代码调整

This commit is contained in:
joylink_cuiweidong 2022-10-27 17:30:17 +08:00
parent 5e0146f8da
commit 706ba10aca

View File

@ -4,15 +4,18 @@
</div>
</template>
<script>
import {queryMapListByUser} from '@/api/jmap/map';
import {queryMapListByUser, getPublishMapDetailById} from '@/api/jmap/map';
import Cookies from 'js-cookie';
import { createSimulation } from '@/api/simulation';
import ConstConfig from '@/scripts/ConstConfig';
import { getPublishSingleList, getPublishScenesList } from '@/api/jmap/training';
// getPublishTrainingDetail, loadPublishTraining,
import { getSessionStorage } from '@/utils/auth';
import { launchFullscreen } from '@/utils/screen';
import { getPublishSingleList, getPublishScenesList, getPublishTrainingDetail, loadPublishTraining} from '@/api/jmap/training';
export default {
name:'TrainingManage',
data() {
return {
loadingProjectList: ['login', 'design', 'xty', 'designxty', 'gzb', 'designxty', 'xadt', 'designxadt', 'drts', 'designdrts', 'hlsdrts', 'designhlsdrts', 'teaching', 'designteaching'],
mapList:[],
showList: false,
pagerConfig: {
@ -90,6 +93,11 @@ export default {
}
};
},
computed: {
project() {
return getSessionStorage('project');
}
},
created() {
queryMapListByUser().then(res=>{
this.mapList = [];
@ -144,8 +152,58 @@ export default {
}
return lastData.type;
},
loadScript(index, data) {
loadScript(index, row) {
// mapSystem terminal
// row.mapSystem
const data = {mapId: row.mapId, type:'METRO', memberId: '1'};
// domConfig: Object
// hasExam: false
// hasTraining: false
// singleClient: false
// singleMember: true
getPublishMapDetailById(row.mapId).then(res=>{
const lindeCode = res.data.lineCode;
createSimulation(data).then(resp => {
const query = { lineCode:lindeCode, group: resp.data, mapId: row.mapId, project: this.project, trainingId:row.id};
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations');
}
this.$router.push({ path: `/display/demon`, query: query });
launchFullscreen();
}).catch(error=>{
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
}
this.disabled = false;
});
}).catch(()=>{
console.log('获取地图详情失败');
});
// try {
// const detailResp = await getPublishTrainingDetail(data.id);
// this.training = detailResp.data;
// if (detailResp.data.mapLocationJson) {
// const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
// this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
// }
// if (detailResp.data.playerIdJson) {
// const playerId = JSON .parse(detailResp.data.playerIdJson)[0];
// if (playerId) {
// const member = this.$store.state.training.memberData[playerId];
// this.$store.dispatch('training/setPrdType', this.prdTypeMap[member.type]);
// this.$store.dispatch('training/setRoles', member.type);
// }
// }
// this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
// this.$store.dispatch('trainingNew/setTrainingScore', '');
// await loadPublishTraining(this.group, data.id, {mode: this.teachMode});
// this.$message.success('');
// } catch (e) {
// this.$message.error('');
// }
}
}
};