diff --git a/src/views/newMap/newMapdraft/configMap.vue b/src/views/newMap/newMapdraft/configMap.vue index 6e05b9c34..2eccf1801 100644 --- a/src/views/newMap/newMapdraft/configMap.vue +++ b/src/views/newMap/newMapdraft/configMap.vue @@ -3,6 +3,7 @@ + 全选 @@ -25,14 +26,13 @@ export default { ViewMode: ViewMode, dialogTableVisible: false, viewSelect: [ViewMode.LOGIC, ViewMode.PHYSICAL], - LogicalViewTypeList: [ - { code: 'Link', name: this.$t('map.link') } - ], PhysicalViewTypeList: [ { code: 'Section', name: this.$t('map.section') }, { code: 'Signal', name: this.$t('map.signal') }, { code: 'Switch', name: this.$t('map.switch') } ], + checkAll: true, + isIndeterminate: false, physicalLevelsSelect: [] // 选中list }; }, @@ -56,9 +56,17 @@ export default { }, handleSelectPhysicalView(handle) { this.$emit('handleSelectPhysicalView', handle); + const checkedCount = handle.length; + this.checkAll = checkedCount === this.PhysicalViewTypeList.length; + this.isIndeterminate = checkedCount > 0 && checkedCount < this.PhysicalViewTypeList.length; }, copyList(list) { return JSON.parse(JSON.stringify(list)); + }, + handleCheckAllChange(val) { + this.physicalLevelsSelect = val ? this.PhysicalViewTypeList.map(item => item.code) : ['Section']; + this.isIndeterminate = this.physicalLevelsSelect.length > 0 && this.physicalLevelsSelect.length < this.PhysicalViewTypeList.length; + this.$emit('handleSelectPhysicalView', this.physicalLevelsSelect); } } };