This commit is contained in:
zyy 2020-06-05 10:14:23 +08:00
commit 3b137ffae9
10 changed files with 379 additions and 58 deletions

View File

@ -177,3 +177,58 @@ export function getPracticalCompetitionResult(competitionId) {
method: 'get'
});
}
/** 回访准备 */
export function playBackReady(params) {
return request({
url: `/api/v1/simulationRecord/playback/ready`,
method: 'get',
params
});
}
/** 设置倍速 */
export function setPlaySpeed(params) {
return request({
url: `/api/v1/simulationRecord/playback/setPlaySpeed`,
method: 'get',
params
});
}
/** 开始播放 */
export function startPlaying(params) {
return request({
url: `/api/v1/simulationRecord/playback/startPlaying`,
method: 'get',
params
});
}
/** 暂停播放 */
export function playingPause(params) {
return request({
url: `/api/v1/simulationRecord/playback/pausePlaying`,
method: 'get',
params
});
}
/** 结束播放 */
export function endPlaying(params) {
return request({
url: `/api/v1/simulationRecord/playback/endPlaying`,
method: 'get',
params
});
}
/** 从暂停中播放 */
export function fromPauseToPlay(params) {
return request({
url: `/api/v1/simulationRecord/playback/playing`,
method: 'get',
params
});
}

View File

@ -38,8 +38,8 @@ function handle(state, data) {
case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息
state.quitCoversition = msg;
break;
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
case 'Simulation_PlayBack_Finish': // 竞赛裁判系统裁判员回放结束推送
state.playBackFinish++; // 竞赛裁判系统裁判员回放结束推送
break;
case 'Simulation_Over': // 用户退出仿真推送消息
state.simulationOver++; // 用户退出仿真推送消息
@ -212,7 +212,7 @@ const socket = {
simulationRoleList:[], // 设置仿真的聊天角色信息
simulationScriptTip:{}, // 剧本推送提示信息
scriptFinish:0, // 剧本执行完成提示信息
competitionStart:0, // 竞赛裁判系统裁判开始考试推送消息
playBackFinish:0, // 竞赛裁判系统裁判回放结束推送
jointRoomPrepare: false, // 演练房间准备状态
equipmentStatus: [], // 仿真-设备状态消息
trainStationList: [], // 仿真-列车实际到发车站消息

View File

@ -4,8 +4,8 @@ export function getBaseUrl() {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康

View File

@ -4,7 +4,7 @@
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div>
<div class="context">
<div>{{ `得分:${operateScore}` }}</div>
<!--<div>{{ `得分:${operateScoreData}` }}</div>-->
<!-- <el-form ref="form" :model="resultModel" size="mini">
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
@ -13,14 +13,11 @@
<span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span>
</el-form-item>
</el-form> -->
<!--<el-table :data="tableData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary :span-method="objectSpanMethod">-->
<!--<el-table-column prop="title" label="题目">-->
<!--<template slot-scope="scope">-->
<!--<div v-html="scope.row.title" />-->
<!--</template>-->
<!--</el-table-column>>-->
<!--<el-table-column prop="score" label="分值" />-->
<!--<el-table-column prop="goal" label="得分" />-->
<el-table :data="operateScoreData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary>
<el-table-column prop="name" label="题目" />
<el-table-column prop="description" label="描述" />
<el-table-column prop="totalScore" label="分值" />
<el-table-column prop="score" label="得分" />
<!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="correctAnswer" label="答题结果" />-->
<!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="explain" label="说明" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointIndex" label="得分点">-->
@ -31,7 +28,7 @@
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointScore" label="得分点分值" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointGoal" label="得分点得分" />-->
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />-->
<!--</el-table>-->
</el-table>
</div>
<div class="draf_box">
<el-button type="primary " @click="back">返回首页</el-button>
@ -71,7 +68,7 @@ export default {
],
loading: true,
tableData: [],
operateScore: 0
operateScoreData: []
};
},
computed: {
@ -91,7 +88,7 @@ export default {
sums[index] = this.$t('exam.totalScore');
return;
}
if (column.property === 'score' || column.property === 'goal' || column.property === 'scoringPointScore' || column.property === 'scoringPointGoal') {
if (column.property === 'score' || column.property === 'totalScore') {
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
@ -128,7 +125,7 @@ export default {
} else if (this.$route.query.type == 'operate') {
this.tableData = [];
getPracticalCompetitionResult(this.$route.query.raceId).then(res => {
this.operateScore = res.data;
this.operateScoreData = res.data;
});
// this.operateData.forEach(item => {
// if (item.scoringPoints && item.scoringPoints.length) {

View File

@ -7,7 +7,7 @@
</template>
<script>
import { refereeEnterSimulation, loadingPaper, getRaceUserList, getRaceById } from '@/api/competition';
import { refereeEnterSimulation, loadingPaper, getRaceUserList, getRaceById, playBackReady } from '@/api/competition';
import { getPublishMapInfo } from '@/api/jmap/map';
import editScore from './editScore';
@ -227,8 +227,15 @@ export default {
playBack(index, row) {
const group = row.group;
getPublishMapInfo(this.mapId).then(resp=>{
playBackReady({group:group}).then(res=>{
if (res.data) {
const query = { lineCode: resp.data.lineCode, mapId: this.mapId, group: group, raceId: this.$route.query.raceId, userName:row.name};
this.$router.push({ path: `/refereeJsxtDisplay`, query: query});
} else {
this.$messageBox('回放数据出错!');
}
});
});
},
gradeScore(index, row) { //

View File

@ -1,15 +1,16 @@
<template>
<div>
<div class="menuReplay">
<div class="replay">
<span class="el-icon-caret-right" />
<div class="replay" @click="startPlaying">
<span v-if="isPlaying" class="ToPause" style="padding: 3px 0px">||</span>
<span v-else class="el-icon-caret-right" />
</div>
<div class="playSpeedGroup">
<div class="speedAdd">
<div class="speedAdd" :style="isAddDisabled?'cursor:no-drop;':''" @click="addSpeed">
<span class="el-icon-plus" />
</div>
<div class="speedNum">{{ playSpeed }}</div>
<div class="speedMinus">
<div class="speedNum">{{ playSpeedList[playSpeedIndex].name }}</div>
<div class="speedMinus" :style="isMinusDisabled?'cursor:no-drop;':''" @click="minusSpeed">
<span class="el-icon-minus" />
</div>
</div>
@ -22,6 +23,7 @@
<script>
import { Notification } from 'element-ui';
import ChatBox from '@/views/newMap/jointTrainingNew/chatView/chatBox';
import {setPlaySpeed, startPlaying, playingPause, endPlaying, fromPauseToPlay} from '@/api/competition';
export default {
name:'MenuPlay',
components:{
@ -29,8 +31,23 @@ export default {
},
data() {
return {
playSpeed:'',
userRole:'AUDIENCE'
playSpeedIndex:5,
playSpeedList:[
{level:'-5', name:'-5X'},
{level:'-4', name:'-4X'},
{level:'-3', name:'-3X'},
{level:'-2', name:'-2X'},
{level:'-1', name:'-1X'},
{level:'1', name:'1X'},
{level:'2', name:'2X'},
{level:'3', name:'3X'},
{level:'4', name:'4X'},
{level:'5', name:'5X'}
],
userRole:'AUDIENCE',
isFirstPlay:true,
isPlaying:false
};
},
computed:{
@ -39,6 +56,24 @@ export default {
},
group() {
return this.$route.query.group;
},
isAddDisabled() {
return this.playSpeedIndex >= this.playSpeedList.length - 1;
},
isMinusDisabled() {
return this.playSpeedIndex <= 0;
}
},
watch: {
'$store.state.socket.playBackFinish':function() {
this.isPlaying = false;
this.isFirstPlay = true;
}
},
beforeDestroy() {
if (this.isPlaying) {
endPlaying({}).then(res=>{
});
}
},
methods:{
@ -47,11 +82,70 @@ export default {
history.go(-1);
Notification.closeAll();
});
},
addSpeed() {
if (this.playSpeedIndex < this.playSpeedList.length - 1) {
this.playSpeedIndex++;
if (this.isPlaying) {
//
playingPause({}).then(res=>{
this.isPlaying = false;
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
});
});
} else {
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
});
}
}
},
minusSpeed() {
if (this.playSpeedIndex > 0) {
this.playSpeedIndex--;
if (this.isPlaying) {
//
playingPause({}).then(res=>{
this.isPlaying = false;
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
});
});
} else {
setPlaySpeed({level:this.playSpeedList[this.playSpeedIndex].level}).then(res=>{
});
}
}
},
startPlaying() {
if (this.isPlaying) {
//
playingPause({}).then(res=>{
this.isPlaying = false;
});
} else {
if (this.isFirstPlay) {
//
startPlaying({}).then(res=>{
this.isPlaying = true;
this.isFirstPlay = false;
});
} else {
//
fromPauseToPlay({}).then(res=>{
this.isPlaying = true;
});
}
}
}
}
};
</script>
<style lang="scss" scoped>
.ToPause{
display: inline-block;
}
.menuReplay{
position: absolute;
width: 215px;

View File

@ -7,7 +7,18 @@
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<menu-demon-joint ref="demonMenu" :group="group" :data-error="dataError" :user-role="userRole" :device-code="deviceCode" @getUserRole="getUserRole" @hidepanel="hidepanel" @showIbp="showIbp" />
<menu-demon-joint
ref="demonMenu"
:group="group"
:data-error="dataError"
:user-role="userRole"
:device-code="deviceCode"
:countdown-time="countdownTime"
@getUserRole="getUserRole"
@hidepanel="hidepanel"
@showIbp="showIbp"
@startCounting="startCounting"
/>
<menu-demon-schema
ref="menuSchema"
:group="group"
@ -27,6 +38,7 @@
<join-run-plan-view ref="runPlanView" :group="group" />
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
<js-question v-if="project==='jsxt'" :offset="offset" :question-list="questionList" />
</div>
</div>
@ -36,6 +48,7 @@
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
import MenuDemonJoint from './menuDemon';
import MenuDemonSchema from './menuSchema';
import JsQuestion from './jsQuestion';
import JoinFaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
@ -48,7 +61,7 @@ import { checkLoginLine } from '@/api/login';
import { loadNewMapDataByGroup } from '@/utils/loaddata';
import { getUserRolesNew, deljointTrainRoomNew} from '@/api/jointTraining';
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
import {getRaceUserById} from '@/api/competition';
import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
import { getSessionStorage } from '@/utils/auth';
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
@ -57,6 +70,7 @@ import ibpData from '@/ibp/constant/ibpData';
import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui';
import Vue from 'vue';
import localStore from 'storejs';
export default {
name: 'JointTrainingDraft',
@ -71,7 +85,8 @@ export default {
menuSystemTime,
Jl3dDrive,
Jl3dMaintainer,
IbpPlate
IbpPlate,
JsQuestion
},
data() {
return {
@ -98,7 +113,11 @@ export default {
stationList: [],
showSelectStation: false,
mapViewLoadedOver: false,
dataError: false
dataError: false,
countdownTime: '00:00:00',
practicalTime: 0,
countdown: null,
questionList: []
};
},
computed: {
@ -209,6 +228,9 @@ export default {
await this.$store.dispatch('training/reset');
await this.$store.dispatch('map/mapClear');
await this.$store.dispatch('training/setGroup', '');
if (this.countdown) {
clearInterval(this.countdown);
}
Message.closeAll();
},
methods: {
@ -367,6 +389,24 @@ export default {
if (this.project == 'jsxt' ) {
resp = await getRaceUserById(this.$route.query.raceId);
resp.data.userRole = resp.data.role;
const paperResp = await getTestPaperDatail(this.$route.query.raceId);
if (paperResp.data && paperResp.data.practicalQuestions) {
this.questionList = [];
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
const startTime = localStore.get(storeKey);
if (startTime) {
const dt = new Date().getTime() - startTime;
this.practicalTime = paperResp.data.practicalExamTime * 60 - Math.floor(dt / 1000);
} else {
this.practicalTime = paperResp.data.practicalExamTime * 60;
const storeValue = new Date().getTime();
localStore.set(storeKey, storeValue);
}
this.countdownTime = this.computationTime(this.practicalTime);
paperResp.data.practicalQuestions.forEach(elem => {
this.questionList.push({name: elem.question.name, description:elem.question.description});
});
}
} else if (this.project == 'refereeJsxt') {
resp['code'] = 200;
resp.data['userRole'] = 'ADMIN';
@ -395,6 +435,18 @@ export default {
this.endViewLoading();
}
},
startCounting() {
this.countdown = setInterval(() => {
if (this.practicalTime <= 0) {
if (this.countdown) {
clearInterval(this.countdown);
}
this.$refs.demonMenu.submit();
}
this.practicalTime--;
this.countdownTime = this.computationTime(this.practicalTime);
}, 1000);
},
async getTrainDetail() {
try {
await loadNewMapDataByGroup(this.group);
@ -419,6 +471,28 @@ export default {
faultChooseShow() {
this.$refs.faultChoose.doShow();
},
computationTime(time) {
let hours = Math.floor(time / 3600);
const newTime = time % 3600;
let minutes = Math.floor(newTime / 60) + '';
let seconds = newTime % 60;
if (hours < 0) {
hours = '00';
} else if (hours < 10) {
hours = '0' + hours;
}
if (minutes < 0) {
minutes = '00';
} else if (minutes < 10) {
minutes = '0' + minutes;
}
if (seconds < 0) {
seconds = '00';
} else if (seconds < 10) {
seconds = '0' + seconds;
}
return hours + ':' + minutes + ':' + seconds;
},
showdriving() {
this.panelShow = true;
this.drivingShow = false;

View File

@ -0,0 +1,94 @@
<template>
<div class="menuTrainListOut" :style="{top: offset-5 +'px'}">
<div v-if="drawer" class="menuTrainListContent">
<div>
<div v-for="(item, index) in questionList" :key="index">
<div style="text-align: center;font-size: 16px;">{{ item.name }}</div>
<div style="text-align: left;font-size: 14px;margin-top: 5px;">{{ '描述:'+item.description }}</div>
</div>
</div>
<div class="menuTrainListBtn1In" style=";position: absolute; top: 98%;left:150px;z-index: 2;" @click="clickBtn">
<i class="el-icon-more" style="font-size: 20px;transform-origin: 50% 50%;" />
</div>
</div>
<div v-else class="menuTrainListBtn1" @click="clickBtn">
<div class="menuTrainListBtn1In">
<i class="el-icon-more" style="font-size: 20px;transform-origin: 50% 50%;" />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'JsQuestion',
props: {
offset: {
type: Number,
required: true
},
questionList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
drawer: true
};
},
methods: {
clickBtn() {
this.drawer = !this.drawer;
}
}
};
</script>
<style lang="scss" scoped>
.menuTrainListBtn1In{
width: 40px;
height: 20px;
background: #fff;
text-align: center;
border-radius: 0 0 6px 6px;
cursor:pointer;
/*border: 1px #adadad solid;*/
}
.menuTrainListBtn1{
position: absolute;
}
.menuTrainListContent{
background: #fff;
text-align: center;
border-radius:0 0 6px 6px;
padding: 10px;
position: absolute;
width: 350px;
left: -150px;
z-index: 3;
cursor:pointer;
}
.menuTrainListOut{
position: absolute;
right: 30%;
height: 70%;
}
.menuTrainList{
width: 400px;
height:100%;
border-radius: 10px 0px 0px 10px;
// padding: 5px;
background: #fff;
}
.topTrainListInfo,.bottomTrainListInfo{
padding: 10px 10px;
background: #cde2ef;
font-size: 13px;
border-radius: 5px 0px 0px 0px;
}
</style>

View File

@ -12,6 +12,7 @@
<!-- <el-button type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> -->
</el-button-group>
<template v-if="project==='jsxt'">
<div style="background: #FFF;display: inline-block;height: 40px;line-height: 40px;padding: 0 5px;border: 2px solid #F00;border-radius: 6px;margin-right: 8px;">{{ '剩余时间:'+countdownTime }}</div>
<el-button :disabled="!jsStart" type="success" @click="startCompetition">开始</el-button>
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
</template>
@ -36,6 +37,7 @@ import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice';
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
import { prefixIntrger } from '@/utils/date';
import localStore from 'storejs';
export default {
name: 'MenuDemonJoint',
@ -56,6 +58,10 @@ export default {
type: String,
required: true
},
countdownTime: {
type: String,
required: true
},
deviceCode: {
type: String,
default() {
@ -127,11 +133,6 @@ export default {
'$store.state.map.runPlanStatus': function (val) {
this.isDisable = val;
},
// '$store.state.socket.competitionStart':function(val) {
// if (val) {
// this.startCompetition();
// }
// },
'$store.state.socket.simulationOver':function(val) {
if (val && this.project === 'refereeJsxt') {
this.$router.go(-1);
@ -315,6 +316,7 @@ export default {
},
startCompetition() {
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
this.$emit('startCounting');
this.jsStart = false;
}).catch(()=> {
this.$message.error('开始竞赛失败');
@ -326,12 +328,7 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
// this.$router.go(-1);
this.submit();
}).catch(()=> {
this.$message.error('提交试卷失败!');
});
});
},
refeeEndCompetition() {
@ -343,10 +340,13 @@ export default {
});
},
submit() {
// this.$store.dispatch('exam/over').then(() => {
// this.$store.dispatch('trainingList/clearTrainingList');
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
localStore.remove(storeKey);
this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
// });
}).catch(()=> {
this.$message.error('提交试卷失败!');
});
}
}
};