diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/api.ts.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/api.ts.vm index 69da81493..7d13b5dec 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/api.ts.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/api.ts.vm @@ -1,35 +1,35 @@ import { useAxios } from '@/hooks/web/useAxios' -import { ${simpleClassName}VO,${simpleClassName}PageReqVO,${simpleClassName}ExcelReqVO } from './types' +import { ${simpleClassName}VO, ${simpleClassName}PageReqVO, ${simpleClassName}ExcelReqVO } from './types' const request = useAxios() #set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}") // 查询${table.classComment}列表 export const get${simpleClassName}PageApi = async (params: ${simpleClassName}PageReqVO) => { - return await request.get({ url: '${baseURL}/page', params }) + return await request.get({ url: '${baseURL}/page', params }) } // 查询${table.classComment}详情 export const get${simpleClassName}Api = async (id: number) => { - return await request.get({ url: '${baseURL}/get?id=' + id }) + return await request.get({ url: '${baseURL}/get?id=' + id }) } // 新增${table.classComment} export const create${simpleClassName}Api = async (data: ${simpleClassName}VO) => { - return await request.post({ url: '${baseURL}/create', data }) + return await request.post({ url: '${baseURL}/create', data }) } // 修改${table.classComment} export const update${simpleClassName}Api = async (data: ${simpleClassName}VO) => { - return await request.put({ url: '${baseURL}/update', data }) + return await request.put({ url: '${baseURL}/update', data }) } // 删除${table.classComment} export const delete${simpleClassName}Api = async (id: number) => { - return await request.delete({ url: '${baseURL}/delete?id=' + id }) + return await request.delete({ url: '${baseURL}/delete?id=' + id }) } // 导出${table.classComment} Excel export const export${simpleClassName}Api = async (params: ${simpleClassName}ExcelReqVO) => { - return await request.download({ url: '${baseURL}/export-excel', params }) + return await request.download({ url: '${baseURL}/export-excel', params }) } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/types.ts.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/types.ts.vm index d5b5d937d..54ab47e02 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/types.ts.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/api/types.ts.vm @@ -2,9 +2,11 @@ export type ${simpleClassName}VO = { #foreach ($column in $columns) #if ($column.createOperation || $column.updateOperation) #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer") - ${column.javaField}: number + ${column.javaField}: number +#elseif(${column.javaType.toLowerCase()} == "date") + ${column.javaField}: string #else - ${column.javaField}: ${column.javaType.toLowerCase()} + ${column.javaField}: ${column.javaType.toLowerCase()} #end #end #end @@ -14,9 +16,11 @@ export type ${simpleClassName}PageReqVO = { #foreach ($column in $columns) #if (${column.listOperation})##查询操作 #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer") - ${column.javaField}: number + ${column.javaField}: number +#elseif(${column.javaType.toLowerCase()} == "date") + ${column.javaField}: string #else - ${column.javaField}: ${column.javaType.toLowerCase()} + ${column.javaField}: ${column.javaType.toLowerCase()} #end #end #end @@ -26,9 +30,11 @@ export type ${simpleClassName}ExcelReqVO = { #foreach ($column in $columns) #if (${column.listOperation})##查询操作 #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer") - ${column.javaField}: number + ${column.javaField}: number +#elseif(${column.javaType.toLowerCase()} == "date") + ${column.javaField}: string #else - ${column.javaField}: ${column.javaType.toLowerCase()} + ${column.javaField}: ${column.javaType.toLowerCase()} #end #end #end diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/data.ts.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/data.ts.vm index 965fe49ab..fa64bc883 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/data.ts.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/data.ts.vm @@ -8,104 +8,104 @@ export const rules = reactive({ #foreach ($column in $columns) #if (($column.createOperation || $column.updateOperation) && !$column.nullable && !${column.primaryKey})## 创建或者更新操作 && 要求非空 && 非主键 #set($comment=$column.columnComment) - $column.javaField: [{ required: true, message: "${comment}不能为空", trigger: #if($column.htmlType == "select")"change"#else"blur"#end }], + $column.javaField: [{ required: true, message: '${comment}不能为空', trigger: #if($column.htmlType == "select")'change'#else'blur'#end }], #end #end }) // CrudSchema const crudSchemas = reactive([ #foreach($column in $columns) - #if ($column.listOperation || $column.listOperationResult || $column.createOperation || $column.updateOperation) - #set ($dictType = $column.dictType) - { - label: '${column.columnComment}', - field: '${column.javaField}', - #if ("" != $dictType)## 有数据字典 - dictType: DICT_TYPE.$dictType.toUpperCase(), - #end - #if($column.primaryKey) - type: 'index', - form: { - show: false - }, - detail: { - show: false + #if ($column.listOperation || $column.listOperationResult || $column.createOperation || $column.updateOperation) + #set ($dictType = $column.dictType) + { + label: '${column.columnComment}', + field: '${column.javaField}', + #if ("" != $dictType)## 有数据字典 + dictType: DICT_TYPE.$dictType.toUpperCase(), + #end + #if($column.primaryKey) + type: 'index', + form: { + show: false + }, + detail: { + show: false + } + #else + #if (!$column.createOperation && !$column.updateOperation) + form: { + show: false + }, + #elseif(!("" != $column.dictType)) + form: { + show: true, + #if ($column.htmlType == "datetime")## 时间框 + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'YYYY-MM-DD HH:mm:ss' } - #else - #if (!$column.createOperation && !$column.updateOperation) - form: { - false + #elseif($column.htmlType == "editor")## 文本编辑器 + component: 'Editor', + colProps: { + span: 24 }, - #elseif(!("" != $column.dictType)) - form: { - show: true, - #if ($column.htmlType == "datetime")## 时间框 - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'YYYY-MM-DD HH:mm:ss' - } - #elseif($column.htmlType == "editor")## 文本编辑器 - component: 'Editor', - colProps: { - span: 24 - }, - componentProps: { - valueHtml: '' - } - #elseif($column.htmlType == "textarea")## 文本框 - component: 'Input', - componentProps: { - type: 'textarea', - rows: 4 - }, - colProps: { - span: 24 - } - #end - }, - #end - #if ($column.listOperationResult) - search: { - #if($column.htmlType == "input") - show: true - #else - #if($column.htmlType == "datetime") - show: true, - component: 'DatePicker', - componentProps: { - type: 'datetimerange', - valueFormat: 'YYYY-MM-DD HH:mm:ss' - } - #elseif($column.htmlType == "select" || $column.htmlType == "radio") - #if ("" == $dictType)## 没有数据字典 - show: true, - component: 'Select', - componentProps: { - option: [{'','请选择字典生成'}] - } - #else - show: true - #end - #end - #end + componentProps: { + valueHtml: '' + } + #elseif($column.htmlType == "textarea")## 文本框 + component: 'Input', + componentProps: { + type: 'textarea', + rows: 4 + }, + colProps: { + span: 24 } - #end #end }, #end -#end - { - label: t('table.action'), - field: 'action', - width: '240px', - form: { - show: false - }, - detail: { - show: false - } + #if ($column.listOperationResult) + search: { + #if($column.htmlType == "input") + show: true + #else + #if($column.htmlType == "datetime") + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss' + } + #elseif($column.htmlType == "select" || $column.htmlType == "radio") + #if ("" == $dictType)## 没有数据字典 + show: true, + component: 'Select', + componentProps: { + option: [{'','请选择字典生成'}] + } + #else + show: true + #end + #end + #end } + #end + #end + }, + #end +#end + { + label: t('table.action'), + field: 'action', + width: '240px', + form: { + show: false + }, + detail: { + show: false + } + } ]) export const { allSchemas } = useCrudSchemas(crudSchemas) \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm index ca4adc1a6..7a050b8bb 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm @@ -1,92 +1,92 @@