diff --git a/frontend/src/components/elVisualSelect/index.vue b/frontend/src/components/elVisualSelect/index.vue index 4f1091c296..e5320bad55 100644 --- a/frontend/src/components/elVisualSelect/index.vue +++ b/frontend/src/components/elVisualSelect/index.vue @@ -6,6 +6,7 @@ :class="classId" popper-class="VisualSelects coustom-de-select" no-match-text=" " + reserve-keyword clearable v-bind="$attrs" v-on="$listeners" @@ -93,7 +94,7 @@ export default { }, computed: { isIndeterminate() { - return Array.isArray(this.selectValue) && this.selectValue.length > 0 && this.selectValue.length !== this.list.length + return Array.isArray(this.selectValue) && this.selectValue.length > 0 && this.isAllSelect() > 0 && this.selectValue.length !== this.halfSelect() } }, watch: { @@ -218,14 +219,34 @@ export default { this.domList.style.paddingTop = scrollTop - (scrollTop % this.itemHeight) + 'px' }, popChange() { + this.$emit('resetKeyWords', '') this.domList.style.paddingTop = 0 + 'px' - + this.startIndex = 0 + this.$nextTick(() => { + if (this.$attrs.multiple) { + this.selectAll = this.selectValue.length === this.list.length + } + }) this.resetList() this.reCacularHeight() }, + isAllSelect() { + let vals = this.list.length + if (this.keyWord.trim()) { + vals = this.list.filter(item => item.text.includes(this.keyWord.trim())).map(ele => ele.id).filter(ele => this.selectValue.includes(ele)).length + } + return vals + }, + halfSelect() { + let vals = this.list.length + if (this.keyWord.trim()) { + vals = this.list.filter(item => item.text.includes(this.keyWord.trim())).map(ele => ele.id).length + } + return vals + }, visualChange(val) { if (this.$attrs.multiple) { - this.selectAll = val.length === this.list.length + this.selectAll = val.length === this.halfSelect() } this.$emit('visual-change', val) } diff --git a/frontend/src/components/widget/deWidget/DeSelect.vue b/frontend/src/components/widget/deWidget/DeSelect.vue index ccc83a9494..666ee8bab7 100644 --- a/frontend/src/components/widget/deWidget/DeSelect.vue +++ b/frontend/src/components/widget/deWidget/DeSelect.vue @@ -16,6 +16,7 @@ :key-word="keyWord" popper-class="coustom-de-select" :list="data" + @resetKeyWords="filterMethod" :custom-style="customStyle" @change="changeValue" @focus="setOptionWidth" diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index 822cec1e01..114ac16388 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -570,6 +570,7 @@ export default { data() { return { sceneMode: false, + saveGroupLoading: false, treeLoading: false, dialogTitle: '', search: '', @@ -859,12 +860,16 @@ export default { saveGroup(group) { this.$refs['groupForm'].validate((valid) => { if (valid) { + if (this.saveGroupLoading) return + this.saveGroupLoading = true addGroup(group).then((res) => { this.close() this.openMessageSuccess('dataset.save_success') this.expandedArray.push(group.pid) const opt = group.id ? 'rename' : 'new' updateCacheTree(opt, 'dataset-tree', res.data, this.tData) + }).finally(() => { + this.saveGroupLoading = false }) } else { return false diff --git a/frontend/src/views/system/user/UserEditer.vue b/frontend/src/views/system/user/UserEditer.vue index 5e58d7b4c8..37997c3ad5 100644 --- a/frontend/src/views/system/user/UserEditer.vue +++ b/frontend/src/views/system/user/UserEditer.vue @@ -561,6 +561,7 @@ export default { this.$success(this.$t('commons.save_success')) this.reset() this.$emit('saved') + }).finally(() => { this.loading = false }) } else {