diff --git a/gen/api.ts.ftl b/gen/api.ts.ftl index 62c1ae2c..89e61be5 100644 --- a/gen/api.ts.ftl +++ b/gen/api.ts.ftl @@ -1,5 +1,7 @@ import type { ${BusinessName}Form, ${BusinessName}Query, ${BusinessName}VO } from '@/api/${moduleName}/${businessName}/types'; +<#if !table.tree> import type { PageResult } from '@/api/types'; + import type { AxiosPromise } from '@/utils/api-types'; import request from '@/utils/request'; @@ -9,7 +11,7 @@ import request from '@/utils/request'; * @returns {*} */ -export const list${BusinessName} = (query?: ${BusinessName}Query): AxiosPromise> => { +export const list${BusinessName} = (query?: ${BusinessName}Query): AxiosPromise<<#if table.tree>${BusinessName}VO[]<#else>PageResult<${BusinessName}VO>> => { return request({ url: '/${moduleName}/${businessName}/list', method: 'get', @@ -100,4 +102,3 @@ export const del${BusinessName} = (${pkColumn.javaField}: string | number | Arra }; - diff --git a/gen/index-tree.vue.ftl b/gen/index-tree.vue.ftl index cbceb9cb..3f7e0955 100644 --- a/gen/index-tree.vue.ftl +++ b/gen/index-tree.vue.ftl @@ -45,7 +45,7 @@ -<#elseif (column.htmlType == "select" || column.htmlType == "radio") && column.dictType?has_content> +<#elseif (column.htmlType == "select" || column.htmlType == "radio") && !(column.dictType?has_content)> @@ -312,7 +312,7 @@ > -<#elseif column.htmlType == "select" && column.dictType?has_content> +<#elseif column.htmlType == "select" && !(column.dictType?has_content)> @@ -329,7 +329,7 @@ -<#elseif column.htmlType == "checkbox" && column.dictType?has_content> +<#elseif column.htmlType == "checkbox" && !(column.dictType?has_content)> 请选择字典生成 @@ -349,7 +349,7 @@ >{{dict.label}} -<#elseif column.htmlType == "radio" && column.dictType?has_content> +<#elseif column.htmlType == "radio" && !(column.dictType?has_content)> 请选择字典生成 @@ -689,4 +689,3 @@ onMounted(() => { getList(); }); - diff --git a/gen/index.vue.ftl b/gen/index.vue.ftl index 9bacf6fd..59df6cc5 100644 --- a/gen/index.vue.ftl +++ b/gen/index.vue.ftl @@ -45,7 +45,7 @@ -<#elseif (column.htmlType == "select" || column.htmlType == "radio") && column.dictType?has_content> +<#elseif (column.htmlType == "select" || column.htmlType == "radio") && !(column.dictType?has_content)> @@ -60,7 +60,7 @@ placeholder="请选择${column.columnLabel}" /> -<#elseif column.htmlType == "datetime" && column.queryType == "BETWEEN"> +<#elseif column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query> <#list columns as column> -<#if (column.insert || column.edit) && !column.pk>`n<#if column.htmlType == "input"> +<#if (column.insert || column.edit) && !column.pk> +<#if column.htmlType == "input"> @@ -268,7 +269,7 @@ > -<#elseif column.htmlType == "select" && column.dictType?has_content> +<#elseif column.htmlType == "select" && !(column.dictType?has_content)> @@ -285,7 +286,7 @@ -<#elseif column.htmlType == "checkbox" && column.dictType?has_content> +<#elseif column.htmlType == "checkbox" && !(column.dictType?has_content)> 请选择字典生成 @@ -305,7 +306,7 @@ >{{dict.label}} -<#elseif column.htmlType == "radio" && column.dictType?has_content> +<#elseif column.htmlType == "radio" && !(column.dictType?has_content)> 请选择字典生成 @@ -380,6 +381,9 @@ import { useTableSelection } from '@/hooks/table/useTableSelection'; <#if needDict> import { useDict } from '@/utils/dict'; +<#if needParseTime> +import { parseTime } from '@/utils/ruoyi'; + import modal from '@/plugins/modal'; <#if enableExport> import { download as requestDownload } from '@/utils/request'; @@ -400,7 +404,7 @@ const { loading, withLoading } = useLoading(true); const { showSearch } = useSearchToggle(); const total = ref(0); <#list columns as column> -<#if column.htmlType == "datetime" && column.queryType == "BETWEEN"> +<#if column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query> const { dateRange: dateRange${column.capJavaField}, applyDateRange: apply${column.capJavaField}DateRange, @@ -472,7 +476,7 @@ const getList = async () => { <#if needAddDateRange> let params = queryParams.value; <#list columns as column> -<#if column.htmlType == "datetime" && column.queryType == "BETWEEN"> +<#if column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query> params = apply${column.capJavaField}DateRange(params); @@ -505,7 +509,7 @@ const { resetQuery } = useSearchReset({ initialPageSize: 10, resetExtras: () => { <#list columns as column> -<#if column.htmlType == "datetime" && column.queryType == "BETWEEN"> +<#if column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query> reset${column.capJavaField}DateRange(); @@ -565,8 +569,8 @@ const handleDelete = async (row?: Partial<${BusinessName}VO>) => { await getList(); }; -/** 导出按钮操作 */ <#if enableExport> +/** 导出按钮操作 */ const handleExport = () => { requestDownload( '${moduleName}/${businessName}/export',