瀏覽代碼

表格数据排序规则调整

lph 1 年之前
父節點
當前提交
b16e87a4dd

+ 11 - 0
ruoyi-ui/jsconfig.json

@@ -0,0 +1,11 @@
+{
+  "allowJs": true,
+  "compilerOptions": {
+    "baseUrl": ".",
+    "paths": {
+      "@/*": ["./src/*"]
+    }
+  },
+  "include": ["src/**/*"],
+  "exclude": ["node_modules"]
+}

+ 8 - 3
ruoyi-ui/src/views/tableMange/index.vue

@@ -557,6 +557,7 @@ export default {
       },
       loading: false, //表格加载
       tableDataList: [], //数据
+      editData: {},
     };
   },
   computed: {
@@ -1065,7 +1066,7 @@ export default {
             tableFieldData: this.tableFieldList,
             formData: this.formData,
           };
-          let isAsc = this.formData.isAsc == "ASC" ? 1 : 0;
+          // let isAsc = this.formData.isAsc == "ASC" ? 0 : 1;
           let data = {
             tId: this.tId,
             dtName: this.formData.menuName,
@@ -1074,7 +1075,7 @@ export default {
             dtTableName: this.tableName,
             primaryKey: this.formData.primaryKey,
             orderByColumn: this.formData.orderByColumn,
-            isAsc,
+            sortOrder: this.formData.isAsc,
             sqlKey: uuid,
             dtColumnName: columns, //列字段标题名称(存储显示字段信息
             timeFormat: this.formData.timeFormate,
@@ -1109,7 +1110,7 @@ export default {
           }
           let res;
           if (this.tId) {
-            delete data.sqlKey;
+            data.sqlKey = this.editData.sqlKey;
             res = await editTable(data);
           } else {
             res = await addDragTable(data);
@@ -1163,6 +1164,9 @@ export default {
             // 关闭当前页面
             if (this.tId) {
               this.$tab.closePage();
+              this.$router.push({
+                path: "/system/fromModel/index/tablelist",
+              });
             }
             this.isShowPreview = false;
           }
@@ -1180,6 +1184,7 @@ export default {
         this.tableName = echoData.tableName;
         this.tableFieldList = echoData.tableFieldData;
         this.formData = echoData.formData;
+        this.editData = res.data;
         let val = await getParticMenu(res.data.sqlKey);
         if (val.code == 200) {
           this.menuId = val.data.menuId;

+ 3 - 1
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -309,7 +309,9 @@ export default {
         .then((res) => {
           // 得到当前模版信息 --- sql columns queryWhere
           this.templateInfo = res.data.resultMap;
-          console.log(this.templateInfo);
+          this.queryParams.orderByColumn =
+            res.data.resultMap.querySql.orderByColumn;
+          this.queryParams.isAsc = res.data.resultMap.querySql.sortOrder;
           this.tableName = this.templateInfo.template.dtTableName;
           // 得到查询条件
           this.queryFromWhere = res.data.resultMap.where;