diff --git a/src/jmapNew/theme/xian_02/menus/menuRequest.vue b/src/jmapNew/theme/xian_02/menus/menuRequest.vue index 8bd6d6646..4c075a7f3 100644 --- a/src/jmapNew/theme/xian_02/menus/menuRequest.vue +++ b/src/jmapNew/theme/xian_02/menus/menuRequest.vue @@ -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, diff --git a/src/utils/index.js b/src/utils/index.js index 056af38cf..bad85f49a 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -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 { diff --git a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue index 63e6248a3..7edfac6c9 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/batchSettings.vue @@ -111,7 +111,7 @@ export default { trainPosType: '' }, roadModel: { - roadType: '', + roadType: null, sectionCode: '' }, positionTypes: [ diff --git a/src/views/newMap/newMapdraft/mapoperate/section/create.vue b/src/views/newMap/newMapdraft/mapoperate/section/create.vue index 53d7fe59c..c11252344 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/create.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/create.vue @@ -226,7 +226,7 @@ export default { points: [], leftAxlePosition: 0, rightAxlePosition: 0, - roadType: '', + roadType: null, firstTurnBack: false }; }, diff --git a/src/views/newMap/newMapdraft/mapoperate/section/index.vue b/src/views/newMap/newMapdraft/mapoperate/section/index.vue index 5c3b4382d..5bf8a63db 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/index.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/index.vue @@ -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()) { diff --git a/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue b/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue index 3fc3a140d..a87cf2a6e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue +++ b/src/views/newMap/newMapdraft/mapoperate/section/splitOrMerge.vue @@ -284,8 +284,8 @@ export default { region: '', trainWindowCode: '', relevanceSectionList: [], - roadType: '', - firstTurnBack: false + roadType: null, + firstTurnBack: false }; models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](lsection.code), { _dispose: true })); models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true }));