From a9c6ba12e6f96fe316927324f2a038b61bc3a2bc Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 25 Dec 2020 09:35:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=8E=A7=E4=BB=B6=E5=8C=BA=E5=88=86=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/vm/vue/index-tree.vue.vm | 44 ++++++++++++++++-- .../src/main/resources/vm/vue/index.vue.vm | 46 +++++++++++++++++-- ruoyi-ui/src/utils/ruoyi.js | 4 +- 3 files changed, 85 insertions(+), 9 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 e43393412..9c31d0d6a 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 @@ -38,15 +38,28 @@ -#elseif($column.htmlType == "datetime") +#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") - +#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") + + + #end #end #end @@ -201,7 +214,7 @@ #elseif($column.htmlType == "datetime") - { this.${businessName}List = this.handleTree(response.data, "${treeCode}", "${treeParentCode}"); this.loading = false; @@ -397,6 +429,12 @@ export default { }, /** 重置按钮操作 */ resetQuery() { +#foreach ($column in $columns) +#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) + this.daterange${AttrName} = []; +#end +#end this.resetForm("queryForm"); this.handleQuery(); }, 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 e667b1098..8ff104711 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -38,15 +38,28 @@ -#elseif($column.htmlType == "datetime") +#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN") - +#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") + + + #end #end #end @@ -95,7 +108,7 @@ v-hasPermi="['${moduleName}:${businessName}:export']" >导出 - + @@ -230,7 +243,7 @@ #elseif($column.htmlType == "datetime") - { this.${businessName}List = response.rows; this.total = response.total; @@ -413,6 +445,12 @@ export default { }, /** 重置按钮操作 */ resetQuery() { +#foreach ($column in $columns) +#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") +#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) + this.daterange${AttrName} = []; +#end +#end this.resetForm("queryForm"); this.handleQuery(); }, diff --git a/ruoyi-ui/src/utils/ruoyi.js b/ruoyi-ui/src/utils/ruoyi.js index 0cecbc0b2..81ee9c70b 100644 --- a/ruoyi-ui/src/utils/ruoyi.js +++ b/ruoyi-ui/src/utils/ruoyi.js @@ -62,8 +62,8 @@ export function addDateRange(params, dateRange, propName) { search.params["beginTime"] = dateRange[0]; search.params["endTime"] = dateRange[1]; } else { - search.params[propName + "BeginTime"] = dateRange[0]; - search.params[propName + "EndTime"] = dateRange[1]; + search.params["begin" + propName] = dateRange[0]; + search.params["end" + propName] = dateRange[1]; } } return search;