From 328e068aca0f230ca0743cded9dc59c8894c8d5b Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 17 May 2021 18:01:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(xpack):=20=E4=BF=AE=E5=A4=8D=E6=94=B6?= =?UTF-8?q?=E9=9B=86=E4=BB=BB=E5=8A=A1=E8=A1=A8=E5=A4=B4=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AutoDataTable/index.vue | 6 ++++-- src/views/xpack/GatheredUser/GatheredUserList.vue | 3 ++- src/views/xpack/GatheredUser/TaskList.vue | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/AutoDataTable/index.vue b/src/components/AutoDataTable/index.vue index 5a0070b80..685672c06 100644 --- a/src/components/AutoDataTable/index.vue +++ b/src/components/AutoDataTable/index.vue @@ -228,7 +228,8 @@ export default { const _tableConfig = localStorage.getItem('tableConfig') ? JSON.parse(localStorage.getItem('tableConfig')) : {} - const configShowColumnsNames = _.get(_tableConfig[this.$route.name], 'showColumns', null) + const tableName = this.config.name || this.$route.name + const configShowColumnsNames = _.get(_tableConfig[tableName], 'showColumns', null) let showColumnsNames = configShowColumnsNames || defaultColumnsNames if (showColumnsNames.length === 0) { showColumnsNames = totalColumnsNames @@ -270,7 +271,8 @@ export default { const _tableConfig = localStorage.getItem('tableConfig') ? JSON.parse(localStorage.getItem('tableConfig')) : {} - _tableConfig[this.$route.name] = { + const tableName = this.config.name || this.$route.name + _tableConfig[tableName] = { 'showColumns': columns } localStorage.setItem('tableConfig', JSON.stringify(_tableConfig)) diff --git a/src/views/xpack/GatheredUser/GatheredUserList.vue b/src/views/xpack/GatheredUser/GatheredUserList.vue index e6a1be356..a2924f5c3 100644 --- a/src/views/xpack/GatheredUser/GatheredUserList.vue +++ b/src/views/xpack/GatheredUser/GatheredUserList.vue @@ -24,7 +24,8 @@ export default { url: '/api/v1/assets/gathered-users/', hasTree: true, columns: [ - 'hostname', 'ip', 'username', 'date_last_login', 'present', 'ip_last_login', 'date_updated' + 'hostname', 'ip', 'username', 'date_last_login', 'present', + 'ip_last_login', 'date_updated' ], columnsMeta: { hostname: { diff --git a/src/views/xpack/GatheredUser/TaskList.vue b/src/views/xpack/GatheredUser/TaskList.vue index 1f5e245f2..4d241b1e8 100644 --- a/src/views/xpack/GatheredUser/TaskList.vue +++ b/src/views/xpack/GatheredUser/TaskList.vue @@ -14,10 +14,14 @@ export default { return { tableConfig: { + name: 'TaskListTable', url: '/api/v1/xpack/gathered-user/tasks/', columns: [ 'name', 'nodes', 'periodic_display', 'executed_times', 'actions' ], + columnsShow: { + min: ['name', 'nodes', 'periodic_display', 'executed_times', 'actions'] + }, columnsMeta: { name: { formatter: null @@ -61,7 +65,8 @@ export default { hasRefresh: false, hasExport: false, hasMoreActions: false, - createRoute: 'GatherUserTaskCreate' + createRoute: 'GatherUserTaskCreate', + hasColumnSetting: false } } }