From 9e5838c647e6d8a839077f8188e7545876ea04c7 Mon Sep 17 00:00:00 2001 From: ival <610568032@qq.com> Date: Tue, 12 Nov 2019 09:24:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PopMenu/index.vue | 1 - .../menus/menuDialog/splitModule.vue | 362 +++--- .../batong_01/menus/passiveDialog/alarm.vue | 385 +++--- .../batong_01/menus/passiveDialog/timeout.vue | 203 +-- .../menus/dialog/cancelAllLimit.vue | 496 +++---- .../menus/dialog/routeSelection.vue | 338 ++--- .../menus/dialog/speedCmdControl.vue | 1151 ++++++++--------- .../beijing_01/menus/dialog/standControl.vue | 386 +++--- .../chengdu_03/menus/dialog/trainCreate.vue | 1 - .../menus/dialog/trainMoveNumber.vue | 1 - .../menus/dialog/cancelAllLimit.vue | 496 +++---- .../fuzhou_01/menus/dialog/trainCreate.vue | 1 - src/jmap/utils/parser.js | 4 - src/store/modules/map.js | 2 +- src/views/display/menuPlan.vue | 171 ++- src/views/display/menuScreen.vue | 187 ++- .../system/ibpDraw/ibpOperate/ibpText.vue | 401 +++--- src/views/system/ibpDraw/ibpOperate/index.vue | 460 +++---- src/views/system/product/tree.vue | 1 - 19 files changed, 2556 insertions(+), 2491 deletions(-) diff --git a/src/components/PopMenu/index.vue b/src/components/PopMenu/index.vue index 8ad4795a5..678e128c3 100644 --- a/src/components/PopMenu/index.vue +++ b/src/components/PopMenu/index.vue @@ -127,7 +127,6 @@ export default { }, methods: { resetShowPosition(point) { - console.log(point); if (point) { this.show = true; const self = this; diff --git a/src/jmap/theme/batong_01/menus/menuDialog/splitModule.vue b/src/jmap/theme/batong_01/menus/menuDialog/splitModule.vue index 6ed7d0a09..257fd530e 100644 --- a/src/jmap/theme/batong_01/menus/menuDialog/splitModule.vue +++ b/src/jmap/theme/batong_01/menus/menuDialog/splitModule.vue @@ -1,196 +1,208 @@ \ No newline at end of file + diff --git a/src/jmap/theme/batong_01/menus/passiveDialog/alarm.vue b/src/jmap/theme/batong_01/menus/passiveDialog/alarm.vue index 53e990525..c5af6d08b 100644 --- a/src/jmap/theme/batong_01/menus/passiveDialog/alarm.vue +++ b/src/jmap/theme/batong_01/menus/passiveDialog/alarm.vue @@ -1,209 +1,214 @@ \ No newline at end of file + diff --git a/src/jmap/theme/batong_01/menus/passiveDialog/timeout.vue b/src/jmap/theme/batong_01/menus/passiveDialog/timeout.vue index d4ef4bb7c..88ce749ae 100644 --- a/src/jmap/theme/batong_01/menus/passiveDialog/timeout.vue +++ b/src/jmap/theme/batong_01/menus/passiveDialog/timeout.vue @@ -1,107 +1,116 @@ \ No newline at end of file + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.doClose(); + } + }); + }, + commit() { + const operate = { + type: this.operate.type, + operation: OperationEvent.Command.close.notice.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (valid) { + this.doClose(); + } + }); + }, + isClose() { + return this.dialogShow; + } + } +}; + + diff --git a/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue b/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue index c5e203711..a331218ad 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/cancelAllLimit.vue @@ -1,273 +1,289 @@ \ No newline at end of file + diff --git a/src/jmap/theme/beijing_01/menus/dialog/routeSelection.vue b/src/jmap/theme/beijing_01/menus/dialog/routeSelection.vue index cae8107c4..5101fb230 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/routeSelection.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/routeSelection.vue @@ -68,186 +68,186 @@ import { mouseCancelState } from '../utils/menuItemStatus'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'RouteSelection', - components: { - // ConfirmControl, - NoticeInfo - }, - data() { - return { - tempData: [], - beforeSectionList: [], - dialogShow: false, - loading: false, - selected: null, - row: null, - operation: '', - display: true, - stationName: '', - signalName: '', - tableStyle: { - 'border-bottom': 'none' - } - }; - }, - computed: { - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdChoose() { - return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; - }, - title() { - return '进路选排'; - }, - commitDisabled() { - let disabled = true; - if (this.row) { - disabled = !this.row.canSetting; - } - return disabled; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - getProtectedSectionName(row) { - let name = ''; - if (row && + name: 'RouteSelection', + components: { + // ConfirmControl, + NoticeInfo + }, + data() { + return { + tempData: [], + beforeSectionList: [], + dialogShow: false, + loading: false, + selected: null, + row: null, + operation: '', + display: true, + stationName: '', + signalName: '', + tableStyle: { + 'border-bottom': 'none' + } + }; + }, + computed: { + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdChoose() { + return this.dialogShow ? OperationEvent.Signal.arrangementRoute.choose.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? OperationEvent.Signal.arrangementRoute.menu.domId : ''; + }, + title() { + return '进路选排'; + }, + commitDisabled() { + let disabled = true; + if (this.row) { + disabled = !this.row.canSetting; + } + return disabled; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + getProtectedSectionName(row) { + let name = ''; + if (row && row.overlapSectionList && row.overlapSectionList && row.overlapSectionList.length > 0) { - const protect = row.overlapSectionList[0]; - name = `${protect.name}`; - const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode); - if (station) { - name = `${name}(${station.name})`; - } - } - return name; - }, - expandPath() { - console.log('展开进路预览'); - }, - 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; - } - } + const protect = row.overlapSectionList[0]; + name = `${protect.name}`; + const station = this.$store.getters['map/getDeviceByCode'](protect.stationCode); + if (station) { + name = `${name}(${station.name})`; + } + } + return name; + }, + expandPath() { + console.log('展开进路预览'); + }, + 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; + } + } - 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.restoreBeforeDevices(); - this.$refs.table.setCurrentRow(); - this.$store.dispatch('training/emitTipFresh'); - mouseCancelState(this.selected); - }, - restoreBeforeDevices() { - // 恢复之前选中设备 - if (this.beforeSectionList && this.beforeSectionList.length) { - this.beforeSectionList.forEach(elem => { - elem.cutOff = false; - }); - } + 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.restoreBeforeDevices(); + this.$refs.table.setCurrentRow(); + this.$store.dispatch('training/emitTipFresh'); + mouseCancelState(this.selected); + }, + restoreBeforeDevices() { + // 恢复之前选中设备 + if (this.beforeSectionList && this.beforeSectionList.length) { + this.beforeSectionList.forEach(elem => { + elem.cutOff = false; + }); + } - this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]); - this.beforeSectionList = []; - }, - clickEvent(row, event, column) { - this.row = row; - if (row) { - // 恢复进路区段的切除状态 - this.restoreBeforeDevices(); + this.$store.dispatch('training/updateMapState', [...this.beforeSectionList]); + this.beforeSectionList = []; + }, + clickEvent(row, event, column) { + this.row = row; + if (row) { + // 恢复进路区段的切除状态 + this.restoreBeforeDevices(); - if (row.canSetting) { - // 设置选中区段为切除状态 - if (row.containSectionList && row.containSectionList.length) { - // 设置新选的进路区段为切除状态 - row.containSectionList.forEach(elem => { - elem.cutOff = true; - }); - } + if (row.canSetting) { + // 设置选中区段为切除状态 + if (row.containSectionList && row.containSectionList.length) { + // 设置新选的进路区段为切除状态 + row.containSectionList.forEach(elem => { + elem.cutOff = true; + }); + } - this.$store.dispatch('training/updateMapState', [...row.containSectionList]); - this.beforeSectionList = row.containSectionList || []; + this.$store.dispatch('training/updateMapState', [...row.containSectionList]); + this.beforeSectionList = row.containSectionList || []; - // 设置选中指令 - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.arrangementRoute.choose.operation, - val: row.code - }; + // 设置选中指令 + const operate = { + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.arrangementRoute.choose.operation, + val: row.code + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }); - } - } - }, - commit() { - if (this.row && this.row.canSetting) { - const operate = { - send: true, - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.arrangementRoute.menu.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }); + } + } + }, + commit() { + if (this.row && this.row.canSetting) { + const operate = { + send: true, + type: MapDeviceType.Signal.type, + operation: OperationEvent.Signal.arrangementRoute.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); - }); - } - }, - 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(() => { + 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(() => { - this.doClose(); - }); - } - } + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; diff --git a/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue b/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue index 0f54a9c1b..7f4caa8e5 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/speedCmdControl.vue @@ -151,7 +151,7 @@
设备列表:
-
+
{{ item.name }}: {{ item.text }}
@@ -278,7 +278,7 @@
设备列表:
-
+
{{ item.name }}: {{ item.text }}
@@ -314,588 +314,585 @@ import { sendCommand } from '@/api/jmap/training'; import router from '@/router'; export default { - name: 'SectionCmdSpeed', - components: { - ConfirmTip - }, - data() { - return { - dialogShow: false, - selected: '', - order: 0, - code: '', - row: null, - timer: null, - type: '', - operation: '', - spdDisabled: true, - firstDisabled: true, - secondDisabled: true, - stpDisabled: true, - timeCountCommand: -1, - timeCountConfirm: -1, - equipmentText: [], - equipmentText1: [], - maxSpeed: 85, - speedSpace: 5, - stationName: '111', - name: '', - speed: '', - regionList: [], - startSectionList: [], - endSectionList: [], - sectionList: [ - { - value: 'up', - name: '上行' - }, - { - value: 'down', - name: '下行' - } - ], - messageStatus: '请先打开会话!', - dialogueStatus: '会话已关闭', - isOpenMessage: true, - codeText: '', - firstScetion: { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - }, - firstShow: false, - copyScetion: { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - }, - secondScetion: { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - } - }; - }, - computed: { - speedList() { - const list = [{ value: -1, name: '无限速' }]; - for (var i = 5; i * this.speedSpace <= this.maxSpeed; i++) { - list.push({ value: String(i * this.speedSpace), name: String(i * this.speedSpace) }); - } - return list; - }, - title() { - if (this.dialogShow) { - return '公里标输入临时限速'; - } - }, - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - openConversationId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.openConversation.domId : ''; - }, - closeConversationId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.closeConversation.domId : ''; - }, - firstLimitSpeedId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstLimitSpeed.domId : ''; - }, - firstStartSectionId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstStartSection.domId : ''; - }, - firstStartvalueId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstStartvalue.domId : ''; - }, - firstEndSectionId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstEndSection.domId : ''; - }, - firstEndvalueId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstEndvalue.domId : ''; - }, - firstCheckId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstCheck.domId : ''; - }, - firstComfirmId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstComfirm.domId : ''; - }, - secondLimitSpeedId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondLimitSpeed.domId : ''; - }, - secondStartSectionId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondStartSection.domId : ''; - }, - secondStartvalueId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondStartvalue.domId : ''; - }, - secondEndSectionId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondEndSection.domId : ''; - }, - secondEndvalueId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondEndvalue.domId : ''; - }, - secondCheckId() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondCheck.domId : ''; - }, - secondComfirmId() { - return this.dialogShow ? OperationEvent.Section.confirmLimit.menu.domId : ''; - }, - domIdClose() { - return this.dialogShow ? OperationEvent.Section.setLimitSpeed.domIdClose.domId : ''; - } - }, - watch: { - 'timeCountCommand': function (val) { - if (val <= 0) { - this.dialogueStatus = `会话已关闭`; - // this.openMessage('close'); - this.isOpenMessage = true; - this.spdDisabled = true; - this.firstDisabled = true; - this.secondDisabled = true; - this.messageStatus = '请先打开会话!'; - this.timeCountCommand = -1; - if (this.speed) { - this.messageStatus = '会话关闭成功'; - } - this.equipmentText = []; - this.equipmentText1 = []; - this.firstScetion = { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - }; - this.secondScetion = { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - }; - } else { - this.dialogueStatus = `会话打开,剩余时间${val}秒`; - } - }, - firstScetion: { - handler: function (val) { - if (val.speed && val.startSection && val.endSection && val.startValue != '' && val.endValue != '') { - this.firstShow = true; - } else { - this.firstShow = false; - } - }, - deep: true - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - this.regionList = this.$ConstSelect.RegionTypeList; - this.timer = setInterval(() => { - if (this.timeCountCommand > 0) { - this.timeCountCommand--; - } else if (this.timeCountCommand == 0) { // 关闭会话 - this.isOpenMessage = true; - this.timeCountCommand = -1; - } - if (this.timeCountConfirm > 0) { - this.timeCountConfirm--; - } else if (this.timeCountConfirm == 0) { // 关闭会话 - this.timeCountConfirm = -1; - } - }, 1000); - }, - beforeDestroy() { - clearInterval(this.timer); - this.timer = null; - }, - methods: { - doShow(operate, selected, tempData) { - this.selected = selected; - if (!this.dialogShow) { - this.name = ''; - if (selected) { - this.timeCountCommand = -1; // 倒计时 - this.order = 0; - this.type = operate.type; - this.operation = operate.operation; - this.code = operate.code; - } - } - this.dialogShow = true; - this.$nextTick(function () { - this.$store.dispatch('training/emitTipFresh'); - }); - }, - doClose() { - this.secondScetion = { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - }; - this.firstScetion = { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - }; - this.speed = 0; - this.dialogShow = false; - this.$store.dispatch('training/emitTipFresh'); - // mouseCancelState(this.selected); - }, - openMessage(state) { - if (state == 'open') { // 打开会话 - const operate = { - type: this.type, - operation: OperationEvent.Section.setLimitSpeed.openConversation.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.isOpenMessage = false; - this.spdDisabled = false; - this.messageStatus = '会话打开成功'; - this.speed = 1; - this.timeCountCommand = 120; - } - }).catch(error => { - console.log(error); - }); - } else { // 关闭会话 - const operate = { - type: this.type, - operation: OperationEvent.Section.setLimitSpeed.closeConversation.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.isOpenMessage = true; - this.spdDisabled = true; - this.firstDisabled = true; - this.secondDisabled = true; - this.messageStatus = '请先打开会话!'; - this.timeCountCommand = -1; - this.startSectionList = []; - this.endSectionList = []; - if (this.speed) { - this.messageStatus = '会话关闭成功'; - } - } - }).catch(error => { - console.log(error); - }); - } - }, - CheckEquipment() { // 第一次确认设备 - if (this.firstShow) { - const value = `${this.firstScetion.speed}::${this.firstScetion.startSection}::${this.firstScetion.startValue}::${this.firstScetion.endSection}::${this.firstScetion.endValue}`; - const operate = { - send: true, - val: value, - type: this.type, - operation: OperationEvent.Section.setLimitSpeed.firstCheck.operation - }; + name: 'SectionCmdSpeed', + components: { + ConfirmTip + }, + data() { + return { + dialogShow: false, + selected: '', + order: 0, + code: '', + row: null, + timer: null, + type: '', + operation: '', + spdDisabled: true, + firstDisabled: true, + secondDisabled: true, + stpDisabled: true, + timeCountCommand: -1, + timeCountConfirm: -1, + equipmentText: [], + equipmentText1: [], + maxSpeed: 85, + speedSpace: 5, + stationName: '111', + name: '', + speed: '', + regionList: [], + startSectionList: [], + endSectionList: [], + sectionList: [ + { + value: 'up', + name: '上行' + }, + { + value: 'down', + name: '下行' + } + ], + messageStatus: '请先打开会话!', + dialogueStatus: '会话已关闭', + isOpenMessage: true, + codeText: '', + firstScetion: { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + }, + firstShow: false, + copyScetion: { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + }, + secondScetion: { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + } + }; + }, + computed: { + speedList() { + const list = [{ value: -1, name: '无限速' }]; + for (var i = 5; i * this.speedSpace <= this.maxSpeed; i++) { + list.push({ value: String(i * this.speedSpace), name: String(i * this.speedSpace) }); + } + return list; + }, + title() { + return this.dialogShow ? '公里标输入临时限速' : ''; + }, + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + openConversationId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.openConversation.domId : ''; + }, + closeConversationId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.closeConversation.domId : ''; + }, + firstLimitSpeedId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstLimitSpeed.domId : ''; + }, + firstStartSectionId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstStartSection.domId : ''; + }, + firstStartvalueId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstStartvalue.domId : ''; + }, + firstEndSectionId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstEndSection.domId : ''; + }, + firstEndvalueId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstEndvalue.domId : ''; + }, + firstCheckId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstCheck.domId : ''; + }, + firstComfirmId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.firstComfirm.domId : ''; + }, + secondLimitSpeedId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondLimitSpeed.domId : ''; + }, + secondStartSectionId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondStartSection.domId : ''; + }, + secondStartvalueId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondStartvalue.domId : ''; + }, + secondEndSectionId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondEndSection.domId : ''; + }, + secondEndvalueId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondEndvalue.domId : ''; + }, + secondCheckId() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.secondCheck.domId : ''; + }, + secondComfirmId() { + return this.dialogShow ? OperationEvent.Section.confirmLimit.menu.domId : ''; + }, + domIdClose() { + return this.dialogShow ? OperationEvent.Section.setLimitSpeed.domIdClose.domId : ''; + } + }, + watch: { + 'timeCountCommand': function (val) { + if (val <= 0) { + this.dialogueStatus = `会话已关闭`; + // this.openMessage('close'); + this.isOpenMessage = true; + this.spdDisabled = true; + this.firstDisabled = true; + this.secondDisabled = true; + this.messageStatus = '请先打开会话!'; + this.timeCountCommand = -1; + if (this.speed) { + this.messageStatus = '会话关闭成功'; + } + this.equipmentText = []; + this.equipmentText1 = []; + this.firstScetion = { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + }; + this.secondScetion = { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + }; + } else { + this.dialogueStatus = `会话打开,剩余时间${val}秒`; + } + }, + firstScetion: { + handler: function (val) { + if (val.speed && val.startSection && val.endSection && val.startValue != '' && val.endValue != '') { + this.firstShow = true; + } else { + this.firstShow = false; + } + }, + deep: true + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + this.regionList = this.$ConstSelect.RegionTypeList; + this.timer = setInterval(() => { + if (this.timeCountCommand > 0) { + this.timeCountCommand--; + } else if (this.timeCountCommand == 0) { // 关闭会话 + this.isOpenMessage = true; + this.timeCountCommand = -1; + } + if (this.timeCountConfirm > 0) { + this.timeCountConfirm--; + } else if (this.timeCountConfirm == 0) { // 关闭会话 + this.timeCountConfirm = -1; + } + }, 1000); + }, + beforeDestroy() { + clearInterval(this.timer); + this.timer = null; + }, + methods: { + doShow(operate, selected, tempData) { + this.selected = selected; + if (!this.dialogShow) { + this.name = ''; + if (selected) { + this.timeCountCommand = -1; // 倒计时 + this.order = 0; + this.type = operate.type; + this.operation = operate.operation; + this.code = operate.code; + } + } + this.dialogShow = true; + this.$nextTick(function () { + this.$store.dispatch('training/emitTipFresh'); + }); + }, + doClose() { + this.secondScetion = { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + }; + this.firstScetion = { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + }; + this.speed = 0; + this.dialogShow = false; + this.$store.dispatch('training/emitTipFresh'); + // mouseCancelState(this.selected); + }, + openMessage(state) { + if (state == 'open') { // 打开会话 + const operate = { + type: this.type, + operation: OperationEvent.Section.setLimitSpeed.openConversation.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.isOpenMessage = false; + this.spdDisabled = false; + this.messageStatus = '会话打开成功'; + this.speed = 1; + this.timeCountCommand = 120; + } + }).catch(error => { + console.log(error); + }); + } else { // 关闭会话 + const operate = { + type: this.type, + operation: OperationEvent.Section.setLimitSpeed.closeConversation.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.isOpenMessage = true; + this.spdDisabled = true; + this.firstDisabled = true; + this.secondDisabled = true; + this.messageStatus = '请先打开会话!'; + this.timeCountCommand = -1; + this.startSectionList = []; + this.endSectionList = []; + if (this.speed) { + this.messageStatus = '会话关闭成功'; + } + } + }).catch(error => { + console.log(error); + }); + } + }, + CheckEquipment() { // 第一次确认设备 + if (this.firstShow) { + const value = `${this.firstScetion.speed}::${this.firstScetion.startSection}::${this.firstScetion.startValue}::${this.firstScetion.endSection}::${this.firstScetion.endValue}`; + const operate = { + send: true, + val: value, + type: this.type, + operation: OperationEvent.Section.setLimitSpeed.firstCheck.operation + }; - this.$store.dispatch('training/next', operate).then(({ valid, response }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.firstDisabled = false; // 运行首次发送 - this.getEquipmentList(response.data); - this.copyScetion = { - speed: this.firstScetion.speed, - startSection: this.firstScetion.startSection, - endSection: this.firstScetion.endSection, - startValue: this.firstScetion.startValue, - endValue: this.firstScetion.endValue - }; - this.startSectionList = []; - this.endSectionList = []; - for (let index = 0; index < 4; index++) { - const starData = { - value: Number(this.firstScetion.startValue) + index, - label: Number(this.firstScetion.startValue) + index - }; - this.startSectionList.push(starData); - const endData = { - value: Number(this.firstScetion.endValue) + index, - label: Number(this.firstScetion.endValue) + index - }; - this.endSectionList.push(endData); - } - } - }).catch(error => { - console.log(error); - }); - } - }, - getEquipmentList(list) { - this.equipmentText = []; - const stationStand = []; - const stationText = []; - this.codeText = ''; - const arr = []; - list.forEach(ele => { - if (stationStand.indexOf(ele.stationCode) == -1) { - stationStand.push(ele.stationCode); - const text = this.getTextName(ele); - stationText.push(text); - } else { - const index = stationStand.indexOf(ele.stationCode); - const text = this.getTextName(ele); - stationText[index] += text; - } - arr.push(ele.code); - }); - this.codeText = arr.join('::'); - stationStand.forEach((item, index) => { - const stationStandName = this.$store.getters['map/getDeviceByCode'](item); - const data = { - text: stationText[index], - name: stationStandName.name - }; - this.equipmentText.push(data); - }); - }, - getTextName(ele) { - if (ele.switchSectionType) { - switch (ele.switchSectionType) { - case '01': { - return `${ele.name}(主), `; - } break; - case '02': { - return `${ele.name}(定), `; - } break; - case '03': { - return `${ele.name}(反), `; - } break; - } - } else if (ele.parentName) { - return `${ele.parentName}-${ele.name}, `; - } else { - return `${ele.name}, `; - } - }, - CheckSecondEquipment() { // 二次查看设备 - if (this.secondScetion.speed == this.copyScetion.speed && this.secondScetion.startSection == this.copyScetion.startSection && this.secondScetion.endSection == this.copyScetion.endSection && this.secondScetion.startValue == this.copyScetion.startValue && this.secondScetion.endValue == this.copyScetion.endValue) { - const operate = { - type: this.type, - operation: OperationEvent.Section.setLimitSpeed.secondCheck.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.equipmentText1 = this.equipmentText; - this.secondDisabled = false; // 第二次确认发送 - } - }).catch(error => { - console.log(error); - }); - } else { - this.firstScetion = { - speed: this.copyScetion.speed, - startSection: this.copyScetion.startSection, - endSection: this.copyScetion.endSection, - startValue: this.copyScetion.startValue, - endValue: this.copyScetion.endValue - }; - this.firstDisabled = true; - this.secondScetion = { - speed: '', - startSection: '', - endSection: '', - startValue: '', - endValue: '' - }; - this.spdDisabled = false; - this.equipmentText = []; - this.stpDisabled = true; - this.timeCountConfirm = -1; - const operate = { - message: `两次值不一致` - }; - this.$refs.ConfirmTip.doShow(operate); - } - }, - changeSelect(value, val) { - const operate = { - type: this.type, - operation: '', - val: value - }; + this.$store.dispatch('training/next', operate).then(({ valid, response }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.firstDisabled = false; // 运行首次发送 + this.getEquipmentList(response.data); + this.copyScetion = { + speed: this.firstScetion.speed, + startSection: this.firstScetion.startSection, + endSection: this.firstScetion.endSection, + startValue: this.firstScetion.startValue, + endValue: this.firstScetion.endValue + }; + this.startSectionList = []; + this.endSectionList = []; + for (let index = 0; index < 4; index++) { + const starData = { + value: Number(this.firstScetion.startValue) + index, + label: Number(this.firstScetion.startValue) + index + }; + this.startSectionList.push(starData); + const endData = { + value: Number(this.firstScetion.endValue) + index, + label: Number(this.firstScetion.endValue) + index + }; + this.endSectionList.push(endData); + } + } + }).catch(error => { + console.log(error); + }); + } + }, + getEquipmentList(list) { + this.equipmentText = []; + const stationStand = []; + const stationText = []; + this.codeText = ''; + const arr = []; + list.forEach(ele => { + if (stationStand.indexOf(ele.stationCode) == -1) { + stationStand.push(ele.stationCode); + const text = this.getTextName(ele); + stationText.push(text); + } else { + const index = stationStand.indexOf(ele.stationCode); + const text = this.getTextName(ele); + stationText[index] += text; + } + arr.push(ele.code); + }); + this.codeText = arr.join('::'); + stationStand.forEach((item, index) => { + const stationStandName = this.$store.getters['map/getDeviceByCode'](item); + const data = { + text: stationText[index], + name: stationStandName.name + }; + this.equipmentText.push(data); + }); + }, + getTextName(ele) { + if (ele.switchSectionType) { + switch (ele.switchSectionType) { + case '01': + return `${ele.name}(主), `; + case '02': + return `${ele.name}(定), `; + case '03': + return `${ele.name}(反), `; + } + } else if (ele.parentName) { + return `${ele.parentName}-${ele.name}, `; + } else { + return `${ele.name}, `; + } - switch (val) { - case '1': - operate.operation = OperationEvent.Section.setLimitSpeed.firstLimitSpeed.operation; - break; - case '2': - operate.operation = OperationEvent.Section.setLimitSpeed.firstStartSection.operation; - break; - case '3': - operate.operation = OperationEvent.Section.setLimitSpeed.firstStartvalue.operation; - break; - case '4': - operate.operation = OperationEvent.Section.setLimitSpeed.firstEndSection.operation; - break; - case '5': - operate.operation = OperationEvent.Section.setLimitSpeed.firstEndvalue.operation; - break; - case '6': - operate.operation = OperationEvent.Section.setLimitSpeed.secondLimitSpeed.operation; - break; - case '7': - operate.operation = OperationEvent.Section.setLimitSpeed.secondStartSection.operation; - break; - case '8': - operate.operation = OperationEvent.Section.setLimitSpeed.secondStartvalue.operation; - break; - case '9': - operate.operation = OperationEvent.Section.setLimitSpeed.secondEndSection.operation; - break; - case '10': - operate.operation = OperationEvent.Section.setLimitSpeed.secondEndvalue.operation; - break; - } + return ''; + }, + CheckSecondEquipment() { // 二次查看设备 + if (this.secondScetion.speed == this.copyScetion.speed && this.secondScetion.startSection == this.copyScetion.startSection && this.secondScetion.endSection == this.copyScetion.endSection && this.secondScetion.startValue == this.copyScetion.startValue && this.secondScetion.endValue == this.copyScetion.endValue) { + const operate = { + type: this.type, + operation: OperationEvent.Section.setLimitSpeed.secondCheck.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.equipmentText1 = this.equipmentText; + this.secondDisabled = false; // 第二次确认发送 + } + }).catch(error => { + console.log(error); + }); + } else { + this.firstScetion = { + speed: this.copyScetion.speed, + startSection: this.copyScetion.startSection, + endSection: this.copyScetion.endSection, + startValue: this.copyScetion.startValue, + endValue: this.copyScetion.endValue + }; + this.firstDisabled = true; + this.secondScetion = { + speed: '', + startSection: '', + endSection: '', + startValue: '', + endValue: '' + }; + this.spdDisabled = false; + this.equipmentText = []; + this.stpDisabled = true; + this.timeCountConfirm = -1; + const operate = { + message: `两次值不一致` + }; + this.$refs.ConfirmTip.doShow(operate); + } + }, + changeSelect(value, val) { + const operate = { + type: this.type, + operation: '', + val: value + }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }).catch(error => { - console.log(error); - }); - }, + switch (val) { + case '1': + operate.operation = OperationEvent.Section.setLimitSpeed.firstLimitSpeed.operation; + break; + case '2': + operate.operation = OperationEvent.Section.setLimitSpeed.firstStartSection.operation; + break; + case '3': + operate.operation = OperationEvent.Section.setLimitSpeed.firstStartvalue.operation; + break; + case '4': + operate.operation = OperationEvent.Section.setLimitSpeed.firstEndSection.operation; + break; + case '5': + operate.operation = OperationEvent.Section.setLimitSpeed.firstEndvalue.operation; + break; + case '6': + operate.operation = OperationEvent.Section.setLimitSpeed.secondLimitSpeed.operation; + break; + case '7': + operate.operation = OperationEvent.Section.setLimitSpeed.secondStartSection.operation; + break; + case '8': + operate.operation = OperationEvent.Section.setLimitSpeed.secondStartvalue.operation; + break; + case '9': + operate.operation = OperationEvent.Section.setLimitSpeed.secondEndSection.operation; + break; + case '10': + operate.operation = OperationEvent.Section.setLimitSpeed.secondEndvalue.operation; + break; + } - Confirmed() { // 第一次确认 - const operate = { - type: this.type, - operation: OperationEvent.Section.setLimitSpeed.firstComfirm.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.spdDisabled = true; - this.stpDisabled = false; - this.firstDisabled = true; - this.messageStatus = '收到Confirm request消息'; - this.timeCountConfirm = 60; // 倒计时 - this.firstScetion = { - speed: '', - startSection: '', - endSection: '', - startValue: '***', - endValue: '***' - }; - } - }).catch(error => { - console.log(error); - }); - }, + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }).catch(error => { + console.log(error); + }); + }, - confirm() { // 第二次确认 - // let value = `${this.secondScetion.speed}::${this.codeText}`; - const value = `${this.secondScetion.speed}::${this.secondScetion.startSection}::${this.secondScetion.startValue}::${this.secondScetion.endSection}::${this.secondScetion.endValue}`; - const operate = { - send: true, - val: value, - type: this.type, - code: this.code, - operation: OperationEvent.Section.confirmLimit.menu.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - const group = router.currentRoute.query.group; - const command = this.handleMenuConfirmLimit(operate); - sendCommand(group, command).then((response) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.timeCountConfirm = -1; - this.stpDisabled = true; - this.messageStatus = '临时限速设置成功'; - }).catch(error => { - const operate = { - message: error.message - }; - this.$refs.ConfirmTip.doShow(operate); - console.log(error); - }); - } - }).catch(error => { - const operate = { - message: error.message - }; - this.$refs.ConfirmTip.doShow(operate); - console.log(error); - }); - }, + Confirmed() { // 第一次确认 + const operate = { + type: this.type, + operation: OperationEvent.Section.setLimitSpeed.firstComfirm.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.spdDisabled = true; + this.stpDisabled = false; + this.firstDisabled = true; + this.messageStatus = '收到Confirm request消息'; + this.timeCountConfirm = 60; // 倒计时 + this.firstScetion = { + speed: '', + startSection: '', + endSection: '', + startValue: '***', + endValue: '***' + }; + } + }).catch(error => { + console.log(error); + }); + }, - close() { // 设置成功 关闭弹窗 - const operate = { - type: this.type, - operation: OperationEvent.Section.setLimitSpeed.domIdClose.operation - }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - if (this.isOpenMessage) { - this.doClose(); - } else { - const operate = { - message: `是否关闭会话,并关闭窗口`, - confirmId: OperationEvent.Section.setLimitSpeed.close.domId - }; - this.$refs.ConfirmTip.doShow(operate); - } - } - }).catch(() => { - this.doClose(); - }); - }, - commit() { + confirm() { // 第二次确认 + // let value = `${this.secondScetion.speed}::${this.codeText}`; + const value = `${this.secondScetion.speed}::${this.secondScetion.startSection}::${this.secondScetion.startValue}::${this.secondScetion.endSection}::${this.secondScetion.endValue}`; + const operate = { + send: true, + val: value, + type: this.type, + code: this.code, + operation: OperationEvent.Section.confirmLimit.menu.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + const group = router.currentRoute.query.group; + const command = this.handleMenuConfirmLimit(operate); + sendCommand(group, command).then((response) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.timeCountConfirm = -1; + this.stpDisabled = true; + this.messageStatus = '临时限速设置成功'; + }).catch(error => { + const operate = { + message: error.message + }; + this.$refs.ConfirmTip.doShow(operate); + console.log(error); + }); + } + }).catch(error => { + const operate = { + message: error.message + }; + this.$refs.ConfirmTip.doShow(operate); + console.log(error); + }); + }, - }, - closeMessage() { - const operate = { - type: this.type, - operation: OperationEvent.Section.setLimitSpeed.close.operation - }; + close() { // 设置成功 关闭弹窗 + const operate = { + type: this.type, + operation: OperationEvent.Section.setLimitSpeed.domIdClose.operation + }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + if (this.isOpenMessage) { + this.doClose(); + } else { + const operate = { + message: `是否关闭会话,并关闭窗口`, + confirmId: OperationEvent.Section.setLimitSpeed.close.domId + }; + this.$refs.ConfirmTip.doShow(operate); + } + } + }).catch(() => { + this.doClose(); + }); + }, + commit() { - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.ConfirmTip.doClose(); - this.isOpenMessage = true; - this.spdDisabled = true; - this.firstDisabled = true; - this.secondDisabled = true; - this.timeCountCommand = -1; - this.startSectionList = []; - this.endSectionList = []; - this.doClose(); - }).catch(error => { - console.log(error); - }); - }, - // 处理右键菜单 确认临时限速 - handleMenuConfirmLimit(operate) { - return { - type: operate.type, - code: operate.code, - over: true, - operation: OperationEvent.Section.confirmLimit.event, - val: operate.val - }; - } - } + }, + closeMessage() { + const operate = { + type: this.type, + operation: OperationEvent.Section.setLimitSpeed.close.operation + }; + + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.ConfirmTip.doClose(); + this.isOpenMessage = true; + this.spdDisabled = true; + this.firstDisabled = true; + this.secondDisabled = true; + this.timeCountCommand = -1; + this.startSectionList = []; + this.endSectionList = []; + this.doClose(); + }).catch(error => { + console.log(error); + }); + }, + // 处理右键菜单 确认临时限速 + handleMenuConfirmLimit(operate) { + return { + type: operate.type, + code: operate.code, + over: true, + operation: OperationEvent.Section.confirmLimit.event, + val: operate.val + }; + } + } }; diff --git a/src/jmap/theme/beijing_01/menus/dialog/standControl.vue b/src/jmap/theme/beijing_01/menus/dialog/standControl.vue index 833dffaaf..ab3a3799b 100644 --- a/src/jmap/theme/beijing_01/menus/dialog/standControl.vue +++ b/src/jmap/theme/beijing_01/menus/dialog/standControl.vue @@ -115,205 +115,205 @@ import { mouseCancelState } from '../utils/menuItemStatus'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; export default { - name: 'StandDetainTrain', - components: { - NoticeInfo - }, - data() { - return { - dialogShow: false, - loading: false, - standName: '', - stationName: '', - selected: null, - operation: null, - radio: '1', - radio1: '1', - radio2: '1', - earlyDepar: false - }; - }, - computed: { - show() { - return this.dialogShow && !this.$store.state.menuOperation.break; - }, - domIdCancel() { - return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; - }, - domIdConfirm() { - return this.dialogShow ? getDomIdByOperation(this.operation) : ''; - }, - upRadioId() { - return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : ''; - }, - downRadioId() { - return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.downSelect.domId : ''; - }, - title() { - this.earlyDepar = false; - if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) { - this.radio1 = '1'; - return '扣车'; - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { - this.radio1 = '2'; - return '取消扣车'; - } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { - this.earlyDepar = true; - if (this.selected.direction == '01') { - this.radio2 = '2'; - } else { - this.radio2 = '1'; - } - return '提前发车'; - } - return ''; - } - }, - mounted() { - this.$nextTick(() => { - this.$store.dispatch('training/tipReload'); - }); - }, - methods: { - doShow(operate, selected) { - this.selected = selected; - if (!this.dialogShow) { - this.standName = ''; - this.stationName = ''; - if (selected) { - this.standName = selected.name; - } - if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { - this.standName = selected.name; - const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); - if (station) { - this.stationName = station.name; - } - } + name: 'StandDetainTrain', + components: { + NoticeInfo + }, + data() { + return { + dialogShow: false, + loading: false, + standName: '', + stationName: '', + selected: null, + operation: null, + radio: '1', + radio1: '1', + radio2: '1', + earlyDepar: false + }; + }, + computed: { + show() { + return this.dialogShow && !this.$store.state.menuOperation.break; + }, + domIdCancel() { + return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : ''; + }, + domIdConfirm() { + return this.dialogShow ? getDomIdByOperation(this.operation) : ''; + }, + upRadioId() { + return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.upSelect.domId : ''; + }, + downRadioId() { + return this.dialogShow ? OperationEvent.StationStand.earlyDeparture.downSelect.domId : ''; + }, + title() { + this.earlyDepar = false; + if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) { + this.radio1 = '1'; + return '扣车'; + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { + this.radio1 = '2'; + return '取消扣车'; + } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { + this.earlyDepar = true; + if (this.selected.direction == '01') { + this.radio2 = '2'; + } else { + this.radio2 = '1'; + } + return '提前发车'; + } + return ''; + } + }, + mounted() { + this.$nextTick(() => { + this.$store.dispatch('training/tipReload'); + }); + }, + methods: { + doShow(operate, selected) { + this.selected = selected; + if (!this.dialogShow) { + this.standName = ''; + this.stationName = ''; + if (selected) { + this.standName = selected.name; + } + if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { + this.standName = selected.name; + const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode); + if (station) { + this.stationName = station.name; + } + } - 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'); - mouseCancelState(this.selected); - }, - changeRadio(val) { - const operate = { - type: MapDeviceType.StationStand.type, - operation: '', - val: val - }; - if (val == 1) { - operate.operation = OperationEvent.StationStand.earlyDeparture.upSelect.operation; - } else if (val == 2) { - operate.operation = OperationEvent.StationStand.earlyDeparture.downSelect.operation; - } + 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'); + mouseCancelState(this.selected); + }, + changeRadio(val) { + const operate = { + type: MapDeviceType.StationStand.type, + operation: '', + val: val + }; + if (val == 1) { + operate.operation = OperationEvent.StationStand.earlyDeparture.upSelect.operation; + } else if (val == 2) { + operate.operation = OperationEvent.StationStand.earlyDeparture.downSelect.operation; + } - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } - }).catch(error => { - console.log(error); - }); - }, - commit() { - if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) { - /** 设置扣车*/ - this.setDetainTrain(); - } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { - /** 取消扣车*/ - this.cancelDetainTrain(); - } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { - /** 提前发车*/ - this.earlyDeparture(); - } - }, - // 设置扣车 - setDetainTrain() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.setDetainTrain.menu.operation - }; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } + }).catch(error => { + console.log(error); + }); + }, + commit() { + if (this.operation == OperationEvent.StationStand.setDetainTrain.menu.operation) { + /** 设置扣车*/ + this.setDetainTrain(); + } else if (this.operation == OperationEvent.StationStand.cancelDetainTrain.menu.operation) { + /** 取消扣车*/ + this.cancelDetainTrain(); + } else if (this.operation == OperationEvent.StationStand.earlyDeparture.menu.operation) { + /** 提前发车*/ + this.earlyDeparture(); + } + }, + // 设置扣车 + setDetainTrain() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.setDetainTrain.menu.operation + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - this.doClose(); - if (!valid) { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(error => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 取消扣车 - cancelDetainTrain() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.loading = false; + this.doClose(); + if (!valid) { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 取消扣车 + cancelDetainTrain() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation + }; - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - this.doClose(); - if (!valid) { - this.$refs.noticeInfo.doShow(operate); - } - }).catch(error => { - this.loading = false; - this.doClose(); - this.$refs.noticeInfo.doShow(operate); - }); - }, - // 提前发车 - earlyDeparture() { - const operate = { - send: true, - type: MapDeviceType.StationStand.type, - operation: OperationEvent.StationStand.earlyDeparture.menu.operation - }; + this.loading = true; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.loading = false; + this.doClose(); + if (!valid) { + this.$refs.noticeInfo.doShow(operate); + } + }).catch(() => { + this.loading = false; + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, + // 提前发车 + earlyDeparture() { + const operate = { + send: true, + type: MapDeviceType.StationStand.type, + operation: OperationEvent.StationStand.earlyDeparture.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.StationStand.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); + }); + }, + cancel() { + const operate = { + type: MapDeviceType.StationStand.type, + operation: OperationEvent.Command.cancel.menu.operation + }; - this.loading = false; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - if (valid) { - this.doClose(); - } - }).catch(error => { - this.doClose(); - }); - } - } + this.loading = false; + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } }; \ No newline at end of file + diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/trainCreate.vue b/src/jmap/theme/fuzhou_01/menus/dialog/trainCreate.vue index f8d52fa90..46c366226 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/trainCreate.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/trainCreate.vue @@ -101,7 +101,6 @@ export default { doShow(operate, selected) { this.dialogShow = true; this.selected = selected; - console.log(this.map, 111); /** 加载列车数据*/ this.loadInitData(this.map); diff --git a/src/jmap/utils/parser.js b/src/jmap/utils/parser.js index a763c7280..71aabb2bb 100644 --- a/src/jmap/utils/parser.js +++ b/src/jmap/utils/parser.js @@ -179,8 +179,6 @@ export function updateForList(model, state, liststr) { list.push(deepClone(model)); // 新增 } else if (i >= 0) { list[i] = deepClone(model); // item map 数据 model 页面表单数据 - // state.mapDevice[model.code] = deepClone(model); - // console.log(list[i], '更新'); } } else { state.map[liststr] = [model]; @@ -188,8 +186,6 @@ export function updateForList(model, state, liststr) { } export function updateMapData(state, model) { - // const map = state.map; - // const mapDevice = state.mapDevice; if (state.map && model) { switch (model._type) { case deviceType.Link: updateForList(model, state, 'linkList'); break; diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 0e9300833..b6ae172a4 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -212,7 +212,7 @@ function handleOperation(state, models) { list.push({ operation: 'add', data: deepAssign({}, item) }); } }); - // console.log(list, '步骤数据'); + if (list.length) { if (state.stepData.length >= 15) { // 步骤数据最多储存15步 state.stepData.pop(); diff --git a/src/views/display/menuPlan.vue b/src/views/display/menuPlan.vue index b5d1e3965..1e65bdbb4 100644 --- a/src/views/display/menuPlan.vue +++ b/src/views/display/menuPlan.vue @@ -1,9 +1,9 @@