操作定义老地图处理

This commit is contained in:
fan 2020-04-09 16:51:17 +08:00
parent 0adcf6dac1
commit 5036229c47
2 changed files with 106 additions and 40 deletions

View File

@ -216,7 +216,7 @@ export default {
}
},
operationManage() {
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode}});
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, lineCode: this.$route.query.lineCode, drawWay: this.$route.query.drawWay}});
},
revertLesson(index, row) {
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {

View File

@ -1,6 +1,6 @@
<template>
<div style="height: 100%; overflow-y: auto;">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 98%;margin-left:1%;margin-top:20px;" />
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 98%;margin-left:1%;margin-top:20px;" />
<training-edit ref="create" type="ADD" @reloadTable="reloadTable" />
<training-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
<add-batch ref="addBatch" @reloadTable="reloadTable" />
@ -23,6 +23,9 @@ import TrainingEdit from './addEdit';
import AddBatch from './addBatch';
import SaveAs from './saveAs.vue';
import { UrlConfig } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import ConstConfig from '@/scripts/ConstConfig';
import Cookies from 'js-cookie';
export default {
name: 'TrainingRule',
@ -97,7 +100,7 @@ export default {
return this.$convertField(
row.operateType,
this.trainingOperateTypeMap[row.trainingType],
['code', 'name']
['value', 'label']
);
},
tagType: row => {
@ -159,31 +162,106 @@ export default {
},
methods: {
init() {
this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = list; //
});
this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = list; //
});
this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = list; //
});
this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = list; //
});
this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = list; //
});
this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = list; //
});
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = list; //
});
this.$Dictionary.limitOperation().then(list => {
this.trainingOperateTypeMap['08'] = list; //
});
if (this.$route.query.drawWay + '' === 'true') {
this.trainingOperateTypeMap = {
Switch: [],
Section: [],
Signal: [],
Stand: [],
Station: [],
ControlConvertMenu: [],
TrainWindow: []
};
let val;
for ( val in CMD['Switch']) {
this.trainingOperateTypeMap['Switch'].push(CMD['Switch'][val]);
}
for ( val in CMD['Section']) {
this.trainingOperateTypeMap['Section'].push(CMD['Section'][val]);
}
for ( val in CMD['Signal']) {
this.trainingOperateTypeMap['Signal'].push(CMD['Signal'][val]);
}
for ( val in CMD['Stand']) {
this.trainingOperateTypeMap['Stand'].push(CMD['Stand'][val]);
}
for ( val in CMD['Station']) {
this.trainingOperateTypeMap['Station'].push(CMD['Station'][val]);
}
for ( val in CMD['ControlConvertMenu']) {
this.trainingOperateTypeMap['ControlConvertMenu'].push(CMD['ControlConvertMenu'][val]);
}
for ( val in CMD['Train']) {
this.trainingOperateTypeMap['TrainWindow'].push(CMD['Train'][val]);
}
const trainingDeviceTypeList = ConstConfig.ConstSelect.trainingDeviceType || {};
for (val in trainingDeviceTypeList) {
this.trainingTypeList.push({code: val, name: Cookies.get('user_lang') == 'en' ? trainingDeviceTypeList[val].enlabel : trainingDeviceTypeList[val].label});
this.queryForm.queryObject.trainingType.config.data.push({value: val, label: Cookies.get('user_lang') == 'en' ? trainingDeviceTypeList[val].enlabel : trainingDeviceTypeList[val].label});
}
} else {
this.trainingOperateTypeMap = {};
this.$Dictionary.stationControl().then(list => {
this.trainingOperateTypeMap['01'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['01'].push({value: item.code, label: item.name});
});
});
this.$Dictionary.signalOperation().then(list => {
this.trainingOperateTypeMap['02'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['02'].push({value: item.code, label: item.name});
});
});
this.$Dictionary.switchOperation().then(list => {
this.trainingOperateTypeMap['03'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['03'].push({value: item.code, label: item.name});
});
});
this.$Dictionary.sectionOperation().then(list => {
this.trainingOperateTypeMap['04'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['04'].push({value: item.code, label: item.name});
});
});
this.$Dictionary.stationStandOperation().then(list => {
this.trainingOperateTypeMap['05'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['05'].push({value: item.code, label: item.name});
});
});
this.$Dictionary.trainPlanOperation().then(list => {
this.trainingOperateTypeMap['06'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['06'].push({value: item.code, label: item.name});
});
});
this.$Dictionary.trainOperation().then(list => {
this.trainingOperateTypeMap['07'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['07'].push({value: item.code, label: item.name});
});
});
this.$Dictionary.limitOperation().then(list => {
this.trainingOperateTypeMap['08'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['08'].push({value: item.code, label: item.name});
});
});
//
this.trainingTypeList = [];
this.$Dictionary.trainingType().then(list => {
this.trainingTypeList = list;
list.forEach(elem => {
this.queryForm.queryObject.trainingType.config.data.push({
value: elem.code,
label: elem.name
});
});
});
}
this.placeholderMap = {};
getPlaceholderList({ trainingType: '' }).then(res => {
res.data.forEach(item => {
@ -194,18 +272,6 @@ export default {
});
});
//
this.trainingTypeList = [];
this.$Dictionary.trainingType().then(list => {
this.trainingTypeList = list;
list.forEach(elem => {
this.queryForm.queryObject.trainingType.config.data.push({
value: elem.code,
label: elem.name
});
});
});
this.reloadTable();
},
repliceName(fieldValue, enumList) {