perf: 克隆资产时克隆账号,template为false

This commit is contained in:
“huailei000”
2023-02-01 14:29:12 +08:00
committed by huailei
parent 88c4d9e56f
commit ad870fe837
2 changed files with 5 additions and 2 deletions

View File

@@ -62,15 +62,18 @@ export default {
// Update 的时候
const { id = '' } = this.$route.params
const accounts = values?.accounts
const query = this.$route.query || {}
if (id) delete values['accounts']
if (values.nodes && values.nodes.length === 0) {
delete values['nodes']
}
if (accounts && accounts.length !== 0) {
accounts.forEach(i => {
if (i.hasOwnProperty('id')) {
i.template = true
// 克隆资产时 template 为 false
i.template = !query.hasOwnProperty('clone_from')
}
return i
})

View File

@@ -69,7 +69,7 @@ export default {
},
data() {
return {
accounts: [],
accounts: this.value || [],
account: {},
initial: false,
addAccountDialogVisible: false,