Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1
Conflicts: src/store/modules/training.js src/views/newMap/display/index.vue src/views/newMap/display/simulationControl.vue src/views/publish/publishMap/editSubsystem.vue
This commit is contained in:
commit
c92c66f17c
@ -1940,7 +1940,7 @@ export const asyncRouter = [
|
||||
{
|
||||
// 线路分组管理
|
||||
path: 'userManage',
|
||||
component: Temporary,
|
||||
component: MapGroup,
|
||||
meta: {
|
||||
i18n: 'newRouter.linePacketManage'
|
||||
}
|
||||
|
@ -188,12 +188,12 @@ class Handler {
|
||||
let trainingDetail = getLocalStorage('trainingDetail') || `{}`;
|
||||
trainingDetail = JSON.parse(trainingDetail);
|
||||
const stepList = JSON.parse(trainingDetail.stepJson || `[]`);
|
||||
let stepOrder = getLocalStorage('stepOrder') || `1`;
|
||||
let stepOrder = getLocalStorage('stepOrder') || `0`;
|
||||
stepOrder = JSON.parse(stepOrder);
|
||||
let operateOrder = getLocalStorage('operateOrder') || `1`;
|
||||
operateOrder = JSON.parse(operateOrder);
|
||||
// const step = stepList[stepOrder - 1];
|
||||
const index = stepOrder - 1 >= 0 ? stepOrder - 1 : 0;
|
||||
const index = stepOrder >= 0 ? stepOrder : 0;
|
||||
const step = stepList[index];
|
||||
const stepOperation = step.operations[operateOrder];
|
||||
return stepOperation;
|
||||
|
@ -134,11 +134,11 @@ const training = {
|
||||
},
|
||||
handleCheckNewTrainingResult:({commit, state}, valid) => {
|
||||
const stepList = JSON.parse(state.trainingDetail.stepJson);
|
||||
const index = state.stepOrder > 0 ? state.stepOrder - 1 : 0;
|
||||
const index = state.stepOrder > 0 ? state.stepOrder : 0;
|
||||
const step = stepList[index];
|
||||
if (valid && step.operations.length === (state.operateOrder + 1 )) {
|
||||
// commit('stepOverCountChange');
|
||||
// commit('stepOrderIncrease');
|
||||
commit('stepOrderIncrease');
|
||||
// debugger;
|
||||
state.operateOrder = 0;
|
||||
} else if (valid) {
|
||||
|
@ -122,8 +122,7 @@ export default {
|
||||
this.$messageBox('此地图数据正在维护中,无法运行!');
|
||||
}
|
||||
this.dataError = resp.data.dataError;
|
||||
if (resp.data.paramVO) {
|
||||
this.$store.dispatch('training/setItemMap', resp.data.paramVO.itemMap);
|
||||
if (resp.data.paramVO && resp.data.paramVO.domConfig) {
|
||||
this.$store.dispatch('training/setDomConfig', resp.data.paramVO.domConfig);
|
||||
}
|
||||
}
|
||||
|
@ -57,14 +57,14 @@
|
||||
<training-tip v-if="trainingDetail||trainingId" ref="trainingTip" />
|
||||
<training-position-tip v-if="trainingDetail||trainingId" ref="trainingPositionTip" />
|
||||
<training-menu v-if="trainingDetail" ref="trainingMenu" :offset-bottom="offsetBottom" />
|
||||
<TrainingDesign ref="trainingDesign" />
|
||||
<TrainingDesign v-if="trainingDesignShow" ref="trainingDesign" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getPublishTrainingDetail, loadPublishTraining} from '@/api/jmap/training';
|
||||
import { getPostByProjectCode } from '@/api/learn';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { getSessionStorage, getLocalStorage } from '@/utils/auth';
|
||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
import ContectUs from './contectUs';
|
||||
import ModifyTime from './modifyTime';
|
||||
@ -142,6 +142,7 @@ export default {
|
||||
return {
|
||||
isShowMenuList: false,
|
||||
scriptMode: ScriptMode.TEACH,
|
||||
showConfig: {},
|
||||
menuList: [],
|
||||
active: -1,
|
||||
openBigLPF: null,
|
||||
@ -496,6 +497,9 @@ export default {
|
||||
},
|
||||
trainingDetail() {
|
||||
return this.$store.state.trainingNew.trainingDetail;
|
||||
},
|
||||
trainingDesignShow() {
|
||||
return this.showConfig.trainingDesign || false;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
@ -537,6 +541,9 @@ export default {
|
||||
this.menuList = [...this.allMenuList];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDomConfig();
|
||||
},
|
||||
mounted() {
|
||||
// jl3dmodel
|
||||
// const dataMap = {
|
||||
@ -575,6 +582,11 @@ export default {
|
||||
this.$store.dispatch('trainingNew/changeTeachMode', '');
|
||||
},
|
||||
methods: {
|
||||
getDomConfig() {
|
||||
let domConfig = getLocalStorage('domConfig') || `{}`;
|
||||
domConfig = JSON.parse(domConfig);
|
||||
this.showConfig = domConfig;
|
||||
},
|
||||
showChidren(data, index) {
|
||||
event.stopPropagation();
|
||||
this.active = index;
|
||||
|
@ -104,14 +104,13 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
'$store.state.trainingNew.stepOrder': function(val) {
|
||||
debugger;
|
||||
const stepList = JSON.parse(this.$store.state.trainingNew.trainingDetail.stepJson);
|
||||
if (val < stepList.length) {
|
||||
const msg = {content:stepList[val - 1].description, memberId:stepList[val - 1].memberId};
|
||||
if (val >= 1 && val < stepList.length) {
|
||||
const msg = {content:stepList[val].description, memberId:stepList[val].memberId};
|
||||
this.$store.dispatch('socket/setTrainingStepTip', msg);
|
||||
} else {
|
||||
this.$store.dispatch('socket/setTrainingStepTip', null);
|
||||
this.$store.dispatch('trainingNew/clearStepOrder');
|
||||
val && this.$store.dispatch('socket/trainingOverCountIncrease');
|
||||
}
|
||||
// operateOrder;
|
||||
}
|
||||
|
@ -42,12 +42,16 @@ export default {
|
||||
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.$store.dispatch('trainingNew/clearOperateOrder');
|
||||
// this.$store.dispatch('trainingNew/stepOrderIncrease');
|
||||
if (member.userId == this.$store.state.user.id) {
|
||||
this.tipInit();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.tip = '';
|
||||
this.popShow = false;
|
||||
this.tipShow = false;
|
||||
}
|
||||
},
|
||||
'$store.state.socket.trainingOverCount': function(val) {
|
||||
@ -78,9 +82,9 @@ export default {
|
||||
const stepOrder = this.$store.state.trainingNew.stepOrder;
|
||||
const steps = JSON.parse(trainingDetail.stepJson);
|
||||
if (steps && steps.length) {
|
||||
const step = steps[stepOrder - 1];
|
||||
const step = steps[stepOrder];
|
||||
const distance = 5;
|
||||
this.tip = this.$store.state.socket.trainingStepTip.content;
|
||||
this.tip = this.$store.state.socket.trainingStepTip ? this.$store.state.socket.trainingStepTip.content : '';
|
||||
if (step && step.tipPosition && step.tipPosition.deviceCode) {
|
||||
const position = this.getShapeTipPoint(step.tipPosition);
|
||||
if (position) {
|
||||
|
@ -31,6 +31,8 @@ export default {
|
||||
this.trainingTipMessage = val.content;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.trainingTipMessage = '';
|
||||
}
|
||||
},
|
||||
'$store.state.trainingNew.trainingSwitch': function(val) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="editContent" :class="{'active': dialogVisible}">
|
||||
<div class="editContentTab">
|
||||
<div v-if="tabVisible" class="editContentTabLable" @click="minisize">
|
||||
<div class="editContentTabLable" @click="minisize">
|
||||
<span class="titleStyle">实训设计</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -124,7 +124,6 @@ import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
||||
import Vue from 'vue';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
import List from './list';
|
||||
import { getLocalStorage } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'DesignIndex',
|
||||
@ -138,7 +137,6 @@ export default {
|
||||
editData: {},
|
||||
showList: true,
|
||||
dialogWidth: '1100px',
|
||||
tabVisible: false,
|
||||
dialogVisible: false,
|
||||
roleList: [],
|
||||
tableData: [],
|
||||
@ -155,6 +153,9 @@ export default {
|
||||
},
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
trainingSwitch() {
|
||||
return this.$store.state.trainingNew.trainingSwitch;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -196,18 +197,10 @@ export default {
|
||||
this.roleList = list;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTabShow();
|
||||
},
|
||||
methods: {
|
||||
getTabShow() {
|
||||
let domConfig = getLocalStorage('domConfig') || `{}`;
|
||||
domConfig = JSON.parse(domConfig);
|
||||
this.tabVisible = domConfig.trainingDesign || false;
|
||||
},
|
||||
updateDetails(data) {
|
||||
this.editData = data;
|
||||
this.$emit('closeAllDialog', 'editDetails');
|
||||
this.$emit('closeAllDialog', 'designIndex');
|
||||
this.getStepList(data);
|
||||
this.showList = false;
|
||||
},
|
||||
@ -298,6 +291,11 @@ export default {
|
||||
},
|
||||
handleCondition(index, row, key) {
|
||||
console.log(key, '条件', index, row);
|
||||
if (this.trainingSwitch) {
|
||||
this.$message.info('请先结束当前实训再编制!');
|
||||
return;
|
||||
}
|
||||
this.$store.dispatch('trainingNew/setTrainingDetail', null);
|
||||
const member = this.$store.state.training.memberData[row.memberId];
|
||||
if (!member.userId) {
|
||||
assignUsersPlayRoles([{ userId: this.$store.state.user.id, memberId: member.id}], this.$route.query.group).then(resp => {
|
||||
@ -311,6 +309,11 @@ export default {
|
||||
this.$message.info('请先选择角色!');
|
||||
return;
|
||||
}
|
||||
if (this.trainingSwitch) {
|
||||
this.$message.info('请先结束当前实训再编制!');
|
||||
return;
|
||||
}
|
||||
this.$store.dispatch('trainingNew/setTrainingDetail', null);
|
||||
const member = this.$store.state.training.memberData[row.memberId];
|
||||
if (!member.userId) {
|
||||
assignUsersPlayRoles([{ userId: this.$store.state.user.id, memberId: member.id}], this.$route.query.group).then(resp => {
|
||||
@ -329,7 +332,6 @@ export default {
|
||||
doShow(data) {
|
||||
// this.getStepList(data);
|
||||
this.dialogVisible = true;
|
||||
this.tabVisible = true;
|
||||
},
|
||||
saveStepData() {
|
||||
const list = [];
|
||||
|
@ -107,6 +107,9 @@ export default {
|
||||
changeTagIndex(index) {
|
||||
this.tagIndex = index;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
backStepList() {
|
||||
const tipPosition = {};
|
||||
if (this.stepDetail.operations[this.tagIndex] && this.trainingType === 'SINGLE') {
|
||||
@ -115,7 +118,7 @@ export default {
|
||||
tipPosition.operateIndex = this.tagIndex;
|
||||
}
|
||||
this.$emit('backStepList', { index: this.dataIndex, stepDetail: this.stepDetail, tipPosition: tipPosition });
|
||||
this.dialogVisible = false;
|
||||
this.doClose();
|
||||
this.stepDetail = {
|
||||
id: '',
|
||||
description: '',
|
||||
|
@ -34,7 +34,7 @@ export default {
|
||||
hoverBtn: false,
|
||||
btnWidth: -600,
|
||||
materialsList: [],
|
||||
refsList: ['create', 'editCondition', 'trackList'],
|
||||
refsList: ['create', 'editCondition', 'trackList', 'editOperate', 'designIndex'],
|
||||
editData: {}
|
||||
};
|
||||
},
|
||||
@ -72,6 +72,7 @@ export default {
|
||||
this.$refs.designIndex.backStep();
|
||||
},
|
||||
handleCondition(index, row, key) {
|
||||
this.closeAllDialog('editCondition');
|
||||
this.$refs.editCondition.doShow(row, index, key);
|
||||
},
|
||||
getMaterials() {
|
||||
@ -96,6 +97,7 @@ export default {
|
||||
});
|
||||
},
|
||||
openEditOperate(data) {
|
||||
this.closeAllDialog('editOperate');
|
||||
this.$refs.editOperate.doShow(data);
|
||||
},
|
||||
backStepList(data) {
|
||||
|
Loading…
Reference in New Issue
Block a user