From 79a1a1faefa5e71eab88c31caee27076056a25e5 Mon Sep 17 00:00:00 2001 From: w940853815 <940853815@qq.com> Date: Fri, 21 Feb 2025 14:15:26 +0800 Subject: [PATCH] perf: streamline onUpdate actions in PlayBook and Adhoc components --- src/components/Table/DrawerListTable/index.vue | 3 --- src/views/ops/Job/components/Adhoc.vue | 6 ++++++ src/views/ops/Job/components/PlayBook.vue | 12 ++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/components/Table/DrawerListTable/index.vue b/src/components/Table/DrawerListTable/index.vue index ac74c711d..38461db34 100644 --- a/src/components/Table/DrawerListTable/index.vue +++ b/src/components/Table/DrawerListTable/index.vue @@ -88,9 +88,6 @@ export default { if (!actions.onCreate) { actions.onCreate = this.onCreate } - if (!actions.onUpdate) { - actions.onUpdate = this.onUpdate - } return actions }, iTableConfig() { diff --git a/src/views/ops/Job/components/Adhoc.vue b/src/views/ops/Job/components/Adhoc.vue index e02571ef1..1f6bb6a21 100644 --- a/src/views/ops/Job/components/Adhoc.vue +++ b/src/views/ops/Job/components/Adhoc.vue @@ -89,6 +89,12 @@ export default { hasUpdate: true, canUpdate: this.$hasPerm('ops.change_job') && !this.$store.getters.currentOrgIsRoot, updateRoute: 'JobUpdate', + onUpdate: ({ row, col }) => { + vm.$router.push({ + query: { _type: 'adhoc' } + }) + vm.$refs.ListTable.onUpdate({ row, col }) + }, hasDelete: true, canDelete: this.$hasPerm('ops.delete_job'), hasClone: false, diff --git a/src/views/ops/Job/components/PlayBook.vue b/src/views/ops/Job/components/PlayBook.vue index 9b7fbe174..5777a8e96 100644 --- a/src/views/ops/Job/components/PlayBook.vue +++ b/src/views/ops/Job/components/PlayBook.vue @@ -92,6 +92,12 @@ export default { updateRoute: 'JobUpdate', hasDelete: true, canDelete: this.$hasPerm('ops.delete_job'), + onUpdate: ({ row, col }) => { + vm.$router.push({ + query: { _type: 'playbook' } + }) + vm.$refs.ListTable.onUpdate({ row, col }) + }, hasClone: false, extraActions: [ { @@ -126,12 +132,6 @@ export default { vm.$refs.ListTable.onCreate() } }, - onUpdate: () => { - vm.$router.push({ - query: { _type: 'playbook' } - }) - vm.$refs.ListTable.onUpdate() - }, showJobRunDialog: false } },