绘图相关调整_(批量创建车站,区段添加激活)
This commit is contained in:
parent
30bab42bbf
commit
f5a5d20ebb
@ -372,8 +372,8 @@ export default {
|
|||||||
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||||
] },
|
] },
|
||||||
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList},
|
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList},
|
||||||
{ prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.AssociateSectionList},
|
{ prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.AssociateSectionList, hover: this.hover, buttonType: 'leftSection', buttonShowType: this.isLeftSectionButtonShow},
|
||||||
{ prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.AssociateSectionList},
|
{ prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.AssociateSectionList},
|
||||||
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
|
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
|
||||||
|
|
||||||
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
|
{ prop: 'isStandTrack', label: this.$t('map.isStandTrack'), type: 'checkbox', isHidden: !this.isStandTrackShow }, // 1
|
||||||
@ -445,7 +445,7 @@ export default {
|
|||||||
rules() {
|
rules() {
|
||||||
var validateLeftSection = (rule, value, callback) => {
|
var validateLeftSection = (rule, value, callback) => {
|
||||||
const leftSection = value ? this.$store.getters['map/getDeviceByCode'](value) : '';
|
const leftSection = value ? this.$store.getters['map/getDeviceByCode'](value) : '';
|
||||||
if (leftSection && (leftSection.points[1].x !== this.selected.points[0].x || leftSection.points[1].y !== this.selected.points[0].y )) {
|
if (leftSection && (leftSection.points[1].x !== this.editModel.points[0].x || leftSection.points[1].y !== this.editModel.points[0].y )) {
|
||||||
callback(new Error(this.$t('rules.theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent')));
|
callback(new Error(this.$t('rules.theLeftEndOfTheSelectedAssociatedSectionIsNotAdjacent')));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
@ -453,7 +453,7 @@ export default {
|
|||||||
};
|
};
|
||||||
var validateRightSection = (rule, value, callback) => {
|
var validateRightSection = (rule, value, callback) => {
|
||||||
const rightSection = value ? this.$store.getters['map/getDeviceByCode'](value) : '';
|
const rightSection = value ? this.$store.getters['map/getDeviceByCode'](value) : '';
|
||||||
if (rightSection && (rightSection.points[0].x !== this.selected.points[1].x || rightSection.points[0].y !== this.selected.points[1].y )) {
|
if (rightSection && (rightSection.points[0].x !== this.editModel.points[1].x || rightSection.points[0].y !== this.editModel.points[1].y )) {
|
||||||
callback(new Error(this.$t('rules.theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent')));
|
callback(new Error(this.$t('rules.theRightEndOfTheSelectedAssociatedSectionIsNotAdjacent')));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
@ -595,6 +595,9 @@ export default {
|
|||||||
},
|
},
|
||||||
isStandTrackShow() {
|
isStandTrackShow() {
|
||||||
return this.editModel.type !== '04' && this.editModel.type !== '03' && !this.editModel.isSwitchSection;
|
return this.editModel.type !== '04' && this.editModel.type !== '03' && !this.editModel.isSwitchSection;
|
||||||
|
},
|
||||||
|
isLeftSectionButtonShow() {
|
||||||
|
return this.field === 'leftSection';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -642,8 +645,21 @@ export default {
|
|||||||
deviceSelect(selected) {
|
deviceSelect(selected) {
|
||||||
this.AssociateSectionList = this.sectionList.filter(item => { return item.type === '01' && item.code !== selected.code; });
|
this.AssociateSectionList = this.sectionList.filter(item => { return item.type === '01' && item.code !== selected.code; });
|
||||||
if (!this.fieldS) { // 判断是否激活选择站台
|
if (!this.fieldS) { // 判断是否激活选择站台
|
||||||
this.$refs.dataform.resetFields();
|
|
||||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||||
|
if (this.field === 'leftSection') {
|
||||||
|
this.editModel.leftSectionCode = selected.code;
|
||||||
|
this.activeName = 'first';
|
||||||
|
this.field = '';
|
||||||
|
this.$emit('fieldSelect', '');
|
||||||
|
return;
|
||||||
|
} else if (this.field === 'rightSection') {
|
||||||
|
this.editModel.rightSectionCode = selected.code;
|
||||||
|
this.activeName = 'first';
|
||||||
|
this.field = '';
|
||||||
|
this.$emit('fieldSelect', '');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$refs.dataform.resetFields();
|
||||||
this.editModel.points = [];
|
this.editModel.points = [];
|
||||||
this.activeName = 'first';
|
this.activeName = 'first';
|
||||||
this.editModel = deepAssign(this.editModel, selected);
|
this.editModel = deepAssign(this.editModel, selected);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<el-form ref="make" label-width="140px" :model="addModel" size="mini" :rules="mergeRules">
|
<el-form ref="make" label-width="140px" :model="addModel" size="mini" :rules="mergeRules">
|
||||||
<el-form-item :label="$t('map.physicalSegmentName')" prop="sectionCode">
|
<el-form-item :label="$t('map.physicalSegmentName')" prop="sectionCode">
|
||||||
<el-select v-model="addModel.sectionCode" filterable>
|
<el-select v-model="addModel.sectionCode" multiple filterable style="width:300px;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in PhysicalSectionList"
|
v-for="item in PhysicalSectionList"
|
||||||
:key="item.code"
|
:key="item.code"
|
||||||
@ -140,7 +140,7 @@ export default {
|
|||||||
controlled:false
|
controlled:false
|
||||||
},
|
},
|
||||||
addModel: {
|
addModel: {
|
||||||
sectionCode: ''
|
sectionCode: []
|
||||||
},
|
},
|
||||||
skins: [],
|
skins: [],
|
||||||
mergeRules: {
|
mergeRules: {
|
||||||
@ -254,7 +254,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase() && this.field.toUpperCase() === 'selectStationCode'.toUpperCase()) {
|
||||||
if (selected.type == '01') {
|
if (selected.type == '01') {
|
||||||
this.addModel.sectionCode = selected.code;
|
this.addModel.sectionCode.push(selected.code);
|
||||||
this.activeName = 'second';
|
this.activeName = 'second';
|
||||||
this.field = '';
|
this.field = '';
|
||||||
this.$emit('stationSectionCode', '');
|
this.$emit('stationSectionCode', '');
|
||||||
@ -333,38 +333,41 @@ export default {
|
|||||||
create() {
|
create() {
|
||||||
this.$refs['make'].validate((valid) => {
|
this.$refs['make'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.addModel.sectionCode) {
|
if (this.addModel.sectionCode.length) {
|
||||||
const uid = getUID('Station');
|
const models = [];
|
||||||
const model = {
|
this.addModel.sectionCode.forEach((item) => {
|
||||||
_type: 'Station',
|
const uid = getUID('Station');
|
||||||
code: uid,
|
const model = {
|
||||||
zcCode: '',
|
_type: 'Station',
|
||||||
runPlanName: '',
|
code: uid,
|
||||||
visible: true,
|
zcCode: '',
|
||||||
nameFont: '14px consolas',
|
runPlanName: '',
|
||||||
nameFontColor: '#FFFFFF',
|
visible: true,
|
||||||
kmPost: '1000km~2000km',
|
nameFont: '14px consolas',
|
||||||
kmPostShow: true,
|
nameFontColor: '#FFFFFF',
|
||||||
kmPostFont: '8px consolas',
|
kmPost: '1000km~2000km',
|
||||||
kmPostFontColor: '#FFFFFF',
|
kmPostShow: true,
|
||||||
centralized: false,
|
kmPostFont: '8px consolas',
|
||||||
concentrateStationCode: '',
|
kmPostFontColor: '#FFFFFF',
|
||||||
controlled:false,
|
centralized: false,
|
||||||
chargeStationCodeList:[]
|
concentrateStationCode: '',
|
||||||
};
|
controlled:false,
|
||||||
this.sectionList.forEach(elem => {
|
chargeStationCodeList:[]
|
||||||
if (elem.code === this.addModel.sectionCode) {
|
};
|
||||||
const l = 0;
|
this.sectionList.forEach(elem => {
|
||||||
const r = elem.points.length - 1;
|
if (elem.code === item) {
|
||||||
model.name = 'Station_' + elem.name.replace('Station_', '');
|
const l = 0;
|
||||||
model.position = {
|
const r = elem.points.length - 1;
|
||||||
x: elem.points[l].x + (elem.points[r].x - elem.points[l].x) / 2,
|
model.name = 'Station_' + elem.name.replace('Station_', '');
|
||||||
y: elem.points[l].y
|
model.position = {
|
||||||
};
|
x: elem.points[l].x + (elem.points[r].x - elem.points[l].x) / 2,
|
||||||
}
|
y: elem.points[l].y - 100
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
models.push(model);
|
||||||
});
|
});
|
||||||
|
this.$emit('updateMapModel', models);
|
||||||
this.$emit('updateMapModel', model);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user