Browse Source

fix: 修复表单模板配置更新报错问题

johnsen 10 tháng trước cách đây
mục cha
commit
6e463dd261
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      src/views/component/formTemplate/index.vue

+ 7 - 2
src/views/component/formTemplate/index.vue

@@ -503,7 +503,8 @@ export default {
     },
     async goEdit(flag) {
       try {
-        const obj = this.formatData()
+        const obj = JSON.parse(JSON.stringify(this.formatData()))
+        delete obj.id_
         const updateParamsRecord = {
           tableName: 't_bdmbpzb',
           updList: [
@@ -515,6 +516,7 @@ export default {
             }
           ]
         }
+        console.log('updateParamsRecord===>', updateParamsRecord)
         await this.$common.request('update', updateParamsRecord)
         this.$message.success('修改成功!')
         this.closeDialog(true)
@@ -554,7 +556,10 @@ export default {
     async init() {
       this.isEdit = !!(this.params && this.params.id_)
       if (this.isEdit) {
-        this.form = this.params
+        // this.form = this.params
+        for (const key in this.form) {
+          this.form[key] = this.params[key]
+        }
         // JSON 解析
         const liu_cheng_shu_ju_ = JSON.parse(this.form.liu_cheng_shu_ju_)
         // console.log(liu_cheng_shu_ju_.nodeList)