This commit is contained in:
fan 2020-06-05 14:46:47 +08:00
commit e98dab8d56
8 changed files with 157 additions and 38 deletions

View File

@ -385,6 +385,15 @@ export function modifyScriptAction(group, actionId, data) {
}); });
} }
/** 修改剧本动作(新版) */
export function modifyScriptActionNew(group, data) {
return request({
url: `/api/scriptSimulation/${group}/action/update`,
method: 'put',
data
});
}
/** 分页查询存在的仿真 */ /** 分页查询存在的仿真 */
export function getExistingSimulation(params) { export function getExistingSimulation(params) {
return request({ return request({
@ -709,3 +718,4 @@ export function getMemberInfo(group, memberId) {
method: 'get' method: 'get'
}); });
} }

View File

@ -90,11 +90,13 @@ export default {
roleTypeNew:[ roleTypeNew:[
{label: '管理员', value: 'ADMIN', enLabel: 'Admin '}, {label: '管理员', value: 'ADMIN', enLabel: 'Admin '},
{label: '教员', value: 'Instructor', enLabel: 'Instructor '}, {label: '教员', value: 'Instructor', enLabel: 'Instructor '},
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
{label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '}, {label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '},
{label: '观众', value: 'AUDIENCE', enLabel: 'Audience '}, {label: '观众', value: 'AUDIENCE', enLabel: 'Audience '},
{label: '司机', value: 'DRIVER', enLabel: 'Driver '}, {label: '司机', value: 'DRIVER', enLabel: 'Driver '},
{label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '} {label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '},
{label: '车辆段调度', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '},
{label: '工电调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'},
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '}
], ],
SimulationType: [ SimulationType: [
{ label: '实训', value: 'Training'}, { label: '实训', value: 'Training'},

View File

@ -58,7 +58,7 @@
<div class="img_box"><img :src="SAFS" alt=""></div> <div class="img_box"><img :src="SAFS" alt=""></div>
<div style="width: 100%;text-align:center;margin-top:120px;"><i class="el-icon-success" style="color: green; font-size: 100px;" /></div> <div style="width: 100%;text-align:center;margin-top:120px;"><i class="el-icon-success" style="color: green; font-size: 100px;" /></div>
<div style="width: 100%;margin-top: 25px;"> <div style="width: 100%;margin-top: 25px;">
<div class="apply_box_title">报名成功!:<br> 您的赛事信息如下: <div class="apply_box_title">报名成功!<br> 您的赛事信息如下:
<br>竞赛名称{{ compition.name }} <br>竞赛名称{{ compition.name }}
<br>竞赛时间{{ compition.startDate }} <br>竞赛时间{{ compition.startDate }}
<br>姓名{{ formModel.name }} <br>姓名{{ formModel.name }}
@ -85,7 +85,7 @@
</div> </div>
</div> </div>
</div> </div>
</template></div></template> </template>
</div> </div>
</template> </template>

View File

@ -16,7 +16,9 @@ import { mapGetters } from 'vuex';
import { checkLoginLine } from '@/api/login'; import { checkLoginLine } from '@/api/login';
import { EventBus } from '@/scripts/event-bus'; import { EventBus } from '@/scripts/event-bus';
import MenuReplay from './menuReplay'; import MenuReplay from './menuReplay';
import { getToken } from '@/utils/auth';
import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic'; import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
export default { export default {
name:'RefereeDisplay', name:'RefereeDisplay',
components: { components: {
@ -52,25 +54,49 @@ export default {
}, },
height() { height() {
return this.$store.state.app.height; return this.$store.state.app.height;
},
group() {
return this.$route.query.group;
} }
}, },
watch: { watch: {
'$store.state.map.mapViewLoadedCount': function (val) { // '$store.state.map.mapViewLoadedCount': function (val) { //
this.subscribe();
this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBoxP.style.cursor = ''; this.mapBoxP.style.cursor = '';
}, },
// 'size.width': function(val) { '$store.state.socket.equipmentStatus': function (val) {
// this.setWindowSize(); if (val.length) {
this.statusMessage(val);
}
},
'$store.state.socket.trainStationList': function (val) {
if (val.length) {
this.runFactMessage(val);
}
},
// '$store.state.socket.simulationError': function (val) {
// if (val) {
// this.simulationError(val);
// }
// }, // },
'$store.state.socket.simulationReset': function (val) {
if (val) {
this.simulationReset(val);
}
},
'$store.state.app.windowSizeCount': function() { '$store.state.app.windowSizeCount': function() {
this.setWindowSize(); this.setWindowSize();
} }
}, },
async mounted() { async mounted() {
window.onbeforeunload = this.clearSubscribe;
await this.setWindowSize(); await this.setWindowSize();
await this.initLoadData(); await this.initLoadData();
}, },
async beforeDestroy() { async beforeDestroy() {
this.clearSubscribe();
await this.clearAllTimer(); await this.clearAllTimer();
await this.quit(); await this.quit();
await this.$store.dispatch('training/reset'); await this.$store.dispatch('training/reset');
@ -81,6 +107,47 @@ export default {
async back() { async back() {
// await this.$refs.menuScript.back(); // await this.$refs.menuScript.back();
}, },
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setEquipmentStatus');
},
async runFactMessage(list) {
await this.$store.dispatch('runPlan/updateRunPlanData', list);
await this.$store.dispatch('socket/setTrainStationList');
},
async simulationReset() {
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over');
await this.$store.dispatch('socket/setSimulationReset');
await this.$store.dispatch('socket/setSimulationStart');
await this.$store.dispatch('training/setMapDefaultState');
},
// async simulationError() {
// await this.$store.dispatch('map/clearJlmapTrainView');
// await this.$store.dispatch('map/setTrainWindowShow', false);
// await this.$store.dispatch('socket/setSimulationError');
// await this.$store.dispatch('training/setMapDefaultState');
// this.clearSubscribe();
// this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), {
// confirmButtonText: this.$t('global.confirm'),
// showCancelButton: false,
// type: 'warning'
// }).then(() => {
// this.$emit('back');
// }).catch(() => {
// });
// },
// //
async initLoadData() { async initLoadData() {
this.$store.dispatch('training/reset'); this.$store.dispatch('training/reset');

View File

@ -82,7 +82,7 @@ export default {
prop: 'theoryScore', prop: 'theoryScore',
width:100, width:100,
type: 'tag', type: 'tag',
columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : row.theoryScore || '0'; }, columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : this.covert(row.theoryScore); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
@ -90,7 +90,7 @@ export default {
prop: 'practiceScore', prop: 'practiceScore',
width:100, width:100,
type: 'tag', type: 'tag',
columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : row.practiceScore || '0'; }, columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : this.covert(row.practiceScore); },
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
@ -119,13 +119,13 @@ export default {
name: '理论结果', name: '理论结果',
handleClick: this.handleTheoryResult, handleClick: this.handleTheoryResult,
type: '', type: '',
showControl: (row) => { return row.status == '5' || row.status == '4'; } showControl: (row) => { return row.status == '5' || row.status == '4' || row.theoryScore != undefined; }
}, },
{ {
name: '实操回放', name: '实操回放',
handleClick: this.playBack, handleClick: this.playBack,
type: '', type: '',
showControl: (row) => { return row.status == '4'; } showControl: (row) => { return row.status == '4' || row.status == '6' || row.practiceScore != undefined; }
}, },
{ {
name: '修改', name: '修改',
@ -183,6 +183,17 @@ export default {
this.$refs.theoryResult.doShow({row:row, raceId:this.$route.query.raceId}); this.$refs.theoryResult.doShow({row:row, raceId:this.$route.query.raceId});
// this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` }); // this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` });
}, },
covert(data) {
if (data != undefined) {
if (data > 0) {
return data;
} else {
return '0';
}
} else {
return '';
}
},
handleAdd() { handleAdd() {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,

View File

@ -1,11 +1,13 @@
<template> <template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" top="150px" width="900px" :before-do-close="doClose" :close-on-click-modal="false"> <el-dialog v-dialogDrag :title="title" :visible.sync="show" class="TheroyResult" top="150px" width="900px" :before-do-close="doClose" :close-on-click-modal="false">
<div style="max-height:500px;overflow:auto;">
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section"> <div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
<template v-if="el.children.length"> <template v-if="el.children.length">
<div class="caption">{{ index2UnicodeList[i] }}{{ el.title }}</div> <div class="caption">{{ index2UnicodeList[i] }}{{ el.title }}</div>
<question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" /> <question v-for="(item,j) in el.children" :id="'anchor__lst-'+item.type+'-'+item.index" :key="j" v-model="item.answer" class="context" :option="item" />
</template> </template>
</div> </div>
</div>
<div style="padding-left: 20px;margin-top: 20px;"> <div style="padding-left: 20px;margin-top: 20px;">
<span>考试总分: </span> <span>考试总分: </span>
<span style="font-size: 20px">{{ totalScore }}</span> <span style="font-size: 20px">{{ totalScore }}</span>
@ -13,9 +15,13 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import Question from '@/views/jsxt/competition/theory/question';
import { getTheroyCompetitionResult } from '@/api/competition'; import { getTheroyCompetitionResult } from '@/api/competition';
export default { export default {
name:'TheroyResult', name:'TheroyResult',
components:{
Question
},
data() { data() {
return { return {
title:'', title:'',
@ -47,7 +53,7 @@ export default {
}, },
methods:{ methods:{
doShow({row, raceId}) { doShow({row, raceId}) {
this.loadInitData(raceId, row.userId); this.loadInitData(raceId, row.id);
this.show = true; this.show = true;
this.title = '【' + row.organization + '】' + row.name + ' 理论结果'; this.title = '【' + row.organization + '】' + row.name + ' 理论结果';
}, },
@ -55,6 +61,7 @@ export default {
this.show = false; this.show = false;
}, },
loadInitData(raceId, userId) { loadInitData(raceId, userId) {
this.examQuestions = [];
getTheroyCompetitionResult(raceId, userId).then((resp)=>{ getTheroyCompetitionResult(raceId, userId).then((resp)=>{
if (resp.data) { if (resp.data) {
resp.data.forEach((item, i) => { resp.data.forEach((item, i) => {
@ -67,3 +74,8 @@ export default {
} }
}; };
</script> </script>
<style lang="scss">
.TheroyResult .el-dialog .el-dialog__body{
padding-top:10px !important;
}
</style>

View File

@ -75,7 +75,7 @@ import Vue from 'vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import CommandOperation from './command'; import CommandOperation from './command';
import {addScriptAction, addScriptActionNew, modifyScriptAction, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation'; import {addScriptAction, addScriptActionNew, modifyScriptAction, modifyScriptActionNew, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation';
export default { export default {
name: 'AddAction', name: 'AddAction',
components:{ components:{
@ -451,6 +451,23 @@ export default {
} else { } else {
const actionId = this.modalData.actionVO.id; const actionId = this.modalData.actionVO.id;
if (this.drawWay) {
data.id = actionId;
modifyScriptActionNew(group, data).then(response=>{
this.modifying = false;
this.isNotModify = true;
this.$emit('setDisabled', this.isNotModify);
this.buttonName = this.$t('scriptRecord.addConversitionButton');
this.operateType = 'add';
this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess'));
this.$emit('create');
// this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]);
this.initActionData();
}).catch(error => {
this.modifying = false;
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
});
} else {
modifyScriptAction(group, actionId, data).then(response=>{ modifyScriptAction(group, actionId, data).then(response=>{
this.modifying = false; this.modifying = false;
this.isNotModify = true; this.isNotModify = true;
@ -466,6 +483,8 @@ export default {
this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`);
}); });
} }
}
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;

View File

@ -20,7 +20,7 @@
</span> </span>
</div> </div>
<div class="btnGroup"> <div class="btnGroup">
<el-button v-if="actionInfo.visible && !drawWay" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button> <el-button v-if="actionInfo.visible" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> --> <!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div> </div>
</el-card> </el-card>
@ -158,8 +158,8 @@ export default {
// memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label); // memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
// }); // });
// memberVOList = JSON.parse(memberVOList); // memberVOList = JSON.parse(memberVOList);
const lastData = JSON.stringify(response.data); const lastData = JSON.stringify(response.data.memberVOList);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
const actionList = response.data.actionVOList; const actionList = response.data.actionVOList;
@ -218,11 +218,9 @@ export default {
this.loadInitData(); this.loadInitData();
}, },
modifyAction(row) { modifyAction(row) {
if (!this.drawWay) {
this.$emit('setAction', row); this.$emit('setAction', row);
} }
} }
}
}; };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>