From b53bcacf52faf81a5defdc2eb5ea93132e064dd1 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 19 Jul 2023 15:29:17 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-3002=20=20fix=EF=BC=9AClickSearch=20?= =?UTF-8?q?=E7=BC=BA=E5=B0=91more=E6=97=B6=20=EF=BC=8C=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=AB=98=E5=BA=A6=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/page/asset/asset.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue index 3f7e3f773..af4d32012 100644 --- a/nezha-fronted/src/components/page/asset/asset.vue +++ b/nezha-fronted/src/components/page/asset/asset.vue @@ -242,7 +242,7 @@ export default { batchShow: false }, silenceBoxShow: false, - dataListLayout: localStorage.getItem('dataList-layout' + 'assetTable') ? JSON.parse(localStorage.getItem('dataList-layout' + 'assetTable')) : ['searchInput', 'elementSet', 'clickSearch', 'pagination', 'detailViewSet'], + dataListLayout: localStorage.getItem('dataList-layoutassetNzTableHeightOffset' + 'assetTable') ? JSON.parse(localStorage.getItem('dataList-layout' + 'assetTable')) : ['searchInput', 'elementSet', 'clickSearch', 'pagination', 'detailViewSet'], assetNzTableHeightOffset: 287, // 包含click-search时nz-table的高度 blankObject: { id: '', @@ -826,6 +826,7 @@ export default { }) }, setSearchData (statistics) { + this.assetNzTableHeightOffset = 2 Object.keys(this.titleSearchList).forEach(key => { const keys = key === 'assetLabel' ? 'meta' : key if (key === 'assetLabel') { @@ -836,6 +837,9 @@ export default { this.detailSearchList.assetLabel.show = true this.titleSearchList[key].hide = !res.length this.detailSearchList[key].hide = !res.length + if (res.length) { + this.assetNzTableHeightOffset += 57 + } }) } else if (key === 'model') { this.getModelData(statistics[keys]).then(res => { @@ -845,12 +849,18 @@ export default { this.detailSearchList.model.show = true this.titleSearchList[key].hide = !res.length this.detailSearchList[key].hide = !res.length + if (res.length) { + this.assetNzTableHeightOffset += 57 + } }) } else { this.titleSearchList[key].children = statistics[keys].map(d => { return { ...d, value: d.id } }) this.detailSearchList[key].children = statistics[keys].map(d => { return { ...d, value: d.id } }) this.titleSearchList[key].hide = !this.titleSearchList[key].children.length this.detailSearchList[key].hide = !this.detailSearchList[key].children.length + if (this.detailSearchList[key].children.length) { + this.assetNzTableHeightOffset += 57 + } } if (this.titleSearchList[key].children.length === 0) { // delete this.titleSearchList[key]