From 74d7b6695c3790d03959aa871e6e5785b4347cbd Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 18 Aug 2020 16:29:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index_Common.js | 2 +- src/views/newMap/chatView/chatTooltip.vue | 1 - .../scriptPreview/index.vue} | 114 ++--------------- .../scriptPreview/scriptButtonGroup.vue | 120 ++++++++++++++++++ .../scriptPreview}/scriptPreviewChat.vue | 4 +- .../scriptPreview}/selectRole.vue | 0 .../{ => scriptDisplay}/scriptTip.vue | 0 7 files changed, 134 insertions(+), 107 deletions(-) rename src/views/newMap/displayNew/{designIndex.vue => scriptDisplay/scriptPreview/index.vue} (83%) create mode 100644 src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue rename src/views/newMap/displayNew/{ => scriptDisplay/scriptPreview}/scriptPreviewChat.vue (98%) rename src/views/newMap/displayNew/{ => scriptDisplay/scriptPreview}/selectRole.vue (100%) rename src/views/newMap/displayNew/{ => scriptDisplay}/scriptTip.vue (100%) diff --git a/src/router/index_Common.js b/src/router/index_Common.js index c4a235bac..aeb19005d 100644 --- a/src/router/index_Common.js +++ b/src/router/index_Common.js @@ -23,7 +23,7 @@ const Jlmap3dMaintainerVr = () => import('@/views/jlmap3d/maintainer/jl3dmaintai const Display = () => import('@/views/oldMap/display/index'); const DisplayNew = () => import('@/views/newMap/displayNew/index'); const DesignDisplay = () => import('@/views/oldMap/display/designIndex'); -const DesignDisplayNew = () => import('@/views/newMap/displayNew/designIndex'); +const DesignDisplayNew = () => import('@/views/newMap/displayNew/scriptDisplay/scriptPreview/index'); const TrainRoom = () => import('@/views/trainRoom/index'); const JointTraining = () => import('@/views/oldMap/jointTraining/index'); diff --git a/src/views/newMap/chatView/chatTooltip.vue b/src/views/newMap/chatView/chatTooltip.vue index 258f066df..6a939cc39 100644 --- a/src/views/newMap/chatView/chatTooltip.vue +++ b/src/views/newMap/chatView/chatTooltip.vue @@ -50,7 +50,6 @@ export default { acceptConversitionInvite(this.group, this.conversitionId).then(res=>{ this.loading = false; this.dialogVisible = false; - this.$emit('getCoversitionList'); }).catch(error=>{ this.$messageBox('接受邀请失败: ' + error.message); }); diff --git a/src/views/newMap/displayNew/designIndex.vue b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/index.vue similarity index 83% rename from src/views/newMap/displayNew/designIndex.vue rename to src/views/newMap/displayNew/scriptDisplay/scriptPreview/index.vue index 9843d4a21..bad52dd41 100644 --- a/src/views/newMap/displayNew/designIndex.vue +++ b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/index.vue @@ -4,28 +4,8 @@ - + -
- {{ $t('display.demon.exitScript') }} - {{ $t('display.demon.back') }} -
- -
- -
- - - @@ -41,19 +21,18 @@ // 草稿预备预览 import SelectRole from './selectRole'; import { getToken } from '@/utils/auth'; -import RunPlanLoad from './demon/runPlanLoad'; -import RunPlanView from './demon/runPlanView'; +import RunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad'; +import RunPlanView from '@/views/newMap/displayNew/demon/runPlanView'; import ScriptPreviewChat from './scriptPreviewChat.vue'; import MapSystemDraft from '@/views/newMap/mapsystemNew/index'; -import { quitScriptNew, scriptRePreview } from '@/api/simulation'; -import FaultChoose from './demon/faultChoose'; +import ScriptButtonGroup from './scriptButtonGroup'; +import FaultChoose from '@/views/newMap/displayNew/demon/faultChoose'; import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime'; import { mapGetters } from 'vuex'; -import { clearSimulation, getSimulationInfoNew } from '@/api/simulation'; +import { getSimulationInfoNew } from '@/api/simulation'; import { OperateMode } from '@/scripts/ConstDic'; import { loadNewMapDataByGroup } from '@/utils/loaddata'; import { EventBus } from '@/scripts/event-bus'; -import { Notification } from 'element-ui'; import { getByGroupStationList } from '@/api/jmap/map'; import { getEveryDayRunPlanNew } from '@/api/simulation'; import {loadDraftScript, loadDraftScriptNew} from '@/api/designPlatform'; @@ -75,7 +54,8 @@ export default { MapSystemDraft, FaultChoose, MenuSystemTime, - SelectRole + SelectRole, + ScriptButtonGroup // Jl3dDrive }, data() { @@ -84,17 +64,14 @@ export default { trainingObj: {}, timeDemonNum: 0, offset: 15, - offsetBottom: 15, - dataError: false, panelShow: true, memberData:[], - faultMode: false, - viewDisabled: true, + mapLocation:{}, firstLoad: true, // simulationShow: false, // drivingShow: false, - isscriptRun:false, // 剧本是否正在加载 + showStation: '', stationListMode: [], showSelectStation: false, // 是否展示现地选择设备集中站select @@ -144,12 +121,6 @@ export default { drawWay() { const drawWay = this.$route.query.drawWay; return drawWay && JSON.parse(drawWay); - }, - running() { - return this.$store.state.training.started; - }, - isScheduling() { - return this.$store.state.training.prdType === '05'; } // isDrive() { // return this.prdType == '04'; @@ -200,16 +171,8 @@ export default { async mounted() { await this.initLoadData(); }, - async beforeDestroy() { - await this.quit(); - await this.$store.dispatch('training/reset'); - await this.$store.dispatch('map/mapClear'); - this.$store.dispatch('scriptRecord/updateSimulationPause', false); - }, methods: { - viewScriptRoles() { - this.$refs.selectRole.doShow(); - }, + async selectRole(role) { try { const res = this.drawWay ? await loadDraftScriptNew(role.id, this.group) : await loadDraftScript(this.$route.query.scriptId, role.id, this.group); @@ -272,14 +235,6 @@ export default { this.$messageBox(error.message); } }, - changeOperateMode() { - this.faultMode = !this.faultMode; - let mode = OperateMode.NORMAL; - if (this.faultMode) { - mode = OperateMode.FAULT; - } - this.$store.dispatch('training/changeOperateMode', { mode: mode }); - }, // 加载地图数据 async initLoadData() { this.setWindowSize(); @@ -518,46 +473,8 @@ export default { const menuTool = document.getElementById('menuTool'); const menuBottom = document.getElementById('menuButton'); this.offset = 15 + (menuBar ? menuBar.offsetHeight || 0 : 0) + (menuTool ? menuTool.offsetHeight || 0 : 0); - this.offsetBottom = 15 + (menuBottom ? menuBottom.offsetHeight || 0 : 0); }); }, - async back() { - await clearSimulation(this.group); - this.$store.dispatch('training/over').then(() => { - history.go(-1); - Notification.closeAll(); - }); - }, - // 退出剧本 - handleQuitQuest() { - quitScriptNew(this.group).then(resp => { - scriptRePreview(this.group).then(resp=>{ - getSimulationInfoNew(this.group).then(()=>{ - this.isscriptRun = false; - this.$store.dispatch('scriptRecord/updateSimulationPause', false); - this.$store.dispatch('scriptRecord/updateBgSet', false); - this.userRole = ''; - this.$refs.chatbox.clearAllData(); - // if (resp.data.planRunning) { - // this.$store.dispatch('training/start');// 仿真开始按计划行车 - // } else { - // this.$store.dispatch('training/over');// 仿真按计划行车结束 - // } - }).catch(()=>{ - this.$messageBox(this.$t('display.demon.exitTaskFail')); - }); - }).catch(()=>{ - this.$messageBox(this.$t('display.demon.exitTaskFail')); - }); - }).catch(() => { - this.$messageBox(this.$t('display.demon.exitTaskFail')); - }); - }, - // 销毁仿真 - async quit() { - await clearSimulation(this.group); - await this.$store.dispatch('training/over'); - }, switchMode(prdType) { this.$store.dispatch('training/setPrdType', prdType); }, @@ -583,15 +500,6 @@ export default { // this.panelShow = true; // this.drivingShow = false; // }, - viewRunPlan() { - this.$refs.runPlanView.doShow(); - }, - loadRunPlan() { - this.$refs.runPlanLoad.doShow(); - }, - setFault() { - this.$refs.faultChoose.doShow(); - }, switchStationMode(val) { if (val == null && this.stationListMode.length > 0) { this.showStation = this.stationListMode[0].value; diff --git a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue new file mode 100644 index 000000000..a6ae3ee2d --- /dev/null +++ b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue @@ -0,0 +1,120 @@ + + diff --git a/src/views/newMap/displayNew/scriptPreviewChat.vue b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptPreviewChat.vue similarity index 98% rename from src/views/newMap/displayNew/scriptPreviewChat.vue rename to src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptPreviewChat.vue index c37fab6b1..ba04347ab 100644 --- a/src/views/newMap/displayNew/scriptPreviewChat.vue +++ b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptPreviewChat.vue @@ -17,8 +17,8 @@ diff --git a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue index a6ae3ee2d..35f3d50ca 100644 --- a/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue +++ b/src/views/newMap/displayNew/scriptDisplay/scriptPreview/scriptButtonGroup.vue @@ -23,9 +23,17 @@ diff --git a/src/views/scriptManage/tipScriptRecord.vue b/src/views/scriptManage/tipScriptRecord.vue index e2d8558d7..47e1dfee2 100644 --- a/src/views/scriptManage/tipScriptRecord.vue +++ b/src/views/scriptManage/tipScriptRecord.vue @@ -156,6 +156,7 @@ export default { } this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); + this.$store.dispatch('scriptRecord/updateRole', 'DISPATCHER' + ':' + this.memberId); getAllSelectedScriptRole(this.group).then(res=>{ const lastData = JSON.stringify(res.data); this.quickChangeMember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);