实训调整

This commit is contained in:
fan 2022-11-23 18:04:35 +08:00
parent 20d4c147f6
commit aaf5912a2e
9 changed files with 96 additions and 75 deletions

View File

@ -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 });

View File

@ -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:{

View File

@ -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 {
this.$confirm('是否退出仿真?', '提 示', {
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning'
}).then(() => {
history.go(-1); history.go(-1);
Notification.closeAll(); Notification.closeAll();
});
} }
}, },
// //
@ -772,7 +793,6 @@ export default {
// //
fieldPractice() { fieldPractice() {
this.hideMenuList(); this.hideMenuList();
this.$refs.sceneList.doShow();
}, },
// //
theoryQuiz() { theoryQuiz() {

View File

@ -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);
} }
} }
} }

View File

@ -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,12 +164,17 @@ 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 {
if (trainingDetail && trainingDetail.client) {
this.changePictureShow(trainingDetail.client);
} else { } else {
this.isFirst = false; this.isFirst = false;
this.initPictureShow(); this.initPictureShow();
} }
}
}, },
'$store.state.socket.simulationWorkParam': function (val) { '$store.state.socket.simulationWorkParam': function (val) {
if (val) { if (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;

View File

@ -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 = [];
} }

View File

@ -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,6 +236,7 @@ export default {
return name; return name;
}, },
addStep() { addStep() {
if (this.bgSceneObj.systemTime) {
const lastIndex = this.tableData.length - 1; const lastIndex = this.tableData.length - 1;
let mId = ''; let mId = '';
if (this.tableData[lastIndex]) { if (this.tableData[lastIndex]) {
@ -247,6 +250,9 @@ export default {
tipPosition: {} tipPosition: {}
}; };
this.tableData.push(obj); this.tableData.push(obj);
} else {
this.$messageBox('请先保存实训背景!');
}
}, },
backDesignPane(data) { backDesignPane(data) {
this.showMode = 'designPane'; this.showMode = 'designPane';
@ -289,7 +295,8 @@ export default {
doShow(data) { doShow(data) {
this.dialogVisible = true; this.dialogVisible = true;
}, },
saveStepData() { async saveStepData() {
try {
const list = []; const list = [];
this.tableData.forEach((item, index) => { this.tableData.forEach((item, index) => {
const obj = { const obj = {
@ -298,15 +305,21 @@ export default {
delete obj.isEdit; delete obj.isEdit;
list.push(obj); list.push(obj);
}); });
updateTrainingStep(this.group, this.editData.id, list).then(res => { const trainingData = {
console.log('保存步骤成功!', res); id: this.editData.id,
this.$message.success('保存步骤成功!'); name: this.editData.name,
// this.doClose(); mapId: this.editData.mapId,
this.getStepList(this.editData); description: this.editData.description,
}).catch(err => { labelJson: this.editData.label,
console.log('保存步骤失败', err); type: this.editData.type,
this.$message.error('保存步骤失败'); client: this.$store.state.map.picture
}); };
await updateTraining(trainingData);
await updateTrainingStep(this.group, this.editData.id, list);
this.$message.success('保存实训成功!');
} catch {
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('保存背景成功!');

View File

@ -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);

View File

@ -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);