From d47a986fcc60b2c8000431faa460a52e7d80e817 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 15 May 2020 18:48:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=85=E9=9A=9C=E6=93=8D=E4=BD=9C&=E8=B4=B5?= =?UTF-8?q?=E5=B7=9E=E7=8A=B6=E6=80=81=E7=8F=AD=E7=BA=A7=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/jmap/lesson.js | 7 + .../theme/ningbo_01/menus/dialog/setFault.vue | 129 +++++++++++++++++ .../theme/ningbo_01/menus/menuSection.vue | 45 ++++-- .../ningbo_01/menus/utils/menuOperate.js | 4 + .../theme/xian_01/menus/dialog/setFault.vue | 131 ++++++++++++++++++ .../theme/xian_01/menus/menuSection.vue | 23 +-- .../theme/xian_01/menus/utils/menuOperate.js | 13 +- src/scripts/cmdPlugin/Command.js | 2 +- src/scripts/cmdPlugin/CommandEnum.js | 4 +- src/scripts/cmdPlugin/CommandHandler.js | 8 +- src/scripts/cmdPlugin/Config.js | 23 ++- src/scripts/cmdPlugin/Handler.js | 1 - src/utils/baseUrl.js | 6 +- src/views/exam/index.vue | 18 ++- .../iscs/iscsSystem/config/pis/lcdControl.vue | 5 +- src/views/lesson/home.vue | 4 - src/views/teach/index.vue | 17 ++- 17 files changed, 385 insertions(+), 55 deletions(-) create mode 100644 src/jmapNew/theme/ningbo_01/menus/dialog/setFault.vue create mode 100644 src/jmapNew/theme/xian_01/menus/dialog/setFault.vue diff --git a/src/api/jmap/lesson.js b/src/api/jmap/lesson.js index 91ce5d9ea..a168e0d58 100644 --- a/src/api/jmap/lesson.js +++ b/src/api/jmap/lesson.js @@ -80,3 +80,10 @@ export function getLessonByClassId(classId) { method: 'get' }); } +/** 强制删除课程(即删除课程和课程关联的试卷) */ +export function forceDeleteLesson(lessonId) { + return request({ + url: `/api/lesson/usedLesson/${lessonId}` + }); +} + diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/setFault.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/setFault.vue new file mode 100644 index 000000000..0eceaa689 --- /dev/null +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/setFault.vue @@ -0,0 +1,129 @@ + + + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index b75931c98..c35831e1c 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -6,6 +6,7 @@ + @@ -21,6 +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'; export default { name: 'SectionMenu', @@ -30,7 +32,8 @@ export default { SectionUnLock, SpeedLimitControl, AlxeEffective, - NoticeInfo + NoticeInfo, + SetFault }, props: { selected: { @@ -95,10 +98,20 @@ export default { ] }, menuForce: [ + // { + // label: '设置计轴失效', // 设置区段故障 + // handler: this.alxeFailure, + // cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + // }, { - label: '设置计轴失效', // 设置区段故障 - handler: this.alxeFailure, + label: this.$t('menu.menuSection.setFault'), + handler: this.setStoppage, cmdType: CMD.Section.CMD_SECTION_ADD_FAULT + }, + { + label: this.$t('menu.menuSection.cancelFault'), + handler: this.cancelStoppage, + cmdType: CMD.Section.CMD_SECTION_REMOVE_FAULT } ] }; @@ -148,14 +161,14 @@ export default { this.$refs.popMenu.close(); } }, - // 设置计轴失效 - alxeFailure() { - this.mouseCancelState(this.selected); - commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then(({valid, operate})=>{ - }).catch(()=>{ - this.$refs.noticeInfo.doShow(); - }); - }, + // // 设置计轴失效 + // alxeFailure() { + // this.mouseCancelState(this.selected); + // commitOperate(menuOperate.Section.alxeFailure, {sectionCode:this.selected.code}, 3).then(({valid, operate})=>{ + // }).catch(()=>{ + // this.$refs.noticeInfo.doShow(); + // }); + // }, // 故障解锁 fault() { commitOperate(menuOperate.Section.fault, {sectionCode:this.selected.code}, 0).then(({valid, operate})=>{ @@ -214,7 +227,15 @@ export default { this.$refs.speedLimitControl.doShow(operate, this.selected); } }); - } + }, + setStoppage() { + commitOperate(menuOperate.Section.setFault, { sectionCode: this.selected.code }, 0).then(({valid, operate})=>{ + if (valid) { + this.$refs.setFault.doShow(operate, this.selected); + } + }); + }, + cancelStoppage() {} } }; diff --git a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js index cac3beffe..34383dd3c 100644 --- a/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/ningbo_01/menus/utils/menuOperate.js @@ -45,6 +45,10 @@ export const menuOperate = { // 区段故障解锁 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:{ diff --git a/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue b/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue new file mode 100644 index 000000000..9cd0d0845 --- /dev/null +++ b/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue @@ -0,0 +1,131 @@ + + + diff --git a/src/jmapNew/theme/xian_01/menus/menuSection.vue b/src/jmapNew/theme/xian_01/menus/menuSection.vue index 55131084b..95289fcc0 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSection.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSection.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: '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 @@