From 5b61aea064663172c1b8564abd797ead3497ab78 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 19 Aug 2023 14:34:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=91=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=88=B6=E7=BA=A7=E7=BC=96=E7=A0=81=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF(I7JZ0L)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm | 2 +- ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm | 2 +- 2 files changed, 2 insertions(+), 2 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 b7fdb62d..cbfb7cd7 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 @@ -453,7 +453,7 @@ export default { this.reset(); this.getTreeselect(); if (row != null) { - this.form.${treeParentCode} = row.${treeCode}; + this.form.${treeParentCode} = row.${treeParentCode}; } get${BusinessName}(row.${pkColumn.javaField}).then(response => { this.form = response.data; diff --git a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm index 7bbd2fc5..c54d62bf 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -420,7 +420,7 @@ async function handleUpdate(row) { reset(); await getTreeselect(); if (row != null) { - form.value.${treeParentCode} = row.${treeCode}; + form.value.${treeParentCode} = row.${treeParentCode}; } get${BusinessName}(row.${pkColumn.javaField}).then(response => { form.value = response.data; From 6a742e1d1bb1fc8c7809ab993367c85daf7a54b4 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 19 Aug 2023 15:43:57 +0800 Subject: [PATCH 2/4] =?UTF-8?q?Excel=E5=AF=BC=E5=85=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=96=87=E4=BB=B6=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=97=AE=E9=A2=98(I7KIXX)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/utils/poi/ExcelUtil.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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 bafb9c07..349ee75d 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 @@ -288,9 +288,23 @@ public class ExcelUtil * @param is 输入流 * @return 转换后集合 */ - public List importExcel(InputStream is) throws Exception + public List importExcel(InputStream is) { - return importExcel(is, 0); + List list = null; + try + { + list = importExcel(is, 0); + } + catch (Exception e) + { + log.error("导入Excel异常{}", e.getMessage()); + throw new UtilException(e.getMessage()); + } + finally + { + IOUtils.closeQuietly(is); + } + return list; } /** @@ -336,7 +350,6 @@ public class ExcelUtil } // 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1 int rows = sheet.getLastRowNum(); - if (rows > 0) { // 定义一个map用于存放excel列的序号和field. From d58942c506f5bf3962894e175d9df73b49ed9297 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 21 Aug 2023 11:57:14 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=98=B2=E9=87=8D=E5=A4=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B0=8F=E9=99=90=E5=88=B6?= =?UTF-8?q?(I7KZDA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/request.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 8797e3f7..ffb0d219 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -42,6 +42,12 @@ service.interceptors.request.use(config => { data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, time: new Date().getTime() } + const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小 + const limitSize = 5 * 1024 * 1024; // 限制存放数据5M + if (requestSize >= limitSize) { + console.warn(`[${config.url}]: ` + '请求数据大小超出允许的5M限制,无法进行防重复提交验证。') + return config; + } const sessionObj = cache.session.getJSON('sessionObj') if (sessionObj === undefined || sessionObj === null || sessionObj === '') { cache.session.setJSON('sessionObj', requestObj) From 27bcef5021bc29bbcc093f92d7df61cf9a67a2e1 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 21 Aug 2023 15:46:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8DExcels=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E5=88=B0dictType?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=80=BC=E9=97=AE=E9=A2=98(I7M4PW)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/domain/entity/SysUser.java | 5 +++-- .../src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 8d4d4c56..864bf254 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -72,8 +72,9 @@ public class SysUser extends BaseEntity /** 部门对象 */ @Excels({ - @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), - @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT) + @Excel(name = "部门名称", targetAttr = "deptName"), + @Excel(name = "部门负责人", targetAttr = "leader"), + @Excel(name = "部门状态", targetAttr = "status", dictType = "sys_normal_disable") }) private SysDept dept; 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 349ee75d..68ccbf11 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 @@ -464,7 +464,7 @@ public class ExcelUtil { propertyName = field.getName() + "." + attr.targetAttr(); } - else if (StringUtils.isNotEmpty(attr.readConverterExp())) + if (StringUtils.isNotEmpty(attr.readConverterExp())) { val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator()); }