From f7ab833cb8bdd6bd8af391b81c4ff8c7f65686ca Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Thu, 23 May 2024 18:14:53 +0800 Subject: [PATCH 1/2] fix: dashboard card alignment --- src/views/dashboard/Audit/RightSummary.vue | 2 +- src/views/dashboard/components/DataCard.vue | 2 +- src/views/dashboard/components/LineChart.vue | 27 ++++++++++---------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/views/dashboard/Audit/RightSummary.vue b/src/views/dashboard/Audit/RightSummary.vue index 943ccfeb9..29d54f7d3 100644 --- a/src/views/dashboard/Audit/RightSummary.vue +++ b/src/views/dashboard/Audit/RightSummary.vue @@ -114,7 +114,7 @@ export default { } .box { - margin-top: 16px; + margin-top: 10px; padding: 20px; background: #fff; diff --git a/src/views/dashboard/components/DataCard.vue b/src/views/dashboard/components/DataCard.vue index e30b24721..b0895d204 100644 --- a/src/views/dashboard/components/DataCard.vue +++ b/src/views/dashboard/components/DataCard.vue @@ -104,7 +104,7 @@ export default { padding: 26px 0 10px; & >>> .echarts { width: 100% !important; - height: 272px !important; + height: 278px !important; } } diff --git a/src/views/dashboard/components/LineChart.vue b/src/views/dashboard/components/LineChart.vue index 740e33a95..822c5a7fe 100644 --- a/src/views/dashboard/components/LineChart.vue +++ b/src/views/dashboard/components/LineChart.vue @@ -232,19 +232,20 @@ export default { From 080565bea68b06ccaa89eb8f3526bc11bbb191ec Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Wed, 22 May 2024 14:18:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?perf:=20=E6=96=B0=E5=A2=9E=E6=8C=89?= =?UTF-8?q?=E9=94=AE=20t=20=E4=BD=BF=E5=BE=97=20Search=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E8=87=AA=E5=8A=A8=20focus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/TagSearch/index.vue | 58 ++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/src/components/Table/TagSearch/index.vue b/src/components/Table/TagSearch/index.vue index 9998e6b58..660914984 100644 --- a/src/components/Table/TagSearch/index.vue +++ b/src/components/Table/TagSearch/index.vue @@ -29,13 +29,14 @@ :placeholder="placeholder" :validate-event="false" class="search-input" - suffix-icon="el-icon-search" + :suffix-icon="suffixIcon" @blur="handleBlur" @change="handleConfirm" - @focus="focus = true" + @focus="handleFocus" @keyup.enter.native="handleConfirm" @keyup.delete.native="handleDelete" /> + t @@ -67,10 +68,12 @@ export default { filterKey: '', filterValue: '', valueLabel: '', + suffixIcon: '', emptyCount: 0, filterTags: this.default || {}, focus: false, - showCascade: true + showCascade: true, + isFocus: false } }, computed: { @@ -134,9 +137,22 @@ export default { } } }, + mounted() { + document.addEventListener('keyup', this.handleKeyUp) + }, + beforeDestroy() { + document.removeEventListener('keyup', this.handleKeyUp) + }, methods: { + handleFocus() { + this.focus = true + this.isFocus = true + this.suffixIcon = 'el-icon-search' + }, handleBlur() { this.focus = false + this.isFocus = false + this.suffixIcon = '' this.$emit('blur') }, // 获取url中的查询条件,判断是不是包含在当前查询条件里 @@ -329,6 +345,14 @@ export default { this.filterValue = v.value this.$refs.SearchInput.focus() }, + handleKeyUp(event) { + // 检查按下的键是否是"T"键 + if (event.key === 'T' || event.key === 't') { + this.$refs.SearchInput.focus() + this.suffixIcon = 'el-icon-search' + this.isFocus = true + } + }, // 删除查询条件时改变url checkUrlFields(evt) { let newQuery = _.omit(this.$route.query, evt) @@ -347,11 +371,16 @@ export default {