Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
3b137ffae9
@ -177,3 +177,58 @@ export function getPracticalCompetitionResult(competitionId) {
|
|||||||
method: 'get'
|
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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ function handle(state, data) {
|
|||||||
case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息
|
case 'Simulation_Exist_Conversation': // 综合演练仿真-聊天界面用户退出群聊发送消息
|
||||||
state.quitCoversition = msg;
|
state.quitCoversition = msg;
|
||||||
break;
|
break;
|
||||||
case 'Competition_Practical': // 竞赛裁判系统裁判员开始考试推送消息
|
case 'Simulation_PlayBack_Finish': // 竞赛裁判系统裁判员回放结束推送
|
||||||
state.competitionStart++; // 竞赛裁判系统裁判员开始考试推送消息
|
state.playBackFinish++; // 竞赛裁判系统裁判员回放结束推送
|
||||||
break;
|
break;
|
||||||
case 'Simulation_Over': // 用户退出仿真推送消息
|
case 'Simulation_Over': // 用户退出仿真推送消息
|
||||||
state.simulationOver++; // 用户退出仿真推送消息
|
state.simulationOver++; // 用户退出仿真推送消息
|
||||||
@ -212,7 +212,7 @@ const socket = {
|
|||||||
simulationRoleList:[], // 设置仿真的聊天角色信息
|
simulationRoleList:[], // 设置仿真的聊天角色信息
|
||||||
simulationScriptTip:{}, // 剧本推送提示信息
|
simulationScriptTip:{}, // 剧本推送提示信息
|
||||||
scriptFinish:0, // 剧本执行完成提示信息
|
scriptFinish:0, // 剧本执行完成提示信息
|
||||||
competitionStart:0, // 竞赛裁判系统裁判开始考试推送消息
|
playBackFinish:0, // 竞赛裁判系统裁判回放结束推送
|
||||||
jointRoomPrepare: false, // 演练房间准备状态
|
jointRoomPrepare: false, // 演练房间准备状态
|
||||||
equipmentStatus: [], // 仿真-设备状态消息
|
equipmentStatus: [], // 仿真-设备状态消息
|
||||||
trainStationList: [], // 仿真-列车实际到发车站消息
|
trainStationList: [], // 仿真-列车实际到发车站消息
|
||||||
|
@ -4,8 +4,8 @@ export function getBaseUrl() {
|
|||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
|
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="context">
|
<div class="context">
|
||||||
<div>{{ `得分:${operateScore}分` }}</div>
|
<!--<div>{{ `得分:${operateScoreData}分` }}</div>-->
|
||||||
<!-- <el-form ref="form" :model="resultModel" size="mini">
|
<!-- <el-form ref="form" :model="resultModel" size="mini">
|
||||||
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
|
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
|
||||||
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
|
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
|
||||||
@ -13,14 +13,11 @@
|
|||||||
<span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span>
|
<span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form> -->
|
</el-form> -->
|
||||||
<!--<el-table :data="tableData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary :span-method="objectSpanMethod">-->
|
<el-table :data="operateScoreData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary>
|
||||||
<!--<el-table-column prop="title" label="题目">-->
|
<el-table-column prop="name" label="题目" />
|
||||||
<!--<template slot-scope="scope">-->
|
<el-table-column prop="description" label="描述" />
|
||||||
<!--<div v-html="scope.row.title" />-->
|
<el-table-column prop="totalScore" label="分值" />
|
||||||
<!--</template>-->
|
<el-table-column prop="score" label="得分" />
|
||||||
<!--</el-table-column>>-->
|
|
||||||
<!--<el-table-column prop="score" label="分值" />-->
|
|
||||||
<!--<el-table-column prop="goal" 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="correctAnswer" label="答题结果" />-->
|
||||||
<!--<el-table-column v-if="this.$route.query.type ==='theory'" prop="explain" 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="得分点">-->
|
<!--<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="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="scoringPointGoal" label="得分点得分" />-->
|
||||||
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />-->
|
<!--<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointExplain" label="得分点说明" />-->
|
||||||
<!--</el-table>-->
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="draf_box">
|
<div class="draf_box">
|
||||||
<el-button type="primary " @click="back">返回首页</el-button>
|
<el-button type="primary " @click="back">返回首页</el-button>
|
||||||
@ -71,7 +68,7 @@ export default {
|
|||||||
],
|
],
|
||||||
loading: true,
|
loading: true,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
operateScore: 0
|
operateScoreData: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -91,7 +88,7 @@ export default {
|
|||||||
sums[index] = this.$t('exam.totalScore');
|
sums[index] = this.$t('exam.totalScore');
|
||||||
return;
|
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]));
|
const values = data.map(item => Number(item[column.property]));
|
||||||
if (!values.every(value => isNaN(value))) {
|
if (!values.every(value => isNaN(value))) {
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
@ -128,7 +125,7 @@ export default {
|
|||||||
} else if (this.$route.query.type == 'operate') {
|
} else if (this.$route.query.type == 'operate') {
|
||||||
this.tableData = [];
|
this.tableData = [];
|
||||||
getPracticalCompetitionResult(this.$route.query.raceId).then(res => {
|
getPracticalCompetitionResult(this.$route.query.raceId).then(res => {
|
||||||
this.operateScore = res.data;
|
this.operateScoreData = res.data;
|
||||||
});
|
});
|
||||||
// this.operateData.forEach(item => {
|
// this.operateData.forEach(item => {
|
||||||
// if (item.scoringPoints && item.scoringPoints.length) {
|
// if (item.scoringPoints && item.scoringPoints.length) {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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 { getPublishMapInfo } from '@/api/jmap/map';
|
||||||
import editScore from './editScore';
|
import editScore from './editScore';
|
||||||
|
|
||||||
@ -227,8 +227,15 @@ export default {
|
|||||||
playBack(index, row) {
|
playBack(index, row) {
|
||||||
const group = row.group;
|
const group = row.group;
|
||||||
getPublishMapInfo(this.mapId).then(resp=>{
|
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};
|
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});
|
this.$router.push({ path: `/refereeJsxtDisplay`, query: query});
|
||||||
|
} else {
|
||||||
|
this.$messageBox('回放数据出错!');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
gradeScore(index, row) { // 裁判打分
|
gradeScore(index, row) { // 裁判打分
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="menuReplay">
|
<div class="menuReplay">
|
||||||
<div class="replay">
|
<div class="replay" @click="startPlaying">
|
||||||
<span class="el-icon-caret-right" />
|
<span v-if="isPlaying" class="ToPause" style="padding: 3px 0px">||</span>
|
||||||
|
<span v-else class="el-icon-caret-right" />
|
||||||
</div>
|
</div>
|
||||||
<div class="playSpeedGroup">
|
<div class="playSpeedGroup">
|
||||||
<div class="speedAdd">
|
<div class="speedAdd" :style="isAddDisabled?'cursor:no-drop;':''" @click="addSpeed">
|
||||||
<span class="el-icon-plus" />
|
<span class="el-icon-plus" />
|
||||||
</div>
|
</div>
|
||||||
<div class="speedNum">{{ playSpeed }}</div>
|
<div class="speedNum">{{ playSpeedList[playSpeedIndex].name }}</div>
|
||||||
<div class="speedMinus">
|
<div class="speedMinus" :style="isMinusDisabled?'cursor:no-drop;':''" @click="minusSpeed">
|
||||||
<span class="el-icon-minus" />
|
<span class="el-icon-minus" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -22,6 +23,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Notification } from 'element-ui';
|
import { Notification } from 'element-ui';
|
||||||
import ChatBox from '@/views/newMap/jointTrainingNew/chatView/chatBox';
|
import ChatBox from '@/views/newMap/jointTrainingNew/chatView/chatBox';
|
||||||
|
import {setPlaySpeed, startPlaying, playingPause, endPlaying, fromPauseToPlay} from '@/api/competition';
|
||||||
export default {
|
export default {
|
||||||
name:'MenuPlay',
|
name:'MenuPlay',
|
||||||
components:{
|
components:{
|
||||||
@ -29,8 +31,23 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
playSpeed:'',
|
playSpeedIndex:5,
|
||||||
userRole:'AUDIENCE'
|
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:{
|
computed:{
|
||||||
@ -39,6 +56,24 @@ export default {
|
|||||||
},
|
},
|
||||||
group() {
|
group() {
|
||||||
return this.$route.query.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:{
|
methods:{
|
||||||
@ -47,11 +82,70 @@ export default {
|
|||||||
history.go(-1);
|
history.go(-1);
|
||||||
Notification.closeAll();
|
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>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.ToPause{
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.menuReplay{
|
.menuReplay{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 215px;
|
width: 215px;
|
||||||
|
@ -7,7 +7,18 @@
|
|||||||
<transition name="el-zoom-in-bottom">
|
<transition name="el-zoom-in-bottom">
|
||||||
<map-system-draft ref="mapCanvas" @back="back" />
|
<map-system-draft ref="mapCanvas" @back="back" />
|
||||||
</transition>
|
</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
|
<menu-demon-schema
|
||||||
ref="menuSchema"
|
ref="menuSchema"
|
||||||
:group="group"
|
:group="group"
|
||||||
@ -27,6 +38,7 @@
|
|||||||
<join-run-plan-view ref="runPlanView" :group="group" />
|
<join-run-plan-view ref="runPlanView" :group="group" />
|
||||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
|
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" :right="right" />
|
||||||
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
|
<menu-train-list v-if="prdType=='02'" @setCenter="setCenter" />
|
||||||
|
<js-question v-if="project==='jsxt'" :offset="offset" :question-list="questionList" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -36,6 +48,7 @@
|
|||||||
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
||||||
import MenuDemonJoint from './menuDemon';
|
import MenuDemonJoint from './menuDemon';
|
||||||
import MenuDemonSchema from './menuSchema';
|
import MenuDemonSchema from './menuSchema';
|
||||||
|
import JsQuestion from './jsQuestion';
|
||||||
import JoinFaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
|
import JoinFaultChoose from '@/views/newMap/displayNew/demon/faultChoose';
|
||||||
import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
|
import JoinRunPlanLoad from '@/views/newMap/displayNew/demon/runPlanLoad';
|
||||||
import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
|
import JoinRunPlanView from '@/views/newMap/displayNew/demon/runPlanView';
|
||||||
@ -48,7 +61,7 @@ import { checkLoginLine } from '@/api/login';
|
|||||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||||
import { getUserRolesNew, deljointTrainRoomNew} from '@/api/jointTraining';
|
import { getUserRolesNew, deljointTrainRoomNew} from '@/api/jointTraining';
|
||||||
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||||
import {getRaceUserById} from '@/api/competition';
|
import {getRaceUserById, getTestPaperDatail} from '@/api/competition';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||||
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
|
import Jl3dMaintainer from '@/views/jlmap3d/maintainer/jl3dmaintainer';
|
||||||
@ -57,6 +70,7 @@ import ibpData from '@/ibp/constant/ibpData';
|
|||||||
import { timeFormat } from '@/utils/date';
|
import { timeFormat } from '@/utils/date';
|
||||||
import { Message } from 'element-ui';
|
import { Message } from 'element-ui';
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import localStore from 'storejs';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JointTrainingDraft',
|
name: 'JointTrainingDraft',
|
||||||
@ -71,7 +85,8 @@ export default {
|
|||||||
menuSystemTime,
|
menuSystemTime,
|
||||||
Jl3dDrive,
|
Jl3dDrive,
|
||||||
Jl3dMaintainer,
|
Jl3dMaintainer,
|
||||||
IbpPlate
|
IbpPlate,
|
||||||
|
JsQuestion
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -98,7 +113,11 @@ export default {
|
|||||||
stationList: [],
|
stationList: [],
|
||||||
showSelectStation: false,
|
showSelectStation: false,
|
||||||
mapViewLoadedOver: false,
|
mapViewLoadedOver: false,
|
||||||
dataError: false
|
dataError: false,
|
||||||
|
countdownTime: '00:00:00',
|
||||||
|
practicalTime: 0,
|
||||||
|
countdown: null,
|
||||||
|
questionList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -209,6 +228,9 @@ export default {
|
|||||||
await this.$store.dispatch('training/reset');
|
await this.$store.dispatch('training/reset');
|
||||||
await this.$store.dispatch('map/mapClear');
|
await this.$store.dispatch('map/mapClear');
|
||||||
await this.$store.dispatch('training/setGroup', '');
|
await this.$store.dispatch('training/setGroup', '');
|
||||||
|
if (this.countdown) {
|
||||||
|
clearInterval(this.countdown);
|
||||||
|
}
|
||||||
Message.closeAll();
|
Message.closeAll();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -367,6 +389,24 @@ export default {
|
|||||||
if (this.project == 'jsxt' ) {
|
if (this.project == 'jsxt' ) {
|
||||||
resp = await getRaceUserById(this.$route.query.raceId);
|
resp = await getRaceUserById(this.$route.query.raceId);
|
||||||
resp.data.userRole = resp.data.role;
|
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') {
|
} else if (this.project == 'refereeJsxt') {
|
||||||
resp['code'] = 200;
|
resp['code'] = 200;
|
||||||
resp.data['userRole'] = 'ADMIN';
|
resp.data['userRole'] = 'ADMIN';
|
||||||
@ -395,6 +435,18 @@ export default {
|
|||||||
this.endViewLoading();
|
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() {
|
async getTrainDetail() {
|
||||||
try {
|
try {
|
||||||
await loadNewMapDataByGroup(this.group);
|
await loadNewMapDataByGroup(this.group);
|
||||||
@ -419,6 +471,28 @@ export default {
|
|||||||
faultChooseShow() {
|
faultChooseShow() {
|
||||||
this.$refs.faultChoose.doShow();
|
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() {
|
showdriving() {
|
||||||
this.panelShow = true;
|
this.panelShow = true;
|
||||||
this.drivingShow = false;
|
this.drivingShow = false;
|
||||||
|
94
src/views/newMap/jointTrainingNew/jsQuestion.vue
Normal file
94
src/views/newMap/jointTrainingNew/jsQuestion.vue
Normal 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>
|
||||||
|
|
@ -12,6 +12,7 @@
|
|||||||
<!-- <el-button type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> -->
|
<!-- <el-button type="primary" :loading="backLoading" @click="back">{{ $t('global.back') }}</el-button> -->
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
<template v-if="project==='jsxt'">
|
<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="success" @click="startCompetition">开始</el-button>
|
||||||
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
|
<el-button :disabled="jsStart" type="danger" @click="endCompetition">提交</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -36,6 +37,7 @@ import { getSessionStorage } from '@/utils/auth';
|
|||||||
import RealDevice from './menuDraft/realDevice';
|
import RealDevice from './menuDraft/realDevice';
|
||||||
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
|
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
|
||||||
import { prefixIntrger } from '@/utils/date';
|
import { prefixIntrger } from '@/utils/date';
|
||||||
|
import localStore from 'storejs';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuDemonJoint',
|
name: 'MenuDemonJoint',
|
||||||
@ -56,6 +58,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
countdownTime: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
deviceCode: {
|
deviceCode: {
|
||||||
type: String,
|
type: String,
|
||||||
default() {
|
default() {
|
||||||
@ -127,11 +133,6 @@ export default {
|
|||||||
'$store.state.map.runPlanStatus': function (val) {
|
'$store.state.map.runPlanStatus': function (val) {
|
||||||
this.isDisable = val;
|
this.isDisable = val;
|
||||||
},
|
},
|
||||||
// '$store.state.socket.competitionStart':function(val) {
|
|
||||||
// if (val) {
|
|
||||||
// this.startCompetition();
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
'$store.state.socket.simulationOver':function(val) {
|
'$store.state.socket.simulationOver':function(val) {
|
||||||
if (val && this.project === 'refereeJsxt') {
|
if (val && this.project === 'refereeJsxt') {
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
@ -315,6 +316,7 @@ export default {
|
|||||||
},
|
},
|
||||||
startCompetition() {
|
startCompetition() {
|
||||||
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
|
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
|
||||||
|
this.$emit('startCounting');
|
||||||
this.jsStart = false;
|
this.jsStart = false;
|
||||||
}).catch(()=> {
|
}).catch(()=> {
|
||||||
this.$message.error('开始竞赛失败');
|
this.$message.error('开始竞赛失败');
|
||||||
@ -326,12 +328,7 @@ export default {
|
|||||||
cancelButtonText: this.$t('global.cancel'),
|
cancelButtonText: this.$t('global.cancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
|
|
||||||
// this.$router.go(-1);
|
|
||||||
this.submit();
|
this.submit();
|
||||||
}).catch(()=> {
|
|
||||||
this.$message.error('提交试卷失败!');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
refeeEndCompetition() {
|
refeeEndCompetition() {
|
||||||
@ -343,10 +340,13 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// this.$store.dispatch('exam/over').then(() => {
|
submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
|
||||||
// this.$store.dispatch('trainingList/clearTrainingList');
|
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 } });
|
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('提交试卷失败!');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user