diff --git a/front/src/api/file.js b/front/src/api/file.js index 278aee62..bd199a46 100644 --- a/front/src/api/file.js +++ b/front/src/api/file.js @@ -117,7 +117,7 @@ export function getPlaceType() { //西海岸 根据标签树查询视频列表 export function CameraConditionPlaceType(params) { return axios.post( - 'http://10.134.135.92:9537/data_service/getCamera/CameraConditionPlaceType' + + 'http://10.134.135.92:9537/data_service/getCamera/CameraConditionPlaceType' , params, config2 ) diff --git a/front/src/views/home/detailsPageInfrastructureTreeXha.vue b/front/src/views/home/detailsPageInfrastructureTreeXha.vue index 4ceed28f..23d6a2de 100644 --- a/front/src/views/home/detailsPageInfrastructureTreeXha.vue +++ b/front/src/views/home/detailsPageInfrastructureTreeXha.vue @@ -140,7 +140,6 @@ export default defineComponent({ const bumenImg = require('@/assets/newHome/bumen.png') const biaoqianImg = require('@/assets/newHome/biaoqian.png') const router = useRouter() - const whoShow1 = ref(whoShow) const showKey = ref(0) const treeData = ref([]) const selectId = ref('') @@ -149,6 +148,24 @@ export default defineComponent({ //切换tab const btnClick = (index) => { itemIndex.value = index + if(index===2){ + if(chooseId.value !==''){ + let placeTypeCode =[] + placeTypeCode.push(chooseId.value) + mybus.emit('CameraConditionPlaceType', placeTypeCode) + }else{ + mybus.emit('clearLeftSelect') + } + }else{ + if(selectId.value!==''){ + mybus.emit('getCameraByParentId', selectId.value) + }else{ + mybus.emit('clearLeftSelect') + } + } + + + } //选择标签内容 const tabClick = (id) => { @@ -156,6 +173,7 @@ export default defineComponent({ chooseId.value = '' mybus.emit('clearLeftSelect') }else{ + chooseId.value = id let placeTypeCode =[] placeTypeCode.push(id) @@ -175,14 +193,10 @@ export default defineComponent({ if (select == '基础设施') { let res = {} - if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) { - res = await getCameraAllOrgan({ parentId: 'S4NbecfYB1DBH8HNULGS34' }) - } else { - // 西海岸 + res = await getCameraInfoByAreaId({ areaId: '70be8c5b664f4bcf869d82f2e8335051', }) - } treeData.value = (res.data && res.data.data) || [] let tabs={} tabs = await getPlaceType() @@ -202,14 +216,9 @@ export default defineComponent({ chooseId.value='' }) const onSelect = async (item, val, child) => { - - // 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) { @@ -222,36 +231,33 @@ 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', '') + + if (newVal == '') { +   mybus.emit('clearLeftSelect') + // mybus.emit('getCameraByParentId', '') + // mybus.emit('getListByParentId', '') } }) const showBottom = async (item) => { item.show = !item.show let res = {} - if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) { - res = await getCameraAllOrgan({ parentId: item.id }) - } else { // 西海岸 res = await getCameraInfoByAreaId({ areaId: item.id }) - } - treeData.value.map((treeDataItem, index) => { if (item.id == treeDataItem.id) { treeData.value[index].children = (res.data && res.data.data) || [] @@ -268,7 +274,7 @@ export default defineComponent({ // 取消选中 if (!val.show) { selectId.value = '' - mybus.emit('clearLeftSelect') + // mybus.emit('clearLeftSelect') } } }