@@ -194,10 +194,11 @@ export default {
return option.name + ' (' + option.code+ ')';
} else if (label == 'code&&name') {
return option.code + ' (' + option.name+ ')';
+ } else {
+ return option.label;
}
},
decompose(item, prop) {
- console.log(prop);
if (!prop.includes('.')) {
return prop;
}
@@ -243,7 +244,7 @@ export default {
font-size: 14px;
color: #606266;
line-height: 40px;
- padding: 0 12px 0 0;
+ // padding: 0 12px 0 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
line-height: 28px;
diff --git a/src/views/map/mapdraft/mapedit/mapoperate/link.vue b/src/views/map/mapdraft/mapedit/mapoperate/link.vue
index ecab28df5..146e64017 100644
--- a/src/views/map/mapdraft/mapedit/mapoperate/link.vue
+++ b/src/views/map/mapdraft/mapedit/mapoperate/link.vue
@@ -26,91 +26,13 @@
-
-
- px
-
-
- 米
-
-
-
-
-
- px
-
-
- px
-
-
+
-
-
-
-
-
-
-
-
- {{ item.label }}
-
-
-
-
- px
-
-
- 米
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
- px
-
-
- 米
-
-
-
-
-
+
@@ -129,7 +51,6 @@ import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { getUName } from '@/jmap/utils/Uname';
import ConfigList from './config/list';
-import { getAttrList, getAttrRules } from '@/scripts/attribute';
export default {
name: 'LinkDraft',
@@ -150,7 +71,6 @@ export default {
},
data() {
return {
- form: getAttrList('link', 'attr', this),
linkLists: [],
activeName: 'first',
LinkType: '0',
@@ -231,29 +151,104 @@ export default {
...mapGetters('map', [
'linkList'
]),
+ form() {
+ const form = {
+ labelWidth: '130px',
+ items: [
+ { prop: 'code', label: 'Link编码:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, change: true, deviceChange: this.deviceChange },
+ { prop: 'name', label: 'Link名称:', type: 'input' },
+ { prop: 'lengthShow', label: 'Link显示长度:', type: 'number', min: 50, placeholder: 'px' },
+ { prop: 'lengthFact', label: 'Link实际长度:', type: 'number', min: 0, placeholder: '米' },
+ { prop: 'color', label: 'Link颜色:', type: 'color' },
+ { prop: 'leftFdCode', label: '左侧正向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
+ { prop: 'leftSdCode', label: '左侧侧向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
+ { prop: 'rightFdCode', label: '右侧正向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
+ { prop: 'rightSdCode', label: '右侧侧向Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
+ { prop: 'lp', label: 'Link 起点坐标:', type: 'coordinate', width: '160px', children: [
+ { prop: 'lp.x', firstLevel: 'lp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
+ { prop: 'lp.y', firstLevel: 'lp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
+ ] },
+ { prop: 'rp', label: 'Link 终点坐标:', type: 'coordinate', width: '160px', children: [
+ { prop: 'rp.x', firstLevel: 'rp', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
+ { prop: 'rp.y', firstLevel: 'rp', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
+ ] }
+ ]
+ };
+ return form;
+ },
rules() {
- const baseRules = getAttrRules('link', 'attr');
+ const rules = {
+ code: [
+ { required: true, message: '请选择设备', trigger: 'change' }
+ ],
+ name: [
+ { required: true, message: '请输入Link名称', trigger: 'blur' }
+ ],
+ lengthFact: [
+ { required: true, message: '请输入Link实际长度', trigger: 'blur' }
+ ]
+ };
// 清空表单验证提示信息
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
- return baseRules.rules;
+ return rules;
+ },
+
+ formMake1() {
+ const form = {
+ labelWidth: '120px',
+ items: [
+ { prop: 'lengthShow', label: '显示长度:', type: 'number', min: 0, placeholder: 'px' },
+ { prop: 'lengthFact', label: '真实长度:', type: 'number', min: 0, placeholder: '米' },
+ { prop: 'color', label: '颜色:', type: 'color' },
+ { prop: 'x', label: '坐标 x:', type: 'number', placeholder: 'px' },
+ { prop: 'y', label: '坐标 y:', type: 'number', placeholder: 'px' }
+ ]
+ };
+ return form;
+ },
+ formMake2() {
+ const form = {
+ labelWidth: '120px',
+ items: [
+ { prop: 'code', label: '基础Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
+ { prop: 'direct', label: '方向:', type: 'radio', border: true, radioList: this.LinkDriectTypeList },
+ { prop: 'lengthShow', label: '显示长度:', type: 'number', min: 0, placeholder: 'px', isHidden: !this.isSd },
+ { prop: 'lengthFact', label: '真实长度:', type: 'number', min: 0, placeholder: '米' },
+ { prop: 'color', label: '颜色:', type: 'color' }
+ ]
+ };
+ return form;
+ },
+ formMake3() {
+ const form = {
+ labelWidth: '120px',
+ items: [
+ { prop: 'lfd', label: '左侧正向Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
+ { prop: 'rfd', label: '右侧正向Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
+ { prop: 'lengthShow', label: '显示长度:', type: 'number', min: 0, placeholder: 'px', isHidden: !this.isSd },
+ { prop: 'lengthFact', label: '真实长度:', type: 'number', min: 0, placeholder: '米' },
+ { prop: 'color', label: '颜色:', type: 'color' }
+ ]
+ };
+ return form;
},
// 是否初始link
isNew() {
- this.addModel.type = '01';
+ // this.addModel.type = '01';
return this.LinkType === '0';
},
// 是否正向link
isFd() {
- this.addModel.type = '01';
+ // this.addModel.type = '01';
return this.LinkType === '1';
},
// 是否侧向link
isSd() {
- this.addModel.type = '02';
+ // this.addModel.type = '02';
return this.LinkType === '2';
}
},
@@ -264,9 +259,6 @@ export default {
$route() {
this.$refs.dataform.clearValidate();
this.activeName = 'first';
- },
- '$store.state.map.mapDataLoadedCount': function() {
- this.form = getAttrList('link', 'attr', this);
}
},
mounted() {
@@ -282,24 +274,23 @@ export default {
this.$refs.dataform.clearValidate();
this.$refs.make.resetFields();
if (selected && selected._type.toUpperCase() === 'Link'.toUpperCase()) {
- const model = selected.model;
- this.editModel.name = model.name;
- this.editModel.code = this.addModel.code = model.code;
- this.editModel.type = model.type;
- this.editModel.lengthShow = Math.sqrt(Math.pow(model.rp.x - model.lp.x, 2) + Math.pow(model.rp.y - model.lp.y, 2));
- this.editModel.lengthFact = model.lengthFact;
- this.editModel.color = model.color;
- this.editModel.leftFdCode = model.leftFdCode;
- this.editModel.leftSdCode = model.leftSdCode;
- this.editModel.rightFdCode = model.rightFdCode;
- this.editModel.rightSdCode = model.rightSdCode;
+ this.editModel.name = selected.name;
+ this.editModel.code = this.addModel.code = selected.code;
+ this.editModel.type = selected.type;
+ this.editModel.lengthShow = Math.sqrt(Math.pow(selected.rp.x - selected.lp.x, 2) + Math.pow(selected.rp.y - selected.lp.y, 2));
+ this.editModel.lengthFact = selected.lengthFact;
+ this.editModel.color = selected.color;
+ this.editModel.leftFdCode = selected.leftFdCode;
+ this.editModel.leftSdCode = selected.leftSdCode;
+ this.editModel.rightFdCode = selected.rightFdCode;
+ this.editModel.rightSdCode = selected.rightSdCode;
this.editModel.lp = {
- x: model.lp.x,
- y: model.lp.y
+ x: selected.lp.x,
+ y: selected.lp.y
};
this.editModel.rp = {
- x: model.rp.x,
- y: model.rp.y
+ x: selected.rp.x,
+ y: selected.rp.y
};
this.activeName = 'first';
} else {
diff --git a/src/views/map/mapdraft/mapedit/mapoperate/section.vue b/src/views/map/mapdraft/mapedit/mapoperate/section.vue
index f8873c0fe..ee1859831 100644
--- a/src/views/map/mapdraft/mapedit/mapoperate/section.vue
+++ b/src/views/map/mapdraft/mapedit/mapoperate/section.vue
@@ -158,7 +158,6 @@ import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import JTriangle from '@/jmap/utils/JTriangle';
import ConfigList from './config/list';
-import { getAttrList, getAttrRules } from '@/scripts/attribute';
export default {
name: 'SectionDraft',
@@ -179,7 +178,6 @@ export default {
},
data() {
return {
- form: getAttrList('section', 'attr', this),
linksCollection: [],
activeName: 'first',
SectionTypeList: [],
@@ -281,14 +279,133 @@ export default {
'stationStandList',
'skinStyle'
]),
+ form() {
+ const form = {
+ labelWidth: '160px',
+ items: [
+ { prop: 'stationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
+ { prop: 'parentCode', label: '关联物理区段:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode },
+ { prop: 'code', label: '区段编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.sectionList, change: true, deviceChange: this.deviceChange },
+ { prop: 'type', label: '区段类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList },
+ { prop: 'name', label: '区段名称:', type: 'input' },
+ { prop: 'namePoint', label: '区段名称偏移量:', type: 'coordinate', width: '150px', children: [
+ { prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
+ { prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
+ ] },
+ { prop: 'kmRangeLeft', label: '左侧公里标(米):', type: 'number', min: 0 },
+ { prop: 'kmRangeRight', label: '右侧公里标(米):', type: 'number', min: 0 },
+ { prop: 'region', label: '区间:', type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList },
+ { prop: 'nameShow', label: '是否显示区段名称:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'axleShow', label: '是否显示计轴:', type: 'checkbox', disabled: this.isStationAxleShow, isHidden: !this.isSectionType},
+ { prop: 'logicSectionShow', label: '是否显示逻辑区段:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'logicSectionNameShow', label: '是否显示逻辑区段名称:', type: 'checkbox', disabled: this.islogicSectionNameShow, isHidden: !this.isSectionType },
+ { prop: 'isStandTrack', label: '是否站台轨:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'standTrackName', label: '站台轨名称:', type: 'input', isHidden: !this.isstandTrackNameShow },
+ { prop: 'standTrackNamePosition', label: '站台轨名称偏移量:', type: 'coordinate', width: '150px', isHidden: !this.isstandTrackNameShow, children: [
+ { prop: 'standTrackNamePosition.x', firstLevel: 'standTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
+ { prop: 'standTrackNamePosition.y', firstLevel: 'standTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
+ ] },
+ { prop: 'relStandCode', label: '站台编码:', type: 'selectHover', optionLabel: 'code&&name', optionValue: 'code', options: this.stationStandList, hover: this.hover, buttonType: 'relStandCode', buttonShowType: this.isButtonType, isHidden: !this.isrelStandCode },
+ { prop: 'isReentryTrack', label: '是否折返轨:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'reentryTrackName', label: '折返轨名称:', type: 'input', isHidden: !this.isreentryTrackName },
+ { prop: 'reentryTrackNamePosition', label: '折返轨名称偏移量:', type: 'coordinate', width: '150px', isHidden: !this.isreentryTrackName, children: [
+ { prop: 'reentryTrackNamePosition.x', firstLevel: 'reentryTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
+ { prop: 'reentryTrackNamePosition.y', firstLevel: 'reentryTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
+ ] },
+ { prop: 'isTransferTrack', label: '是否转换轨:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'transferTrackName', label: '转换轨名称:', type: 'input', isHidden: !this.istransferTrackName },
+ { prop: 'transferTrackNamePosition', label: '转换轨名称偏移量:', type: 'coordinate', width: '150px', isHidden: !this.istransferTrackName, children: [
+ { prop: 'transferTrackNamePosition.x', firstLevel: 'transferTrackNamePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
+ { prop: 'transferTrackNamePosition.y', firstLevel: 'transferTrackNamePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
+ ] },
+ { prop: 'destinationCode', label: '目的地码:', type: 'input', isHidden: !this.isdestinationCode },
+ { prop: 'destinationCodePoint', label: '目的地码坐标:', type: 'coordinate', width: '150px', isHidden: !this.isdestinationCode, children: [
+ { prop: 'destinationCodePoint.x', firstLevel: 'destinationCodePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
+ { prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
+ ] },
+ { prop: 'destinationCodeShow', label: '是否显示目的地码:', type: 'checkbox', isHidden: !this.isdestinationCode },
+ { prop: 'leftStopPointOffset', label: '左向停车点偏移量:', type: 'number', min: 0, isHidden: !this.isStopPointOffset },
+ { prop: 'rightStopPointOffset', label: '右向停车点偏移量:', type: 'number', min: 0, isHidden: !this.isStopPointOffset },
+ { prop: 'isSwitchSection', label: '是否道岔区段:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'relSwitchCode', label: '关联道岔Code:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode },
+ { prop: 'logicSectionNameSort', label: '逻辑区段排序:', type: 'radio', isHidden: !this.isLogicSectionNameSort, radioList: [
+ {value: true, label: '从小到大'},
+ {value: false, label: '从大到小'}
+ ] },
+ { prop: 'linkCode', label: '关联的Link:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, disabled: true, isHidden: !this.isSectionType },
+ { prop: 'sepTypeLeft', label: '左侧分隔符类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSectionType },
+ { prop: 'offsetLeft', label: '左侧Link偏移量:', type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
+ { prop: 'sepTypeRight', label: '右侧分隔符类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionSepTypeList, isHidden: !this.isSectionType },
+ { prop: 'offsetRight', label: '右侧Link偏移量:', type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
+ { prop: 'isSegmentation', label: '是否分割:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'segmentationPosition', label: '默认背景:', type: 'coordinate', width: '150px', isHidden: !this.issegmentationPosition, children: [
+ { prop: 'segmentationPosition.x', firstLevel: 'segmentationPosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px', disabled: true },
+ { prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
+ ] },
+ { prop: 'isCurve', label: '是否曲线:', type: 'checkbox', isHidden: !this.isSectionType },
+ { prop: 'points', label: '区段显示坐标:', type: 'points', width: '160px', isHidden: !this.isPointsShow, pointDisabled: this.pointDisabledName, addPoint: this.addPoint, delPoint: this.delPoint },
+ { prop: 'trainPosType', label: '列车所在方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.TrainPositionTypeList, isHidden: !this.isSectionType }
+ ]
+ };
+ return form;
+ },
rules() {
- const baseRules = getAttrRules('section', 'attr');
+ const rules = {
+ code: [
+ { required: true, message: '请选择设备', trigger: 'change' }
+ ],
+ name: [
+ { required: true, message: '请输入区段名称', trigger: 'blur' }
+ ],
+ type: [
+ { required: true, message: '请输入区段类型', trigger: 'blur' }
+ ],
+ relStandCode: [
+ { required: true, message: '请选择关联站台', trigger: 'change' }
+ ],
+ leftStopPointOffset: [
+ { required: true, message: '请输入左向停车点偏移量', trigger: 'blur' }
+ ],
+ rightStopPointOffset: [
+ { required: true, message: '请输入右向停车点偏移量', trigger: 'blur' }
+ ],
+ destinationCode: [
+ { required: true, message: '请输入目的地码', trigger: 'blur' }
+ ],
+ 'destinationCodePoint.x': [
+ { required: true, message: '请输入目的地码坐标X', trigger: 'blur' }
+ ],
+ 'destinationCodePoint.y': [
+ { required: true, message: '请输入目的地码坐标Y', trigger: 'blur' }
+ ],
+ 'namePoint.x': [
+ { required: true, message: '请输入区段名称坐标X', trigger: 'blur' }
+ ],
+ 'namePoint.y': [
+ { required: true, message: '请输入区段名称坐标Y', trigger: 'blur' }
+ ],
+ logicSectionNameSort: [
+ { required: true, message: '请选择逻辑区段名称排序', trigger: 'change' }
+ ],
+ offsetLeft: [
+ { required: true, message: '请输入左侧Link偏移量', trigger: 'blur' }
+ ],
+ sepTypeLeft: [
+ { required: true, message: '请选择左侧分隔符', trigger: 'change' }
+ ],
+ offsetRight: [
+ { required: true, message: '请输入右侧Link偏移量', trigger: 'blur' }
+ ],
+ sepTypeRight: [
+ { required: true, message: '请选择右侧分隔符', trigger: 'change' }
+ ]
+ };
// 清空表单验证提示信息
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
- return baseRules.rules;
+ return rules;
},
PhysicalSectionList() {
let list = [];
@@ -353,7 +470,7 @@ export default {
},
isButtonType() {
- return this.fieldS === 'relStandCode';
+ return this.fieldS == 'relStandCode';
},
isrelStandCode() {
return this.editModel.type !== '03' && this.editModel.isStandTrack && this.editModel.type == '01';
@@ -371,7 +488,7 @@ export default {
return this.editModel.type !== '03' && this.editModel.points.length > 0;
},
pointDisabledName() {
- return this.editModel.type === '02';
+ return this.editModel.type == '02';
}
},
watch: {
@@ -381,19 +498,6 @@ export default {
$route() {
this.$refs.dataform.clearValidate();
this.activeName = 'first';
- },
- editModel: {
- handler: function() {
- if (this.sectionList) {
- this.form = getAttrList('section', 'attr', this);
- }
- },
- deep: true
- },
- '$store.state.map.mapDataLoadedCount': function() {
- if (this.sectionList) {
- this.form = getAttrList('section', 'attr', this);
- }
}
},
mounted() {
@@ -432,11 +536,10 @@ export default {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
- deviceSelect(model) {
+ deviceSelect(selected) {
if (!this.fieldS) { // 判断是否激活选择站台
this.editModel.points = [];
- if (model && model._type.toUpperCase() === 'Section'.toUpperCase()) {
- const selected = model.model;
+ if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
this.editModel.code = selected.code;
this.editModel.name = selected.name;
this.editModel.type = selected.type;
@@ -540,9 +643,6 @@ export default {
} else {
this.field = field === this.field ? '' : field;
}
- if (this.sectionList) {
- this.form = getAttrList('section', 'attr', this);
- }
},
handleDelete(index, row) {
row.num = 0;
diff --git a/src/views/map/mapdraft/mapedit/mapoperate/signal.vue b/src/views/map/mapdraft/mapedit/mapoperate/signal.vue
index 4be212dd0..c8aec2ad2 100644
--- a/src/views/map/mapdraft/mapedit/mapoperate/signal.vue
+++ b/src/views/map/mapdraft/mapedit/mapoperate/signal.vue
@@ -67,7 +67,6 @@ import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import JTriangle from '@/jmap/utils/JTriangle';
import ConfigList from './config/list';
-import { getAttrList, getAttrRules } from '@/scripts/attribute';
export default {
name: 'SignalDraft',
@@ -88,7 +87,6 @@ export default {
},
data() {
return {
- form: getAttrList('signal', 'attr', this),
activeName: 'first',
SignalLeftOrRightList: [],
SignalPotLampTypeList: [],
@@ -159,8 +157,6 @@ export default {
x: 0,
y: 0
},
- // 'position.x': 0,
- // 'position.y': 0,
buttonPosition: {
x: 0,
y: 0
@@ -198,14 +194,80 @@ export default {
}
return list;
},
+ form() {
+ const form = {
+ labelWidth: '150px',
+ items: [
+ { prop: 'stationCode', label: '所属设备集中站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList },
+ { prop: 'code', label: '信号机编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.signalList, change: true, deviceChange: this.deviceChange },
+ { prop: 'name', label: '信号机名称:', type: 'input' },
+ { prop: 'uniqueName', label: '信号机唯一名称:', type: 'input' },
+ { prop: 'nameShow', label: '是否显示信号机名称:', type: 'checkbox' },
+ { prop: 'lampPostType', label: '灯柱类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPostTypeList },
+ { prop: 'lampPositionType', label: '灯位类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList },
+ { prop: 'useType', label: '用途类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalUseTypeList },
+ { prop: 'potLampType', label: '点灯类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPotLampTypeList },
+ { prop: 'directionType', label: '方向类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionTypeList },
+ { prop: 'positionType', label: '信号机位置类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalPositionTypeList },
+ { prop: 'linkCode', label: 'LinkCode:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList },
+ { prop: 'offset', label: '偏移量:', type: 'number', min: 0, placeholder: '米' },
+ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: '信号机x:', type: 'number', placeholder: '米' },
+ { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: '信号机y:', type: 'number', placeholder: '米' },
+ { prop: 'rotate', label: '旋转角度:', type: 'number', min: -90, max: 90, placeholder: '度' },
+ { prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: '信号机名字偏移量 x:', type: 'number', placeholder: 'px' },
+ { prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'x', label: '信号机名字偏移量 y:', type: 'number', placeholder: 'px' },
+ { prop: 'buttonShow', label: '是否显示按钮:', type: 'checkbox' },
+ { prop: 'buttonPosition.x', firstLevel: 'buttonPosition', secondLevel: 'x', label: '按钮x:', type: 'number', placeholder: 'px' },
+ { prop: 'buttonPosition.y', firstLevel: 'buttonPosition', secondLevel: 'x', label: '按钮y:', type: 'number', placeholder: 'px' },
+ { prop: 'guideShow', label: '是否显示引导信号灯:', type: 'checkbox' },
+ { prop: 'guidePosition.x', firstLevel: 'guidePosition', secondLevel: 'x', label: '引导信号x:', type: 'number', placeholder: 'px' },
+ { prop: 'guidePosition.y', firstLevel: 'guidePosition', secondLevel: 'x', label: '引导信号y:', type: 'number', placeholder: 'px' }
+ ]
+ };
+ return form;
+ },
rules() {
- const baseRules = getAttrRules('signal', 'attr');
+ const rules = {
+ code: [
+ { required: true, message: '请选择设备', trigger: 'change' }
+ ],
+ name: [
+ { required: true, message: '请输入信号灯名称', trigger: 'blur' }
+ ],
+ uniqueName: [
+ { required: true, message: '请输入信号机唯一名称', trigger: 'blur' }
+ ],
+ offset: [
+ { required: true, message: '请输入偏移量', trigger: 'blur' }
+ ],
+ stationCode: [
+ { required: true, message: '请输入设备集中站', trigger: 'change' }
+ ],
+ 'position.x': [
+ { required: true, message: '信号机x', trigger: 'blur' }
+ ],
+ 'position.y': [
+ { required: true, message: '信号机y', trigger: 'blur' }
+ ],
+ 'buttonPosition.x': [
+ { required: true, message: '请输入按钮x', trigger: 'blur' }
+ ],
+ 'buttonPosition.y': [
+ { required: true, message: '请输入按钮y', trigger: 'blur' }
+ ],
+ 'guidePosition.x': [
+ { required: true, message: '请输入引导信号x', trigger: 'blur' }
+ ],
+ 'guidePosition.y': [
+ { required: true, message: '请输入引导信号y', trigger: 'blur' }
+ ]
+ };
// 清空表单验证提示信息
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
- return baseRules.rules;
+ return rules;
}
},
watch: {
@@ -215,9 +277,6 @@ export default {
$route() {
this.$refs.dataform.resetFields();
this.activeName = 'first';
- },
- '$store.state.map.mapDataLoadedCount': function() {
- this.form = getAttrList('signal', 'attr', this);
}
},
mounted() {
@@ -252,11 +311,10 @@ export default {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
- deviceSelect(model) {
+ deviceSelect(selected) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
- if (model && model._type.toUpperCase() === 'Signal'.toUpperCase()) {
- const selected = model.model;
+ if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.editModel.code = selected.code;
this.editModel.name = selected.name;
this.editModel.uniqueName = selected.uniqueName;
@@ -298,9 +356,8 @@ export default {
};
}
this.activeName = 'first';
- } else if (model && model._type.toUpperCase() === 'Section'.toUpperCase()) {
+ } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
// 获取逻辑区段关联的物理区段
- const selected = model.model;
if (selected.type === '02') {
const section = this.sectionList.find(stn => stn.parentCode === selected.code);
this.addModel.sectionCode = section ? section.code : '';
diff --git a/src/views/map/mapdraft/mapedit/mapoperate/station.vue b/src/views/map/mapdraft/mapedit/mapoperate/station.vue
index de25a5a4d..fbde26af2 100644
--- a/src/views/map/mapdraft/mapedit/mapoperate/station.vue
+++ b/src/views/map/mapdraft/mapedit/mapoperate/station.vue
@@ -37,7 +37,6 @@
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import ConfigList from './config/list';
-import { getAttrList, getAttrRules } from '@/scripts/attribute';
export default {
name: 'StationDraft',
@@ -58,7 +57,6 @@ export default {
},
data() {
return {
- form: getAttrList('station', 'attr', this),
activeName: 'first',
editModel: {
centralized: false,
@@ -99,14 +97,57 @@ export default {
'zcList',
'skinStyle'
]),
+ form() {
+ const form = {
+ labelWidth: '150px',
+ items: [
+ { prop: 'concentrateStationCode', label: '所属联锁站编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList },
+ { prop: 'code', label: '车站编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.stationList, change: true, deviceChange: this.deviceChange },
+ { prop: 'zcCode', label: '所属zc区域编码:', type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.zcList },
+ { prop: 'centralized', label: '是否集中站:', type: 'checkbox' },
+ { prop: 'name', label: '车站名称:', type: 'input' },
+ { prop: 'runPlanName', label: '真实名称:', type: 'input' },
+ { prop: 'visible', label: '是否显示:', type: 'checkbox' },
+ { prop: 'nameFont', label: '车站字体:', type: 'font', placeholder: '车站字体' },
+ { prop: 'nameFontColor', label: '车站字体颜色:', type: 'color' },
+ { prop: 'kmPostShow', label: '是否显示公里标名称:', type: 'checkbox' },
+ { prop: 'kmRange', label: '公里标距离:', type: 'number', min: 0, placeholder: '米' },
+ { prop: 'kmPost', label: '公里标名称:', type: 'input' },
+ { prop: 'kmPostFont', label: '公里标字体:', type: 'font', placeholder: '公里标字体' },
+ { prop: 'kmPostFontColor', label: '公里标字体颜色:', type: 'color' },
+ { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x坐标:', type: 'number', placeholder: 'px' },
+ { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y坐标:', type: 'number', placeholder: 'px' }
+ ]
+ };
+ return form;
+ },
rules() {
- const baseRules = getAttrRules('station', 'attr');
+ const rules = {
+ code: [
+ { required: true, message: '请选择设备', trigger: 'change' }
+ ],
+ name: [
+ { required: true, message: '请输入车站名称', trigger: 'blur' }
+ ],
+ kmRange: [
+ { required: true, message: '请输入公里标距离', trigger: 'blur' }
+ ],
+ kmPost: [
+ { required: true, message: '请输入公里标名称', trigger: 'blur' }
+ ],
+ 'position.x': [
+ { required: true, message: '请输入x坐标', trigger: 'blur' }
+ ],
+ 'position.y': [
+ { required: true, message: '请输入y坐标', trigger: 'blur' }
+ ]
+ };
// 清空表单验证提示信息
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
- return baseRules.rules;
+ return rules;
},
PhysicalSectionList() {
let list = [];
@@ -123,9 +164,6 @@ export default {
$route() {
this.$refs.dataform.resetFields();
this.activeName = 'first';
- },
- '$store.state.map.mapDataLoadedCount': function() {
- this.form = getAttrList('station', 'attr', this);
}
},
methods: {
@@ -133,11 +171,10 @@ export default {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
- deviceSelect(model) {
+ deviceSelect(selected) {
this.$refs.dataform.resetFields();
this.$refs.make.resetFields();
- if (model && model._type.toUpperCase() === 'Station'.toUpperCase()) {
- const selected = model.model;
+ if (selected && selected._type.toUpperCase() === 'Station'.toUpperCase()) {
this.editModel.centralized = selected.centralized;
this.editModel.concentrateStationCode = selected.concentrateStationCode;
this.editModel.code = selected.code;
@@ -160,8 +197,7 @@ export default {
};
}
this.activeName = 'first';
- } else if (model && model._type.toUpperCase() === 'Section'.toUpperCase()) {
- const selected = model.model;
+ } else if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
// 获取逻辑区段关联的物理区段
if (selected.type !== '01') {
const section = this.sectionList.find(stn => stn.parentCode === selected.code);
diff --git a/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue b/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue
index 7062e9460..c52568b21 100644
--- a/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue
+++ b/src/views/map/mapdraft/mapedit/mapoperate/stationcontrol.vue
@@ -3,52 +3,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- px
-
-
- px
-
-
+
修改
@@ -81,10 +36,12 @@