From fe3eb0aa68c56e3f2558b56ef776c3f7a72e6d47 Mon Sep 17 00:00:00 2001 From: guoyue Date: Thu, 22 Sep 2022 15:08:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A5=BF=E6=B5=B7=E5=B2=B8--=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E8=AE=BE=E6=96=BD=EF=BC=9A=E5=8E=BB=E6=8E=89=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/home/infrastructurePage.vue | 128 ++++++++++++-------- 1 file changed, 79 insertions(+), 49 deletions(-) diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue index 65297386..4fb29040 100644 --- a/front/src/views/home/infrastructurePage.vue +++ b/front/src/views/home/infrastructurePage.vue @@ -635,11 +635,13 @@ const tabList = ref([ title: '设施类型', content: isXiHaiAn ? ['视频资源'] : ['视频资源', '云资源', '感知资源', '城市云脑会客厅'], }, - { +]) +if (!isXiHaiAn) { + tabList.value.push({ title: '视频标签', content: [], - }, -]) + }) +} const wrjVisible = ref(false) const wrjName = ref('') const wrjData = ref([]) @@ -1065,7 +1067,10 @@ const tabClick = (indexFather, name) => { room.value = true tableHeight.value = 330 showMap.value = true - tabList.value[1].title = '视频标签' + if (tabList.value[1]) { + tabList.value[1].title = '视频标签' + } + } else if (name == '云资源') { room.value = true tableHeight.value = 600 @@ -1073,7 +1078,9 @@ const tabClick = (indexFather, name) => { dataSource.value = [] dataSource2.value = [] pagination.value.total = 0 - tabList.value[1].title = '云资源分类' + if (tabList.value[1]) { + tabList.value[1].title = '云资源分类' + } } else if (name == '感知资源') { room.value = true tableHeight.value = 330 @@ -1100,26 +1107,34 @@ const tabClick = (indexFather, name) => { wrjFlag.value = false tableHeight.value = 330 showMap.value = true - tabList.value[1].content = [] - clickList.value[1].content = [] - tabList.value[1].title = '视频标签' + if (tabList.value[1]) { + tabList.value[1].content = [] + tabList.value[1].title = '视频标签' + } + if (clickList.value[1]) { + clickList.value[1].content = [] + } clickList.value[indexFather].content[0] = name dataSource.value = [] dataSource2.value = [] room.value = true getCameraAllLabel().then((res) => { res.data.data.forEach((val) => { - tabList.value[1].content.push({ - labelCode: val.labelCode, - labelName: val.labelName, - }) + if (tabList.value[1]) { + tabList.value[1].content.push({ + labelCode: val.labelCode, + labelName: val.labelName, + }) + } }) }) // 改变查询摄像头接口的labelCode数组 mapSearchParam.value.labelCodes = [] - clickList.value[1].content.map((item) => { - mapSearchParam.value.labelCodes.push(item.labelCode) - }) + if (clickList.value[1]) { + clickList.value[1].content.map((item) => { + mapSearchParam.value.labelCodes.push(item.labelCode) + }) + } console.log('选中的标签code', mapSearchParam.value) mapSearchParam.value.labelCodes = mapSearchParam.value.labelCodes + '' emits('add', 1) @@ -1130,30 +1145,38 @@ const tabClick = (indexFather, name) => { dataSource.value = [] dataSource2.value = [] pagination.value.total = 0 - clickList.value[1].content = [] - tabList.value[1].title = '云资源分类' + if (clickList.value[1]) { + clickList.value[1].content = [] + } clickList.value[indexFather].content[0] = name - tabList.value[1].content = [ - '云主机', - '算力主机', - '对象存储', - '堡垒机', - '防火墙', - '网闸', - '负载均衡', - '公网IP', - ] + if (tabList.value[1]) { + tabList.value[1].title = '云资源分类' + tabList.value[1].content = [ + '云主机', + '算力主机', + '对象存储', + '堡垒机', + '防火墙', + '网闸', + '负载均衡', + '公网IP', + ] + } room.value = true wrjFlag.value = false emits('add', 2) } else if (name == '感知资源') { tableHeight.value = 330 showMap.value = true - clickList.value[1].content = [] + if (clickList.value[1]) { + clickList.value[1].content = [] + } pagination.value.total = 0 - tabList.value[1].title = '感知资源分类' clickList.value[indexFather].content[0] = name - tabList.value[1].content = [] + if (tabList.value[1]) { + tabList.value[1].content = [] + tabList.value[1].title = '感知资源分类' + } dataSource.value = [] dataSource2.value = [] room.value = true @@ -1170,28 +1193,33 @@ const tabClick = (indexFather, name) => { dataSource.value = [] dataSource2.value = [] pagination.value.total = 0 - clickList.value[1].content = [] + if (clickList.value[1]) { + clickList.value[1].content = [] + } clickList.value[indexFather].content[0] = name - tabList.value[1].title = '' - tabList.value[1].content = [] + if (tabList.value[1]) { + tabList.value[1].content = [] + tabList.value[1].title = '' + } wrjFlag.value = true room.value = false - // wrjFlag.value = true - // showMap.value = false roomYuyue.value = true roomResult.value = false - // tabList.value[1] = [] emits('add', 6) searchData() } else { - clickList.value[indexFather].content.push(name) + if (clickList.value[indexFather]) { + clickList.value[indexFather].content.push(name) + } } } // 改变查询摄像头接口的labelCode数组 mapSearchParam.value.labelCodes = [] - clickList.value[1].content.map((item) => { - mapSearchParam.value.labelCodes.push(item.labelCode) - }) + if (clickList.value[1]) { + clickList.value[1].content.map((item) => { + mapSearchParam.value.labelCodes.push(item.labelCode) + }) + } console.log('选中的标签code', mapSearchParam.value) mapSearchParam.value.labelCodes = mapSearchParam.value.labelCodes + '' @@ -1220,10 +1248,14 @@ const getSoldierData = (indexFather, name) => { showMap.value = false dataSource.value = [] dataSource2.value = [] - clickList.value[1].content = [] + if (clickList.value[1]) { + clickList.value[1].content = [] + } clickList.value[indexFather].content[0] = name - tabList.value[1].title = '' - tabList.value[1].content = [] + if (tabList.value[1]) { + tabList.value[1].title = '' + tabList.value[1].content = [] + } wrjFlag.value = true let _params = { @@ -1362,7 +1394,9 @@ const batchPicturePreview = async function (page) { } // 清空 const nullClick = () => { - clickList.value[1].content = [] + if (clickList.value[1]) { + clickList.value[1].content = [] + } mapSearchParam.value.labelCodes = '' getCamera() console.log('hhhhhhhh') @@ -1655,11 +1689,7 @@ const videoShowMsg = () => { } .tabBox { - margin-bottom: 0.16rem; - } - - .tabBox:last-of-type { - margin-bottom: 0; + padding-bottom: 0.16rem; } }