From 73c593cc4ea5c82d984f5d42b01ae3a509a8a5ac Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 29 Apr 2025 16:24:14 +0800 Subject: [PATCH] perf: asset permission set --- src/components/Form/FormFields/TagInput.vue | 21 +- .../components/AccountFormatter.vue | 278 ++++++++---------- src/views/perms/const.js | 76 +++++ src/views/profile/PassKey.vue | 2 +- src/views/profile/index.vue | 32 +- 5 files changed, 230 insertions(+), 179 deletions(-) diff --git a/src/components/Form/FormFields/TagInput.vue b/src/components/Form/FormFields/TagInput.vue index 3791cc711..b7e392f50 100644 --- a/src/components/Form/FormFields/TagInput.vue +++ b/src/components/Form/FormFields/TagInput.vue @@ -16,7 +16,7 @@ :is="component" ref="SearchInput" v-model.trim="filterValue" - :fetch-suggestions="autocomplete" + :fetch-suggestions="autocomplete ? autocomplete : () => {}" :placeholder="iPlaceholder" :type="inputType" class="search-input" @@ -78,16 +78,18 @@ export default { }, data() { return { - filterTags: this.value, focus: false, filterValue: '', - isCheckShowPassword: this.replaceShowPassword, - component: this.autocomplete ? 'el-autocomplete' : 'el-input' + filterTags: this.value, + isCheckShowPassword: this.replaceShowPassword } }, computed: { iPlaceholder() { return `${this.placeholder} (${this.$t('EnterToContinue')})` + }, + component() { + return this.autocomplete !== null ? 'el-autocomplete' : 'el-input' } }, watch: { @@ -98,7 +100,7 @@ export default { methods: { handleTagClose(tag) { this.filterTags.splice(this.filterTags.indexOf(tag), 1) - this.$emit('change', this.filterTags) + this.handleConfirm() }, handleSelect(item) { this.filterValue = item.value @@ -113,14 +115,15 @@ export default { if (!this.filterTags.includes(this.filterValue)) { this.filterTags.push(this.filterValue) this.filterValue = '' - this.$emit('change', this.filterTags) } - this.$refs.SearchInput.focus() + this.$emit('change', this.filterTags) + this.$emit('input', this.filterTags) + // this.$refs.SearchInput.focus() }, handleTagClick(v, k) { this.$delete(this.filterTags, k) this.filterValue = v - this.$refs.SearchInput.focus() + // this.$refs.SearchInput.focus() }, matchRule(value) { const regex = new RegExp(this.replaceRule) @@ -189,7 +192,7 @@ export default { } .filter-field ::v-deep .el-input__inner { - height: 28px !important; + height: 27px !important; } .show-password { diff --git a/src/views/perms/AssetPermission/components/AccountFormatter.vue b/src/views/perms/AssetPermission/components/AccountFormatter.vue index 957897e9b..16a930593 100644 --- a/src/views/perms/AssetPermission/components/AccountFormatter.vue +++ b/src/views/perms/AssetPermission/components/AccountFormatter.vue @@ -1,53 +1,59 @@