perf: asset update

This commit is contained in:
ibuler
2025-03-20 17:59:59 +08:00
committed by 老广
parent 6eedfe994e
commit 84a66d8c5a
2 changed files with 4 additions and 12 deletions

View File

@@ -44,7 +44,6 @@ export default {
}
},
data() {
const vm = this
return {
loading: true,
platform: {},
@@ -68,16 +67,15 @@ export default {
fieldsMeta: {},
performSubmit(validValues) {
let url = this.url
const { id = '', action } = vm.meta
const { id = '' } = this.$route.query
const values = _.cloneDeep(validValues)
const submitMethod = id ? 'put' : 'post'
if (values.nodes && values.nodes.length === 0) {
delete values['nodes']
}
if (action === 'update') {
if (submitMethod === 'put') {
url = getUpdateObjURL(url, id)
delete values['accounts']
} else {

View File

@@ -215,9 +215,7 @@ export default {
},
methods: {
async updateOrCloneAsset(row, action) {
if (action === 'update') {
this.$route.params.id = row.id
}
this.createDrawer = this.drawer[row.category.value]
const meta = {
action: action,
id: row.id,
@@ -227,11 +225,7 @@ export default {
row: row,
payload: row.payload
}
await this.$store.dispatch('common/setDrawerActionMeta', meta)
this.createDrawer = this.drawer[row.category.value]
setTimeout(() => {
this.$refs.ListTable.showDrawer(action)
}, 100)
this.$refs.ListTable.onUpdate({ row, query: meta })
},
createAsset(platform) {
this.showPlatform = false