调整大屏系统推出流程
This commit is contained in:
parent
ecf563e8de
commit
98a4a7b622
@ -2,7 +2,7 @@
|
|||||||
<div class="map-view">
|
<div class="map-view">
|
||||||
<div v-show="maskOpen" class="mask" :style="{'width': maskWidth}" />
|
<div v-show="maskOpen" class="mask" :style="{'width': maskWidth}" />
|
||||||
<jlmap-visual ref="jlmapVisual" />
|
<jlmap-visual ref="jlmapVisual" />
|
||||||
<div class="display-draft">
|
<div v-show="disPlay" class="display-draft">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
|
<el-button type="primary" @click="back">{{ $t('scriptRecord.scriptBack') }}</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
@ -12,6 +12,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||||
import { loadNewMapDataByGroup, loadMapDataById } from '@/utils/loaddata';
|
import { loadNewMapDataByGroup, loadMapDataById } from '@/utils/loaddata';
|
||||||
|
import { clearSimulation } from '@/api/simulation';
|
||||||
import { EventBus } from '@/scripts/event-bus';
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
|
||||||
@ -35,7 +36,8 @@ export default {
|
|||||||
height: document.documentElement.clientHeight - 80
|
height: document.documentElement.clientHeight - 80
|
||||||
},
|
},
|
||||||
maskOpen: false,
|
maskOpen: false,
|
||||||
maskWidth: '100%'
|
maskWidth: '100%',
|
||||||
|
disPlay: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -69,7 +71,9 @@ export default {
|
|||||||
this.$jlmap.off('zoom');
|
this.$jlmap.off('zoom');
|
||||||
this.$jlmap.off('pan');
|
this.$jlmap.off('pan');
|
||||||
this.handleUpdateScreen();
|
this.handleUpdateScreen();
|
||||||
|
if (this.$route.query.group) {
|
||||||
this.subscribe();
|
this.subscribe();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'$store.state.socket.equipmentStatus': function (val) {
|
'$store.state.socket.equipmentStatus': function (val) {
|
||||||
if (val.length && this.$route.query.group) {
|
if (val.length && this.$route.query.group) {
|
||||||
@ -83,43 +87,37 @@ export default {
|
|||||||
async mounted() {
|
async mounted() {
|
||||||
await this.setWindowSize();
|
await this.setWindowSize();
|
||||||
await this.initLoadData();
|
await this.initLoadData();
|
||||||
|
this.disPlay = true;
|
||||||
|
if (this.$route.path.includes('design/bigScreen')) {
|
||||||
|
this.disPlay = false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async initLoadData() { // 加载地图数据
|
async initLoadData() { // 加载地图数据
|
||||||
if (this.$route.query.group) {
|
if (this.$route.query.group) {
|
||||||
await loadNewMapDataByGroup(this.$route.query.group);
|
await loadNewMapDataByGroup(this.$route.query.group);
|
||||||
} else {
|
} else {
|
||||||
await loadMapDataById(this.$route.params.mapId);
|
this.loadMapDataById(this.$route.params.mapId);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 通过id加载地图数据
|
||||||
|
async loadMapDataById(mapId) {
|
||||||
|
try {
|
||||||
|
await this.$store.dispatch('training/changeMode', { mode: null });
|
||||||
|
loadMapDataById(mapId).then(()=>{
|
||||||
|
this.$store.dispatch('training/over');
|
||||||
|
this.$store.dispatch('training/setMapDefaultState');
|
||||||
|
this.$store.dispatch('map/clearJlmapTrainView');
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||||
|
this.endViewLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async statusMessage(list) {
|
async statusMessage(list) {
|
||||||
await this.$store.dispatch('training/updateMapState', list);
|
await this.$store.dispatch('training/updateMapState', list);
|
||||||
await this.$store.dispatch('socket/setEquipmentStatus');
|
await this.$store.dispatch('socket/setEquipmentStatus');
|
||||||
},
|
},
|
||||||
// 通过id加载地图数据
|
|
||||||
async loadMapDataById(mapId) {
|
|
||||||
// try {
|
|
||||||
// await this.$store.dispatch('training/changeMode', { mode: null });
|
|
||||||
// loadMapDataById(mapId).then(()=>{
|
|
||||||
// this.$store.dispatch('training/over');
|
|
||||||
// this.$store.dispatch('training/setMapDefaultState');
|
|
||||||
// this.$store.dispatch('map/clearJlmapTrainView');
|
|
||||||
// });
|
|
||||||
// } catch (error) {
|
|
||||||
// this.$messageBox(`获取地图数据失败: ${error.message}`);
|
|
||||||
// this.endViewLoading();
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
// 结束加载状态
|
|
||||||
endViewLoading(isSuccess) {
|
|
||||||
if (!isSuccess) {
|
|
||||||
this.$store.dispatch('map/mapClear');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
|
||||||
EventBus.$emit('viewLoading', false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
setWindowSize() {
|
setWindowSize() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.widthLeft) {
|
if (this.widthLeft) {
|
||||||
@ -159,7 +157,11 @@ export default {
|
|||||||
this.$messageBox('该线路没有大屏切割位置信息, 请前往地图绘制编辑');
|
this.$messageBox('该线路没有大屏切割位置信息, 请前往地图绘制编辑');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
back() {
|
async back() {
|
||||||
|
if (this.$route.query.group) {
|
||||||
|
await clearSimulation(this.$route.query.group);
|
||||||
|
this.clearSubscribe();
|
||||||
|
}
|
||||||
this.$store.dispatch('training/over').then(() => {
|
this.$store.dispatch('training/over').then(() => {
|
||||||
EventBus.$emit('runPlanStop');
|
EventBus.$emit('runPlanStop');
|
||||||
EventBus.$emit('chatSubscribeStop');
|
EventBus.$emit('chatSubscribeStop');
|
||||||
@ -199,5 +201,6 @@ export default {
|
|||||||
float: right;
|
float: right;
|
||||||
right: 15px;
|
right: 15px;
|
||||||
bottom: 15px;
|
bottom: 15px;
|
||||||
|
z-index: 19;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user