修改canvasId 初始化位置

This commit is contained in:
joylink_cuiweidong 2021-05-25 09:32:11 +08:00
parent 4796e7f648
commit 45371fb2d3

View File

@ -76,6 +76,7 @@ export default {
operate: null,
concentrationStationList: [],
showMode: '02',
canvasId:'',
localStationShow: false,
previewOrMapDraw: false,
trainingSetStation: false //
@ -85,11 +86,12 @@ export default {
...mapGetters('training', [
'mode'
]),
canvasId() {
const canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
this.$store.dispatch('config/setCurrentCancasId', { id: canvasId });
return canvasId;
},
// canvasId() {
// // debugger;
// const canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
// this.$store.dispatch('config/setCurrentCancasId', { id: canvasId });
// return canvasId;
// },
width() {
return this.$store.state.config.width;
},
@ -207,6 +209,8 @@ export default {
EventBus.$on('refresh', () => {
this.refresh(this.$store.state.map.map);
});
this.canvasId = ['map', (Math.random().toFixed(5)) * 100000].join('_');
this.$store.dispatch('config/setCurrentCancasId', { id: this.canvasId });
},
mounted() {
this.initLoadPage();
@ -265,7 +269,6 @@ export default {
stateUpdate: this.handleStateUpdate
}
});
this.$jlmap.on('dataZoom', this.onDataZoom, this);
this.$jlmap.on('selected', this.onSelected, this);
this.$jlmap.on('contextmenu', this.onContextMenu, this);