From 0c6de0e011f641016dc9d1404a26be9a4e676001 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 22 Oct 2019 13:41:23 +0800 Subject: [PATCH] =?UTF-8?q?desc:=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/childDialog/passwordInputBox.vue | 31 +- .../chengdu_03/menus/dialog/routeControl.vue | 82 +---- .../chengdu_03/menus/dialog/routeGuide.vue | 23 +- .../menus/dialog/sectionControl.vue | 21 +- .../chengdu_03/menus/dialog/switchControl.vue | 22 +- .../chengdu_03/menus/dialog/trainCreate.vue | 297 ++++++++-------- .../menus/dialog/trainEditNumber.vue | 326 +++++++++--------- .../theme/chengdu_03/menus/menuButton.vue | 56 ++- .../fuzhou_01/menus/dialog/trainControl.vue | 143 ++++---- .../fuzhou_01/menus/dialog/trainCreate.vue | 27 +- src/scripts/ConstDic.js | 8 +- src/scripts/GlobalPlugin.js | 2 +- src/scripts/OperationConfig.js | 215 +++++++++++- .../converter/SectionOperationConverter.js | 2 +- .../SignalRouteOperationConverter.js | 104 +++--- .../converter/TrainOperationConverter.js | 15 +- src/scripts/plugin/trainingOperateHandler.js | 4 + src/utils/baseUrl.js | 4 +- src/views/display/designIndex.vue | 93 +++-- .../lesson/trainingrecord/category/tree.vue | 10 +- src/views/map/product/edit.vue | 12 +- src/views/map/product/tree.vue | 8 +- src/views/trainingPlatform/index.vue | 126 +++---- 23 files changed, 928 insertions(+), 703 deletions(-) diff --git a/src/jmap/theme/chengdu_03/menus/dialog/childDialog/passwordInputBox.vue b/src/jmap/theme/chengdu_03/menus/dialog/childDialog/passwordInputBox.vue index 68a8db975..b706da32d 100644 --- a/src/jmap/theme/chengdu_03/menus/dialog/childDialog/passwordInputBox.vue +++ b/src/jmap/theme/chengdu_03/menus/dialog/childDialog/passwordInputBox.vue @@ -107,11 +107,7 @@ export default { } }, domIdConfirm() { - if (this.operate && this.operate.operateCode) { - return this.dialogShow ? getDomIdByOperation(this.operate.operateCode) : ''; - } else { - return this.dialogShow ? OperationEvent.Command.close.confirm.domId : ''; - } + return this.dialogShow ? getDomIdByOperation(this.operate.operateNext) : ''; } }, mounted() { @@ -135,29 +131,10 @@ export default { this.$store.dispatch('training/emitTipFresh'); }, commit() { - const operate = { - send: this.operate.operateCode != null, - type: this.operate.type, - operation: this.operate.operateCode != null ? this.operate.operateCode : OperationEvent.Command.close.confirm.operation - }; - if (this.operate.val) { - operate['val'] = this.operate.val; - } - if (this.passwordCheck === this.correctPassword) { - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$emit('checkOver'); - this.doClose(); - this.inputClear(); - } - }).catch(() => { - this.loading = false; - this.$refs.noticeInfo && this.$refs.noticeInfo.doShow(operate); - }); + this.$emit('checkOver', this.operate); + this.doClose(); + this.inputClear(); } else { this.showMistake = true; } diff --git a/src/jmap/theme/chengdu_03/menus/dialog/routeControl.vue b/src/jmap/theme/chengdu_03/menus/dialog/routeControl.vue index d959ba7e3..6af5a13b5 100644 --- a/src/jmap/theme/chengdu_03/menus/dialog/routeControl.vue +++ b/src/jmap/theme/chengdu_03/menus/dialog/routeControl.vue @@ -27,7 +27,7 @@ - + @@ -79,10 +79,6 @@ export default { return '信号封锁'; } else if (this.operation == OperationEvent.Signal.unlock.menu.operation) { return '信号解封'; - } else if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - return '进路收人工控'; - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - return '进路交自动控'; } else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) { return '信号关灯'; } @@ -138,17 +134,26 @@ export default { } else if (this.operation == OperationEvent.Signal.unlock.menu.operation) { /** 信号解封*/ this.unlock(); - } else if (this.operation == OperationEvent.Signal.humanControl.menu.operation) { - /** 进路收人工控*/ - this.humanControl(); - } else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) { - /** 进路交自动控*/ - this.atsAutoControl(); } else if (this.operation == OperationEvent.Signal.signalClose.menu.operation) { /** 信号关灯*/ this.signalClose(); } }, + passWordCommit(data) { + const operate = { + send: true, + type: data.type, + operation: data.operateNext + }; + + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { this.doClose(); } + }).catch(() => { + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + + }, // 取消列车进路 cancelTrainRoute() { if (this.$store.state.training.prdType == '01') { @@ -174,7 +179,6 @@ export default { this.doClose(); } }).catch(() => { - this.loading = false; this.doClose(); this.$refs.noticeInfo.doShow(operate); }); @@ -194,7 +198,6 @@ export default { this.doClose(); } }).catch(() => { - this.loading = false; this.doClose(); this.$refs.noticeInfo.doShow(operate); }); @@ -204,7 +207,7 @@ export default { const operate = { type: MapDeviceType.Signal.type, operation: OperationEvent.Signal.humanTrainRoute.menu.operation, - operateCode: OperationEvent.Signal.humanTrainRoute.confirm.operation + operateNext: OperationEvent.Signal.humanTrainRoute.confirm.operation }; this.$store.dispatch('training/next', operate).then(({ valid }) => { @@ -213,7 +216,6 @@ export default { this.$refs.password.doShow(operate); } }).catch(() => { - this.loading = false; this.doClose(); this.$refs.noticeInfo.doShow(operate); }); @@ -233,7 +235,6 @@ export default { this.doClose(); } }).catch(() => { - this.loading = false; this.doClose(); this.$refs.noticeInfo.doShow(operate); }); @@ -243,7 +244,7 @@ export default { const operate = { type: MapDeviceType.Signal.type, operation: OperationEvent.Signal.lock.menu.operation, - operateCode: OperationEvent.Signal.lock.confirm.operation + operateNext: OperationEvent.Signal.lock.confirm.operation }; this.$store.dispatch('training/next', operate).then(({ valid }) => { @@ -259,7 +260,7 @@ export default { const operate = { type: MapDeviceType.Signal.type, operation: OperationEvent.Signal.unlock.menu.operation, - operateCode: OperationEvent.Signal.unlock.confirm.operation + operateNext: OperationEvent.Signal.unlock.confirm.operation }; this.$store.dispatch('training/next', operate).then(({ valid }) => { @@ -270,51 +271,6 @@ export default { }).catch(() => { }); }, - // 进路收人工控 - humanControl() { - const operate = { - type: MapDeviceType.Signal.type, - operation: OperationEvent.Signal.humanControl.menu.operation, - operateCode: OperationEvent.Signal.humanControl.confirm.operation, - val: this.operateCode - }; - - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.password.doShow(operate); - } - }).catch(() => { - 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, - operateCode: OperationEvent.Signal.atsAutoControl.confirm.operation, - val: this.operateCode - }; - - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { - this.loading = false; - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.password.doShow(operate); - } - }).catch(() => { - this.loading = false; - // this.doClose(); - // this.$refs.noticeInfo.doShow(operate); - }); - }, // 信号关灯 signalClose() { const operate = { diff --git a/src/jmap/theme/chengdu_03/menus/dialog/routeGuide.vue b/src/jmap/theme/chengdu_03/menus/dialog/routeGuide.vue index a17a5c0a5..847ab9fd2 100644 --- a/src/jmap/theme/chengdu_03/menus/dialog/routeGuide.vue +++ b/src/jmap/theme/chengdu_03/menus/dialog/routeGuide.vue @@ -45,7 +45,7 @@ - + @@ -149,6 +149,25 @@ export default { this.$store.dispatch('training/emitTipFresh'); }); }, + passWordCommit(data) { + const operate = { + send: true, + type: data.type, + operation: data.operateNext + }; + + 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); + }); + }, doClose() { this.loading = false; this.dialogShow = false; @@ -179,7 +198,7 @@ export default { const operate = { type: MapDeviceType.Signal.type, operation: OperationEvent.Signal.guide.menu.operation, - operateCode: OperationEvent.Signal.guide.confirm.operation + operateNext: OperationEvent.Signal.guide.confirm.operation }; this.loading = true; diff --git a/src/jmap/theme/chengdu_03/menus/dialog/sectionControl.vue b/src/jmap/theme/chengdu_03/menus/dialog/sectionControl.vue index 3b262fa86..ddf690e1e 100644 --- a/src/jmap/theme/chengdu_03/menus/dialog/sectionControl.vue +++ b/src/jmap/theme/chengdu_03/menus/dialog/sectionControl.vue @@ -27,7 +27,7 @@ - + @@ -129,6 +129,22 @@ export default { this.fault(); } }, + passWordCommit(data) { + const operate = { + send: true, + type: data.type, + operation: data.operateNext + }; + + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, // 道岔单锁 lock() { const operate = { @@ -192,10 +208,9 @@ export default { // 区故解 fault() { const operate = { - // send: true, type: MapDeviceType.Section.type, operation: OperationEvent.Section.fault.menu.operation, - operateCode: OperationEvent.Section.fault.confirm.operation + operateNext: OperationEvent.Section.fault.confirm.operation }; this.loading = true; diff --git a/src/jmap/theme/chengdu_03/menus/dialog/switchControl.vue b/src/jmap/theme/chengdu_03/menus/dialog/switchControl.vue index 4de269dad..911e471b5 100644 --- a/src/jmap/theme/chengdu_03/menus/dialog/switchControl.vue +++ b/src/jmap/theme/chengdu_03/menus/dialog/switchControl.vue @@ -31,7 +31,7 @@ - + @@ -153,6 +153,22 @@ export default { this.openPasswordBox(this.operation, OperationEvent.Switch.fault.confirm.operation); } }, + passWordCommit(data) { + const operate = { + send: true, + type: data.type, + operation: data.operateNext + }; + + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + this.$refs.noticeInfo.doShow(operate); + }); + }, // 道岔单锁 lock() { const operate = { @@ -311,11 +327,11 @@ export default { }); }, // 打开密码输入框 - openPasswordBox(operation, code) { + openPasswordBox(operation, operateNext) { const operate = { type: MapDeviceType.Switch.type, operation: operation, - operateCode: code + operateNext: operateNext }; this.loading = true; this.$store.dispatch('training/next', operate).then(({ valid }) => { diff --git a/src/jmap/theme/chengdu_03/menus/dialog/trainCreate.vue b/src/jmap/theme/chengdu_03/menus/dialog/trainCreate.vue index c778ce917..210adccf0 100644 --- a/src/jmap/theme/chengdu_03/menus/dialog/trainCreate.vue +++ b/src/jmap/theme/chengdu_03/menus/dialog/trainCreate.vue @@ -1,158 +1,153 @@ \ No newline at end of file + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } +}; + diff --git a/src/jmap/theme/chengdu_03/menus/dialog/trainEditNumber.vue b/src/jmap/theme/chengdu_03/menus/dialog/trainEditNumber.vue index 2cf5460f1..f13e64a16 100644 --- a/src/jmap/theme/chengdu_03/menus/dialog/trainEditNumber.vue +++ b/src/jmap/theme/chengdu_03/menus/dialog/trainEditNumber.vue @@ -1,180 +1,174 @@