代码调整

This commit is contained in:
dong 2022-12-28 15:31:39 +08:00
parent 17398ffb03
commit 19b16deee5

View File

@ -3,7 +3,7 @@
<div class="allSimulationMenu"> <div class="allSimulationMenu">
<div class="simulationMenu" @click="showMenuList">菜单</div> <div class="simulationMenu" @click="showMenuList">菜单</div>
<div v-show="isShowMenuList" class="simulationMenuList"> <div v-show="isShowMenuList" class="simulationMenuList">
<div v-for="(each, index) in autoMenuList" :key="index"> <div v-for="(each, index) in allMenuList" :key="index">
<div v-if="each.show" class="eachSimulationMenu" :class="{'menuDisabled' :each.disabled}" @click="() => { each.disabled? '' : each.click(); }">{{ each.label }}</div> <div v-if="each.show" class="eachSimulationMenu" :class="{'menuDisabled' :each.disabled}" @click="() => { each.disabled? '' : each.click(); }">{{ each.label }}</div>
</div> </div>
</div> </div>
@ -83,21 +83,12 @@ export default {
}, },
mapId() { mapId() {
return this.$route.query.mapId; return this.$route.query.mapId;
},
autoMenuList() {
const list = [];
this.allMenuList.forEach(item => {
const obj = {
...item,
show: item.isShow(),
disabled: item.isDisabled()
};
list.push(obj);
});
return list;
} }
}, },
watch: { watch: {
'$store.state.ibp.moreScreen': function (val) {
this.handleMenuShow();
},
'$store.state.training.simulationUserType': function (val) { '$store.state.training.simulationUserType': function (val) {
this.handleMenuShow(); this.handleMenuShow();
}, },