From 8059353f0696aa28a7988de95f8e1ef8d13bb006 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 15 May 2020 20:45:59 +0800 Subject: [PATCH 01/40] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/ningbo_01/menus/menuSignal.vue | 2 +- src/store/modules/socket.js | 4 ++++ .../newMap/displayNew/chatView/chatBox.vue | 17 ++++++++++++++ .../displayNew/chatView/chatContent.vue | 11 ++++++--- .../newMap/displayNew/demon/addQuest.vue | 11 ++++++++- src/views/newMap/displayNew/designIndex.vue | 5 ++-- src/views/newMap/displayNew/menuDemon.vue | 23 ++++++++++++++----- src/views/newMap/displayNew/menuSchema.vue | 2 +- 8 files changed, 61 insertions(+), 14 deletions(-) diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index 26cb43946..7bbd70f20 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -215,7 +215,7 @@ export default { self.doClose(); }; }, - initMenu() { + initMenu() { this.menu = MenuContextHandler.covert(this.menuNormal); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 8c21a5287..5cb0d22e5 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -29,6 +29,9 @@ function handle(state, data) { case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息 handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息 break; + case 'Simulation_Script_Finish': // 剧本执行完成推送消息 + state.scriptFinish++; // 剧本执行完成推送消息 + break; case 'Simulation_RunFact': // 仿真-列车实际到发车站消息 // let runFactMsg = msg; // if (runFactMsg.constructor !== Array ) { @@ -195,6 +198,7 @@ const socket = { roleList: [], // 设置角色信息 simulationRoleList:[], // 设置仿真的聊天角色信息 simulationScriptTip:{}, // 剧本推送提示信息 + scriptFinish:0, // 剧本执行完成提示信息 jointRoomPrepare: false, // 演练房间准备状态 equipmentStatus: [], // 仿真-设备状态消息 trainStationList: [], // 仿真-列车实际到发车站消息 diff --git a/src/views/newMap/displayNew/chatView/chatBox.vue b/src/views/newMap/displayNew/chatView/chatBox.vue index 649939ca4..4f713fb2f 100644 --- a/src/views/newMap/displayNew/chatView/chatBox.vue +++ b/src/views/newMap/displayNew/chatView/chatBox.vue @@ -46,6 +46,7 @@ From 3e64c6da0247500ce9b46befd8c3ebc759655111 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 18 May 2020 11:32:46 +0800 Subject: [PATCH 05/40] =?UTF-8?q?=E8=A5=BF=E5=AE=89=E4=B8=89=E5=8F=B7?= =?UTF-8?q?=E7=BA=BF=20=E4=BB=BF=E7=9C=9F=E7=B3=BB=E7=BB=9F=E8=BD=A6?= =?UTF-8?q?=E6=AC=A1=E4=B8=8E=E5=AE=9E=E9=99=85=E8=BD=A6=E6=AC=A1=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E7=AC=A6=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/xian_01.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index 022134b49..1c97a6556 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -558,7 +558,8 @@ class SkinCode extends defaultStyle { lrPadding: 1, // 两边间隔 upPadding: 1, // 上边距离 trainBodyFillColor: '#000000', // 列车车身填充颜色 - trainNameFormat: 'targetCode:serviceNumber:tripNumber'// 列车显示格式 + // targetCode: + trainNameFormat: 'serviceNumber:tripNumber'// 列车显示格式 }, directionArrow: { }, @@ -610,6 +611,7 @@ class SkinCode extends defaultStyle { aspectRatio: 8 / 15, // 字体宽高比例(用以拼接text是计算位置) textOffset: 1, // 字体偏移(用以控制字体据车头的距离) trainWidthMoreText: 2, // 计算列车长度时--列车长比text多出尺寸 + useSelfFormat: true, // 使用配置项的nameFormat displayPosition: 'margin', // 非同通信车在物理区段(有逻辑区段)上显示的位置 margin:行驶方向边缘车次窗 center: 中间位置车次窗 trainTip:true // 鼠标悬停列车状态信息框是否显示 }, From 9591cbd268ba857cd6b801f3b629adc401de1393 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 18 May 2020 13:08:45 +0800 Subject: [PATCH 06/40] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=99=BB=E9=99=86=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index_Common.js | 12 ++++-------- src/scripts/ConstConfig.js | 3 ++- src/store/modules/permission.js | 7 ++++--- src/store/modules/user.js | 5 +++-- src/utils/baseUrl.js | 4 ++-- .../mapoperate/section/splitOrMerge.vue | 16 ++++++++-------- 6 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 87eabad31..ca11e1bd6 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -151,6 +151,7 @@ export const mapCreater = '02'; // 地图创建权限 export const lessonCreater = '03'; // 课程创建权限 export const admin = '04'; // 管理员 export const superAdmin = '05'; // 超级管理员 +export const referee = '07'; // 裁判员 export const userExam = '011'; // 考试系统 export const userLesson = '012'; // 教学系统 @@ -982,13 +983,13 @@ export const asyncRouter = [ ] } ]; -const JSXT = [ +export const JSXT = [ { path: '/jsxt', component: Layout, meta: { i18n: 'router.competitionManage', - roles: [user, userTrainingPlatform] + roles: [user, userTrainingPlatform, referee] }, pathStr: 'jsxt', hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('jsxt') && !window.document.location.pathname.includes('jsxt') : !window.document.location.pathname.includes('jsxt'), @@ -1009,7 +1010,7 @@ const JSXT = [ component: Layout, meta: { i18n: 'router.refereeJManage', - roles: [admin, userTrainingPlatform] + roles: [referee, userTrainingPlatform] }, pathStr: 'refereeJsxt', hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), @@ -1036,11 +1037,6 @@ const router = createRouter(); router.beforeEach((to, from, next) => { const project = getSessionStorage('project'); - JSXT.forEach(route => { - if (from.path.includes(route.pathStr)) { - asyncRouter.push(route); - } - }); document.title = loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title; next(); }); diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 88f8ca94d..0e5598c55 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -37,7 +37,8 @@ export default { { label: '课程生成者', value: '03' }, { label: '系统管理员', value: '04' }, { label: '超级管理员', value: '05' }, - { label: '销售用户', value: '06' } + { label: '销售用户', value: '06' }, + { label: '裁判员', value: '07' } ], examResultList: [ diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 7a7958541..03bbc159e 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,4 +1,4 @@ -import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform } from '@/router/index_APP_TARGET'; +import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform, JSXT } from '@/router/index_APP_TARGET'; import { PermissionType } from '@/utils/PermissionType'; import { UrlConfig } from '@/scripts/ConstDic'; import { getSessionStorage } from '@/utils/auth'; @@ -35,7 +35,7 @@ function hasPermission(roles, route, parentsRoles) { roles = roles.filter(function (role) { return route.meta.roles.indexOf(role) >= 0; }); - return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) > 0; + return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) >= 0; } } else if (parentsRoles) { // 如果没有本级路由,有父级路由,则使用父级路由过滤 @@ -104,8 +104,9 @@ const permission = { if (roles.indexOf(superAdmin) >= 0 && roles.indexOf(admin) < 0) { roles.push(admin); } + const routeArr = [...asyncRouter, ...JSXT]; - const accessedRouters = filterAsyncRouter(asyncRouter, roles); + const accessedRouters = filterAsyncRouter(routeArr, roles); accessedRouters.forEach(route => { if (route.children && route.children.length == 0) { route.hidden = true; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index d52813076..91d273d7d 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,9 +1,9 @@ import { setSessionStorage } from '@/utils/auth'; import { login, logout, getInfo } from '@/api/login'; -import { getToken, setToken, removeToken } from '@/utils/auth'; +import { getToken, setToken, removeToken, removeSessionStorage } from '@/utils/auth'; import { getUserConfigInfo } from '@/api/management/user'; import { LoginParams } from '@/utils/login'; -import { creatSubscribe, clearSubscribe, perpetualTopic, commonTopic, disconnect} from '@/utils/stomp'; +import { creatSubscribe, clearSubscribe, perpetualTopic, disconnect} from '@/utils/stomp'; import Cookies from 'js-cookie'; const user = { @@ -145,6 +145,7 @@ const user = { commit('SET_ID', ''); commit('SET_ROLES', []); removeToken(); + removeSessionStorage('project'); }, // 登出系统 diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 080406116..4ff00eac2 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - BASE_API = 'http://192.168.3.6:9000'; // 旭强 + // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张S赛 diff --git a/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue b/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue index f4a541799..4022d6933 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue @@ -208,10 +208,10 @@ export default { roadType: selected.roadType, firstTurnBack: false, belongStation: '', - rightAxleOffset: {x:0, y:0}, - leftAxleOffset: {x:0, y:0}, - leftAxlePosition: 0, - rightAxlePosition: 0, + rightAxleOffset: {x:0, y:0}, + leftAxleOffset: {x:0, y:0}, + leftAxlePosition: 0, + rightAxlePosition: 0 }; models.push(model); } @@ -291,10 +291,10 @@ export default { roadType: null, firstTurnBack: false, belongStation: '', - rightAxleOffset: {x:0, y:0}, - leftAxleOffset: {x:0, y:0}, - leftAxlePosition: 0, - rightAxlePosition: 0, + rightAxleOffset: {x:0, y:0}, + leftAxleOffset: {x:0, y:0}, + leftAxlePosition: 0, + rightAxlePosition: 0 }; models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true })); models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true })); From 25b1c09141f47cdbdd6eabd9c063a7a9448f2525 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 18 May 2020 13:32:25 +0800 Subject: [PATCH 07/40] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMap/displayNew/demon/addQuest.vue | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/views/newMap/displayNew/demon/addQuest.vue b/src/views/newMap/displayNew/demon/addQuest.vue index 03556d973..4f73289c9 100644 --- a/src/views/newMap/displayNew/demon/addQuest.vue +++ b/src/views/newMap/displayNew/demon/addQuest.vue @@ -213,22 +213,20 @@ export default { checkDisabled(role) { if (!this.$route.fullPath.includes('design/displayNew/demon')) { - if (this.$route.query.prdType == '01') { - return role !== 'Attendant' && role !== 'no'; - } else if (this.$route.query.prdType == '02') { - return role !== 'Dispatcher' && role !== 'no'; - } else if (this.$route.query.prdType == '04') { - return role !== 'Driver' && role !== 'no'; - } + const prdType = this.$route.query.prdType; + return this.judgeDisabled(prdType, role); } else { const prdType = this.$store.state.training.prdType; - if ( prdType == '01') { - return role !== '行值' && role !== 'no'; - } else if (prdType == '02') { - return role !== '行调' && role !== 'no'; - } else if (prdType == '04') { - return role !== '司机' && role !== 'no'; - } + return this.judgeDisabled(prdType, role); + } + }, + judgeDisabled(prdType, role) { + if ( prdType == '01') { + return role !== '行值' && role !== 'no'; + } else if (prdType == '02') { + return role !== '行调' && role !== 'no'; + } else if (prdType == '04') { + return role !== '司机' && role !== 'no'; } }, From 6fdf3b74aa0bbcb47941fe89cb56e67e056c40d8 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 18 May 2020 13:34:46 +0800 Subject: [PATCH 08/40] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BD=A6=E6=AC=A1?= =?UTF-8?q?=E7=AA=97=E6=92=A4=E9=94=80=E6=93=8D=E4=BD=9C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newMapdraft/mapoperate/trainwindow.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue index 614d6bb1f..d2bb50dda 100644 --- a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue @@ -22,7 +22,7 @@
删除 - {{ $t('map.deleteTrainWindow') }} + {{ $t('map.deleteTrainWindow') }}
修改 @@ -374,15 +374,17 @@ export default { this.$refs['addForm'].validate((valid) => { if (valid) { const models = []; - this.addModel.modelList.forEach(item => { - const model = this.$store.getters['map/getDeviceByCode'](item); - model.point.y = this.addModel.pointY; - model.height = this.addModel.height; - model.width = this.addModel.width; - models.push(model); + this.addModel.modelList.forEach(code => { + const model = this.$store.getters['map/getDeviceByCode'](code); + const modelData = deepAssign({}, model); + modelData.point.y = this.addModel.pointY; + modelData.height = this.addModel.height; + modelData.width = this.addModel.width; + models.push(modelData); }); this.$emit('updateMapModel', models); this.addModel.modelList = []; + this.field = ''; } }); } From bdf627e81272d4130af4641c25cb6c97f82e8935 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 18 May 2020 14:00:16 +0800 Subject: [PATCH 09/40] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/displayNew/designIndex.vue | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/views/newMap/displayNew/designIndex.vue b/src/views/newMap/displayNew/designIndex.vue index a18b869c9..f6ed7bdb6 100644 --- a/src/views/newMap/displayNew/designIndex.vue +++ b/src/views/newMap/displayNew/designIndex.vue @@ -329,26 +329,6 @@ export default { // 选择脚本 async selectQuest(row, id, mapLocation, roleName) { try { - let prdType = ''; - switch (roleName) { - case 'Attendant': { - prdType = '01'; - break; - } - case 'Dispatcher': { - prdType = '02'; - break; - } - case 'Driver': { - prdType = '04'; - break; - } - case 'Repair': { - prdType = ''; - break; - } - } - this.switchMode(prdType); const res = this.drawWay ? await loadDraftScriptNew(id, this.group) : await loadDraftScript(row.id, id, this.group); if (res && res.code == 200) { this.questId = parseInt(row.id); From 135b328dd19690075f4950ac73f2ad6c9c9fbc54 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 18 May 2020 14:49:16 +0800 Subject: [PATCH 10/40] =?UTF-8?q?=E6=95=85=E9=9A=9C=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=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 | 36 +- .../theme/beijing_01/menus/menuSignal.vue | 70 +--- .../theme/beijing_01/menus/menuSwitch.vue | 66 ++-- .../chengdu_01/menus/dialog/platformDwell.vue | 2 +- .../chengdu_01/menus/menuDialog/playBack.vue | 2 +- .../menus/menuDialog/systemLogin.vue | 2 +- .../menus/menuDialog/systemLogout.vue | 2 +- .../theme/chengdu_01/menus/menuRequest.vue | 2 + .../theme/chengdu_01/menus/menuSection.vue | 61 +--- .../theme/chengdu_01/menus/menuSignal.vue | 53 +-- .../theme/chengdu_01/menus/menuSwitch.vue | 48 +-- .../chengdu_01/menus/utils/menuOperate.js | 257 +++++++++++++++ .../theme/chengdu_03/menus/menuSection.vue | 59 +--- .../theme/chengdu_03/menus/menuSignal.vue | 51 +-- .../theme/chengdu_03/menus/menuSwitch.vue | 46 +-- .../chengdu_03/menus/utils/menuOperate.js | 257 +++++++++++++++ .../theme/foshan_01/menus/menuSection.vue | 35 +- .../theme/foshan_01/menus/menuSignal.vue | 50 +-- .../theme/foshan_01/menus/menuSwitch.vue | 45 +-- .../foshan_01/menus/utils/menuOperate.js | 10 + .../theme/fuzhou_01/menus/menuSection.vue | 45 +-- .../theme/fuzhou_01/menus/menuSignal.vue | 44 +-- .../theme/fuzhou_01/menus/menuStation.vue | 4 +- .../theme/fuzhou_01/menus/menuSwitch.vue | 48 +-- .../fuzhou_01/menus/utils/menuOperate.js | 308 ++++++++++++++++++ .../theme/haerbin_01/menus/menuSection.vue | 46 +-- .../theme/haerbin_01/menus/menuSignal.vue | 44 +-- .../theme/haerbin_01/menus/menuSwitch.vue | 42 +-- .../haerbin_01/menus/utils/menuOperate.js | 308 ++++++++++++++++++ .../theme/ningbo_01/menus/menuSection.vue | 25 +- .../theme/ningbo_01/menus/menuSignal.vue | 80 ++--- .../theme/ningbo_01/menus/menuSwitch.vue | 70 ++-- .../ningbo_01/menus/utils/menuOperate.js | 10 + .../theme/xian_01/menus/menuSection.vue | 15 +- .../theme/xian_01/menus/menuSignal.vue | 19 +- .../theme/xian_01/menus/menuSwitch.vue | 21 +- src/jmapNew/theme/xian_02/menus/index.vue | 12 +- .../theme/xian_02/menus/menuSection.vue | 36 +- .../theme/xian_02/menus/menuSignal.vue | 52 +-- .../theme/xian_02/menus/menuSwitch.vue | 35 +- .../theme/xian_02/menus/utils/menuOperate.js | 10 + src/utils/baseUrl.js | 4 +- .../newMap/mapsystemNew/plugin/setFault.vue | 174 ++++++++++ 43 files changed, 1741 insertions(+), 865 deletions(-) create mode 100644 src/jmapNew/theme/chengdu_01/menus/utils/menuOperate.js create mode 100644 src/jmapNew/theme/chengdu_03/menus/utils/menuOperate.js create mode 100644 src/jmapNew/theme/fuzhou_01/menus/utils/menuOperate.js create mode 100644 src/jmapNew/theme/haerbin_01/menus/utils/menuOperate.js create mode 100644 src/views/newMap/mapsystemNew/plugin/setFault.vue diff --git a/src/jmapNew/theme/beijing_01/menus/menuSection.vue b/src/jmapNew/theme/beijing_01/menus/menuSection.vue index 07d648269..7871ce8f2 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSection.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSection.vue @@ -5,6 +5,7 @@ +
@@ -21,6 +22,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import {menuOperate, commitOperate} from './utils/menuOperate'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SectionMenu', @@ -29,7 +31,8 @@ export default { SectionControl, SpeedLimitControl, AlxeEffective, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -72,11 +75,16 @@ export default { ] }, menuForce: [ - // { - // label: '设置计轴失效', - // handler: this.alxeFailure - // // disabledCallback: MenuDisabledState.Section.alxeFailure - // } + { + label: '设置故障', + handler: this.setStoppage, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } ] }; }, @@ -234,6 +242,22 @@ export default { this.$refs.speedLimitControl.doShow(operate, this.selected); } }); + }, + // 设置故障 + setStoppage() { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); + } + }); + }, + // 取消故障 + cancelStoppage() { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); + } + }); } } }; diff --git a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue index d61298593..6c533599b 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue @@ -7,6 +7,7 @@ + @@ -26,6 +27,7 @@ import { DeviceMenu } from '@/scripts/ConstDic'; import { mouseCancelState } from './utils/menuItemStatus'; import PasswordBox from './dialog/childDialog/passwordInputBox.vue'; import {menuOperate, commitOperate} from './utils/menuOperate'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SignalMenu', @@ -36,7 +38,8 @@ export default { RouteHandControl, RouteDetail, NoticeInfo, - PasswordBox + PasswordBox, + SetFault }, props: { selected: { @@ -91,21 +94,16 @@ export default { ] }, menuForce: [ - { - label: '信号关灯', - handler: this.signalClose, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL - }, - { - label: '设置故障', - handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT - }, - { - label: '取消故障', - handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT - } + { + label: '设置故障', + handler: this.setStoppage, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } ] }; }, @@ -284,50 +282,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - over: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.stoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - param: { - signalCode: `${this.selected.code}` - } - - }; - mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - over: true, - code: this.selected.code, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 设置进路 diff --git a/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue b/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue index d9d87027e..fa303a19d 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSwitch.vue @@ -6,6 +6,7 @@ + @@ -22,8 +23,8 @@ import {DeviceMenu } from '@/scripts/ConstDic'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { mouseCancelState } from './utils/menuItemStatus'; import {menuOperate, commitOperate} from './utils/menuOperate'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SwitchMenu', @@ -33,7 +34,8 @@ export default { SwitchControl, SpeedLimitControl, AlxeEffective, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -89,16 +91,25 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; }, + computed: { + ...mapGetters('training', [ + 'mode', + 'operatemode' + ]), + ...mapGetters('menuOperation', [ + 'buttonOperation' + ]) + }, watch: { '$store.state.menuOperation.menuCount': function (val) { if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Switch) && !this.buttonOperation) { @@ -113,15 +124,6 @@ export default { } } }, - computed: { - ...mapGetters('training', [ - 'mode', - 'operatemode' - ]), - ...mapGetters('menuOperation', [ - 'buttonOperation' - ]) - }, methods: { clickEvent() { const self = this; @@ -192,48 +194,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.stoppage.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_ADD_FAULT, - param: { - switchCode: `${this.selected.code}` - } - }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - cmdType: CMD.Switch.CMD_SWITCH_REMOVE_FAULT, - param: { - switchCode: `${this.selected.code}` - } - }; - - mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 道岔单锁 diff --git a/src/jmapNew/theme/chengdu_01/menus/dialog/platformDwell.vue b/src/jmapNew/theme/chengdu_01/menus/dialog/platformDwell.vue index 4a067f5d2..96ca967de 100644 --- a/src/jmapNew/theme/chengdu_01/menus/dialog/platformDwell.vue +++ b/src/jmapNew/theme/chengdu_01/menus/dialog/platformDwell.vue @@ -73,7 +73,7 @@ - 确认 + 确认 取消 帮助 diff --git a/src/jmapNew/theme/chengdu_01/menus/menuDialog/playBack.vue b/src/jmapNew/theme/chengdu_01/menus/menuDialog/playBack.vue index 86cc82035..9a18253a0 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuDialog/playBack.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuDialog/playBack.vue @@ -63,7 +63,7 @@ - 确定 + 确定 取消 帮助 diff --git a/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogin.vue b/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogin.vue index 6f61b5d27..40fbc395a 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogin.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogin.vue @@ -56,7 +56,7 @@ - 确定 + 确定 取消 帮助 diff --git a/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogout.vue b/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogout.vue index 5afea1f63..a4f9e7f2d 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogout.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuDialog/systemLogout.vue @@ -28,7 +28,7 @@ - 确定 + 确定 取消 帮助 diff --git a/src/jmapNew/theme/chengdu_01/menus/menuRequest.vue b/src/jmapNew/theme/chengdu_01/menus/menuRequest.vue index f8bd7d56e..27134db34 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuRequest.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuRequest.vue @@ -43,6 +43,8 @@ export default { return { unfold: true, tempData: [], + commitDisabled: false, + loading: false, tableStyle: { 'border-bottom': 'none', 'border-right': 'none' diff --git a/src/jmapNew/theme/chengdu_01/menus/menuSection.vue b/src/jmapNew/theme/chengdu_01/menus/menuSection.vue index 0873e9e97..7853e271d 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuSection.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuSection.vue @@ -5,6 +5,7 @@ + @@ -19,6 +20,8 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SectionMenu', @@ -27,7 +30,8 @@ export default { NoticeInfo, SpeedLimitControl, SectionControl, - SectionCmdControl + SectionCmdControl, + SetFault }, props: { selected: { @@ -63,24 +67,14 @@ export default { }, menuForce: [ { - label: '设置计轴失效', - handler: this.alxeFailure, - cmdType:'' - }, - { - label: this.$t('menu.menuSection.setFault'), + label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { - label: this.$t('menu.menuSection.cancelFault'), + label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT - }, - { - label: '创建速度限制', - handler: this.setSpeed, - cmdType: CMD.Section.CMD_SWITCH_SET_LIMIT_SPEED + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -152,49 +146,20 @@ export default { this.$refs.noticeInfo.doShow(step); }); }, - // 设置故障 setStoppage() { - const step = { - start: true, - over:true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.stoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT, - param: { - sectionCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - over:true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.cancelStoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT, - param: { - sectionCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 设置速度 diff --git a/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue b/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue index 6c70337c7..0e623ebb7 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuSignal.vue @@ -3,6 +3,7 @@ + @@ -15,13 +16,16 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SignalMenu', components: { PopMenu, NoticeInfo, - CreateDeviceLabel + CreateDeviceLabel, + SetFault }, props: { selected: { @@ -166,20 +170,15 @@ export default { ] }, menuForce: [ - { - label: '信号关灯', - handler: this.signalClose, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL - }, { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -259,48 +258,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - over:true, - code: `${this.selected.code}`, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - operation: OperationEvent.Signal.stoppage.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - over:true, - code: `${this.selected.code}`, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 设置进路 diff --git a/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue b/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue index d7daad700..b74d34dc1 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuSwitch.vue @@ -4,6 +4,7 @@ + @@ -18,6 +19,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SwitchMenu', @@ -25,7 +28,8 @@ export default { PopMenu, NoticeInfo, CreateDeviceLabel, - SwitchControl + SwitchControl, + SetFault }, mixins: [ CancelMouseState @@ -118,12 +122,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -177,48 +181,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - over:true, - operation: OperationEvent.Switch.stoppage.menu.operation, - cmdType: CMD.Switch.CMD_STOPPAGE, - param: { - switchCode: this.selected.code - } - }; - - // mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - over:true, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE, - param: { - switchCode: this.selected.code - } - }; - - // mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 道岔单锁 diff --git a/src/jmapNew/theme/chengdu_01/menus/utils/menuOperate.js b/src/jmapNew/theme/chengdu_01/menus/utils/menuOperate.js new file mode 100644 index 000000000..85d6fd6f6 --- /dev/null +++ b/src/jmapNew/theme/chengdu_01/menus/utils/menuOperate.js @@ -0,0 +1,257 @@ +import store from '@/store/index_APP_TARGET'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; + +// 操作 +export const menuOperate = { + Section:{ + alxeFailure:{ + // 设置计轴失效 + operation: OperationEvent.Section.alxeFailure.menu.operation, + // cmdType 值有问题 + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + }, + active:{ + // 区段激活 + operation: OperationEvent.Section.active.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ACTIVE + }, + split:{ + // 区段切除 + operation: OperationEvent.Section.split.menu.operation, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF + }, + setSpeed:{ + // 设置速度 + operation: OperationEvent.Section.setSpeed.menu.operation, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED + }, + fault:{ + // 区段故障解锁 + operation: OperationEvent.Section.fault.menu.operation, + 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 + }, + lock:{ + // 信号封锁 + operation:OperationEvent.Signal.lock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK + }, + unlock:{ + // 信号解封 + operation: OperationEvent.Signal.unlock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK + }, + guide:{ + // 进路引导 + operation: OperationEvent.Signal.guide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE + }, + 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 + }, + cancelGuide:{ + // 人工解锁进路(信号机取消引导) + operation: OperationEvent.Signal.cancelGuide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE + }, + setAutoTurnBack:{ + // 设置自动折返 + operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK + }, + cancelAutoTurnBack:{ + // 取消自动折返 + operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK + } + }, + Switch:{ + lock:{ + // 道岔单锁 + operation: OperationEvent.Switch.lock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + }, + unlock:{ + // 道岔解锁 + operation: OperationEvent.Switch.unlock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + }, + block:{ + // 道岔封锁 + operation: OperationEvent.Switch.block.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_BLOCK + }, + unblock:{ + // 道岔解封 + operation: OperationEvent.Switch.unblock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK + }, + locate:{ + // 单操到定位 + operation: OperationEvent.Switch.locate.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION + }, + reverse:{ + // 单操到反位 + operation: OperationEvent.Switch.reverse.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION + }, + setSpeed:{ + // 设置临时限速 + operation: OperationEvent.Switch.setSpeed.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED + }, + turnoutForce: { + // 道岔强制扳动 + operation: OperationEvent.Switch.turnoutForce.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_FORCE_TURN + } + }, + StationStand:{ + setDetainTrain:{ + // 设置扣车 + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN + }, + cancelDetainTrain:{ + // 取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + cancelDetainTrainAll:{ + // 全线取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, + cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN + }, + setJumpStop:{ + // 设置跳停 + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + cancelJumpStop:{ + // 取消跳停 + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + }, + setStopTime:{ + // 停站时间控制 + operation: OperationEvent.StationStand.setStopTime.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME + }, + setRunLevel:{ + // 运行时间控制 + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME + }, + earlyDeparture:{ + // 设置提前发车 + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART + }, + detail:{ + // 查询站台状态 + operation: OperationEvent.StationStand.detail.menu.operation + } + }, + StationControl:{ + // requestCentralControl:{ + // // 请求中控(遥控) + // operation: OperationEvent.StationControl.requestCentralControl.menu.operation, + // cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL + // }, + // requestStationControl:{ + // // 请求站控 + // operation: OperationEvent.StationControl.requestStationControl.menu.operation, + // cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL + // }, + // emergencyStationControl:{ + // // 紧急站控 + // operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, + // cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL + // } + }, + Common: { + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } + } +}; + +export function commitOperate(operate, paramList, over) { + const step = { + start: true, + operation: operate.operation, + param:{} + }; + step.param = paramList; + // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over == 0 || over == 3) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } + if (over != 0 && over != 3) { + 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({ valid: valid, operate: step }); + }).catch(error=>{ + reject(error); + }); + }); +} diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue index 3427384e8..9d6056367 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSection.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSection.vue @@ -5,6 +5,7 @@ + @@ -19,6 +20,8 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SectionMenu', @@ -27,7 +30,8 @@ export default { SectionControl, SectionDetail, TrainCreate, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -43,10 +47,10 @@ export default { menuNormal: { Local: [ { - label: '区故解', - handler: this.fault, + label: '区故解', + handler: this.fault, cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK, - auth: { station: true, center: false } + auth: { station: true, center: false } } ], Center: [ @@ -66,19 +70,14 @@ export default { }, menuForce: [ { - label: '设置计轴失效', - handler: this.alxeFailure, - cmdType:'' - }, - { - label: this.$t('menu.menuSection.setFault'), + label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { - label: this.$t('menu.menuSection.cancelFault'), + label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -186,44 +185,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.stoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT, - param: { - sectionCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.cancelStoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT, - param: { - sectionCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, undeveloped() { diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue index 9e5ff2028..9501c8ced 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSignal.vue @@ -8,6 +8,7 @@ + @@ -25,6 +26,8 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import PasswordBox from './dialog/childDialog/passwordInputBox'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SignalMenu', @@ -36,7 +39,8 @@ export default { RouteDetail, RouteGuide, NoticeInfo, - PasswordBox + PasswordBox, + SetFault }, props: { selected: { @@ -141,20 +145,15 @@ export default { ] }, menuForce: [ - { - label: '信号关灯', - handler: this.signalClose, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL - }, { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -232,46 +231,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - operation: OperationEvent.Signal.stoppage.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - param: { - signalCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 设置进路 diff --git a/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue b/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue index e4c842f0d..4abe91ca7 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuSwitch.vue @@ -4,6 +4,7 @@ + @@ -18,6 +19,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import {menuOperate, commitOperate} from './utils/menuOperate'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SwitchMenu', @@ -25,7 +28,8 @@ export default { PopMenu, SectionControl, SwitchControl, - NoticeInfo + NoticeInfo, + SetFault }, mixins: [ CancelMouseState @@ -91,12 +95,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -150,46 +154,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - operation: OperationEvent.Switch.stoppage.menu.operation, - cmdType: CMD.Switch.CMD_STOPPAGE, - param: { - switchCode: this.selected.code - } - }; - - // mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE, - param: { - switchCode: this.selected.code - } - }; - - // mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 道岔单锁 diff --git a/src/jmapNew/theme/chengdu_03/menus/utils/menuOperate.js b/src/jmapNew/theme/chengdu_03/menus/utils/menuOperate.js new file mode 100644 index 000000000..85d6fd6f6 --- /dev/null +++ b/src/jmapNew/theme/chengdu_03/menus/utils/menuOperate.js @@ -0,0 +1,257 @@ +import store from '@/store/index_APP_TARGET'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; + +// 操作 +export const menuOperate = { + Section:{ + alxeFailure:{ + // 设置计轴失效 + operation: OperationEvent.Section.alxeFailure.menu.operation, + // cmdType 值有问题 + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + }, + active:{ + // 区段激活 + operation: OperationEvent.Section.active.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ACTIVE + }, + split:{ + // 区段切除 + operation: OperationEvent.Section.split.menu.operation, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF + }, + setSpeed:{ + // 设置速度 + operation: OperationEvent.Section.setSpeed.menu.operation, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED + }, + fault:{ + // 区段故障解锁 + operation: OperationEvent.Section.fault.menu.operation, + 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 + }, + lock:{ + // 信号封锁 + operation:OperationEvent.Signal.lock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK + }, + unlock:{ + // 信号解封 + operation: OperationEvent.Signal.unlock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK + }, + guide:{ + // 进路引导 + operation: OperationEvent.Signal.guide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE + }, + 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 + }, + cancelGuide:{ + // 人工解锁进路(信号机取消引导) + operation: OperationEvent.Signal.cancelGuide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE + }, + setAutoTurnBack:{ + // 设置自动折返 + operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK + }, + cancelAutoTurnBack:{ + // 取消自动折返 + operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK + } + }, + Switch:{ + lock:{ + // 道岔单锁 + operation: OperationEvent.Switch.lock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + }, + unlock:{ + // 道岔解锁 + operation: OperationEvent.Switch.unlock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + }, + block:{ + // 道岔封锁 + operation: OperationEvent.Switch.block.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_BLOCK + }, + unblock:{ + // 道岔解封 + operation: OperationEvent.Switch.unblock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK + }, + locate:{ + // 单操到定位 + operation: OperationEvent.Switch.locate.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION + }, + reverse:{ + // 单操到反位 + operation: OperationEvent.Switch.reverse.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION + }, + setSpeed:{ + // 设置临时限速 + operation: OperationEvent.Switch.setSpeed.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED + }, + turnoutForce: { + // 道岔强制扳动 + operation: OperationEvent.Switch.turnoutForce.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_FORCE_TURN + } + }, + StationStand:{ + setDetainTrain:{ + // 设置扣车 + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN + }, + cancelDetainTrain:{ + // 取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + cancelDetainTrainAll:{ + // 全线取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation, + cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN + }, + setJumpStop:{ + // 设置跳停 + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + cancelJumpStop:{ + // 取消跳停 + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + }, + setStopTime:{ + // 停站时间控制 + operation: OperationEvent.StationStand.setStopTime.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME + }, + setRunLevel:{ + // 运行时间控制 + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME + }, + earlyDeparture:{ + // 设置提前发车 + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART + }, + detail:{ + // 查询站台状态 + operation: OperationEvent.StationStand.detail.menu.operation + } + }, + StationControl:{ + // requestCentralControl:{ + // // 请求中控(遥控) + // operation: OperationEvent.StationControl.requestCentralControl.menu.operation, + // cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL + // }, + // requestStationControl:{ + // // 请求站控 + // operation: OperationEvent.StationControl.requestStationControl.menu.operation, + // cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL + // }, + // emergencyStationControl:{ + // // 紧急站控 + // operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, + // cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL + // } + }, + Common: { + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } + } +}; + +export function commitOperate(operate, paramList, over) { + const step = { + start: true, + operation: operate.operation, + param:{} + }; + step.param = paramList; + // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over == 0 || over == 3) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } + if (over != 0 && over != 3) { + 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({ valid: valid, operate: step }); + }).catch(error=>{ + reject(error); + }); + }); +} diff --git a/src/jmapNew/theme/foshan_01/menus/menuSection.vue b/src/jmapNew/theme/foshan_01/menus/menuSection.vue index 9982b12aa..5af573bcf 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSection.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSection.vue @@ -5,6 +5,7 @@ + @@ -19,6 +20,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import {menuOperate, commitOperate} from './utils/menuOperate'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SectionMenu', @@ -27,7 +29,8 @@ export default { SectionControl, SectionUnLock, SpeedLimitControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -78,9 +81,14 @@ export default { }, menuForce: [ { - label: '设置计轴失效', // 设置区段故障 - handler: this.alxeFailure, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + label: '设置故障', + handler: this.setStoppage, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -130,11 +138,20 @@ export default { this.$refs.popMenu.close(); } }, - // 设置计轴失效 - alxeFailure() { - commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then(({valid, operate})=>{ - }).catch(error=>{ - this.$refs.noticeInfo.doShow({}, error.message); + // 设置故障 + setStoppage() { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); + } + }); + }, + // 取消故障 + cancelStoppage() { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); + } }); }, // 故障解锁 diff --git a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue index 830957023..4ce8a70fc 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSignal.vue @@ -9,6 +9,7 @@ + @@ -22,6 +23,7 @@ import RouteHandControl from './dialog/routeHandControl'; import RouterCommand from './dialog/routerCommand'; import RouteDetail from './dialog/routeDetail'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; @@ -41,7 +43,8 @@ export default { RouteHandControl, RouteDetail, RouterCommand, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -144,20 +147,15 @@ export default { ] }, menuForce: [ - { - label: '信号关灯', - handler: this.signalClose, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL - }, { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -220,46 +218,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.stoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, operationHandler(buttonOperation, selectType) { diff --git a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue index dc2b1669a..d21fcadbb 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuSwitch.vue @@ -5,6 +5,7 @@ + @@ -20,6 +21,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SwitchMenu', @@ -28,7 +30,8 @@ export default { SwitchControl, SwitchUnLock, SpeedLimitControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -81,12 +84,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -143,46 +146,18 @@ export default { }, // 设置故障 setStoppage() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.stoppage.menu.operation, - param: { - switchCode: this.selected.code - } - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - param: { - switchCode: this.selected.code - } - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, operationHandler(buttonOperation, selectType) { diff --git a/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js b/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js index abaeb2ea0..85d6fd6f6 100644 --- a/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/foshan_01/menus/utils/menuOperate.js @@ -212,6 +212,16 @@ export const menuOperate = { // operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, // cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL // } + }, + Common: { + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } } }; diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue index 885bda462..c9eadaeda 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSection.vue @@ -5,6 +5,7 @@ + @@ -20,6 +21,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SectionMenu', @@ -28,7 +31,8 @@ export default { SectionControl, SectionCmdControl, SpeedCmdControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -127,12 +131,12 @@ export default { { label: this.$t('menu.menuSection.setFault'), handler: this.setStoppage, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: this.$t('menu.menuSection.cancelFault'), handler: this.cancelStoppage, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -185,45 +189,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.stoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT, - param: { - Section_Code: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.cancelStoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT, - param: { - Section_Code: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 故障解锁 diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue index 958cd69f1..bfd31336c 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSignal.vue @@ -8,6 +8,7 @@ + @@ -26,6 +27,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { querySignalStatus } from '@/api/simulation'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SignalMenu', @@ -37,7 +40,8 @@ export default { RouteCmdControl, RouteHandControl, RouteDetail, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -155,12 +159,12 @@ export default { { label: this.$t('menu.menuSignal.setFault'), handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: this.$t('menu.menuSignal.cancelFault'), handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -214,44 +218,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.stoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - param: { - Signal_Code: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - param: { - Signal_Code: `${this.selected.code}` - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 排列进路 diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue index 0efa0bfed..e4f0cd4db 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuStation.vue @@ -89,12 +89,12 @@ export default { { label: this.$t('menu.menuStation.setStoppage'), handler: this.setStoppage, - cmdType: CMD.Station.CMD_STATION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: this.$t('menu.menuStation.cancelStoppage'), handler: this.cancelStoppage, - cmdType: CMD.Station.CMD_STATION_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue b/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue index 2ae658968..d805cad83 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuSwitch.vue @@ -5,6 +5,7 @@ + @@ -19,6 +20,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SwitchMenu', @@ -27,7 +30,8 @@ export default { SwitchControl, SwitchCmdControl, SpeedCmdControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -174,18 +178,12 @@ export default { { label: this.$t('menu.menuSwitch.setFault'), handler: this.setStoppage, - auth: { - - }, - cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType:CMD.Fault.CMD_SET_FAULT }, { label: this.$t('menu.menuSwitch.cancelFault'), handler: this.cancelStoppage, - auth: { - - }, - cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType:CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -244,42 +242,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - operation: OperationEvent.Switch.stoppage.menu.operation, - cmdType: CMD.Switch.CMD_STOPPAGE, - param: { - Switch_Code: this.selected.code - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE, - param: { - Switch_Code: this.selected.code - } - }; - this.$store.dispatch('training/next', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 道岔单锁 diff --git a/src/jmapNew/theme/fuzhou_01/menus/utils/menuOperate.js b/src/jmapNew/theme/fuzhou_01/menus/utils/menuOperate.js new file mode 100644 index 000000000..09a216171 --- /dev/null +++ b/src/jmapNew/theme/fuzhou_01/menus/utils/menuOperate.js @@ -0,0 +1,308 @@ +import store from '@/store/index_APP_TARGET'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; + +// 操作 +export const menuOperate = { + Section:{ + alxeFailure:{ + // 设置计轴失效 + operation: OperationEvent.Section.alxeFailure.menu.operation, + // cmdType 值有问题 + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + }, + active:{ + // 区段激活 + operation: OperationEvent.Section.active.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ACTIVE + }, + alxeEffective:{ + // 确认计轴有效 + operation: OperationEvent.Section.alxeEffective.menu.operation, + cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE + }, + split:{ + // 区段切除 + operation: OperationEvent.Section.split.menu.operation, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF + }, + lock:{ + // 区段封锁 + operation: OperationEvent.Section.lock.menu.operation, + cmdType: CMD.Section.CMD_SECTION_BLOCK + }, + unlock:{ + // 区段解锁 + operation: OperationEvent.Section.unlock.menu.operation, + cmdType: CMD.Section.CMD_SECTION_UNBLOCK + }, + setSpeed:{ + // 设置速度 + operation: OperationEvent.Section.setSpeed.menu.operation, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED + }, + fault:{ + // 区段故障解锁 + operation: OperationEvent.Section.fault.menu.operation, + cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK + }, + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + } + }, + 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 + }, + lock:{ + // 信号封锁 + operation:OperationEvent.Signal.lock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK + }, + unlock:{ + // 信号解封 + operation: OperationEvent.Signal.unlock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK + }, + guide:{ + // 进路引导 + operation: OperationEvent.Signal.guide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE + }, + 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 + }, + cancelGuide:{ + // 人工解锁进路(信号机取消引导) + operation: OperationEvent.Signal.cancelGuide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE + }, + setAutoTurnBack:{ + // 设置自动折返 + operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK + }, + cancelAutoTurnBack:{ + // 取消自动折返 + operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK + } + }, + Switch:{ + lock:{ + // 道岔单锁(联锁) + operation: OperationEvent.Switch.lock.menu.operation, + // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK_CHAIN + }, + unlock:{ + // 道岔解锁(联锁) + operation: OperationEvent.Switch.unlock.menu.operation, + // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN + }, + block:{ + // 道岔封锁 + operation: OperationEvent.Switch.block.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_BLOCK + }, + unblock:{ + // 道岔解封 + operation: OperationEvent.Switch.unblock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK + }, + npChain:{ + // 道岔定操(联动) + operation: OperationEvent.Switch.locate.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN + }, + rpChain:{ + // 道岔反操(联动) + operation: OperationEvent.Switch.reverse.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN + }, + split:{ + // 区段切除 + operation: OperationEvent.Switch.split.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF + }, + active:{ + // 区段激活 + operation: OperationEvent.Switch.active.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_ACTIVE + }, + setSpeed:{ + // 设置临时限速 + operation: OperationEvent.Switch.setSpeed.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED + }, + alxeEffective:{ + // 确认计轴有效 + operation: OperationEvent.Switch.alxeEffective.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE + } + }, + StationStand:{ + setDetainTrain:{ + // 设置扣车 + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN + }, + cancelDetainTrain:{ + // 取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + setDetainTrainAuto:{ + // 区间列车数量限制 + operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO + }, + cancelDetainTrainAuto:{ + // 取消区间列车数量限制 + operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO + }, + setBulkBuckleTrain:{ + // 批量扣车 + operation: OperationEvent.StationStand.setBulkBuckleTrain.menu.operation, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL + }, + cancelBulkBuckleTrain:{ + // 批量取消扣车 + operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL + }, + setJumpStop:{ + // 设置跳停 + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + cancelJumpStop:{ + // 取消跳停 + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + }, + setStopTime:{ + // 停站时间控制 + operation: OperationEvent.StationStand.setStopTime.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME + }, + setRunLevel:{ + // 运行时间控制 + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME + }, + earlyDeparture:{ + // 设置提前发车 + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART + }, + setBackStrategy:{ + // 设置折返策略 + operation: OperationEvent.StationStand.setBackStrategy.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY + }, + detail:{ + // 查询站台状态 + operation: OperationEvent.StationStand.detail.menu.operation + } + }, + StationControl:{ + requestCentralControl:{ + // 请求中控(遥控) + operation: OperationEvent.StationControl.requestCentralControl.menu.operation, + cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL + }, + requestStationControl:{ + // 请求站控 + operation: OperationEvent.StationControl.requestStationControl.menu.operation, + cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL + }, + emergencyStationControl:{ + // 紧急站控 + operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, + cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL + } + }, + Common: { + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } + } +}; + +export function commitOperate(operate, paramList, over) { + const step = { + start: true, + operation: operate.operation, + param:{} + }; + step.param = paramList; + // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over == 0 || over == 3) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } + if (over != 0 && over != 3) { + 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({ valid: valid, operate: step }); + }).catch(error=>{ + reject(error); + }); + }); +} diff --git a/src/jmapNew/theme/haerbin_01/menus/menuSection.vue b/src/jmapNew/theme/haerbin_01/menus/menuSection.vue index 50c2225aa..db1b769eb 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuSection.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuSection.vue @@ -5,6 +5,7 @@ + @@ -15,11 +16,12 @@ import SectionCmdControl from './dialog/sectionCmdControl'; import SpeedCmdControl from './dialog/speedCmdControl'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -// import Handler from '@/scripts/cmdPlugin/Handler'; import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SectionMenu', @@ -28,7 +30,8 @@ export default { SectionControl, SectionCmdControl, SpeedCmdControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -75,12 +78,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -133,45 +136,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.stoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT, - param: { - sectionCode: `${this.selected.code}` - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Section.cancelStoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT, - param: { - sectionCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 故障解锁 diff --git a/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue b/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue index 71cf26971..67b88f525 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuSignal.vue @@ -8,6 +8,7 @@ + @@ -26,6 +27,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; // import { querySignalStatus } from '@/api/simulation'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SignalMenu', @@ -37,7 +40,8 @@ export default { RouteCmdControl, RouteHandControl, RouteDetail, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -109,12 +113,12 @@ export default { { label: this.$t('menu.menuSignal.setFault'), handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: this.$t('menu.menuSignal.cancelFault'), handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -171,44 +175,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.stoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 排列进路 diff --git a/src/jmapNew/theme/haerbin_01/menus/menuSwitch.vue b/src/jmapNew/theme/haerbin_01/menus/menuSwitch.vue index f8d6cb09a..e6dd094c1 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuSwitch.vue @@ -5,6 +5,7 @@ + @@ -19,6 +20,8 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import {menuOperate, commitOperate} from './utils/menuOperate'; export default { name: 'SwitchMenu', @@ -27,7 +30,8 @@ export default { SwitchControl, SwitchCmdControl, SpeedCmdControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -80,12 +84,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType:CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType:CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -138,42 +142,18 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - operation: OperationEvent.Switch.stoppage.menu.operation, - cmdType: CMD.Switch.CMD_STOPPAGE, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - cmdType: CMD.Switch.CMD_CANCEL_STOPPAGE, - param: { - switchCode: this.selected.code - } - }; - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 道岔单锁 diff --git a/src/jmapNew/theme/haerbin_01/menus/utils/menuOperate.js b/src/jmapNew/theme/haerbin_01/menus/utils/menuOperate.js new file mode 100644 index 000000000..09a216171 --- /dev/null +++ b/src/jmapNew/theme/haerbin_01/menus/utils/menuOperate.js @@ -0,0 +1,308 @@ +import store from '@/store/index_APP_TARGET'; +import CMD from '@/scripts/cmdPlugin/CommandEnum'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; + +// 操作 +export const menuOperate = { + Section:{ + alxeFailure:{ + // 设置计轴失效 + operation: OperationEvent.Section.alxeFailure.menu.operation, + // cmdType 值有问题 + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + }, + active:{ + // 区段激活 + operation: OperationEvent.Section.active.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ACTIVE + }, + alxeEffective:{ + // 确认计轴有效 + operation: OperationEvent.Section.alxeEffective.menu.operation, + cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE + }, + split:{ + // 区段切除 + operation: OperationEvent.Section.split.menu.operation, + cmdType: CMD.Section.CMD_SECTION_CUT_OFF + }, + lock:{ + // 区段封锁 + operation: OperationEvent.Section.lock.menu.operation, + cmdType: CMD.Section.CMD_SECTION_BLOCK + }, + unlock:{ + // 区段解锁 + operation: OperationEvent.Section.unlock.menu.operation, + cmdType: CMD.Section.CMD_SECTION_UNBLOCK + }, + setSpeed:{ + // 设置速度 + operation: OperationEvent.Section.setSpeed.menu.operation, + cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED + }, + fault:{ + // 区段故障解锁 + operation: OperationEvent.Section.fault.menu.operation, + cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK + }, + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + } + }, + 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 + }, + lock:{ + // 信号封锁 + operation:OperationEvent.Signal.lock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_BLOCK + }, + unlock:{ + // 信号解封 + operation: OperationEvent.Signal.unlock.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK + }, + guide:{ + // 进路引导 + operation: OperationEvent.Signal.guide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE + }, + 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 + }, + cancelGuide:{ + // 人工解锁进路(信号机取消引导) + operation: OperationEvent.Signal.cancelGuide.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE + }, + setAutoTurnBack:{ + // 设置自动折返 + operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK + }, + cancelAutoTurnBack:{ + // 取消自动折返 + operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation, + cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK + } + }, + Switch:{ + lock:{ + // 道岔单锁(联锁) + operation: OperationEvent.Switch.lock.menu.operation, + // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK_CHAIN + }, + unlock:{ + // 道岔解锁(联锁) + operation: OperationEvent.Switch.unlock.menu.operation, + // cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK + cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK_CHAIN + }, + block:{ + // 道岔封锁 + operation: OperationEvent.Switch.block.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_BLOCK + }, + unblock:{ + // 道岔解封 + operation: OperationEvent.Switch.unblock.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK + }, + npChain:{ + // 道岔定操(联动) + operation: OperationEvent.Switch.locate.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN + }, + rpChain:{ + // 道岔反操(联动) + operation: OperationEvent.Switch.reverse.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN + }, + split:{ + // 区段切除 + operation: OperationEvent.Switch.split.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF + }, + active:{ + // 区段激活 + operation: OperationEvent.Switch.active.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_ACTIVE + }, + setSpeed:{ + // 设置临时限速 + operation: OperationEvent.Switch.setSpeed.menu.operation, + cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED + }, + alxeEffective:{ + // 确认计轴有效 + operation: OperationEvent.Switch.alxeEffective.menu.operation, + cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE + } + }, + StationStand:{ + setDetainTrain:{ + // 设置扣车 + operation: OperationEvent.StationStand.setDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN + }, + cancelDetainTrain:{ + // 取消扣车 + operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN + }, + setDetainTrainAuto:{ + // 区间列车数量限制 + operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO + }, + cancelDetainTrainAuto:{ + // 取消区间列车数量限制 + operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO + }, + setBulkBuckleTrain:{ + // 批量扣车 + operation: OperationEvent.StationStand.setBulkBuckleTrain.menu.operation, + cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL + }, + cancelBulkBuckleTrain:{ + // 批量取消扣车 + operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation, + cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL + }, + setJumpStop:{ + // 设置跳停 + operation: OperationEvent.StationStand.setJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP + }, + cancelJumpStop:{ + // 取消跳停 + operation: OperationEvent.StationStand.cancelJumpStop.menu.operation, + cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP + }, + setStopTime:{ + // 停站时间控制 + operation: OperationEvent.StationStand.setStopTime.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME + }, + setRunLevel:{ + // 运行时间控制 + operation: OperationEvent.StationStand.setRunLevel.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME + }, + earlyDeparture:{ + // 设置提前发车 + operation: OperationEvent.StationStand.earlyDeparture.menu.operation, + cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART + }, + setBackStrategy:{ + // 设置折返策略 + operation: OperationEvent.StationStand.setBackStrategy.menu.operation, + cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY + }, + detail:{ + // 查询站台状态 + operation: OperationEvent.StationStand.detail.menu.operation + } + }, + StationControl:{ + requestCentralControl:{ + // 请求中控(遥控) + operation: OperationEvent.StationControl.requestCentralControl.menu.operation, + cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL + }, + requestStationControl:{ + // 请求站控 + operation: OperationEvent.StationControl.requestStationControl.menu.operation, + cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL + }, + emergencyStationControl:{ + // 紧急站控 + operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, + cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL + } + }, + Common: { + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } + } +}; + +export function commitOperate(operate, paramList, over) { + const step = { + start: true, + operation: operate.operation, + param:{} + }; + step.param = paramList; + // over 0为首次操作,1为中间操作,2为最后操作,3为直接一次性操作 + if (over == 0 || over == 3) { + const codeList = Object.values(paramList); + step.code = codeList[0]; + } + if (over != 0 && over != 3) { + 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({ valid: valid, operate: step }); + }).catch(error=>{ + reject(error); + }); + }); +} diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index c35831e1c..aeb16bf71 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -22,7 +22,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import {menuOperate, commitOperate} from './utils/menuOperate'; -import SetFault from './dialog/setFault'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SectionMenu', @@ -98,20 +98,15 @@ export default { ] }, menuForce: [ - // { - // label: '设置计轴失效', // 设置区段故障 - // handler: this.alxeFailure, - // cmdType: CMD.Section.CMD_SECTION_ADD_FAULT - // }, { label: this.$t('menu.menuSection.setFault'), handler: this.setStoppage, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: this.$t('menu.menuSection.cancelFault'), handler: this.cancelStoppage, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -228,14 +223,22 @@ export default { } }); }, + // 设置故障 setStoppage() { - commitOperate(menuOperate.Section.setFault, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{ + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$refs.setFault.doShow(operate, this.selected); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } }); }, - cancelStoppage() {} + // 取消故障 + cancelStoppage() { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); + } + }); + } } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue index 7bbd70f20..a5d218da8 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSignal.vue @@ -8,7 +8,8 @@ - + \ + @@ -26,9 +27,8 @@ import {menuOperate, commitOperate} from './utils/menuOperate'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import { mapGetters } from 'vuex'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; -// import { querySignalStatus } from '@/api/simulation'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SignalMenu', @@ -41,7 +41,8 @@ export default { RouteHandControl, RouteDetail, RouterCommand, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -166,20 +167,15 @@ export default { ] }, menuForce: [ - { - label: '信号关灯', - handler: this.signalClose, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL - }, { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -215,7 +211,7 @@ export default { self.doClose(); }; }, - initMenu() { + initMenu() { this.menu = MenuContextHandler.covert(this.menuNormal); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { @@ -235,50 +231,6 @@ export default { this.$refs.popMenu.close(); } }, - // 设置故障 - setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.stoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(); - }); - }, - // 取消故障 - cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(); - }); - }, // 获取进路列表 getRouteList(selectType) { const routes = []; @@ -392,6 +344,22 @@ export default { this.$refs.routerCommand.doShow(operate, this.selected, '是否执行引导命令?'); } }); + }, + // 设置故障 + setStoppage() { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); + } + }); + }, + // 取消故障 + cancelStoppage() { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); + } + }); } } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue index 6cbcd77fc..c47a6cc6f 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSwitch.vue @@ -6,6 +6,7 @@ + @@ -17,9 +18,9 @@ import SpeedLimitControl from './dialog/speedLimitControl'; import AlxeEffective from './dialog/alxeEffective'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import { mapGetters } from 'vuex'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import {menuOperate, commitOperate} from './utils/menuOperate'; @@ -32,7 +33,8 @@ export default { SwitchUnLock, SpeedLimitControl, AlxeEffective, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -129,12 +131,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -184,50 +186,6 @@ export default { this.$refs.popMenu.close(); } }, - // 设置故障 - setStoppage() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.stoppage.menu.operation, - param: { - switchCode: this.selected.code - } - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(); - }); - }, - // 取消故障 - cancelStoppage() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - param: { - switchCode: this.selected.code - } - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(); - } - }).catch(() => { - this.$refs.noticeInfo.doShow(); - }); - }, // 定操定位 locate() { commitOperate(menuOperate.Switch.npChain, {switchCode:this.selected.code}, 0).then(({valid, operate})=>{ @@ -315,6 +273,22 @@ export default { callback: action => { } }); + }, + // 设置故障 + setStoppage() { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); + } + }); + }, + // 取消故障 + cancelStoppage() { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); + } + }); } } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js index 34383dd3c..09a216171 100644 --- a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js @@ -263,6 +263,16 @@ export const menuOperate = { operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL } + }, + Common: { + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } } }; diff --git a/src/jmapNew/theme/xian_01/menus/menuSection.vue b/src/jmapNew/theme/xian_01/menus/menuSection.vue index 8c55dfa1a..21816f04b 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSection.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSection.vue @@ -17,11 +17,10 @@ import SpeedCmdControl from './dialog/speedCmdControl'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import { menuOperate, commitOperate } from './utils/menuOperate'; -import SetFault from './dialog/setFault'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SectionMenu', @@ -113,14 +112,14 @@ export default { }, menuForce: [ { - label: this.$t('menu.menuSection.setFault'), + label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { - label: this.$t('menu.menuSection.cancelFault'), + label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -175,7 +174,7 @@ export default { setStoppage() { commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$refs.setFault.doShow(operate, this.selected); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } }); }, @@ -183,7 +182,7 @@ export default { cancelStoppage() { commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$refs.setFault.doShow(operate, this.selected); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } }); }, diff --git a/src/jmapNew/theme/xian_01/menus/menuSignal.vue b/src/jmapNew/theme/xian_01/menus/menuSignal.vue index d349989f0..197a15e81 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSignal.vue @@ -8,7 +8,7 @@ - + @@ -24,10 +24,9 @@ import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import { mapGetters } from 'vuex'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { menuOperate, commitOperate } from './utils/menuOperate'; -import SetFault from './dialog/setFault'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SignalMenu', @@ -40,7 +39,7 @@ export default { RouteHandControl, RouteDetail, NoticeInfo, - SetFault + SetFault }, props: { selected: { @@ -166,14 +165,14 @@ export default { }, menuForce: [ { - label: this.$t('menu.menuSignal.setFault'), + label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { - label: this.$t('menu.menuSignal.cancelFault'), + label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -232,7 +231,7 @@ export default { setStoppage() { commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$refs.setFault.doShow(operate, this.selected); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } }); }, @@ -240,7 +239,7 @@ export default { cancelStoppage() { commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$refs.setFault.doShow(operate, this.selected); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } }); }, diff --git a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue index ead1453dc..17aebdcbe 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue @@ -17,11 +17,10 @@ import SpeedCmdControl from './dialog/speedCmdControl'; import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; -import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import { menuOperate, commitOperate } from './utils/menuOperate'; -import SetFault from './dialog/setFault'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SwitchMenu', @@ -157,20 +156,14 @@ export default { }, menuForce: [ { - label: this.$t('menu.menuSwitch.setFault'), + label: '设置故障', handler: this.setStoppage, - auth: { - - }, - cmdType:CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { - label: this.$t('menu.menuSwitch.cancelFault'), + label: '取消故障', handler: this.cancelStoppage, - auth: { - - }, - cmdType:CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -227,7 +220,7 @@ export default { setStoppage() { commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$refs.setFault.doShow(operate, this.selected); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } }); }, @@ -235,7 +228,7 @@ export default { cancelStoppage() { commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$refs.setFault.doShow(operate, this.selected); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } }); }, diff --git a/src/jmapNew/theme/xian_02/menus/index.vue b/src/jmapNew/theme/xian_02/menus/index.vue index 93d0672ea..2eb3607ae 100644 --- a/src/jmapNew/theme/xian_02/menus/index.vue +++ b/src/jmapNew/theme/xian_02/menus/index.vue @@ -228,6 +228,12 @@ export default { .xian-02__system .el-dialog .el-button:disabled span { border: 0px; } + .xian-02__system .el-select-dropdown__item { + background: #5F9EA0; + } + .xian-02__system .el-select-dropdown__list { + background: #5F9EA0; + } .xian-02__select-option .el-select-dropdown__item{ background: #5F9EA0; } @@ -296,9 +302,9 @@ export default { line-height: 22px !important; } - .xian-02__system .el-dialog .el-input.is-disabled .el-input__inner { - background: #F0F0F0 !important; - } + /*.xian-02__system .el-dialog .el-input.is-disabled .el-input__inner {*/ + /*background: #F0F0F0 !important;*/ + /*}*/ .xian-02__system .el-dialog .el-textarea { border-style:solid; diff --git a/src/jmapNew/theme/xian_02/menus/menuSection.vue b/src/jmapNew/theme/xian_02/menus/menuSection.vue index 4d753ce25..705cad421 100644 --- a/src/jmapNew/theme/xian_02/menus/menuSection.vue +++ b/src/jmapNew/theme/xian_02/menus/menuSection.vue @@ -6,6 +6,7 @@ + @@ -22,6 +23,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; // import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import {menuOperate, commitOperate} from './utils/menuOperate'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SectionMenu', @@ -31,7 +33,8 @@ export default { SectionUnLock, SpeedLimitControl, AlxeEffective, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -116,9 +119,14 @@ export default { }, menuForce: [ { - label: '设置计轴失效', // 设置区段故障 - handler: this.alxeFailure, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + label: '设置故障', + handler: this.setStoppage, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + { + label: '取消故障', + handler: this.cancelStoppage, + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -170,12 +178,20 @@ export default { this.$refs.popMenu.close(); } }, - // 设置计轴失效 - alxeFailure() { - this.mouseCancelState(this.selected); - commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then(({valid, operate})=>{ - }).catch((error)=>{ - this.$refs.noticeInfo.doShow({}, error.message); + // 设置故障 + setStoppage() { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); + } + }); + }, + // 取消故障 + cancelStoppage() { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); + } }); }, // 故障解锁 diff --git a/src/jmapNew/theme/xian_02/menus/menuSignal.vue b/src/jmapNew/theme/xian_02/menus/menuSignal.vue index 94c7d49e7..363b79694 100644 --- a/src/jmapNew/theme/xian_02/menus/menuSignal.vue +++ b/src/jmapNew/theme/xian_02/menus/menuSignal.vue @@ -9,6 +9,7 @@ + @@ -28,7 +29,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; -// import { querySignalStatus } from '@/api/simulation'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SignalMenu', @@ -41,7 +42,8 @@ export default { RouteHandControl, RouteDetail, RouterCommand, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -188,20 +190,15 @@ export default { } ], menuForce: [ - { - label: '信号关灯', - handler: this.signalClose, - cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL - }, { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -269,46 +266,19 @@ export default { }, // 设置故障 setStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.stoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_ADD_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + console.log(this, this.$refs, '==='); + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 cancelStoppage() { - const step = { - start: true, - code: `${this.selected.code}`, - operation: OperationEvent.Signal.cancelStoppage.menu.operation, - cmdType: CMD.Signal.CMD_SIGNAL_REMOVE_FAULT, - param: { - signalCode: `${this.selected.code}` - } - }; - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 获取进路列表 diff --git a/src/jmapNew/theme/xian_02/menus/menuSwitch.vue b/src/jmapNew/theme/xian_02/menus/menuSwitch.vue index 2046d7da4..62efcc86f 100644 --- a/src/jmapNew/theme/xian_02/menus/menuSwitch.vue +++ b/src/jmapNew/theme/xian_02/menus/menuSwitch.vue @@ -6,6 +6,7 @@ + @@ -23,6 +24,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import {menuOperate, commitOperate} from './utils/menuOperate'; +import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; export default { name: 'SwitchMenu', @@ -32,7 +34,8 @@ export default { SwitchUnLock, SpeedLimitControl, AlxeEffective, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -146,12 +149,12 @@ export default { { label: '设置故障', handler: this.setStoppage, - cmdType: CMD.Switch.CMD_SWITCH_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, { label: '取消故障', handler: this.cancelStoppage, - cmdType: CMD.Switch.CMD_SWITCH_REMOVE_FAULT + cmdType: CMD.Fault.CMD_CANCEL_FAULT } ] }; @@ -238,26 +241,20 @@ export default { this.$refs.noticeInfo.doShow(operate); }); }, + // 设置故障 + setStoppage() { + commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(menuOperate.Common.setFault, this.selected); + } + }); + }, // 取消故障 cancelStoppage() { - const operate = { - start: true, - code: this.selected.code, - operation: OperationEvent.Switch.cancelStoppage.menu.operation, - param: { - switchCode: this.selected.code - } - }; - - this.mouseCancelState(this.selected); - this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { + commitOperate(menuOperate.Common.cancelFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.setFault.doShow(menuOperate.Common.cancelFault, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(operate); }); }, // 定操定位 diff --git a/src/jmapNew/theme/xian_02/menus/utils/menuOperate.js b/src/jmapNew/theme/xian_02/menus/utils/menuOperate.js index 5dcae4248..929324f24 100644 --- a/src/jmapNew/theme/xian_02/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/xian_02/menus/utils/menuOperate.js @@ -257,6 +257,16 @@ export const menuOperate = { operation: OperationEvent.StationControl.emergencyStationControl.menu.operation, cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL } + }, + Common: { + setFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } } }; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 080406116..4ff00eac2 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - BASE_API = 'http://192.168.3.6:9000'; // 旭强 + // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张S赛 diff --git a/src/views/newMap/mapsystemNew/plugin/setFault.vue b/src/views/newMap/mapsystemNew/plugin/setFault.vue new file mode 100644 index 000000000..20c3688ba --- /dev/null +++ b/src/views/newMap/mapsystemNew/plugin/setFault.vue @@ -0,0 +1,174 @@ + + + From cc8b7003280a58ba4c90808f0ad4496e4804ccde Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Mon, 18 May 2020 15:18:57 +0800 Subject: [PATCH 11/40] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E5=BD=95=E5=88=B6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4=20=E9=80=80=E5=87=BA?= =?UTF-8?q?=E5=89=A7=E6=9C=AC=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 --- src/views/newMap/displayNew/chatView/chatBox.vue | 5 ++++- src/views/newMap/displayNew/designIndex.vue | 1 - src/views/newMap/displayNew/menuDemon.vue | 2 ++ src/views/scriptManage/scriptRecord/addAction.vue | 15 ++++++++++++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/views/newMap/displayNew/chatView/chatBox.vue b/src/views/newMap/displayNew/chatView/chatBox.vue index e12fca1d9..a9b079620 100644 --- a/src/views/newMap/displayNew/chatView/chatBox.vue +++ b/src/views/newMap/displayNew/chatView/chatBox.vue @@ -81,7 +81,7 @@ export default { language:'zh', sex:'1' }, - headerTitle:'所有人' + headerTitle:'' }; }, watch: { @@ -134,6 +134,9 @@ export default { }, setCurrentCoversition(coversition) { this.currentCoversition = coversition; + if (coversition.group) { + this.headerTitle = coversition.name; + } if (this.recordSending) { this.cancleRecording(); } diff --git a/src/views/newMap/displayNew/designIndex.vue b/src/views/newMap/displayNew/designIndex.vue index f6ed7bdb6..8ffb148e0 100644 --- a/src/views/newMap/displayNew/designIndex.vue +++ b/src/views/newMap/displayNew/designIndex.vue @@ -338,7 +338,6 @@ export default { } if (this.drawWay) { scriptExecuteNew(this.group).then(data=>{ - this.$refs.menuDemon.clearAllData(); }).catch(error=>{ console.log(error); }); diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 956486d99..5ecee252f 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -233,6 +233,7 @@ export default { getSimulationInfoNew(this.group).then(()=>{ this.$emit('quitQuest'); this.initLoadPage(); + this.clearAllData(); }).catch(()=>{ this.$messageBox(this.$t('display.demon.exitTaskFail')); }); @@ -247,6 +248,7 @@ export default { getSimulationInfoNew(this.group).then(()=>{ this.$emit('quitQuest'); this.initLoadPage(); + this.clearAllData(); }).catch(()=>{ this.$messageBox(this.$t('display.demon.exitTaskFail')); }); diff --git a/src/views/scriptManage/scriptRecord/addAction.vue b/src/views/scriptManage/scriptRecord/addAction.vue index 31d3eeb55..83e0ab83b 100644 --- a/src/views/scriptManage/scriptRecord/addAction.vue +++ b/src/views/scriptManage/scriptRecord/addAction.vue @@ -201,7 +201,7 @@ export default { this.$refs['commandDataNew'].clearValidate(); if (!val) { this.initActionData(); - this.initCommandActionData(); + this.clearCommand(); } } else { this.$refs['commandData'].clearValidate(); @@ -236,7 +236,7 @@ export default { const lastData = JSON.stringify(resp.data); this.memberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); this.resetDisabled(); - this.initCommandActionData(); + this.clearCommand(); }).catch(error => { this.$message(error.message); }); @@ -363,6 +363,9 @@ export default { changeMember(member) { if (member) { this.messageTips1 = ''; + this.executeCommandName = ''; + this.commandDataNew.action.operationType = ''; + this.commandDataNew.action.operationParamMap = {}; } }, addCommandActionNew() { @@ -376,12 +379,12 @@ export default { this.messageTips2 = '请在右侧的地图中选择操作'; return false; } else { - debugger; const group = this.group; const data = this.commandDataNew.action; this.adding = true; addScriptActionNew(group, data).then(response=>{ this.adding = false; + this.clearCommand(); this.$message.success(this.$t('scriptRecord.addCommandSucess')); this.$emit('create'); }).catch(error => { @@ -390,6 +393,12 @@ export default { }); } }, + clearCommand() { + this.commandDataNew.action.memberId = ''; + this.executeCommandName = ''; + this.commandDataNew.action.operationType = ''; + this.commandDataNew.action.operationParamMap = {}; + }, addScriptActionInfo(formName) { this.$refs[formName].validate((valid) => { if (valid) { From c8d7347e611f31b2d41faca0228ebfdc1c272dea Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 18 May 2020 15:47:55 +0800 Subject: [PATCH 12/40] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jmap/lessondraft.js | 8 +++++ src/i18n/langs/zh/map.js | 2 +- src/utils/baseUrl.js | 4 +-- src/views/lesson/details.vue | 32 +++++++++++++++++-- .../lessoncategory/edit/lesson/index.vue | 9 ++++-- src/views/lesson/operateMenu.vue | 7 ++++ .../newMap/newDesignUser/mapmanage/edit.vue | 4 +-- .../newDesignUser/mapmanage/operateMenu.vue | 4 +-- .../newDesignUser/mapmanage/publish.vue | 1 + .../newDesignUser/mapmanage/publish3d.vue | 3 +- .../newMap/newDesignUser/mapmanage/saveAs.vue | 7 ++-- src/views/studentManage/index.vue | 2 +- 12 files changed, 67 insertions(+), 16 deletions(-) diff --git a/src/api/jmap/lessondraft.js b/src/api/jmap/lessondraft.js index 69b47b7c1..7c8a9bb9e 100644 --- a/src/api/jmap/lessondraft.js +++ b/src/api/jmap/lessondraft.js @@ -69,6 +69,14 @@ export function updateLessonChapter(data) { }); } +/** 删除课程章节*/ +export function deleteLessonChapter(id) { + return request({ + url: `/api/lessonDraft/chapter/${id}`, + method: 'delete' + }); +} + /** 创建课程章节详细内容*/ export function getLessonChapterDetail(data) { return request({ diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js index b95471af5..8d58a9c69 100644 --- a/src/i18n/langs/zh/map.js +++ b/src/i18n/langs/zh/map.js @@ -32,7 +32,7 @@ export default { save: '保存', updata: '更新', - updateObj: '修改', + updateObj: '修改名称', updateObjAxis: '更新坐标', saveAs: '另存为', publish: '发布', diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 4ff00eac2..8df5a551d 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - // BASE_API = 'http://192.168.3.82:9000'; // 杜康 + BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张S赛 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/lesson/details.vue b/src/views/lesson/details.vue index c63b2b677..d5df3f6cf 100644 --- a/src/views/lesson/details.vue +++ b/src/views/lesson/details.vue @@ -34,7 +34,7 @@ diff --git a/src/views/newMap/newDesignUser/mapmanage/saveAs.vue b/src/views/newMap/newDesignUser/mapmanage/saveAs.vue index ee1497d2f..3315bd056 100644 --- a/src/views/newMap/newDesignUser/mapmanage/saveAs.vue +++ b/src/views/newMap/newDesignUser/mapmanage/saveAs.vue @@ -2,8 +2,11 @@
- - + + {{ this.map.name }} + + +
diff --git a/src/views/studentManage/index.vue b/src/views/studentManage/index.vue index 953fbe957..30dcd973a 100644 --- a/src/views/studentManage/index.vue +++ b/src/views/studentManage/index.vue @@ -343,7 +343,7 @@ export default { totolScore += centerLessonPassRate * 100; } }); - totolScore += item.attendance * 100 * 10 / 100; + totolScore += item.attendance * 100 * 10 / 100 * 100; this.tableData.push( { index: index + 1, From 9e03602403cd2275c6cbfb5f729f1e68226e917b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 18 May 2020 16:08:49 +0800 Subject: [PATCH 13/40] =?UTF-8?q?=E8=8D=89=E7=A8=BF=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E7=82=B9=E5=87=BB=E6=94=B9=E5=8F=98tree?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/lesson/details.vue | 1 - src/views/newMap/newDesignUser/demonList.vue | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/lesson/details.vue b/src/views/lesson/details.vue index d5df3f6cf..1e6b19fef 100644 --- a/src/views/lesson/details.vue +++ b/src/views/lesson/details.vue @@ -116,7 +116,6 @@ export default { }); }, deleteChapter(node) { - console.log(node, '-----------'); const _that = this; this.$confirm('是否确认删除章节《' + node.data.name + '》 ' + ' ?', this.$t('tip.hint'), { confirmButtonText: '确认', diff --git a/src/views/newMap/newDesignUser/demonList.vue b/src/views/newMap/newDesignUser/demonList.vue index 92e4fad11..e132ea07c 100644 --- a/src/views/newMap/newDesignUser/demonList.vue +++ b/src/views/newMap/newDesignUser/demonList.vue @@ -6,7 +6,7 @@
- +  {{ tnode.label }} @@ -131,6 +131,8 @@ export default { } }, showContextMenu(e, obj, node, vueElem) { + this.$refs.tree.setCurrentKey(obj.id); + this.$refs.tree.currentNode = node; if (obj && obj.type == 'map') { e.preventDefault(); const menu = DeviceMenu.Map; From b8bf51fc82b976aa9949bf669b2b7df0c4a92a83 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 18 May 2020 17:08:21 +0800 Subject: [PATCH 14/40] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=BB=98=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 6 --- src/jmapNew/shape/Switch/index.js | 2 +- src/scripts/GlobalPlugin.js | 1 + src/utils/index.js | 6 +-- .../newMapdraft/mapoperate/ControlDraft.vue | 6 +-- .../newMapdraft/mapoperate/ImageControl.vue | 7 ++-- .../newMap/newMapdraft/mapoperate/arrow.vue | 11 +++-- .../newMapdraft/mapoperate/checkboxDraft.vue | 5 --- .../newMapdraft/mapoperate/controlLamp.vue | 6 +-- .../newMap/newMapdraft/mapoperate/counter.vue | 11 +++-- .../newMapdraft/mapoperate/delayunlock.vue | 11 +++-- .../newMapdraft/mapoperate/espDraft.vue | 4 +- .../newMap/newMapdraft/mapoperate/index.vue | 3 +- .../newMapdraft/mapoperate/lcControl.vue | 11 +++-- .../newMap/newMapdraft/mapoperate/line.vue | 25 +++-------- .../mapoperate/outFrameControl.vue | 11 +++-- .../newMapdraft/mapoperate/psdDraft.vue | 10 ++--- .../newMapdraft/mapoperate/section/index.vue | 35 ++++------------ .../newMapdraft/mapoperate/signal/index.vue | 41 +++---------------- .../newMapdraft/mapoperate/splitStation.vue | 6 +-- .../newMap/newMapdraft/mapoperate/station.vue | 11 ++--- .../newMapdraft/mapoperate/stationstand.vue | 13 +++--- .../newMapdraft/mapoperate/switch/index.vue | 3 ++ .../mapoperate/switch/switchModle.vue | 12 +++--- .../newMap/newMapdraft/mapoperate/text.vue | 11 +++-- .../newMapdraft/mapoperate/trainwindow.vue | 7 ++-- .../newMapdraft/mapoperate/zcControl.vue | 11 +++-- 27 files changed, 96 insertions(+), 190 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index b1b8e3a3a..89775ba64 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -262,9 +262,6 @@ class Jlmap { const sectionC = this.mapDevice[item.sectionCCode]; if (sectionA && sectionB && sectionC) { item['cutOff'] = sectionA.cutOff; - item['sectionAstatus'] = sectionA.status; - item['sectionBstatus'] = sectionB.status; - item['sectionCstatus'] = sectionC.status; } } @@ -281,9 +278,6 @@ class Jlmap { const sectionC = this.mapDevice[swch.sectionCCode]; if (sectionA && sectionB && sectionC) { swch['cutOff'] = sectionA.cutOff; - swch['sectionAstatus'] = sectionA.status; - swch['sectionBstatus'] = sectionB.status; - swch['sectionCstatus'] = sectionC.status; } this.$painter.update(swch); diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 0b9312fcf..b8c4f86b2 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -434,7 +434,7 @@ export default class Switch extends Group { } sectionCutOff(section) { - const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0); + const lineWidth = this.style.Section.line.width; if (section) { section.animateStyle(true, [ { time: 0, styles: { lineWidth: lineWidth } }, diff --git a/src/scripts/GlobalPlugin.js b/src/scripts/GlobalPlugin.js index 0a466d53e..8307b1367 100644 --- a/src/scripts/GlobalPlugin.js +++ b/src/scripts/GlobalPlugin.js @@ -5,6 +5,7 @@ import TurnbackBar from '@/components/TurnbackBar'; import ConstConfig from '@/scripts/ConstConfig'; import Dictionary from '@/scripts/DictionaryData'; import Theme from '@/jmapNew/theme/factory'; +import store from './../store/index_Common'; // 全局组件 Vue.component('DataForm', DataForm); diff --git a/src/utils/index.js b/src/utils/index.js index bad85f49a..74f5b079d 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -149,9 +149,9 @@ export function deepAssign(obj, item) { const target = item.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象 for (const keys in item) { if (item.hasOwnProperty(keys) && keys != 'instance') { // instance 对面不拷贝 - if (item[keys] && typeof item[keys] === 'object') { // 如果值是对象,就递归一下 - target[keys] = item[keys].constructor === Array ? [] : {}; - target[keys] = deepClone(item[keys]); + if (item[keys] && typeof item[keys] == 'object') { // 如果值是对象,就递归一下 + const targetObj = item[keys].constructor == Array ? [] : {}; + target[keys] = deepAssign(targetObj, item[keys]); } else { target[keys] = item[keys]; } diff --git a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue index 1adf5f3be..0437a5302 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue @@ -312,7 +312,6 @@ export default { this.$refs.make.validate((valid) => { if (valid) { const uid = getUID(this.addModel.type, this.selectLists); // 根据类型写 uid 前缀命名 - const models = []; const model = { _type: this.addModel.type, code: uid, @@ -326,8 +325,7 @@ export default { cycleCode: this.addModel.cycleCode, // 自动折返关联code stationCode: this.addModel.stationCode // 所属设备集中站 }; - models.push(model); - this.$emit('updateMapModel', models); + this.$emit('updateMapModel', model); this.$refs.make.resetForm(); } }); @@ -337,7 +335,7 @@ export default { this.$refs['dataform'].validate((valid) => { if (valid) { const data = Object.assign({_type: this.editModel.type}, this.editModel); - this.$emit('updateMapModel', [data]); + this.$emit('updateMapModel', data); } }); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index 5197fde13..a8ed0b3ba 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -226,16 +226,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Resource'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('map.confirm'), cancelButtonText: this.$t('map.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/arrow.vue b/src/views/newMap/newMapdraft/mapoperate/arrow.vue index b310e353b..07cf434ac 100644 --- a/src/views/newMap/newMapdraft/mapoperate/arrow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/arrow.vue @@ -150,8 +150,8 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.form && this.$refs.form.resetFields(); - this.$refs.createForm && this.$refs.createForm.resetFields(); + this.$refs.form && this.$refs.form.resetFields(); + this.$refs.createForm && this.$refs.createForm.resetFields(); if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -204,16 +204,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue index 737cd465e..5b4e35d38 100644 --- a/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/checkboxDraft.vue @@ -151,11 +151,6 @@ export default { models.push(Model); }); }); - // this.seclectDeviceList.forEach(model => { - // const Model = deepAssign({}, this.$store.getters['map/getDeviceByCode'](model.code)); - // Model.stationCode = this.stationCode; - // models.push(Model); - // }); this.$emit('updateMapModel', models); this.$message.success('设置设备集中站成功'); this.stationCode = ''; diff --git a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue index 8d5ca3f34..96830f268 100644 --- a/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue +++ b/src/views/newMap/newMapdraft/mapoperate/controlLamp.vue @@ -501,7 +501,6 @@ export default { this.$refs.make.validate((valid) => { if (valid) { const uid = getUID(this.getIdPrefix(this.addModel.type), this.selectLists); // 根据类型写 uid 前缀命名 - const models = []; const model = { _type: this.addModel.type, type: this.addModel.type, @@ -516,8 +515,7 @@ export default { stationCode: this.addModel.stationCode, // 所属设备集中站 switchCode: this.addModel.switchCode }; - models.push(model); - this.$emit('updateMapModel', models); + this.$emit('updateMapModel', model); this.$refs.make.resetForm(); } }); @@ -527,7 +525,7 @@ export default { this.$refs['dataform'].validate((valid) => { if (valid) { const data = Object.assign({_type: this.editModel.type}, this.editModel); - this.$emit('updateMapModel', [data]); + this.$emit('updateMapModel', data); } }); }, diff --git a/src/views/newMap/newMapdraft/mapoperate/counter.vue b/src/views/newMap/newMapdraft/mapoperate/counter.vue index cfbf2a66e..d92995565 100644 --- a/src/views/newMap/newMapdraft/mapoperate/counter.vue +++ b/src/views/newMap/newMapdraft/mapoperate/counter.vue @@ -179,8 +179,8 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.form && this.$refs.form.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -228,16 +228,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Counter'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('map.confirm'), cancelButtonText: this.$t('map.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue index 05974bcbd..e710c84b4 100644 --- a/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue +++ b/src/views/newMap/newMapdraft/mapoperate/delayunlock.vue @@ -162,8 +162,8 @@ export default { }, deviceSelect(selected) { this.$nextTick(() => { - this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.form && this.$refs.form.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -210,16 +210,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'DelayUnlock'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('map.confirm'), cancelButtonText: this.$t('map.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue index 90c2b10b3..3c1093231 100644 --- a/src/views/newMap/newMapdraft/mapoperate/espDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/espDraft.vue @@ -135,7 +135,7 @@ export default { }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() === 'Esp'.toUpperCase()) { - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } @@ -197,7 +197,7 @@ export default { }).then(() => { this.$store.dispatch('map/delMapStandData', {models: [selected], type: 'espList'}); this.deviceSelect(); - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { this.$message.info(this.$t('tip.cancelledDelete')); }); diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index feaeb244d..88352b0da 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -325,8 +325,7 @@ export default { this.$emit('showMap'); }, handleSelectControlPage(device) { - const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', - 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle']; + const controlLampTypeList = ['AtsControl', 'CenterCommunication', 'ChainControl', 'IntersiteControl', 'LeuControl', 'LocalControl', 'Maintain', 'SwitchFault', 'PowerSupply', 'NoOneReturn', 'MaintenanceLamps', 'ZcCommunication', 'FaultStatusGroup', 'ModeStatusGroup', 'LampFilament', 'ReturnModeGroup', 'ControlSwitch', 'Axle']; const type = device._type; if (this.stationType) { this.enabledTab = 'Station'; diff --git a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue index 4bfca3c1c..60ef3ed5c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/lcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/lcControl.vue @@ -169,8 +169,8 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.form && this.$refs.form.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -206,16 +206,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'LcControl'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/line.vue b/src/views/newMap/newMapdraft/mapoperate/line.vue index af51db33f..2ce06e561 100644 --- a/src/views/newMap/newMapdraft/mapoperate/line.vue +++ b/src/views/newMap/newMapdraft/mapoperate/line.vue @@ -213,9 +213,9 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) { + this.$refs.form && this.$refs.form.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } @@ -234,18 +234,6 @@ export default { delPointAddModel(index) { this.addModel.points.splice(index, 1); }, - clear() { - this.addModel = { - type: '', - width: 1, - showConditions: '01', - lineColor: 'rgba(255, 255, 255, 1)', - points: [ - { x: 0, y: 0 }, - { x: 100, y: 100 } - ] - }; - }, create() { this.$refs['make'].validate((valid) => { if (valid) { @@ -261,7 +249,7 @@ export default { points: JSON.parse(pointArr) }; this.$emit('updateMapModel', model); - this.clear(); + this.$refs.make && this.$refs.make.resetFields(); } else { this.$message.console.error(this.$t('tip.cannotCoincide')); @@ -282,16 +270,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue index 5b1ae05cf..0d0a6a34a 100644 --- a/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/outFrameControl.vue @@ -216,8 +216,8 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.form && this.$refs.form.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -257,16 +257,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'OutFrame'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue index e2cdaeff5..bd0a7b507 100644 --- a/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue +++ b/src/views/newMap/newMapdraft/mapoperate/psdDraft.vue @@ -223,7 +223,7 @@ export default { }, deviceSelect(selected) { if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) { - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } @@ -271,17 +271,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Psd'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index f5aece895..fb7047a19 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -502,14 +502,9 @@ export default { this.clear(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); - this.editModel.points = JSON.parse(JSON.stringify(selected.points)); - this.editModel.lengthFact = selected.lengthFact || 0; // 过滤非正常数值 - this.oldPoint = JSON.parse(JSON.stringify(selected.points)); + this.oldPoint = selected.points; this.oldLeftSectionCode = selected.leftSectionCode; this.oldRightSectionCode = selected.rightSectionCode; - this.editModel.leftAxlePosition = selected.leftAxlePosition || 0; // 重置计轴显示 - this.editModel.rightAxlePosition = selected.rightAxlePosition || 0; // 重置计轴显示 - this.editModel.belongStation = selected.belongStation || ''; if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) { this.$refs.splitOrMerge.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz); this.$refs.splitOrMerge.addModel.splitOffset = this.$refs.splitOrMerge.addModel.splitOffsetMax / 2; @@ -583,8 +578,7 @@ export default { } }); }, - handleOtherSectionChange(model) { - // 处理该区段改变导致的相关区段的变化 + handleOtherSectionChange(model) { // 处理该区段改变导致的相关区段的变化 const models = []; const pointModel = []; const slope1 = (this.oldPoint[this.oldPoint.length - 1].y - this.oldPoint[0].y) / (this.oldPoint[this.oldPoint.length - 1].x - this.oldPoint[0].x); @@ -592,7 +586,6 @@ export default { if (section.parentCode === model.code) { // 逻辑区段 const copySection = deepAssign({}, section); copySection.logicSectionShow = model.logicSectionShow; - // copySection.lengthFact = (Number(model.lengthFact) / model.logicSectionCodeList.length).toFixed(3); // 容易处理成无限大 copySection.stationCode = model.stationCode; // 给元素 子逻辑区段设置 设备集中站 if (this.checkPointsCoincide(this.oldPoint[0], copySection.points[0])) { copySection.points[0] = model.points[0]; @@ -600,7 +593,7 @@ export default { copySection.points[copySection.points.length - 1] = model.points[model.points.length - 1]; } models.push(copySection); - } else if (model.code !== section.code && (section.type === '01' || section.type === '03' || section.type === '02')) { + } else if (model.code !== section.code && section.type != '04') { const copySection = deepAssign({}, section); let updataFlag = false; if (model.leftSectionCode !== this.oldLeftSectionCode) { @@ -622,13 +615,10 @@ export default { } } if (model.parentCode == copySection.code) { // 物理区段 - let lengthFact = 0; - copySection.logicSectionCodeList.forEach(code => { - if (model.code != code) { - const localSectionModel = this.$store.getters['map/getDeviceByCode'](code); - lengthFact += Number(localSectionModel.lengthFact); - } - }); + let lengthFact = copySection.logicSectionCodeList.filter(code => model.code != code).reduce((pre, code) => { + const length = this.$store.getters['map/getDeviceByCode'](code).lengthFact; + return pre + Number(length); + }, 0); lengthFact += model.lengthFact; copySection.lengthFact = lengthFact.toFixed(3); // 自动获取 物理区段的 实际长度 是由逻辑区段相加 if (copySection.lengthFact > 5) { @@ -696,7 +686,6 @@ export default { models = [...models, ...deleteObjAssociatedSection]; this.$emit('updateMapModel', models); this.clear(); - this.deviceSelect(); }).catch(error => { console.log(error); this.$message.info(this.$t('tip.cancelledDelete')); @@ -736,15 +725,7 @@ export default { } }, clear() { - this.$refs.dataform && this.$refs.dataform.resetFields(); - // 新加属性需要单独在这里清除(避免老数据无新属性,深拷贝是未获取属性,沿用上一个设备的属性导致的数据污染) - this.editModel.logicSectionCodeList = []; - this.editModel.rightSectionCode = ''; - this.editModel.leftSectionCode = ''; - this.editModel.rightAxleOffset = {x:0, y:0}; - this.editModel.leftAxleOffset = {x:0, y:0}; - this.editModel.leftAxlePosition = 0; - this.editModel.rightAxlePosition = 0; + this.$refs.dataform && this.$refs.dataform.resetFields(); // 表单重置 移入校验结果 } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue index abc855339..7cf9faa93 100644 --- a/src/views/newMap/newMapdraft/mapoperate/signal/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/signal/index.vue @@ -33,12 +33,7 @@ - + @@ -50,22 +45,12 @@ - + - + @@ -133,7 +118,6 @@ export default { SignalLampPostTypeList: [], SignalLampPositionTypeList: [], SignalPositionTypeList: [], - // SignalUseTypeList: [], failTypes: [ { code: '00', name: this.$t('map.normal') }, { code: '01', name: this.$t('map.signalFilamentAlarm') } @@ -277,7 +261,6 @@ export default { { prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }, { prop: 'interlockStationCode', label: '所属联锁站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.ciStationList}, { prop: 'uniqueName', label: this.$t('map.signalUniqueName'), type: 'input' }, - // { prop: 'useType', label: this.$t('map.signalUseType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList }, { prop: 'sectionCode', label: this.$t('map.belongsSection'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.signalSectionList }, { prop: 'sectionOffset', label: this.$t('map.signalOffset'), type: 'number', min: 0, placeholder: this.$t('tip.meter') } @@ -340,10 +323,6 @@ export default { this.$Dictionary.signalPositionType().then(list => { this.SignalPositionTypeList = list; }); - - // this.$Dictionary.signalUseType().then(list => { - // this.SignalUseTypeList = list; - // }); }, methods: { deviceChange(code) { @@ -355,14 +334,6 @@ export default { this.$refs.dataform && this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); - this.editModel.rotate = selected.rotate || 0; // 角度 - this.editModel.type = selected.type || ''; - this.editModel.interlockStationCode = selected.interlockStationCode || ''; - if (!selected.positionPoint) { - this.editModel.positionPoint.x = 0; - this.editModel.positionPoint.y = 0; - } - this.editModel.right = Boolean(selected.right); } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectSingalCode'.toUpperCase()) { if (selected.type == '01' || selected.type === '03') { this.$refs.createSignal.setSectionCode(selected.code); @@ -394,17 +365,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type === 'Signal') { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue index 36405bc6e..4d88e5afe 100644 --- a/src/views/newMap/newMapdraft/mapoperate/splitStation.vue +++ b/src/views/newMap/newMapdraft/mapoperate/splitStation.vue @@ -140,8 +140,8 @@ export default { }, methods: { deviceSelect(selected) { - this.$refs.dataform && this.$refs.dataform.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type === 'SplitStation') { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -190,7 +190,7 @@ export default { type: 'warning' }).then(() => { this.$emit('updateMapModel', {...selected, _dispose: true}); - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { this.$message.info(this.$t('tip.cancelledDelete')); }); diff --git a/src/views/newMap/newMapdraft/mapoperate/station.vue b/src/views/newMap/newMapdraft/mapoperate/station.vue index a285659d8..1c5c03d54 100644 --- a/src/views/newMap/newMapdraft/mapoperate/station.vue +++ b/src/views/newMap/newMapdraft/mapoperate/station.vue @@ -292,12 +292,10 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - // this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); - this.editModel.runPlanName = selected.runPlanName || ''; // 被控制的车站数据 const beCentralizedStation = {}; this.stationList.forEach(data=>{ @@ -478,16 +476,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue index af7148833..d18f17c14 100644 --- a/src/views/newMap/newMapdraft/mapoperate/stationstand.vue +++ b/src/views/newMap/newMapdraft/mapoperate/stationstand.vue @@ -235,8 +235,7 @@ export default { }; // 清空表单验证提示信息 this.$nextTick(() => { - this.$refs.dataform && - this.$refs.dataform.clearValidate(); + this.$refs.dataform && this.$refs.dataform.clearValidate(); }); return rules; @@ -367,7 +366,7 @@ export default { }, deviceSelect(selected) { if (this.field.toUpperCase() != 'standSelectStationCode'.toUpperCase() && selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); } @@ -493,7 +492,6 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'StationStand'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), @@ -511,11 +509,10 @@ export default { models.push(deepAssign(item, { _dispose: true })); } }); - _that.$emit('updateMapModel', models); - _that.deviceSelect(); - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$emit('updateMapModel', models); + this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue index 730120093..65fba51cc 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch/index.vue @@ -98,6 +98,9 @@ export default { }, deleteObj() { this.$refs.switchModel.deleteObj(); + }, + edit() { + this.$refs.switchModel.edit(); } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/switch/switchModle.vue b/src/views/newMap/newMapdraft/mapoperate/switch/switchModle.vue index dd2c20937..3787ef278 100644 --- a/src/views/newMap/newMapdraft/mapoperate/switch/switchModle.vue +++ b/src/views/newMap/newMapdraft/mapoperate/switch/switchModle.vue @@ -103,8 +103,7 @@ export default { }; // 清空表单验证提示信息 this.$nextTick(() => { - this.$refs.dataform && - this.$refs.dataform.clearValidate(); + this.$refs.dataform && this.$refs.dataform.clearValidate(); }); return rules; @@ -129,7 +128,7 @@ export default { this.setModel(this.$store.getters['map/getDeviceByCode'](code)); }, setModel(data) { - this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); this.editModel = deepAssign(this.editModel, data); }, // 修改对象 @@ -148,17 +147,16 @@ export default { const models = []; const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Switch'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { models.push(deepAssign(selected, { _dispose: true })); - _that.$emit('updateMapModel', models); - _that.deviceSelect(); + this.$emit('updateMapModel', models); + this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelGeneration')); + this.$message.info(this.$t('tip.cancelGeneration')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/text.vue b/src/views/newMap/newMapdraft/mapoperate/text.vue index 35416b837..9add562bf 100644 --- a/src/views/newMap/newMapdraft/mapoperate/text.vue +++ b/src/views/newMap/newMapdraft/mapoperate/text.vue @@ -192,8 +192,8 @@ export default { this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code)); }, deviceSelect(selected) { - this.$refs.form && this.$refs.form.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.form && this.$refs.form.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -232,16 +232,15 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'Text'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), type: 'warning' }).then(() => { - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } } diff --git a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue index d2bb50dda..b69c3af7c 100644 --- a/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue +++ b/src/views/newMap/newMapdraft/mapoperate/trainwindow.vue @@ -348,7 +348,6 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'TrainWindow'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), @@ -363,10 +362,10 @@ export default { } }); models.push(deepAssign(selected, { _dispose: true })); - _that.$emit('updateMapModel', models); - _that.deviceSelect(); + this.$emit('updateMapModel', models); + this.$refs.form && this.$refs.form.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } }, diff --git a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue index 29836fff2..e5779eb98 100644 --- a/src/views/newMap/newMapdraft/mapoperate/zcControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/zcControl.vue @@ -182,8 +182,8 @@ export default { this.getConcertrateStation(); }, deviceSelect(selected) { - this.$refs.dataform && this.$refs.dataform.resetFields(); - this.$refs.make && this.$refs.make.resetFields(); + this.$refs.dataform && this.$refs.dataform.resetFields(); + this.$refs.make && this.$refs.make.resetFields(); if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); @@ -251,7 +251,6 @@ export default { deleteObj() { const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code); if (selected && selected._type.toUpperCase() === 'ZcControl'.toUpperCase()) { - const _that = this; this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { confirmButtonText: this.$t('tip.confirm'), cancelButtonText: this.$t('tip.cancel'), @@ -267,10 +266,10 @@ export default { } }); }); - _that.$emit('updateMapModel', {...selected, _dispose: true}); - _that.deviceSelect(); + this.$emit('updateMapModel', {...selected, _dispose: true}); + this.$refs.dataform && this.$refs.dataform.resetFields(); }).catch(() => { - _that.$message.info(this.$t('tip.cancelledDelete')); + this.$message.info(this.$t('tip.cancelledDelete')); }); } }, From 86d59db1779ed2e27852ccdfb609853f8243c927 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 18 May 2020 17:59:38 +0800 Subject: [PATCH 15/40] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 4 +- src/router/index_Common.js | 45 ++++++++-------- src/store/modules/permission.js | 11 ++-- src/utils/baseUrl.js | 4 +- .../newMap/mapsystemNew/plugin/setFault.vue | 53 ++++++++++++------- 5 files changed, 71 insertions(+), 46 deletions(-) diff --git a/src/permission.js b/src/permission.js index 949a5a037..9834b35a7 100644 --- a/src/permission.js +++ b/src/permission.js @@ -44,6 +44,9 @@ function getRouteInfo(to) { break; } } + if (whiteList.includes(toRoutePath)) { + removeToken(); + } if (isDesignPage(toRoutePath)) { const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; loginPath = whitePage || loginDesignPage; @@ -114,7 +117,6 @@ router.beforeEach((to, from, next) => { } } else { // 继电器使用 - // console.log(to); // 未登录情况下 if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 diff --git a/src/router/index_Common.js b/src/router/index_Common.js index ca11e1bd6..5e11e1e92 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -960,29 +960,32 @@ export const asyncRouter = [ ] } ] - }, - { - path: '/design/student', - redirect: '/design/student/home', - component: Layout, - meta: { - i18n: 'router.studentManage', - roles: [admin, lessonCreater] - }, - hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('gzb') && !window.document.location.pathname.includes('gzb') : !window.document.location.pathname.includes('gzb'), - children: [ - { - path: 'home', - component: StudentManage, - meta: { - i18n: 'router.studentManage', - icon: 'design', - hidden: true - } - } - ] } ]; +export const projectRoute = { + designgzb: [ + { + path: '/design/student', + redirect: '/design/student/home', + component: Layout, + meta: { + i18n: 'router.studentManage', + roles: [admin, lessonCreater] + }, + children: [ + { + path: 'home', + component: StudentManage, + meta: { + i18n: 'router.studentManage', + icon: 'design', + hidden: true + } + } + ] + } + ] +}; export const JSXT = [ { path: '/jsxt', diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 03bbc159e..e42333265 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,4 +1,4 @@ -import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform, JSXT } from '@/router/index_APP_TARGET'; +import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform, JSXT, projectRoute } from '@/router/index_APP_TARGET'; import { PermissionType } from '@/utils/PermissionType'; import { UrlConfig } from '@/scripts/ConstDic'; import { getSessionStorage } from '@/utils/auth'; @@ -104,8 +104,13 @@ const permission = { if (roles.indexOf(superAdmin) >= 0 && roles.indexOf(admin) < 0) { roles.push(admin); } - const routeArr = [...asyncRouter, ...JSXT]; - + const proRoute = projectRoute[getSessionStorage('project')]; + let routeArr = []; + if (proRoute && proRoute.constructor === Array) { + routeArr = [...asyncRouter, ...JSXT, ...proRoute]; + } else { + routeArr = [...asyncRouter, ...JSXT]; + } const accessedRouters = filterAsyncRouter(routeArr, roles); accessedRouters.forEach(route => { if (route.children && route.children.length == 0) { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 8df5a551d..4ff00eac2 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - BASE_API = 'http://192.168.3.82:9000'; // 杜康 + // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张S赛 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/newMap/mapsystemNew/plugin/setFault.vue b/src/views/newMap/mapsystemNew/plugin/setFault.vue index 20c3688ba..a26fa68f1 100644 --- a/src/views/newMap/mapsystemNew/plugin/setFault.vue +++ b/src/views/newMap/mapsystemNew/plugin/setFault.vue @@ -5,19 +5,25 @@ 故障类型: - - - - - - - - + + + + + + + + + + + + + + @@ -46,9 +52,14 @@ export default { switchName: '', activeShow: false, deviceName: '', - faultType: '', faultList: [], - className: '' + className: '', + form: { faultType: ''}, + rules: { + faultType: [ + { required: true, message: '请选择故障类型', trigger: 'change'} + ] + } }; }, computed: { @@ -123,12 +134,16 @@ export default { doClose() { this.loading = false; this.dialogShow = false; + this.form.faultType = ''; + this.$refs.form.resetFields(); this.$store.dispatch('training/emitTipFresh'); }, commit() { - if (this.faultType) { - this.sendCommand(); - } + this.$refs.form.validate((valid) => { + if (valid) { + this.sendCommand(); + } + }); }, sendCommand() { // 发送指令 this.loading = true; @@ -137,7 +152,7 @@ export default { operation: this.operation, cmdType: this.cmdType, param: { - faultType: this.faultType + faultType: this.form.faultType } }; this.$store.dispatch('training/nextNew', setp).then(({ valid }) => { From 09b3b684cfe995c82111964f0650f90624a2074d Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 19 May 2020 09:03:38 +0800 Subject: [PATCH 16/40] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/zh/router.js | 3 +- src/router/index_Common.js | 32 +++++++++++++--- src/scripts/ProjectConfig.js | 2 +- src/store/modules/permission.js | 5 ++- src/utils/baseUrl.js | 4 +- .../{ => jsxt}/competition/demonList.vue | 0 src/views/{ => jsxt}/competition/index.vue | 0 src/views/jsxt/home/index.vue | 37 +++++++++++++++++++ src/views/{ => jsxt}/refereeList/index.vue | 0 src/views/login/index.vue | 6 ++- 10 files changed, 77 insertions(+), 12 deletions(-) rename src/views/{ => jsxt}/competition/demonList.vue (100%) rename src/views/{ => jsxt}/competition/index.vue (100%) create mode 100644 src/views/jsxt/home/index.vue rename src/views/{ => jsxt}/refereeList/index.vue (100%) diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index 70aaa568f..ffc9c7d0d 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -78,5 +78,6 @@ export default { iscsSystem: 'Iscs系统', studentManage: '学生管理', competitionManage: '竞赛管理', - refereeJManage: '仿真管理' + refereeJManage: '仿真管理', + homeJsxt: '首页' }; diff --git a/src/router/index_Common.js b/src/router/index_Common.js index ca11e1bd6..aa97d49be 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -121,8 +121,9 @@ const DeviceManage = () => import('@/views/system/deviceManage/index'); const MapSort = () => import('@/views/publish/publishMap/mapSort'); const StudentManage = () => import('@/views/studentManage'); -const CompetitionManage = () => import('@/views/competition/index'); -const RefereeList = () => import('@/views/refereeList/index'); +const CompetitionManage = () => import('@/views/jsxt/competition/index'); +const RefereeList = () => import('@/views/jsxt/refereeList/index'); +const homeJsxt = () => import('@/views/jsxt/home/index'); import { loginInfo, GenerateRouteProjectList } from '@/scripts/ProjectConfig'; import { getSessionStorage } from '@/utils/auth'; @@ -159,6 +160,7 @@ export const userSimulation = '013'; // 仿真系统 export const userScreen = '014'; // 大屏系统 export const userPlan = '015'; // 计划系统 export const userTrainingPlatform = '016'; // 实训平台 +export const refereePlatform = '017'; // const isDev = process.env.NODE_ENV === 'development'; /** @@ -991,7 +993,6 @@ export const JSXT = [ i18n: 'router.competitionManage', roles: [user, userTrainingPlatform, referee] }, - pathStr: 'jsxt', hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('jsxt') && !window.document.location.pathname.includes('jsxt') : !window.document.location.pathname.includes('jsxt'), children: [ { @@ -1009,10 +1010,29 @@ export const JSXT = [ path: '/refereeJsxt', component: Layout, meta: { - i18n: 'router.refereeJManage', - roles: [referee, userTrainingPlatform] + i18n: 'router.homeJsxt', + roles: [user, referee, refereePlatform] + }, + hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), + children: [ + { + path: 'preview', + component: homeJsxt, + meta: { + i18n: 'router.homeJsxt', + icon: 'design', + hidden: true + } + } + ] + }, + { + path: '/referee', + component: Layout, + meta: { + i18n: 'router.refereeJManage', + roles: [referee, refereePlatform] }, - pathStr: 'refereeJsxt', hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), children: [ { diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index ad9ecf7cf..c39a169a0 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -142,7 +142,7 @@ export const PermissionParam = { // 路径权限处理所需参数配置(跳 refereeJsxt: { whitePage: '/refereeJsxt/login', reg: /^\/refereeJsxt/, - clientId: null + clientId: LoginParams.Design.clientId } }; export const ProjectList = [ diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 03bbc159e..6dff59748 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,4 +1,4 @@ -import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform, JSXT } from '@/router/index_APP_TARGET'; +import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform, JSXT, refereePlatform } from '@/router/index_APP_TARGET'; import { PermissionType } from '@/utils/PermissionType'; import { UrlConfig } from '@/scripts/ConstDic'; import { getSessionStorage } from '@/utils/auth'; @@ -31,6 +31,9 @@ function hasPermission(roles, route, parentsRoles) { if (getSessionStorage('project').startsWith('design')) { const result = roles.filter(role => route.meta.roles.indexOf(role) >= 0) || []; return result.length && route.meta.roles.indexOf(userTrainingPlatform) < 0; + } else if (getSessionStorage('project').startsWith('refereeJsxt')) { + const result = roles.filter(role => route.meta.roles.indexOf(role) >= 0) || []; + return result.length && route.meta.roles.indexOf(refereePlatform) >= 0; } else { roles = roles.filter(function (role) { return route.meta.roles.indexOf(role) >= 0; diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 8df5a551d..4ff00eac2 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,11 +2,11 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 - BASE_API = 'http://192.168.3.82:9000'; // 杜康 + // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.41:9000'; // 张S赛 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 diff --git a/src/views/competition/demonList.vue b/src/views/jsxt/competition/demonList.vue similarity index 100% rename from src/views/competition/demonList.vue rename to src/views/jsxt/competition/demonList.vue diff --git a/src/views/competition/index.vue b/src/views/jsxt/competition/index.vue similarity index 100% rename from src/views/competition/index.vue rename to src/views/jsxt/competition/index.vue diff --git a/src/views/jsxt/home/index.vue b/src/views/jsxt/home/index.vue new file mode 100644 index 000000000..60e021e47 --- /dev/null +++ b/src/views/jsxt/home/index.vue @@ -0,0 +1,37 @@ + + + + diff --git a/src/views/refereeList/index.vue b/src/views/jsxt/refereeList/index.vue similarity index 100% rename from src/views/refereeList/index.vue rename to src/views/jsxt/refereeList/index.vue diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 712f9ac10..218aaef1b 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -218,7 +218,11 @@ export default { } else if (this.project.startsWith('jsxt')) { this.path = '/jsxt/home'; } else if (this.project.startsWith('refereeJsxt')) { - this.path = '/refereeJsxt/home'; + this.cookiesName = 'UserDesignName'; + this.cookiesToken = 'UserDesignToken'; + this.modelType = 'design'; + this.loginClient = 'Design'; + this.path = '/refereeJsxt/preview'; } const nowLang = LangStorage.getLang('zh'); From 46092a9b8e94d2eadc26565a01829c85cfa32c2b Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 19 May 2020 09:09:38 +0800 Subject: [PATCH 17/40] =?UTF-8?q?=E8=A5=BF=E5=AE=89=E4=B8=89=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/theme/xian_01/menus/menuStation.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/jmapNew/theme/xian_01/menus/menuStation.vue b/src/jmapNew/theme/xian_01/menus/menuStation.vue index ca9705442..c00fab189 100644 --- a/src/jmapNew/theme/xian_01/menus/menuStation.vue +++ b/src/jmapNew/theme/xian_01/menus/menuStation.vue @@ -81,6 +81,16 @@ export default { cmdType: CMD.Station.active } // { + // label: '所有进路交人工控', + // handler: this.humanControlALL, + // cmdType: '' + // }, + // { + // label: '所有进路交ATS自动控', + // handler: this.atsAutoControlALL, + // cmdType: '' + // } + // { // label: '执行关键操作测试', // handler: this.execKeyOperationTest, // cmdType: CMD.Station.active, From 08991c8694b079e80fbbe3736f4e9cdb061a3fc4 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 19 May 2020 09:45:15 +0800 Subject: [PATCH 18/40] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Switch/index.js | 4 +- src/views/newMap/displayNew/designIndex.vue | 37 +++++++++++++++++++ src/views/newMap/displayNew/index.vue | 12 ++++-- src/views/newMap/displayNew/menuDemon.vue | 15 ++++---- src/views/newMap/displayNew/menuSchema.vue | 16 ++++++-- .../scriptManage/display/tipScriptRecord.vue | 11 +++++- .../scriptManage/scriptRecord/addAction.vue | 26 ++++++------- 7 files changed, 92 insertions(+), 29 deletions(-) diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 0b9312fcf..475e9f476 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -161,8 +161,8 @@ export default class Switch extends Group { z: this.z + 6, _subType: 'enabled', // 标识 style: { - x: arrowTextX, - y: arrowTextY + 10, + x: nameTextX, + y: nameTextY + directy * 20, fontSize: 12, text: 'E', textAlign: 'center', diff --git a/src/views/newMap/displayNew/designIndex.vue b/src/views/newMap/displayNew/designIndex.vue index 8ffb148e0..2af6e52c5 100644 --- a/src/views/newMap/displayNew/designIndex.vue +++ b/src/views/newMap/displayNew/designIndex.vue @@ -24,8 +24,12 @@ :offset="offset" :offset-bottom="offsetBottom" :group="group" + :show-station="showStation" + :station-list="stationList" + :show-select-station="showSelectStation" @switchMode="switchMode" @selectQuest="selectQuest" + @switchStationMode="switchStationMode" /> @@ -104,6 +108,9 @@ export default { simulationShow: false, drivingShow: false, questId: 0, // 加载任务的Id + showStation: '', + stationList: [], + showSelectStation: false, // 是否展示现地选择设备集中站select group: '', prdTypeMap: { '01': '01', // 现地 => 现地 @@ -162,6 +169,12 @@ export default { '$store.state.map.mapViewLoadedCount': function (val) { this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP.style.cursor = ''; + this.switchStationMode(this.showStation); + }, + '$store.state.training.centerStationCode': function(code) { + if (code) { + this.showStation = code; + } }, // '$store.state.training.prdType': function(val) { // debugger; @@ -172,6 +185,10 @@ export default { '$store.state.app.windowSizeCount': function() { this.setWindowSize(); }, + '$store.state.map.map': function (val) { + this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01'; + this.showSelectStation && this.setStationList(val); + }, $route() { this.$nextTick(() => { this.initLoadData(); @@ -436,6 +453,26 @@ export default { this.$store.dispatch('config/resize', { width, height }); this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode }); }); + }, + switchStationMode(val) { + if (val == null && this.stationList.length > 0) { + this.showStation = this.stationList[0].value; + } else { + this.showStation = val; + } + this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation); + this.$store.dispatch('map/setShowCentralizedStationNum'); + }, + setStationList(val) { + this.stationList = []; + (val.stationList || []).forEach(item => { + if (item.centralized) { + this.stationList.push({value: item.code, name: item.name}); + } + }); + if (this.stationList.length) { + this.showStation = this.stationList[0].value; + } } } }; diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index fcda0d5c2..4c7c007f6 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -627,9 +627,15 @@ export default { } }, switchStationMode(val) { - this.showStation = val; - this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation); - this.$store.dispatch('map/setShowCentralizedStationNum'); + if (this.stationList.length > 0) { + if (val == null) { + this.showStation = this.stationList[0].value; + } else { + this.showStation = val; + } + this.$store.dispatch('map/setShowCentralizedStationCode', this.showStation); + this.$store.dispatch('map/setShowCentralizedStationNum'); + } }, setStationList(val) { this.stationList = []; diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 5ecee252f..b8f3287e9 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -329,11 +329,12 @@ export default { font-size: 18px !important; color: #fff; } - - .display-draft { - position: absolute; - float: right; - right: 20px; - bottom: 15px; - } + + diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index a9b08129e..d858431b0 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -1,10 +1,10 @@ diff --git a/src/views/jsxt/competition/theory/quiz/index.vue b/src/views/jsxt/competition/theory/quiz/index.vue new file mode 100644 index 000000000..7caffcf5b --- /dev/null +++ b/src/views/jsxt/competition/theory/quiz/index.vue @@ -0,0 +1,243 @@ + + + + diff --git a/src/views/jsxt/competition/theory/quiz/question.vue b/src/views/jsxt/competition/theory/quiz/question.vue new file mode 100644 index 000000000..8871b1b61 --- /dev/null +++ b/src/views/jsxt/competition/theory/quiz/question.vue @@ -0,0 +1,91 @@ + + + + From 4b683de30fe6fef1a286534893c5182a50b2428d Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 19 May 2020 13:15:36 +0800 Subject: [PATCH 25/40] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=80=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/jsxt/competition/examDetail.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/jsxt/competition/examDetail.vue b/src/views/jsxt/competition/examDetail.vue index f40be4152..1fad7d7f3 100644 --- a/src/views/jsxt/competition/examDetail.vue +++ b/src/views/jsxt/competition/examDetail.vue @@ -192,7 +192,11 @@ export default { } }, async exmaStart() { - this.disabled = true; + if (this.$route.query.type == 'theory') { + this.$router.push(`/jsxt/theory/detail/${this.$route.query.mapId}`); + } else { + this.disabled = true; + } }, back() { this.$router.go(-1); From cc3f117a8fd8eb93f3ca212322764aec2ff5f61a Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 19 May 2020 13:41:48 +0800 Subject: [PATCH 26/40] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E4=B8=80=E7=BB=BC?= =?UTF-8?q?=E5=90=88=E6=BC=94=E7=BB=83=E7=8E=B0=E5=9C=B0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/jointTrainingNew/index.vue | 20 +++++++++++++++---- .../newMap/jointTrainingNew/menuSchema.vue | 4 +++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index 9f4c980ff..d8e45b8f1 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -50,6 +50,7 @@ import { EventBus } from '@/scripts/event-bus'; import ibpData from '@/ibp/constant/ibpData'; import { timeFormat } from '@/utils/date'; import { Message } from 'element-ui'; +import Vue from 'vue'; export default { name: 'JointTrainingDraft', @@ -126,17 +127,17 @@ export default { this.setPosition(); if (val === '01' && this.$route.query.lineCode === '06') { this.showSelectStation = true; - this.mapViewLoadedOver && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation); + this.mapViewLoadedOver && this.setShowStation(this.showStation); } else if (val === '02' && this.$route.query.lineCode === '06') { this.showSelectStation = false; - this.mapViewLoadedOver && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(''); + this.mapViewLoadedOver && this.setShowStation(''); } }, '$store.state.map.mapViewLoadedCount': function (val) { this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP.style.cursor = ''; this.mapViewLoadedOver = true; - this.showSelectStation && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation); + this.showSelectStation && this.setShowStation(this.showStation); }, '$store.state.socket.permissionOver': function () { this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), { @@ -436,7 +437,18 @@ export default { }, switchStationMode(val) { this.showStation = val; - this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation); + this.setShowStation(this.showStation); + }, + setShowStation(val) { + const nameList = Object.keys(this.$store.state.map.map); + let list = []; + nameList.forEach(item => { + if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) { + list = [...list, ...this.$store.state.map.map[item]]; + } + }); + Vue.prototype.$jlmap.updateShowStation(list, val); + Vue.prototype.$jlmap.setCenter(val); }, setStationList(val) { this.stationList = []; diff --git a/src/views/newMap/jointTrainingNew/menuSchema.vue b/src/views/newMap/jointTrainingNew/menuSchema.vue index eecb13afc..692dc1cb8 100644 --- a/src/views/newMap/jointTrainingNew/menuSchema.vue +++ b/src/views/newMap/jointTrainingNew/menuSchema.vue @@ -10,7 +10,7 @@ > - + @@ -91,6 +91,7 @@ export default { viewDisabled: true, realData: {}, series: [], + chiShowStation: '', kmRangeCoordMap: {}, runPlanData: {}, swch: '02', @@ -156,6 +157,7 @@ export default { }); }, switchMode(swch) { + this.chiShowStation = this.showStation; this.$store.dispatch('training/setPrdType', swch); }, initPlannedDriving(isDisable) { From 736c81a61da854b83d4a5fa33cca0ab9885d5da9 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 19 May 2020 14:01:23 +0800 Subject: [PATCH 27/40] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=BC=94=E7=BB=83=20?= =?UTF-8?q?=20=E5=89=A7=E6=9C=AC=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 --- .../newMap/displayNew/chatView/chatBox.vue | 1 + .../displayNew/chatView/chatContent.vue | 36 +++++++++----- .../chatView/chatCoversitionList.vue | 5 +- src/views/newMap/jointTrainingNew/chatBox.vue | 12 ++++- .../newMap/jointTrainingNew/chatContent.vue | 48 +++++++++++++------ .../jointTrainingNew/chatCoversitionList.vue | 26 ++++++++++ src/views/newMap/jointTrainingNew/index.vue | 8 ++-- .../scriptManage/display/tipScriptRecord.vue | 1 + src/views/trainRoom/e-roles.vue | 4 +- 9 files changed, 106 insertions(+), 35 deletions(-) diff --git a/src/views/newMap/displayNew/chatView/chatBox.vue b/src/views/newMap/displayNew/chatView/chatBox.vue index a9b079620..6ea2f84da 100644 --- a/src/views/newMap/displayNew/chatView/chatBox.vue +++ b/src/views/newMap/displayNew/chatView/chatBox.vue @@ -140,6 +140,7 @@ export default { if (this.recordSending) { this.cancleRecording(); } + this.$refs.chatContent.scrollTop(); }, setHeadTitle(headerTitle) { this.headerTitle = headerTitle; diff --git a/src/views/newMap/displayNew/chatView/chatContent.vue b/src/views/newMap/displayNew/chatView/chatContent.vue index fc55c986d..3a94a2e08 100644 --- a/src/views/newMap/displayNew/chatView/chatContent.vue +++ b/src/views/newMap/displayNew/chatView/chatContent.vue @@ -1,18 +1,20 @@