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