Fixed: Execution Record

This commit is contained in:
zhaojisen
2025-03-20 11:07:22 +08:00
committed by ZhaoJiSen
parent 9575936849
commit 138bdad7ef
3 changed files with 46 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
<template>
<BaseExecutionList
:automation-route="automationRoute"
:custom-actions="customActions"
:detail-route="detailRoute"
:resource="resource"
:url="url"
@@ -21,7 +22,21 @@ export default {
url: `/api/v1/accounts/change-secret-executions/?${params}`,
detailRoute: 'AccountChangeSecretExecutionDetail',
automationRoute: 'AccountChangeSecretDetail',
resource: 'changesecretexecution'
resource: 'changesecretexecution',
customActions: {
name: 'record',
title: this.$t('Record'),
can: this.$hasPerm('accounts.view_changesecretrecord'),
callback: function({ row }) {
return this.$router.push({
name: 'AccountChangeSecretList',
query: {
tab: 'ChangeSecretRecord',
execution_id: row.id
}
})
}
}
}
}
}

View File

@@ -1,10 +1,11 @@
<template>
<BaseExecutionList
:automation-route="automationRoute"
:resource-label="resourceLabel"
:custom-actions="customActions"
:detail-drawer="detailDrawer"
:detail-route="detailRoute"
:resource="resource"
:resource-label="resourceLabel"
:url="url"
/>
</template>
@@ -24,7 +25,21 @@ export default {
detailRoute: 'AccountPushExecutionDetail',
resource: 'pushaccountexecution',
resourceLabel: this.$t('AccountPushExecution'),
detailDrawer: () => import('@/views/accounts/AccountPush/ExecutionDetail/index.vue')
detailDrawer: () => import('@/views/accounts/AccountPush/ExecutionDetail/index.vue'),
customActions: {
name: 'record',
title: this.$t('Record'),
can: this.$hasPerm('accounts.view_changesecretrecord'),
callback: function({ row }) {
return this.$router.push({
name: 'AccountPush',
query: {
tab: 'AccountPushRecord',
execution_id: row.id
}
})
}
}
}
}
}

View File

@@ -39,6 +39,10 @@ export default {
resource: {
type: String,
required: true
},
customActions: {
type: Object,
default: () => ({})
}
},
data() {
@@ -121,20 +125,6 @@ export default {
vm.visible = true
vm.reportUrl = `${this.url}${row.id}/report/`
}
},
{
name: 'record',
title: this.$t('Record'),
can: this.$hasPerm('accounts.view_changesecretrecord'),
callback: function({ row }) {
return this.$router.push({
name: 'AccountChangeSecretList',
query: {
tab: 'ChangeSecretRecord',
execution_id: row.id
}
})
}
}
]
}
@@ -168,6 +158,15 @@ export default {
if (automation_id !== undefined) {
this.tableConfig.url = `${this.tableConfig.url}?automation_id=${automation_id}`
}
const defaultExtraActions = this.tableConfig.columnsMeta.actions.formatterArgs.extraActions
if (this.customActions) {
this.tableConfig.columnsMeta.actions.formatterArgs.extraActions = [
...defaultExtraActions,
this.customActions
]
}
},
methods: {
handleDetailCallback(row) {