diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue index b9d750bd6..62ba953eb 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/alxeEffective.vue @@ -90,7 +90,6 @@ diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue index d3c3cc73d..c678c7def 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeControl.vue @@ -42,7 +42,6 @@ \ No newline at end of file +}; + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue index c0d256fcc..757a5ba37 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeHandControl.vue @@ -78,265 +78,264 @@ import { mapGetters } from 'vuex'; import { MapDeviceType, OperationEvent, getDomIdByOperation } from '@/scripts/ConstDic'; import ConfirmControl from './childDialog/confirmControl'; -import { mouseCancelState } from '../utils/menuItemStatus'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'RouteHandControl', - components: { - ConfirmControl, - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - selected: null, - tempData: [], - operation: null, - selection: [], - stationName: '', - signalName: '', - allSelect: false - }; - }, - computed: { - ...mapGetters('map', [ - 'signalList' - ]), - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdChoose() { - if (this.dialogShow) { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - return OperationEvent.Signal.humanControl.choose.domId; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - return OperationEvent.Signal.atsAutoControl.choose.domId; - } - } - }, - domIdConfirm() { - return this.dialogShow ? getDomIdByOperation(this.operation) : ''; - }, - title() { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - return '进路交人工控'; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - return '进路交自动控'; - } - }, - commitDisabled() { - let disabled = true; - if (this.selection && this.selection.length) { - disabled = false; - } + name: 'RouteHandControl', + components: { + ConfirmControl, + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + selected: null, + tempData: [], + operation: null, + selection: [], + stationName: '', + signalName: '', + allSelect: false + }; + }, + computed: { + ...mapGetters('map', [ + 'signalList' + ]), + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdChoose() { + if (this.dialogShow) { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + return OperationEvent.Signal.humanControl.choose.domId; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + return OperationEvent.Signal.atsAutoControl.choose.domId; + } + } + }, + domIdConfirm() { + return this.dialogShow ? getDomIdByOperation(this.operation) : ''; + }, + title() { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + return '进路交人工控'; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + return '进路交自动控'; + } + }, + commitDisabled() { + let disabled = true; + if (this.selection && this.selection.length) { + disabled = false; + } - return disabled; - } - }, - watch: { - // 深度数据状态 - tempData: { - handler(val, oldVal) { - this.checkTableDataSelction(val); - }, - deep: true - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected, tempData) { - this.selected = selected; - // 如果不是断点激活,而是第一次显示则初始化 - if (!this.dialogShow) { - this.signalName = ''; - this.stationName = ''; - if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { - this.signalName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } + return disabled; + } + }, + watch: { + // 深度数据状态 + tempData: { + handler(val, oldVal) { + this.checkTableDataSelction(val); + }, + deep: true + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected, tempData) { + this.selected = selected; + // 如果不是断点激活,而是第一次显示则初始化 + if (!this.dialogShow) { + this.signalName = ''; + this.stationName = ''; + if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) { + this.signalName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } - if (tempData && tempData.length > 0) { - tempData.forEach(elem => { - elem.check = false; - elem.disabled = false; - // 设置禁用状态 - if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && + if (tempData && tempData.length > 0) { + tempData.forEach(elem => { + elem.check = false; + elem.disabled = false; + // 设置禁用状态 + if (operate.operation === OperationEvent.Signal.humanControl.menu.operation && elem.controlType != '01') { - elem.disabled = true; - } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && + elem.disabled = true; + } if (operate.operation === OperationEvent.Signal.atsAutoControl.menu.operation && elem.controlType == '01') { - elem.disabled = true; - } - }); - } + elem.disabled = true; + } + }); + } - this.tempData = tempData || []; - this.operation = operate.operation; - } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$refs.tempTable.setCurrentRow(); - this.$store.dispatch('training/emitTipFresh'); - mouseCancelState(this.selected); - }, - checkTableDataSelction(data) { - const selection = []; - if (data && data.length > 0) { - data.forEach(row => { - if (row.check && !row.disabled) { - selection.push(row); - } - }); - } + this.tempData = tempData || []; + this.operation = operate.operation; + } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$refs.tempTable.setCurrentRow(); + this.$store.dispatch('training/emitTipFresh'); + this.mouseCancelState(this.selected); + }, + checkTableDataSelction(data) { + const selection = []; + if (data && data.length > 0) { + data.forEach(row => { + if (row.check && !row.disabled) { + selection.push(row); + } + }); + } - if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { - this.handleChooseChange(selection); - this.selection = selection; - } - let num = 0; - this.allSelect = false; - this.tempData.forEach(item => { - if (item.check) { - num++; - if (num == this.tempData.length) { - this.allSelect = true; - } - } - }); - }, - allSelectChange() { - if (this.allSelect) { - this.tempData.forEach(item => { - if (!item.disabled) { - item.check = true; - } - }); - } else { - this.tempData.forEach(item => { - if (!item.disabled) { - item.check = false; - } - }); - } - }, - serializeCodeListWithSeparator(sep) { - const codeList = []; - if (this.selection && this.selection.length) { - this.selection.forEach(elem => { - codeList.push(elem.code); - }); - } - return codeList.join(sep); - }, - handleChooseChange(selection) { - this.selection = selection; - if (selection && selection.length) { - const operate = { - repeat: true, - type: MapDeviceType.Signal.type, - operation: '', - val: this.serializeCodeListWithSeparator('::'), - selection: selection - }; + if (JSON.stringify(selection) !== JSON.stringify(this.selection)) { + this.handleChooseChange(selection); + this.selection = selection; + } + let num = 0; + this.allSelect = false; + this.tempData.forEach(item => { + if (item.check) { + num++; + if (num == this.tempData.length) { + this.allSelect = true; + } + } + }); + }, + allSelectChange() { + if (this.allSelect) { + this.tempData.forEach(item => { + if (!item.disabled) { + item.check = true; + } + }); + } else { + this.tempData.forEach(item => { + if (!item.disabled) { + item.check = false; + } + }); + } + }, + serializeCodeListWithSeparator(sep) { + const codeList = []; + if (this.selection && this.selection.length) { + this.selection.forEach(elem => { + codeList.push(elem.code); + }); + } + return codeList.join(sep); + }, + handleChooseChange(selection) { + this.selection = selection; + if (selection && selection.length) { + const operate = { + repeat: true, + type: MapDeviceType.Signal.type, + operation: '', + val: this.serializeCodeListWithSeparator('::'), + selection: selection + }; - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - /** 进路交人工控*/ - operate.operation = OperationEvent.Signal.humanControl.choose.operation; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - /** 进路交自动控*/ - operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation; - } + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + /** 进路交人工控*/ + operate.operation = OperationEvent.Signal.humanControl.choose.operation; + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + /** 进路交自动控*/ + operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation; + } - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - } else if (!selection) { - this.$messageBox(`请选择一条数据`); - } - }, - commit() { - if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - /** 进路交人工控*/ - this.humanControl(); - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - /** 进路交自动控*/ - this.atsAutoControl(); - } - }, - // 进路交人工控 - humanControl() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.humanControl.menu.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + } else if (!selection) { + this.$messageBox(`请选择一条数据`); + } + }, + commit() { + if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { + /** 进路交人工控*/ + this.humanControl(); + } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { + /** 进路交自动控*/ + this.atsAutoControl(); + } + }, + // 进路交人工控 + humanControl() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.humanControl.menu.operation + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.doClose(); - } - }).catch(error => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 进路交自动控 - atsAutoControl() { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.atsAutoControl.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.loading = false; + if (valid) { + this.doClose(); + } + }).catch(error => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 进路交自动控 + atsAutoControl() { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.atsAutoControl.menu.operation + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.doClose(); - } - }).catch(error => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Command.cancel.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.loading = false; + if (valid) { + this.doClose(); + } + }).catch(error => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(error => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(error => { + this.doClose(); + }); + } + } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeLock.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeLock.vue index 51c936cf6..cb44c2684 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeLock.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeLock.vue @@ -1,157 +1,170 @@ \ No newline at end of file +}; + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue index b0e861631..b4cc77bda 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue @@ -34,7 +34,6 @@ \ No newline at end of file +}; + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/standBulkBuckleTrain.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/standBulkBuckleTrain.vue index d98193e6b..d75c8fc3c 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/standBulkBuckleTrain.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/standBulkBuckleTrain.vue @@ -35,7 +35,6 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/stationSetRouteControlAll.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/stationSetRouteControlAll.vue index b2079626d..61ae8dab8 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/stationSetRouteControlAll.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/stationSetRouteControlAll.vue @@ -1,133 +1,141 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/switchCmdControl.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/switchCmdControl.vue index 15ab47bc7..e9339584b 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/switchCmdControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/switchCmdControl.vue @@ -60,7 +60,6 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainCreate.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainCreate.vue index 7b7e290eb..b5ca7b901 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainCreate.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainCreate.vue @@ -43,7 +43,6 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainDelete.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainDelete.vue index 2ac382127..9d969581d 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainDelete.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainDelete.vue @@ -32,138 +32,137 @@ import { mapGetters } from 'vuex'; import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; // import { getPublishMapTrainNos } from '@/api/runplan'; -import { mouseCancelState } from '../utils/menuItemStatus'; import ConfirmControl from './childDialog/confirmControl'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'TrainDelete', - components: { - ConfirmControl, - NoticeInfo - }, - data() { - return { - trainNoList: [], - selected: null, - addModel: { - groupNumber: '' - }, + name: 'TrainDelete', + components: { + ConfirmControl, + NoticeInfo + }, + data() { + return { + trainNoList: [], + selected: null, + addModel: { + groupNumber: '' + }, - rules: { - groupNumber: [ - { required: true, message: '请输入车组号', trigger: 'blur' } - ] - }, - operation: null, - dialogShow: false, - loading: false - }; - }, - computed: { - ...mapGetters('map', [ - 'map' - ]), - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdInput() { - return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : ''; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; - }, - title() { - return '删除车组号'; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - loadInitData(map) { - if (map) { - // getPublishMapTrainNos(map.skinCode).then(response => { - // this.trainNoList = response.data; - // }).catch(() => { - // this.$messageBox(`获取列车车组号失败`); - // }); - } - }, - doShow(operate, selected) { - this.selected = selected; - // 如果不是断点激活,则需要对初始值进行初始化 - if (!this.dialogShow) { - this.operation = operate.operation; - } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.loading = false; - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - this.$store.dispatch('map/setTrainWindowShow', false); - mouseCancelState(this.selected); - }, - inputGroupNumber() { - const operate = { - type: MapDeviceType.Train.type, - operation: OperationEvent.Train.delTrainId.input.operation, - val: this.addModel.groupNumber - }; + rules: { + groupNumber: [ + { required: true, message: '请输入车组号', trigger: 'blur' } + ] + }, + operation: null, + dialogShow: false, + loading: false + }; + }, + computed: { + ...mapGetters('map', [ + 'map' + ]), + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdInput() { + return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : ''; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : ''; + }, + title() { + return '删除车组号'; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + loadInitData(map) { + if (map) { + // getPublishMapTrainNos(map.skinCode).then(response => { + // this.trainNoList = response.data; + // }).catch(() => { + // this.$messageBox(`获取列车车组号失败`); + // }); + } + }, + doShow(operate, selected) { + this.selected = selected; + // 如果不是断点激活,则需要对初始值进行初始化 + if (!this.dialogShow) { + this.operation = operate.operation; + } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.loading = false; + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + this.$store.dispatch('map/setTrainWindowShow', false); + this.mouseCancelState(this.selected); + }, + inputGroupNumber() { + const operate = { + type: MapDeviceType.Train.type, + operation: OperationEvent.Train.delTrainId.input.operation, + val: this.addModel.groupNumber + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - }, - commit() { - this.$refs['form'].validate((valid) => { - if (valid) { - const operate = { - send: true, - type: MapDeviceType.Train.type, - operation: OperationEvent.Train.delTrainId.menu.operation, - val: this.addModel.groupNumber - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + }, + commit() { + this.$refs['form'].validate((valid) => { + if (valid) { + const operate = { + send: true, + type: MapDeviceType.Train.type, + operation: OperationEvent.Train.delTrainId.menu.operation, + val: this.addModel.groupNumber + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.doClose(); - } - }).catch(() => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - } else { - return false; - } - }); - }, - cancel() { - const operate = { - type: MapDeviceType.Train.type, - operation: OperationEvent.Command.cancel.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.loading = false; + if (valid) { + this.doClose(); + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + } else { + return false; + } + }); + }, + cancel() { + const operate = { + type: MapDeviceType.Train.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(() => { this.doClose(); }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { this.doClose(); }); + } + } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainEdit.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainEdit.vue index 5c7837af2..3f663a94a 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainEdit.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainEdit.vue @@ -1,160 +1,168 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainFlag.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainFlag.vue index b09756e32..a0fe79a5e 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainFlag.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainFlag.vue @@ -1,139 +1,147 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainMove.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainMove.vue index 031dce18a..b2118d71c 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainMove.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainMove.vue @@ -1,160 +1,168 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue index 9dec09865..6311939e1 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetPlan.vue @@ -1,144 +1,152 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue index e4f713c7a..4a22bde2d 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainSetWork.vue @@ -1,144 +1,152 @@ \ No newline at end of file + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuBar.vue b/src/jmapNew/theme/ningbo_01/menus/menuBar.vue index 221e19047..b081c6b8b 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuBar.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuBar.vue @@ -119,951 +119,951 @@ import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { EventBus } from '@/scripts/event-bus'; export default { - name: 'MenuBar', - components: { - NoticeInfo, - StationControl, - DetainTrainContorl, - DetainTrainContorlUpDown, - ViewTrainId, - ViewName, - ViewDevice, - TrainAdd, - TrainTranstalet, - TrainDelete, - ManageUser, - HelpAbout - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - classA: -1, - classB: -1, - tempClassA: -1, - tempClassB: -1, - valid: true, - menu: [], - menuNormal: { - local: [ - { - title: '系统', - operate: OperationEvent.Command.mBar.system, - children: [ - { - title: '登录', - click: this.undeveloped - }, - { - title: '注销', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '站遥控', - operate: OperationEvent.MixinCommand.remoteControl.mbar, - click: this.stationRemoteControl - }, - { - title: '区域选择', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '连接主用中心', - click: this.undeveloped - }, - { - title: '连接备用中心', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '退出', - click: this.undeveloped - } - ] - }, - { - title: '查看', - operate: OperationEvent.Command.mBar.check, - children: [ - { - title: '运行图', - click: this.undeveloped - }, - { - title: '报告分析', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '视图', - click: this.undeveloped, - operate: '', - children: [{ - title: '报警', - click: this.undeveloped - }, - { - title: '列车运行信息', - click: this.undeveloped - }, - { - title: '设备状态', - click: this.undeveloped - }, - { - title: '列车详细信息', - click: this.undeveloped - }, - { - title: '站台详细信息', - click: this.undeveloped - }] - }, - { - title: '终端站发车列表', - click: this.undeveloped - }, - { - title: '详细设备状态', - click: this.undeveloped - }, - { - title: '查找列车', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示目的地号', - click: this.undeveloped - }, - { - title: '显示轨道名', - click: this.undeveloped - }, - { - title: '显示道岔名', - click: this.undeveloped - }, - { - title: '显示信号机名', - click: this.undeveloped - }, - { - title: '显示车次窗位置', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示车次号', - click: this.undeveloped - }, - { - title: '显示车组号', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '全屏', - click: this.undeveloped - }, - { - title: '放大', - click: this.undeveloped - }, - { - title: '缩小', - click: this.undeveloped - }, - { - title: '恢复', - click: this.undeveloped - } - ] - }, - { - title: '车站定位', - operate: '', - children: [ - ] - }, - { - title: '显示', - operate: OperationEvent.Command.mBar.view, - hide: true, - children: [ - { - title: '设置列车识别号显示', - click: this.setTrainIdDisplay, - operate: OperationEvent.Command.view.setTrainIdDisplay - }, - { - title: '设置名称显示', - click: this.setNameDisplay, - operate: OperationEvent.Command.view.setNameDisplay - }, - { - title: '设置设备显示', - click: this.setDeviceDisplay, - operate: OperationEvent.Command.view.setDeviceDisplay - } - ] - }, - { - title: 'ATS终端操作', - operate: '', - children: [ - { - title: '当天运行车计划', - click: this.undeveloped - }, - { - title: '出入库预告', - click: this.undeveloped - } - ] - }, - { - title: '计划车操作', - operate: '', - children: [ - { - title: '添加计划车', - click: this.undeveloped - }, - { - title: '平移计划车', - click: this.undeveloped - }, - { - title: '删除计划车', - click: this.undeveloped - } - ] - }, - { - title: '批处理命令', - operate: OperationEvent.Command.mBar.detainControl, - children: [ - { - title: '全线扣车', - operate: OperationEvent.StationStand.setDetainTrainAll.mbar, - click: this.setDetainTrainAll - }, - { - title: '取消全线扣车', - operate: OperationEvent.StationStand.cancelDetainTrainAll.mbar, - click: this.cancelDetainTrainAll - }, - { - title: '取消上行全线扣车', - operate: OperationEvent.StationStand.cancelUpDetainTrainAll.mbar, - click: this.cancelUpDetainTrainAll - }, - { - title: '取消下行全线扣车', - operate: OperationEvent.StationStand.cancelDownDetainTrainAll.mbar, - click: this.cancelDownDetainTrainAll - } - ] - }, - { - title: '信息管理', - operate: '', - children: [ - { - title: '调度日志', - click: this.undeveloped - }, - { - title: '调度留言提醒', - click: this.undeveloped - }, - { - title: '报警设置', - click: this.undeveloped - } - ] - }, - { - title: '帮助', - children: [ - { - title: '关于ITS GPC 工作站', - click: this.about, - operate: OperationEvent.Command.help.about - } - ] - } - ], - central: [ - { - title: '系统', - operate: OperationEvent.Command.mBar.system, - children: [ - { - title: '登录', - click: this.undeveloped - }, - { - title: '注销', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '站遥控', - operate: OperationEvent.MixinCommand.remoteControl.mbar, - click: this.stationRemoteControl - }, - { - title: '区域选择', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '连接主用中心', - click: this.undeveloped - }, - { - title: '连接备用中心', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '退出', - click: this.undeveloped - } - ] - }, - { - title: '查看', - operate: OperationEvent.Command.mBar.check, - children: [ - { - title: '运行图', - click: this.undeveloped - }, - { - title: '报告分析', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '视图', - click: this.undeveloped, - operate: '', - children: [{ - title: '报警', - click: this.undeveloped - }, - { - title: '列车运行信息', - click: this.undeveloped - }, - { - title: '设备状态', - click: this.undeveloped - }, - { - title: '列车详细信息', - click: this.undeveloped - }, - { - title: '站台详细信息', - click: this.undeveloped - }] - }, - { - title: '终端站发车列表', - click: this.undeveloped - }, - { - title: '详细设备状态', - click: this.undeveloped - }, - { - title: '查找列车', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示目的地号', - click: this.undeveloped - }, - { - title: '显示轨道名', - click: this.undeveloped - }, - { - title: '显示道岔名', - click: this.undeveloped - }, - { - title: '显示信号机名', - click: this.undeveloped - }, - { - title: '显示车次窗位置', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '显示车次号', - click: this.undeveloped - }, - { - title: '显示车组号', - click: this.undeveloped - }, - { - type: 'separator' - }, - { - title: '全屏', - click: this.undeveloped - }, - { - title: '放大', - click: this.undeveloped - }, - { - title: '缩小', - click: this.undeveloped - }, - { - title: '恢复', - click: this.undeveloped - } - ] - }, - { - title: '车站定位', - operate: '', - children: [ - ] - }, - { - title: '显示', - operate: OperationEvent.Command.mBar.view, - hide: true, - children: [ - { - title: '设置列车识别号显示', - click: this.setTrainIdDisplay, - operate: OperationEvent.Command.view.setTrainIdDisplay - }, - { - title: '设置名称显示', - click: this.setNameDisplay, - operate: OperationEvent.Command.view.setNameDisplay - }, - { - title: '设置设备显示', - click: this.setDeviceDisplay, - operate: OperationEvent.Command.view.setDeviceDisplay - } - ] - }, - { - title: 'ATS终端操作', - operate: '', - children: [ - { - title: '当天运行车计划', - click: this.undeveloped - }, - { - title: '出入库预告', - click: this.undeveloped - } - ] - }, - { - title: '计划车操作', - operate: '', - children: [ - { - title: '添加计划车', - click: this.undeveloped - }, - { - title: '平移计划车', - click: this.undeveloped - }, - { - title: '删除计划车', - click: this.undeveloped - } - ] - }, - { - title: '批处理命令', - operate: OperationEvent.Command.mBar.detainControl, - children: [ - { - title: '全线扣车', - operate: OperationEvent.StationStand.setDetainTrainAll.mbar, - click: this.setDetainTrainAll - }, - { - title: '取消全线扣车', - operate: OperationEvent.StationStand.cancelDetainTrainAll.mbar, - click: this.cancelDetainTrainAll - }, - { - title: '取消上行全线扣车', - operate: OperationEvent.StationStand.cancelUpDetainTrainAll.mbar, - click: this.cancelUpDetainTrainAll - }, - { - title: '取消下行全线扣车', - operate: OperationEvent.StationStand.cancelDownDetainTrainAll.mbar, - click: this.cancelDownDetainTrainAll - } - ] - }, - { - title: '信息管理', - operate: '', - children: [ - { - title: '调度日志', - click: this.undeveloped - }, - { - title: '调度留言提醒', - click: this.undeveloped - }, - { - title: '报警设置', - click: this.undeveloped - } - ] - }, - { - title: '帮助', - children: [ - { - title: '关于ITS GPC 工作站', - click: this.about, - operate: OperationEvent.Command.help.about - } - ] - } - ] - } - }; - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'started', - 'steps', - 'order', - 'mode' - ]), - ...mapGetters('map', [ - 'stationList' - ]) - }, - watch: { - tempClassA() { - this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA; - }, - tempClassB() { - this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB; - }, - '$store.state.menuOperation.break': function (val) { - if (val) { - this.classA = this.classB = -1; - } else { - this.classA = this.tempClassA; - this.classB = this.tempClassB; - } - }, - '$store.state.training.operatemode': function (mode) { - this.initMenu(); - }, - '$store.state.training.started': function (val) { - this.closeMenu(true); - }, - '$store.state.training.prdType': function () { - this.initMenu(); - } - }, - mounted() { - this.initMenu(); - }, - methods: { - handleShow(item) { - if (item.hide) { - return false; - } - return true; - }, - initStationList() { - const list = []; - this.stationList.forEach(station => { - if (station.visible) { - const node = { - title: station.name, - operate: station.code, - show: true, - click: this.mapLocation, - code: station.code - }; + name: 'MenuBar', + components: { + NoticeInfo, + StationControl, + DetainTrainContorl, + DetainTrainContorlUpDown, + ViewTrainId, + ViewName, + ViewDevice, + TrainAdd, + TrainTranstalet, + TrainDelete, + ManageUser, + HelpAbout + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + classA: -1, + classB: -1, + tempClassA: -1, + tempClassB: -1, + valid: true, + menu: [], + menuNormal: { + local: [ + { + title: '系统', + operate: OperationEvent.Command.mBar.system, + children: [ + { + title: '登录', + click: this.undeveloped + }, + { + title: '注销', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '站遥控', + operate: OperationEvent.MixinCommand.remoteControl.mbar, + click: this.stationRemoteControl + }, + { + title: '区域选择', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '连接主用中心', + click: this.undeveloped + }, + { + title: '连接备用中心', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '退出', + click: this.undeveloped + } + ] + }, + { + title: '查看', + operate: OperationEvent.Command.mBar.check, + children: [ + { + title: '运行图', + click: this.undeveloped + }, + { + title: '报告分析', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '视图', + click: this.undeveloped, + operate: '', + children: [{ + title: '报警', + click: this.undeveloped + }, + { + title: '列车运行信息', + click: this.undeveloped + }, + { + title: '设备状态', + click: this.undeveloped + }, + { + title: '列车详细信息', + click: this.undeveloped + }, + { + title: '站台详细信息', + click: this.undeveloped + }] + }, + { + title: '终端站发车列表', + click: this.undeveloped + }, + { + title: '详细设备状态', + click: this.undeveloped + }, + { + title: '查找列车', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示目的地号', + click: this.undeveloped + }, + { + title: '显示轨道名', + click: this.undeveloped + }, + { + title: '显示道岔名', + click: this.undeveloped + }, + { + title: '显示信号机名', + click: this.undeveloped + }, + { + title: '显示车次窗位置', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示车次号', + click: this.undeveloped + }, + { + title: '显示车组号', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '全屏', + click: this.undeveloped + }, + { + title: '放大', + click: this.undeveloped + }, + { + title: '缩小', + click: this.undeveloped + }, + { + title: '恢复', + click: this.undeveloped + } + ] + }, + { + title: '车站定位', + operate: '', + children: [ + ] + }, + { + title: '显示', + operate: OperationEvent.Command.mBar.view, + hide: true, + children: [ + { + title: '设置列车识别号显示', + click: this.setTrainIdDisplay, + operate: OperationEvent.Command.view.setTrainIdDisplay + }, + { + title: '设置名称显示', + click: this.setNameDisplay, + operate: OperationEvent.Command.view.setNameDisplay + }, + { + title: '设置设备显示', + click: this.setDeviceDisplay, + operate: OperationEvent.Command.view.setDeviceDisplay + } + ] + }, + { + title: 'ATS终端操作', + operate: '', + children: [ + { + title: '当天运行车计划', + click: this.undeveloped + }, + { + title: '出入库预告', + click: this.undeveloped + } + ] + }, + { + title: '计划车操作', + operate: '', + children: [ + { + title: '添加计划车', + click: this.undeveloped + }, + { + title: '平移计划车', + click: this.undeveloped + }, + { + title: '删除计划车', + click: this.undeveloped + } + ] + }, + { + title: '批处理命令', + operate: OperationEvent.Command.mBar.detainControl, + children: [ + { + title: '全线扣车', + operate: OperationEvent.StationStand.setDetainTrainAll.mbar, + click: this.setDetainTrainAll + }, + { + title: '取消全线扣车', + operate: OperationEvent.StationStand.cancelDetainTrainAll.mbar, + click: this.cancelDetainTrainAll + }, + { + title: '取消上行全线扣车', + operate: OperationEvent.StationStand.cancelUpDetainTrainAll.mbar, + click: this.cancelUpDetainTrainAll + }, + { + title: '取消下行全线扣车', + operate: OperationEvent.StationStand.cancelDownDetainTrainAll.mbar, + click: this.cancelDownDetainTrainAll + } + ] + }, + { + title: '信息管理', + operate: '', + children: [ + { + title: '调度日志', + click: this.undeveloped + }, + { + title: '调度留言提醒', + click: this.undeveloped + }, + { + title: '报警设置', + click: this.undeveloped + } + ] + }, + { + title: '帮助', + children: [ + { + title: '关于ITS GPC 工作站', + click: this.about, + operate: OperationEvent.Command.help.about + } + ] + } + ], + central: [ + { + title: '系统', + operate: OperationEvent.Command.mBar.system, + children: [ + { + title: '登录', + click: this.undeveloped + }, + { + title: '注销', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '站遥控', + operate: OperationEvent.MixinCommand.remoteControl.mbar, + click: this.stationRemoteControl + }, + { + title: '区域选择', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '连接主用中心', + click: this.undeveloped + }, + { + title: '连接备用中心', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '退出', + click: this.undeveloped + } + ] + }, + { + title: '查看', + operate: OperationEvent.Command.mBar.check, + children: [ + { + title: '运行图', + click: this.undeveloped + }, + { + title: '报告分析', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '视图', + click: this.undeveloped, + operate: '', + children: [{ + title: '报警', + click: this.undeveloped + }, + { + title: '列车运行信息', + click: this.undeveloped + }, + { + title: '设备状态', + click: this.undeveloped + }, + { + title: '列车详细信息', + click: this.undeveloped + }, + { + title: '站台详细信息', + click: this.undeveloped + }] + }, + { + title: '终端站发车列表', + click: this.undeveloped + }, + { + title: '详细设备状态', + click: this.undeveloped + }, + { + title: '查找列车', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示目的地号', + click: this.undeveloped + }, + { + title: '显示轨道名', + click: this.undeveloped + }, + { + title: '显示道岔名', + click: this.undeveloped + }, + { + title: '显示信号机名', + click: this.undeveloped + }, + { + title: '显示车次窗位置', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '显示车次号', + click: this.undeveloped + }, + { + title: '显示车组号', + click: this.undeveloped + }, + { + type: 'separator' + }, + { + title: '全屏', + click: this.undeveloped + }, + { + title: '放大', + click: this.undeveloped + }, + { + title: '缩小', + click: this.undeveloped + }, + { + title: '恢复', + click: this.undeveloped + } + ] + }, + { + title: '车站定位', + operate: '', + children: [ + ] + }, + { + title: '显示', + operate: OperationEvent.Command.mBar.view, + hide: true, + children: [ + { + title: '设置列车识别号显示', + click: this.setTrainIdDisplay, + operate: OperationEvent.Command.view.setTrainIdDisplay + }, + { + title: '设置名称显示', + click: this.setNameDisplay, + operate: OperationEvent.Command.view.setNameDisplay + }, + { + title: '设置设备显示', + click: this.setDeviceDisplay, + operate: OperationEvent.Command.view.setDeviceDisplay + } + ] + }, + { + title: 'ATS终端操作', + operate: '', + children: [ + { + title: '当天运行车计划', + click: this.undeveloped + }, + { + title: '出入库预告', + click: this.undeveloped + } + ] + }, + { + title: '计划车操作', + operate: '', + children: [ + { + title: '添加计划车', + click: this.undeveloped + }, + { + title: '平移计划车', + click: this.undeveloped + }, + { + title: '删除计划车', + click: this.undeveloped + } + ] + }, + { + title: '批处理命令', + operate: OperationEvent.Command.mBar.detainControl, + children: [ + { + title: '全线扣车', + operate: OperationEvent.StationStand.setDetainTrainAll.mbar, + click: this.setDetainTrainAll + }, + { + title: '取消全线扣车', + operate: OperationEvent.StationStand.cancelDetainTrainAll.mbar, + click: this.cancelDetainTrainAll + }, + { + title: '取消上行全线扣车', + operate: OperationEvent.StationStand.cancelUpDetainTrainAll.mbar, + click: this.cancelUpDetainTrainAll + }, + { + title: '取消下行全线扣车', + operate: OperationEvent.StationStand.cancelDownDetainTrainAll.mbar, + click: this.cancelDownDetainTrainAll + } + ] + }, + { + title: '信息管理', + operate: '', + children: [ + { + title: '调度日志', + click: this.undeveloped + }, + { + title: '调度留言提醒', + click: this.undeveloped + }, + { + title: '报警设置', + click: this.undeveloped + } + ] + }, + { + title: '帮助', + children: [ + { + title: '关于ITS GPC 工作站', + click: this.about, + operate: OperationEvent.Command.help.about + } + ] + } + ] + } + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'started', + 'steps', + 'order', + 'mode' + ]), + ...mapGetters('map', [ + 'stationList' + ]) + }, + watch: { + tempClassA() { + this.classA = this.$store.state.menuOperation.break ? -1 : this.tempClassA; + }, + tempClassB() { + this.classB = this.$store.state.menuOperation.break ? -1 : this.tempClassB; + }, + '$store.state.menuOperation.break': function (val) { + if (val) { + this.classA = this.classB = -1; + } else { + this.classA = this.tempClassA; + this.classB = this.tempClassB; + } + }, + '$store.state.training.operatemode': function (mode) { + this.initMenu(); + }, + '$store.state.training.started': function (val) { + this.closeMenu(true); + }, + '$store.state.training.prdType': function () { + this.initMenu(); + } + }, + mounted() { + this.initMenu(); + }, + methods: { + handleShow(item) { + if (item.hide) { + return false; + } + return true; + }, + initStationList() { + const list = []; + this.stationList.forEach(station => { + if (station.visible) { + const node = { + title: station.name, + operate: station.code, + show: true, + click: this.mapLocation, + code: station.code + }; - list.push(node); - } - }); - return list; - }, - initMenu(menu) { - this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode); - if (this.menu[2]) { - this.menu[2].children = this.initStationList(); - } - this.clickEvent(); - this.closeMenu(true); - }, - clickEvent() { - const self = this; - window.onclick = function (e) { - if (document.getElementById('menuBar')) { - self.closeMenu(false); - } - }; - }, - getDomId(item) { - if (item && item.operate) { - return item.operate.domId; - } - return ''; - }, - noShowingChildren(children) { - if (!children || children.length <= 0) { - return true; - } - return false; - }, - hasShowingChildren(children) { - if (children && children.length > 0) { - return true; - } - return false; - }, - closeMenu(flag) { - if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) { - this.classA = this.tempClassA = -1; - this.classB = this.tempClassB = -1; - } - }, - hookClick(item, event) { - this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); - if (item && typeof item.click == 'function') { - item.click(item.operate); - } - }, - selectedClassA(item, index) { - const order = this.order || 0; - if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 - this.popupMenuA(item, index); - } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 - this.popupMenuA(item, index); - } - }, - // 弹出顶部菜单操作 - popupMenuA(item, index) { - this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); - this.clickEvent(); - const operate = { - type: 'bar', - operation: item.operate.operation - }; - this.tempClassA = index; - this.tempClassB = -1; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - }, - selectedClassB(item, index) { - const order = this.order || 0; - if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 - this.popupMenuB(item, index); - } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 - this.popupMenuB(item, index); - } - }, - popupMenuB(item, index) { - this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); - const operate = { - type: 'bar', - operation: item.operate.operation - }; - this.tempClassB = index; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - }, - // 设置地图定位 - mapLocation(code) { - if (code) { - this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: code }); - this.closeMenu(true); - } - }, - // 站遥控 - stationRemoteControl(order) { - const operate = { - type: 'bar', - operation: order.operation - }; + list.push(node); + } + }); + return list; + }, + initMenu(menu) { + this.menu = menuBarConvert(this.menuNormal[SystemType[this.$store.state.training.prdType]], this.$store.state.training.operatemode); + if (this.menu[2]) { + this.menu[2].children = this.initStationList(); + } + this.clickEvent(); + this.closeMenu(true); + }, + clickEvent() { + const self = this; + window.onclick = function (e) { + if (document.getElementById('menuBar')) { + self.closeMenu(false); + } + }; + }, + getDomId(item) { + if (item && item.operate) { + return item.operate.domId; + } + return ''; + }, + noShowingChildren(children) { + if (!children || children.length <= 0) { + return true; + } + return false; + }, + hasShowingChildren(children) { + if (children && children.length > 0) { + return true; + } + return false; + }, + closeMenu(flag) { + if (flag || (this.mode !== TrainingMode.EDIT && this.mode !== TrainingMode.TEACH)) { + this.classA = this.tempClassA = -1; + this.classB = this.tempClassB = -1; + } + }, + hookClick(item, event) { + this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); + if (item && typeof item.click == 'function') { + item.click(item.operate); + } + }, + selectedClassA(item, index) { + const order = this.order || 0; + if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 + this.popupMenuA(item, index); + } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 + this.popupMenuA(item, index); + } + }, + // 弹出顶部菜单操作 + popupMenuA(item, index) { + this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); + this.clickEvent(); + const operate = { + type: 'bar', + operation: item.operate.operation + }; + this.tempClassA = index; + this.tempClassB = -1; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + }, + selectedClassB(item, index) { + const order = this.order || 0; + if (this.mode !== TrainingMode.TEACH) { // 编辑模式下可显示 + this.popupMenuB(item, index); + } else if (this.steps[order] && this.steps[order].type == 'bar') { // 操作步骤没有顶部操作顶部菜单都不可显示 + this.popupMenuB(item, index); + } + }, + popupMenuB(item, index) { + this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); + const operate = { + type: 'bar', + operation: item.operate.operation + }; + this.tempClassB = index; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + }, + // 设置地图定位 + mapLocation(code) { + if (code) { + this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: code }); + this.closeMenu(true); + } + }, + // 站遥控 + stationRemoteControl(order) { + const operate = { + type: 'bar', + operation: order.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.stationControl.doShow(operate); - } - }); - }, - // 设置全线扣车 - setDetainTrainAll(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.detainTrainContorl.doShow(operate); - } - }); - }, - // 取消全线扣车 - cancelDetainTrainAll(order) { - const operate = { - type: 'bar', - operation: order.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.stationControl.doShow(operate); + } + }); + }, + // 设置全线扣车 + setDetainTrainAll(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.detainTrainContorl.doShow(operate); + } + }); + }, + // 取消全线扣车 + cancelDetainTrainAll(order) { + const operate = { + type: 'bar', + operation: order.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.detainTrainContorl.doShow(operate); - } - }); - }, - // 取消上行扣车 - cancelUpDetainTrainAll(order) { - const operate = { - type: 'bar', - operation: order.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.detainTrainContorl.doShow(operate); + } + }); + }, + // 取消上行扣车 + cancelUpDetainTrainAll(order) { + const operate = { + type: 'bar', + operation: order.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.detainTrainContorlUpDown.doShow(operate); - } - }); - }, - // 取消下行扣车 - cancelDownDetainTrainAll(order) { - const operate = { - type: 'bar', - operation: order.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.detainTrainContorlUpDown.doShow(operate); + } + }); + }, + // 取消下行扣车 + cancelDownDetainTrainAll(order) { + const operate = { + type: 'bar', + operation: order.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.detainTrainContorlUpDown.doShow(operate); - } - }); - }, - // 设置列车识别号显示 - setTrainIdDisplay(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.viewTrainId.doShow(operate); - } - }); - }, - // 设置设备显示 - setNameDisplay(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.viewName.doShow(operate); - } - }); - }, - // 设置名称显示 - setDeviceDisplay(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.viewDevice.doShow(operate); - } - }); - }, - // 添加计划车 - addPlanTrain(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainAdd.doShow(operate); - } - }); - }, - // 平移计划车 - translatPlanTrain(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainTranstalet.doShow(operate); - } - }); - }, - // 删除计划车 - delPlanTrain(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDelete.doShow(operate); - } - }); - }, - // 用户管理 - userManage(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.manageUser.doShow(operate); - } - }); - }, - // 关于 - about(order) { - const operate = { - type: 'bar', - operation: order.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.closeMenu(true); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.helpAbout.doShow(operate); - } - }); - }, - // 刷新 - refresh() { - this.closeMenu(true); - EventBus.$emit('refresh'); - }, - getLoginResult(operate) { - /** 密码校验*/ - if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) { - if (operate.success) { - /** 校验成功*/ - this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation }); - } - } - }, - undeveloped() { - this.doClose(); - this.$alert('实现中......', '提示', { - confirmButtonText: '确定', - callback: action => { - } - }); - }, - doClose() { - this.$nextTick(() => { - EventBus.$emit('closeMenu'); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.detainTrainContorlUpDown.doShow(operate); + } + }); + }, + // 设置列车识别号显示 + setTrainIdDisplay(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.viewTrainId.doShow(operate); + } + }); + }, + // 设置设备显示 + setNameDisplay(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.viewName.doShow(operate); + } + }); + }, + // 设置名称显示 + setDeviceDisplay(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.viewDevice.doShow(operate); + } + }); + }, + // 添加计划车 + addPlanTrain(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainAdd.doShow(operate); + } + }); + }, + // 平移计划车 + translatPlanTrain(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainTranstalet.doShow(operate); + } + }); + }, + // 删除计划车 + delPlanTrain(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainDelete.doShow(operate); + } + }); + }, + // 用户管理 + userManage(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.manageUser.doShow(operate); + } + }); + }, + // 关于 + about(order) { + const operate = { + type: 'bar', + operation: order.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.closeMenu(true); + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.helpAbout.doShow(operate); + } + }); + }, + // 刷新 + refresh() { + this.closeMenu(true); + EventBus.$emit('refresh'); + }, + getLoginResult(operate) { + /** 密码校验*/ + if (operate.operation == OperationEvent.StationControl.forcedStationControl.passwordConfirm.operation) { + if (operate.success) { + /** 校验成功*/ + this.$refs.stationControlConvert.doShow({ operation: OperationEvent.StationControl.forcedStationControl.mbar.operation }); + } + } + }, + undeveloped() { + this.doClose(); + this.$alert('实现中......', '提示', { + confirmButtonText: '确定', + callback: action => { + } + }); + }, + doClose() { + this.$nextTick(() => { + EventBus.$emit('closeMenu'); + }); + } + } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/menuLimit.vue b/src/jmapNew/theme/ningbo_01/menus/menuLimit.vue index 21f957938..c1e1b60d1 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuLimit.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuLimit.vue @@ -11,7 +11,6 @@ import CancelAllLimit from './dialog/cancelAllLimit'; import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; -import { MenuDisabledState } from './utils/menuItemStatus'; export default { name: 'MenuLimit', @@ -40,7 +39,7 @@ export default { { label: '取消全线临时限速', handler: this.cancelSpeed, - disabledCallback: MenuDisabledState.Section.cancelSpeed, + disabledCallback: '', auth: { station: true, center: false } } ], @@ -48,7 +47,7 @@ export default { { label: '取消全线临时限速', handler: this.cancelSpeed, - disabledCallback: MenuDisabledState.Section.cancelSpeed, + disabledCallback: '', auth: { station: false, center: true } } ] diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index 7db67c490..2e82b1d92 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -21,7 +21,6 @@ import TrainCreate from './dialog/trainCreate'; import AlxeEffective from './dialog/alxeEffective'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { mouseCancelState } from './utils/menuItemStatus'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; @@ -166,7 +165,7 @@ export default { } }; - mouseCancelState(this.selected); + this.mouseCancelState(this.selected); this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index 5d03d992c..d64917fcb 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -21,7 +21,6 @@ import RouteHandControl from './dialog/routeHandControl'; import RouteDetail from './dialog/routeDetail'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; -import { mouseCancelState } from './utils/menuItemStatus'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import { mapGetters } from 'vuex'; @@ -216,7 +215,7 @@ export default { Signal_Code: `${this.selected.code}` } }; - mouseCancelState(this.selected); + this.mouseCancelState(this.selected); this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); @@ -238,7 +237,7 @@ export default { Signal_Code: `${this.selected.code}` } }; - mouseCancelState(this.selected); + this.mouseCancelState(this.selected); this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue b/src/jmapNew/theme/ningbo_01/menus/menuStation.vue index e00c7a549..81b2a52f3 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStation.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStation.vue @@ -18,7 +18,6 @@ import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic'; import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus'; -import { mouseCancelState } from './utils/menuItemStatus'; export default { name: 'StationMenu', @@ -169,7 +168,7 @@ export default { operation: OperationEvent.Station.stoppage.menu.operation }; - mouseCancelState(this.selected); + this.mouseCancelState(this.selected); this.$store.dispatch('training/next', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); @@ -191,7 +190,7 @@ export default { operation: OperationEvent.Station.cancelStoppage.menu.operation }; - mouseCancelState(this.selected); + this.mouseCancelState(this.selected); this.$store.dispatch('training/next', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index b51ab3540..e63018fdb 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -21,7 +21,6 @@ import SpeedLimitControl from './dialog/speedLimitControl'; import AlxeEffective from './dialog/alxeEffective'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; -import { mouseCancelState } from './utils/menuItemStatus'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; @@ -177,7 +176,7 @@ export default { } }; - mouseCancelState(this.selected); + this.mouseCancelState(this.selected); this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); @@ -199,7 +198,7 @@ export default { } }; - mouseCancelState(this.selected); + this.mouseCancelState(this.selected); this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue index a37eb1d68..8cf034200 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue @@ -34,568 +34,567 @@ import TrainDeletePlan from './dialog/trainDeletePlan'; import TrainSetHead from './dialog/trainSetHead'; import TrainSetWork from './dialog/trainSetWork'; import TrainFlag from './dialog/trainFlag'; -import { mouseCancelState } from './utils/menuItemStatus'; export default { - name: 'MenuTrain', - components: { - PopMenu, - NoticeInfo, - TrainDelete, - TrainDefine, - TrainMove, - TrainEdit, - TrainSetPlan, - TrainAddPlan, - TrainMoveEvently, - TrainDeletePlan, - TrainSetHead, - TrainSetWork, - TrainFlag - }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - menu: [], - menuNormal: { - local: [ - { - label: '定义车组号', - handler: this.addTrainId, - disabledCallback: MenuDisabledState.Train.addTrainId, - auth: { station: true, center: true } - }, - { - label: '删除车组号', - handler: this.delTrainId, - disabledCallback: MenuDisabledState.Train.delTrainId, - auth: { station: true, center: true } - }, - { - label: '修改车组号', - handler: this.editTrainId, - disabledCallback: MenuDisabledState.Train.editTrainId, - auth: { station: true, center: true } - }, - { - label: '移动车组号', - handler: this.moveTrainId, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '设置计划车', - handler: this.setPlanTrain, - disabledCallback: MenuDisabledState.Train.setPlanTrain, - auth: { station: true, center: true } - }, - { - label: '设置头码车', - handler: this.setHeadTrain, - disabledCallback: MenuDisabledState.Train.setHeadTrain, - auth: { station: true, center: true } - }, - { - label: '设置人工车', - handler: this.setWorkTrain, - disabledCallback: MenuDisabledState.Train.setWorkTrain, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '添加计划车', - // handler: this.undeveloped, - handler: this.addPlanTrain, - // disabledCallback: MenuDisabledState.Train.moveTrainId, - disabledCallback: MenuDisabledState.Train.addPlanTrain, - auth: { station: true, center: true } - }, - { - label: '删除计划车', - // handler: this.undeveloped, - handler: this.deletePlanTrain, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - }, - { - label: '平移计划车', - // handler: this.undeveloped, - handler: this.moveEventlyTrain, - disabledCallback: MenuDisabledState.Train.moveEventlyTrain, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '标记重点列车', - handler: this.trainToFlag, - disabledCallback: MenuDisabledState.Train.trainToFlag, - auth: { station: true, center: true } - }, - { - label: '取消标记重点列车', - handler: this.trainUnFlag, - disabledCallback: MenuDisabledState.Train.trainUnFlag, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '列车信息', - handler: this.undeveloped, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - } - ], - central: [ - { - label: '定义车组号', - handler: this.addTrainId, - disabledCallback: MenuDisabledState.Train.addTrainId, - auth: { station: true, center: true } - }, - { - label: '删除车组号', - handler: this.delTrainId, - disabledCallback: MenuDisabledState.Train.delTrainId, - auth: { station: true, center: true } - }, - { - label: '修改车组号', - handler: this.editTrainId, - disabledCallback: MenuDisabledState.Train.editTrainId, - auth: { station: true, center: true } - }, - { - label: '移动车组号', - handler: this.moveTrainId, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '设置计划车', - handler: this.setPlanTrain, - disabledCallback: MenuDisabledState.Train.setPlanTrain, - auth: { station: true, center: true } - }, - { - label: '设置头码车', - handler: this.setHeadTrain, - disabledCallback: MenuDisabledState.Train.setHeadTrain, - auth: { station: true, center: true } - }, - { - label: '设置人工车', - handler: this.setWorkTrain, - disabledCallback: MenuDisabledState.Train.setWorkTrain, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '添加计划车', - // handler: this.undeveloped, - handler: this.addPlanTrain, - // disabledCallback: MenuDisabledState.Train.moveTrainId, - disabledCallback: MenuDisabledState.Train.addPlanTrain, - auth: { station: true, center: true } - }, - { - label: '删除计划车', - // handler: this.undeveloped, - handler: this.deletePlanTrain, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - }, - { - label: '平移计划车', - // handler: this.undeveloped, - handler: this.moveEventlyTrain, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '标记重点列车', - handler: this.trainToFlag, - disabledCallback: MenuDisabledState.Train.trainToFlag, - auth: { station: true, center: true } - }, - { - label: '取消标记重点列车', - handler: this.trainUnFlag, - disabledCallback: MenuDisabledState.Train.trainUnFlag, - auth: { station: true, center: true } - }, - { - type: 'separator' - }, - { - label: '列车信息', - handler: this.undeveloped, - disabledCallback: MenuDisabledState.Train.moveTrainId, - auth: { station: true, center: true } - } - ] - }, - menuForce: [ - { - label: '设置通信故障', - handler: this.setStoppage, - disabledCallback: MenuDisabledState.Train.setStoppage - }, - { - label: '取消通信故障', - handler: this.cancelStoppage, - disabledCallback: MenuDisabledState.Train.cancelStoppage - } - ], - menuSpeed: [ - { - label: '确认运行至前方站', - handler: this.limitSpeed, - disabledCallback: MenuDisabledState.Train.limitSpeed - } - ] - }; - }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, - watch: { - '$store.state.menuOperation.menuCount': function () { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) { - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - methods: { - clickEvent() { - const self = this; - window.onclick = function (e) { - self.doClose(); - }; - }, - initMenu() { - // 编辑模式菜单列表 - this.menu = trainMenuFiltration(this.menuNormal); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]; - } + name: 'MenuTrain', + components: { + PopMenu, + NoticeInfo, + TrainDelete, + TrainDefine, + TrainMove, + TrainEdit, + TrainSetPlan, + TrainAddPlan, + TrainMoveEvently, + TrainDeletePlan, + TrainSetHead, + TrainSetWork, + TrainFlag + }, + props: { + selected: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + menu: [], + menuNormal: { + local: [ + { + label: '定义车组号', + handler: this.addTrainId, + disabledCallback: MenuDisabledState.Train.addTrainId, + auth: { station: true, center: true } + }, + { + label: '删除车组号', + handler: this.delTrainId, + disabledCallback: MenuDisabledState.Train.delTrainId, + auth: { station: true, center: true } + }, + { + label: '修改车组号', + handler: this.editTrainId, + disabledCallback: MenuDisabledState.Train.editTrainId, + auth: { station: true, center: true } + }, + { + label: '移动车组号', + handler: this.moveTrainId, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '设置计划车', + handler: this.setPlanTrain, + disabledCallback: MenuDisabledState.Train.setPlanTrain, + auth: { station: true, center: true } + }, + { + label: '设置头码车', + handler: this.setHeadTrain, + disabledCallback: MenuDisabledState.Train.setHeadTrain, + auth: { station: true, center: true } + }, + { + label: '设置人工车', + handler: this.setWorkTrain, + disabledCallback: MenuDisabledState.Train.setWorkTrain, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '添加计划车', + // handler: this.undeveloped, + handler: this.addPlanTrain, + // disabledCallback: MenuDisabledState.Train.moveTrainId, + disabledCallback: MenuDisabledState.Train.addPlanTrain, + auth: { station: true, center: true } + }, + { + label: '删除计划车', + // handler: this.undeveloped, + handler: this.deletePlanTrain, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true } + }, + { + label: '平移计划车', + // handler: this.undeveloped, + handler: this.moveEventlyTrain, + disabledCallback: MenuDisabledState.Train.moveEventlyTrain, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '标记重点列车', + handler: this.trainToFlag, + disabledCallback: MenuDisabledState.Train.trainToFlag, + auth: { station: true, center: true } + }, + { + label: '取消标记重点列车', + handler: this.trainUnFlag, + disabledCallback: MenuDisabledState.Train.trainUnFlag, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '列车信息', + handler: this.undeveloped, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true } + } + ], + central: [ + { + label: '定义车组号', + handler: this.addTrainId, + disabledCallback: MenuDisabledState.Train.addTrainId, + auth: { station: true, center: true } + }, + { + label: '删除车组号', + handler: this.delTrainId, + disabledCallback: MenuDisabledState.Train.delTrainId, + auth: { station: true, center: true } + }, + { + label: '修改车组号', + handler: this.editTrainId, + disabledCallback: MenuDisabledState.Train.editTrainId, + auth: { station: true, center: true } + }, + { + label: '移动车组号', + handler: this.moveTrainId, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '设置计划车', + handler: this.setPlanTrain, + disabledCallback: MenuDisabledState.Train.setPlanTrain, + auth: { station: true, center: true } + }, + { + label: '设置头码车', + handler: this.setHeadTrain, + disabledCallback: MenuDisabledState.Train.setHeadTrain, + auth: { station: true, center: true } + }, + { + label: '设置人工车', + handler: this.setWorkTrain, + disabledCallback: MenuDisabledState.Train.setWorkTrain, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '添加计划车', + // handler: this.undeveloped, + handler: this.addPlanTrain, + // disabledCallback: MenuDisabledState.Train.moveTrainId, + disabledCallback: MenuDisabledState.Train.addPlanTrain, + auth: { station: true, center: true } + }, + { + label: '删除计划车', + // handler: this.undeveloped, + handler: this.deletePlanTrain, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true } + }, + { + label: '平移计划车', + // handler: this.undeveloped, + handler: this.moveEventlyTrain, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '标记重点列车', + handler: this.trainToFlag, + disabledCallback: MenuDisabledState.Train.trainToFlag, + auth: { station: true, center: true } + }, + { + label: '取消标记重点列车', + handler: this.trainUnFlag, + disabledCallback: MenuDisabledState.Train.trainUnFlag, + auth: { station: true, center: true } + }, + { + type: 'separator' + }, + { + label: '列车信息', + handler: this.undeveloped, + disabledCallback: MenuDisabledState.Train.moveTrainId, + auth: { station: true, center: true } + } + ] + }, + menuForce: [ + { + label: '设置通信故障', + handler: this.setStoppage, + disabledCallback: MenuDisabledState.Train.setStoppage + }, + { + label: '取消通信故障', + handler: this.cancelStoppage, + disabledCallback: MenuDisabledState.Train.cancelStoppage + } + ], + menuSpeed: [ + { + label: '确认运行至前方站', + handler: this.limitSpeed, + disabledCallback: MenuDisabledState.Train.limitSpeed + } + ] + }; + }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, + watch: { + '$store.state.menuOperation.menuCount': function () { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Train) && !this.buttonOperation) { + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + methods: { + clickEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + initMenu() { + // 编辑模式菜单列表 + this.menu = trainMenuFiltration(this.menuNormal); + if (this.operatemode === OperateMode.ADMIN) { + this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed]; + } - // 故障模式菜单列表 - if (this.operatemode === OperateMode.FAULT) { - this.menu = [...this.menuForce, ...this.menuSpeed]; - } + // 故障模式菜单列表 + if (this.operatemode === OperateMode.FAULT) { + this.menu = [...this.menuForce, ...this.menuSpeed]; + } - this.menu = menuConvert(this.menu); - }, - doShow(point) { - this.clickEvent(); - this.initMenu(); + this.menu = menuConvert(this.menu); + }, + doShow(point) { + this.clickEvent(); + this.initMenu(); - if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { - this.$refs.popMenu.resetShowPosition(point); - } - }, - doClose() { - if (this.$refs && this.$refs.popMenu) { - this.$refs.popMenu.close(); - // this.$store.dispatch('map/setTrainWindowShow', false); - } - }, - // 设置故障 - setStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.stoppage.menu.operation - }; + if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { + this.$refs.popMenu.resetShowPosition(point); + } + }, + doClose() { + if (this.$refs && this.$refs.popMenu) { + this.$refs.popMenu.close(); + // this.$store.dispatch('map/setTrainWindowShow', false); + } + }, + // 设置故障 + setStoppage() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.stoppage.menu.operation + }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 取消故障 - cancelStoppage() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.cancelStoppage.menu.operation - }; + this.mouseCancelState(this.selected); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 取消故障 + cancelStoppage() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.cancelStoppage.menu.operation + }; - mouseCancelState(this.selected); - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 限速行驶 - limitSpeed() { - const operate = { - start: true, - send: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.limitSpeed.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); - }); - }, - undeveloped() { - this.doClose(); - this.$alert('实现中......', '提示', { - confirmButtonText: '确定', - callback: action => { - } - }); - }, - // 添加列车识别号 - addTrainId() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.addTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDefine.doShow(operate, this.selected); - } - }); - }, - // 删除列车识别号 - delTrainId() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.delTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDelete.doShow(operate, this.selected); - } - }); - }, - // 移动列车识别号 - moveTrainId() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.moveTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainMove.doShow(operate, this.selected); - } - }); - }, - // 修改列车识别号 - editTrainId() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainEdit.doShow(operate, this.selected); - } - }); - }, - // 设置计划车 - setPlanTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainSetPlan.doShow(operate, this.selected); - } - }); - }, - // 添加计划车 - addPlanTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.addPlanTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainAddPlan.doShow(operate, this.selected); - } - }); - }, - // 平移计划车 - moveEventlyTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.moveEventlyTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainMoveEvently.doShow(operate, this.selected); - } - }); - }, - // 删除计划车 - deletePlanTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.deletePlanTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainDeletePlan.doShow(operate, this.selected); - } - }); - }, - // 设置头码车 - setHeadTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainSetHead.doShow(operate, this.selected); - } - }); - }, - // 设置人工车 - setWorkTrain() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainSetWork.doShow(operate, this.selected); - } - }); - }, - // 标记重点车 - trainToFlag() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainFlag.doShow(operate, this.selected); - } - }); - }, - // 取消标记重点车 - trainUnFlag() { - const operate = { - start: true, - code: this.selected.code, - type: MapDeviceType.Train.type, - label: MapDeviceType.Train.label, - operation: OperationEvent.Train.editTrainId.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainFlag.doShow(operate, this.selected); - } - }); - } - } + this.mouseCancelState(this.selected); + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 限速行驶 + limitSpeed() { + const operate = { + start: true, + send: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.limitSpeed.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.$refs.noticeInfo.doShow(operate); + }); + }, + undeveloped() { + this.doClose(); + this.$alert('实现中......', '提示', { + confirmButtonText: '确定', + callback: action => { + } + }); + }, + // 添加列车识别号 + addTrainId() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.addTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainDefine.doShow(operate, this.selected); + } + }); + }, + // 删除列车识别号 + delTrainId() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.delTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainDelete.doShow(operate, this.selected); + } + }); + }, + // 移动列车识别号 + moveTrainId() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.moveTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainMove.doShow(operate, this.selected); + } + }); + }, + // 修改列车识别号 + editTrainId() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.editTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainEdit.doShow(operate, this.selected); + } + }); + }, + // 设置计划车 + setPlanTrain() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.editTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainSetPlan.doShow(operate, this.selected); + } + }); + }, + // 添加计划车 + addPlanTrain() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.addPlanTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainAddPlan.doShow(operate, this.selected); + } + }); + }, + // 平移计划车 + moveEventlyTrain() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.moveEventlyTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainMoveEvently.doShow(operate, this.selected); + } + }); + }, + // 删除计划车 + deletePlanTrain() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.deletePlanTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainDeletePlan.doShow(operate, this.selected); + } + }); + }, + // 设置头码车 + setHeadTrain() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.editTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainSetHead.doShow(operate, this.selected); + } + }); + }, + // 设置人工车 + setWorkTrain() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.editTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainSetWork.doShow(operate, this.selected); + } + }); + }, + // 标记重点车 + trainToFlag() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.editTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainFlag.doShow(operate, this.selected); + } + }); + }, + // 取消标记重点车 + trainUnFlag() { + const operate = { + start: true, + code: this.selected.code, + type: MapDeviceType.Train.type, + label: MapDeviceType.Train.label, + operation: OperationEvent.Train.editTrainId.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainFlag.doShow(operate, this.selected); + } + }); + } + } }; diff --git a/src/main.js b/src/main.js index f4d345463..7c43c7a2a 100644 --- a/src/main.js +++ b/src/main.js @@ -11,6 +11,9 @@ import VueI18n from 'vue-i18n'; import store from './store'; import router from './router'; +import CancelMouseState from '@/mixin/CancelMouseState.js'; + +Vue.mixin(CancelMouseState); import '@/icons'; // icon import '@/permission'; // permission control diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 1e9afea51..79d1c6346 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,11 +3,11 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - // BASE_API = 'http://192.168.3.82:9000'; // 杜康 + BASE_API = 'http://192.168.3.82:9000'; // 杜康 } else { BASE_API = process.env.VUE_APP_BASE_API; }