Browse Source

Merge remote-tracking branch 'origin/master'

韩帛霖 1 year ago
parent
commit
f8ac3e8fa6

+ 0 - 1
ruoyi-ui/src/views/system/tenant/index.vue

@@ -540,7 +540,6 @@ export default {
     /** 绑定数据源按钮操作 */
     bindDatasource(row) {
       this.currentTenantInfo = row;
-      console.log(row);
       this.reset1();
       this.dataSourceOpen = true;
       this.dataSourceTitle = row.tenantName + "配置数据库";

+ 1 - 1
ruoyi-ui/src/views/system/user/authRole.vue

@@ -108,7 +108,7 @@ export default {
           this.$nextTick(() => {
             this.roles.forEach((row) => {
               if (row.flag) {
-                this.$refs.table.toggleRowSelection(row);
+                this.$refs.table.toggleRowSelection(row, true);
               }
             });
           });

+ 48 - 2
ruoyi-ui/src/views/tableMange/index.vue

@@ -614,6 +614,15 @@ export default {
     primaryKeyList() {
       return this.tableFieldList.filter((item) => !item.isChildren);
     },
+    menuOrderNum() {
+      if (!this.formData.routePath) return 0;
+      let targetMenu = this.getTargetMenu(this.menus);
+      if (targetMenu.children?.length) {
+        return targetMenu.children.length;
+      } else {
+        return 0;
+      }
+    },
   },
   watch: {
     tableName: function (val) {
@@ -632,6 +641,18 @@ export default {
     },
   },
   methods: {
+    // 获取目标menu
+    getTargetMenu(menus) {
+      for (let i = 0; i < menus.length; i++) {
+        if (menus[i].menuId == this.formData.routePath) {
+          return menus[i];
+        } else if (menus.children?.length) {
+          return this.getTargetMenu(menus.children);
+        }
+      }
+      return false;
+    },
+
     /** 查询列表 */
     getList(queryParams) {
       if (!this.tableName) return;
@@ -864,6 +885,31 @@ export default {
           msg: "显示的字段数不能为空",
         };
       }
+      if (
+        tableFieldList.filter((item) => item.isExport && !item.isChildren)
+          .length == 0
+      ) {
+        return {
+          val: false,
+          msg: "导出字段中至少应有一个主表字段",
+        };
+      }
+      // 导出的字段的描述不能重复
+      let describeArr = tableFieldList
+        .filter((item) => item.isExport)
+        .map((item) => item.fieldDescription);
+      let isRepeat = false;
+      describeArr.map((item) => {
+        if (describeArr.indexOf(item) != describeArr.lastIndexOf(item)) {
+          isRepeat = true;
+        }
+      });
+      if (isRepeat) {
+        return {
+          val: false,
+          msg: "导出的字段描述不能重复",
+        };
+      }
 
       return {
         val: true,
@@ -1146,7 +1192,7 @@ export default {
               isCache: "0",
               isFrame: "1",
               menuType: "C",
-              orderNum: "0",
+              orderNum: this.menuOrderNum,
               status: "0",
               visible: "0",
             };
@@ -1162,7 +1208,7 @@ export default {
               isFrame: "1",
               menuName: this.formData.menuName,
               menuType: "C",
-              orderNum: "0",
+              orderNum: this.menuOrderNum,
               parentId: this.formData.routePath,
               path: uuid,
               query: JSON.stringify(sqlKeyObj),