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

View File

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