perf: streamline onUpdate actions in PlayBook and Adhoc components

This commit is contained in:
w940853815 2025-02-21 14:15:26 +08:00 committed by w940853815
parent 8ef4b466d7
commit 79a1a1faef
3 changed files with 12 additions and 9 deletions

View File

@ -88,9 +88,6 @@ export default {
if (!actions.onCreate) { if (!actions.onCreate) {
actions.onCreate = this.onCreate actions.onCreate = this.onCreate
} }
if (!actions.onUpdate) {
actions.onUpdate = this.onUpdate
}
return actions return actions
}, },
iTableConfig() { iTableConfig() {

View File

@ -89,6 +89,12 @@ export default {
hasUpdate: true, hasUpdate: true,
canUpdate: this.$hasPerm('ops.change_job') && !this.$store.getters.currentOrgIsRoot, canUpdate: this.$hasPerm('ops.change_job') && !this.$store.getters.currentOrgIsRoot,
updateRoute: 'JobUpdate', updateRoute: 'JobUpdate',
onUpdate: ({ row, col }) => {
vm.$router.push({
query: { _type: 'adhoc' }
})
vm.$refs.ListTable.onUpdate({ row, col })
},
hasDelete: true, hasDelete: true,
canDelete: this.$hasPerm('ops.delete_job'), canDelete: this.$hasPerm('ops.delete_job'),
hasClone: false, hasClone: false,

View File

@ -92,6 +92,12 @@ export default {
updateRoute: 'JobUpdate', updateRoute: 'JobUpdate',
hasDelete: true, hasDelete: true,
canDelete: this.$hasPerm('ops.delete_job'), canDelete: this.$hasPerm('ops.delete_job'),
onUpdate: ({ row, col }) => {
vm.$router.push({
query: { _type: 'playbook' }
})
vm.$refs.ListTable.onUpdate({ row, col })
},
hasClone: false, hasClone: false,
extraActions: [ extraActions: [
{ {
@ -126,12 +132,6 @@ export default {
vm.$refs.ListTable.onCreate() vm.$refs.ListTable.onCreate()
} }
}, },
onUpdate: () => {
vm.$router.push({
query: { _type: 'playbook' }
})
vm.$refs.ListTable.onUpdate()
},
showJobRunDialog: false showJobRunDialog: false
} }
}, },