操作定义老地图处理

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

@ -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,41 +162,93 @@ export default {
},
methods: {
init() {
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; //
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; //
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; //
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; //
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; //
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; //
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; //
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; //
});
this.placeholderMap = {};
getPlaceholderList({ trainingType: '' }).then(res => {
res.data.forEach(item => {
if (!this.placeholderMap[item.trainingType]) {
this.placeholderMap[item.trainingType] = [];
}
this.placeholderMap[item.trainingType].push(item);
this.trainingOperateTypeMap['08'] = []; //
list.forEach(item => {
this.trainingOperateTypeMap['08'].push({value: item.code, label: item.name});
});
});
//
this.trainingTypeList = [];
this.$Dictionary.trainingType().then(list => {
@ -205,6 +260,17 @@ export default {
});
});
});
}
this.placeholderMap = {};
getPlaceholderList({ trainingType: '' }).then(res => {
res.data.forEach(item => {
if (!this.placeholderMap[item.trainingType]) {
this.placeholderMap[item.trainingType] = [];
}
this.placeholderMap[item.trainingType].push(item);
});
});
this.reloadTable();
},