实训调整
This commit is contained in:
parent
20d4c147f6
commit
aaf5912a2e
@ -343,8 +343,7 @@ export default {
|
||||
} else {
|
||||
this.editRecord({ order: this.order, date: now(), context: this.$t('menu.clickSecondConfirm'), result: this.$t('tip.executionFailed') });
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error, '=====');
|
||||
}).catch(() => {
|
||||
this.timeCountCommand = -1;
|
||||
this.timeCountConfirm = -1;
|
||||
this.setButtonEnable({ step: -1 });
|
||||
|
@ -26,14 +26,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// offset: 15,
|
||||
// offsetBottom: 15,
|
||||
// tipBottom: 0,
|
||||
// textStatusHeight: 0,
|
||||
// planRunning:false,
|
||||
dataError: false,
|
||||
group: ''
|
||||
// showMap: false
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
|
@ -432,6 +432,21 @@ export default {
|
||||
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,
|
||||
deviceShow: true,
|
||||
prdTypeMap: {
|
||||
@ -693,8 +708,14 @@ export default {
|
||||
});
|
||||
}
|
||||
} else {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
this.$confirm('是否退出仿真?', '提 示', {
|
||||
confirmButtonText: '确 定',
|
||||
cancelButtonText: '取 消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
history.go(-1);
|
||||
Notification.closeAll();
|
||||
});
|
||||
}
|
||||
},
|
||||
// 数字沙盘
|
||||
@ -772,7 +793,6 @@ export default {
|
||||
// 实操练习
|
||||
fieldPractice() {
|
||||
this.hideMenuList();
|
||||
this.$refs.sceneList.doShow();
|
||||
},
|
||||
// 理论考试
|
||||
theoryQuiz() {
|
||||
|
@ -119,7 +119,6 @@ export default {
|
||||
}
|
||||
},
|
||||
'$store.state.socket.memberChangeCount': function () { // 仿真成员变更
|
||||
console.log('************');
|
||||
this.initMemberUserInfo();
|
||||
},
|
||||
'$store.state.map.map': function (map) {
|
||||
@ -185,12 +184,6 @@ export default {
|
||||
creatSubscribe(getTopic(type, this.group), header, defaultCallback);
|
||||
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(getTopic('COMMON', this.group));
|
||||
@ -241,10 +234,8 @@ export default {
|
||||
this.loading = loading;
|
||||
if (loading) {
|
||||
this.$store.dispatch('app/animationsClose');
|
||||
// this.$refs.progressBar && this.$refs.progressBar.start();
|
||||
} else {
|
||||
this.$store.dispatch('app/animationsClose');
|
||||
// this.$refs.progressBar && this.$refs.progressBar.end(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,6 @@ export default {
|
||||
roleList: ['STATION_SUPERVISOR'],
|
||||
click: this.changePictureShow
|
||||
},
|
||||
|
||||
{
|
||||
name: '调度计划',
|
||||
code: 'schedulingPlan',
|
||||
@ -165,11 +164,16 @@ export default {
|
||||
watch: {
|
||||
'$store.state.training.roles': function (val) {
|
||||
this.initTerminalList();
|
||||
const trainingDetail = this.$store.state.trainingNew.trainingDetail;
|
||||
if (this.isFirst && this.$route.query.client) {
|
||||
this.isFirst = false;
|
||||
} else {
|
||||
this.isFirst = false;
|
||||
this.initPictureShow();
|
||||
if (trainingDetail && trainingDetail.client) {
|
||||
this.changePictureShow(trainingDetail.client);
|
||||
} else {
|
||||
this.isFirst = false;
|
||||
this.initPictureShow();
|
||||
}
|
||||
}
|
||||
},
|
||||
'$store.state.socket.simulationWorkParam': function (val) {
|
||||
@ -206,12 +210,6 @@ export default {
|
||||
if (localWorkRoleList.includes(this.roles)) {
|
||||
this.changePictureShow('localWork');
|
||||
} 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');
|
||||
} else if (this.roles === 'MAINTAINER') {
|
||||
// 通号
|
||||
@ -235,10 +233,7 @@ export default {
|
||||
right: 0;
|
||||
top: 45%;
|
||||
width: 111px;
|
||||
padding-left: 1px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
padding-right: 1px;
|
||||
padding: 1px;
|
||||
background: #fff;
|
||||
border-radius: 5px 0 0 5px;
|
||||
z-index: 2000;
|
||||
|
@ -47,7 +47,8 @@ export default {
|
||||
name: '',
|
||||
mapId: '',
|
||||
description:'',
|
||||
type: ''
|
||||
type: '',
|
||||
client: ''
|
||||
},
|
||||
inputVisible: false,
|
||||
inputValue: '',
|
||||
@ -138,7 +139,8 @@ export default {
|
||||
name: '',
|
||||
mapId: this.$route.query.mapId,
|
||||
description:'',
|
||||
type: ''
|
||||
type: '',
|
||||
client: ''
|
||||
};
|
||||
this.tagForm.dynamicTags = [];
|
||||
}
|
||||
|
@ -39,8 +39,6 @@
|
||||
<el-divider direction="vertical" />
|
||||
<el-button size="small" type="text" @click="previewTraining">预览</el-button>
|
||||
<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-divider direction="vertical" />
|
||||
<el-button size="small" type="text" @click="resetTraining">重置</el-button>
|
||||
@ -69,7 +67,11 @@
|
||||
<div>{{ mapLocationObj.scale || '' }}</div>
|
||||
</div>
|
||||
<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
|
||||
style="position: relative;top: -40px;"
|
||||
:data="tableData"
|
||||
@ -110,7 +112,7 @@
|
||||
</template>
|
||||
|
||||
<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 Vue from 'vue';
|
||||
import {covertMemberData} from '@/views/newMap/displayNew/utils';
|
||||
@ -234,19 +236,23 @@ export default {
|
||||
return name;
|
||||
},
|
||||
addStep() {
|
||||
const lastIndex = this.tableData.length - 1;
|
||||
let mId = '';
|
||||
if (this.tableData[lastIndex]) {
|
||||
mId = this.tableData[lastIndex].memberId || '';
|
||||
if (this.bgSceneObj.systemTime) {
|
||||
const lastIndex = this.tableData.length - 1;
|
||||
let mId = '';
|
||||
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) {
|
||||
this.showMode = 'designPane';
|
||||
@ -289,24 +295,31 @@ export default {
|
||||
doShow(data) {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
saveStepData() {
|
||||
const list = [];
|
||||
this.tableData.forEach((item, index) => {
|
||||
const obj = {
|
||||
...item
|
||||
async saveStepData() {
|
||||
try {
|
||||
const list = [];
|
||||
this.tableData.forEach((item, index) => {
|
||||
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;
|
||||
list.push(obj);
|
||||
});
|
||||
updateTrainingStep(this.group, this.editData.id, list).then(res => {
|
||||
console.log('保存步骤成功!', res);
|
||||
this.$message.success('保存步骤成功!');
|
||||
// this.doClose();
|
||||
this.getStepList(this.editData);
|
||||
}).catch(err => {
|
||||
console.log('保存步骤失败', err);
|
||||
this.$message.error('保存步骤失败');
|
||||
});
|
||||
await updateTraining(trainingData);
|
||||
await updateTrainingStep(this.group, this.editData.id, list);
|
||||
this.$message.success('保存实训成功!');
|
||||
} catch {
|
||||
this.$message.error('保存实训失败');
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
@ -359,6 +372,19 @@ export default {
|
||||
});
|
||||
},
|
||||
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 => {
|
||||
console.log('保存背景', res);
|
||||
this.$message.success('保存背景成功!');
|
||||
|
@ -67,12 +67,11 @@ export default {
|
||||
doShow() {
|
||||
const playerList = JSON.parse(this.trainingDetail.playerIdJson);
|
||||
const memberData = this.$store.state.training.memberData;
|
||||
const activeTrainList = this.$store.state.map.activeTrainList || [];
|
||||
const newMemberData = {};
|
||||
playerList.forEach(playerId => {
|
||||
newMemberData[playerId] = memberData[playerId];
|
||||
});
|
||||
const result = covertMemberData(activeTrainList, Object.values(newMemberData));
|
||||
const result = covertMemberData([], Object.values(newMemberData));
|
||||
let list = [];
|
||||
result.deviceListData.forEach(item => {
|
||||
list = list.concat(item);
|
||||
|
@ -276,11 +276,6 @@ export default {
|
||||
this.playerId = '';
|
||||
if (detailResp.data.playerIdJson) {
|
||||
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.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
|
||||
|
Loading…
Reference in New Issue
Block a user