diff --git a/pom.xml b/pom.xml
index 95e63e7bc..9ef7c4fdc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
2.9.2
2.3.2
1.2.5
- 1.2.70
+ 1.2.73
3.9.1
2.5
1.3.3
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
index eed41a2ab..f781b1e37 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
@@ -4,6 +4,7 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import java.math.BigDecimal;
/**
* 自定义导出Excel数据注解
@@ -30,7 +31,7 @@ public @interface Excel
public String dateFormat() default "";
/**
- * 如果是字典类型,请设置字典的type值
+ * 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
*/
public String dictType() default "";
@@ -44,6 +45,16 @@ public @interface Excel
*/
public String separator() default ",";
+ /**
+ * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
+ */
+ public int scale() default -1;
+
+ /**
+ * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
+ */
+ public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
+
/**
* 导出类型(0数字 1字符串)
*/
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
index e6dd98e22..23f1f8bd5 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
@@ -18,8 +18,8 @@ public class PageDomain
/** 排序列 */
private String orderByColumn;
- /** 排序的方向 "desc" 或者 "asc". */
- private String isAsc;
+ /** 排序的方向desc或者asc */
+ private String isAsc = "asc";
public String getOrderBy()
{
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
index d950b77f4..d5a23b155 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -8,6 +8,7 @@ import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
+import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
@@ -546,10 +547,14 @@ public class ExcelUtil
{
cell.setCellValue(convertByExp(Convert.toStr(value), readConverterExp, separator));
}
- else if (StringUtils.isNotEmpty(dictType))
+ else if (StringUtils.isNotEmpty(dictType) && StringUtils.isNotNull(value))
{
cell.setCellValue(convertDictByExp(Convert.toStr(value), dictType, separator));
}
+ else if (value instanceof BigDecimal && -1 != attr.scale())
+ {
+ cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).toString());
+ }
else
{
// 设置列类型
@@ -896,7 +901,14 @@ public class ExcelUtil
}
else
{
- val = new BigDecimal(val.toString()); // 浮点格式处理
+ if ((Double) val % 1 > 0)
+ {
+ val = new BigDecimal(val.toString());
+ }
+ else
+ {
+ val = new DecimalFormat("0").format(val);
+ }
}
}
else if (cell.getCellTypeEnum() == CellType.STRING)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
index 10531590f..786611507 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -88,7 +88,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
protected void configure(HttpSecurity httpSecurity) throws Exception
{
httpSecurity
- // CRSF禁用,因为不使用session
+ // CSRF禁用,因为不使用session
.csrf().disable()
// 认证失败处理类
.exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
index 495a94c25..b52c6f249 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
@@ -66,7 +66,7 @@
v-hasPermi="['${moduleName}:${businessName}:add']"
>新增
-
+
#elseif($column.htmlType == "select" && "" != $dictType)
-
+
#elseif($column.htmlType == "select" && $dictType)
-
+
@@ -272,9 +272,8 @@ export default {
#else
#set($comment=$column.columnComment)
#end
-#set($comment=$column.columnComment)
$column.javaField: [
- { required: true, message: "$comment不能为空", trigger: "blur" }
+ { required: true, message: "$comment不能为空", trigger: "#if($column.htmlType == "select")"change"#else"blur"#end" }
]#if($velocityCount != $columns.size()),#end
#end
diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
index 3e5298c69..b5e45f5c5 100644
--- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
+++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
@@ -169,7 +169,7 @@
#elseif($column.htmlType == "select" && "" != $dictType)
-
+
#elseif($column.htmlType == "select" && $dictType)
-
+
@@ -306,9 +306,8 @@ export default {
#else
#set($comment=$column.columnComment)
#end
-#set($comment=$column.columnComment)
$column.javaField: [
- { required: true, message: "$comment不能为空", trigger: "blur" }
+ { required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end }
]#if($velocityCount != $columns.size()),#end
#end
diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json
index d5e3dd726..b4173d3f6 100644
--- a/ruoyi-ui/package.json
+++ b/ruoyi-ui/package.json
@@ -86,7 +86,7 @@
"mockjs": "1.0.1-beta3",
"plop": "2.3.0",
"runjs": "4.3.2",
- "sass": "1.26.10",
+ "node-sass": "4.14.1",
"sass-loader": "8.0.2",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
diff --git a/ruoyi-ui/src/components/HeaderSearch/index.vue b/ruoyi-ui/src/components/HeaderSearch/index.vue
index 114ae041a..6fe5fd651 100644
--- a/ruoyi-ui/src/components/HeaderSearch/index.vue
+++ b/ruoyi-ui/src/components/HeaderSearch/index.vue
@@ -167,7 +167,7 @@ export default {
display: inline-block;
vertical-align: middle;
- ::v-deep .el-input__inner {
+ /deep/ .el-input__inner {
border-radius: 0;
border: 0;
padding-left: 0;
diff --git a/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue b/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue
index c110bf123..dd4b77f95 100644
--- a/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue
+++ b/ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue
@@ -82,7 +82,7 @@ export default {
position: relative;
overflow: hidden;
width: 100%;
- ::v-deep {
+ /deep/ {
.el-scrollbar__bar {
bottom: 0px;
}
diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js
index 0c0f59082..b79f44c62 100644
--- a/ruoyi-ui/src/utils/ruoyi.js
+++ b/ruoyi-ui/src/utils/ruoyi.js
@@ -1,4 +1,4 @@
-/**
+/**
* 通用js方法封装处理
* Copyright (c) 2019 ruoyi
*/
@@ -131,7 +131,7 @@ export function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'
parentId = parentId || 'parentId'
children = children || 'children'
- rootId = rootId || 0
+ rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
//对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
//循环所有项