浏览代码

Merge remote-tracking branch 'origin/master'

Administrator 4 年之前
父节点
当前提交
7aaa28107c

+ 1 - 1
boman-modules/boman-file/src/main/java/com/boman/file/utils/FileUploadUtils.java

@@ -27,7 +27,7 @@ public class FileUploadUtils
     /**
      * 默认的文件名最大长度 100
      */
-    public static final int DEFAULT_FILE_NAME_LENGTH = 100;
+    public static final int DEFAULT_FILE_NAME_LENGTH = 1000;
 
     /**
      * 根据文件路径上传

+ 21 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/util/GenUtils.java

@@ -1,6 +1,11 @@
 package com.boman.gen.util;
 
 import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.RegExUtils;
 import com.boman.common.core.constant.GenConstants;
 import com.boman.common.core.utils.StringUtils;
@@ -255,4 +260,20 @@ public class GenUtils
             return 0;
         }
     }
+
+    /**
+     * 功能描述: 数字小的在前面,数字大的在后面
+     *
+     * @param allColumns allColumns
+     * @return java.util.List<com.boman.gen.domain.GenTableColumn>
+     */
+    public static List<GenTableColumn> filterHrAndSort(List<GenTableColumn> allColumns) {
+        if (CollectionUtils.isEmpty(allColumns)) {
+            throw new IllegalArgumentException("GenTableColumn is empty");
+        }
+
+        return allColumns.stream().filter(col -> "HR".equalsIgnoreCase(col.getHtmlType()))
+                .sorted(Comparator.comparing(GenTableColumn::getSort))
+                .collect(Collectors.toList());
+    }
 }

+ 10 - 7
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -18,6 +18,7 @@ import com.boman.gen.controller.MyController;
 import com.boman.gen.domain.GenTable;
 import com.boman.gen.domain.GenTableColumn;
 import com.boman.gen.domain.GenTableRelation;
+import com.boman.gen.util.GenUtils;
 import com.boman.system.api.RemoteDictDataService;
 import com.boman.system.api.domain.SysFile;
 import com.boman.web.core.constant.FormDataConstant;
@@ -124,7 +125,7 @@ public class TableServiceCmdService {
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     public AjaxResult objectDelete(BaseTableSaveDTO dto) {
-        requireNonNull(dto.getTable());
+        requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
         requireNonNull(idArr);
         // 拿到pkName
@@ -151,7 +152,7 @@ public class TableServiceCmdService {
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     public AjaxResult objectLogicDelete(BaseTableSaveDTO dto) {
-        requireNonNull(dto.getTable());
+        requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
         Long[] idArr = CollectionUtils.listToArray(dto.getIdList());
         requireNonNull(idArr);
 
@@ -178,7 +179,7 @@ public class TableServiceCmdService {
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     public AjaxResult queryList(BaseTableSaveDTO dto) {
-        requireNonNull(dto.getTable());
+        requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
 
         // 拿到每个字段对应的查询类型,=、 like、 >、 <
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, dto.getTable());
@@ -378,7 +379,7 @@ public class TableServiceCmdService {
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     public AjaxResult getObject(BaseTableSaveDTO dto) {
-        String tableName = requireNonNull(dto.getTable());
+        String tableName = requireNonNull(dto.getTable(), "tableName = [" + dto.getTable() + "] 此表不存在");
 
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
         String pkName = IdUtils.getPkName(genTable.getColumns());
@@ -394,7 +395,8 @@ public class TableServiceCmdService {
         // 默认查所有字段,不支持自定义
         JSONObject json = selectService.selectById(tableName, pkName, id);
         requireNonNull(json, "id 为[" + id + "]的数据不存在, 表名为[" + tableName + "]");
-        List<GenTableColumn> parentColumns = filter(columns, col -> HR.equalsIgnoreCase(col.getHtmlType()));
+        List<GenTableColumn> parentColumns = GenUtils.filterHrAndSort(columns);
+
         // 处理成hr的形式
         for (GenTableColumn hrColumn : parentColumns) {
             List<GenTableColumn> children = Lists.newArrayListWithCapacity(16);
@@ -796,7 +798,7 @@ public class TableServiceCmdService {
      * @return com.boman.common.core.web.domain.AjaxResult
      */
     public AjaxResult getByTableName(BaseTableSaveDTO condition) {
-        requireNonNull(condition.getTable(), "表名为空");
+        requireNonNull(condition.getTable(), "tableName = [" + condition.getTable() + "] 此表不存在");
         requireNonNull(condition.getIsUi(), "根据表名获取表字段,未传 isUi 这个字段");
         GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, condition.getTable());
         List<GenTableColumn> allColumns = genTable.getColumns();
@@ -813,7 +815,8 @@ public class TableServiceCmdService {
     }
 
     public AjaxResult getByTableName(String tableName, List<GenTableColumn> allColumns) {
-        List<GenTableColumn> parentColumns = filter(allColumns, col -> HR.equalsIgnoreCase(col.getHtmlType()));
+        List<GenTableColumn> parentColumns = GenUtils.filterHrAndSort(allColumns);
+//        List<GenTableColumn> parentColumns = filter(allColumns, col -> HR.equalsIgnoreCase(col.getHtmlType()));
         allColumns = filterData(allColumns, 0, MaskConstant.LIST_VISIBLE::equals);
 
         // 把孩子放入父亲的怀抱

+ 3 - 2
ruoyi-ui/src/components/DynamicForm/index.vue

@@ -40,7 +40,7 @@
         :action="process + '/boman-file/upload'"
         :on-change="handleChange"
         :on-success="upImageFn"
-         :on-remove="reseImage"
+        :on-remove="reseImage"
         :file-list="config">
         <el-button size="small" type="primary">点击上传</el-button>
         <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
@@ -87,7 +87,7 @@
     methods: {
       upImageFn(res, file){
         this.config.push(res.data);
-        console.log(this.config,12153)
+        console.log(res,12153)
       },
       init() {
         if(this.formConfig.htmlType == 'checkbox' || this.formConfig.htmlType == 'imageUpload' || this.formConfig.htmlType == 'fileUpload'){
@@ -130,6 +130,7 @@
       },
       handlePictureCardPreview(file) {
         this.dialogImageUrl = file.url;
+		// console.log(this.dialogImageUrl)
         this.dialogVisible = true;
       },
       handleDownload(file) {

+ 1 - 1
ruoyi-ui/src/components/DynamicForms/index.vue

@@ -91,7 +91,7 @@
       },
       init() {
         if(this.formConfig.htmlType == 'checkbox' || this.formConfig.htmlType == 'imageUpload' || this.formConfig.htmlType == 'fileUpload'){
-          this.config =  this.formConfig.columnValue || []
+          this.config =  []
         }else{
           this.$set(this.config, this.formConfig.columnName,(this.formConfig.columnValue || ''))
         }

+ 1 - 1
ruoyi-ui/src/settings.js

@@ -1,7 +1,7 @@
 module.exports = {
   title: '潜山市云数据中心',
   // urls: `http://192.168.101.11:8090`,
-  urls: `http://192.168.101.110:8080`,
+  urls: `http://192.168.101.110:8090`,
   // urls: `http://192.168.101.49:8080`,
 
   // urls: `http://192.168.101.10:8080`,

+ 5 - 1
ruoyi-ui/src/views/system/form/index.vue

@@ -302,6 +302,7 @@
              addbjectSave(this.forme).then(response => {
                this.msgSuccess("保存成功");
                this.open = false;
+               this.$router.go(-1)
                // this.getList();
              });
      },
@@ -311,6 +312,7 @@
          // 提交
          tableSubimt(this.formeanti).then(response => {
            this.msgSuccess("提交成功");
+           this.$router.go(-1)
            // this.open = false;
            // this.getList();
          });
@@ -318,6 +320,7 @@
          // 反提交
          tableSubimtanit(this.formeanti).then(response => {
            this.msgSuccess("反提交成功");
+           this.$router.go(-1)
            // this.open = false;
            // this.getList();
          });
@@ -330,10 +333,11 @@
            cancelButtonText: "取消",
            type: "warning"
          }).then(function() {
-           return delMenutab(index);
+           return delMenutabform(index);
          }).then(() => {
            // this.getList();
            this.msgSuccess("删除成功");
+           this.$router.go(-1)
          })
      }
 

+ 3 - 3
ruoyi-ui/src/views/system/surface/index.vue

@@ -300,9 +300,9 @@
       line-height: 36px;
     }
 
-    .el-form-item__content {
-      width: 55%;
-    }
+    // .el-form-item__content {
+    //   width: 55%;
+    // }
 
     .el-collapse {
       border-top: 0;

+ 4 - 0
ruoyi-ui/src/views/system/table/index.vue

@@ -218,6 +218,7 @@
               addbjectSave(this.forme).then(response => {
                 this.msgSuccess("保存成功");
                 this.open = false;
+                this.$router.go(-1)
                 // this.getList();
               });
       },
@@ -227,6 +228,7 @@
           // 提交
           tableSubimt(this.formeanti).then(response => {
             this.msgSuccess("提交成功");
+            this.$router.go(-1)
             // this.open = false;
             // this.getList();
           });
@@ -234,6 +236,7 @@
           // 反提交
           tableSubimtanit(this.formeanti).then(response => {
             this.msgSuccess("反提交成功");
+            this.$router.go(-1)
             // this.open = false;
             // this.getList();
           });
@@ -250,6 +253,7 @@
           }).then(() => {
             // this.getList();
             this.msgSuccess("删除成功");
+            this.$router.go(-1)
           })
       }
     },