Browse Source

fix:达梦数据格式调式

xuezizhuo 1 year ago
parent
commit
1367aed4f8
1 changed files with 8 additions and 9 deletions
  1. 8 9
      ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

+ 8 - 9
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -397,7 +397,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(
-        (item) => item[this.templateInfo.template?.primaryKey]
+        (item) => item[camelCase(this.templateInfo.template?.primaryKey)]
       );
       this.single = selection.length != 1;
       this.multiple = !selection.length;
@@ -445,6 +445,8 @@ export default {
           this.$message.error("当前表格未绑定表单!");
           return;
         }
+        console.log(row);
+        console.log(data.dfVueTemplate);
         Object.assign(this.defaultValue, row);
         this.jsonData = JSON.parse(data.dfVueTemplate);
         this.open = true;
@@ -494,14 +496,12 @@ export default {
      * 删除提示信息语句(标识)
      * */
     handleDelete(row) {
+      console.log(this.ids)
       let delIds = this.ids;
-      let primary = this.templateInfo.template?.primaryKey;
+      let primary = camelCase(this.templateInfo.template?.primaryKey);
       if (row[primary] != undefined && row[primary] != null) {
         delIds = [];
         delIds.push(row[primary]);
-        // if (delIds.findIndex(item => item === row.id) == -1) {
-        //   delIds.push(row.id);
-        // }
       }
       let data = {
         basicMap: {
@@ -511,7 +511,7 @@ export default {
           // id: delIds,
         },
       };
-      data.conditionMap[primary] = delIds;
+      data.conditionMap[this.templateInfo.template?.primaryKey] = delIds;
       this.$modal
         .confirm('是否确认删除"' + delIds + '"的数据项?')
         .then(function () {
@@ -619,12 +619,11 @@ export default {
               commMap: {},
             };
 
-            updateData.conditionMap[this.templateInfo.template?.primaryKey] =
-              this.defaultValue[this.templateInfo.template?.primaryKey];
+            // 后台接收需要是表中字段真实的名称,无所谓驼峰。
+            updateData.conditionMap[this.templateInfo.template?.primaryKey] = this.defaultValue[camelCase(this.templateInfo.template?.primaryKey)];
             Object.keys(values).map((k) => {
               updateData.commMap[k] = values[k];
             });
-            console.log(values);
             let res = await batchEdit(updateData);
             this.$modal.msgSuccess("修改成功");
             this.getList();