diff --git a/.env.native b/.env.native index d1152d456..af5c4a6d3 100644 --- a/.env.native +++ b/.env.native @@ -1,5 +1,5 @@ # just a flag -NODE_ENV = 'Local' +NODE_ENV = 'production' VUE_APP_PRO = 'local' # base api diff --git a/.env.staging b/.env.staging index 605ec30ae..41dbe65d7 100644 --- a/.env.staging +++ b/.env.staging @@ -1,5 +1,5 @@ # just a flag -NODE_ENV = 'test' +NODE_ENV = 'production' # base api VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud' diff --git a/src/App.vue b/src/App.vue index fa63f2683..37e4c4697 100644 --- a/src/App.vue +++ b/src/App.vue @@ -82,7 +82,9 @@ export default { }, subscribeMessage(res) { if (this.$refs.deomonTopic && !window.location.href.includes('trainroom')) { - this.$refs.deomonTopic.doShow(res); + if (getSessionStorage('project') != 'refereeJsxt' && getSessionStorage('project') != 'jsxt') { + this.$refs.deomonTopic.doShow(res); + } this.$store.dispatch('socket/setRoomInvite'); } }, diff --git a/src/api/competition.js b/src/api/competition.js index 483d58386..1e81796d6 100644 --- a/src/api/competition.js +++ b/src/api/competition.js @@ -36,3 +36,73 @@ export function participantCompleteCompetition(id, group) { method: 'post' }); } + +/** 分页获取地图下的实操列表 */ +export function getQuestionListByMapId(params) { + return request({ + url: `/api/v1/competitionPractical`, + method: 'get', + params + }); +} + +// 加载实操及内容 +export function loadQuestionList(competitionId, data) { + return request({ + url: `api/v1/competitionPractical/competition/${competitionId}/distribute`, + method: 'post', + data + }); +} +/** 竞赛报名 */ +export function postSignUp(id, data) { + return request({ + url: `/api/race/${id}/signUp`, + method: 'post', + data + }); +} + +/** 查询用户是否已经报名该竞赛 */ +export function getIsSignUp(raceId) { + return request({ + url: `/api/race/${raceId}/isSignUp`, + method: 'get' + }); +} + +/** 分页查询竞赛报名人员 */ +export function getRaceUserList(params) { + return request({ + url: `/api/race/${params.raceId}/raceUser`, + method: 'get', + params + }); +} + +/** 分页查询理论题列表 */ +export function getCompetitionTheory(params) { + return request({ + url: `/api/v1/competitionTheory`, + method: 'get', + params + }); +} + +/** 提交试卷 */ +export function postCompetitionTheory(theoryId, data) { + return request({ + url: `/api/v1/competitionTheory/${theoryId}/submit`, + method: 'post', + data + }); +} + +/** 查询用户是否已经报名该竞赛 */ +export function getCompetitionPractical(competitionId) { + return request({ + url: `/api/v1/competitionPractical/competition/${competitionId}`, + method: 'get' + }); +} + diff --git a/src/api/practical.js b/src/api/practical.js new file mode 100644 index 000000000..7a86ae405 --- /dev/null +++ b/src/api/practical.js @@ -0,0 +1,40 @@ +import request from '@/utils/request'; + +/** 创建实操 */ +export function createPractical(data) { + return request({ + url: `/api/v1/competitionPractical`, + method: 'post', + data: data + }); +} +/** 加载实操及内容 */ +export function loadingPractical(data) { + return request({ + url: `/api/v1/competitionPractical/distribute`, + method: 'post', + data: data + }); +} +/** 查询地图下的实操列表 */ +export function getPracticalListByMapId(mapId) { + return request({ + url: `/api/v1/competitionPractical/map/${mapId}`, + method: 'get' + }); +} +/** 删除实操 */ +export function deletePractical(practicalId) { + return request({ + url: `/api/v1/competitionPractical/${practicalId}`, + method: 'delete' + }); +} +/** 更新实操 */ +export function updatePractical(practicalId, data) { + return request({ + url: `/api/v1/competitionPractical/{practicalId}`, + method: 'put', + data: data + }); +} diff --git a/src/api/race.js b/src/api/race.js new file mode 100644 index 000000000..13d7ecb91 --- /dev/null +++ b/src/api/race.js @@ -0,0 +1,26 @@ +import request from '@/utils/request'; + +/** 分页查询竞赛 */ +export function getRaceList(params) { + return request({ + url: `/api/race`, + method: 'get', + params: params + }); +} +/** 创建竞赛 */ +export function createRace(data) { + return request({ + url: `/api/race`, + method: 'post', + data + }); +} +/** 修改竞赛信息 */ +export function updateRace(id, data) { + return request({ + url: `/api/race/${id}`, + method: 'put', + data + }); +} diff --git a/src/assets/apply.png b/src/assets/apply.png new file mode 100644 index 000000000..5460d5141 Binary files /dev/null and b/src/assets/apply.png differ diff --git a/src/assets/applyAlready.png b/src/assets/applyAlready.png new file mode 100644 index 000000000..9d36a1d7d Binary files /dev/null and b/src/assets/applyAlready.png differ diff --git a/src/components/QueryListPage/DataForm.vue b/src/components/QueryListPage/DataForm.vue index d4858a6ac..aa6718737 100644 --- a/src/components/QueryListPage/DataForm.vue +++ b/src/components/QueryListPage/DataForm.vue @@ -78,6 +78,25 @@ >{{ item.message }} + @@ -22,6 +23,7 @@ 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'; +import TrainInitPlan from './dialog/trainInitPlan'; export default { name: 'SectionMenu', @@ -31,7 +33,8 @@ export default { SectionCmdControl, SpeedCmdControl, NoticeInfo, - SetFault + SetFault, + TrainInitPlan }, props: { selected: { @@ -106,6 +109,16 @@ export default { } } }, + mounted() { + const isDev = process.env.NODE_ENV === 'development'; + if (isDev) { + this.menuNormal.Center.push({ + label: '新建计划车', + handler: this.createPlanTrain, + cmdType: CMD.Section.CMD_Train_Init_Plan + }); + } + }, methods: { clickEvent() { const self = this; @@ -134,6 +147,23 @@ export default { this.$refs.popMenu.close(); } }, + createPlanTrain() { + const step = { + start: true, + code: this.selected.code, + operation: OperationEvent.Train.createPlanTrain.menu.operation, + param: { + sectionCode: this.selected.code + } + }; + + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainInitPlan.doShow(step, this.selected); + } + }); + }, // 设置故障 setStoppage() { commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ diff --git a/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue b/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue index 056684c28..b563af36f 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue @@ -7,7 +7,6 @@ - @@ -23,7 +22,6 @@ import TrainDelete from './dialog/trainDelete'; import TrainMove from './dialog/trainMove'; import TrainSwitch from './dialog/trainSwitch'; import TrainEditNumber from './dialog/trainEditNumber'; -import TrainInitPlan from './dialog/trainInitPlan'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { @@ -35,8 +33,7 @@ export default { TrainDelete, TrainMove, TrainSwitch, - TrainEditNumber, - TrainInitPlan + TrainEditNumber }, props: { selected: { @@ -51,18 +48,18 @@ export default { menu: [], menuNormal: { Local: [ - { - label: '新建计划列车', - handler: this.createPlanTrain, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - } + // { + // label: '新建计划列车', + // handler: this.createPlanTrain, + // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan + // } ], Center: [ - { - label: '新建计划列车', - handler: this.createPlanTrain, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - } + // { + // label: '新建计划列车', + // handler: this.createPlanTrain, + // cmdType: CMD.TrainWindow.CMD_Train_Init_Plan + // } ] }, menuForce: [ @@ -140,23 +137,6 @@ export default { // this.$store.dispatch('map/setTrainWindowShow', false); } }, - createPlanTrain() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.Train.createPlanTrain.menu.operation, - param: { - trainWindowCode: this.selected.code - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainInitPlan.doShow(step, this.selected); - } - }); - }, // 设置故障 setStoppage() { const step = { diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue index f62ef0f73..81f3ba9cf 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/routeSelection.vue @@ -38,6 +38,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; import {menuOperate, commitOperate} from '../utils/menuOperate'; import { deepAssign } from '@/utils/index'; +import { mapGetters } from 'vuex'; export default { name: 'RouteSelection', @@ -62,6 +63,9 @@ export default { }; }, computed: { + ...mapGetters('map', [ + 'overlapData' + ]), show() { return this.dialogShow && !this.$store.state.menuOperation.break; }, @@ -166,7 +170,25 @@ export default { } }); } - + if (this.overlapData[row.overlapCode] && this.overlapData[row.overlapCode].pathList && this.overlapData[row.overlapCode].pathList.length) { + this.overlapData[row.overlapCode].pathList.forEach(item => { + if (item.sectionList && item.sectionList.length) { + item.sectionList.forEach(elem => { + const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem)); + if (section.logicSectionCodeList && section.logicSectionCodeList.length) { + section.logicSectionCodeList.forEach(logicSectionCode => { + const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicSectionCode)); + sec.cutOff = true; + containSectionList.push(sec); + }); + } else { + section.cutOff = true; + containSectionList.push(section); + } + }); + } + }); + } this.$store.dispatch('training/updateMapState', [...containSectionList]); this.beforeSectionList = containSectionList || []; diff --git a/src/jmapNew/theme/ningbo_01/menus/dialog/trainAddPlan.vue b/src/jmapNew/theme/ningbo_01/menus/dialog/trainAddPlan.vue index 0cec5e880..d887bf47d 100644 --- a/src/jmapNew/theme/ningbo_01/menus/dialog/trainAddPlan.vue +++ b/src/jmapNew/theme/ningbo_01/menus/dialog/trainAddPlan.vue @@ -12,33 +12,23 @@ >
- - - - - - + @@ -61,7 +51,6 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { getTripNumberList, getServiceNumbersByTripNum } from '@/api/simulation'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; - export default { // name: 'TrainMove', name: 'TrainAddPlan', @@ -74,15 +63,11 @@ export default { tripNumberList: [], serviceNumberList: [], addModel: { - trainCode: '', // 车组号 serviceNumber: '', // 服务号 tripNumber: '' // 车次号 }, rules: { - trainCode: [ - { required: true, message: '请输入车组号', trigger: 'change' } - ], serviceNumber: [ { required: true, message: '请输入服务号', trigger: 'blur' } ], @@ -143,7 +128,6 @@ export default { // } this.addModel = { - trainCode:'', tripNumber:'', serviceNumber:'' }; @@ -155,7 +139,7 @@ export default { } }); }).catch(error => { - console.log(error); + console.log(error); // this.$messageBox(error.message); }); this.dialogShow = true; @@ -176,9 +160,8 @@ export default { const operate = { over: true, operation: OperationEvent.Train.createPlanTrain.menu.operation, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan, + cmdType: CMD.Section.CMD_Train_Init_Plan, param: { - trainCode: this.addModel.trainCode, // 车组号 serviceNumber: this.addModel.serviceNumber, // 服务号 tripNumber: this.addModel.tripNumber // 车次号 } diff --git a/src/jmapNew/theme/ningbo_01/menus/index.vue b/src/jmapNew/theme/ningbo_01/menus/index.vue index b2fec6082..ab18734c5 100644 --- a/src/jmapNew/theme/ningbo_01/menus/index.vue +++ b/src/jmapNew/theme/ningbo_01/menus/index.vue @@ -6,7 +6,8 @@ - > + + diff --git a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue index aeb16bf71..890c0ce08 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuSection.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuSection.vue @@ -6,6 +6,7 @@ +
@@ -23,6 +24,8 @@ 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'; +import TrainAddPlan from './dialog/trainAddPlan'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; export default { name: 'SectionMenu', @@ -33,7 +36,8 @@ export default { SpeedLimitControl, AlxeEffective, NoticeInfo, - SetFault + SetFault, + TrainAddPlan }, props: { selected: { @@ -129,6 +133,16 @@ export default { } } }, + mounted() { + const isDev = process.env.NODE_ENV === 'development'; + if (isDev) { + this.menuNormal.Center.push({ + label: '新建计划车', + handler: this.addPlanTrain, + cmdType: CMD.Section.CMD_Train_Init_Plan + }); + } + }, methods: { clickEvent() { const self = this; @@ -156,6 +170,24 @@ export default { this.$refs.popMenu.close(); } }, + // 新建计划车(开发专用) + addPlanTrain() { + const step = { + start: true, + code: this.selected.code, + operation: OperationEvent.Train.createPlanTrain.menu.operation, + param: { + sectionCode: this.selected.code + } + }; + + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainAddPlan.doShow(step, this.selected); + } + }); + }, // // 设置计轴失效 // alxeFailure() { // this.mouseCancelState(this.selected); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue b/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue index fee348e7d..b753a3290 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuStationControl.vue @@ -20,14 +20,14 @@ export default { PopMenu, StationControl }, - props: { - selected: { - type: Object, - default() { - return null; - } - } - }, + // props: { + // selected: { + // type: Object, + // default() { + // return null; + // } + // } + // }, data() { return { menu: [], diff --git a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue index 2ecfcdedc..18331a9f0 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue @@ -7,7 +7,6 @@ - @@ -24,7 +23,6 @@ import TrainDelete from './dialog/trainDelete'; import TrainDefine from './dialog/trainDefine'; import TrainMove from './dialog/trainMove'; import TrainSetPlan from './dialog/trainSetPlan'; -import TrainAddPlan from './dialog/trainAddPlan'; import TrainSetHead from './dialog/trainSetHead'; import TrainSetWork from './dialog/trainSetWork'; import trainSetWorkATP from './dialog/trainSetWorkATP'; @@ -44,7 +42,6 @@ export default { TrainDefine, TrainMove, TrainSetPlan, - TrainAddPlan, TrainSetHead, TrainSetWork, trainSetWorkATP @@ -148,11 +145,6 @@ export default { handler: this.moveTrainId, cmdType: CMD.TrainWindow.CMD_Train_Init_Plan }, - { - label: '新建计划车', - handler: this.addPlanTrain, - cmdType: CMD.TrainWindow.CMD_Train_Init_Plan - }, { type: 'separator' }, @@ -407,24 +399,6 @@ export default { } }); }, - // 新建计划车(开发专用) - addPlanTrain() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.Train.createPlanTrain.menu.operation, - param: { - sectionCode: this.$store.state.map.trainWindowSectionCode - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainAddPlan.doShow(step, this.selected); - } - }); - }, // 设置头码车 setHeadTrain() { const operate = { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/childDialog/childDialog/noticeInfo.vue b/src/jmapNew/theme/xian_01/menus/dialog/childDialog/childDialog/noticeInfo.vue index 6df116961..672cfec3d 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/childDialog/childDialog/noticeInfo.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/childDialog/childDialog/noticeInfo.vue @@ -32,8 +32,7 @@ export default { data() { return { dialogShow: false, - messages: [this.$t('tip.commandFailed')], - operate: null + messages: [this.$t('tip.commandFailed')] }; }, computed: { @@ -53,8 +52,7 @@ export default { }); }, methods: { - doShow(operate, messages) { - this.operate = operate || {}; + doShow(messages) { this.dialogShow = true; this.messages = [this.$t('tip.commandFailed')]; if (messages && messages != 'null') { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmControl.vue b/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmControl.vue index 208f4a5f6..5e7296eb6 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmControl.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmControl.vue @@ -170,7 +170,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 信号关灯 @@ -187,10 +187,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate, [error.message]); + this.$refs.noticeInfo.doShow(); }); }, // 信号重开 @@ -207,10 +207,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate, [error.message]); + this.$refs.noticeInfo.doShow(); }); }, // 取消进路 @@ -230,7 +230,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 进路交人工控 @@ -250,7 +250,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 进路交ATS自动控 @@ -270,7 +270,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 设置运行等级 @@ -291,7 +291,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 停站时间 @@ -312,7 +312,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 设置折返策略 @@ -333,7 +333,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmTrain.vue b/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmTrain.vue index 92342891c..1d72826c7 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmTrain.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/childDialog/confirmTrain.vue @@ -152,7 +152,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/routeControl.vue b/src/jmapNew/theme/xian_01/menus/dialog/routeControl.vue index b47664af9..3f5ef2062 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/routeControl.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/routeControl.vue @@ -151,10 +151,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); }, // 信号关灯 @@ -206,7 +206,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 取消联锁自动进路 @@ -226,7 +226,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 设置联锁自动触发 @@ -246,7 +246,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 取消联锁自动触发 @@ -267,7 +267,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 取消 @@ -281,7 +281,7 @@ export default { } }).catch(() => { this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); } } diff --git a/src/jmapNew/theme/xian_01/menus/dialog/routeDetail.vue b/src/jmapNew/theme/xian_01/menus/dialog/routeDetail.vue index 3d5cbc403..c74603b7b 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/routeDetail.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/routeDetail.vue @@ -143,7 +143,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/routeHandControl.vue b/src/jmapNew/theme/xian_01/menus/dialog/routeHandControl.vue index a5617e325..f205504b2 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/routeHandControl.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/routeHandControl.vue @@ -297,10 +297,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); }, // 进路交自动控 @@ -311,10 +311,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/routeLock.vue b/src/jmapNew/theme/xian_01/menus/dialog/routeLock.vue index d68020d00..719613135 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/routeLock.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/routeLock.vue @@ -138,10 +138,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); }, cancel() { @@ -154,7 +154,7 @@ export default { } }).catch(() => { this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); } } diff --git a/src/jmapNew/theme/xian_01/menus/dialog/routeSelection.vue b/src/jmapNew/theme/xian_01/menus/dialog/routeSelection.vue index 92d949ef7..a8f0d4cb9 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/routeSelection.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/routeSelection.vue @@ -51,6 +51,7 @@ import ConfirmControl from './childDialog/confirmControl'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; import { deepAssign } from '@/utils/index'; import { menuOperate, commitOperate } from '../utils/menuOperate'; +import { mapGetters } from 'vuex'; export default { name: 'RouteSelection', @@ -72,6 +73,9 @@ export default { }; }, computed: { + ...mapGetters('map', [ + 'overlapData' + ]), show() { return this.dialogShow && !this.$store.state.menuOperation.break; }, @@ -184,7 +188,25 @@ export default { } }); } - + if (this.overlapData[row.overlapCode] && this.overlapData[row.overlapCode].pathList && this.overlapData[row.overlapCode].pathList.length) { + this.overlapData[row.overlapCode].pathList.forEach(item => { + if (item.sectionList && item.sectionList.length) { + item.sectionList.forEach(elem => { + const section = deepAssign({}, this.$store.getters['map/getDeviceByCode'](elem)); + if (section.logicSectionCodeList && section.logicSectionCodeList.length) { + section.logicSectionCodeList.forEach(logicSectionCode => { + const sec = deepAssign({}, this.$store.getters['map/getDeviceByCode'](logicSectionCode)); + sec.cutOff = true; + containSectionList.push(sec); + }); + } else { + section.cutOff = true; + containSectionList.push(section); + } + }); + } + }); + } this.$store.dispatch('training/updateMapState', [...containSectionList]); this.beforeSectionList = containSectionList || []; @@ -210,10 +232,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); } }, diff --git a/src/jmapNew/theme/xian_01/menus/dialog/sectionControl.vue b/src/jmapNew/theme/xian_01/menus/dialog/sectionControl.vue index 616652fdb..2f97efb8b 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/sectionControl.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/sectionControl.vue @@ -129,10 +129,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue b/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue index 54916da3c..4b11511d4 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/setFault.vue @@ -117,10 +117,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); }, diff --git a/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue b/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue index a1d0c1e09..8df2c96e0 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/standBackStrategy.vue @@ -214,7 +214,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); } else { this.doClose(); diff --git a/src/jmapNew/theme/xian_01/menus/dialog/standControl.vue b/src/jmapNew/theme/xian_01/menus/dialog/standControl.vue index 54f372905..c86a9b2f4 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/standControl.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/standControl.vue @@ -153,10 +153,10 @@ export default { if (valid) { this.doClose(); } - }).catch((error) => { + }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow({}, error.message); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/standDetainTrainAll.vue b/src/jmapNew/theme/xian_01/menus/dialog/standDetainTrainAll.vue index fae73b1f3..5c151a61a 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/standDetainTrainAll.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/standDetainTrainAll.vue @@ -170,7 +170,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/stationCmdControl.vue b/src/jmapNew/theme/xian_01/menus/dialog/stationCmdControl.vue index 7e544c8f6..fd2b2973e 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/stationCmdControl.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/stationCmdControl.vue @@ -79,6 +79,7 @@ + diff --git a/src/jmapNew/theme/xian_01/menus/dialog/trainControl.vue b/src/jmapNew/theme/xian_01/menus/dialog/trainControl.vue index fdb3b740b..87cd70709 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/trainControl.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/trainControl.vue @@ -17,19 +17,19 @@ /> - + - {{ $t('menu.planTrain') }} - {{ $t('menu.headCodeTrain') }} - {{ $t('menu.artificialTrain') }} + {{ $t('menu.planTrain') }} + {{ $t('menu.headCodeTrain') }} + {{ $t('menu.artificialTrain') }} - + {{ $t('menu.serviceNumber') }} - + - + - - - - - + + + + + + + + + + + + + + +
- {{ $t('global.confirm') }} + {{ $t('global.confirm') }} {{ $t('global.cancel') }} @@ -88,6 +86,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; import ConfirmTrain from './childDialog/confirmTrain'; import NoticeInfo from './childDialog/childDialog/noticeInfo'; import Handler from '@/scripts/cmdPlugin/Handler'; +import { menuOperate, commitOperate } from '../utils/menuOperate'; export default { name: 'TrainControl', @@ -104,9 +103,9 @@ export default { formModel: { tripNumber: '', groupNumber: '', - trainType: '01', + type: 'PLAN', serviceNumber: '', - targetCode: '', + destinationCode: '', category: 'MM' }, @@ -114,7 +113,7 @@ export default { groupNumber: [ { required: true, message: this.$t('rules.selectGroupNumber'), trigger: 'change' } ], - trainType: [ + type: [ { required: true, message: this.$t('rules.selectATrainType'), trigger: 'change' } ], serviceNumber: [ @@ -123,7 +122,7 @@ export default { tripNumber: [ { required: true, message: this.$t('rules.enterTheTripNumber'), trigger: 'blur' } ], - targetCode: [ + destinationCode: [ { required: true, message: this.$t('rules.enterTheTargetCode'), trigger: 'blur' } ] }, @@ -252,20 +251,20 @@ export default { } }, watch: { - 'formModel.tripNumber': function(val) { - if (val.length == 4) { - this.trainNoChange(val); - } else { - this.formModel = { - groupNumber: this.formModel.groupNumber, - tripNumber: val, - trainType: this.formModel.trainType, - serviceNumber: '', - targetCode: '', - category: 'MM' - }; - } - } + // 'formModel.tripNumber': function(val) { + // if (val.length == 4) { + // // this.trainNoChange(val); + // } else { + // this.formModel = { + // groupNumber: this.formModel.groupNumber, + // tripNumber: val, + // type: this.formModel.type, + // serviceNumber: '', + // destinationCode: '', + // category: 'MM' + // }; + // } + // } }, mounted() { this.$nextTick(() => { @@ -282,13 +281,12 @@ export default { const model = this.$store.getters['map/getDeviceByCode'](selected.code); this.formModel = { groupNumber: model.groupNumber, - tripNumber: `${model.directionCode}${model.tripNumber}`, - trainType: model.type, + tripNumber: model.tripNumber, + type: model.type ? model.type : 'PLAN', serviceNumber: model.serviceNumber, - targetCode: model.targetCode, + destinationCode: model.destinationCode, category: 'MM' }; - /** 加载列车数据*/ this.loadInitData(this.map); this.dialogShow = true; @@ -415,7 +413,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); } else { return false; @@ -426,27 +424,52 @@ export default { editTrainId() { this.$refs['form'].validate((valid) => { if (valid) { - const operate = { - send: true, - - operation: OperationEvent.Train.editTrainId.menu.operation, - cmdType: CMD.Train.CMD_EDIT_TRAIN_ID, - messages: [this.$t('tip.editTrainIdTip')], - val: `${this.formModel.trainType}::${this.formModel.tripNumber}` + // const operate = { + // send: true, + // + // operation: OperationEvent.Train.editTrainId.menu.operation, + // cmdType: CMD.Train.CMD_EDIT_TRAIN_ID, + // messages: [this.$t('tip.editTrainIdTip')], + // val: `${this.formModel.trainType}::${this.formModel.tripNumber}` + // }; + // + // this.loading = true; + // this.$store.dispatch('training/next', operate).then(({ valid }) => { + // this.loading = false; + // if (valid) { + // this.doClose(); + // this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + // this.$refs.confirmTrain.doShow(operate); + // } + // }).catch(() => { + // this.loading = false; + // this.doClose(); + // this.$refs.noticeInfo.doShow(); + // }); + const params = { + groupNumber: this.formModel.groupNumber, + type: this.formModel.type, + serviceNumber: '', + tripNumber: '', + destinationCode: '' }; - - this.loading = true; - this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (this.formModel.type === '01') { + params.serviceNumber = this.formModel.serviceNumber; + params.tripNumber = this.formModel.tripNumber; + params.destinationCode = this.formModel.destinationCode; + } else if (this.formModel.type === '02') { + params.tripNumber = this.formModel.tripNumber; + params.destinationCode = this.formModel.destinationCode; + } + commitOperate(menuOperate.TrainWindow.editTrainId, params, 2).then(({valid})=>{ this.loading = false; if (valid) { this.doClose(); - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.confirmTrain.doShow(operate); } }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); } else { return false; diff --git a/src/jmapNew/theme/xian_01/menus/dialog/trainCreate.vue b/src/jmapNew/theme/xian_01/menus/dialog/trainCreate.vue index 661033719..da31ce350 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/trainCreate.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/trainCreate.vue @@ -133,7 +133,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, cancel() { diff --git a/src/jmapNew/theme/xian_01/menus/dialog/trainDelete.vue b/src/jmapNew/theme/xian_01/menus/dialog/trainDelete.vue index 2b08dc30d..c880e2e14 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/trainDelete.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/trainDelete.vue @@ -143,7 +143,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); } else { return false; diff --git a/src/jmapNew/theme/xian_01/menus/dialog/trainDetail.vue b/src/jmapNew/theme/xian_01/menus/dialog/trainDetail.vue new file mode 100644 index 000000000..32e9ad06e --- /dev/null +++ b/src/jmapNew/theme/xian_01/menus/dialog/trainDetail.vue @@ -0,0 +1,180 @@ + + diff --git a/src/jmapNew/theme/xian_01/menus/dialog/trainMove.vue b/src/jmapNew/theme/xian_01/menus/dialog/trainMove.vue index f2309fd59..c38c3b47e 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/trainMove.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/trainMove.vue @@ -167,7 +167,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); }); } else { return false; diff --git a/src/jmapNew/theme/xian_01/menus/dialog/trainSwitch.vue b/src/jmapNew/theme/xian_01/menus/dialog/trainSwitch.vue index 6a2eaf4fe..41076e5de 100644 --- a/src/jmapNew/theme/xian_01/menus/dialog/trainSwitch.vue +++ b/src/jmapNew/theme/xian_01/menus/dialog/trainSwitch.vue @@ -172,7 +172,7 @@ export default { }).catch(() => { this.loading = false; this.doClose(); - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); }); } else { return false; diff --git a/src/jmapNew/theme/xian_01/menus/menuBar.vue b/src/jmapNew/theme/xian_01/menus/menuBar.vue index e59b47d55..679d5f01d 100644 --- a/src/jmapNew/theme/xian_01/menus/menuBar.vue +++ b/src/jmapNew/theme/xian_01/menus/menuBar.vue @@ -67,6 +67,10 @@ + + + + @@ -694,7 +698,7 @@ export default { diff --git a/src/jmapNew/theme/xian_01/menus/menuCancel.vue b/src/jmapNew/theme/xian_01/menus/menuCancel.vue index 4606ff2b7..89aa52c8c 100644 --- a/src/jmapNew/theme/xian_01/menus/menuCancel.vue +++ b/src/jmapNew/theme/xian_01/menus/menuCancel.vue @@ -63,12 +63,12 @@ export default { initMenu() { this.menuNormal = []; this.stationList.forEach(station => { - if (station.chargeStationCodeList && station.chargeStationCodeList.length) { + if (station.relStationCodeList && station.relStationCodeList.length) { const node = { label: station.name, children: [] }; - station.chargeStationCodeList.forEach(item => { + station.relStationCodeList.forEach(item => { const next = this.$store.getters['map/getDeviceByCode'](item); node.children.push({ code: next.code, diff --git a/src/jmapNew/theme/xian_01/menus/menuDialog/childDialog/twoConfirmation.vue b/src/jmapNew/theme/xian_01/menus/menuDialog/childDialog/twoConfirmation.vue index d3d60b145..09e857e89 100644 --- a/src/jmapNew/theme/xian_01/menus/menuDialog/childDialog/twoConfirmation.vue +++ b/src/jmapNew/theme/xian_01/menus/menuDialog/childDialog/twoConfirmation.vue @@ -121,8 +121,8 @@ export default { this.doClose(); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } - }).catch((error) => { - this.$refs.noticeInfo.doShow(operate, error.message); + }).catch(() => { + this.$refs.noticeInfo.doShow(); }); } } diff --git a/src/jmapNew/theme/xian_01/menus/menuDialog/passwordBox.vue b/src/jmapNew/theme/xian_01/menus/menuDialog/passwordBox.vue index 3312655f7..e06f5bac3 100644 --- a/src/jmapNew/theme/xian_01/menus/menuDialog/passwordBox.vue +++ b/src/jmapNew/theme/xian_01/menus/menuDialog/passwordBox.vue @@ -164,7 +164,7 @@ export default { }); }); } else { - this.$refs.noticeInfo.doShow(operate, [this.$t('menu.menuDialog.IncorrectPassword')]); + this.$refs.noticeInfo.doShow(this.$t('menu.menuDialog.IncorrectPassword')); } }, diff --git a/src/jmapNew/theme/xian_01/menus/menuDialog/trainAdd.vue b/src/jmapNew/theme/xian_01/menus/menuDialog/trainAdd.vue index fd7486f6e..9fd3cab96 100644 --- a/src/jmapNew/theme/xian_01/menus/menuDialog/trainAdd.vue +++ b/src/jmapNew/theme/xian_01/menus/menuDialog/trainAdd.vue @@ -136,12 +136,12 @@ export default { if (valid) { this.doClose(); } else { - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); } }).catch(() => { this.loading = false; this.doClose(); - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); }); } else { return false; diff --git a/src/jmapNew/theme/xian_01/menus/menuDialog/trainDelete.vue b/src/jmapNew/theme/xian_01/menus/menuDialog/trainDelete.vue index 148e6cbc6..96c46f725 100644 --- a/src/jmapNew/theme/xian_01/menus/menuDialog/trainDelete.vue +++ b/src/jmapNew/theme/xian_01/menus/menuDialog/trainDelete.vue @@ -118,12 +118,12 @@ export default { if (valid) { this.doClose(); } else { - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); } }).catch(() => { this.loading = false; this.doClose(); - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); }); } else { return false; diff --git a/src/jmapNew/theme/xian_01/menus/menuDialog/trainTranstalet.vue b/src/jmapNew/theme/xian_01/menus/menuDialog/trainTranstalet.vue index 96a4c65da..180469290 100644 --- a/src/jmapNew/theme/xian_01/menus/menuDialog/trainTranstalet.vue +++ b/src/jmapNew/theme/xian_01/menus/menuDialog/trainTranstalet.vue @@ -135,12 +135,12 @@ export default { if (valid) { this.doClose(); } else { - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); } }).catch(() => { this.loading = false; this.doClose(); - // this.$refs.noticeInfo.doShow(operate); + // this.$refs.noticeInfo.doShow(); }); } else { return false; diff --git a/src/jmapNew/theme/xian_01/menus/menuSection.vue b/src/jmapNew/theme/xian_01/menus/menuSection.vue index 21816f04b..1589964cd 100644 --- a/src/jmapNew/theme/xian_01/menus/menuSection.vue +++ b/src/jmapNew/theme/xian_01/menus/menuSection.vue @@ -6,6 +6,7 @@ + @@ -21,6 +22,8 @@ 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'; +import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; +import TrainAddPlan from './dialog/trainAddPlan'; export default { name: 'SectionMenu', @@ -30,7 +33,8 @@ export default { SectionCmdControl, SpeedCmdControl, NoticeInfo, - SetFault + SetFault, + TrainAddPlan }, props: { selected: { @@ -142,6 +146,16 @@ export default { } } }, + mounted() { + const isDev = process.env.NODE_ENV === 'development'; + if (isDev) { + this.menuNormal.Center.push({ + label: '新建计划车', + handler: this.addPlanTrain, + cmdType: CMD.Section.CMD_Train_Init_Plan + }); + } + }, methods: { clickEvent() { const self = this; @@ -151,6 +165,7 @@ export default { }, initMenu() { // 编辑模式菜单列表 + this.menu = MenuContextHandler.covert(this.menuNormal); // 故障模式菜单列表 @@ -170,6 +185,24 @@ export default { this.$refs.popMenu.close(); } }, + // 新建计划车(开发专用) + addPlanTrain() { + const step = { + start: true, + code: this.selected.code, + operation: OperationEvent.Train.createPlanTrain.menu.operation, + param: { + sectionCode: this.selected.code + } + }; + + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainAddPlan.doShow(step, this.selected); + } + }); + }, // 设置故障 setStoppage() { commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ diff --git a/src/jmapNew/theme/xian_01/menus/menuStation.vue b/src/jmapNew/theme/xian_01/menus/menuStation.vue index c00fab189..dceee489c 100644 --- a/src/jmapNew/theme/xian_01/menus/menuStation.vue +++ b/src/jmapNew/theme/xian_01/menus/menuStation.vue @@ -56,46 +56,30 @@ export default { // { // label: '上电解锁', // handler: this.powerUnLock, - // cmdType: CMD.Station.active, + // cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK, // }, // { // label: '执行关键操作测试', // handler: this.execKeyOperationTest, - // cmdType: CMD.Station.active, + // cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST, // } ], Center: [ { - label: '所有进路自排关', + label: '所有进路交人工控', handler: this.humanControlALL, cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING }, { - label: '所有进路自排开', + label: '所有进路交ATS自动控', handler: this.atsAutoControlALL, cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING }, { - label: '上电解锁', - handler: this.powerUnLock, - cmdType: CMD.Station.active + label: '执行关键操作测试', + handler: this.execKeyOperationTest, + cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST } - // { - // label: '所有进路交人工控', - // handler: this.humanControlALL, - // cmdType: '' - // }, - // { - // label: '所有进路交ATS自动控', - // handler: this.atsAutoControlALL, - // cmdType: '' - // } - // { - // label: '执行关键操作测试', - // handler: this.execKeyOperationTest, - // cmdType: CMD.Station.active, - // auth: { station: false, center: true } - // } ] }, menuForce: [ @@ -140,9 +124,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - if (this.operatemode === OperateMode.ADMIN) { - this.menu = [...this.menu, ...this.menuForce]; - } // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { @@ -150,10 +131,12 @@ export default { } }, doShow(point) { - this.clickEvent(); - this.initMenu(); - if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { - this.$refs.popMenu.resetShowPosition(point); + if (this.selected.ciStation) { + this.clickEvent(); + this.initMenu(); + if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) { + this.$refs.popMenu.resetShowPosition(point); + } } }, doClose() { @@ -174,10 +157,10 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 取消故障 @@ -193,10 +176,10 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 全站设置联锁自动触发 @@ -212,7 +195,7 @@ export default { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 全站取消联锁自动触发 @@ -228,7 +211,7 @@ export default { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, // 上电解锁 @@ -259,12 +242,15 @@ export default { } }); }, - // 所有进路自排关 + // 所有进路交人工控 humanControlALL() { const operate = { start: true, code: this.selected.code, - operation: OperationEvent.Station.humanControlALL.menu.operation + operation: OperationEvent.Station.humanControlALL.menu.operation, + param:{ + stationCode:this.selected.code + } }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { @@ -273,12 +259,15 @@ export default { } }); }, - // 所有进路自排开 + // 所有进路交ATS自动控 atsAutoControlALL() { const operate = { start: true, code: this.selected.code, - operation: OperationEvent.Station.atsAutoControlALL.menu.operation + operation: OperationEvent.Station.atsAutoControlALL.menu.operation, + param:{ + stationCode:this.selected.code + } }; this.$store.dispatch('training/nextNew', operate).then(({ valid }) => { if (valid) { diff --git a/src/jmapNew/theme/xian_01/menus/menuTrain.vue b/src/jmapNew/theme/xian_01/menus/menuTrain.vue index 7f215a543..a211af021 100644 --- a/src/jmapNew/theme/xian_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/xian_01/menus/menuTrain.vue @@ -49,42 +49,51 @@ export default { menuNormal: { Local: [], Center: [ - // { - // label: this.$t('menu.menuTrain.addTrainId'), - // handler: this.addTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.deleteTrainId'), - // handler: this.delTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.editTrainId'), - // handler: this.editTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.editTrainNo'), - // handler: this.editTrainNo, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.moveTrainId'), - // handler: this.moveTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.switchTrainId'), - // handler: this.switchTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // } + { + label: this.$t('menu.menuTrain.addTrainId'), + handler: this.addTrainId, + cmdType:'' + }, + { + label: this.$t('menu.menuTrain.deleteTrainId'), + handler: this.delTrainId, + cmdType:'' + }, + { + label: this.$t('menu.menuTrain.editTrainId'), + handler: this.editTrainId, + cmdType:CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE + }, + { + label: this.$t('menu.menuTrain.editTrainNo'), + handler: this.editTrainNo, + cmdType:'' + }, + { + label: this.$t('menu.menuTrain.moveTrainId'), + handler: this.moveTrainId, + cmdType:'' + }, + { + label: this.$t('menu.menuTrain.switchTrainId'), + handler: this.switchTrainId, + cmdType:'' + }, + { + label: '标记ATP切除', + handler: this.undeveloped(), + cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_CUT + }, + { + label: '标记ATP激活', + handler: this.undeveloped(), + cmdType: CMD.TrainWindow.CMD_TRAIN_TAG_ATP_RECOVER + }, + { + label: '查看列车详细运行信息', + handler: this.undeveloped(), + cmdType: CMD.TrainWindow.CMD_TRAIN_INFO + } ] }, menuForce: [ @@ -145,8 +154,6 @@ export default { if (this.operatemode === OperateMode.FAULT) { this.menu = [...this.menuForce, ...this.menuSpeed]; } - - // this.menu = MenuContextHandler.covert(this.menu); }, doShow(point) { this.clickEvent(); @@ -177,10 +184,10 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.noticeInfo.doShow(); } }).catch(() => { - this.$refs.noticeInfo.doShow(step); + this.$refs.noticeInfo.doShow(); }); }, // 取消故障 @@ -198,10 +205,10 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.noticeInfo.doShow(); } }).catch(() => { - this.$refs.noticeInfo.doShow(step); + this.$refs.noticeInfo.doShow(); }); }, // 限速行驶 @@ -219,10 +226,10 @@ export default { if (valid) { this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); } else { - this.$refs.noticeInfo.doShow(step); + this.$refs.noticeInfo.doShow(); } }).catch(() => { - this.$refs.noticeInfo.doShow(step); + this.$refs.noticeInfo.doShow(); }); }, // 添加列车识别号 @@ -310,6 +317,7 @@ export default { } }); }, + undeveloped() {}, // 交换列车识别号 switchTrainId() { const step = { diff --git a/src/jmapNew/theme/xian_01/menus/passiveDialog/control.vue b/src/jmapNew/theme/xian_01/menus/passiveDialog/control.vue index aae10f32b..55e1d23be 100644 --- a/src/jmapNew/theme/xian_01/menus/passiveDialog/control.vue +++ b/src/jmapNew/theme/xian_01/menus/passiveDialog/control.vue @@ -268,7 +268,7 @@ export default { this.doClose(); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); }, refuse() { @@ -292,7 +292,7 @@ export default { this.doClose(); } }).catch(() => { - this.$refs.noticeInfo.doShow(operate); + this.$refs.noticeInfo.doShow(); }); } } diff --git a/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js b/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js index 498d780ff..2323957ec 100644 --- a/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js +++ b/src/jmapNew/theme/xian_01/menus/utils/menuOperate.js @@ -264,6 +264,12 @@ export const menuOperate = { cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL } }, + TrainWindow: { + editTrainId: { + operation: OperationEvent.Train.editTrainId.menu.operation, + cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE + } + }, Common: { setFault: { operation: OperationEvent.Section.stoppage.menu.operation, diff --git a/src/jmapNew/theme/xian_02/menus/dialog/trainAddPlan.vue b/src/jmapNew/theme/xian_02/menus/dialog/trainAddPlan.vue index 8aae08895..6c4c3fca4 100644 --- a/src/jmapNew/theme/xian_02/menus/dialog/trainAddPlan.vue +++ b/src/jmapNew/theme/xian_02/menus/dialog/trainAddPlan.vue @@ -12,16 +12,6 @@ >
- - - - - +
@@ -24,6 +25,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import {menuOperate, commitOperate} from './utils/menuOperate'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import SetFault from '@/views/newMap/mapsystemNew/plugin/setFault'; +import TrainAddPlan from './dialog/trainAddPlan'; export default { name: 'SectionMenu', @@ -34,7 +36,8 @@ export default { SpeedLimitControl, AlxeEffective, NoticeInfo, - SetFault + SetFault, + TrainAddPlan }, props: { selected: { @@ -149,6 +152,16 @@ export default { } } }, + mounted() { + const isDev = process.env.NODE_ENV === 'development'; + if (isDev) { + this.menuNormal.Center.push({ + label: '新建计划车', + handler: this.addPlanTrain, + cmdType: CMD.Section.CMD_Train_Init_Plan + }); + } + }, methods: { clickEvent() { const self = this; @@ -178,6 +191,24 @@ export default { this.$refs.popMenu.close(); } }, + // 新建计划车(开发专用) + addPlanTrain() { + const step = { + start: true, + code: this.selected.code, + operation: OperationEvent.Train.createPlanTrain.menu.operation, + param: { + sectionCode: this.selected.code + } + }; + + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainAddPlan.doShow(step, this.selected); + } + }); + }, // 设置故障 setStoppage() { commitOperate(menuOperate.Common.setFault, { code: this.selected.code }, 0).then(({valid, operate})=>{ diff --git a/src/jmapNew/theme/xian_02/menus/menuTrain.vue b/src/jmapNew/theme/xian_02/menus/menuTrain.vue index 871aa277e..e01bbf2ec 100644 --- a/src/jmapNew/theme/xian_02/menus/menuTrain.vue +++ b/src/jmapNew/theme/xian_02/menus/menuTrain.vue @@ -537,24 +537,6 @@ export default { } }); }, - // 新建计划车(开发专用) - addPlanTrain() { - const step = { - start: true, - code: this.selected.code, - operation: OperationEvent.Train.createPlanTrain.menu.operation, - param: { - sectionCode: this.$store.state.map.trainWindowSectionCode - } - }; - - this.$store.dispatch('training/nextNew', step).then(({ valid }) => { - if (valid) { - this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); - this.$refs.trainAddPlan.doShow(step, this.selected); - } - }); - }, // 设置头码车 setHeadTrain() { const operate = { diff --git a/src/permission.js b/src/permission.js index 0f2be5706..3f32cd3f1 100644 --- a/src/permission.js +++ b/src/permission.js @@ -6,9 +6,10 @@ import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; import { admin} from './router/index_APP_TARGET'; import { getToken, removeToken} from '@/utils/auth'; -import { LoginParams } from '@/utils/login'; +// import { LoginParams } from '@/utils/login'; import { getSessionStorage } from '@/utils/auth'; import localStore from 'storejs'; +import { loginInfo } from '@/scripts/ProjectConfig'; function hasPermission(roles, permissionRoles) { if (roles.indexOf(admin) >= 0) return true; @@ -21,9 +22,7 @@ const whiteList = ['/login', '/design/login', '/gzzbxy/relay']; // 不重定向 const designPageRegex = [/^\/design/, /^\/scriptDisplay/, /^\/publish/, /^\/orderauthor/, /^\/system/, /^\/iscs/, /^\/display\/record/, /^\/display\/manage/, /^\/apply/, /^\/plan/, /^\/display\/plan/, /^\/displayNew\/record/, /^\/displayNew\/manage/, /^\/displayNew\/plan/]; function isDesignPage(toRoutePath) { - return designPageRegex.some(item => { - return item.test(toRoutePath); - }); + return designPageRegex.some(item => item.test(toRoutePath) ); } for (const val in PermissionParam) { whiteList.push(PermissionParam[val].whitePage); @@ -34,49 +33,35 @@ const loginDesignPage = whiteList[1]; // 获取路径数据 function getRouteInfo(to) { let loginPath = ''; - let clientId = ''; const toRoutePath = to.redirectedFrom || to.path; const current_session = getSessionStorage('project'); - for (const val in PermissionParam) { - if (PermissionParam[val].reg.test(toRoutePath)) { - loginPath = PermissionParam[val].whitePage; - clientId = PermissionParam[val].clientId; - break; - } - } - if (whiteList.includes(toRoutePath)) { + if (whiteList.includes(toRoutePath)) { // 登陆页面清空 token removeToken(); } if (isDesignPage(toRoutePath)) { - const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; - loginPath = whitePage || loginDesignPage; - clientId = LoginParams.Design.clientId; + loginPath = loginDesignPage; if (current_session && !current_session.startsWith('design')) { removeToken(); } } else { const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; loginPath = whitePage || loginPage; - clientId = null; if (current_session && current_session.startsWith('design')) { removeToken(); } } - return { clientId, loginPath }; + return { loginPath }; } function handleRoute(to, from, next, routeInfo) { if (store.getters.roles.length === 0) { - // 拉取用户信息 store.dispatch('GetInfo', getToken()).then(res => { // 根据roles权限生成可访问的路由表 const roles = res.roles; - store.dispatch('GenerateRoutes', { roles, clientId: routeInfo.clientId }).then(() => { - // 动态添加可访问路由表 - router.addRoutes(store.getters.addRouters); - // router.addRoutes(asyncRouter1); + store.dispatch('GenerateRoutes', { roles }).then(() => { + router.addRoutes(store.getters.addRouters); // 动态添加可访问路由表 if (to.redirectedFrom) { next({ path: to.redirectedFrom, replace: true }); } else { @@ -105,10 +90,12 @@ function handleRoute(to, from, next, routeInfo) { } router.beforeEach((to, from, next) => { + const project = getSessionStorage('project'); + document.title = loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title; + NProgress.start(); const routeInfo = getRouteInfo(to); if (getToken()) { - // 已登录 if (to.path === routeInfo.loginPath) { // 登录页面不拦截 next(); @@ -117,8 +104,6 @@ router.beforeEach((to, from, next) => { handleRoute(to, from, next, routeInfo); } } else { - // 继电器使用 - // 未登录情况下 if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 next(); diff --git a/src/router/index_Common.js b/src/router/index_Common.js index 69c9c30d7..660fa8839 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -15,7 +15,7 @@ const Jlmap3dPassFlow = () => import('@/views/jlmap3d/passflow/jl3dpassflow'); const Jlmap3dStation = () => import('@/views/jlmap3d/station/jl3dstation'); const Jlmap3dModel = () => import('@/views/jlmap3d/device/jl3ddevice'); const Jlmap3dTrain = () => import('@/views/jlmap3d/devicetrain/jl3ddevicetrain'); -const Jl3dMaintainer = () => import('@/views/jlmap3d/maintainer/jl3dmaintainer'); +// const Jl3dMaintainer = () => import('@/views/jlmap3d/maintainer/jl3dmaintainer'); const Display = () => import('@/views/display/index'); const DisplayNew = () => import('@/views/newMap/displayNew/index'); @@ -122,18 +122,19 @@ const RunPlanApproval = () => import('@/views/approval/runPlan/index'); const DeviceManage = () => import('@/views/system/deviceManage/index'); const MapSort = () => import('@/views/publish/publishMap/mapSort'); const StudentManage = () => import('@/views/studentManage'); +const RaceManage = () => import('@/views/competitionManage/index'); const CompetitionDetail = () => import('@/views/jsxt/competition/examDetail'); const CompetitionManage = () => import('@/views/jsxt/competition/index'); const CompetitionHome = () => import('@/views/jsxt/competition/home'); const Refereedetail = () => import('@/views/jsxt/competition/theory/quiz/index'); +const JsxtExamResult = () => import('@/views/jsxt/competition/result'); const JsxtApply = () => import('@/views/jsxt/apply/index'); // const theoryManage = () => import('@/views/jsxt/competition/theory/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'; +import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; +// import { getSessionStorage } from '@/utils/auth'; /** * Note: sub-menu only appear when route children.length >= 1 @@ -159,22 +160,17 @@ export const mapCreater = '02'; // 地图创建权限 export const lessonCreater = '03'; // 课程创建权限 export const admin = '04'; // 管理员 export const superAdmin = '05'; // 超级管理员 -export const referee = '07'; // 裁判员 +// export const referee = '07'; // 裁判员 -export const userExam = '011'; // 考试系统 -export const userLesson = '012'; // 教学系统 -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'; +export const projectTrain = '011'; // 城市轨道项目 +export const projectXian = '012'; // 西安地铁项目 +export const projectXty = '013'; // 西铁院 +export const projectGzzb = '014'; // 贵州装备 +export const projectJsxt = '015'; // 竞赛系统 + +export const userTrainingPlatform = '016'; // 实训系统 +// export const refereePlatform = '017'; // 裁判系统 -/** - * constantRoutes - * a base page that does not have permission requirements - * all roles can be accessed - */ export const constantRoutes = [ // 实训平台登录 { @@ -227,8 +223,6 @@ export const constantRoutes = [ { // 竞赛系统报名 path: '/jsxtApply', component: JsxtApply, - meta: { - }, hidden: true }, { @@ -251,6 +245,87 @@ GenerateRouteProjectList.forEach(item => { hidden: true }); }); +// 公共路由不需要过滤 直接可以访问 +export const publicAsyncRoute = [ + { // 全屏战场图 + path: '/display/:mode', + component: Display, + hidden: true + }, + { + path: '/displayNew/:mode', + component: DisplayNew, + hidden: true + }, + { + path: '/design/display/:mode', + component: DesignDisplay, + hidden: true + }, + { + path: '/design/displayNew/:mode', + component: DesignDisplayNew, + hidden: true + }, + { // 剧本编辑 战场图 + path: '/scriptDisplay/:mode', + component: ScriptDisplay, + hidden: true + }, + { // 剧本编辑 战场图 + path: '/scriptDisplayNew/:mode', + component: ScriptDisplayNew, + hidden: true + }, + { + path: '/displayBigScreen/:mapId', + component: BigScreen, + hidden: true + }, + { // 综合演练室 + path: '/trainroom', + component: TrainRoom, + hidden: true + }, + { + path: '/jointTraining', + component: JointTraining, + hidden: true + }, + { + path: '/jointTrainingNew', + component: JointTrainingNew, + hidden: true + }, + { + path: '/jlmap3d', + component: Jlmap3d, + hidden: true + }, + { // 运行图编辑 + path: '/plan/usertool', + component: PlanMonitorEditUserTool, + hidden: true + }, + { // 运行图编辑 + path: '/plan/tool', + component: PlanMonitorEditTool, + hidden: true + }, + { + path: '/displayIscs/system', + component: IscsSystem, + hidden: true, + children: [ + { + path: 'config/:mode', + component: IscsConfig, + hidden: true + } + ] + } +]; +// 城市轨道项目 export const asyncRouter = [ { // 公共地图 path: '/design', @@ -365,136 +440,12 @@ export const asyncRouter = [ } ] }, - // { // 个人地图 - // path: '/design/userlist', - // redirect: '/design/userlist/home', - // component: Layout, - // meta: { - // roles: [admin] - // }, - // children: [ - // { - // path: '', - // redirect: '/design/userlist/home', - // component: DesignPlatformUser, - // meta: { - // i18n: 'router.designUserPage', - // icon: 'design' - // }, - // children: [ - // { - // path: 'home', - // component: DesignPlatformHome, - // meta: { - // } - // }, - // { // 地图 绘制 - // path: 'map/draw/:mapId/:view', - // component: Mapedit, - // hidden: true - // }, - // { // 运行图设计 - // path: 'runPlan/detail/:mapId', - // component: PlanMonitorDetail, - // hidden: true - // } - // ] - // } - // ] - // }, - { // 全屏战场图 - path: '/display/:mode', - component: Display, - meta: { - }, - hidden: true - }, - { - path: '/displayNew/:mode', - component: DisplayNew, - meta: { - }, - hidden: true - }, - { - path: '/design/display/:mode', - component: DesignDisplay, - meta: { - }, - hidden: true - }, - { - path: '/design/displayNew/:mode', - component: DesignDisplayNew, - meta: { - }, - hidden: true - }, - { // 剧本编辑 战场图 - path: '/scriptDisplay/:mode', - component: ScriptDisplay, - meta: { - }, - hidden: true - }, - { // 剧本编辑 战场图 - path: '/scriptDisplayNew/:mode', - component: ScriptDisplayNew, - meta: { - }, - hidden: true - }, - { - path: '/displayIscs/system', - component: IscsSystem, - meta: { - }, - hidden: true, - children: [ - { - path: 'config/:mode', - component: IscsConfig, - hidden: true - } - ] - }, - { - path: '/displayBigScreen/:mapId', - component: BigScreen, - meta: { - }, - hidden: true - }, - { // 综合演练室 - path: '/trainroom', - component: TrainRoom, - meta: { - }, - hidden: true - }, - { - path: '/jointTraining', - component: JointTraining, - hidden: true - }, - { - path: '/jointTrainingNew', - component: JointTrainingNew, - hidden: true - }, - { - path: '/jlmap3d', - component: Jlmap3d, - meta: { - }, - hidden: true - }, { // 实训平台 path: '/trainingPlatform', component: Layout, hidden: true, meta: { - roles: [admin, userSimulation, user, userTrainingPlatform] + roles: [admin, user, userTrainingPlatform] }, children: [ { @@ -562,20 +513,6 @@ export const asyncRouter = [ } ] }, - { // 运行图编辑 - path: '/plan/usertool', - component: PlanMonitorEditUserTool, - meta: { - }, - hidden: true - }, - { // 运行图编辑 - path: '/plan/tool', - component: PlanMonitorEditTool, - meta: { - }, - hidden: true - }, { // 发布内容管理 path: '/publish', component: Layout, @@ -975,8 +912,28 @@ export const asyncRouter = [ ] } ] + }, + { + path: '/design/race', + redirect: '/design/race/manage', + component: Layout, + meta: { + i18n: 'route.raceManage', + roles: [admin] + }, + children: [ + { + path: 'manage', + component: RaceManage, + meta: { + i18n: 'router.raceManage', + icon: 'design' + } + } + ] } ]; + export const projectRoute = { designgzb: [ { @@ -1001,48 +958,43 @@ export const projectRoute = { } ] }; +// 竞赛系统 export const JSXT = [ { path: '/jsxt', redirect: '/jsxt/home', component: Layout, meta: { - i18n: 'router.competitionManage', - roles: [user, userTrainingPlatform, referee] + roles: [user, admin, userTrainingPlatform] }, - hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('jsxt') && !window.document.location.pathname.includes('jsxt') : !window.document.location.pathname.includes('jsxt'), + hidden: true, children: [ { path: '', redirect: '/jsxt/home', component: CompetitionManage, meta: { - i18n: 'router.competitionManage', - icon: 'design' }, children: [ { path: 'home', component: CompetitionHome, - meta: { - hidden: true - } + hidden: true }, // { // path: 'theory/:id', // component: theoryManage, - // meta: { - // hidden: true - // } + // hidden: true // }, { path: 'examDetail', component: CompetitionDetail, - meta: { - il8n: 'router.examDetail', - icon: 'design', - hidden: true - } + hidden: true + }, + { // 考试结果 + path: 'result', + component: JsxtExamResult, + hidden: true } ] } @@ -1051,38 +1003,18 @@ export const JSXT = [ { path: '/jsxt/theory/detail/:id', component: Refereedetail, - meta: { - hidden: true - } + hidden: true }, + // 裁判系统 { path: '/refereeJsxt', + redirect: '/refereeJsxt/home', component: Layout, meta: { i18n: 'router.homeJsxt', - roles: [user, referee, refereePlatform] + roles: [user, admin] }, - 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] - }, - hidden: getSessionStorage('project') ? !getSessionStorage('project').endsWith('refereeJsxt') && !window.document.location.pathname.includes('refereeJsxt') : !window.document.location.pathname.includes('refereeJsxt'), + hidden: true, children: [ { path: 'home', @@ -1104,12 +1036,6 @@ const createRouter = () => new Router({ const router = createRouter(); -router.beforeEach((to, from, next) => { - const project = getSessionStorage('project'); - document.title = loginInfo[project || 'login'].browserTitle || loginInfo[project || 'login'].title; - next(); -}); - // 兼容 vue-router在3.1.0版本以上的路由跳转使用的是 promise 的方式 const originalPush = Router.prototype.push; Router.prototype.push = function push(location) { diff --git a/src/router/index_HYD.js b/src/router/index_HYD.js index 961f28afe..d8ef8743a 100644 --- a/src/router/index_HYD.js +++ b/src/router/index_HYD.js @@ -108,8 +108,8 @@ const RunPlanApproval = () => import('@/views/approval/runPlan/index'); const DeviceManage = () => import('@/views/system/deviceManage/index'); const MapSort = () => import('@/views/publish/publishMap/mapSort'); -import { loginInfo } from '@/scripts/ProjectConfig'; -import { getSessionStorage } from '@/utils/auth'; +// import { loginInfo } from '@/scripts/ProjectConfig'; +// import { getSessionStorage } from '@/utils/auth'; /** * Note: sub-menu only appear when route children.length >= 1 @@ -136,13 +136,14 @@ export const lessonCreater = '03'; // 课程创建权限 export const admin = '04'; // 管理员 export const superAdmin = '05'; // 超级管理员 -export const userExam = '011'; // 考试系统 -export const userLesson = '012'; // 教学系统 -export const userSimulation = '013'; // 仿真系统 -export const userScreen = '014'; // 大屏系统 -export const userPlan = '015'; // 计划系统 -export const userTrainingPlatform = '016'; // 实训平台 -// const isDev = process.env.NODE_ENV === 'development'; +export const projectTrain = '011'; // 城市轨道项目 +export const projectXian = '012'; // 西安地铁项目 +export const projectXty = '013'; // 西铁院 +export const projectGzzb = '014'; // 贵州装备 +export const projectJsxt = '015'; // 竞赛系统 + +export const userTrainingPlatform = '016'; // 实训系统 +export const refereePlatform = '017'; // 裁判系统 /** * constantRoutes @@ -200,7 +201,77 @@ export const constantRoutes = [ }, { path: '*', redirect: '/404', hidden: true } ]; +// 公共路由不需要过滤 直接可以访问 +export const publicAsyncRoute = [ + { // 全屏战场图 + path: '/display/:mode', + component: Display, + hidden: true + }, + { + path: '/displayNew/:mode', + component: DisplayNew, + hidden: true + }, + { + path: '/design/display/:mode', + component: DesignDisplay, + hidden: true + }, + { // 剧本编辑 战场图 + path: '/scriptDisplay/:mode', + component: ScriptDisplay, + hidden: true + }, + { // 剧本编辑 战场图 + path: '/scriptDisplayNew/:mode', + component: ScriptDisplayNew, + hidden: true + }, + { // 综合演练室 + path: '/trainroom', + component: TrainRoom, + hidden: true + }, + { + path: '/jointTraining', + component: JointTraining, + hidden: true + }, + { + path: '/jointTrainingNew', + component: JointTrainingNew, + hidden: true + }, + { + path: '/jlmap3d', + component: Jlmap3d, + hidden: true + }, + { // 运行图编辑 + path: '/plan/usertool', + component: PlanMonitorEditUserTool, + hidden: true + }, + { // 运行图编辑 + path: '/plan/tool', + component: PlanMonitorEditTool, + hidden: true + }, + { + path: '/displayIscs/system', + component: IscsSystem, + hidden: true, + children: [ + { + path: 'config/:mode', + component: IscsConfig, + hidden: true + } + ] + } +]; export const asyncRouter = [ { // 公共地图 path: '/design', @@ -305,85 +376,12 @@ export const asyncRouter = [ } ] }, - { // 全屏战场图 - path: '/display/:mode', - component: Display, - meta: { - }, - hidden: true - }, - { - path: '/displayNew/:mode', - component: DisplayNew, - meta: { - }, - hidden: true - }, - { - path: '/design/display/:mode', - component: DesignDisplay, - meta: { - }, - hidden: true - }, - { // 剧本编辑 战场图 - path: '/scriptDisplay/:mode', - component: ScriptDisplay, - meta: { - }, - hidden: true - }, - { // 剧本编辑 战场图 - path: '/scriptDisplayNew/:mode', - component: ScriptDisplayNew, - meta: { - }, - hidden: true - }, - { - path: '/displayIscs/system', - component: IscsSystem, - meta: { - }, - hidden: true, - children: [ - { - path: 'config/:mode', - component: IscsConfig, - hidden: true - } - ] - }, - { // 综合演练室 - path: '/trainroom', - component: TrainRoom, - meta: { - }, - hidden: true - }, - { - path: '/jointTraining', - component: JointTraining, - hidden: true - }, - { - path: '/jointTrainingNew', - component: JointTrainingNew, - hidden: true - }, - { - path: '/jlmap3d', - component: Jlmap3d, - meta: { - }, - hidden: true - }, { // 实训平台 path: '/trainingPlatform', component: Layout, hidden: true, meta: { - roles: [admin, userSimulation, user, userTrainingPlatform] + roles: [admin, user, userTrainingPlatform] }, children: [ { @@ -451,20 +449,6 @@ export const asyncRouter = [ } ] }, - { // 运行图编辑 - path: '/plan/usertool', - component: PlanMonitorEditUserTool, - meta: { - }, - hidden: true - }, - { // 运行图编辑 - path: '/plan/tool', - component: PlanMonitorEditTool, - meta: { - }, - hidden: true - }, { // 发布内容管理 path: '/publish', component: Layout, @@ -764,11 +748,11 @@ const createRouter = () => new VueRouter({ const router = createRouter(); -router.beforeEach((to, from, next) => { - const project = getSessionStorage('project'); - document.title = loginInfo[project || 'login'].title; - next(); -}); +// router.beforeEach((to, from, next) => { +// const project = getSessionStorage('project'); +// document.title = loginInfo[project || 'login'].title; +// next(); +// }); // 兼容 vue-router在3.1.0版本以上的路由跳转使用的是 promise 的方式 const originalPush = VueRouter.prototype.push; diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 0e5598c55..88f8ca94d 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -37,8 +37,7 @@ export default { { label: '课程生成者', value: '03' }, { label: '系统管理员', value: '04' }, { label: '超级管理员', value: '05' }, - { label: '销售用户', value: '06' }, - { label: '裁判员', value: '07' } + { label: '销售用户', value: '06' } ], examResultList: [ diff --git a/src/scripts/ProjectConfig.js b/src/scripts/ProjectConfig.js index c39a169a0..0c952a264 100644 --- a/src/scripts/ProjectConfig.js +++ b/src/scripts/ProjectConfig.js @@ -104,44 +104,64 @@ export const goOtherPlatformMenu = { // 导航栏快速切换平台 designxadt: '/xadt/login' }; export const PermissionParam = { // 路径权限处理所需参数配置(跳转白名单&路径正则匹配&clientId) + hyd: { + systemType: '011' + }, + designhyd: { + systemType: '011' + }, + login: { + systemType: '011' + }, + design: { + systemType: '011' + }, designxty: { whitePage: '/designxty/login', reg: /^\/designxty/, + systemType: '013', clientId: LoginParams.Design.clientId }, designgzb: { whitePage: '/designgzb/login', reg: /^\/designgzb/, + systemType: '014', clientId: LoginParams.Design.clientId }, designxadt: { whitePage: '/designxadt/login', reg: /^\/designxadt/, + systemType: '012', clientId: LoginParams.Design.clientId }, xty: { whitePage: '/xty/login', reg: /^\/xty/, + systemType: '013', clientId: null }, gzb: { whitePage: '/gzb/login', reg: /^\/gzb/, + systemType: '014', clientId: null }, xadt: { whitePage: '/xadt/login', reg: /^\/xadt/, + systemType: '012', clientId: null }, jsxt: { whitePage: '/jsxt/login', reg: /^\/jsxt/, + systemType: '015', clientId: null }, refereeJsxt: { whitePage: '/refereeJsxt/login', reg: /^\/refereeJsxt/, + systemType: '015', clientId: LoginParams.Design.clientId } }; diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 15d9abdbe..dc911ae3b 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -135,7 +135,9 @@ export default { /** 确认计轴有效 */ CMD_SECTION_COMFIRMATION_AXLE:{value:'Section_Confirm_Axis_Valid', label: '确认计轴有效'}, /** 详情 */ - CMD_SECTION_DETAILS: {value: 'Section_Details', label: '属性'} + CMD_SECTION_DETAILS: {value: 'Section_Details', label: '属性'}, + /** 新建计划列车 */ + CMD_Train_Init_Plan: {value: 'Train_Init_Plan', label: '新建计划列车'} }, // 站台 @@ -196,7 +198,11 @@ export default { /** 取消引导总锁 */ CMD_STATION_CANCEL_MASTER_GUIDE_LOCK: {value: 'Station_Cancel_Master_Guide_Lock', label: '取消引导总锁'}, /** 封锁车站所有信号机 */ - CMD_STATION_CANCEL_MASTER_GUIDE: {value: 'Station_Cancel_Master_Guide_Lock', label: '封锁集中站信号'} + CMD_STATION_CANCEL_MASTER_GUIDE: {value: 'Station_Cancel_Master_Guide_Lock', label: '封锁集中站信号'}, + /** 上电解锁 */ + CMD_STATION_POWER_ON_UNLOCK: {value: ' Station_Power_On_Unlock', label: '上电解锁'}, + /** 执行关键操作测试 */ + CMD_STATION_KEY_OPERATION_TEST: {value: 'Station_Key_Operation_Test', label: '执行关键操作测试'} }, // 列车 @@ -215,8 +221,30 @@ export default { CMD_TRAIN_DRIVE_BY_GUIDE_SIGNAL: {value:'Train_Drive_By_Guide_Signal', label: '引导信号行车'} }, TrainWindow: { - /** 新建计划列车 */ - CMD_Train_Init_Plan: {value: 'Train_Init_Plan', label: '新建计划列车'} + /** 修改列车识别号 */ + CMD_TRAIN_UPDATE_TYPE: {value: 'Train_Update_Type', label: '修改列车识别号'}, + /** 设置车组号 */ + CMD_TRAIN_ADD_TRAIN_TRACE: {value: 'Train_Add_Train_Trace', label: '设置车组号'}, + /** 删除车组号 */ + CMD_TRAIN_REMOVE_TRAIN_TRACE: {value: 'Train_Remove_Train_Trace', label: '删除车组号'}, + /** 移动车组号 */ + CMD_TRAIN_MOVE_TRAIN_TRACE: {value: 'Train_Move_Train_Trace', label: '移动车组号'}, + /** 设计划车 */ + CMD_TRAIN_SET_PLAN: {value: 'Train_Set_Plan', label: '设计划车'}, + /** 设头码车 */ + CMD_TRAIN_SET_HEAD: {value: 'Train_Set_Head', label: '设头码车'}, + /** 设人工车 */ + CMD_TRAIN_SET_MANUAL: {value: 'Train_Set_Manual', label: '设人工车'}, + /** 设乘务组号 */ + CMD_TRAIN_SET_CREW_NUMBER: {value:'Train_Set_Crew_Number', label: '设乘务组号'}, + /** 标记ATP切除 */ + CMD_TRAIN_TAG_ATP_CUT: {value: 'Train_Tag_Atp_Cut', label: '标记ATP切除'}, + /** 标记ATP恢复 */ + CMD_TRAIN_TAG_ATP_RECOVER: {value: 'Train_Tag_Atp_Recover', label: '标记ATP恢复'}, + /** 放行冲突列车 */ + CMD_TRAIN_ALLOW_PASS: {value:'Train_Allow_Pass', label: '放行冲突列车'}, + /** 列车信息 */ + CMD_TRAIN_INFO: {value: 'Train_Info', label:'列车信息'} }, Fault: { CMD_SET_FAULT: {value: 'Set_Fault', label: '设置故障'}, diff --git a/src/scripts/cmdPlugin/CommandHandler.js b/src/scripts/cmdPlugin/CommandHandler.js index 726d0788b..3846fd5b6 100644 --- a/src/scripts/cmdPlugin/CommandHandler.js +++ b/src/scripts/cmdPlugin/CommandHandler.js @@ -17,7 +17,8 @@ class CommandHandle { Local: {}, Common: { Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, - Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]} + Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, + Train_Init_Plan: {operate: 'Train_Init_Plan', paramList: [{name: 'sectionCode'}, {name: 'serviceNumber'}, {name: 'tripNumber'}]} } }; (list || []).forEach(definition => { diff --git a/src/scripts/cmdPlugin/Config.js b/src/scripts/cmdPlugin/Config.js index 868caf9ec..7d74e9352 100644 --- a/src/scripts/cmdPlugin/Config.js +++ b/src/scripts/cmdPlugin/Config.js @@ -36,7 +36,7 @@ export const deviceFaultType = { {label: '主灯丝熔断故障', value: 'MAIN_FILAMENT_BROKEN'} ], Switch: [ - {label: '挤岔', value: 'SPLIT'} + {label: '失表', value: 'SPLIT'} ], StationStand: [ {label: '屏蔽门无法关闭', value: 'FAULT'} diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index d25026f94..69bedb83b 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -1954,8 +1954,18 @@ export const OperationEvent = { operation: '70e4', domId: '_Tips-Train-createPlanTrain-ChangeTripNumber' } + }, + // 查看列车详细信息 + trainDetailInfo: { + menu: { + operation: '70f', + domId: '_Tip-Train_trainDetailInfo-Menu' + }, + confirm: { + operation: '70f1', + domId: '_Tips-Train-trainDetailInfo-Confirm' + } } - }, // 取消全线临时限速 diff --git a/src/store/modules/map.js b/src/store/modules/map.js index eb5687328..8de77f1b7 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -207,7 +207,13 @@ const map = { trainListUpdate:0, // 列车列表更新标识, runPlanStatus:false, // 是否正处于按计划行车 showCentralizedStationCode: '', // 现地分集中站显示(集中站code) - showCentralizedStationNum: 0 // 现地分集中站显示判断 + showCentralizedStationNum: 0, // 现地分集中站显示判断 + overlapList: [], // 延续保护list + overlapData: {}, // 延续保护数据 + holdStandList: [], // 扣车站台列表 + holdStatus: false, // 是否有扣车状态 + jumpStandList: [], // 跳停站台列表 + jumpStatus: false // 是否有跳停状态 }, getters: { @@ -226,6 +232,9 @@ const map = { routeData: (state) => { return state.routeData; }, + overlapData: (state) => { + return state.overlapData; + }, autoReentryData: (state) => { return state.autoReentryData; }, @@ -716,6 +725,12 @@ const map = { }); state.routeList = routeDataList; }, + setOverlapData: (state, overlapList) => { + overlapList.forEach(data => { + state.overlapData[data.code] = data; + }); + state.overlapList = overlapList; + }, setAutoReentryData: (state, autoReentryList) => { autoReentryList.forEach(data => { state.autoReentryData[data.code] = data; @@ -740,6 +755,22 @@ const map = { updateTrainState:(state, status) =>{ state.map.trainList[parseInt(status.code) - 1] = deepAssign(state.map.trainList[parseInt(status.code) - 1] || {}, status); }, + updateStationStand: (state, status) => { + const holdIndex = state.holdStandList.indexOf(status.code); + const jumpIndex = state.jumpStandList.indexOf(status.code); + if ((status.stationHoldTrain || status.centerHoldTrain) && holdIndex < 0) { + state.holdStandList.push(status.code); + } else if (!(status.stationHoldTrain && status.centerHoldTrain) && holdIndex > -1) { + state.holdStandList.splice(holdIndex, 1); + } + state.holdStatus = state.holdStandList.length > 0; + if ((status.assignSkip || status.allSkip) && jumpIndex < 0) { + state.jumpStandList.push(status.code); + } else if (!(status.assignSkip && status.allSkip) && jumpIndex > -1) { + state.jumpStandList.splice(jumpIndex, 1); + } + state.jumpStatus = state.jumpStandList.length > 0; + }, setMapVersion:(state, version) => { state.version = version; }, @@ -790,6 +821,9 @@ const map = { setRouteData: ({ commit }, routeData) => { // 设置进路数据 commit('setRouteData', routeData); }, + setOverlapData: ({ commit }, overlapData) => { + commit('setOverlapData', overlapData); + }, setAutoReentryData: ({ commit }, autoReentryData) => { commit('setAutoReentryData', autoReentryData); }, @@ -805,6 +839,9 @@ const map = { updateTrainState:({ commit }, status) => { commit('updateTrainState', status); }, + updateStationStand: ({ commit }, status) => { + commit('updateStationStand', status); + }, getRouteDataListByCode: ({ state, commit }, code) => { // 获取进路数据 return new Promise((resolve) => { const list = []; diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 8f50c3d05..349af31c1 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,46 +1,23 @@ -import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin, userTrainingPlatform, JSXT, refereePlatform, projectRoute } from '@/router/index_APP_TARGET'; -import { PermissionType } from '@/utils/PermissionType'; -import { UrlConfig } from '@/scripts/ConstDic'; +import { publicAsyncRoute, asyncRouter, constantRoutes, user, projectTrain, projectXian, projectXty, projectGzzb, projectJsxt, superAdmin, admin, userTrainingPlatform, JSXT, projectRoute } from '@/router/index_APP_TARGET'; +import { PermissionParam } from '@/scripts/ProjectConfig'; import { getSessionStorage } from '@/utils/auth'; -function setHonePagePath(route, roles) { - if (roles && roles.length === 2 && roles.indexOf(user) >= 0 && (route.path === '/' || route.path === 'dashboard')) { - if (roles.indexOf(userLesson) >= 0) { - route.redirect = `${UrlConfig.teach.home}`; - } else if (roles.indexOf(userExam) >= 0) { - route.redirect = `${UrlConfig.exam.home}`; - } else if (roles.indexOf(userSimulation) >= 0) { - route.redirect = `${UrlConfig.demonstration.home}`; - } else if (roles.indexOf(userScreen) >= 0) { - route.redirect = `${UrlConfig.dp.home}`; - } else if (roles.indexOf(userPlan) >= 0) { - route.redirect = `${UrlConfig.plan.home}`; - } - } -} - /** - * 通过meta.role判断是否与当前用户权限匹配 + * 通过meta.role判断是否与当前用户权限匹配及子系统生成 * @param roles * @param route */ function hasPermission(roles, route, parentsRoles) { - setHonePagePath(route, roles); if (!getSessionStorage('project')) { return false; } if (route.meta && route.meta.roles) { // 如果存在本级路由,则使用自己的roles过滤 - if (getSessionStorage('project').startsWith('design')) { + if (getSessionStorage('project').startsWith('design') || getSessionStorage('project').startsWith('refereeJsxt')) { 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; - }); + roles = roles.filter((role) => route.meta.roles.indexOf(role) >= 0); return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) >= 0; } } else if (parentsRoles) { @@ -53,22 +30,23 @@ function hasPermission(roles, route, parentsRoles) { } /** - * 根据roles和系统类型重新设置权限列表 - * @param roles - * @param type + * 根据项目重置 路由 + * @param systemType 项目类型 */ -function convertRouterRoles({ roles, permissionType }) { - if (roles && roles.indexOf(user) >= 0) { - switch (permissionType) { - case PermissionType.LESSON: roles.push(userLesson); break; - case PermissionType.EXAM: roles.push(userExam); break; - case PermissionType.SIMULATION: roles.push(userSimulation); break; - case PermissionType.SCREEN: roles.push(userScreen); break; - case PermissionType.PLAN: roles.push(userPlan); break; - } +function resetAsyncRouter({ systemType }) { + let list = publicAsyncRoute; + if (systemType == projectTrain) { + list = [...list, ...asyncRouter]; + } else if (systemType == projectXian) { + list = [...list, ...asyncRouter]; + } else if (systemType == projectXty) { + list = [...list, ...asyncRouter]; + } else if (systemType == projectGzzb) { + list = [...list, ...asyncRouter, ...projectRoute.designgzb]; + } else if (systemType == projectJsxt) { + list = [...list, ...JSXT]; } - - return { roles }; + return list; } /** @@ -78,9 +56,6 @@ function convertRouterRoles({ roles, permissionType }) { */ function filterAsyncRouter(asyncRouter, roles, parentsRoles) { return asyncRouter.filter(route => { - if (route.name === '大屏系统' && roles.indexOf(admin) == -1 && roles.indexOf(userScreen) == -1) { - route.hidden = true; - } if (hasPermission(roles, route, parentsRoles)) { if (route.children && route.children.length) { route.children = filterAsyncRouter(route.children, roles, route.meta ? route.meta.roles : undefined); @@ -106,18 +81,16 @@ const permission = { // 生成其他权限路由 GenerateRoutes({ commit }, data) { return new Promise(resolve => { - const { roles } = convertRouterRoles(data); - if (roles.indexOf(superAdmin) >= 0 && roles.indexOf(admin) < 0) { + const { roles } = data; + if (roles.includes(superAdmin) && !roles.includes(admin)) { // 只拥有超级管理员 没有管理员权限 roles.push(admin); } - const proRoute = projectRoute[getSessionStorage('project')]; - let routeArr = []; - if (proRoute && proRoute.constructor === Array) { - routeArr = [...asyncRouter, ...JSXT, ...proRoute]; - } else { - routeArr = [...asyncRouter, ...JSXT]; + if (roles.includes(admin) && !roles.includes(user)) { // 只拥有管理员 不拥有普通用户权限 则增加用户权限 + roles.push(user); } - const accessedRouters = filterAsyncRouter(routeArr, roles); + const routeList = resetAsyncRouter(PermissionParam[getSessionStorage('project') || 'login']); + + const accessedRouters = filterAsyncRouter(routeList, roles); accessedRouters.forEach(route => { if (route.children && route.children.length == 0) { route.hidden = true; diff --git a/src/store/modules/socket.js b/src/store/modules/socket.js index 5cb0d22e5..470488e82 100644 --- a/src/store/modules/socket.js +++ b/src/store/modules/socket.js @@ -29,6 +29,12 @@ function handle(state, data) { case 'Simulation_Script_Tip': // 仿真-聊天界面用户进出仿真消息 handleSimulationScriptTipInfo(state, msg); // 用户进出仿真消息 break; + case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息 + state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息 + break; + case 'Simulation_Over': // 用户退出仿真推送消息 + state.simulationOver++; // 用户退出仿真推送消息 + break; case 'Simulation_Script_Finish': // 剧本执行完成推送消息 state.scriptFinish++; // 剧本执行完成推送消息 break; @@ -199,11 +205,13 @@ const socket = { simulationRoleList:[], // 设置仿真的聊天角色信息 simulationScriptTip:{}, // 剧本推送提示信息 scriptFinish:0, // 剧本执行完成提示信息 + competitionStart:0, // 竞赛裁判系统裁判开始考试推送消息 jointRoomPrepare: false, // 演练房间准备状态 equipmentStatus: [], // 仿真-设备状态消息 trainStationList: [], // 仿真-列车实际到发车站消息 simulationError: '', // 仿真-异常消息 simulationStart: '', // 仿真-开始消息 + simulationOver:0, // 退出仿真推送消息 simulationReset: '', // 仿真-异常消息 simulationText: {}, // 仿真-用户交互消息(聊天/命令) // coversitionList:{}, // 历史仿真-用户消息列表 diff --git a/src/utils/loaddata.js b/src/utils/loaddata.js index 08d695429..d9e160dae 100644 --- a/src/utils/loaddata.js +++ b/src/utils/loaddata.js @@ -48,9 +48,11 @@ export function loadNewMapDataByGroup(group) { }); }); const routeData = resp.data.logicDataNew.routeList; // 设置进路数据 + const overlapData = resp.data.logicDataNew.overlapList; const autoReentryData = resp.data.logicDataNew.autoReentryList; // 自动折返数据 const signalApproachSectionData = resp.data.logicDataNew.signalApproachSectionList; // 信号机接近区段数据 store.dispatch('map/setRouteData', routeData); + store.dispatch('map/setOverlapData', overlapData); store.dispatch('map/setAutoReentryData', autoReentryData); store.dispatch('map/setSignalApproachSectionData', signalApproachSectionData); const mapConfig = resp.data.configVO; diff --git a/src/views/competitionManage/create.vue b/src/views/competitionManage/create.vue new file mode 100644 index 000000000..0250f0d9f --- /dev/null +++ b/src/views/competitionManage/create.vue @@ -0,0 +1,165 @@ + + + diff --git a/src/views/competitionManage/index.vue b/src/views/competitionManage/index.vue new file mode 100644 index 000000000..7b013f3eb --- /dev/null +++ b/src/views/competitionManage/index.vue @@ -0,0 +1,180 @@ + + + + diff --git a/src/views/components/StatusIcon/statusIcon.vue b/src/views/components/StatusIcon/statusIcon.vue new file mode 100644 index 000000000..a61e2e20b --- /dev/null +++ b/src/views/components/StatusIcon/statusIcon.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue index 1ef7878f2..efb22487e 100644 --- a/src/views/demonstration/detail/index.vue +++ b/src/views/demonstration/detail/index.vue @@ -155,6 +155,7 @@ export default { } catch (error) { if (error.code == 30001) { const url = localStore.get('orignalTrainingPlatformRoute' + this.$store.state.user.id); + localStore.remove(); if (url) { this.$router.push(url); } diff --git a/src/views/iscs/iscsSystem/config/pis/emergencyRelease.vue b/src/views/iscs/iscsSystem/config/pis/emergencyRelease.vue index a1a15a367..9bb0c83cb 100644 --- a/src/views/iscs/iscsSystem/config/pis/emergencyRelease.vue +++ b/src/views/iscs/iscsSystem/config/pis/emergencyRelease.vue @@ -1,6 +1,8 @@ + diff --git a/src/views/iscs/iscsSystem/config/pis/lcdControl.vue b/src/views/iscs/iscsSystem/config/pis/lcdControl.vue index 64cc1e513..68b60815b 100644 --- a/src/views/iscs/iscsSystem/config/pis/lcdControl.vue +++ b/src/views/iscs/iscsSystem/config/pis/lcdControl.vue @@ -8,6 +8,7 @@
开启LCD屏 +
关闭LCD屏
确定
diff --git a/src/views/iscs/iscsSystem/config/pis/timePreview.vue b/src/views/iscs/iscsSystem/config/pis/timePreview.vue index 2be15008d..441926965 100644 --- a/src/views/iscs/iscsSystem/config/pis/timePreview.vue +++ b/src/views/iscs/iscsSystem/config/pis/timePreview.vue @@ -77,8 +77,8 @@ export default { /deep/{ .time_preview{padding:20px;} .preview_header_text{margin-top:10px;text-align: center;color: #9af1ec;font-size: 18px;padding-bottom: 10px;} - .time_preview_content{width:100%;height:500px;border-top: 2px solid #8c8a89;overflow-y: auto;margin-top:10px;display:flex;border-left: 2px solid #8c8a89;border-right: 2px solid #fff;border-bottom: 2px solid #fff;} - .time_preview_footer{width:650px;margin-top:20px;border-top: 2px solid #8c8a89; + .time_preview_content{width:94%;height:500px;border-top: 2px solid #8c8a89;overflow-y: auto;margin-left:3%;margin-top:10px;display:flex;border-left: 2px solid #8c8a89;border-right: 2px solid #fff;border-bottom: 2px solid #fff;} + .time_preview_footer{width:650px;margin-top:20px;border-top: 2px solid #8c8a89;margin-left:3%; border-left: 2px solid #8c8a89; border-right: 2px solid #fff; border-bottom: 2px solid #fff;background:#aabbbb;} diff --git a/src/views/jlmap3d/device/jl3ddevice.vue b/src/views/jlmap3d/device/jl3ddevice.vue index 7456ee6b0..1be06fe87 100644 --- a/src/views/jlmap3d/device/jl3ddevice.vue +++ b/src/views/jlmap3d/device/jl3ddevice.vue @@ -102,7 +102,10 @@ computed: { code() { return this.$route.query.code; - } + }, + mapId() { + return this.$route.query.mapId; + }, }, mounted() { window.updatemenulist = this.updatemenulist; @@ -133,11 +136,11 @@ initolddata: function (group,header) { // let mapdata = this.$store.state.socket.device; let dom = document.getElementById('jl3d'); - this.jl3d = new Jl3ddevice(dom,group,header); + this.jl3d = new Jl3ddevice(dom,group,header,this.mapId); }, initnewdata: function (group,header){ let dom = document.getElementById('jl3d'); - this.jl3d = new Jl3ddeviceNew(dom,group,header); + this.jl3d = new Jl3ddeviceNew(dom,group,header,this.mapId); }, close3ddeviceview: function(){ this.$emit('closedevice3dview'); diff --git a/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue b/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue index 7392fc72b..07045e547 100644 --- a/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue +++ b/src/views/jlmap3d/drive/drivecontrol/drivecontrol.vue @@ -2,12 +2,14 @@
- + + :value="item.value" + :disabled="item.disabled" + >
@@ -81,7 +83,7 @@ import axios from 'axios'; groupnum:"", userrole:'', drawWay:'', - + nowdrive:null, } }, watch: { @@ -95,29 +97,36 @@ import axios from 'axios'; computed: { group() { return this.$route.query.group; - } + }, + userId() { + return this.$store.state.user ? this.$store.state.user.id : ''; + }, }, async mounted() { // this.teststomp = new StompClient(); - + this.updatetrainlist(); }, beforeDestroy() { }, methods: { currentsel(selVal){ - this.selVal = selVal; - this.dialogVisible = true; + let oldgroupnum = this.groupnum; this.groupnum = selVal; - for(let i=0;i { + this.selVal = selVal; + this.dialogVisible = true; + // this.groupnum = selVal; + for(let i=0;i { - - console.log(error); + this.groupnum = oldgroupnum; + this.selVal = oldgroupnum; + this.$emit('warningmsg',error.message); + this.value = this.nowdrive; }); }, clickselect(e){ @@ -125,26 +134,38 @@ import axios from 'axios'; getSimulationMemberNew(this.group).then(netdata => { this.userrole = netdata.data.role; }); - getSimulationTrainlistNew(this.group).then(netdata => { - this.options = []; - this.trainlist = netdata.data; - for(let i=0;i { + this.options = []; + this.trainlist = netdata.data; + + for(let i=0;i diff --git a/src/views/jlmap3d/drive/jl3ddrive.vue b/src/views/jlmap3d/drive/jl3ddrive.vue index 427ef654a..bbf4807aa 100644 --- a/src/views/jlmap3d/drive/jl3ddrive.vue +++ b/src/views/jlmap3d/drive/jl3ddrive.vue @@ -33,7 +33,7 @@ - +
@@ -265,6 +265,15 @@ export default { updatestatus(newdata){ this.trainnum = newdata.groupNumber; this.$refs.mmiui.updatetrainstatus(newdata); + }, + warningmsg(nowmsg){ + this.controlmsg = nowmsg; + this.msgshow = true; + setTimeout(this.warningmsgoff,3000); + }, + warningmsgoff(){ + this.msgshow = false; + }, } @@ -377,7 +386,7 @@ export default { position:absolute; } .msgtext{ - width:400px; + width:100%; height:50px; border-radius:5px; background:#C0C0C0; diff --git a/src/views/jlmap3d/maintainer/component/devicefaultlist.vue b/src/views/jlmap3d/maintainer/component/devicefaultlist.vue new file mode 100644 index 000000000..43a8092b0 --- /dev/null +++ b/src/views/jlmap3d/maintainer/component/devicefaultlist.vue @@ -0,0 +1,169 @@ + + + + + + diff --git a/src/views/jlmap3d/maintainer/component/faultdevice.vue b/src/views/jlmap3d/maintainer/component/faultdevice.vue new file mode 100644 index 000000000..6416d4580 --- /dev/null +++ b/src/views/jlmap3d/maintainer/component/faultdevice.vue @@ -0,0 +1,257 @@ + + + diff --git a/src/views/jlmap3d/maintainer/jl3dmaintainer.vue b/src/views/jlmap3d/maintainer/jl3dmaintainer.vue index ac05aefbd..c7f95e942 100644 --- a/src/views/jlmap3d/maintainer/jl3dmaintainer.vue +++ b/src/views/jlmap3d/maintainer/jl3dmaintainer.vue @@ -10,17 +10,28 @@
- - - + + +
+
+
+ {{controlmsg}} +
+
+ @@ -37,9 +48,8 @@ // import { UrlConfig } from '@/router/index'; import { JLmap3dMaintainer } from '@/jlmap3d/jl3dmaintainer/jlmap3dmaintainer.js'; - -// components -import Jlmap3dMenu from '@/views/jlmap3d/simulation/show/menu'; +import DevicefaultList from '@/views/jlmap3d/maintainer/component/devicefaultlist'; +import FaultDevice from '@/views/jlmap3d/maintainer/component/faultdevice'; import Jlmap3dConfig from '@/views/jlmap3d/simulation/show/configmenu'; import { ProjectIcon } from '@/scripts/ProjectConfig'; @@ -50,17 +60,13 @@ var train; export default { name: 'Jl3dMaintainer', components: { - Jlmap3dMenu, - Jlmap3dConfig + DevicefaultList, + FaultDevice // Jlmap3dMsg // ShowProperty }, data() { return { - trainlist: null, - stationlist: null, - msgdata: null, - training: { id: '', name: '', @@ -72,7 +78,12 @@ export default { selectmodel: null, mapid:null, group:null, - token:null + token:null, + faultlistshow:true, + devicelist:[], + deviceShow:true, + msgshow:false, + controlmsg:"", }; }, beforeDestroy() { @@ -90,7 +101,10 @@ export default { document.querySelector("link[rel*='icon']").href = ProjectIcon[this.$route.query.project]; }, mounted() { - window.updatemenulist = this.updatemenulist; + window.updatefault = this.updatefault; + window.resetfaultlist = this.resetfaultlist; + window.deletefault = this.deletefault; + window.warningmsg = this.warningmsg; this.getParams(); // console.log(""); @@ -101,9 +115,7 @@ export default { this.mapid = this.$route.query.mapId; this.group = this.$route.query.group; this.token = this.$route.query.token; - console.log(this.mapid); - console.log(this.group); - console.log(this.token); + this.init(this.mapid, this.group); }, show: function (skinCode, group) { @@ -121,7 +133,7 @@ export default { const dom = document.getElementById('app'); const project = this.$route.query.project; // console.log(project); - + this.deviceShow = false; if (project) { this.jlmap3d = new JLmap3dMaintainer(dom, mapdata, skinCode, this.$store, group, project); @@ -155,31 +167,41 @@ export default { showtrainmsg(showtype) { this.jlmap3d.showtrainmsg(showtype); }, - updatemenulist(stationlist, trainlist) { - const stations = []; - for (const k in stationlist) { - stations.push(stationlist[k]); - } - const trains = []; - for (const k in trainlist) { - trains.push(trainlist[k]); - } - this.stationlist = stations; - this.trainlist = trains; - // console.log(this.stationlist); + resetfaultlist(){ + this.devicelist = []; }, - - sstation(changedata) { - this.jlmap3d.updatecamera(changedata.mesh, 'station'); + updatefault(fault) { + this.devicelist.push(fault); }, - strain(changedata) { - - if (changedata.dispose == false) { - this.jlmap3d.updatecamera(changedata, 'train'); + deletefault(code){ + for(let i=0,leni=this.devicelist.length;i
-

报名系统

-