代码调整

This commit is contained in:
dong 2022-08-31 14:20:36 +08:00
parent 19a87a79db
commit e2c9fa3c3e
2 changed files with 13 additions and 4 deletions

View File

@ -6,9 +6,9 @@
<el-button size="small" class="fault-button" :type="faultMode ? '':'primary' " @click="changeOperateMode()">{{ faultMode?'切换到普通模式':'切换到故障模式' }}</el-button>
<div class="trainBack">
<el-button-group>
<el-button v-loading="loading" type="danger" :disabled="loading" size="small" @click="init">初始化</el-button>
<el-button v-if="!isPause" size="small" type="primary" @click="pauseScript">暂停</el-button>
<el-button v-else size="small" type="primary" @click="executePlayScript">恢复</el-button>
<el-button v-if="record" v-loading="loading" type="danger" :disabled="loading" size="small" @click="init">初始化</el-button>
<el-button v-if="!isPause && record" size="small" type="primary" @click="pauseScript">暂停</el-button>
<el-button v-if="isPause && record" size="small" type="primary" @click="executePlayScript">恢复</el-button>
<el-button v-if="!trainingSwitch && trainingDetail" type="success" size="small" @click="handlerStart">开始</el-button>
<el-button v-if="trainingSwitch" type="danger" size="small" @click="handlerEnd">结束</el-button>
<el-button type="primary" size="small" @click="back">返回</el-button>
@ -38,6 +38,9 @@ export default {
};
},
computed: {
record() { //
return this.$route.query.record;
},
mapId() {
return this.$route.query.mapId;
},

View File

@ -182,7 +182,10 @@ export default {
return list;
},
drawUp(index, row) {
console.log('编辑', index, row);
const qObj = {...this.$route.query};
qObj.record = true;
this.$router.push({ query:{...qObj}});
console.log('编辑', qObj, index, row);
getTrainingAll(row.id).then(resp => {
this.$store.dispatch('trainingNew/setTrainingDetail', null);
if (resp.data && resp.data.mapLocationJson) {
@ -239,6 +242,9 @@ export default {
this.$message.error('请先结束当前实训后再加载新的实训!');
return;
}
const qObj = {...this.$route.query};
delete qObj.record;
this.$router.push({ query:{...qObj}});
try {
const detailResp = await getTrainingAll(data.id);
this.training = detailResp.data;