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) {
return request({
@ -709,3 +718,4 @@ export function getMemberInfo(group, memberId) {
method: 'get'
});
}

View File

@ -90,11 +90,13 @@ export default {
roleTypeNew:[
{label: '管理员', value: 'ADMIN', enLabel: 'Admin '},
{label: '教员', value: 'Instructor', enLabel: 'Instructor '},
{label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '},
{label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '},
{label: '观众', value: 'AUDIENCE', enLabel: 'Audience '},
{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: [
{ label: '实训', value: 'Training'},

View File

@ -58,7 +58,7 @@
<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%;margin-top: 25px;">
<div class="apply_box_title">报名成功!:<br> 您的赛事信息如下:
<div class="apply_box_title">报名成功!<br> 您的赛事信息如下:
<br>竞赛名称{{ compition.name }}
<br>竞赛时间{{ compition.startDate }}
<br>姓名{{ formModel.name }}
@ -85,7 +85,7 @@
</div>
</div>
</div>
</template></div></template>
</template>
</div>
</template>

View File

@ -16,7 +16,9 @@ import { mapGetters } from 'vuex';
import { checkLoginLine } from '@/api/login';
import { EventBus } from '@/scripts/event-bus';
import MenuReplay from './menuReplay';
import { getToken } from '@/utils/auth';
import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
export default {
name:'RefereeDisplay',
components: {
@ -52,25 +54,49 @@ export default {
},
height() {
return this.$store.state.app.height;
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.map.mapViewLoadedCount': function (val) { //
this.subscribe();
this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBoxP.style.cursor = '';
},
// 'size.width': function(val) {
// this.setWindowSize();
'$store.state.socket.equipmentStatus': function (val) {
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() {
this.setWindowSize();
}
},
async mounted() {
window.onbeforeunload = this.clearSubscribe;
await this.setWindowSize();
await this.initLoadData();
},
async beforeDestroy() {
this.clearSubscribe();
await this.clearAllTimer();
await this.quit();
await this.$store.dispatch('training/reset');
@ -81,6 +107,47 @@ export default {
async 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() {
this.$store.dispatch('training/reset');

View File

@ -82,7 +82,7 @@ export default {
prop: 'theoryScore',
width:100,
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'; }
},
{
@ -90,7 +90,7 @@ export default {
prop: 'practiceScore',
width:100,
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'; }
},
{
@ -119,13 +119,13 @@ export default {
name: '理论结果',
handleClick: this.handleTheoryResult,
type: '',
showControl: (row) => { return row.status == '5' || row.status == '4'; }
showControl: (row) => { return row.status == '5' || row.status == '4' || row.theoryScore != undefined; }
},
{
name: '实操回放',
handleClick: this.playBack,
type: '',
showControl: (row) => { return row.status == '4'; }
showControl: (row) => { return row.status == '4' || row.status == '6' || row.practiceScore != undefined; }
},
{
name: '修改',
@ -183,6 +183,17 @@ export default {
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` });
},
covert(data) {
if (data != undefined) {
if (data > 0) {
return data;
} else {
return '0';
}
} else {
return '';
}
},
handleAdd() {
const loading = this.$loading({
lock: true,

View File

@ -1,10 +1,12 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="show" top="150px" width="900px" :before-do-close="doClose" :close-on-click-modal="false">
<div v-for="(el,i) in sortedList" :id="'anchor__lst-'+i" :key="i" class="section">
<template v-if="el.children.length">
<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" />
</template>
<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">
<template v-if="el.children.length">
<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" />
</template>
</div>
</div>
<div style="padding-left: 20px;margin-top: 20px;">
<span>考试总分: </span>
@ -13,9 +15,13 @@
</el-dialog>
</template>
<script>
import Question from '@/views/jsxt/competition/theory/question';
import { getTheroyCompetitionResult } from '@/api/competition';
export default {
name:'TheroyResult',
components:{
Question
},
data() {
return {
title:'',
@ -47,7 +53,7 @@ export default {
},
methods:{
doShow({row, raceId}) {
this.loadInitData(raceId, row.userId);
this.loadInitData(raceId, row.id);
this.show = true;
this.title = '【' + row.organization + '】' + row.name + ' 理论结果';
},
@ -55,6 +61,7 @@ export default {
this.show = false;
},
loadInitData(raceId, userId) {
this.examQuestions = [];
getTheroyCompetitionResult(raceId, userId).then((resp)=>{
if (resp.data) {
resp.data.forEach((item, i) => {
@ -67,3 +74,8 @@ export default {
}
};
</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 ConstConfig from '@/scripts/ConstConfig';
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 {
name: 'AddAction',
components:{
@ -451,20 +451,39 @@ export default {
} else {
const actionId = this.modalData.actionVO.id;
modifyScriptAction(group, actionId, 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}`);
});
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=>{
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 {
console.log('error submit!!');

View File

@ -20,7 +20,7 @@
</span>
</div>
<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> -->
</div>
</el-card>
@ -158,8 +158,8 @@ export default {
// memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
// });
// memberVOList = JSON.parse(memberVOList);
const lastData = JSON.stringify(response.data);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
const lastData = JSON.stringify(response.data.memberVOList);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
const actionList = response.data.actionVOList;
@ -218,9 +218,7 @@ export default {
this.loadInitData();
},
modifyAction(row) {
if (!this.drawWay) {
this.$emit('setAction', row);
}
this.$emit('setAction', row);
}
}
};