Sfoglia il codice sorgente

fix:优化驼峰转换

韩帛霖 1 anno fa
parent
commit
f8e86fb18c
1 ha cambiato i file con 2 aggiunte e 9 eliminazioni
  1. 2 9
      ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

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

@@ -351,29 +351,22 @@ export default {
           let test = [];
           test = JSON.parse(this.templateInfo.template.dtColumnName);
           this.columns = this.columnsHandler(test);
-          // test.forEach((item) => {
-          //   this.columns = {
-          //     ...this.columns,
-          //     ...item,
-          //   };
-          // });
-          console.log(this.columns);
         })
         .finally((fes) => {
           if (this.templateInfo == {}) return;
           // 调用查询需要携带当前table的唯一标识
           this.queryParams.queryMap.sqlkey = this.sqlkey;
-          this.queryParams.orderByColumn = this.toUnderScoreCase(this.queryParams.orderByColumn);
+          this.queryParams.orderByColumn = camelCase(this.queryParams.orderByColumn);
           // 根据sql语句查询当前表数据
           unionListTableData(this.queryParams).then((res) => {
             this.tableList = [];
             res.rows.forEach((item) => {
               this.tableList.push(item.resultMap);
             });
+            // 驼峰转换
             this.tableList = this.tableList.map(item => {
               let kv = {}
               for (let itemKey in item) {
-                console.log(itemKey);
                 kv[camelCase(itemKey)] = item[itemKey]
               }
               return kv