NEZ-843 fix:asset,endpoint chart 导入模板接口错误

This commit is contained in:
zhangyu
2021-07-19 17:04:46 +08:00
parent 8f9f1347f2
commit 63ba940d2a
6 changed files with 52 additions and 36 deletions

View File

@@ -566,8 +566,13 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.editAsset.id) {
this.$put(this.url, this.editAsset).then(res => {
const params = JSON.parse(JSON.stringify(this.editAsset))
if (params.type.vm !== 1) {
params.parent = {}
params.pid = ''
}
if (params.id) {
this.$put(this.url, params).then(res => {
this.prevent_opt.save = false
if (res.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
@@ -577,7 +582,7 @@ export default {
}
})
} else {
this.$post(this.url, this.editAsset).then(res => {
this.$post(this.url, params).then(res => {
this.prevent_opt.save = false
if (res.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })