@@ -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,12 @@ export default {
stationList: [],
showSelectStation: false,
mapViewLoadedOver: false,
- dataError: false
+ dataError: false,
+ countdownTime: '00:00:00',
+ practicalTime: 0,
+ countdown: null,
+ questionList: [],
+ practicalExamTime: 0
};
},
computed: {
@@ -209,6 +229,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 +390,23 @@ 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 = [];
+ this.practicalExamTime = paperResp.data.practicalExamTime;
+ 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 = this.practicalExamTime * 60;
+ }
+ 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,24 @@ export default {
this.endViewLoading();
}
},
+ startCounting() {
+ const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
+ const startTime = localStore.get(storeKey);
+ if (!startTime) {
+ const storeValue = new Date().getTime();
+ localStore.set(storeKey, storeValue);
+ }
+ 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 +477,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;
diff --git a/src/views/newMap/jointTrainingNew/jsQuestion.vue b/src/views/newMap/jointTrainingNew/jsQuestion.vue
new file mode 100644
index 000000000..eb2e3e440
--- /dev/null
+++ b/src/views/newMap/jointTrainingNew/jsQuestion.vue
@@ -0,0 +1,94 @@
+
+
+
+
+
+
diff --git a/src/views/newMap/jointTrainingNew/menuDemon.vue b/src/views/newMap/jointTrainingNew/menuDemon.vue
index cb97a70fa..bf0515faa 100644
--- a/src/views/newMap/jointTrainingNew/menuDemon.vue
+++ b/src/views/newMap/jointTrainingNew/menuDemon.vue
@@ -12,6 +12,7 @@
@@ -34,8 +35,9 @@ import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice';
-import { participantCompleteCompetition, refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
+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('提交试卷失败!');
- });
+ this.submit();
});
},
refeeEndCompetition() {
@@ -343,10 +340,13 @@ export default {
});
},
submit() {
- // this.$store.dispatch('exam/over').then(() => {
- // this.$store.dispatch('trainingList/clearTrainingList');
- this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
- // });
+ 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('提交试卷失败!');
+ });
}
}
};
diff --git a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue
index 0437a5302..32f6d3af0 100644
--- a/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/ControlDraft.vue
@@ -3,7 +3,51 @@
-
+
+
+
站后折返数据
+
+
+
+
+
+
+ 移出
+ 编辑
+
+
+
+
+
+ {{ cardTitle }}
+ 生成
+
+ 修改
+ 取消
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 激活
+
+
+
+
+
+
+
@@ -55,18 +99,36 @@ export default {
activeName: 'first',
lazy: true,
autoList: [],
+ field: '',
+ turnBackList: [
+ { name: '按计划执行', value: 'NONE' },
+ { name: '仅某个折返轨', value: 'ONLY' },
+ { name: '等价折返', value: 'EQUAL' },
+ { name: '优先/次之', value: 'FIRST' }
+ ],
typeList: [
{ name: '自动折返', value: 'AutoTurnBack' },
{ name: '计轴复位', value: 'AxleReset' },
{ name: '自动进路', value: 'AutomaticRoute' },
{ name: '引导总锁', value: 'GuideLock' },
- { name: '全线临时限速', value: 'LimitControl' }
+ { name: '全线临时限速', value: 'LimitControl' },
+ { name: '站后折返', value: 'StationTurnBack' }
],
+ cardMode: 'generate',
+ addBackModel: {
+ id: '',
+ type: '',
+ label: '',
+ sectionList: [],
+ parentIndex: 0
+ },
editModel: {
code: '',
type: '',
name: '',
+ show: true, // 站后折返显示
subtitleName: '',
+ optionList: [], // 战后折返列表
automaticRouteCode: '', // 关联自动进路code
cycleCode: '', // 自动折返关联code
stationCode: '', // 所属设备集中站
@@ -101,6 +163,17 @@ export default {
'position.y': [
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
]
+ },
+ addBackRules: {
+ type: [
+ { required: true, message: '请选择类型', trigger: 'change' }
+ ],
+ label: [
+ { required: true, message: '请填写描述', trigger: 'blur' }
+ ],
+ sectionList: [
+ { required: true, message: '请选择站台轨', trigger: 'change' }
+ ]
}
};
},
@@ -111,8 +184,19 @@ export default {
'tempSpeedLimitList',
'axleCounterResetButtonList',
'totalGuideLockButtonVOList',
- 'stationList'
+ 'stationList',
+ 'sectionList',
+ 'tbStrategyList'
]),
+ cardTitle() {
+ if (this.cardMode === 'generate') {
+ return '生成数据';
+ } else if (this.cardMode === 'edit') {
+ return '编辑数据';
+ } else {
+ return '';
+ }
+ },
form() {
const form = {
labelWidth: '150px',
@@ -124,17 +208,18 @@ export default {
draw: {
name: this.$t('map.drawData'),
item: [
- { prop:'type', label: this.$t('map.functionButtonType'), type: 'select', optionLabel: 'name', optionValue: 'value', options: this.typeList, disabled: true },
+ { prop:'type', label: this.$t('map.functionButtonType'), type: 'select', optionLabel: 'name', optionValue: 'value', options: this.typeList, change: true, deviceChange: this.typeChange },
{ prop: 'code', label: `${this.$t('map.code')}`, type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.selectLists, change: true, deviceChange: this.deviceChange },
{ prop: 'name', label: this.$t('map.buttonMainName'), type: 'input' },
- { prop: 'subtitleName', label: this.$t('map.buttonViceName'), type: 'input' },
+ { prop: 'show', label: '是否显示:', type: 'checkbox', isHidden: !this.isTurnBackShow },
+ { prop: 'subtitleName', label: this.$t('map.buttonViceName'), type: 'input', isHidden: !this.isHiddensubtitleNameVO },
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '140px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] },
{ prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, change: true, deviceChange: this.changeEditStation },
{ prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, change: true, deviceChange: this.changeEditStation },
- { prop:'stationCode', label: this.$t('map.ownedCiStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
+ { prop:'stationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
]
}
}
@@ -153,7 +238,7 @@ export default {
] },
{ prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateAutomaticRoute, change: true, deviceChange: this.changeStation },
{ prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenCreateMapCycleButtonVO, change: true, deviceChange: this.changeStation },
- { prop:'stationCode', label: this.$t('map.ownedCiStation'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledCreateStation, isHidden: !this.isHiddenCreateStation }
+ { prop:'stationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledCreateStation, isHidden: !this.isHiddenCreateStation }
]
};
return form;
@@ -180,11 +265,17 @@ export default {
isHiddenMapCycleButtonVO() {
return this.editModel.type == 'AutoTurnBack';
},
+ isTurnBackShow() {
+ return this.editModel.type == 'StationTurnBack';
+ },
+ isHiddensubtitleNameVO() {
+ return this.editModel.type != 'StationTurnBack';
+ },
isDisabledStation() {
return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'AutomaticRoute';
},
isHiddenStation() {
- return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset';
+ return this.editModel.type == 'AutoTurnBack' || this.editModel.type == 'GuideLock' || this.editModel.type == 'AxleReset' || this.editModel.type == 'StationTurnBack';
},
isHiddenCreateAutomaticRoute() {
@@ -197,17 +288,9 @@ export default {
return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'AutomaticRoute';
},
isHiddenCreateStation() {
- return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset';
+ return this.addModel.type == 'AutoTurnBack' || this.addModel.type == 'GuideLock' || this.addModel.type == 'AxleReset' || this.addModel.type == 'StationTurnBack';
}
},
- // watch: {
- // selected(val, oldVal) {
- // if (val && val._type) {
- // this.handleTypes(val._type);
- // this.deviceSelect(val);
- // }
- // }
- // },
mounted() {
},
methods: {
@@ -219,13 +302,33 @@ export default {
this.changeEditStation(data.cycleCode);
}
},
- typeChange(type) { // 根据类型来选择功能按钮列表
- this.$refs.dataform && this.$refs.dataform.resetFields();
- this.$refs.make && this.$refs.make.resetFields();
+ clearInfo() {
this.addModel.automaticRouteCode = '';
this.addModel.cycleCode = '';
this.addModel.concentrateStationList = '';
- this.addModel.type = type; // 上面清除掉重新赋值
+ this.editModel = {
+ code: '',
+ type: '',
+ name: '',
+ show: true, // 站后折返显示
+ subtitleName: '',
+ optionList: [], // 战后折返列表
+ automaticRouteCode: '', // 关联自动进路code
+ cycleCode: '', // 自动折返关联code
+ stationCode: '', // 所属设备集中站
+ position: {
+ x: 0,
+ y: 0
+ }
+ };
+ },
+ typeChange(type) { // 根据类型来选择功能按钮列表
+ this.$refs.dataform && this.$refs.dataform.resetFields();
+ this.$refs.make && this.$refs.make.resetFields();
+
+ this.clearInfo();
+ this.addModel.type = type;
+ this.editModel.type = type;
this.handleTypes(type);
},
handleTypes(type) {
@@ -247,6 +350,9 @@ export default {
case 'GuideLock':
this.selectLists = this.totalGuideLockButtonVOList;
break;
+ case 'StationTurnBack':
+ this.selectLists = this.tbStrategyList;
+ break;
}
},
changeStation(code) { // 选择对应的所属设备集中站
@@ -271,16 +377,20 @@ export default {
this.getAutoMaticList();
},
deviceSelect(selected) {
- this.handleTypes(selected._type);
- this.$refs.dataform && this.$refs.dataform.resetFields();
- this.$refs.make && this.$refs.make.resetFields();
- if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase()) {
+ if (selected && selected._type.toUpperCase() == 'AutomaticRoute'.toUpperCase() || selected._type.toUpperCase() == 'AutoTurnBack'.toUpperCase() || selected._type.toUpperCase() == 'AxleReset'.toUpperCase() || selected._type.toUpperCase() == 'LimitControl'.toUpperCase() || selected._type.toUpperCase() == 'GuideLock'.toUpperCase() || selected._type.toUpperCase() == 'StationTurnBack'.toUpperCase()) {
+ this.handleTypes(selected._type);
+ this.$refs.dataform && this.$refs.dataform.resetFields();
+ this.$refs.make && this.$refs.make.resetFields();
this.activeName = 'first';
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;
this.$nextTick(() => {
this.setStation(selected);
});
+ } else if (selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'sectionCode1'.toUpperCase()) {
+ if (!this.addBackModel.sectionList.includes(selected.code)) {
+ this.addBackModel.sectionList.push(selected.code);
+ }
}
},
async getAutoMaticList() { // 获取自动信号列表
@@ -317,10 +427,12 @@ export default {
code: uid,
name: this.addModel.name,
subtitleName: this.addModel.subtitleName,
+ show: true,
position: {
x: this.addModel.position.x,
y: this.addModel.position.y
},
+ optionList: [],
automaticRouteCode: this.addModel.automaticRouteCode, // 关联自动进路code
cycleCode: this.addModel.cycleCode, // 自动折返关联code
stationCode: this.addModel.stationCode // 所属设备集中站
@@ -354,6 +466,62 @@ export default {
this.$message.info(this.$t('tip.cancelledDelete'));
});
}
+ },
+ hover(field) {
+ this.field = field === this.field ? '' : field;
+ this.$emit('selectFiled', this.field);
+ },
+ deleteOverlab(list, index) {
+ list.splice(index, 1);
+ this.cardMode = 'generate';
+ },
+ editOverlab(list, index) {
+ this.addBackModel = deepAssign({}, list[index]);
+ this.addBackModel.parentIndex = index;
+ this.cardMode = 'edit';
+ },
+ updateOverlab() { // 修改数据
+ this.$refs.hostileForm.validate((valid) => {
+ if (valid) {
+ const data = {
+ id: this.addBackModel.id,
+ type: this.addBackModel.type,
+ label: this.addBackModel.label,
+ sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
+ };
+ this.editModel.optionList.splice(this.addBackModel.parentIndex, 1, data);
+ this.$refs.hostileForm.resetFields();
+ this.cardMode = 'generate';
+ this.addBackModel.sectionList = [];
+ }
+ });
+ },
+ generateOverlab() { // 生成数据
+ this.$refs.hostileForm.validate((valid) => {
+ if (valid) {
+ const id = this.createUid(this.editModel.optionList); // 根据类型写 uid 前缀命名
+ this.editModel.optionList.push({
+ id: id,
+ type: this.addBackModel.type,
+ label: this.addBackModel.label,
+ sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
+ });
+ this.$refs.hostileForm.resetFields();
+ this.addBackModel.sectionList = [];
+ }
+ });
+ },
+ cancelOverlab() {
+ this.$refs.hostileForm.resetFields();
+ this.cardMode = 'generate';
+ },
+ createUid(list) {
+ if (list.length) {
+ let num = Number(list[list.length - 1].id);
+ return ++num;
+ } else {
+ return 1;
+ }
}
}
};
@@ -389,4 +557,24 @@ export default {
.map-draft-group {
color: #3E44BE;
}
+ .card-box{
+ border: 1px solid #ccc;
+ padding: 10px;
+ padding-top: 18px;
+ box-sizing: border-box;
+ position: relative;
+ margin-bottom: 15px;
+
+ &:last-child{
+ margin-bottom: 0;
+ }
+
+ .card_title {
+ position: absolute;
+ left: 10px;
+ top: -8px;
+ background: #fff;
+ padding: 0px 5px;
+ }
+ }
diff --git a/src/views/newMap/newMapdraft/mapoperate/config/data.vue b/src/views/newMap/newMapdraft/mapoperate/config/data.vue
index f65ab489f..c3af39e3b 100644
--- a/src/views/newMap/newMapdraft/mapoperate/config/data.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/config/data.vue
@@ -174,6 +174,7 @@
+
diff --git a/src/views/newMap/newMapdraft/mapoperate/config/list.vue b/src/views/newMap/newMapdraft/mapoperate/config/list.vue
index 1f20a9402..36130d4a6 100644
--- a/src/views/newMap/newMapdraft/mapoperate/config/list.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/config/list.vue
@@ -270,6 +270,7 @@
+
diff --git a/src/views/newMap/newMapdraft/mapoperate/index.vue b/src/views/newMap/newMapdraft/mapoperate/index.vue
index 618cd1663..53e730f63 100644
--- a/src/views/newMap/newMapdraft/mapoperate/index.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/index.vue
@@ -106,6 +106,7 @@
:selected="selected"
@updateMapModel="updateMapModel"
@setCenter="setCenter"
+ @selectFiled="selectFiled"
/>