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