perf: streamline onUpdate actions in PlayBook and Adhoc components

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

View File

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

View File

@ -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,

View File

@ -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
}
},