diff --git a/package.json b/package.json index 4373cc9e3..80eb50f30 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "dependencies": { "axios": "^0.18.0", + "dayjs": "^1.11.5", "echarts": "^4.7.0", "element-ui": "^2.12.0", "file-saver": "^1.3.3", diff --git a/src/App.vue b/src/App.vue index 358854bc8..fda7b5c5b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,7 +17,7 @@ + + diff --git a/src/views/designPlatform/testRunplan.vue b/src/views/designPlatform/testRunplan.vue index b446bfea1..bad23871c 100644 --- a/src/views/designPlatform/testRunplan.vue +++ b/src/views/designPlatform/testRunplan.vue @@ -23,7 +23,6 @@ import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp'; import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime'; import { getToken } from '@/utils/auth'; import { mapGetters } from 'vuex'; -import { timeFormat } from '@/utils/date'; export default { name:'TestRunplan', components: { @@ -142,8 +141,7 @@ export default { if (resp && resp.code == 200 && resp.data) { if (!resp.data.dataError) { this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // 是否暂停判断 - this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); - // this.$store.dispatch('training/countTime'); + this.$store.dispatch('training/setInitTime', resp.data.systemTime); this.planRunning = resp.data.planRunning; if (resp.data.planRunning) { this.$store.commit('training/start'); @@ -159,7 +157,8 @@ export default { time: model.initTime }; ranAsPlan(data, this.group).then(res => { - this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`)); + // this.$store.dispatch('training/setInitTime', model.initTime); + this.$store.dispatch('training/setInitTime', model.timestamp); }).catch(error => { if (error.code == '5001') { this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed')); diff --git a/src/views/designPlatform/trainingDesign.vue b/src/views/designPlatform/trainingDesign.vue index a76f21e58..697e0505e 100644 --- a/src/views/designPlatform/trainingDesign.vue +++ b/src/views/designPlatform/trainingDesign.vue @@ -4,14 +4,12 @@ - {{ faultMode?'切换到普通模式':'切换到故障模式' }} +
初始化 暂停 恢复 - 开始 - 结束 返回
@@ -19,12 +17,12 @@ + diff --git a/src/views/designPlatform/trainingPositionTip.vue b/src/views/designPlatform/trainingPositionTip.vue index 1ffd7bf4e..0edb941ca 100644 --- a/src/views/designPlatform/trainingPositionTip.vue +++ b/src/views/designPlatform/trainingPositionTip.vue @@ -29,15 +29,24 @@ export default { ...mapGetters([ 'canvasWidth', 'canvasHeight' - ]) + ]), + trainingDetail() { + return this.$store.state.trainingNew.trainingDetail; + }, + teachMode() { + return this.$store.state.trainingNew.teachMode; + } }, watch: { '$store.state.socket.trainingStepTip': function(val) { - if (val) { + if (val && this.trainingDetail.type === 'SINGLE') { + const member = this.$store.state.training.memberData[val.memberId]; this.$nextTick(function() { this.$store.dispatch('trainingNew/clearOperateOrder'); this.$store.dispatch('trainingNew/stepOrderIncrease'); - this.tipInit(); + if (member.userId == this.$store.state.user.id) { + this.tipInit(); + } }); } }, @@ -56,7 +65,7 @@ export default { }, methods: { tipInit() { - if (this.$store.state.trainingNew.teachMode === ScriptMode.TEACH) { + if (this.teachMode === ScriptMode.TEACH) { this.tipShow = true; const offset = this.$store.state.config.canvasOffset; const trainingDetail = this.$store.state.trainingNew.trainingDetail; @@ -65,7 +74,7 @@ export default { if (steps && steps.length) { const step = steps[stepOrder - 1]; const distance = 5; - this.tip = this.$store.state.socket.trainingStepTip; + this.tip = this.$store.state.socket.trainingStepTip.content; if (step && step.tipPosition && step.tipPosition.deviceCode) { const position = this.getShapeTipPoint(step.tipPosition); if (position) { @@ -77,7 +86,6 @@ export default { } } else if (step && step.tipPosition && step.tipPosition.domId) { const position = this.getOtherTipPoint(step.tipPosition); - console.log(position, '**********', step); if (position) { this.position = position; this.position.y -= distance; diff --git a/src/views/designPlatform/trainingPreview.vue b/src/views/designPlatform/trainingPreview.vue index e6c9823fc..87b2d2ed4 100644 --- a/src/views/designPlatform/trainingPreview.vue +++ b/src/views/designPlatform/trainingPreview.vue @@ -4,10 +4,12 @@ + +
- 开始 - 结束 + + 返回
@@ -20,13 +22,17 @@ import MenuDemon from './demonMenu.vue'; import TrainingTip from './trainingTip'; import TrainingPositionTip from './trainingPositionTip'; import TrainingJlmap from './trainingJlmap'; +// import ScenePlayRole from './scenePlayRole'; +import TrainingMenu from './trainingMenu'; export default { name: 'TrainingDesign', components: { MenuDemon, TrainingTip, TrainingJlmap, - TrainingPositionTip + TrainingPositionTip, + // ScenePlayRole, + TrainingMenu }, props: { widthLeft: { @@ -40,7 +46,8 @@ export default { trainingObj: null, starting: false, selected: null, - menus: null + menus: null, + offsetBottom: 15 }; }, computed: { @@ -82,8 +89,22 @@ export default { }, mounted() { this.$store.dispatch('trainingNew/setTrainingScore', ''); + this.handleOffsetBottom(); }, methods: { + handleOffsetBottom() { + setTimeout(() => { + const menuBottom = document.getElementById('menuButtons_box'); + const tipInfoBox = document.getElementById('tipInfoBox'); + const buttonWidth = this.width - 1200; + if (menuBottom && buttonWidth < 780) { + this.offsetBottom = (menuBottom.offsetHeight || 0) + 15; + } + if (tipInfoBox) { + this.offsetBottom += tipInfoBox.offsetHeight; + } + }, 500); + }, overallTranslation(flag) { const panel = document.getElementById('leftSlider'); if (flag) { @@ -98,6 +119,13 @@ export default { } }, handlerStart() { + if (this.trainingDetail.type === 'SCENE') { + this.$refs.scenePlayRole.doShow(); + } else { + this.startTraining(); + } + }, + startTraining() { startTraining(this.group, {mode: this.teachMode}).then(() => { this.$store.dispatch('trainingNew/trainingStart'); this.$store.dispatch('trainingNew/setTrainingScore', ''); @@ -106,7 +134,9 @@ export default { }); }, nextStep() { - endTrainingStep(this.group, this.$store.state.trainingNew.stepOrder).then(resp => { + const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson); + const step = stepList[this.$store.state.trainingNew.stepOrder - 1]; + endTrainingStep(this.group, step.id).then(resp => { }).catch(() => { this.$message.error('进入下一步实训失败!'); }); diff --git a/src/views/designPlatform/trainingTip.vue b/src/views/designPlatform/trainingTip.vue index 16ea0d37b..94c54fc22 100644 --- a/src/views/designPlatform/trainingTip.vue +++ b/src/views/designPlatform/trainingTip.vue @@ -15,21 +15,32 @@ export default { computed: { teachMode() { return this.$store.state.trainingNew.teachMode; + }, + trainingDetail() { + return this.$store.state.trainingNew.trainingDetail; } }, watch: { - // '$store.state.socket.trainingStepTip': function(val) { - // if (val && this.teachMode === ScriptMode.TEACH) { - // this.trainingTipMessage = val; - // } else { - // this.trainingTipMessage = ''; - // } - // }, + '$store.state.socket.trainingStepTip': function(val) { + if (val && this.trainingDetail.type === 'SCENE') { + const member = this.$store.state.training.memberData[val.memberId]; + this.$nextTick(function() { + this.$store.dispatch('trainingNew/clearOperateOrder'); + this.$store.dispatch('trainingNew/stepOrderIncrease'); + if (member.userId == this.$store.state.user.id && (this.teachMode === ScriptMode.TEACH || this.teachMode === ScriptMode.PRACTICE)) { + this.trainingTipMessage = val.content; + } + }); + } + }, '$store.state.trainingNew.trainingSwitch': function(val) { if (!val) { this.trainingTipMessage = ''; } }, + '$store.state.socket.trainingStepFinishCount': function(val) { + this.trainingTipMessage = ''; + }, '$store.state.socket.trainingOverCount': function(val) { if (this.teachMode === ScriptMode.TEACH) { this.trainingTipMessage = '实训完成,请点击结束按钮。'; diff --git a/src/views/designPlatform/whTrainList.vue b/src/views/designPlatform/whTrainList.vue new file mode 100644 index 000000000..44e4c4cf6 --- /dev/null +++ b/src/views/designPlatform/whTrainList.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/views/dispatcherStationManage/dispatchCmd.vue b/src/views/dispatcherStationManage/dispatchCmd.vue index 93db0ddf0..c49d851ba 100644 --- a/src/views/dispatcherStationManage/dispatchCmd.vue +++ b/src/views/dispatcherStationManage/dispatchCmd.vue @@ -4,7 +4,7 @@ class="dispatcher-cmd chengdou-03__systerm" :title="title" :visible.sync="show" - width="1300px" + width="1500px" :before-close="doClose" :z-index="2010" :modal="false" @@ -13,7 +13,7 @@ >
- +
@@ -21,7 +21,6 @@
- @@ -44,17 +43,21 @@
- - - + + + - + + + + + - - @@ -424,6 +427,24 @@ export default { } models.push(deepAssign(section, { _type: 'Section' })); this.$emit('updateMapModel', models); + }, + calculateSectionLength(){ + const precisionOf = num => num.toString().split('.').pop().length + this.$confirm('确认设置所有区段的实际长度吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(()=>{ + this.sectionList.forEach(section => { + const { kmMin, kmMax } = section + if (typeof kmMin === 'number' && typeof kmMax === 'number') { + const precision = Math.max(precisionOf(kmMin), precisionOf(kmMax)) + section.lengthFact = Number((kmMax - kmMin).toFixed(precision)) + } + }) + this.$emit('updateMapModel', this.sectionList) + this.$message.success('区段长度设置成功!') + }) } } }; diff --git a/src/views/pis/components/slideshow.vue b/src/views/pis/components/slideshow.vue new file mode 100644 index 000000000..ecc8cd449 --- /dev/null +++ b/src/views/pis/components/slideshow.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/views/pis/index.vue b/src/views/pis/index.vue new file mode 100644 index 000000000..a053b5e3c --- /dev/null +++ b/src/views/pis/index.vue @@ -0,0 +1,441 @@ + + + + + diff --git a/src/views/planMonitor/newEditTool/menuTool.vue b/src/views/planMonitor/newEditTool/menuTool.vue index 9cbe4e450..1371d73b8 100644 --- a/src/views/planMonitor/newEditTool/menuTool.vue +++ b/src/views/planMonitor/newEditTool/menuTool.vue @@ -8,7 +8,7 @@
diff --git a/src/views/trainingManage/expressionValue.vue b/src/views/trainingManage/expressionValue.vue new file mode 100644 index 000000000..beafc3d5b --- /dev/null +++ b/src/views/trainingManage/expressionValue.vue @@ -0,0 +1,249 @@ + + + + diff --git a/src/views/trainingManage/gradeRules.vue b/src/views/trainingManage/gradeRules.vue index a7ea81b42..422f3e064 100644 --- a/src/views/trainingManage/gradeRules.vue +++ b/src/views/trainingManage/gradeRules.vue @@ -39,11 +39,11 @@ /> @@ -59,7 +59,7 @@ + diff --git a/src/views/trainingManage/trainingList.vue b/src/views/trainingManage/trainingList.vue index 725239f5a..6bfe4de52 100644 --- a/src/views/trainingManage/trainingList.vue +++ b/src/views/trainingManage/trainingList.vue @@ -1,5 +1,5 @@