竞赛平台 实操删除 切换地图 按钮
This commit is contained in:
parent
217ae8c2de
commit
59940ece21
@ -23,7 +23,6 @@
|
||||
<!-- <el-button v-if="isContest" size="small" @click=" fieldTeach">实操教学</el-button> -->
|
||||
<!-- <el-button v-if="isContest" size="small" @click=" fieldExam">实操测验</el-button> -->
|
||||
<el-button v-if="isContest" size="small" @click="goTheoryQuiz">理论考试</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="viewChangeMap">切换地图</el-button>
|
||||
<template v-if="project === 'bjd'">
|
||||
<el-button v-if="running" size="small" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
||||
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- 运行图加载 -->
|
||||
@ -41,7 +40,6 @@
|
||||
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
||||
<scheduling v-if="scheduleLoadShow" ref="scheduling" :group="group" />
|
||||
<scheduling-view v-if="schedulePreviewShow" ref="schedulingView" :group="group" />
|
||||
<change-map v-if="isContest" ref="changeMap" @changeMap="changeMap" />
|
||||
<qr-code ref="qrCode" />
|
||||
</div>
|
||||
</template>
|
||||
@ -49,7 +47,6 @@
|
||||
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import ChangeMap from './dispatherContest/changeMap';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import Scheduling from '@/views/newMap/displayNew/demon/scheduling';
|
||||
import SchedulingView from '@/views/newMap/displayNew/demon/schedulingView';
|
||||
@ -63,7 +60,6 @@ export default {
|
||||
Jl3dDrive,
|
||||
Scheduling,
|
||||
SchedulingView,
|
||||
ChangeMap,
|
||||
DistributeDraft,
|
||||
QrCode
|
||||
},
|
||||
@ -248,12 +244,6 @@ export default {
|
||||
this.$refs.schedulingView && this.$refs.schedulingView.doClose();
|
||||
}
|
||||
},
|
||||
viewChangeMap() {
|
||||
this.$refs.changeMap.doShow();
|
||||
},
|
||||
changeMap(query) {
|
||||
this.$emit('changeMap', query);
|
||||
},
|
||||
fieldPractice() {
|
||||
this.$emit('fieldPractice');
|
||||
},
|
||||
|
@ -1,62 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="切换地图" :visible.sync="dialogVisible" width="20%" center>
|
||||
<el-select v-model="selectMapId" placeholder="请选择地图" style="width: 60%; position: relative; left: 20%;" @change="changeMap">
|
||||
<el-option
|
||||
v-for="item in projectMapList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirm">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getMapListByProjectCode } from '@/api/jmap/map';
|
||||
export default {
|
||||
name:'ChangeMap',
|
||||
data() {
|
||||
return {
|
||||
projectMapList:[],
|
||||
dialogVisible: false,
|
||||
selectMapId:'',
|
||||
selectMapLineCode:''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const projectCode = 'DRTS';
|
||||
getMapListByProjectCode(projectCode).then(res =>{
|
||||
if (res.code === 200) {
|
||||
const projectMapList = res.data;
|
||||
projectMapList.forEach(element => {
|
||||
this.projectMapList.push({id:element.id, lineCode:element.lineCode, name:element.name});
|
||||
});
|
||||
this.selectMapId = this.$route.query.mapId;
|
||||
this.selectMapLineCode = this.$route.query.lineCode;
|
||||
}
|
||||
}).catch(error => { this.$message.error(error.msg); });
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
confirm() {
|
||||
this.dialogVisible = false;
|
||||
const query = Object.assign({}, this.$route.query);
|
||||
query.lineCode = this.selectMapLineCode;
|
||||
query.mapId = this.selectMapId;
|
||||
this.$emit('changeMap', query);
|
||||
},
|
||||
changeMap(mapId) {
|
||||
const map = this.projectMapList.find(map=>{ return map.id == mapId; });
|
||||
if (map) {
|
||||
this.selectMapId = map.id;
|
||||
this.selectMapLineCode = map.lineCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -12,7 +12,6 @@
|
||||
:jlmap3d-fault-show="false"
|
||||
:driver-show="isDrive"
|
||||
:all-style="'top:'+(offset+textStatusHeight)+'px'"
|
||||
@changeMap="changeMap"
|
||||
@fieldPractice="fieldPractice"
|
||||
@goTheoryQuiz="goTheoryQuiz"
|
||||
/>
|
||||
@ -99,9 +98,7 @@ import SelectRole from '@/views/newMap/displayNew/scriptDisplay/component/select
|
||||
// import { setGoodsTryUse } from '@/api/management/goods';
|
||||
|
||||
import {competitionPracticalSceneStart, competitionPracticalSceneExit, competitionPracticalSceneFinish, getEmptyOperationalStatistics} from '@/api/competition';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { createSimulationNew } from '@/api/simulation';
|
||||
import OperationalStatistic from './operationalStatistic.vue';
|
||||
import TestResult from './testResult.vue';
|
||||
import Vue from 'vue';
|
||||
@ -267,25 +264,6 @@ export default {
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
changeMap(query) {
|
||||
clearSimulation(this.group).then(res=>{
|
||||
const data = { mapId: query.mapId, prdType: query.prdType };
|
||||
createSimulationNew(data).then(resp => {
|
||||
this.$store.dispatch('training/over');
|
||||
this.$store.dispatch('training/reset');
|
||||
this.$store.dispatch('map/mapClear');
|
||||
this.$store.dispatch('training/setPrdType', this.currentPrdType); // 改变prdType
|
||||
query.group = resp.data;
|
||||
const newQuery = Object.assign({}, query);
|
||||
newQuery.noFirst = true;
|
||||
this.$router.replace({query: newQuery});
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
this.disabled = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
start(model) { // 开始仿真
|
||||
const data = {
|
||||
time: model.initTime
|
||||
|
Loading…
Reference in New Issue
Block a user