From ae5916b90aed7b79a217f2b5416fac8f0c6362e4 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 15 May 2020 14:50:05 +0800 Subject: [PATCH 01/13] =?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=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/zh/router.js | 4 +- src/router/index_Common.js | 54 +++++- src/scripts/ProjectConfig.js | 16 +- src/views/competition/index.vue | 20 +++ src/views/login/index.vue | 5 + src/views/newMap/jlmapNew/screen.vue | 161 ------------------ .../newMapdraft/mapoperate/ImageControl.vue | 4 +- .../newMap/newMapdraft/mapoperate/index.vue | 2 - vue.config.js | 3 +- 9 files changed, 96 insertions(+), 173 deletions(-) create mode 100644 src/views/competition/index.vue delete mode 100644 src/views/newMap/jlmapNew/screen.vue diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index a3f94eb3b..21292436d 100644 --- a/src/i18n/langs/zh/router.js +++ b/src/i18n/langs/zh/router.js @@ -76,5 +76,7 @@ export default { deviceManage: '设备管理', iscsDraw: 'Iscs绘制', iscsSystem: 'Iscs系统', - studentManage: '学生管理' + studentManage: '学生管理', + competitionManage: '竞赛管理', + refereeJManage: '裁判管理' }; diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 98615ae25..6f9751af3 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -40,7 +40,7 @@ const News = () => import('@/views/system/news/index'); const CommandDictionary = () => import('@/views/system/commandDictionary/index'); const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit'); const configLine = () => import('@/views/system/configLine/index'); -const Mapedit = () => import('@/views/mapdraft/index'); +// const Mapedit = () => import('@/views/mapdraft/index'); const IscsSystem = () => import('@/views/iscs/iscsSystem/index'); const IscsDraw = () => import('@/views/iscs/iscsDraw/index'); @@ -87,7 +87,7 @@ const MapPreview = () => import('@/views/designPlatform/mapPreview'); const MapPreviewNew = () => import('@/views/designPlatform/mapPreviewNew'); const BigScreen = () => import('@/views/designPlatform/bigScreen'); -const DesignPlatformUser = () => import('@/views/designUser/index'); +// const DesignPlatformUser = () => import('@/views/designUser/index'); const Package = () => import('@/views/package/index'); @@ -121,6 +121,8 @@ 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'); + import { loginInfo, GenerateRouteProjectList } from '@/scripts/ProjectConfig'; import { getSessionStorage } from '@/utils/auth'; @@ -848,7 +850,6 @@ export const asyncRouter = [ }, { // 新个人地图 path: '/design', - // redirect: '/design/usermap/home', component: Layout, meta: { i18n: 'router.newDesignUserPage', @@ -980,6 +981,48 @@ export const asyncRouter = [ ] } ]; +const JSXT = [ + { + path: '/jsxt', + component: Layout, + meta: { + i18n: 'router.competitionManage', + roles: [user, userTrainingPlatform] + }, + hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('jsxt') && !window.document.location.pathname.includes('jsxt') : !window.document.location.pathname.includes('jsxt'), + children: [ + { + path: 'home', + component: CompetitionManage, + meta: { + i18n: 'router.competitionManage', + icon: 'design', + hidden: true + } + } + ] + }, + { + path: '/refereeJsxt', + component: Layout, + meta: { + i18n: 'router.refereeJManage', + roles: [admin, userTrainingPlatform] + }, + hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), + children: [ + { + path: 'home', + component: CompetitionManage, + meta: { + i18n: 'router.refereeJManage', + icon: 'design', + hidden: true + } + } + ] + } +]; const createRouter = () => new Router({ mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), @@ -990,6 +1033,11 @@ const router = createRouter(); router.beforeEach((to, from, next) => { const project = getSessionStorage('project'); + JSXT.forEach(route => { + if (from.path.includes(route.path)) { + asyncRouter.push(route); + } + }); document.title = loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title; next(); }); diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index 85b6f3267..ad9ecf7cf 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -55,7 +55,11 @@ export const loginInfo = { // 页面title & 退出登录跳转路径 }, jsxt:{ title: '城市轨道交通竞赛平台', - loginPath: '/js/login' + loginPath: '/jsxt/login' + }, + refereeJsxt:{ + title: '城市轨道交通裁判平台', + loginPath: '/refereeJsxt/login' } }; @@ -70,7 +74,8 @@ export const ProjectIcon = { designhyd: FaviconHyd, xadt: FaviconXadt, designxadt: FaviconXadt, - jsxt: Favicon + jsxt: Favicon, + refereeJsxt: Favicon }; export const ProjectCode = { @@ -85,7 +90,7 @@ export const ProjectCode = { }; export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt']; // 实训设计平台通过项目code获取地图列表的项目 export const CaseHideProjectList = ['hyd', 'designhyd']; // 案例展示隐藏的项目 -export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'jsxt'];// 需要在公共路由中生成登录页面的项目&登录页样式 +export const GenerateRouteProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目&登录页样式 export const goOtherPlatformMenu = { // 导航栏快速切换平台 login: '/design/login', design: '/login', @@ -133,6 +138,11 @@ export const PermissionParam = { // 路径权限处理所需参数配置(跳 whitePage: '/jsxt/login', reg: /^\/jsxt/, clientId: null + }, + refereeJsxt: { + whitePage: '/refereeJsxt/login', + reg: /^\/refereeJsxt/, + clientId: null } }; export const ProjectList = [ diff --git a/src/views/competition/index.vue b/src/views/competition/index.vue new file mode 100644 index 000000000..493f1ba8c --- /dev/null +++ b/src/views/competition/index.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 761fde036..a6f04c819 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -215,6 +215,10 @@ export default { this.modelType = 'design'; this.loginClient = 'Design'; this.path = UrlConfig.design.prefix; + } else if (this.project.startsWith('jsxt')) { + this.path = '/jsxt/home'; + } else if (this.project.startsWith('refereeJsxt')) { + this.path = '/refereeJsxt/home'; } const nowLang = LangStorage.getLang('zh'); @@ -326,6 +330,7 @@ export default { this.loading = false; this.tipsMsg = ''; removeSessionStorage('againEnter'); + console.log(this.path, '====='); this.$router.push({ path: this.path }); }, handleLanguage() { diff --git a/src/views/newMap/jlmapNew/screen.vue b/src/views/newMap/jlmapNew/screen.vue deleted file mode 100644 index 1632342b2..000000000 --- a/src/views/newMap/jlmapNew/screen.vue +++ /dev/null @@ -1,161 +0,0 @@ - - - - diff --git a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue index 6869fc7ef..5197fde13 100644 --- a/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue +++ b/src/views/newMap/newMapdraft/mapoperate/ImageControl.vue @@ -184,8 +184,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() === 'Resource'.toUpperCase()) { this.activeName = 'first'; this.editModel = deepAssign(this.editModel, selected); diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue index bbdc23fbf..feaeb244d 100644 --- a/src/views/newMap/newMapdraft/mapoperate/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/index.vue @@ -17,8 +17,6 @@ 生成联锁 - - {{ $t('map.advanced') }} 绘图显隐 diff --git a/vue.config.js b/vue.config.js index a77409465..21c947aba 100644 --- a/vue.config.js +++ b/vue.config.js @@ -30,10 +30,11 @@ module.exports = { assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录 lintOnSave: false, // filenameHashing: true, - productionSourceMap: false, + productionSourceMap: false, // 项目打包后是否压缩 devServer: { port: port, // open: true, + hotOnly: true, overlay: { warnings: false, errors: true From 399111c682bee04e26a27ab268fb4bb837ce2ba1 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Fri, 15 May 2020 14:59:53 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/lesson/home.vue | 4 ++-- src/views/planMonitor/detail.vue | 2 +- src/views/scriptManage/home.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/lesson/home.vue b/src/views/lesson/home.vue index b915b162d..552883e41 100644 --- a/src/views/lesson/home.vue +++ b/src/views/lesson/home.vue @@ -1,7 +1,7 @@ @@ -20,6 +21,7 @@ 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'; export default { name: 'SectionMenu', @@ -28,7 +30,8 @@ export default { SectionControl, SectionCmdControl, SpeedCmdControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -170,24 +173,10 @@ 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.Section.setFault, { sectionCode: 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(operate, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 取消故障 diff --git a/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js b/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js index baf16b23e..202ede60f 100644 --- a/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js @@ -263,7 +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.Section.CMD_SECTION_ADD_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.stoppage.menu.operation, + cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + } } }; @@ -290,7 +299,9 @@ export function commitOperate(operate, paramList, over, val) { step.cmdType = operate.cmdType; } return new Promise(function(resolve, reject) { + console.log(step, '8888888888888'); store.dispatch('training/nextNew', step).then(({ valid }) => { + console.log(valid, '3333333333333'); if (valid) { store.dispatch('menuOperation/handleBreakFlag', { break: true }); } diff --git a/src/scripts/cmdPlugin/Command.js b/src/scripts/cmdPlugin/Command.js index c8286e5fe..d63721116 100644 --- a/src/scripts/cmdPlugin/Command.js +++ b/src/scripts/cmdPlugin/Command.js @@ -8,7 +8,7 @@ export default class Command { } toFound(definition, wholeParam) { - this.id = definition.id; + this.id = definition.operate; (definition.paramList || []).forEach(param => { if (wholeParam.hasOwnProperty(param.name)) { this.command[param.name] = wholeParam[param.name]; diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 13bde0d94..25ce2d926 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -218,7 +218,9 @@ export default { /** 新建计划列车 */ CMD_Train_Init_Plan: {value: 'Train_Init_Plan', label: '新建计划列车'} }, - + Fault: { + CMD_Set_Fault: {} + }, LimitControl: { } diff --git a/src/scripts/cmdPlugin/CommandHandler.js b/src/scripts/cmdPlugin/CommandHandler.js index b709e2b03..e29e4a928 100644 --- a/src/scripts/cmdPlugin/CommandHandler.js +++ b/src/scripts/cmdPlugin/CommandHandler.js @@ -14,7 +14,11 @@ class CommandHandle { load(list) { this.definitionMap = { Center: {}, - Local: {} + Local: {}, + Common: { + Set_Fault:{operate: 'Set_Fault'}, + Cancel_Fault: {operate:'Cancel_Fault'} + } }; (list || []).forEach(definition => { this.definitionMap[definition.simulationRole][definition.operate] = definition; @@ -25,7 +29,7 @@ class CommandHandle { getDefinition(cmdType) { if (cmdType) { const simulationRole = Handler.getSimulationRole(); - return this.definitionMap[simulationRole][cmdType.value] || null; + return this.definitionMap[simulationRole][cmdType.value] || this.definitionMap.Common[cmdType.value] || null; } else { return null; } diff --git a/src/scripts/cmdPlugin/Config.js b/src/scripts/cmdPlugin/Config.js index 2e3ebde3b..aebf868ae 100644 --- a/src/scripts/cmdPlugin/Config.js +++ b/src/scripts/cmdPlugin/Config.js @@ -26,4 +26,25 @@ export const MapDeviceType = { MixinCommand: { type: '11', label: '混合命令' } }; - +/** 设备故障类型 */ +export const deviceFaultType = { + Section: [ + {label: '计轴故障', value: 'FAULT'}, + {label: '计轴干扰', value: 'DISTURBANCE'} + ], + Signal: [ + {label: '主灯丝熔断故障', value: 'MAIN_FILAMENT_BROKEN'} + ], + Switch: [ + {label: '挤岔', value: 'SPLIT'} + ] +}; +/** 设备类型 */ +export const deviceType = { + Section: '区段', + Signal: '信号机', + Switch: '道岔', + Station: '车站', + StationStand: '站台', + Train: '列车' +}; diff --git a/src/scripts/cmdPlugin/Handler.js b/src/scripts/cmdPlugin/Handler.js index e8ef1565f..1fde94d33 100644 --- a/src/scripts/cmdPlugin/Handler.js +++ b/src/scripts/cmdPlugin/Handler.js @@ -57,7 +57,6 @@ class Handler { if (operation.cmdType) { const cmdType = operation.cmdType; const wholeParam = this.getWholeParam(); - command = CommandHandler.getCommand(cmdType, wholeParam); if (command && command.isError) { this.operations.pop(); diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index e9046878d..080406116 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,12 +2,12 @@ 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'; // 张赛 + // BASE_API = 'http://192.168.3.41:9000'; // 张S赛 // BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue index 4bd5cb929..5b164816f 100644 --- a/src/views/exam/index.vue +++ b/src/views/exam/index.vue @@ -8,13 +8,18 @@ + + + @@ -27,7 +32,7 @@ diff --git a/src/views/iscs/iscsSystem/config/pis/mainScreen.vue b/src/views/iscs/iscsSystem/config/pis/mainScreen.vue index de40a951f..cf3812fd1 100644 --- a/src/views/iscs/iscsSystem/config/pis/mainScreen.vue +++ b/src/views/iscs/iscsSystem/config/pis/mainScreen.vue @@ -6,7 +6,7 @@
特定区域
-
+ + {{ item.title }}
-
车站
-
站厅(LCD)
-
上行站台
-
下行站台
-
出站口
-
天桥1
-
天桥2
-
物业
-
LED
+
{{ item.name }}
@@ -93,6 +86,17 @@ export default { }, data() { return { + verticalHeader: [ + {name: '车站', title: '全线', key: 'station', type: 'header', active: false}, + {name: '站厅(LCD)', title: '全站厅(LCD)', key: 'stationHall', type: 'checkBox', active: false}, + {name: '上行站台', title: '全上行站台', key: 'uplinkStation', type: 'checkBox', active: false}, + {name: '下行站台', title: '全下行站台', key: 'downlinkStation', type: 'checkBox', active: false}, + {name: '出入口', title: '全出入口', key: 'passageway', type: 'checkBox', active: false}, + {name: '物业', title: '全物业', key: 'property', type: 'checkBox', active: false}, + {name: '天桥1', title: '天桥1', key: 'overbridge1', type: 'checkBox', active: false}, + {name: '天桥2', title: '天桥2', key: 'overbridge2', type: 'checkBox', active: false}, + {name: 'LED', title: '出入口(LED)', key: 'LED', type: 'checkBox', active: false} + ], stationList:[], selectedAreaList: [] }; @@ -122,31 +126,7 @@ export default { showInfoBrroadcast() { this.$refs.infoBroadcast.doShow(); }, - selectedAllLine() { - const flag = this.checkSelectedAllLine(); - this.selectedAreaList = []; - this.stationList.forEach(station => { - station.children.forEach((item, index) => { - if (item.status === 'default' && !flag) { - this.selectedAreaList.push(station.stationName + '-' + index); - } - }); - }); - }, - checkSelectedAllLine() { - let selectedAllLineFlag = true; - this.stationList.some(station => { - station.children.some((item, index) => { - if (item.status === 'default') { - const elem = station.stationName + '-' + index; - selectedAllLineFlag = this.selectedAreaList.includes(elem); - return !selectedAllLineFlag; - } - }); - return !selectedAllLineFlag; - }); - return selectedAllLineFlag; - }, + selectArea(stationName, index) { const elem = stationName + '-' + index; if (this.selectedAreaList.includes(elem)) { @@ -178,37 +158,61 @@ export default { }); return stationSelectedFlag; }, - selectedAreaBatch(areaIndex) { - const flag = this.checkAreaBatchSelected(areaIndex); + selectedBatch(data) { + data.active = !data.active; + if (data.key == 'station') { + this.selectedAllLine(data); + } else { + let areaIndex; + this.verticalHeader.map((item, index) => { + if (item.key === data.key) { + areaIndex = index; + } + }); + const flag = data.active; + // this.stationList.forEach(station => { + // station.children.forEach((item, index) => { + // const elem = station.stationName + '-' + index; + // if (item.status === 'default' && index === areaIndex && !flag) { + // const selectedAreaIndex = this.selectedAreaList.indexOf(elem); + // this.selectedAreaList.splice(selectedAreaIndex, 1); + // } else if (item.status === 'default' && index === areaIndex && !flag && !this.selectedAreaList.includes(elem)) { + // this.selectedAreaList.push(elem); + // } + // }); + // }); + for (let j = 0; j < this.stationList.length; j++) { + if (!this.selectedAreaList.includes(areaIndex + '-' + j) && flag) { + this.selectedAreaList.push(areaIndex + '-' + j); + } else if (!flag) { + const index = this.selectedAreaList.indexOf(areaIndex + '-' + j); + this.selectedAreaList.splice(index, 1); + } + } + } + }, + selectedAllLine(data) { + const flag = data.active; + this.selectedAreaList = []; this.stationList.forEach(station => { station.children.forEach((item, index) => { - const elem = station.stationName + '-' + index; - if (item.status === 'default' && index === areaIndex && flag) { - const selectedAreaIndex = this.selectedAreaList.indexOf(elem); - this.selectedAreaList.splice(selectedAreaIndex, 1); - } else if (item.status === 'default' && index === areaIndex && !flag && !this.selectedAreaList.includes(elem)) { - this.selectedAreaList.push(elem); + if (item.status === 'default' && flag) { + this.selectedAreaList.push(station.stationName + '-' + index); } }); }); - }, - checkAreaBatchSelected(areaIndex) { - let selectedAreaBatchFlag = true; - this.stationList.some(station => { - station.children.some((item, index) => { - if (item.status === 'default' && index === areaIndex) { - selectedAreaBatchFlag = this.selectedAreaList.includes(station.stationName + '-' + index); - return !selectedAreaBatchFlag; - } - }); - return !selectedAreaBatchFlag; - }); - return selectedAreaBatchFlag; } } }; From cc6227f6f4952f40d1b03434f733e2078bcfc87c Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 15 May 2020 19:24:58 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E6=95=85=E9=9A=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/xian_01/menus/dialog/setFault.vue | 23 ++++++++--- .../theme/xian_01/menus/menuSection.vue | 19 ++------- .../theme/xian_01/menus/menuSignal.vue | 39 ++++--------------- .../theme/xian_01/menus/menuSwitch.vue | 37 ++++-------------- .../theme/xian_01/menus/utils/menuOperate.js | 8 ++-- src/scripts/cmdPlugin/CommandEnum.js | 3 +- src/scripts/cmdPlugin/CommandHandler.js | 4 +- 7 files changed, 43 insertions(+), 90 deletions(-) diff --git a/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue b/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue index 9cd0d0845..54916da3c 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue @@ -9,7 +9,7 @@ - + { + commitOperate(operate, param, 2).then(({valid})=>{ this.loading = false; if (valid) { this.doClose(); diff --git a/src/jmapNew/theme/xian_01/menus/menuSection.vue b/src/jmapNew/theme/xian_01/menus/menuSection.vue index 95289fcc0..8c55dfa1a 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSection.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSection.vue @@ -173,7 +173,7 @@ 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); } @@ -181,23 +181,10 @@ export default { }, // 取消故障 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(operate, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 故障解锁 diff --git a/src/jmapNew/theme/xian_01/menus/menuSignal.vue b/src/jmapNew/theme/xian_01/menus/menuSignal.vue index b1512d549..d349989f0 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSignal.vue @@ -8,6 +8,7 @@ +
@@ -26,6 +27,7 @@ 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'; export default { name: 'SignalMenu', @@ -37,7 +39,8 @@ export default { RouteCmdControl, RouteHandControl, RouteDetail, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -227,44 +230,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(operate, 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(operate, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 获取进路列表 diff --git a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue index 9a4783d30..ead1453dc 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSwitch.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSwitch.vue @@ -5,6 +5,7 @@ +
@@ -20,6 +21,7 @@ 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'; export default { name: 'SwitchMenu', @@ -28,7 +30,8 @@ export default { SwitchControl, SwitchCmdControl, SpeedCmdControl, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -222,42 +225,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/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(operate, 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/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(operate, this.selected); } - }).catch(() => { - this.$refs.noticeInfo.doShow(step); }); }, // 道岔单锁 diff --git a/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js b/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js index 202ede60f..498d780ff 100644 --- a/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js @@ -267,11 +267,11 @@ export const menuOperate = { Common: { setFault: { operation: OperationEvent.Section.stoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + cmdType: CMD.Fault.CMD_SET_FAULT }, cancelFault: { - operation: OperationEvent.Section.stoppage.menu.operation, - cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT } } }; @@ -299,9 +299,7 @@ export function commitOperate(operate, paramList, over, val) { step.cmdType = operate.cmdType; } return new Promise(function(resolve, reject) { - console.log(step, '8888888888888'); store.dispatch('training/nextNew', step).then(({ valid }) => { - console.log(valid, '3333333333333'); if (valid) { store.dispatch('menuOperation/handleBreakFlag', { break: true }); } diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 25ce2d926..15d9abdbe 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -219,7 +219,8 @@ export default { CMD_Train_Init_Plan: {value: 'Train_Init_Plan', label: '新建计划列车'} }, Fault: { - CMD_Set_Fault: {} + CMD_SET_FAULT: {value: 'Set_Fault', label: '设置故障'}, + CMD_CANCEL_FAULT: {value: 'Cancel_Fault', label: '取消故障'} }, LimitControl: { diff --git a/src/scripts/cmdPlugin/CommandHandler.js b/src/scripts/cmdPlugin/CommandHandler.js index e29e4a928..d8b3c8590 100644 --- a/src/scripts/cmdPlugin/CommandHandler.js +++ b/src/scripts/cmdPlugin/CommandHandler.js @@ -16,8 +16,8 @@ class CommandHandle { Center: {}, Local: {}, Common: { - Set_Fault:{operate: 'Set_Fault'}, - Cancel_Fault: {operate:'Cancel_Fault'} + Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, + Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]} } }; (list || []).forEach(definition => {