diff --git a/front/src/views/home/detailsPageInfrastructureTreeXha.vue b/front/src/views/home/detailsPageInfrastructureTreeXha.vue index 9387dcb6..4ceed28f 100644 --- a/front/src/views/home/detailsPageInfrastructureTreeXha.vue +++ b/front/src/views/home/detailsPageInfrastructureTreeXha.vue @@ -152,10 +152,16 @@ export default defineComponent({ } //选择标签内容 const tabClick = (id) => { - chooseId.value = id + if(chooseId.value === id){ + chooseId.value = '' + mybus.emit('clearLeftSelect') + }else{ + chooseId.value = id let placeTypeCode =[] placeTypeCode.push(id) mybus.emit('CameraConditionPlaceType', placeTypeCode) + } + } // 初始化 const init = async () => { @@ -196,14 +202,15 @@ export default defineComponent({ chooseId.value='' }) const onSelect = async (item, val, child) => { - let res = {} - if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) { - res = await getCameraAllOrgan({ parentId: val.id }) - } else { + + // if(selectId.value===val.id){ + // selectId.value='' + //   mybus.emit('clearLeftSelect') + // }else{ + let res = {}  mybus.emit('getCameraByParentId', val.id) - // 西海岸 + res = await getCameraInfoByAreaId({ areaId: val.id }) - } treeData.value.map((treeDataItem, index) => { if (item.id == treeDataItem.id) { treeData.value[index].children.map((childItem, childIndex) => { @@ -215,11 +222,20 @@ export default defineComponent({ } }) if (child) { + if(selectId.value===child.id){ + selectId.value='' +   mybus.emit('clearLeftSelect') + }else{ selectId.value = child.id } + + } + // } + } watch(selectId, (newVal) => { + if (newVal == '') { mybus.emit('getCameraByParentId', '') mybus.emit('getListByParentId', '') @@ -244,14 +260,15 @@ export default defineComponent({ }) } const showDown = (item, val) => { + selectId.value = val.id - console.log('item---showDown--------->', item) - console.log('val----showDown-------->', val) + if (item.children) { val.show = !val.show // 取消选中 if (!val.show) { selectId.value = '' + mybus.emit('clearLeftSelect') } } } @@ -284,10 +301,11 @@ export default defineComponent({