chore: 优化代码生成模板

This commit is contained in:
Charles7c 2024-05-02 20:24:33 +08:00
parent dc9273132d
commit def831f2dc
2 changed files with 5 additions and 3 deletions

View File

@ -22,7 +22,7 @@ export interface ${classNamePrefix}DetailResp {
updateUserString: string
</#if>
}
export interface ${classNamePrefix}Query extends PageQuery {
export interface ${classNamePrefix}Query {
<#if fieldConfigs??>
<#list fieldConfigs as fieldConfig>
<#if fieldConfig.showInQuery>
@ -30,10 +30,12 @@ export interface ${classNamePrefix}Query extends PageQuery {
</#if>
</#list>
</#if>
sort: Array<string>
}
export interface ${classNamePrefix}PageQuery extends ${classNamePrefix}Query, PageQuery {}
/** @desc 查询${businessName}列表 */
export function list${classNamePrefix}(query: ${classNamePrefix}Query) {
export function list${classNamePrefix}(query: ${classNamePrefix}PageQuery) {
return http.get<PageRes<${classNamePrefix}Resp[]>>(`${'$'}{BASE_URL}`, query)
}

View File

@ -88,7 +88,7 @@ const columns: TableInstanceColumns[] = [
}
]
const queryForm: ${classNamePrefix}Query = reactive({
const queryForm = reactive<${classNamePrefix}Query>({
<#list fieldConfigs as fieldConfig>
<#if fieldConfig.showInQuery>
${fieldConfig.fieldName}: undefined,