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/api/script.js b/src/api/script.js index 19264af82..0d66e269c 100644 --- a/src/api/script.js +++ b/src/api/script.js @@ -13,7 +13,7 @@ export function getScriptPageListOnline(params) { /** 分页查找上线的剧本(新版)*/ export function getScriptPageListOnlineNew(params) { return request({ - url: `/api/scirpt/v1/paging/online`, + url: `/api/script/v1/paging/online`, method: 'get', params: params }); @@ -30,7 +30,7 @@ export function getScriptById(id) { /** 通过ID查询发布的剧本的详细信息(新版) */ export function getScriptByIdNew(id) { return request({ - url: `/api/scirpt/v1/${id}/detail`, + url: `/api/script/v1/${id}/detail`, method: 'get' }); } diff --git a/src/api/simulation.js b/src/api/simulation.js index 43bfb7ad1..29407127d 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -193,6 +193,14 @@ export function saveScriptScenesNew(group) { }); } +/** 剧本预览再次加载剧本*/ +export function scriptRePreview(group) { + return request({ + url: `/api/scriptSimulation/${group}/rePreview`, + method: 'put' + }); +} + /** 保存录制任务数据*/ export function saveScriptData(group) { return request({ diff --git a/src/i18n/langs/zh/router.js b/src/i18n/langs/zh/router.js index a3f94eb3b..70aaa568f 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/jmapNew/theme/beijing_01/menus/menuCancel.vue b/src/jmapNew/theme/beijing_01/menus/menuCancel.vue index 36896b645..4fd69e6a7 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuCancel.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuCancel.vue @@ -76,33 +76,6 @@ export default { }, initMenu() { this.menuNormal = []; - // this.stationList.forEach(station => { - // if (station.code === station.concentrateStationCode) { - // let node = { - // label: station.name, - // children: [] - // } - // - // this.stationList.forEach(elem => { - // if (elem.visible) { - // let next = elem; - // while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { - // next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); - // } - // - // if (station.code == next.code) { - // node.children.push({ - // code: elem.code, - // label: elem.name, - // handler: this.mapLocation, - // }); - // } - // } - // }) - // - // this.menuNormal.push(node); - // } - // }); if (this.isScreen) { this.menu = [...this.menuScreen]; } diff --git a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue index 779ec9e13..d61298593 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuSignal.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuSignal.vue @@ -371,7 +371,6 @@ export default { }, // 现地信号重开操作 reopenSignalByRoute(selectType) { - debugger; commitOperate(menuOperate.Signal.reopenSignal, {signalCode:selectType.code}, 3).then(({valid, operate})=>{ }).catch(error=>{ this.$refs.noticeInfo.doShow({}, error.message); diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuCancel.vue b/src/jmapNew/theme/fuzhou_01/menus/menuCancel.vue index c977cd799..6652b345f 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuCancel.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuCancel.vue @@ -63,29 +63,19 @@ export default { initMenu() { this.menuNormal = []; this.stationList.forEach(station => { - if (station.code === station.concentrateStationCode) { + if (station.chargeStationCodeList && station.chargeStationCodeList.length) { const node = { label: station.name, children: [] }; - - this.stationList.forEach(elem => { - if (elem.visible) { - let next = elem; - while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { - next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); - } - - if (station.code == next.code) { - node.children.push({ - code: elem.code, - label: elem.name, - handler: this.mapLocation - }); - } - } + station.chargeStationCodeList.forEach(item => { + const next = this.$store.getters['map/getDeviceByCode'](item); + node.children.push({ + code: next.code, + label: next.name, + handler: this.mapLocation + }); }); - this.menuNormal.push(node); } }); diff --git a/src/jmapNew/theme/haerbin_01/menus/menuCancel.vue b/src/jmapNew/theme/haerbin_01/menus/menuCancel.vue index c977cd799..4606ff2b7 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuCancel.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuCancel.vue @@ -63,33 +63,22 @@ export default { initMenu() { this.menuNormal = []; this.stationList.forEach(station => { - if (station.code === station.concentrateStationCode) { + if (station.chargeStationCodeList && station.chargeStationCodeList.length) { const node = { label: station.name, children: [] }; - - this.stationList.forEach(elem => { - if (elem.visible) { - let next = elem; - while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { - next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); - } - - if (station.code == next.code) { - node.children.push({ - code: elem.code, - label: elem.name, - handler: this.mapLocation - }); - } - } + station.chargeStationCodeList.forEach(item => { + const next = this.$store.getters['map/getDeviceByCode'](item); + node.children.push({ + code: next.code, + label: next.name, + handler: this.mapLocation + }); }); - this.menuNormal.push(node); } }); - this.menu = [...this.menuNormal]; }, doShow(point) { 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..54916da3c --- /dev/null +++ b/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue @@ -0,0 +1,142 @@ + + + diff --git a/src/jmapNew/theme/xian_01/menus/menuCancel.vue b/src/jmapNew/theme/xian_01/menus/menuCancel.vue index c977cd799..4606ff2b7 100644 --- a/src/jmapNew/theme/xian_01/menus/menuCancel.vue +++ b/src/jmapNew/theme/xian_01/menus/menuCancel.vue @@ -63,33 +63,22 @@ export default { initMenu() { this.menuNormal = []; this.stationList.forEach(station => { - if (station.code === station.concentrateStationCode) { + if (station.chargeStationCodeList && station.chargeStationCodeList.length) { const node = { label: station.name, children: [] }; - - this.stationList.forEach(elem => { - if (elem.visible) { - let next = elem; - while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { - next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); - } - - if (station.code == next.code) { - node.children.push({ - code: elem.code, - label: elem.name, - handler: this.mapLocation - }); - } - } + station.chargeStationCodeList.forEach(item => { + const next = this.$store.getters['map/getDeviceByCode'](item); + node.children.push({ + code: next.code, + label: next.name, + handler: this.mapLocation + }); }); - this.menuNormal.push(node); } }); - this.menu = [...this.menuNormal]; }, doShow(point) { diff --git a/src/jmapNew/theme/xian_01/menus/menuSection.vue b/src/jmapNew/theme/xian_01/menus/menuSection.vue index 55131084b..8c55dfa1a 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,45 +173,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(operate, 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(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 baf16b23e..498d780ff 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.Fault.CMD_SET_FAULT + }, + cancelFault: { + operation: OperationEvent.Section.cancelStoppage.menu.operation, + cmdType: CMD.Fault.CMD_CANCEL_FAULT + } } }; diff --git a/src/layout/components/Entry.vue b/src/layout/components/Entry.vue index fb457a4e2..bfdca93cf 100644 --- a/src/layout/components/Entry.vue +++ b/src/layout/components/Entry.vue @@ -47,41 +47,42 @@ export default { return { entryList: [ { - name: 'global.designPlatformEntrance', + name: 'global.designPlatformEntrance', // 设计平台入口 handle: this.goToDesign, hidden: getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')] }, { - name: 'global.trainingPlatformEntrance', + name: 'global.trainingPlatformEntrance', // 实训平台入口 handle: this.goToTraining, hidden: !getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')] }, { - name: 'global.caseShow', + name: 'global.caseShow', // 案例展示 handle: this.goEmpty, isHelp:true, style:'padding-right:0px;', - hidden:getSessionStorage('project').endsWith('hyd') + hidden:getSessionStorage('project').endsWith('hyd') || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') }, { - name: 'global.scan', + name: 'global.scan', // 扫码 handle: this.qcodeEntry, - hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') || process.env.VUE_APP_PRO === 'local' + hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') || process.env.VUE_APP_PRO === 'local' || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') }, { - name: 'global.quickEntry', + name: 'global.quickEntry', // 快速入口 handle: this.quickEntry, - hidden: getSessionStorage('project').startsWith('design') + hidden: getSessionStorage('project').startsWith('design') || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') }, { name: LangStorage.getLang('zh') === 'zh' ? 'English' : '中文', handle: this.switchLanguage, + hidden: getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt'), tip: true }, { name: 'global.help', handle: this.goToHelp, - hidden: getSessionStorage('project').endsWith('hyd') + hidden: getSessionStorage('project').endsWith('hyd') || getSessionStorage('project').startsWith('refereeJsxt') || getSessionStorage('project').startsWith('jsxt') } ], diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 98615ae25..87eabad31 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,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'); + import { loginInfo, GenerateRouteProjectList } from '@/scripts/ProjectConfig'; import { getSessionStorage } from '@/utils/auth'; @@ -848,7 +851,6 @@ export const asyncRouter = [ }, { // 新个人地图 path: '/design', - // redirect: '/design/usermap/home', component: Layout, meta: { i18n: 'router.newDesignUserPage', @@ -980,6 +982,50 @@ export const asyncRouter = [ ] } ]; +const JSXT = [ + { + path: '/jsxt', + component: Layout, + meta: { + i18n: 'router.competitionManage', + roles: [user, userTrainingPlatform] + }, + pathStr: 'jsxt', + 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] + }, + pathStr: 'refereeJsxt', + hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), + children: [ + { + path: 'home', + component: RefereeList, + meta: { + i18n: 'router.refereeJManage', + icon: 'design', + hidden: true + } + } + ] + } +]; const createRouter = () => new Router({ mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), @@ -990,6 +1036,11 @@ 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/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/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..15d9abdbe 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -218,7 +218,10 @@ export default { /** 新建计划列车 */ CMD_Train_Init_Plan: {value: 'Train_Init_Plan', label: '新建计划列车'} }, - + 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 b709e2b03..d8b3c8590 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', paramList:[{name: 'code'}, {name: 'faultType'}]}, + Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]} + } }; (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/store/modules/socket.js b/src/store/modules/socket.js index 061fd17fd..8c21a5287 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -26,6 +26,9 @@ function handle(state, data) { case 'Simulation_User': // 仿真-聊天界面用户进出仿真消息 handleSimulationUserinfo(state, msg); // 用户进出仿真消息 break; + case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息 + handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息 + break; case 'Simulation_RunFact': // 仿真-列车实际到发车站消息 // let runFactMsg = msg; // if (runFactMsg.constructor !== Array ) { @@ -136,7 +139,6 @@ function handleSimulationInfo(state, data) { if (data.member.userId == userId) { isSelf = true; } - const myDate = new Date(); const myDate1 = myDate.toLocaleDateString().replace(/\//g, '-'); const chatTime = /\d{2}:\d{2}:\d{2}/.exec(data.chatTime)[0] || data.chatTime; @@ -156,61 +158,11 @@ function handleSimulationInfo(state, data) { date: +new Date(`${myDate1} ${chatTime}`) }; state.simulationText = params; - // if (state.coversitionList[data.conversationId]) { - // state.coversitionList[data.conversationId].push(params); - // } else { - // state.coversitionList[data.conversationId] = []; - // state.coversitionList[data.conversationId].push(params); - // } +} - // switch (data.member.role) { - // case '01': - // role = '管理员'; - // break; - // case '02': - // role = '教员'; - // break; - // case '03': - // role = `调度员`; - // break; - // case '04': - // store.state.map.map.stationList.forEach(nor => { - // if (nor.code == data.member.deviceCode) { - // role = `${nor.name}`; - // } - // }); - // break; - // } - // if (!data.member.userId && data.member.deviceName) { - // data.member.nickName = data.member.deviceName; - // } - // if (!data.targetMember.userId && data.targetMember.deviceName) { - // data.targetMember.nickName = data.targetMember.deviceName; - // } - - // const param = { - // join: false, - // value: data.message, - // self: isSelf, - // voice: data.isAudio, - // src: data.isAudio ? `${process.env.process.env.VUE_VOICE_API}/jlcloud/audio/${data.audioPath}` : '', - // other: !isSelf, - // userName: '', - // id: data.member.id, - // chatTime: data.chatTime, - // date: +new Date(`${myDate1} ${chatTime}`), - // conversationId: data.conversationId, - // changeVO: data.changeVO || {}, - // targetMember: data.targetMember, - // member: data.member, - // group: data.group - // }; - // if (data.member.role) { - // param.userName = `${role}【${data.member.nickName}】`; - // } else { - // param.userName = `${data.member.nickName}`; - // } - // state.simulationText = param; +// 剧本提示 +function handleSimulationScriptTipInfo(state, data) { + state.simulationScriptTip = data; } function handleUserinfo(state, data) { @@ -242,6 +194,7 @@ const socket = { chatContent: {}, // 聊天室聊天内容 roleList: [], // 设置角色信息 simulationRoleList:[], // 设置仿真的聊天角色信息 + simulationScriptTip:{}, // 剧本推送提示信息 jointRoomPrepare: false, // 演练房间准备状态 equipmentStatus: [], // 仿真-设备状态消息 trainStationList: [], // 仿真-列车实际到发车站消息 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/competition/demonList.vue b/src/views/competition/demonList.vue new file mode 100644 index 000000000..936e4c791 --- /dev/null +++ b/src/views/competition/demonList.vue @@ -0,0 +1,133 @@ + + + + diff --git a/src/views/competition/index.vue b/src/views/competition/index.vue new file mode 100644 index 000000000..9f074b3f2 --- /dev/null +++ b/src/views/competition/index.vue @@ -0,0 +1,85 @@ + + + + diff --git a/src/views/designPlatform/mapPreviewNew.vue b/src/views/designPlatform/mapPreviewNew.vue index 9460822c4..2a2f8727d 100644 --- a/src/views/designPlatform/mapPreviewNew.vue +++ b/src/views/designPlatform/mapPreviewNew.vue @@ -1,17 +1,22 @@ - diff --git a/src/views/iscs/iscsSystem/config/pa/timePreviewPA.vue b/src/views/iscs/iscsSystem/config/pa/timePreviewPA.vue index d5b647b99..e4dceabb2 100644 --- a/src/views/iscs/iscsSystem/config/pa/timePreviewPA.vue +++ b/src/views/iscs/iscsSystem/config/pa/timePreviewPA.vue @@ -1,10 +1,102 @@ + diff --git a/src/views/iscs/iscsSystem/config/pis/lcdControl.vue b/src/views/iscs/iscsSystem/config/pis/lcdControl.vue index ed24b55b4..5bf810393 100644 --- a/src/views/iscs/iscsSystem/config/pis/lcdControl.vue +++ b/src/views/iscs/iscsSystem/config/pis/lcdControl.vue @@ -1,5 +1,5 @@ + diff --git a/src/views/scriptManage/home.vue b/src/views/scriptManage/home.vue index 51ddcaf12..dfafb228c 100644 --- a/src/views/scriptManage/home.vue +++ b/src/views/scriptManage/home.vue @@ -1,7 +1,7 @@