mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-09-10 23:21:58 +08:00
代码生成:主子表(inner)部分模版
This commit is contained in:
@@ -69,6 +69,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, getStrDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${table.businessName}'
|
||||
const props = defineProps<{
|
||||
${subJoinColumn.javaField}: undefined // ${subJoinColumn.columnComment}(主表的关联字段)
|
||||
}>()
|
||||
@@ -79,15 +81,18 @@ const list = ref([]) // 列表的数据
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
#if ( $subTable.subJoinMany )
|
||||
formData.value = await ${simpleClassName}Api.get${subSimpleClassName}ListBy${SubJoinColumnName}(val)
|
||||
#else
|
||||
const data = await ${simpleClassName}Api.get${subSimpleClassName}By${SubJoinColumnName}(val)
|
||||
if (!data) {
|
||||
return
|
||||
}
|
||||
formData.value = data
|
||||
#end
|
||||
#if ($table.templateType == 11)
|
||||
#else
|
||||
#if ( $subTable.subJoinMany )
|
||||
list.value = await ${simpleClassName}Api.get${subSimpleClassName}ListBy${SubJoinColumnName}(${subJoinColumn.javaField}.props)
|
||||
#else
|
||||
const data = await ${simpleClassName}Api.get${subSimpleClassName}By${SubJoinColumnName}(${subJoinColumn.javaField}.props)
|
||||
if (!data) {
|
||||
return
|
||||
}
|
||||
list.value.push(data)
|
||||
#end
|
||||
#end
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
Reference in New Issue
Block a user