Commit d2aee55ed256d3b9a01bb220223fe49cf0768e8d

Authored by YunaiV
1 parent 2aecdbf0

代码生成:增加主子表 inner 模式的示例

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