From 727bbd964973c4a1fce2db8a8365eec72958ae0c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 1 Aug 2022 10:54:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF-=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E9=80=89=E6=8B=A9=E5=99=A8):=20=E5=85=A8=E9=80=89?= =?UTF-8?q?=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ElVisualSelect/index.vue | 27 ++++++++++--------- .../components/widget/DeWidget/DeSelect.vue | 6 ++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/ElVisualSelect/index.vue b/frontend/src/components/ElVisualSelect/index.vue index eeda732b70..4308dd42cf 100644 --- a/frontend/src/components/ElVisualSelect/index.vue +++ b/frontend/src/components/ElVisualSelect/index.vue @@ -12,8 +12,8 @@ @change="visualChange" @visible-change="popChange" > -

{{ $t('dataset.check_all') }}

- +

{{ $t('dataset.check_all') }}

+ @@ -98,14 +98,14 @@ export default { }) }, keyWord(val, old) { - if(val === old) return + if (val === old) return const results = val ? this.list.filter(item => item.text.includes(val)) : null this.resetList(results) this.reCacularHeight() this.$nextTick(() => { this.callback() }) - }, + } }, mounted() { this.resetList() @@ -116,13 +116,16 @@ export default { methods: { setSelect(id) { if (Array.isArray(this.selectValue)) { - return this.selectValue.map( ele => ele.id ).includes(id) && 'selected' + return this.selectValue.map(ele => ele.id).includes(id) && 'selected' } - return this.selectValue === id && 'selected'; + return this.selectValue === id && 'selected' }, selectAllChane(val) { - this.visualChange(val ? [...this.list.map( ele => ele.id )] : []) - this.$emit('handleShowNumber'); + const vals = val ? [...this.list.map(ele => ele.id)] : [] + this.visualChange(vals) + this.selectValue = vals + this.$emit('change', vals) + this.$emit('handleShowNumber') }, addScrollDiv(selectDom) { this.maxHeightDom = document.createElement('div') @@ -144,9 +147,9 @@ export default { this.options = this.newList.slice(0, this.maxLength) }, customInputStyle() { - if (!this.$parent.$parent.handlerInputStyle) return; + if (!this.$parent.$parent.handlerInputStyle) return handlerInputStyle(this.$refs.visualSelect.$el.querySelector('.el-input__inner'), this.$parent.element.style) - handlerInputStyle(this.$refs.visualSelect.$el.querySelector('.el-select__input'), {wordColor: this.$parent.element.style.wordColor}) + handlerInputStyle(this.$refs.visualSelect.$el.querySelector('.el-select__input'), { wordColor: this.$parent.element.style.wordColor }) }, init() { if (this.defaultFirst && this.list.length > 0) { @@ -193,8 +196,8 @@ export default { this.reCacularHeight() }, visualChange(val) { - if(this.$attrs.multiple) { - this.selectAll = val.length === this.list.length; + if (this.$attrs.multiple) { + this.selectAll = val.length === this.list.length } this.$emit('visual-change', val) } diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index ce3aac9589..4f1feeacda 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -16,7 +16,7 @@ :key-word="keyWord" popper-class="coustom-de-select" :list="datas" - :customStyle="customStyle" + :custom-style="customStyle" @change="changeValue" @focus="setOptionWidth" @blur="onBlur" @@ -108,7 +108,7 @@ export default { return this.$store.state.panel.panelInfo }, customStyle() { - const { brColor, wordColor, innerBgColor } = this.element.style; + const { brColor, wordColor, innerBgColor } = this.element.style return { brColor, wordColor, innerBgColor } } }, @@ -257,7 +257,7 @@ export default { } }, visualChange(value) { - this.value = value; + this.value = value this.$nextTick(() => { if (!this.element.options.attrs.multiple) { return