Commit d2aee55ed256d3b9a01bb220223fe49cf0768e8d
1 parent
2aecdbf0
代码生成:增加主子表 inner 模式的示例
Showing
1 changed file
with
9 additions
and
3 deletions
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | <template> |
| 8 | 8 | <!-- 列表 --> |
| 9 | 9 | <ContentWrap> |
| 10 | +#if ($table.templateType == 11) | |
| 10 | 11 | <el-button |
| 11 | 12 | type="primary" |
| 12 | 13 | plain |
| ... | ... | @@ -15,6 +16,7 @@ |
| 15 | 16 | > |
| 16 | 17 | <Icon icon="ep:plus" class="mr-5px" /> 新增 |
| 17 | 18 | </el-button> |
| 19 | +#end | |
| 18 | 20 | <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
| 19 | 21 | #foreach($column in $subColumns) |
| 20 | 22 | #if ($column.listOperationResult) |
| ... | ... | @@ -22,7 +24,8 @@ |
| 22 | 24 | #set ($javaField = $column.javaField) |
| 23 | 25 | #set ($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
| 24 | 26 | #set ($comment=$column.columnComment) |
| 25 | - #if ($column.javaType == "LocalDateTime")## 时间类型 | |
| 27 | + #if ( $column.id == $subJoinColumn.id) ## 特殊:忽略主子表的 join 字段,不用填写 | |
| 28 | + #elseif ($column.javaType == "LocalDateTime")## 时间类型 | |
| 26 | 29 | <el-table-column |
| 27 | 30 | label="${comment}" |
| 28 | 31 | align="center" |
| ... | ... | @@ -74,15 +77,18 @@ |
| 74 | 77 | /> |
| 75 | 78 | #end |
| 76 | 79 | </ContentWrap> |
| 77 | - | |
| 80 | +#if ($table.templateType == 11) | |
| 78 | 81 | <!-- 表单弹窗:添加/修改 --> |
| 79 | 82 | <${subSimpleClassName}Form ref="formRef" @success="getList" /> |
| 83 | +#end | |
| 80 | 84 | </template> |
| 81 | - | |
| 82 | 85 | <script setup lang="ts"> |
| 83 | 86 | import { getIntDictOptions, getStrDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict' |
| 87 | +import { dateFormatter } from '@/utils/formatTime' | |
| 84 | 88 | import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}' |
| 89 | +#if ($table.templateType == 11) | |
| 85 | 90 | import ${subSimpleClassName}Form from './${subSimpleClassName}Form.vue' |
| 91 | +#end | |
| 86 | 92 | |
| 87 | 93 | const { t } = useI18n() // 国际化 |
| 88 | 94 | const message = useMessage() // 消息弹窗 | ... | ... |