From 17bf2b0611503b554e85b61f0db7b2ea1f435934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 6 Sep 2022 10:46:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E5=88=97=E8=A1=A8baseList=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Asset/AssetList/AllList.vue | 2 +- src/views/assets/Asset/AssetList/HostList.vue | 2 +- src/views/assets/Asset/AssetList/components/BaseList.vue | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/views/assets/Asset/AssetList/AllList.vue b/src/views/assets/Asset/AssetList/AllList.vue index 4706c7539..2ad4d0f14 100644 --- a/src/views/assets/Asset/AssetList/AllList.vue +++ b/src/views/assets/Asset/AssetList/AllList.vue @@ -13,7 +13,7 @@ /> diff --git a/src/views/assets/Asset/AssetList/HostList.vue b/src/views/assets/Asset/AssetList/HostList.vue index 19c22fceb..14c0dba51 100644 --- a/src/views/assets/Asset/AssetList/HostList.vue +++ b/src/views/assets/Asset/AssetList/HostList.vue @@ -27,7 +27,7 @@ export default { } ] }, - columnsMeta: { + addColumnsMeta: { actions: { formatter: ActionsFormatter, formatterArgs: { diff --git a/src/views/assets/Asset/AssetList/components/BaseList.vue b/src/views/assets/Asset/AssetList/components/BaseList.vue index b1d09fb5b..41d6aafbc 100644 --- a/src/views/assets/Asset/AssetList/components/BaseList.vue +++ b/src/views/assets/Asset/AssetList/components/BaseList.vue @@ -28,7 +28,7 @@ export default { }, category: { type: String, - default: 'all' + default: '' }, tableConfig: { type: Object, @@ -114,6 +114,10 @@ export default { actions: { formatter: ActionsFormatter, formatterArgs: { + onUpdate: ({ row }) => { + const routeName = _.capitalize(row.category.value) + 'Update' + vm.$router.push({ name: routeName, params: { id: row.id }}) + }, performDelete: ({ row }) => { const id = row.id const url = `/api/v1/assets/assets/${id}/` @@ -124,7 +128,6 @@ export default { } }, defaultHeaderActions: { - createRoute: 'HostCreate', onCreate: () => { this.showPlatform = true }, @@ -189,7 +192,7 @@ export default { iTableConfig() { const config = _.merge(this.defaultConfig, this.tableConfig, { url: this.url, - category: this.category + ...(this.category && { category: this.category }) }) if (this.addColumns.length > 0) { config.columns = [