fix: Asset list: when clone, the account add failed

This commit is contained in:
w940853815
2025-03-06 16:55:13 +08:00
committed by w940853815
parent fcee27b8df
commit 62f482bb63
2 changed files with 5 additions and 4 deletions

View File

@@ -68,13 +68,13 @@ export default {
fieldsMeta: {},
performSubmit(validValues) {
let url = this.url
const { id = '' } = vm.meta
const { id = '', action } = vm.meta
const values = _.cloneDeep(validValues)
let submitMethod = id ? 'put' : 'post'
if (values.nodes && values.nodes.length === 0) {
delete values['nodes']
}
if (id) {
if (action === 'update') {
url = getUpdateObjURL(url, id)
delete values['accounts']
} else {

View File

@@ -217,8 +217,9 @@ export default {
},
methods: {
async updateOrCloneAsset(row, action) {
this.$route.params.id = row.id
this.$route.params.action = action
if (action === 'update') {
this.$route.params.id = row.id
}
const meta = {
action: action,
id: row.id,