调整:代码修改
This commit is contained in:
parent
9623c98994
commit
0b5cfcc9a7
@ -28,6 +28,6 @@ export default class TrainBodyBox extends Group {
|
||||
this.add(this.trainBodyBox);
|
||||
}
|
||||
setColor(key, color) {
|
||||
this.train.setStyle(key, color);
|
||||
this.trainBodyBox.setStyle(key, color);
|
||||
}
|
||||
}
|
||||
|
@ -75,42 +75,39 @@ export default {
|
||||
},
|
||||
initMenu() {
|
||||
this.menuNormal = [];
|
||||
let resultCode = this.$route.path.indexOf("/display");
|
||||
if(resultCode === -1){
|
||||
this.stationList.forEach(station => {
|
||||
if (station.code === station.concentrateStationCode) {
|
||||
let node = {
|
||||
label: station.name,
|
||||
children: []
|
||||
}
|
||||
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.visible) {
|
||||
let next = elem;
|
||||
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
|
||||
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
|
||||
}
|
||||
|
||||
if (station.code == next.code) {
|
||||
node.children.push({
|
||||
code: elem.code,
|
||||
label: elem.name,
|
||||
handler: this.mapLocation,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.menuNormal.push(node);
|
||||
}
|
||||
});
|
||||
}
|
||||
// this.stationList.forEach(station => {
|
||||
// if (station.code === station.concentrateStationCode) {
|
||||
// let node = {
|
||||
// label: station.name,
|
||||
// children: []
|
||||
// }
|
||||
//
|
||||
// this.stationList.forEach(elem => {
|
||||
// if (elem.visible) {
|
||||
// let next = elem;
|
||||
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
|
||||
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
|
||||
// }
|
||||
//
|
||||
// if (station.code == next.code) {
|
||||
// node.children.push({
|
||||
// code: elem.code,
|
||||
// label: elem.name,
|
||||
// handler: this.mapLocation,
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
//
|
||||
// this.menuNormal.push(node);
|
||||
// }
|
||||
// });
|
||||
if (this.isScreen) {
|
||||
this.menu = [...this.menuScreen];
|
||||
}
|
||||
else {
|
||||
this.menu = [...this.menuNormal];
|
||||
}
|
||||
// else {
|
||||
// this.menu = [...this.menuNormal];
|
||||
// }
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
|
@ -77,40 +77,40 @@ export default {
|
||||
},
|
||||
initMenu() {
|
||||
this.menuNormal = [];
|
||||
this.stationList.forEach(station => {
|
||||
if (station.code === station.concentrateStationCode) {
|
||||
let node = {
|
||||
label: station.name,
|
||||
children: []
|
||||
}
|
||||
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.visible) {
|
||||
let next = elem;
|
||||
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
|
||||
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
|
||||
}
|
||||
|
||||
if (station.code == next.code) {
|
||||
node.children.push({
|
||||
code: elem.code,
|
||||
label: elem.name,
|
||||
handler: this.mapLocation,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.menuNormal.push(node);
|
||||
}
|
||||
});
|
||||
// this.stationList.forEach(station => {
|
||||
// if (station.code === station.concentrateStationCode) {
|
||||
// let node = {
|
||||
// label: station.name,
|
||||
// children: []
|
||||
// }
|
||||
//
|
||||
// this.stationList.forEach(elem => {
|
||||
// if (elem.visible) {
|
||||
// let next = elem;
|
||||
// while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
|
||||
// next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
|
||||
// }
|
||||
//
|
||||
// if (station.code == next.code) {
|
||||
// node.children.push({
|
||||
// code: elem.code,
|
||||
// label: elem.name,
|
||||
// handler: this.mapLocation,
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
//
|
||||
// this.menuNormal.push(node);
|
||||
// }
|
||||
// });
|
||||
|
||||
if (this.isScreen) {
|
||||
this.menu = [...this.menuScreen];
|
||||
}
|
||||
else {
|
||||
this.menu = [...this.menuNormal];
|
||||
}
|
||||
// else {
|
||||
// this.menu = [...this.menuNormal];
|
||||
// }
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
|
@ -243,7 +243,6 @@ export default {
|
||||
x: em.clientX,
|
||||
y: em.clientY
|
||||
};
|
||||
|
||||
var menu = getDeviceMenuByDeviceType('Cancel');
|
||||
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||
|
@ -16,6 +16,7 @@ import PopMenu from '@/components/PopMenu';
|
||||
import MapEdit from './edit';
|
||||
import MapSaveAs from './saveAs';
|
||||
import MapPublish from './publish';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'MapOperateMenu',
|
||||
@ -42,7 +43,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
menuShow: false,
|
||||
menu: [
|
||||
menuMap: [
|
||||
{
|
||||
label: this.$t('map.updateObj'),
|
||||
handler: this.updateObj
|
||||
@ -87,14 +88,25 @@ export default {
|
||||
label: this.$t('map.jlmap3d'),
|
||||
handler: this.jlmap3d
|
||||
}
|
||||
]
|
||||
],
|
||||
menuNormal:[],
|
||||
menu: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationList'
|
||||
]),
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Map)) {
|
||||
this.menu = [ ...this.menuMap]
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
} else if(this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)){
|
||||
this.initCancelMenu();
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
}else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
@ -187,7 +199,44 @@ export default {
|
||||
},
|
||||
refresh() {
|
||||
this.$emit('refresh');
|
||||
},
|
||||
initCancelMenu() {
|
||||
this.menuNormal = [];
|
||||
this.stationList.forEach(station => {
|
||||
if (station.code === station.concentrateStationCode) {
|
||||
let node = {
|
||||
label: station.name,
|
||||
children: []
|
||||
};
|
||||
|
||||
this.stationList.forEach(elem => {
|
||||
if (elem.visible) {
|
||||
let next = elem;
|
||||
while (next.code != next.concentrateStationCode || !next.concentrateStationCode) {
|
||||
next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode);
|
||||
}
|
||||
|
||||
if (station.code == next.code) {
|
||||
node.children.push({
|
||||
code: elem.code,
|
||||
label: elem.name,
|
||||
handler: this.mapLocation,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.menuNormal.push(node);
|
||||
}
|
||||
});
|
||||
this.menu = [ ...this.menuNormal ]
|
||||
},
|
||||
mapLocation(item) {
|
||||
if (item) {
|
||||
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user