From 650359c357b3e6b75cce03a2f4ec3f47909ef011 Mon Sep 17 00:00:00 2001 From: liguonan Date: Mon, 10 Aug 2020 16:28:50 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9sass=E4=B8=BAnode-sass?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8Del-icon=E5=9B=BE=E6=A0=87=E4=B9=B1?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index f359fb6c..0a05a254 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", From 0070297fe11ceb3a013721ae35ffd4ad56ad1065 Mon Sep 17 00:00:00 2001 From: gst <332882090@qq.com> Date: Tue, 11 Aug 2020 10:59:02 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=A0=B9=E8=8A=82=E7=82=B9=E4=B8=BA?= =?UTF-8?q?=E5=AD=90=E9=83=A8=E9=97=A8=E6=97=B6=EF=BC=8C=E6=A0=91=E7=8A=B6?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/ruoyi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 462dc8f6..87ba2213 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -1,4 +1,4 @@ -/** +/** * 通用js方法封装处理 * Copyright (c) 2019 ruoyi */ @@ -128,7 +128,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)) //循环所有项 From 04e294b3e532d03642335ee102d3f515fa5358a0 Mon Sep 17 00:00:00 2001 From: sunshine <1913599913@qq.com> Date: Mon, 17 Aug 2020 12:08:34 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90:select?= =?UTF-8?q?=E7=9A=84=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 3e5298c6..17881567 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) - + @@ -308,7 +308,7 @@ export default { #end #set($comment=$column.columnComment) $column.javaField: [ - { required: true, message: "$comment不能为空", trigger: "blur" } + { required: true, message: "$comment不能为空", #if($column.htmlType == "select")"change"#else"blur"#end } ]#if($velocityCount != $columns.size()),#end #end From 4f7702b22a715272e9210571c69b80b4eb89ef4f Mon Sep 17 00:00:00 2001 From: Lyy <1250400743@qq.com> Date: Mon, 17 Aug 2020 17:05:33 +0800 Subject: [PATCH 4/8] =?UTF-8?q?update=20ruoyi-framework/src/main/java/com/?= =?UTF-8?q?ruoyi/framework/config/SecurityConfig.java.=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=B3=A8=E9=87=8A=EF=BC=8CCRSF=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/framework/config/SecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 10531590..78661150 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() From 5fcf342f5a08cc7dec3bdd53445c6c5c69c52b80 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 18 Aug 2020 17:36:20 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9sass=E4=B8=BAnode-sass?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8Del-icon=E5=9B=BE=E6=A0=87=E4=B9=B1?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/HeaderSearch/index.vue | 2 +- ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue | 2 +- ruoyi-ui/src/utils/ruoyi.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/src/components/HeaderSearch/index.vue b/ruoyi-ui/src/components/HeaderSearch/index.vue index 114ae041..6fe5fd65 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 c110bf12..dd4b77f9 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 4333f82d..b79f44c6 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -131,7 +131,7 @@ export function handleTree(data, id, parentId, children, rootId) { id = id || 'id' parentId = parentId || 'parentId' children = children || 'children' - rootId = rootId || Math.min.apply(Math,data.map(item => { return item[parentId] })) || 0 + rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0 //对源数据深度克隆 const cloneData = JSON.parse(JSON.stringify(data)) //循环所有项 From 549c7ee97a2a006566848d7889aa8eed0e0dde20 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 18 Aug 2020 18:15:12 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0select=E5=BF=85=E5=A1=AB=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/vm/vue/index-tree.vue.vm | 9 ++++----- ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) 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 495a94c2..b52c6f24 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 17881567..b5e45f5c 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -306,9 +306,8 @@ export default { #else #set($comment=$column.columnComment) #end -#set($comment=$column.columnComment) $column.javaField: [ - { required: true, message: "$comment不能为空", #if($column.htmlType == "select")"change"#else"blur"#end } + { required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end } ]#if($velocityCount != $columns.size()),#end #end From 7de5358dcdafbf5ea4a08afc6434f1a0a3214d29 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 19 Aug 2020 11:17:24 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=8D=87=E7=BA=A7fastjson=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=881.2.73?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 95e63e7b..9ef7c4fd 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 From da146c2a708387059d4e31cbe1db0fdd8ceb41e3 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 19 Aug 2020 11:20:31 +0800 Subject: [PATCH 8/8] =?UTF-8?q?Excel=E6=B3=A8=E8=A7=A3=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEBigDecimal=E7=B2=BE=E5=BA=A6&=E8=88=8D?= =?UTF-8?q?=E5=85=A5=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/annotation/Excel.java | 13 ++++++++++++- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) 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 eed41a2a..f781b1e3 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/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index d950b77f..d5a23b15 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)