调整运行图加载方式

This commit is contained in:
fan 2020-08-04 10:03:06 +08:00
parent 313a99260c
commit f645433696
3 changed files with 12 additions and 5 deletions

View File

@ -117,7 +117,6 @@ const training = {
},
over: (state) => {
state.started = false;
state.switchcount += 1;
},
updateMapState: (state, deviceStatus) => {
Vue.prototype.$jlmap && Vue.prototype.$jlmap.update(deviceStatus);

View File

@ -91,7 +91,8 @@ export default {
swchList: [
{ value: '01', name: '现地' },
{ value: '02', name: '行调' }
]
],
firstLoad: true
};
},
computed: {
@ -129,7 +130,10 @@ export default {
if (this.group) {
if (this.$store.state.training.started) {
await this.loadRunData();
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
this.firstLoad = false;
}
},
'$store.state.scriptRecord.bgSet':function (val) {
@ -146,7 +150,7 @@ export default {
}
},
async mounted() {
await this.loadRunData();
// await this.loadRunData();
},
methods: {
loadRunData() {

View File

@ -87,7 +87,8 @@ export default {
runing: false,
userId: '',
faultMode: false,
directiveMode: false
directiveMode: false,
firstLoad: true
};
},
computed: {
@ -113,13 +114,16 @@ export default {
const started = this.$store.state.training.started;
if (started) {
await this.loadRunData(this.$route.query);
} else if (this.firstLoad) {
await this.loadRunData(this.$route.query);
}
this.firstLoad = false;
}
}
},
async mounted() {
this.userId = this.$store.state.user.id;
await this.loadRunData(this.$route.query);
// await this.loadRunData(this.$route.query);
},
methods: {
loadRunData(opt) {