diff --git a/jero-boot/jero-boot-module-system/src/main/resources/jero/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei b/jero-boot/jero-boot-module-system/src/main/resources/jero/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei index e6e92c48..bd8e5f82 100644 --- a/jero-boot/jero-boot-module-system/src/main/resources/jero/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei +++ b/jero-boot/jero-boot-module-system/src/main/resources/jero/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei @@ -69,9 +69,11 @@ <#if query_field_no gt 1> <#if query_field_no gt 1> <#if po.classType=='date'> - <#if query_field_no gt 1> + <#assign date_flag=true> + <#if query_field_no gt 1> <#elseif po.classType=='datetime'> - <#if query_field_no gt 1> + <#assign date_flag=true> + <#if query_field_no gt 1> <#else> <#if query_field_no gt 1> <#if query_field_no gt 1> @@ -227,6 +229,9 @@ import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' <#if list_need_pca> import Area from '@/components/_util/Area' +<#if date_flag> +import { filterObj } from '@/utils/util' + export default { name: '${entityName}List', @@ -404,12 +409,36 @@ export default { }, <#list columns as po> <#if po.classType=='datetime' || po.classType=='date'> - ${po.fieldName}OnOk () { - this.queryParam.${po.fieldName}_begin = this.queryParam.${po.fieldName}Range[0] - this.queryParam.${po.fieldName}_end = this.queryParam.${po.fieldName}Range[1] + // 范围查询需要处理查询参数 + ${po.fieldName}Change (value, valueString) { + if (valueString && valueString.length > 0) { + this.queryParam.${po.fieldName}_begin = valueString[0] + this.queryParam.${po.fieldName}_end = valueString[1] + } }, + <#if date_flag> + getQueryParams () { + // 获取查询条件 + const sqp = {} + if (this.superQueryParams) { + sqp.superQueryParams = encodeURI(this.superQueryParams) + sqp.superQueryMatchType = this.superQueryMatchType + } + const param = JSON.parse(JSON.stringify(Object.assign(sqp, this.queryParam, this.isorter, this.filters))) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + <#list columns as po> + <#if po.classType=='datetime' || po.classType=='date'> + // 范围查询需要吧range的属性去掉 + delete param.${po.fieldName}Range + + + return filterObj(param) + }, + getSuperFieldList () { <#include "/common/utils.ftl"> const fieldList = []