This commit is contained in:
fan 2022-09-02 17:03:57 +08:00
commit e7360ce946
2 changed files with 9 additions and 5 deletions

View File

@ -36,8 +36,7 @@ export default {
},
data() {
return {
loading: false,
faultMode: false
loading: false
};
},
computed: {
@ -56,6 +55,9 @@ export default {
group() {
return this.$route.query.group;
},
faultMode() {
return this.$store.state.training.operatemode === OperateMode.FAULT;
},
teachMode() {
return 'TEACHING_MODE';
},
@ -88,10 +90,9 @@ export default {
},
methods: {
changeOperateMode() {
this.faultMode = !this.faultMode;
let mode = OperateMode.NORMAL;
let mode = OperateMode.FAULT;
if (this.faultMode) {
mode = OperateMode.FAULT;
mode = OperateMode.NORMAL;
}
this.$store.dispatch('training/changeOperateMode', { mode: mode });
},

View File

@ -20,6 +20,7 @@ import ConstConfig from '@/scripts/ConstConfig';
import Create from './create.vue';
import { loadDraftTraining } from '@/api/jmap/training';
import { deleteTraining, publishTraining } from '@/api/trainingManage';
import { OperateMode } from '@/scripts/ConstDic';
export default {
name: 'TrainingList',
@ -190,6 +191,7 @@ export default {
qObj.record = true;
this.$router.replace({ query:{...qObj}});
console.log('编辑', qObj, index, row);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
getTrainingAll(row.id).then(resp => {
this.$store.dispatch('trainingNew/setTrainingDetail', null);
if (resp.data && resp.data.mapLocationJson) {
@ -251,6 +253,7 @@ export default {
const qObj = {...this.$route.query};
delete qObj.record;
this.$router.replace({ query:{...qObj}});
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
try {
const detailResp = await getTrainingAll(data.id);
this.training = detailResp.data;