From 6deecb4569980c5cd88cf72afae7280f6aa99bef Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 27 Jun 2022 15:39:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8B=E6=8B=89=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E9=87=8F=E5=A4=A7=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ElVisualSelect/index.vue | 10 ++++++++++ frontend/src/components/widget/DeWidget/DeSelect.vue | 5 ++++- .../views/panel/filter/filterMain/FilterControl.vue | 2 -- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/ElVisualSelect/index.vue b/frontend/src/components/ElVisualSelect/index.vue index 5338d70b59..3799166a96 100644 --- a/frontend/src/components/ElVisualSelect/index.vue +++ b/frontend/src/components/ElVisualSelect/index.vue @@ -4,8 +4,10 @@ v-model="selectValue" :class="classId" popper-class="VisualSelects" + no-match-text=" " v-bind="$attrs" v-on="$listeners" + @change="visualChange" @visible-change="popChange" > @@ -54,6 +56,9 @@ export default { } }, watch: { + value(val) { + this.selectValue = val + }, selectValue(val) { this.$emit('update', val) if (!val) { @@ -102,6 +107,7 @@ export default { ) this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`) this.slectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`) + if (!this.slectBoxDom || !this.slectBoxDom.style) return this.slectBoxDom.style.display = 'flex' this.slectBoxDom.style.flexDirection = 'row' this.domList = selectDom.querySelector( @@ -117,6 +123,7 @@ export default { }, callback() { + if (!this.scrollbar) return const scrollTop = this.scrollbar.scrollTop this.startIndex = parseInt(scrollTop / this.itemHeight) this.endIndex = this.startIndex + this.maxLength @@ -129,6 +136,9 @@ export default { this.resetList() this.reCacularHeight() + }, + visualChange(val) { + this.$emit('visual-change', val) } } diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index cbbceea3f6..1cbdf5a8da 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -17,6 +17,7 @@ @change="changeValue" @focus="setOptionWidth" @blur="onBlur" + @visual-change="visualChange" >