Commit 67ed6d0a551d70ab65a88ceb3654487100545239

Authored by YunaiV
1 parent 1979084c

feat:【infra】移动端 admin uniapp 的代码生成的优化(components 调整成 modules)

yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java
... ... @@ -96,7 +96,7 @@ public class CodegenEngine {
96 96 .build();
97 97  
98 98 /**
99   - * 后端的配置模版
  99 + * 前端的配置模版
100 100 *
101 101 * key1:UI 模版的类型 {@link CodegenFrontTypeEnum#getType()}
102 102 * key2:模板在 resources 的地址
... ... @@ -141,8 +141,8 @@ public class CodegenEngine {
141 141 vue3UniappFilePath("api/${table.moduleName}/${table.businessName}/index.ts"))
142 142 .put(CodegenFrontTypeEnum.VUE3_ADMIN_UNIAPP_WOT.getType(), vue3AdminUniappTemplatePath("views/index.vue"),
143 143 vue3UniappFilePath("pages-${table.moduleName}/${table.businessName}/index.vue"))
144   - .put(CodegenFrontTypeEnum.VUE3_ADMIN_UNIAPP_WOT.getType(), vue3AdminUniappTemplatePath("components/search-form.vue"),
145   - vue3UniappFilePath("pages-${table.moduleName}/${table.businessName}/components/search-form.vue"))
  144 + .put(CodegenFrontTypeEnum.VUE3_ADMIN_UNIAPP_WOT.getType(), vue3AdminUniappTemplatePath("modules/search-form.vue"),
  145 + vue3UniappFilePath("pages-${table.moduleName}/${table.businessName}/modules/search-form.vue"))
146 146 .put(CodegenFrontTypeEnum.VUE3_ADMIN_UNIAPP_WOT.getType(), vue3AdminUniappTemplatePath("views/form/index.vue"),
147 147 vue3UniappFilePath("pages-${table.moduleName}/${table.businessName}/form/index.vue"))
148 148 .put(CodegenFrontTypeEnum.VUE3_ADMIN_UNIAPP_WOT.getType(), vue3AdminUniappTemplatePath("views/detail/index.vue"),
... ...
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/api/api.ts.vm
... ... @@ -28,6 +28,7 @@ export interface ${simpleClassName} {
28 28 #end
29 29 }
30 30  
  31 +// TODO @AI:`/system/operate-log/get?id=${id}` 类似这种
31 32 /** 获取${table.classComment}分页列表 */
32 33 export function get${simpleClassName}Page(params: PageParam) {
33 34 return http.get<PageResult<${simpleClassName}>>('/${table.moduleName}/${simpleClassName_strikeCase}/page', params)
... ... @@ -48,6 +49,7 @@ export function update${simpleClassName}(data: ${simpleClassName}) {
48 49 return http.put<boolean>('/${table.moduleName}/${simpleClassName_strikeCase}/update', data)
49 50 }
50 51  
  52 +// TODO @AI:`/system/operate-log/get?id=${id}` 类似这种
51 53 /** 删除${table.classComment} */
52 54 export function delete${simpleClassName}(id: ${primaryTsType}) {
53 55 return http.delete<boolean>('/${table.moduleName}/${simpleClassName_strikeCase}/delete?id=' + id)
... ...
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/components/search-form.vue.vm renamed to yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/modules/search-form.vue.vm
yudao-module-infra/src/main/resources/codegen/vue3_admin_uniapp/views/index.vue.vm
... ... @@ -111,7 +111,7 @@
111 111 #end
112 112 #end
113 113 #end
114   -import type { SearchFormData } from './components/search-form.vue'
  114 +import type { SearchFormData } from './modules/search-form.vue'
115 115 import type { ${simpleClassName} } from '@/api/${table.moduleName}/${table.businessName}'
116 116 import type { LoadMoreState } from '@/http/types'
117 117 import { onReachBottom } from '@dcloudio/uni-app'
... ... @@ -125,7 +125,7 @@ import { DICT_TYPE } from &#39;@/utils/constants&#39;
125 125 #if ($hasDateTime == 1)
126 126 import { formatDateTime } from '@/utils/date'
127 127 #end
128   -import SearchForm from './components/search-form.vue'
  128 +import SearchForm from './modules/search-form.vue'
129 129  
130 130 definePage({
131 131 style: {
... ...