区段绘图数据调整roadType不为''

This commit is contained in:
fan 2020-04-29 17:53:35 +08:00
parent 1c8929cb08
commit 35d13ae529
6 changed files with 15 additions and 8 deletions

View File

@ -48,7 +48,8 @@ export default {
'border-right': 'none'
},
row: {},
loading: false
loading: false,
specialOperationList: [OperationEvent.Signal.cancelTrainRoute.lock.menu.operation]
};
},
computed: {
@ -103,6 +104,9 @@ export default {
},
commitEachCommand(requestList) {
const eachCmd = requestList[0];
if (this.specialOperationList.includes(eachCmd) && eachCmd.cmdType) {
// this.handelSpecialOperation(eachCmd);
}
const operate = {
send: true,
operation: eachCmd.operation.code,

View File

@ -149,7 +149,7 @@ export function deepAssign(obj, item) {
const target = item.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象
for (const keys in item) {
if (item.hasOwnProperty(keys) && keys != 'instance') { // instance 对面不拷贝
if (typeof item[keys] === 'object') { // 如果值是对象,就递归一下
if (item[keys] && typeof item[keys] === 'object') { // 如果值是对象,就递归一下
target[keys] = item[keys].constructor === Array ? [] : {};
target[keys] = deepClone(item[keys]);
} else {

View File

@ -111,7 +111,7 @@ export default {
trainPosType: ''
},
roadModel: {
roadType: '',
roadType: null,
sectionCode: ''
},
positionTypes: [

View File

@ -226,7 +226,7 @@ export default {
points: [],
leftAxlePosition: 0,
rightAxlePosition: 0,
roadType: '',
roadType: null,
firstTurnBack: false
};
},

View File

@ -123,7 +123,7 @@ export default {
logicSectionEndOffset: 0,
leftAxlePosition: 0,
rightAxlePosition: 0,
roadType: '',
roadType: null,
firstTurnBack: false
},
oldPoint: [], //
@ -161,7 +161,7 @@ export default {
{ 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: 'roadType', label: '线路类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.sectionRoadTypeList, isHidden: !this.isSwitchSectionType},
{ prop: 'roadType', label: '线路类型:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.sectionRoadTypeList, clearable:true, isHidden: !this.isSwitchSectionType, change: true, deviceChange: this.roadTypeChange},
{ prop: 'leftSectionCode', label: this.$t('map.leftAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'leftSection', buttonShowType: this.isLeftSectionButtonShow, isHidden: !this.hasAssociatedSection}, //
{ prop: 'rightSectionCode', label: this.$t('map.rightAssociatedSection'), type: 'selectHover', optionLabel: 'name&&code', optionValue: 'code', clearable: true, options: this.switchAndPhySicalSectionList, hover: this.hover, buttonType: 'rightSection', buttonShowType: this.isRightSectionButtonShow, isHidden: !this.hasAssociatedSection}, //
{ prop: 'parentCode', label: this.$t('map.associatedSection'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: true, options: this.sectionList, isHidden: !this.isParentCode }, // /code
@ -403,6 +403,9 @@ export default {
this.$emit('setCenter', code);
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
},
roadTypeChange(val) {
if (!val) { this.editModel.roadType = null; }
},
deviceSelect(selected) {
//
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {

View File

@ -284,7 +284,7 @@ export default {
region: '',
trainWindowCode: '',
relevanceSectionList: [],
roadType: '',
roadType: null,
firstTurnBack: false
};
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true }));