From 4d4c10f2d5d86060765ba83968c47a840f1ed873 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 27 Feb 2020 20:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=88=E5=B0=94=E6=BB=A8=E7=BA=BF=E8=B7=AF?= =?UTF-8?q?=20=E4=BF=A1=E5=8F=B7=E6=9C=BA=E6=93=8D=E4=BD=9C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/childDialog/confirmControl.vue | 56 ++++++------ .../menus/dialog/routeCmdControl.vue | 12 +-- .../haerbin_01/menus/dialog/routeControl.vue | 18 ++-- .../haerbin_01/menus/dialog/routeLock.vue | 10 +-- .../theme/haerbin_01/menus/menuSignal.vue | 85 ++++++++++--------- src/utils/stomp.js | 1 + 6 files changed, 92 insertions(+), 90 deletions(-) diff --git a/src/jmapNew/theme/haerbin_01/menus/dialog/childDialog/confirmControl.vue b/src/jmapNew/theme/haerbin_01/menus/dialog/childDialog/confirmControl.vue index 6ef44707a..cf2e8cd93 100644 --- a/src/jmapNew/theme/haerbin_01/menus/dialog/childDialog/confirmControl.vue +++ b/src/jmapNew/theme/haerbin_01/menus/dialog/childDialog/confirmControl.vue @@ -162,15 +162,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 信号关灯 @@ -182,15 +182,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 信号重开 @@ -202,15 +202,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 取消进路 @@ -222,15 +222,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 进路交人工控 @@ -242,15 +242,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 进路交ATS自动控 @@ -262,15 +262,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 设置运行等级 @@ -283,15 +283,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 停站时间 @@ -304,15 +304,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, // 设置折返策略 @@ -325,15 +325,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, cancel() { @@ -341,7 +341,7 @@ export default { operation: OperationEvent.Command.cancel.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); } diff --git a/src/jmapNew/theme/haerbin_01/menus/dialog/routeCmdControl.vue b/src/jmapNew/theme/haerbin_01/menus/dialog/routeCmdControl.vue index cdc42faa3..064111fc2 100644 --- a/src/jmapNew/theme/haerbin_01/menus/dialog/routeCmdControl.vue +++ b/src/jmapNew/theme/haerbin_01/menus/dialog/routeCmdControl.vue @@ -279,7 +279,7 @@ export default { this.setMessage(this.$t('tip.firstConfirmTip')); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); if (this.operation == OperationEvent.Signal.unlock.menu.operation) { @@ -299,7 +299,7 @@ export default { this.setMessage(this.$t('tip.firstConfirmTip')); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickReleaseCommand'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.setButtonEnable({ step: 1 }); @@ -325,7 +325,7 @@ export default { this.setMessage(this.$t('tip.secondConfirmTip')); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickFirstConfirm'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.timeCountCommand = -1; @@ -355,7 +355,7 @@ export default { } this.setMessage(''); this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.timeCountCommand = -1; this.timeCountConfirm = -1; this.setButtonEnable({ step: -1 }); @@ -385,7 +385,7 @@ export default { } this.writeRecord({ order: ++this.order, date: now(), context: this.$t('menu.clickSuspend'), result: '' }); - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.setButtonEnable({ step: 0 }); @@ -402,7 +402,7 @@ export default { operation: OperationEvent.Command.close.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); } diff --git a/src/jmapNew/theme/haerbin_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/haerbin_01/menus/dialog/routeControl.vue index 5675ce39a..4612aba1e 100644 --- a/src/jmapNew/theme/haerbin_01/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/haerbin_01/menus/dialog/routeControl.vue @@ -161,7 +161,7 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -182,7 +182,7 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -201,7 +201,7 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -220,7 +220,7 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -240,7 +240,7 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -260,7 +260,7 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -280,7 +280,7 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -301,7 +301,7 @@ export default { this.doClose(); this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); @@ -318,7 +318,7 @@ export default { operation: OperationEvent.Command.close.menu.operation }; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { this.doClose(); } diff --git a/src/jmapNew/theme/haerbin_01/menus/dialog/routeLock.vue b/src/jmapNew/theme/haerbin_01/menus/dialog/routeLock.vue index cb3a749e9..22f36f24c 100644 --- a/src/jmapNew/theme/haerbin_01/menus/dialog/routeLock.vue +++ b/src/jmapNew/theme/haerbin_01/menus/dialog/routeLock.vue @@ -110,8 +110,8 @@ export default { } /** status 04:封锁*/ - const signal = (selected || {}).status; - this.tempData = [{ code: selected.code, name: selected.name, status: signal.status != '04' ? this.$t('menu.unblocked') : this.$t('menu.blocked') }]; + const signal = selected; + this.tempData = [{ code: selected.code, name: selected.name, status: signal.blockade ? this.$t('menu.blocked') : this.$t('menu.unblocked') }]; const timer = setInterval(() => { if (this.$refs.table) { this.$refs.table.setCurrentRow(this.tempData[0]); @@ -138,15 +138,15 @@ export default { }; this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { this.loading = false; if (valid) { this.doClose(); } - }).catch(() => { + }).catch(error => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(operate, [error.message]); }); }, cancel() { diff --git a/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue b/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue index 34a9dcc31..4d8b6811c 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue @@ -230,10 +230,10 @@ export default { operation: OperationEvent.Signal.stoppage.menu.operation, cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { @@ -251,10 +251,10 @@ export default { operation: OperationEvent.Signal.cancelStoppage.menu.operation, cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { @@ -271,11 +271,11 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.arrangementRoute.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); if (valid) { querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { @@ -294,10 +294,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.cancelTrainRoute.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); if (valid) { this.$refs.routeControl.doShow(step, this.selected); @@ -308,17 +308,17 @@ export default { lock() { const step = { start: true, - code: `${this.selected.code}`, + code: this.selected.code, operation: OperationEvent.Signal.lock.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: this.selected.code } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.routeLock.doShow(step.operation, this.selected); + this.$refs.routeLock.doShow(step, this.selected); } }).catch(() => { this.$refs.noticeInfo.doShow(step); @@ -331,10 +331,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.unlock.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.routeCmdControl.doShow(step, this.selected); @@ -348,10 +348,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.reopenSignal.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.routeControl.doShow(step, this.selected); @@ -365,10 +365,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.guide.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); if (valid) { this.$refs.routeCmdControl.doShow(step, this.selected); @@ -382,10 +382,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.setAutoInterlock.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.routeControl.doShow(step, this.selected); @@ -399,10 +399,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.routeControl.doShow(step, this.selected); @@ -413,13 +413,15 @@ export default { setAutoTrigger() { const step = { start: true, + over: true, code: `${this.selected.code}`, operation: OperationEvent.Signal.setAutoTrigger.menu.operation, param: { - Signal_Code: `${this.selected.code}` - } + signalCode: `${this.selected.code}` + }, + cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.routeControl.doShow(step, this.selected); @@ -433,10 +435,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.routeControl.doShow(step, this.selected); @@ -450,10 +452,10 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.signalClose.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$refs.routeControl.doShow(step, this.selected); @@ -467,16 +469,16 @@ export default { code: `${this.selected.code}`, operation: OperationEvent.Signal.humanControl.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid, response }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { - const tempData = resp.data; - this.$refs.routeHandControl.doShow(step, this.selected, tempData); - }); + // querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + // this.$refs.routeHandControl.doShow(step, this.selected, tempData); + // }); } }); }, @@ -484,20 +486,19 @@ export default { atsAutoControl() { const step = { start: true, - Signal_Code: `${this.selected.code}`, code: `${this.selected.code}`, operation: OperationEvent.Signal.atsAutoControl.menu.operation, param: { - Signal_Code: `${this.selected.code}` + signalCode: `${this.selected.code}` } }; - this.$store.dispatch('training/next', step).then(({ valid, response }) => { + this.$store.dispatch('training/nextNew', step).then(({ valid, response }) => { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { - const tempData = resp.data; - this.$refs.routeHandControl.doShow(step, this.selected, tempData); - }); + // querySignalStatus(this.group, {signalCode: `${this.selected.code}`}).then(resp => { + // const tempData = resp.data; + // this.$refs.routeHandControl.doShow(step, this.selected, tempData); + // }); } }); } diff --git a/src/utils/stomp.js b/src/utils/stomp.js index cc46671df..5adb484fa 100644 --- a/src/utils/stomp.js +++ b/src/utils/stomp.js @@ -22,6 +22,7 @@ export function creatSubscribe(topic, header) { function callback(Response) { if (store) { var data = JSON.parse(Response.body); + console.log(data); store.dispatch('socket/setStomp', data); } else { callback(Response);