From 59f5336f8ae6137362bae32a3c3bbe7513c760d0 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Fri, 20 Mar 2020 10:31:19 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E5=8C=97=E4=BA=AC=E4=B8=80=E5=8F=B7?=
=?UTF-8?q?=E7=BA=BF=E4=BF=A1=E5=8F=B7=E6=9C=BA=E5=8C=BA=E6=AE=B5=E6=93=8D?=
=?UTF-8?q?=E4=BD=9C=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../theme/beijing_01/menus/menuSection.vue | 47 +--
.../theme/beijing_01/menus/menuSignal.vue | 280 ++++--------------
.../beijing_01/menus/utils/menuOperate.js | 106 +++++--
.../config/broadcast/centerHome.vue | 10 +-
4 files changed, 156 insertions(+), 287 deletions(-)
diff --git a/src/jmapNew/theme/beijing_01/menus/menuSection.vue b/src/jmapNew/theme/beijing_01/menus/menuSection.vue
index 200a9d641..7561350c1 100644
--- a/src/jmapNew/theme/beijing_01/menus/menuSection.vue
+++ b/src/jmapNew/theme/beijing_01/menus/menuSection.vue
@@ -20,7 +20,7 @@ import { DeviceMenu } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
-import {menuOperate} from './utils/menuOperate';
+import {menuOperate, commitOperate} from './utils/menuOperate';
export default {
name: 'SectionMenu',
@@ -173,7 +173,7 @@ export default {
// },
// 故障解锁
faultUnlock(selectType) {
- this.commitOperate(menuOperate.Section.fault, selectType, [selectType.code]).then((data)=>{
+ commitOperate(menuOperate.Section.fault, selectType, [selectType.code]).then((data)=>{
this.$refs.sectionControl.doShow(data.operate, data.selected);
});
},
@@ -187,56 +187,37 @@ export default {
},
// 切除
split() {
- this.commitOperate(menuOperate.Section.split, this.selected, [this.selected.code]).then((data)=>{
- this.$refs.sectionControl.doShow(data.operate, data.selected);
+ commitOperate(menuOperate.Section.split, {sectionCode:this.selected.code}, 0).then((data)=>{
+ this.$refs.sectionControl.doShow(data.operate, this.selected);
});
},
alxeEffective() {
- this.commitOperate(menuOperate.Section.alxeEffective, this.selected, [this.selected.code]).then((data)=>{
- this.$refs.alxeEffective.doShow(data.operate, data.selected);
+ commitOperate(menuOperate.Section.alxeEffective, {sectionCode:this.selected.code}, 0).then((data)=>{
+ this.$refs.alxeEffective.doShow(data.operate, this.selected);
});
},
// 激活
active() {
- this.commitOperate(menuOperate.Section.active, this.selected, [this.selected.code]).then((data)=>{
- this.$refs.sectionControl.doShow(data.operate, data.selected);
+ commitOperate(menuOperate.Section.active, {sectionCode:this.selected.code}, 0).then((data)=>{
+ this.$refs.sectionControl.doShow(data.operate, this.selected);
});
},
// 区段计轴预复位
axlePreReset(selectType) {
- this.commitOperate(menuOperate.Section.axlePreReset, selectType, [selectType.code]).then((data)=>{
- this.$refs.sectionControl.doShow(data.operate, data.selected);
+ commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 0).then((data)=>{
+ this.$refs.sectionControl.doShow(data.operate, selectType);
});
},
// 区段计轴预复位
// axlePreReset() {
- // this.commitOperate(menuOperate.Section.axlePreReset, this.selected, [this.selected.code]).then((data)=>{
- // this.$refs.sectionCmdControl.doShow(data.operate, data.selected);
+ // this.commitOperate(menuOperate.Section.axlePreReset, {sectionCode:this.selected.code},0).then((data)=>{
+ // this.$refs.sectionCmdControl.doShow(data.operate, this.selected);
// });
// },
// 设置速度
setSpeed() {
- this.commitOperate(menuOperate.Section.setSpeed, this.selected, [this.selected.code]).then((data)=>{
- this.$refs.speedLimitControl.doShow(data.operate, data.selected);
- });
- },
- commitOperate(operate, selected, paramList) {
- const step = {
- start: true,
- operation: operate.operation,
- param:{}
- };
- operate.param.forEach((each, index)=>{
- step.param[each] = paramList[index];
- });
- const obj = this;
- return new Promise(function(resolve, reject) {
- obj.$store.dispatch('training/nextNew', step).then(({ valid }) => {
- if (valid) {
- obj.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- resolve({operate:step, selected:selected});
- }
- });
+ commitOperate(menuOperate.Section.setSpeed, {sectionCode:this.selected.code}, 0).then((data)=>{
+ this.$refs.speedLimitControl.doShow(data.operate, this.selected);
});
}
}
diff --git a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue
index 0a9f82256..bf35a12d4 100644
--- a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue
+++ b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue
@@ -25,6 +25,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu } from '@/scripts/ConstDic';
import { mouseCancelState } from './utils/menuItemStatus';
import PasswordBox from './dialog/childDialog/passwordInputBox.vue';
+import {menuOperate, commitOperate} from './utils/menuOperate';
export default {
name: 'SignalMenu',
@@ -294,7 +295,6 @@ export default {
}
};
-
mouseCancelState(this.selected);
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@@ -332,278 +332,118 @@ export default {
},
// 设置进路
arrangementRoute() {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.arrangementRoute.menu.operation
- // param: {
- // signalCode: `${this.selected.code}`
- // }
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- if (valid) {
- const routes = [];
- this.routeList.forEach(elem => {
- if (elem.startSignalCode === this.selected.code) {
- routes.push(elem);
- }
- });
- this.$refs.routeSelection.doShow(operate, this.selected, routes);
- }
- }).catch(() => {
- this.$refs.noticeInfo.doShow(operate);
+ commitOperate(menuOperate.Signal.arrangementRoute, {signalCode:this.selected.code}, 0).then((data)=>{
+ const routes = [];
+ this.routeList.forEach(elem => {
+ if (elem.startSignalCode === this.selected.code) {
+ routes.push(elem);
+ }
+ });
+ this.$refs.routeSelection.doShow(data.operate, this.selected, routes);
});
},
// 现地设置进路
setRoute(route) {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.arrangementRoute.menu.operation,
- param: {
- routeCode: route.code
- },
- cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- }).catch((error) => {
- this.$refs.noticeInfo.doShow(operate, error.message);
+ commitOperate(menuOperate.Signal.arrangementRoute, {routeCode:route.code}, [], 3).then((data)=>{
+ }).catch(error=>{
+ this.$refs.noticeInfo.doShow({}, error.message);
});
},
// 取消进路
cancelTrainRoute() {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
- param: {
- signalCode: `${this.selected.code}`
- }
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- if (valid) {
- this.$refs.routeControl.doShow(operate, this.selected);
- }
+ commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:this.selected.code}, 0).then((data)=>{
+ this.$refs.routeControl.doShow(data.operate, this.selected);
});
},
// 现地取消进路
cancelTrainRouteByLow(selectType) {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
- param: {
- signalCode: selectType.code
- },
- cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- }
- }).catch((error) => {
- this.$refs.noticeInfo.doShow(operate, error.message);
+ commitOperate(menuOperate.Signal.cancelTrainRoute, {signalCode:selectType.code}, 3).then((data)=>{
+ }).catch(error=>{
+ this.$refs.noticeInfo.doShow({}, error.message);
});
},
// 现地总人解
humanTrainRoute(selectType) {
- const step = {
- start: true,
- code: `${this.selected.code}`,
- operation: OperationEvent.Signal.humanTrainRoute.menu.operation,
- param: {
- signalCode: `${this.selected.code}`
- }
- };
- this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- if (valid) {
- step.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
- this.$refs.password.doShow(step);
- }
+ commitOperate(menuOperate.Signal.humanTrainRoute, {signalCode:selectType.code}, 0).then((data)=>{
+ data.operate.cmdType = CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE;
+ this.$refs.password.doShow(data.operate);
});
},
// 现地信号重开操作
reopenSignalByRoute(selectType) {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.reopenSignal.menu.operation,
- param: {
- signalCode: selectType.code
- },
- cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- }
- }).catch((error) => {
- this.$refs.noticeInfo.doShow(operate, error.message);
+ commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then((data)=>{
+ }).catch(error=>{
+ this.$refs.noticeInfo.doShow({}, error.message);
});
},
// 信号重开
reopenSignal() {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.reopenSignal.menu.operation,
- param: {
- signalCode: `${this.selected.code}`
- }
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- this.$refs.routeControl.doShow(operate, this.selected);
- }
+ commitOperate(menuOperate.Signal.reopenSignal, {signalCode:this.selected.code}, 0).then((data)=>{
+ this.$refs.routeControl.doShow(data.operate, this.selected);
});
},
// 信号关灯
signalClose() {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.signalClose.menu.operation,
- param: {
- signalCode: `${this.selected.code}`
- }
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- this.$refs.routeControl.doShow(operate, this.selected);
- }
+ commitOperate(menuOperate.Signal.signalClose, {signalCode:this.selected.code}, 0).then((data)=>{
+ this.$refs.routeControl.doShow(data.operate, this.selected);
});
},
// 现地信号关灯
signalCloseByLow(selectType) {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.signalClose.menu.operation,
- param: {
- signalCode: selectType.code
- },
- cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- }
- }).catch((error) => {
- this.$refs.noticeInfo.doShow(operate, error.message);
+ commitOperate(menuOperate.Signal.signalClose, {signalCode:selectType.code}, 3).then((data)=>{
+ }).catch(error=>{
+ this.$refs.noticeInfo.doShow({}, error.message);
});
},
// 进路交人工控
humanControl() {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.humanControl.menu.operation,
- param: {
- signalCode: `${this.selected.code}`
- }
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- const routes = [];
- this.routeList.forEach(elem => {
- if (elem.startSignalCode === this.selected.code) {
- routes.push(elem);
- }
- });
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- this.$refs.routeHandControl.doShow(operate, this.selected, routes);
- }
+ commitOperate(menuOperate.Signal.humanControl, {signalCode:this.selected.code}, 0).then((data)=>{
+ const routes = [];
+ this.routeList.forEach(elem => {
+ if (elem.startSignalCode === this.selected.code) {
+ routes.push(elem);
+ }
+ });
+ this.$refs.routeHandControl.doShow(data.operate, this.selected, routes);
});
},
// 进路交自动控
atsAutoControl() {
- const operate = {
- start: true,
- code: this.selected.code,
- operation: OperationEvent.Signal.atsAutoControl.menu.operation,
- param: {
- signalCode: `${this.selected.code}`
- }
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- const routes = [];
- this.routeList.forEach(elem => {
- if (elem.startSignalCode === this.selected.code) {
- routes.push(elem);
- }
- });
- this.$refs.routeHandControl.doShow(operate, this.selected, routes);
- }
+ commitOperate(menuOperate.Signal.atsAutoControl, {signalCode:this.selected.code}, 0).then((data)=>{
+ const routes = [];
+ this.routeList.forEach(elem => {
+ if (elem.startSignalCode === this.selected.code) {
+ routes.push(elem);
+ }
+ });
+ this.$refs.routeHandControl.doShow(data.operate, this.selected, routes);
});
},
// 设置通过模式
singalPassModel(selectType) {
- const operate = {
- start: true,
- over: true,
- operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
- param: {
- signalCode:selectType.code
- },
- cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- }
- }).catch(error => {
- this.$refs.noticeInfo.doShow(operate, error.message);
+ commitOperate(menuOperate.Signal.setAutoInterlock, {signalCode:selectType.code}, 3).then((data)=>{
+ }).catch(error=>{
+ this.$refs.noticeInfo.doShow({}, error.message);
});
},
// 取消通过模式
singalCancelPassModel(selectType) {
- const operate = {
- start: true,
- over: true,
- operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
- param: {
- signalCode:selectType.code
- },
- cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
- };
- this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- }
- }).catch(error => {
- this.$refs.noticeInfo.doShow(operate, error.message);
+ commitOperate(menuOperate.Signal.cancelAutoInterlock, {signalCode:selectType.code}, 3).then((data)=>{
+ }).catch(error=>{
+ this.$refs.noticeInfo.doShow({}, error.message);
});
},
// 查询进路状态
detail() {
- const step = {
- start: true,
- code: `${this.selected.code}`,
- operation: OperationEvent.Signal.detail.menu.operation,
- param: {
- signalCode: `${this.selected.code}`
- }
- };
- this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
- if (valid) {
- this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
- const routes = [];
- this.routeList.forEach(elem => {
- if (elem.startSignalCode === this.selected.code) {
- routes.push(elem);
- }
- });
- this.$refs.routeDetail.doShow(step, this.selected, routes);
- }
+ commitOperate(menuOperate.Signal.detail, {signalCode:this.selected.code}, 0).then((data)=>{
+ const routes = [];
+ this.routeList.forEach(elem => {
+ if (elem.startSignalCode === this.selected.code) {
+ routes.push(elem);
+ }
+ });
+ this.$refs.routeDetail.doShow(data.operate, this.selected, routes);
});
},
passWordCommit(data) {
diff --git a/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js b/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js
index 9befae7c6..b6936687f 100644
--- a/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js
+++ b/src/jmapNew/theme/beijing_01/menus/utils/menuOperate.js
@@ -1,4 +1,3 @@
-import Vue from 'vue';
import store from '@/store';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@@ -42,34 +41,83 @@ export const menuOperate = {
param:['sectionCode'],
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
}
+ },
+ Signal:{
+ arrangementRoute:{
+ // 排列进路
+ operation: OperationEvent.Signal.arrangementRoute.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
+ },
+ cancelTrainRoute:{
+ // 取消进路
+ operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
+ },
+ humanTrainRoute:{
+ // 总人解
+ operation: OperationEvent.Signal.humanTrainRoute.menu.operation,
+ cmdType:CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
+ },
+ reopenSignal:{
+ // 信号重开
+ operation: OperationEvent.Signal.reopenSignal.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
+ },
+ signalClose:{
+ // 信号关灯
+ operation: OperationEvent.Signal.signalClose.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
+ },
+ humanControl:{
+ // 进路交人工控
+ operation: OperationEvent.Signal.humanControl.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
+ },
+ atsAutoControl:{
+ // 进路交自动控
+ operation: OperationEvent.Signal.atsAutoControl.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
+ },
+ setAutoInterlock:{
+ // 设置通过模式
+ operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
+ },
+ cancelAutoInterlock:{
+ // 取消通过模式
+ operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
+ cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
+ },
+ detail:{
+ // 查询进路状态
+ operation: OperationEvent.Signal.detail.menu.operation
+ }
}
};
-// export function commitOperate(menuoperate, paramList, selected, callback) {
-// return new Promise((resolve, reject) => {
-// try {
-// const operate = {
-// start: true,
-// operation: OperationEvent.Section.split.menu.operation,
-// param: {
-// sectionCode: `${this.selected.code}`
-// }
-// };
-// this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
-// if (valid) {
-// this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
-// resolve(true);
-// // callback({operate:operate, selected:selected});
-// // this.$refs.sectionControl.doShow(operate, this.selected);
-// }
-// }).catch((error) => {
-// this.loading = false;
-// this.doClose();
-// this.$refs.noticeInfo.doShow(operate, error.message);
-// });
-// } catch (error) {
-// reject(error);
-// }
-// });
-
-// }
+export function commitOperate(operate, paramList, over) {
+ const step = {
+ start: true,
+ operation: operate.operation,
+ param:{}
+ };
+ step.param = paramList;
+ // isOnce 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作
+ if (over != 0) {
+ delete step.start;
+ }
+ if (over == 2 || over == 3) {
+ step.over = true;
+ step.cmdType = operate.cmdType;
+ }
+ return new Promise(function(resolve, reject) {
+ store.dispatch('training/nextNew', step).then(({ valid }) => {
+ if (valid) {
+ store.dispatch('menuOperation/handleBreakFlag', { break: true });
+ resolve({operate:step});
+ }
+ }).catch(error=>{
+ reject(error);
+ });
+ });
+}
diff --git a/src/views/iscs/iscsSystem/config/broadcast/centerHome.vue b/src/views/iscs/iscsSystem/config/broadcast/centerHome.vue
index ce54fb38f..2ce124d25 100644
--- a/src/views/iscs/iscsSystem/config/broadcast/centerHome.vue
+++ b/src/views/iscs/iscsSystem/config/broadcast/centerHome.vue
@@ -12,16 +12,16 @@