|
@@ -6,12 +6,12 @@
|
|
|
<div
|
|
|
v-for="(item, index) in mapData"
|
|
|
:key="index"
|
|
|
- v-show="open || (!open && mapStore.activeMap === item.key)"
|
|
|
+ v-show="open || (!open && mapStore.activeMap === item.value)"
|
|
|
class="switch-item"
|
|
|
- @click="selectItem(item.key)"
|
|
|
+ @click="selectItem(item.value)"
|
|
|
>
|
|
|
- <div :class="'item-bg1 ' + item.key">
|
|
|
- <div :class="mapStore.activeMap === item.key ? 'item-text bg-active' : 'item-text'">{{ item.name }}</div>
|
|
|
+ <div :class="'item-bg1 ' + item.value">
|
|
|
+ <div :class="mapStore.activeMap === item.value ? 'item-text bg-active' : 'item-text'">{{ item.label }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -28,7 +28,7 @@ const mapStore = useMapStore();
|
|
|
const route = useRoute();
|
|
|
const emits = defineEmits(['switchMap']);
|
|
|
const mapData = computed(() => {
|
|
|
- if (zt_dt.value && mapStore.ztMapList.length > 0) {
|
|
|
+ if (zt_dt.value && zt_dt.value.length > 0 && mapStore.ztMapList && mapStore.ztMapList.length > 0) {
|
|
|
const path = route.path;
|
|
|
let zt = '';
|
|
|
if (path === '/globalMap' || path === '/globalMap2') {
|
|
@@ -36,6 +36,7 @@ const mapData = computed(() => {
|
|
|
} else if (['/index', '/index2', '/emergencyCommandMap', '/emergencyCommandMap2'].includes(path)) {
|
|
|
zt = '一图作战';
|
|
|
}
|
|
|
+ debugger
|
|
|
let res = [];
|
|
|
for (let i = 0; i < mapStore.ztMapList.length; i++) {
|
|
|
if (mapStore.ztMapList[i].zt === zt) {
|