Fixed: Fix issues in the edit form of the account list (#4714)

* Fixed: Fix issues in the edit form of the account list

* Fixed: Switch Add Template And Edit

---------

Co-authored-by: zhaojisen <1301338853@qq.com>
This commit is contained in:
fit2bot
2025-03-04 14:33:59 +08:00
committed by GitHub
parent 36f6c161b4
commit 6ebc02825e
2 changed files with 12 additions and 7 deletions

View File

@@ -144,6 +144,7 @@ export default {
const vm = this
return {
addTemplate: false,
isUpdateAccount: false,
currentAccountColumn: {},
showPasswordHistoryDialog: false,
showViewSecretDialog: false,
@@ -209,7 +210,7 @@ export default {
},
platform: {
label: this.$t('Platform'),
width: '120px',
width: '170px',
formatter: PlatformFormatter,
formatterArgs: {
platformAttr: 'asset.platform'
@@ -394,6 +395,8 @@ export default {
accountCreateUpdateTitle() {
if (this.addTemplate) {
return this.$t('AddAccountByTemplate')
} else if (this.isUpdateAccount) {
return this.$t('UpdateAccount')
} else {
return this.$t('AddAccount')
}
@@ -434,6 +437,7 @@ export default {
},
addAccountSuccess() {
Reflect.deleteProperty(this.$route.query, 'flag')
this.isUpdateAccount = false
this.$refs.ListTable.reloadTable()
},
async getAssetDetail() {

View File

@@ -46,14 +46,15 @@ export const accountOtherActions = (vm) => [
title: vm.$t('Edit'),
can: vm.$hasPerm('accounts.change_account') && !vm.$store.getters.currentOrgIsRoot,
callback: ({ row }) => {
const data = {
...vm.asset,
...row.asset
}
vm.isUpdateAccount = true
// const data = {
// ...vm.asset,
// ...row.asset
// }
// vm.iAsset = data
vm.account = row
vm.iAsset = data
vm.addTemplate = false
vm.showAddDialog = false
vm.accountCreateUpdateTitle = vm.$t('UpdateAccount')
setTimeout(() => {
vm.showAddDialog = true
})