mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-26 06:58:53 +00:00
perf: asset update
This commit is contained in:
@@ -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 {
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user