From af296ebf512b23bbe28ba137eb3c4c99eb8e2cf6 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 23 Oct 2024 10:53:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E9=80=89=E9=A1=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AppGroupMonitorTable.vue | 25 ++++++++++++++----------- src/views/AppStoreMonitor.vue | 11 ++++------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/views/AppGroupMonitorTable.vue b/src/views/AppGroupMonitorTable.vue index 222072a..e0528e6 100644 --- a/src/views/AppGroupMonitorTable.vue +++ b/src/views/AppGroupMonitorTable.vue @@ -63,21 +63,23 @@ export default { this.tableData = res.data?.page?.records || [] } }) + }, + getOptions() { + const ops = {} + this.tableData.forEach(e => { + ops[e.groupCode] = e.groupName + }) + return Object.entries(ops).map(([key, value]) => ({label: value, value: key})) } }, watch: { search: { - deep: true, handler() { - this.getTableData() + immediate: true, deep: true, handler() { + this.getTableData().then(() => { + if (this.options.length == 0) this.options = this.getOptions() + }) } } - }, - created() { - this.getTableData().then(() => { - this.options = this.tableData.map(e => ({ - label: e.groupName, value: e.groupCode - })) - }) } } @@ -108,7 +110,8 @@ export default { .AppGroupMonitorTable .dv-scroll-board, .AppGroupMonitorTable .scrollTable { height: calc(100% - 80px) !important; } -.AppGroupMonitorTable .el-select{ - width: 140px!important; + +.AppGroupMonitorTable .el-select { + width: 140px !important; } diff --git a/src/views/AppStoreMonitor.vue b/src/views/AppStoreMonitor.vue index ddc7a86..812eddc 100644 --- a/src/views/AppStoreMonitor.vue +++ b/src/views/AppStoreMonitor.vue @@ -71,15 +71,12 @@ export default { }, watch: { search: { - deep: true, handler() { - this.getTableData() + immediate: true, deep: true, handler() { + this.getTableData().then(() => { + if (this.options.length == 0) this.options = this.getOptions() + }) } } - }, - created() { - this.getTableData().then(() => { - this.options = this.getOptions() - }) } }