From 24d6e7a218c9234d927b44d772760857a620fa1d Mon Sep 17 00:00:00 2001 From: zhangyu Date: Wed, 13 Oct 2021 11:12:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=90=9C=E7=B4=A2=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E8=B0=83=E6=95=B4=20modeil=E4=BB=A5=E5=8F=8Amore?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/detailView/detailViewTopSearch.vue | 92 +++++++++++++++---- .../detailView/list/asset/assetDetail.vue | 57 +++++++++++- .../common/detailView/nzDetailView.vue | 20 ++-- .../common/labelFilter/clickSearch.vue | 26 ++---- .../common/labelFilter/dropdown.vue | 13 ++- .../src/components/common/mixin/dataList.js | 25 ++--- .../common/mixin/detailViewMixin.js | 56 +---------- .../common/table/asset/assetTable.vue | 2 +- .../src/components/page/asset/asset.vue | 41 +++++---- 9 files changed, 197 insertions(+), 135 deletions(-) diff --git a/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue b/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue index 28d485e6a..9f5457e9f 100644 --- a/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue +++ b/nezha-fronted/src/components/common/detailView/detailViewTopSearch.vue @@ -1,24 +1,29 @@ @@ -60,13 +95,28 @@ export default { } } }, - searchDetailObj: { + selectValue: { type: Object } }, + computed: { + }, data () { return { - detailSearchListCopy: {} + detailSearchListCopy: {}, + searchStr: '' + } + }, + methods: { + searchStrChange (val, key) { + this.detailSearchListCopy[key].searchStr = val + this.detailSearchListCopy[key].children = this.detailSearchListCopy[key].oldChildren.filter(children => children.name.indexOf(val) !== -1) + }, + getSearchStr (oldChildren, label) { + const arr = label.split('-') + const obj = oldChildren.find(item => item.id == arr[0]) + const children = obj.children.find(item => item.id == arr[1]) + return children.name } }, watch: { @@ -74,14 +124,17 @@ export default { immediate: true, deep: true, handler (n) { - console.log(n) this.detailSearchListCopy = JSON.parse(JSON.stringify(n)) + Object.keys(this.detailSearchListCopy).forEach(key => { + this.detailSearchListCopy[key].searchStr = '' + this.detailSearchListCopy[key].oldChildren = JSON.parse(JSON.stringify(this.detailSearchListCopy[key].children)) + }) + console.log(this.detailSearchListCopy) } }, - searchDetailObj: { + selectValue: { deep: true, handler (n) { - console.log(n, 123123123) this.$emit('reload', n) } } @@ -90,7 +143,15 @@ export default {