This commit is contained in:
fan 2019-08-02 16:31:49 +08:00
commit 33c71a20f6
5 changed files with 12 additions and 12 deletions

View File

@ -45,8 +45,8 @@ class TrainWindow extends Group {
stroke: this.style.TrainWindow.trainWindowColor, stroke: this.style.TrainWindow.trainWindowColor,
fill: this.style.transparentColor fill: this.style.transparentColor
}, },
onmouseover: () => { if (this.prdType != '') this.setTrainWindowEventShow(true); }, onmouseover: () => { if (this.prdType) this.setTrainWindowEventShow(true); },
onmouseout: () => { if (this.prdType != '') this.setTrainWindowEventShow(false); } onmouseout: () => { if (this.prdType) this.setTrainWindowEventShow(false); }
}); });
this.add(this.trainRect); this.add(this.trainRect);
} }

View File

@ -23,7 +23,7 @@ Vue.use(ElementUI);
Vue.config.productionTip = false; Vue.config.productionTip = false;
window.eventBus = new Vue({ new Vue({
el: '#app', el: '#app',
router, router,
store, store,

View File

@ -27,6 +27,7 @@ import ZoomBox from './zoom/zoom';
import ProgressBar from '@/views/components/progressBar/index'; import ProgressBar from '@/views/components/progressBar/index';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { TrainingMode } from '@/scripts/ConstDic'; import { TrainingMode } from '@/scripts/ConstDic';
import { EventBus } from '@/scripts/event-bus';
export default { export default {
name: 'JlmapVisual', name: 'JlmapVisual',
@ -98,24 +99,23 @@ export default {
} }
}, },
created() { created() {
eventBus.$on('viewLoading', (loading) => { EventBus.$on('viewLoading', (loading) => {
this.mapViewLoaded(loading); this.mapViewLoaded(loading);
}); });
eventBus.$on('viewProgressAt', (percentage) => { EventBus.$on('viewProgressAt', (percentage) => {
this.mapViewProgressAt(percentage); this.mapViewProgressAt(percentage);
}); });
eventBus.$on('refresh', () => { EventBus.$on('refresh', () => {
this.refresh(this.$store.state.map.map); this.refresh(this.$store.state.map.map);
}); });
}, },
mounted() { mounted() {
this.initLoadPage(); this.initLoadPage();
}, },
async beforeDestroy() { beforeDestroy() {
await this.$store.dispatch('training/setPrdType', null); EventBus.$off('refresh');
eventBus.$off('refresh'); EventBus.$off('viewLoading');
eventBus.$off('viewLoading'); EventBus.$off('viewProgressAt');
eventBus.$off('viewProgressAt');
if (this.$jlmap) { if (this.$jlmap) {
this.$jlmap.dispose(); this.$jlmap.dispose();
} }

View File

@ -38,6 +38,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.$store.dispatch('training/setPrdType', null);
this.resizeHandler(); this.resizeHandler();
}, },
methods: { methods: {

View File

@ -16,7 +16,6 @@ import PopMenu from '@/components/PopMenu';
import MapEdit from './edit'; import MapEdit from './edit';
import MapSaveAs from './saveAs'; import MapSaveAs from './saveAs';
import MapPublish from './publish'; import MapPublish from './publish';
// import localStore from 'storejs';
export default { export default {
name: 'MapOperateMenu', name: 'MapOperateMenu',