实训调整
This commit is contained in:
parent
20d4c147f6
commit
aaf5912a2e
@ -343,8 +343,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
console.log(error, '=====');
|
|
||||||
this.timeCountCommand = -1;
|
this.timeCountCommand = -1;
|
||||||
this.timeCountConfirm = -1;
|
this.timeCountConfirm = -1;
|
||||||
this.setButtonEnable({ step: -1 });
|
this.setButtonEnable({ step: -1 });
|
||||||
|
@ -26,14 +26,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// offset: 15,
|
|
||||||
// offsetBottom: 15,
|
|
||||||
// tipBottom: 0,
|
|
||||||
// textStatusHeight: 0,
|
|
||||||
// planRunning:false,
|
|
||||||
dataError: false,
|
dataError: false,
|
||||||
group: ''
|
group: ''
|
||||||
// showMap: false
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
|
@ -432,6 +432,21 @@ export default {
|
|||||||
isShow: true
|
isShow: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
allMenuList1: [
|
||||||
|
{ label: '设备视图', name: 'jlmap3dmodel', click: this.jlmap3dmodel, isShow: () => { return true; } },
|
||||||
|
{ label: '修改系统时间', name: 'modifyOrDriving', click: this.modifyOrDriving, isShow: () => { return true; } },
|
||||||
|
{ label: '按计划行车', name: 'modifyOrDriving', click: this.modifyOrDriving, isShow: () => { return true; } },
|
||||||
|
{ label: '初始化', name: 'initialize', click: this.end, isShow: () => { return true; } },
|
||||||
|
{ label: '考试', name: 'exam', click: this.goExam, isShow: () => { return true; } },
|
||||||
|
{ label: '联系方式', name: 'contectUs', click: this.contectUs, isShow: () => { return true; } },
|
||||||
|
{ label: '成员管理', name: 'memberManage', click: this.memberManage, isShow: () => { return true; } },
|
||||||
|
{ label: '切换客流数据', name: 'changeFlowData', click: this.changeFlowData, isShow: () => { return true; } },
|
||||||
|
{ label: '退出', name: 'quit', click: this.back, isShow: () => { return true; } },
|
||||||
|
{ label: '返回', name: 'back', click: this.back, isShow: () => { return true; } },
|
||||||
|
{ label: '留言板', name: 'messageBoard', click: this.messageBoard, isShow: () => { return true; } },
|
||||||
|
{ label: '路票', name: 'trainTicket ', click: this.trainTicket, isShow: () => { return true; }},
|
||||||
|
{ label: '簿册', name: 'registerBook ', click: this.registerBook, isShow: () => { return true; }}
|
||||||
|
],
|
||||||
deviceif: false,
|
deviceif: false,
|
||||||
deviceShow: true,
|
deviceShow: true,
|
||||||
prdTypeMap: {
|
prdTypeMap: {
|
||||||
@ -693,8 +708,14 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
history.go(-1);
|
this.$confirm('是否退出仿真?', '提 示', {
|
||||||
Notification.closeAll();
|
confirmButtonText: '确 定',
|
||||||
|
cancelButtonText: '取 消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
history.go(-1);
|
||||||
|
Notification.closeAll();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 数字沙盘
|
// 数字沙盘
|
||||||
@ -772,7 +793,6 @@ export default {
|
|||||||
// 实操练习
|
// 实操练习
|
||||||
fieldPractice() {
|
fieldPractice() {
|
||||||
this.hideMenuList();
|
this.hideMenuList();
|
||||||
this.$refs.sceneList.doShow();
|
|
||||||
},
|
},
|
||||||
// 理论考试
|
// 理论考试
|
||||||
theoryQuiz() {
|
theoryQuiz() {
|
||||||
|
@ -119,7 +119,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'$store.state.socket.memberChangeCount': function () { // 仿真成员变更
|
'$store.state.socket.memberChangeCount': function () { // 仿真成员变更
|
||||||
console.log('************');
|
|
||||||
this.initMemberUserInfo();
|
this.initMemberUserInfo();
|
||||||
},
|
},
|
||||||
'$store.state.map.map': function (map) {
|
'$store.state.map.map': function (map) {
|
||||||
@ -185,12 +184,6 @@ export default {
|
|||||||
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
|
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// creatSubscribe(`${displayTopic}\/${this.group}`, header, defaultCallback);
|
|
||||||
// creatSubscribe(getTopic('STATE', this.group), header, stateCallback);
|
|
||||||
// if (this.picture === 'trafficTerminal') {
|
|
||||||
// creatSubscribe(getTopic('CTC', this.group), header, defaultCallback);
|
|
||||||
// }
|
|
||||||
// this.$store.dispatch('training/setHasSubscribed');
|
|
||||||
},
|
},
|
||||||
clearSubscribe() {
|
clearSubscribe() {
|
||||||
clearSubscribe(getTopic('COMMON', this.group));
|
clearSubscribe(getTopic('COMMON', this.group));
|
||||||
@ -241,10 +234,8 @@ export default {
|
|||||||
this.loading = loading;
|
this.loading = loading;
|
||||||
if (loading) {
|
if (loading) {
|
||||||
this.$store.dispatch('app/animationsClose');
|
this.$store.dispatch('app/animationsClose');
|
||||||
// this.$refs.progressBar && this.$refs.progressBar.start();
|
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('app/animationsClose');
|
this.$store.dispatch('app/animationsClose');
|
||||||
// this.$refs.progressBar && this.$refs.progressBar.end(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,6 @@ export default {
|
|||||||
roleList: ['STATION_SUPERVISOR'],
|
roleList: ['STATION_SUPERVISOR'],
|
||||||
click: this.changePictureShow
|
click: this.changePictureShow
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: '调度计划',
|
name: '调度计划',
|
||||||
code: 'schedulingPlan',
|
code: 'schedulingPlan',
|
||||||
@ -165,11 +164,16 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'$store.state.training.roles': function (val) {
|
'$store.state.training.roles': function (val) {
|
||||||
this.initTerminalList();
|
this.initTerminalList();
|
||||||
|
const trainingDetail = this.$store.state.trainingNew.trainingDetail;
|
||||||
if (this.isFirst && this.$route.query.client) {
|
if (this.isFirst && this.$route.query.client) {
|
||||||
this.isFirst = false;
|
this.isFirst = false;
|
||||||
} else {
|
} else {
|
||||||
this.isFirst = false;
|
if (trainingDetail && trainingDetail.client) {
|
||||||
this.initPictureShow();
|
this.changePictureShow(trainingDetail.client);
|
||||||
|
} else {
|
||||||
|
this.isFirst = false;
|
||||||
|
this.initPictureShow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'$store.state.socket.simulationWorkParam': function (val) {
|
'$store.state.socket.simulationWorkParam': function (val) {
|
||||||
@ -206,12 +210,6 @@ export default {
|
|||||||
if (localWorkRoleList.includes(this.roles)) {
|
if (localWorkRoleList.includes(this.roles)) {
|
||||||
this.changePictureShow('localWork');
|
this.changePictureShow('localWork');
|
||||||
} else if (this.roles === 'DISPATCHER') {
|
} else if (this.roles === 'DISPATCHER') {
|
||||||
// if (this.$route.query.lineCode === '16') {
|
|
||||||
// this.changePictureShow('dispatcherManage');
|
|
||||||
// this.$store.dispatch('app/animationsClose');
|
|
||||||
// } else {
|
|
||||||
// this.changePictureShow('dispatchWork');
|
|
||||||
// }
|
|
||||||
this.changePictureShow('dispatchWork');
|
this.changePictureShow('dispatchWork');
|
||||||
} else if (this.roles === 'MAINTAINER') {
|
} else if (this.roles === 'MAINTAINER') {
|
||||||
// 通号
|
// 通号
|
||||||
@ -235,10 +233,7 @@ export default {
|
|||||||
right: 0;
|
right: 0;
|
||||||
top: 45%;
|
top: 45%;
|
||||||
width: 111px;
|
width: 111px;
|
||||||
padding-left: 1px;
|
padding: 1px;
|
||||||
padding-top: 1px;
|
|
||||||
padding-bottom: 1px;
|
|
||||||
padding-right: 1px;
|
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 5px 0 0 5px;
|
border-radius: 5px 0 0 5px;
|
||||||
z-index: 2000;
|
z-index: 2000;
|
||||||
|
@ -47,7 +47,8 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
mapId: '',
|
mapId: '',
|
||||||
description:'',
|
description:'',
|
||||||
type: ''
|
type: '',
|
||||||
|
client: ''
|
||||||
},
|
},
|
||||||
inputVisible: false,
|
inputVisible: false,
|
||||||
inputValue: '',
|
inputValue: '',
|
||||||
@ -138,7 +139,8 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
mapId: this.$route.query.mapId,
|
mapId: this.$route.query.mapId,
|
||||||
description:'',
|
description:'',
|
||||||
type: ''
|
type: '',
|
||||||
|
client: ''
|
||||||
};
|
};
|
||||||
this.tagForm.dynamicTags = [];
|
this.tagForm.dynamicTags = [];
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-button size="small" type="text" @click="previewTraining">预览</el-button>
|
<el-button size="small" type="text" @click="previewTraining">预览</el-button>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-button size="small" type="text" @click="saveStepData">保存</el-button>
|
|
||||||
<el-divider direction="vertical" />
|
|
||||||
<el-button size="small" type="text" @click="publishTraining">发布</el-button>
|
<el-button size="small" type="text" @click="publishTraining">发布</el-button>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-button size="small" type="text" @click="resetTraining">重置</el-button>
|
<el-button size="small" type="text" @click="resetTraining">重置</el-button>
|
||||||
@ -69,7 +67,11 @@
|
|||||||
<div>{{ mapLocationObj.scale || '' }}</div>
|
<div>{{ mapLocationObj.scale || '' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<el-divider content-position="center">实训步骤</el-divider>
|
<el-divider content-position="center">实训步骤</el-divider>
|
||||||
<el-button class="text-button-position" type="text" @click="addStep">新增步骤</el-button>
|
<div class="text-button-position">
|
||||||
|
<el-button type="text" @click="addStep">新增步骤</el-button>
|
||||||
|
<el-divider direction="vertical" />
|
||||||
|
<el-button type="text" @click="saveStepData">保存</el-button>
|
||||||
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
style="position: relative;top: -40px;"
|
style="position: relative;top: -40px;"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
@ -110,7 +112,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation, clearDesignTraining } from '@/api/trainingManage';
|
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation, clearDesignTraining, updateTraining} from '@/api/trainingManage';
|
||||||
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
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';
|
||||||
@ -234,19 +236,23 @@ export default {
|
|||||||
return name;
|
return name;
|
||||||
},
|
},
|
||||||
addStep() {
|
addStep() {
|
||||||
const lastIndex = this.tableData.length - 1;
|
if (this.bgSceneObj.systemTime) {
|
||||||
let mId = '';
|
const lastIndex = this.tableData.length - 1;
|
||||||
if (this.tableData[lastIndex]) {
|
let mId = '';
|
||||||
mId = this.tableData[lastIndex].memberId || '';
|
if (this.tableData[lastIndex]) {
|
||||||
|
mId = this.tableData[lastIndex].memberId || '';
|
||||||
|
}
|
||||||
|
const obj = {
|
||||||
|
memberId: mId,
|
||||||
|
description: '',
|
||||||
|
operations: [],
|
||||||
|
simCommands: [],
|
||||||
|
tipPosition: {}
|
||||||
|
};
|
||||||
|
this.tableData.push(obj);
|
||||||
|
} else {
|
||||||
|
this.$messageBox('请先保存实训背景!');
|
||||||
}
|
}
|
||||||
const obj = {
|
|
||||||
memberId: mId,
|
|
||||||
description: '',
|
|
||||||
operations: [],
|
|
||||||
simCommands: [],
|
|
||||||
tipPosition: {}
|
|
||||||
};
|
|
||||||
this.tableData.push(obj);
|
|
||||||
},
|
},
|
||||||
backDesignPane(data) {
|
backDesignPane(data) {
|
||||||
this.showMode = 'designPane';
|
this.showMode = 'designPane';
|
||||||
@ -289,24 +295,31 @@ export default {
|
|||||||
doShow(data) {
|
doShow(data) {
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
saveStepData() {
|
async saveStepData() {
|
||||||
const list = [];
|
try {
|
||||||
this.tableData.forEach((item, index) => {
|
const list = [];
|
||||||
const obj = {
|
this.tableData.forEach((item, index) => {
|
||||||
...item
|
const obj = {
|
||||||
|
...item
|
||||||
|
};
|
||||||
|
delete obj.isEdit;
|
||||||
|
list.push(obj);
|
||||||
|
});
|
||||||
|
const trainingData = {
|
||||||
|
id: this.editData.id,
|
||||||
|
name: this.editData.name,
|
||||||
|
mapId: this.editData.mapId,
|
||||||
|
description: this.editData.description,
|
||||||
|
labelJson: this.editData.label,
|
||||||
|
type: this.editData.type,
|
||||||
|
client: this.$store.state.map.picture
|
||||||
};
|
};
|
||||||
delete obj.isEdit;
|
await updateTraining(trainingData);
|
||||||
list.push(obj);
|
await updateTrainingStep(this.group, this.editData.id, list);
|
||||||
});
|
this.$message.success('保存实训成功!');
|
||||||
updateTrainingStep(this.group, this.editData.id, list).then(res => {
|
} catch {
|
||||||
console.log('保存步骤成功!', res);
|
this.$message.error('保存实训失败');
|
||||||
this.$message.success('保存步骤成功!');
|
}
|
||||||
// this.doClose();
|
|
||||||
this.getStepList(this.editData);
|
|
||||||
}).catch(err => {
|
|
||||||
console.log('保存步骤失败', err);
|
|
||||||
this.$message.error('保存步骤失败');
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
@ -359,6 +372,19 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
saveScenesStage() {
|
saveScenesStage() {
|
||||||
|
if (this.tableData && this.tableData.length) {
|
||||||
|
this.$confirm('已添加实训步骤,保存背景可能导致步骤执行失败,是否继续?', '提 示', {
|
||||||
|
confirmButtonText: '确 定',
|
||||||
|
cancelButtonText: '取 消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.saveBg();
|
||||||
|
}).catch( () => { });
|
||||||
|
} else {
|
||||||
|
this.saveBg();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
saveBg() {
|
||||||
updateTrainingBackgroud({id: this.editData.id, groupId: this.group}).then(res => {
|
updateTrainingBackgroud({id: this.editData.id, groupId: this.group}).then(res => {
|
||||||
console.log('保存背景', res);
|
console.log('保存背景', res);
|
||||||
this.$message.success('保存背景成功!');
|
this.$message.success('保存背景成功!');
|
||||||
|
@ -67,12 +67,11 @@ export default {
|
|||||||
doShow() {
|
doShow() {
|
||||||
const playerList = JSON.parse(this.trainingDetail.playerIdJson);
|
const playerList = JSON.parse(this.trainingDetail.playerIdJson);
|
||||||
const memberData = this.$store.state.training.memberData;
|
const memberData = this.$store.state.training.memberData;
|
||||||
const activeTrainList = this.$store.state.map.activeTrainList || [];
|
|
||||||
const newMemberData = {};
|
const newMemberData = {};
|
||||||
playerList.forEach(playerId => {
|
playerList.forEach(playerId => {
|
||||||
newMemberData[playerId] = memberData[playerId];
|
newMemberData[playerId] = memberData[playerId];
|
||||||
});
|
});
|
||||||
const result = covertMemberData(activeTrainList, Object.values(newMemberData));
|
const result = covertMemberData([], Object.values(newMemberData));
|
||||||
let list = [];
|
let list = [];
|
||||||
result.deviceListData.forEach(item => {
|
result.deviceListData.forEach(item => {
|
||||||
list = list.concat(item);
|
list = list.concat(item);
|
||||||
|
@ -276,11 +276,6 @@ export default {
|
|||||||
this.playerId = '';
|
this.playerId = '';
|
||||||
if (detailResp.data.playerIdJson) {
|
if (detailResp.data.playerIdJson) {
|
||||||
this.playerId = JSON.parse(detailResp.data.playerIdJson)[0];
|
this.playerId = JSON.parse(detailResp.data.playerIdJson)[0];
|
||||||
// if (playerId) {
|
|
||||||
// const member = this.$store.state.training.memberData[playerId];
|
|
||||||
// this.$store.dispatch('training/setPrdType', this.prdTypeMap[member.type]);
|
|
||||||
// this.$store.dispatch('training/setRoles', member.type);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
this.showMenu = true;
|
this.showMenu = true;
|
||||||
this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
|
this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
|
||||||
|
Loading…
Reference in New Issue
Block a user