From fe08980f2fa7344681bdade0fc5552dd19fcef1f Mon Sep 17 00:00:00 2001
From: zyy <1787816799@qq.com>
Date: Fri, 24 Jul 2020 11:01:22 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/demonstration/detail/index.vue | 6 +--
src/views/newMap/displayNew/designIndex.vue | 6 +--
src/views/newMap/displayNew/index.vue | 58 ++++++++++++---------
src/views/newMap/displayNew/menuDemon.vue | 6 +--
src/views/newMap/displayNew/menuSchema.vue | 8 ++-
src/views/newMap/jointTrainingNew/index.vue | 8 +--
6 files changed, 49 insertions(+), 43 deletions(-)
diff --git a/src/views/demonstration/detail/index.vue b/src/views/demonstration/detail/index.vue
index 3ec04d4a3..4ccd52923 100644
--- a/src/views/demonstration/detail/index.vue
+++ b/src/views/demonstration/detail/index.vue
@@ -308,8 +308,8 @@ export default {
jump() {
this.disabled = true;
setTimeout(() => {
+ const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
if (!this.drawWay) {
- const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
simulationNotify(data).then(resp => {
const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
@@ -319,9 +319,9 @@ export default {
this.disabled = false;
});
} else {
- const data = { mapId: this.courseModel.mapId, prdType: this.currentPrdType };
createSimulationNew(data).then(resp => {
- const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
+ const query = { lineCode: this.courseModel.lineCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, goodsId: this.goodsId, try: this.tryUser, project: this.project };
+ this.$store.dispatch('training/setPrdType', this.currentPrdType); // 改变prdType
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen();
}).catch(error => {
diff --git a/src/views/newMap/displayNew/designIndex.vue b/src/views/newMap/displayNew/designIndex.vue
index 71e10a923..6f870bc19 100644
--- a/src/views/newMap/displayNew/designIndex.vue
+++ b/src/views/newMap/displayNew/designIndex.vue
@@ -76,8 +76,8 @@ export default {
dataError: false,
panelShow: true,
memberData:[],
- simulationShow: false,
- drivingShow: false,
+ // simulationShow: false,
+ // drivingShow: false,
isscriptRun:false, // 剧本是否正在加载
showStation: '',
stationListMode: [],
@@ -141,8 +141,6 @@ export default {
this.setPosition();
},
'$store.state.map.mapViewLoadedCount': function (val) {
- // this.mapBoxP = document.getElementById(this.canvasId).children[0];
- // this.mapBoxP.style.cursor = '';
this.switchStationMode(this.showStation);
},
'$store.state.training.centerStationCode': function(code) {
diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue
index b6386fd20..d9cabfe17 100644
--- a/src/views/newMap/displayNew/index.vue
+++ b/src/views/newMap/displayNew/index.vue
@@ -29,7 +29,7 @@
:offset-bottom="offsetBottom"
:tip-bottom="tipBottom"
:show-station="showStation"
- :station-list="stationList"
+ :station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
@@ -40,7 +40,7 @@
:data-error="dataError"
:offset-bottom="offsetBottom"
:show-station="showStation"
- :station-list="stationList"
+ :station-list="stationListMode"
:show-select-station="showSelectStation"
@switchStationMode="switchStationMode"
/>
@@ -52,7 +52,7 @@
:data-error="dataError"
:offset-bottom="offsetBottom"
:show-station="showStation"
- :station-list="stationList"
+ :station-list="stationListMode"
:show-select-station="showSelectStation"
@switchMode="switchMode"
@selectQuest="selectQuest"
@@ -67,7 +67,7 @@
:offset="offset"
:offset-bottom="offsetBottom"
:show-station="showStation"
- :station-list="stationList"
+ :station-list="stationListMode"
:show-select-station="showSelectStation"
:data-error="dataError"
@switchMode="switchMode"
@@ -149,7 +149,7 @@ export default {
dataError: false,
group:'',
showStation: '',
- stationList: [],
+ stationListMode: [],
showSelectStation: false, // 是否展示现地选择设备集中站select
prdTypeMap: {
'01': '01', // 现地 => 现地
@@ -163,6 +163,10 @@ export default {
computed:{
...mapGetters([
'canvasWidth'
+ ]),
+ ...mapGetters('map', [
+ 'map',
+ 'stationList'
]),
mode() {
return this.$route.params.mode;
@@ -217,8 +221,9 @@ export default {
'$store.state.config.menuBarLoadedCount': function (val) {
this.setPosition();
},
- '$store.state.training.prdType': function (val) { // 根据权限类型计算高度
- this.setPosition();
+ '$store.state.training.prdType': function (val) { // 根据权限类型计算高度
+ this.setPosition();
+ this.setMode();
},
'size.width': function(val) {
this.setWindowSize();
@@ -245,10 +250,9 @@ export default {
}
});
},
- '$store.state.map.map': function (val) {
- this.showSelectStation = val.skinVO.code === '06' && this.$store.state.training.prdType === '01';
- this.showSelectStation && this.setStationList(val);
- },
+ 'stationList': function () {
+ this.setStationList();
+ },
'$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态
if (this.planRunning) {
this.$store.dispatch('training/simulationStart');
@@ -259,7 +263,8 @@ export default {
async mounted() {
this.group = this.$route.query.group;
await this.setWindowSize();
- await this.initLoadData();
+ await this.initLoadData();
+ this.setMode();
},
beforeDestroy() {
this.quit(this.group);
@@ -393,8 +398,13 @@ export default {
});
},
switchMode(prdType) {
- this.$store.dispatch('training/setPrdType', prdType);
- },
+ this.$store.dispatch('training/setPrdType', prdType); // 改变prdType
+ },
+ setMode() {
+ if (this.map) {
+ this.showSelectStation = this.map.skinVO.code === '06' && this.$store.state.training.prdType === '01';
+ }
+ },
// 选择脚本
selectQuest(row) {
this.scriptId = parseInt(row.id);
@@ -509,7 +519,7 @@ export default {
offsetBottom = (menuBottom.offsetHeight || 0) + 15;
}
if (menuButtonsBox) {
- this.tipBottom = menuButtonsBox.offsetHeight + 15 || 0;
+ this.tipBottom = (menuButtonsBox.offsetHeight || 0) + 15;
}
if (this.offset != offset) {
this.offset = offset;
@@ -520,12 +530,12 @@ export default {
});
},
setCenter(code) {
- this.$refs.mapCanvas.setCenter(code);
+ this.$jlmap.setCenter(code);
},
switchStationMode(val) {
- if (this.stationList.length > 0) {
+ if (this.stationListMode.length > 0) {
if (val == null) {
- this.showStation = this.stationList[0].value;
+ this.showStation = this.stationListMode[0].value;
} else {
this.showStation = val;
}
@@ -548,15 +558,15 @@ export default {
// this.$store.dispatch('map/setShowCentralizedStationNum');
}
},
- setStationList(val) {
- this.stationList = [];
- (val.stationList || []).forEach(item => {
+ setStationList() {
+ this.stationListMode = [];
+ (this.stationList || []).forEach(item => {
if (item.centralized) {
- this.stationList.push({value: item.code, name: item.name});
+ this.stationListMode.push({value: item.code, name: item.name});
}
});
- if (this.stationList.length) {
- this.showStation = this.stationList[0].value;
+ if (this.stationListMode.length && this.showSelectStation) {
+ this.showStation = this.stationListMode[0].value;
}
}
}
diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue
index 93ef57b8b..a4378a4c3 100644
--- a/src/views/newMap/displayNew/menuDemon.vue
+++ b/src/views/newMap/displayNew/menuDemon.vue
@@ -61,7 +61,7 @@ export default {
default() {
return 0;
}
- },
+ },
dataError: {
type: Boolean,
default() {
@@ -76,7 +76,7 @@ export default {
timeNow: 0, // 进入页面 相对时间
time: null, // 定时器
countTime: 0, // 显示 倒计时
- remainingTime: 0,
+ remainingTime: 0,
goodsId: this.$route.query.goodsId,
try: this.$route.query.try, // 是否是试用权限
training: {
@@ -244,7 +244,7 @@ export default {
this.isDisable = true;
this.$messageBox(this.$t('display.demon.endSimulationFail'));
});
- },
+ },
handleQuitQuest() {
quitScriptNew(this.group).then(resp => {
getSimulationInfoNew(this.group).then(()=>{
diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue
index 24e973ae8..bcb28bde2 100644
--- a/src/views/newMap/displayNew/menuSchema.vue
+++ b/src/views/newMap/displayNew/menuSchema.vue
@@ -4,8 +4,8 @@
-
-
+
+
@@ -112,7 +112,7 @@ export default {
isDemon() {
return this.$route.params.mode === 'demon';
},
- isDesignPlatform() {
+ isDesignPlatform() { // 是否剧本预览页面
return this.$route.fullPath.includes('design/displayNew/demon');
},
isScheduling() {
@@ -153,8 +153,6 @@ export default {
},
async mounted() {
await this.loadRunData(this.$route.query);
- // this.isScriptCommand = this.$store.state.scriptRecord.bgSet;
- // this.showStationContent = this.showStation;
},
methods: {
loadRunData(opt) {
diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue
index 2a01e307f..455e9c9a3 100644
--- a/src/views/newMap/jointTrainingNew/index.vue
+++ b/src/views/newMap/jointTrainingNew/index.vue
@@ -80,7 +80,7 @@ import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
import { EventBus } from '@/scripts/event-bus';
import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui';
-import Vue from 'vue';
+// import Vue from 'vue';
import localStore from 'storejs';
import MembersManage from './memberManage/membersManage';
import AddMember from './memberManage/addMember';
@@ -293,7 +293,7 @@ export default {
});
},
setCenter(code) {
- this.$refs.mapCanvas.setCenter(code);
+ this.$jlmap.setCenter(code);
},
// 加载地图数据
initLoadData() {
@@ -553,8 +553,8 @@ export default {
list = [...list, ...this.$store.state.map.map[item]];
}
});
- Vue.prototype.$jlmap.updateShowStation(list, val);
- Vue.prototype.$jlmap.setCenter(val);
+ this.$jlmap.updateShowStation(list, val);
+ this.$jlmap.setCenter(val);
},
setStationList(val) {
this.stationList = [];