Skip to content

Commit e0a7cfd

Browse files
committed
fix(generator): 代码生成详情页模板增加对字典字段的翻译处理
Closes #ICGQVB
1 parent ca320c7 commit e0a7cfd

File tree

1 file changed

+11
-0
lines changed
  • continew-plugin/continew-plugin-generator/src/main/resources/templates/frontend

1 file changed

+11
-0
lines changed

continew-plugin/continew-plugin-generator/src/main/resources/templates/frontend/DetailDrawer.ftl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
<a-drawer v-model:visible="visible" title="${businessName}详情" :width="width >= 600 ? 600 : '100%'" :footer="false">
33
<a-descriptions :column="2" size="large" class="general-description">
44
<#list fieldConfigs as fieldConfig>
5+
<#if fieldConfig.dictCode?? && fieldConfig.dictCode != "">
6+
<a-descriptions-item label="${fieldConfig.comment}">
7+
<GiCellTag :value="dataDetail?.${fieldConfig.fieldName}" :dict="${fieldConfig.dictCode}" />
8+
</a-descriptions-item>
9+
<#else>
510
<a-descriptions-item label="${fieldConfig.comment}">{{ dataDetail?.${fieldConfig.fieldName} }}</a-descriptions-item>
11+
</#if>
612
<#if fieldConfig.fieldName = 'createUser'>
713
<a-descriptions-item label="创建人">{{ dataDetail?.createUserString }}</a-descriptions-item>
814
<#elseif fieldConfig.fieldName = 'updateUser'>
@@ -16,6 +22,11 @@
1622
<script setup lang="ts">
1723
import { useWindowSize } from '@vueuse/core'
1824
import { type ${classNamePrefix}DetailResp, get${classNamePrefix} as getDetail } from '@/apis/${apiModuleName}/${apiName}'
25+
import { useDict } from '@/hooks/app'
26+
27+
<#if hasDictField>
28+
const { <#list dictCodes as dictCode>${dictCode}<#if dictCode_has_next>,</#if></#list> } = useDict(<#list dictCodes as dictCode>'${dictCode}'<#if dictCode_has_next>,</#if></#list>)
29+
</#if>
1930
2031
const { width } = useWindowSize()
2132

0 commit comments

Comments
 (0)