diff --git a/src/api/chat.js b/src/api/chat.js index 0cf5433f3..81cedad06 100644 --- a/src/api/chat.js +++ b/src/api/chat.js @@ -53,3 +53,11 @@ export function overConversationMessage(group, conversationMessageId) { method: 'put' }); } +/** 发送会话文字 */ +export function sendConversationText (group, id, data) { + return request({ + url: `/api/simulation/${group}/conversation/${id}/chat/text?`, + method: 'post', + data + }); +} diff --git a/src/api/designPlatform.js b/src/api/designPlatform.js index 985d6a6e8..b1501d034 100644 --- a/src/api/designPlatform.js +++ b/src/api/designPlatform.js @@ -139,9 +139,9 @@ export function previewRunPlan(planId) { } /** 剧本预览选择角色 */ -export function loadDraftScriptNew(memberId, group) { +export function loadDraftScriptNew(memberId, group, mode) { return request({ - url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}`, + url: `/api/scriptSimulation/${group}/chooseMemberAndStart?memberId=${memberId}&mode=${mode}`, method: 'put' }); } diff --git a/src/api/script.js b/src/api/script.js index f316ea3d9..326131774 100644 --- a/src/api/script.js +++ b/src/api/script.js @@ -126,3 +126,11 @@ export function deleteScriptAction(group, actionId) { method: 'delete' }); } +/** 修改剧本活动条件 */ +export function updateActionCondition(group, actionId, data) { + return request({ + url: `/api/scriptSimulation/${group}/${actionId}/updateCondition`, + method: 'put', + data + }); +} diff --git a/src/api/simulation.js b/src/api/simulation.js index c6efd75d2..bb59c7f2a 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -147,6 +147,30 @@ export function modifyScriptActionNew(group, data) { }); } +/** 开始替换 */ +export function startReplaceBg(group) { + return request({ + url: `/api/scriptSimulation/${group}/replace/start`, + method: 'put' + }); +} + +/** 确认替换 */ +export function confirmReplaceBg(group) { + return request({ + url: `/api/scriptSimulation/${group}/replace/confirm`, + method: 'put' + }); +} + +/** 放弃替换 */ +export function cancelReplaceBg(group) { + return request({ + url: `/api/scriptSimulation/${group}/replace/cancel`, + method: 'put' + }); +} + /** 分页查询存在的仿真 */ export function getExistingSimulation(params) { return request({ diff --git a/src/components/QueryListPage/QueryListPage.vue b/src/components/QueryListPage/QueryListPage.vue index c33a4af53..29d22845f 100644 --- a/src/components/QueryListPage/QueryListPage.vue +++ b/src/components/QueryListPage/QueryListPage.vue @@ -15,7 +15,7 @@ @disableQuery="disableQuery" @enableQuery="enableQuery" /> - + ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`); if (!result) { + let directionCode = elem.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + directionCode = elem.right ? '1' : '2'; + } serie.markPoint.data.push(createMartPoint({ - directionCode: elem.directionCode, + directionCode: directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`, color: lineStyle.color || '#000' diff --git a/src/jmapNew/theme/chengdu_01/planConvert.js b/src/jmapNew/theme/chengdu_01/planConvert.js index 9f9441ee4..5601b44c9 100644 --- a/src/jmapNew/theme/chengdu_01/planConvert.js +++ b/src/jmapNew/theme/chengdu_01/planConvert.js @@ -1,5 +1,5 @@ import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; - +import store from '@/store/index_APP_TARGET'; export default { /** 边缘高度*/ EdgeHeight: 600, @@ -113,7 +113,11 @@ export default { // pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.name = `${service.serviceNumber}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; - pointdata.directionCode = train.directionCode; + pointdata.directionCode = train.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + pointdata.directionCode = train.right ? '1' : '2'; + } + // pointdata.directionCode = train.directionCode; pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ @@ -211,8 +215,12 @@ export default { if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`); if (!result) { + let directionCode = elem.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + directionCode = elem.right ? '1' : '2'; + } serie.markPoint.data.push(createMartPointReverse({ - directionCode: elem.directionCode, + directionCode: directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`, color: lineStyle.color || '#000' diff --git a/src/jmapNew/theme/chengdu_03/planConvert.js b/src/jmapNew/theme/chengdu_03/planConvert.js index 921c6f4da..8780b2871 100644 --- a/src/jmapNew/theme/chengdu_03/planConvert.js +++ b/src/jmapNew/theme/chengdu_03/planConvert.js @@ -1,5 +1,5 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList } from '@/utils/runPlan'; - +import store from '@/store/index_APP_TARGET'; export default { /** 边缘高度*/ EdgeHeight: 600, @@ -91,7 +91,11 @@ export default { // pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.name = `${service.serviceNumber}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; - pointdata.directionCode = train.directionCode; + // pointdata.directionCode = train.directionCode; + pointdata.directionCode = train.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + pointdata.directionCode = train.right ? '1' : '2'; + } pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ @@ -186,8 +190,12 @@ export default { if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`); if (!result) { + let directionCode = elem.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + directionCode = elem.right ? '1' : '2'; + } serie.markPoint.data.push(createMartPoint({ - directionCode: elem.directionCode, + directionCode: directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`, color: lineStyle.color || '#000' diff --git a/src/jmapNew/theme/foshan_01/planConvert.js b/src/jmapNew/theme/foshan_01/planConvert.js index 2d381de1f..4362d2c07 100644 --- a/src/jmapNew/theme/foshan_01/planConvert.js +++ b/src/jmapNew/theme/foshan_01/planConvert.js @@ -1,5 +1,5 @@ import { createMartPointReverse, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; - +import store from '@/store/index_APP_TARGET'; export default { /** 边缘高度*/ EdgeHeight: 600, @@ -110,7 +110,11 @@ export default { // pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.name = `${service.serviceNumber}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; - pointdata.directionCode = train.directionCode; + // pointdata.directionCode = train.directionCode; + pointdata.directionCode = train.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + pointdata.directionCode = train.right ? '1' : '2'; + } pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ @@ -203,8 +207,12 @@ export default { if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`); if (!result) { + let directionCode = elem.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + directionCode = elem.right ? '1' : '2'; + } serie.markPoint.data.push(createMartPointReverse({ - directionCode: elem.directionCode, + directionCode: directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`, color: lineStyle.color || '#000' diff --git a/src/jmapNew/theme/fuzhou_01/planConvert.js b/src/jmapNew/theme/fuzhou_01/planConvert.js index 0163d7a31..b9e9580e6 100644 --- a/src/jmapNew/theme/fuzhou_01/planConvert.js +++ b/src/jmapNew/theme/fuzhou_01/planConvert.js @@ -1,5 +1,5 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan'; - +import store from '@/store/index_APP_TARGET'; export default { /** 边缘高度*/ EdgeHeight: 3, @@ -297,7 +297,11 @@ export default { // pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.name = `${service.serviceNumber}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; - pointdata.directionCode = train.directionCode; + // pointdata.directionCode = train.directionCode; + pointdata.directionCode = train.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + pointdata.directionCode = train.right ? '1' : '2'; + } pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ @@ -388,8 +392,12 @@ export default { if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`); if (!result) { + let directionCode = elem.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + directionCode = elem.right ? '1' : '2'; + } serie.markPoint.data.push(createMartPoint({ - directionCode: elem.directionCode, + directionCode: directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`, color: lineStyle.color || '#000' diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index 8048deb70..a5966787d 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -126,7 +126,8 @@ export default { this.canCommand = true; const step = { operation: 'click', - code: this.selectedObj.code + code: this.selectedObj.code, + subType:this.$store.state.menuOperation.subType }; this.$store.dispatch('training/nextNew', step).then(({ valid }) => { if (valid) { diff --git a/src/jmapNew/theme/haerbin_01/operationConfig.js b/src/jmapNew/theme/haerbin_01/operationConfig.js index f7d241703..f2894207f 100644 --- a/src/jmapNew/theme/haerbin_01/operationConfig.js +++ b/src/jmapNew/theme/haerbin_01/operationConfig.js @@ -877,7 +877,7 @@ export default { productTypes: ['02'], stepVOList: [ // { deviceType: '04', orderNum: 1, tip: '鼠标左键点击选择该站台' }, - { deviceType: 'trainSetButton', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', codeType:'STAND'}, + { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'}, { deviceType: '04', orderNum: 2, operateCode: '5041', tip: '鼠标左键点击【扣车】按钮' }, { deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' } ] @@ -893,7 +893,7 @@ export default { productTypes: ['02'], stepVOList: [ // { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' }, - { deviceType: 'trainSetButton', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', codeType:'STAND'}, + { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'}, { deviceType: '04', orderNum: 2, operateCode: '5052', tip: '鼠标左键点击【取消扣车】按钮' }, { deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' } ] @@ -909,7 +909,7 @@ export default { productTypes: ['02'], stepVOList: [ // { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' }, - { deviceType: 'trainSetButton', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', codeType:'STAND'}, + { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'}, { deviceType: '04', orderNum: 2, operateCode: '5025', tip: '鼠标左键点击【越站】按钮' }, { deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' } ] @@ -925,7 +925,7 @@ export default { productTypes: ['02'], stepVOList: [ // { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台' }, - { deviceType: 'trainSetButton', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', codeType:'STAND'}, + { deviceType: '04', orderNum: 1, operateCode: 'click', tip: '鼠标左键点击选择该站台', subType:'trainSetButton'}, { deviceType: '04', orderNum: 2, operateCode: '5035', tip: '鼠标左键点击【取消越站】按钮' }, { deviceType: '04', orderNum: 3, operateCode: '008', tip: '鼠标左键点击【执行】按钮' } ] diff --git a/src/jmapNew/theme/haerbin_01/planConvert.js b/src/jmapNew/theme/haerbin_01/planConvert.js index be09d33f1..3e2521f51 100644 --- a/src/jmapNew/theme/haerbin_01/planConvert.js +++ b/src/jmapNew/theme/haerbin_01/planConvert.js @@ -1,5 +1,5 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, prefixTime, convertSheetToList } from '@/utils/runPlan'; - +import store from '@/store/index_APP_TARGET'; export default { /** 边缘高度*/ EdgeHeight: 3, @@ -178,7 +178,10 @@ export default { // pointdata.name = `${service.serviceNumber}${train.directionCode}${train.tripNumber}`; pointdata.name = `${service.serviceNumber}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; - pointdata.directionCode = train.directionCode; + pointdata.directionCode = train.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + pointdata.directionCode = train.right ? '1' : '2'; + } pointdata.coord = [train.stationTimeList[0].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[0], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ @@ -271,8 +274,12 @@ export default { if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`); if (!result) { + let directionCode = elem.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + directionCode = elem.right ? '1' : '2'; + } serie.markPoint.data.push(createMartPoint({ - directionCode: elem.directionCode, + directionCode: directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`, color: lineStyle.color || '#000' diff --git a/src/jmapNew/theme/ningbo_01/planConvert.js b/src/jmapNew/theme/ningbo_01/planConvert.js index 5e73b8dc2..0a10d4565 100644 --- a/src/jmapNew/theme/ningbo_01/planConvert.js +++ b/src/jmapNew/theme/ningbo_01/planConvert.js @@ -1,5 +1,5 @@ import { createMartPoint, createSeriesModel, createMarkLineModels, hexColor, convertSheetToList, prefixTime } from '@/utils/runPlan'; - +import store from '@/store/index_APP_TARGET'; export default { /** 边缘高度*/ EdgeHeight: 600, @@ -137,7 +137,11 @@ export default { // pointdata.name = `${service.serviceNumber}${train.tripNumber}${train.destinationCode || ''}`; pointdata.name = `${service.serviceNumber}${train.tripNumber}`; pointdata.color = '#000' || lineStyle.color; - pointdata.directionCode = train.directionCode; + // pointdata.directionCode = train.directionCode; + pointdata.directionCode = train.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + pointdata.directionCode = train.right ? '1' : '2'; + } pointdata.coord = [train.stationTimeList[1].secondTime, this.getCoordYByElem(stations, kmRangeCoordMap, train.stationTimeList[1], train.directionCode, false)]; /** 给服务对象添加服务名称和标记点*/ @@ -230,8 +234,12 @@ export default { if (runPlanData[elem.serviceNumber][elem.tripNumber].length <= 1) { const result = serie.markPoint.data.some(ele => ele.name == `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`); if (!result) { + let directionCode = elem.right ? '2' : '1'; + if (!store.state.map.mapConfig.upRight) { + directionCode = elem.right ? '1' : '2'; + } serie.markPoint.data.push(createMartPoint({ - directionCode: elem.directionCode, + directionCode: directionCode, coord: [parseInt(elem.secondTime), this.getCoordYByElem(stations, kmRangeCoordMap, elem, false)], name: `(${elem.groupNumber})${elem.serviceNumber}${elem.tripNumber}`, color: lineStyle.color || '#000' diff --git a/src/jmapNew/theme/race_01/menus/dialog/trainSetHead.vue b/src/jmapNew/theme/race_01/menus/dialog/trainSetHead.vue index fe8f7c0ca..9b0e9f237 100644 --- a/src/jmapNew/theme/race_01/menus/dialog/trainSetHead.vue +++ b/src/jmapNew/theme/race_01/menus/dialog/trainSetHead.vue @@ -118,6 +118,11 @@ export default { }); }, doClose() { + this.addModel = { + groupNumber: '', + destinationCode: '', + tripNumber: '' + }; this.loading = false; this.dialogShow = false; this.$store.dispatch('training/emitTipFresh'); diff --git a/src/jmapNew/theme/race_01/menus/dialog/trainSetPlan.vue b/src/jmapNew/theme/race_01/menus/dialog/trainSetPlan.vue index d3cb78679..92fad2177 100644 --- a/src/jmapNew/theme/race_01/menus/dialog/trainSetPlan.vue +++ b/src/jmapNew/theme/race_01/menus/dialog/trainSetPlan.vue @@ -129,6 +129,11 @@ export default { }); }, doClose() { + this.addModel = { + groupNumber: '', + tripNumber: '', + serviceNumber: '' + }; this.loading = false; this.dialogShow = false; this.$store.dispatch('training/emitTipFresh'); diff --git a/src/jmapNew/theme/race_01/menus/menuDialog/stationControl.vue b/src/jmapNew/theme/race_01/menus/menuDialog/stationControl.vue index 219792dfc..c033ec11d 100644 --- a/src/jmapNew/theme/race_01/menus/menuDialog/stationControl.vue +++ b/src/jmapNew/theme/race_01/menus/menuDialog/stationControl.vue @@ -67,9 +67,9 @@ export default { stationName:'', message:'', controlProps: { - '03': '紧急站控', - '02': '站控', - '01': '遥控' + '03': '请求紧急站控', + '02': '请求站控', + '01': '请求中控' } }; }, @@ -262,7 +262,7 @@ export default { } }; - diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index 3c6b59f50..9c15c91eb 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -26,7 +26,7 @@ /> - + @@ -181,7 +181,7 @@ export default { setCenter(code) { this.$jlmap.setCenter(code); }, - // 设置 各个按钮的定位 + // 设置各个按钮的定位 setPosition() { this.$nextTick(() => { this.offset = 10; @@ -233,11 +233,8 @@ export default { this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); this.$store.dispatch('training/countTime'); this.planRunning = resp.data.planRunning; - - if (this.isDemon) { - this.$refs.menuDemon.initPlannedDriving(this.planRunning); // 是否正在按计划行车 - } else if (this.isScript) { - // this.$refs.menuScript.initPlannedDriving(resp.data.planRunning); + if (resp.data.planRunning) { + this.$store.commit('training/start'); } } else if (resp && resp.code == 200 && resp.data && resp.data.dataError) { this.dataError = true; diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 89f5b27b2..07a92735e 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -99,7 +99,6 @@ export default { }, data() { return { - isDisable: false, tryTime: 0, // 进入页面多少秒 timeNow: 0, // 进入页面 相对时间 time: null, // 定时器 @@ -141,6 +140,9 @@ export default { }, projectDevice() { return this.$route.query.projectDevice; + }, + isDisable() { + return this.$store.state.training.started; } }, watch: { @@ -163,6 +165,9 @@ export default { '$store.state.socket.simulationStart':function(val) { if (val) { this.setRuning(true); + this.$store.dispatch('training/simulationStart').then(() => { + this.$store.dispatch('map/setShowCentralizedStationNum'); + }); } }, '$store.state.socket.simulationReset':function(val) { @@ -208,9 +213,6 @@ export default { console.log(error); } }, - initPlannedDriving(isDisable) { - this.isDisable = isDisable; - }, loadInitData() { const data = { mapId: this.$route.query.mapId, @@ -237,7 +239,6 @@ export default { this.$refs.setTime.doShow(); }, start(model) { // 开始仿真 - this.isDisable = true; const data = { time: model.initTime }; @@ -245,12 +246,8 @@ export default { data.loadNumber = model.loadNum; } ranAsPlan(data, this.group).then(res => { - this.$store.dispatch('training/simulationStart').then(() => { - this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); - this.$store.dispatch('map/setShowCentralizedStationNum'); - }); + this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); }).catch(error => { - this.isDisable = false; if (error.code == '5001') { this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed')); } else if (error.code == '5002') { @@ -281,7 +278,6 @@ export default { this.$refs.demonMenu.hideScheduling(run); }, end() { - this.isDisable = false; exitRunPlan(this.group).then(() => { this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/setMapDefaultState').then(() => { @@ -291,14 +287,12 @@ export default { }); }); }).catch(() => { - this.isDisable = true; this.$messageBox(this.$t('display.demon.endSimulationFail')); }); }, handleQuitQuest() { quitScriptNew(this.group).then(resp => { getSimulationInfoNew(this.group).then((res)=>{ - this.isDisable = false; EventBus.$emit('clearRunSeries'); this.quitQuest(); this.initLoadPage(); diff --git a/src/views/newMap/displayNew/menuTrainList.vue b/src/views/newMap/displayNew/menuTrainList.vue index ee6390153..b88f2e440 100644 --- a/src/views/newMap/displayNew/menuTrainList.vue +++ b/src/views/newMap/displayNew/menuTrainList.vue @@ -136,8 +136,8 @@ export default { .menuTrainListOut{ position: absolute; right: 0; - top: 15%; - height: 70%; + top: 20%; + height: 60%; transform: translateX(400px); transition: all 0.4s; &.active{ diff --git a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js index cf9d6903c..dd7f550bd 100644 --- a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js +++ b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js @@ -51,6 +51,24 @@ export const operateEnum = { Section_Set_Limit_Speed:{ code:'speedLimitValue', name:'限速值为' + }, + Train_Load_Spare_Train:{ + isList:true, + params:[ + { + code:'groupNumber', + name:'车组号' + }, + { + code:'right', + name:'方向', + function:judgeUpDown + // result:[ + // {data:true, name:'右行', judge:'='}, + // {data:false, name:'左行', judge:'='} + // ] + } + ] } // Section_Cancel_Limit_Speed:{ // code:'speedLimitValue', @@ -58,7 +76,7 @@ export const operateEnum = { // } }, ControlConvertMenu:{ - type:'控制模式', + type:'系统/站遥控', CM_Apply_For_Station_Control:{ code:'stationCodes', isList:true, @@ -209,7 +227,11 @@ export function covertOperate(operationType, operationParamMap) { const station = store.getters['map/getDeviceByCode'](device.stationCode); deviceName += '【车站-' + station.name + '】 / ' + deviceType[device._type] + device.name; } else { - deviceName = '' + device.name; + if (device._type == 'Power') { + deviceName = '供电线(' + device.code + ')'; + } else { + deviceName = '' + device.name; + } } let tip = '请找到' + deviceName + ','; if (operationType == 'Set_Fault') { @@ -230,6 +252,9 @@ export function covertOperate(operationType, operationParamMap) { if (device == 'CM') { device = 'ControlConvertMenu'; } + if (operationType == 'Train_Load_Spare_Train') { + device = 'Section'; + } const list = ['Train_Update_Type', 'Train_Add_Train_Trace', 'Train_Remove_Train_Trace', @@ -359,7 +384,11 @@ function covertOperation(deviceType, operationParamMap, operationType) { } }); } else { - paramName += ',值为' + data; + if (param.function) { + paramName += covertFunction(param.function, data); + } else { + paramName += ',值为' + data; + } } if (index != params.length - 1) { @@ -399,3 +428,11 @@ function getStationResultById(stationResult) { return station.name + ' ' + param; } +function judgeUpDown(right) { + if (store.state.map.mapConfig.upRight) { + return right ? '上行' : '下行'; + } else { + return right ? '下行' : '上行'; + } +} + diff --git a/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue b/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue index fa2dceb35..bc03d1ff1 100644 --- a/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue +++ b/src/views/newMap/displayNew/scriptDisplay/component/scriptTip.vue @@ -99,6 +99,7 @@ export default { this.$notify({ title: this.$t('global.tips'), duration: 3000, + offset: 100, message: h('i', { style: 'color:' + opt.color }, opt.message) }); } @@ -119,7 +120,8 @@ export default { transform: translateX(-50%); color: #000; line-height: 180%; - z-index: 1501; + // z-index: 1501; + z-index: 15; font-size: 14px; } diff --git a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/index.vue b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/index.vue index baf2f1a64..bfa4e4d67 100644 --- a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/index.vue +++ b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/index.vue @@ -17,6 +17,8 @@ @setMemberList="setMemberList" @clearAllData="clearAllData" @setTreeData="setTreeData" + @changeScriptMode="changeScriptMode" + @setMapLocation="setMapLocation" /> @@ -45,6 +47,7 @@ import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime'; import { mapGetters } from 'vuex'; import { loadDraftScriptNew } from '@/api/designPlatform'; import Vue from 'vue'; +import { ScriptMode } from '@/scripts/ConstDic'; import ConstConfig from '@/scripts/ConstConfig'; export default { @@ -79,7 +82,8 @@ export default { userRole:'', isDrive: this.prdType == '04', treeData:[], - memberList:[] + memberList:[], + scriptMode: ScriptMode.TEACH }; }, computed: { @@ -118,6 +122,11 @@ export default { // this.setMode(); } }, + beforeDestroy() { + this.$store.dispatch('training/setRoles', ''); + this.$store.dispatch('training/setPrdType', ''); + this.clearAllData(); + }, created() { this.group = this.$route.query.group || ''; }, @@ -125,15 +134,19 @@ export default { back() { this.$refs.scriptButtonGroup.back(); }, + changeScriptMode(scriptMode) { + this.scriptMode = scriptMode; + }, async selectRole(role) { try { - const res = await loadDraftScriptNew(role.id, this.group); + const res = await loadDraftScriptNew(role.id, this.group, this.scriptMode); if (res && res.code == 200) { - if (this.querymapLocation) { - const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale}; - Vue.prototype.$jlmap.setOptions(newMapLocation); - } + // if (this.querymapLocation) { + const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale}; + Vue.prototype.$jlmap.setOptions(newMapLocation); + // } } + this.$store.dispatch('scriptRecord/updateAudioPlay', false); this.$store.dispatch('scriptRecord/updateBgSet', true); this.$refs.scriptButtonGroup.setIsscriptRun(true); if (role.type) { @@ -223,6 +236,9 @@ export default { } }); }, + setMapLocation(mapLocation) { + this.mapLocation = mapLocation; + }, switchMode(prdType) { this.$store.dispatch('training/setPrdType', prdType); }, diff --git a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue index 90068e9ad..0d3331b5c 100644 --- a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue +++ b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue @@ -1,10 +1,20 @@ @@ -95,8 +98,8 @@ export default { }, data() { return { - isDisable: false, isScriptCommand:false, + isReplaceBg: false, userRole:'' }; }, @@ -119,12 +122,20 @@ export default { }, isStation() { return this.$store.state.training.prdType == '01'; + }, + isDisable() { + return this.$store.state.training.started; } }, watch: { '$store.state.scriptRecord.bgSet':function (val) { this.isScriptCommand = val; }, + '$store.state.socket.simulationStart': function(val) { + this.$store.dispatch('training/simulationStart').then(() => { + this.$store.dispatch('map/setShowCentralizedStationNum'); + }); + }, '$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 getSimulationMemberList(this.group).then(resp => { this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id}); @@ -173,21 +184,13 @@ export default { selectBeginTime() { this.$refs.setTime.doShow(); }, - resetBeginTime() { - this.isDisable = false; - }, start(model) { - this.isDisable = true; const data = { time: model.initTime }; ranAsPlan(data, this.group).then(res => { - this.$store.dispatch('training/simulationStart').then(() => { - this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); - this.$store.dispatch('map/setShowCentralizedStationNum'); - }); + this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); }).catch((error) => { - this.isDisable = false; if (error.code == '5001') { this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed')); } else if (error.code == '5002') { @@ -212,7 +215,6 @@ export default { }); }, end() { - this.isDisable = false; exitRunPlan(this.group).then(() => { this.$store.dispatch('training/over').then(() => { this.$store.dispatch('training/setMapDefaultState').then(() => { @@ -222,7 +224,6 @@ export default { }); }); }).catch(() => { - this.isDisable = true; this.$messageBox(this.$t('display.demon.endSimulationFail')); }); }, @@ -234,6 +235,9 @@ export default { }, resetChat() { // this.$refs.chatbox.resetCoversition(); + }, + setReplace(isRp) { + this.isReplaceBg = isRp; } } }; diff --git a/src/views/newMap/jlmapNew/index.vue b/src/views/newMap/jlmapNew/index.vue index c6a79908c..1018e9b70 100644 --- a/src/views/newMap/jlmapNew/index.vue +++ b/src/views/newMap/jlmapNew/index.vue @@ -352,12 +352,12 @@ export default { } }, async simulationReset() { + await this.$store.dispatch('socket/setSimulationStart'); await this.$store.dispatch('map/clearJlmapTrainView'); await this.$store.dispatch('map/setTrainWindowShow', false); await this.$store.dispatch('training/over'); await this.$store.dispatch('map/resetActiveTrainList'); await this.$store.dispatch('socket/setSimulationReset'); // 清空 - await this.$store.dispatch('socket/setSimulationStart'); await this.$store.dispatch('training/setMapDefaultState'); }, // 视图缩放事件 diff --git a/src/views/newMap/jointTrainingNew/menuDemon.vue b/src/views/newMap/jointTrainingNew/menuDemon.vue index 13e431c95..b7fe108be 100644 --- a/src/views/newMap/jointTrainingNew/menuDemon.vue +++ b/src/views/newMap/jointTrainingNew/menuDemon.vue @@ -109,7 +109,6 @@ export default { }, data() { return { - isDisable: false, backLoading: false, chatShow: true, jsStart: true, @@ -161,6 +160,9 @@ export default { isDeviceLogin() { const typeList = ['LW', 'CW']; return typeList.includes(this.$route.query.type); + }, + isDisable() { + return this.$store.state.training.started; } }, watch: { @@ -172,11 +174,6 @@ export default { }); } }, - '$store.state.training.started': function (val) { - if (val) { - this.isDisable = true; - } - }, '$store.state.socket.simulationOver':function(val) { if (val && this.project == 'refereeJsxt') { this.$router.go(-1); @@ -284,19 +281,15 @@ export default { }, // 开始仿真 start(model) { - this.isDisable = true; const data = { time: model.initTime }; ranAsPlan(data, this.group).then(res => { - // this.$store.dispatch('training/simulationStart').then(() => { if (this.project == 'jsxt') { this.jsStart = false; } this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); - // }); }).catch((error) => { - this.isDisable = false; if (error.code == '5001') { this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed')); } else if (error.code == '5002') { @@ -321,13 +314,11 @@ export default { }); }, end() { - this.isDisable = false; exitRunPlan(this.group).then(()=>{ this.$store.dispatch('map/setTrainWindowShow', false); this.$store.dispatch('map/resetActiveTrainList', false); }).catch(() => { this.$store.dispatch('training/over').then(() => { - this.isDisable = true; this.$store.dispatch('map/resetActiveTrainList', false); this.$messageBox(this.$t('error.endSimulationFailed')); }); diff --git a/src/views/newMap/jointTrainingNew/menuTrainList.vue b/src/views/newMap/jointTrainingNew/menuTrainList.vue index e5a2c3604..209e5a14a 100644 --- a/src/views/newMap/jointTrainingNew/menuTrainList.vue +++ b/src/views/newMap/jointTrainingNew/menuTrainList.vue @@ -125,8 +125,8 @@ export default { .menuTrainListOut{ position: absolute; right: 0; - top: 15%; - height: 70%; + top: 20%; + height: 60%; transform: translateX(400px); transition: all 0.4s; &.active{ diff --git a/src/views/newMap/mapsystemNew/plugin/delayBox.vue b/src/views/newMap/mapsystemNew/plugin/delayBox.vue index ef36dd91b..c6bbe1fc0 100644 --- a/src/views/newMap/mapsystemNew/plugin/delayBox.vue +++ b/src/views/newMap/mapsystemNew/plugin/delayBox.vue @@ -1,6 +1,6 @@