reactor:【infra 基础设施】调整 vben 字典重构结果

This commit is contained in:
YunaiV
2025-09-05 19:29:18 +08:00
parent 8193e9801c
commit 8170d1563f
5 changed files with 14 additions and 9 deletions

View File

@ -3,12 +3,15 @@ import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ${apiName} } from '#/api/${table.moduleName}/${table.businessName}';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
#if(${table.templateType} == 2)## 树表需要导入这些
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
import { handleTree } from '@vben/utils';
#end
import { getRangePickerDefaultProps } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [

View File

@ -11,8 +11,6 @@ import { message#if ($table.templateType == 11), Tabs#end } from 'ant-design-vue
import { useVbenForm } from '#/adapter/form';
import { create${simpleClassName}, get${simpleClassName}, update${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
import { $t } from '#/locales';
import { useFormSchema } from '../data';
## 特殊:主子表专属逻辑
#if ( $table.templateType == 10 || $table.templateType == 12 )
#foreach ($subSimpleClassName in $subSimpleClassNames)
@ -22,6 +20,8 @@ import { useFormSchema } from '../data';
#end
#end
import { useFormSchema } from '../data';
const emit = defineEmits(['success']);
const formData = ref<${apiName}.${simpleClassName}>();
const getTitle = computed(() => {

View File

@ -206,7 +206,6 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template>
<Page auto-content-height>
<FormModal @success="onRefresh" />
#if ($table.templateType == 11) ## erp情况
<div>
#end

View File

@ -3,12 +3,15 @@ import type { VbenFormSchema } from '#/adapter/form';
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { ${apiName} } from '#/api/${table.moduleName}/${table.businessName}';
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
#if(${table.templateType} == 2)## 树表需要导入这些
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
import { handleTree } from '@vben/utils';
#end
import { getRangePickerDefaultProps } from '#/utils';
/** 新增/修改的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [

View File

@ -213,17 +213,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
#if ($table.templateType == 12) ## 内嵌情况
<template #expand_content="{ row }">
<!-- 子表的表单 -->
<el-tabs v-model="subTabsName" class="mx-8">
<ElTabs v-model="subTabsName" class="mx-8">
#foreach ($subTable in $subTables)
#set ($index = $foreach.count - 1)
#set ($subClassNameVar = $subClassNameVars.get($index))
#set ($subSimpleClassName = $subSimpleClassNames.get($index))
#set ($subJoinColumn_strikeCase = $subJoinColumn_strikeCases.get($index))
<el-tab-pane name="$subClassNameVar" label="${subTable.classComment}">
<ElTabPane name="$subClassNameVar" label="${subTable.classComment}">
<${subSimpleClassName}List :${subJoinColumn_strikeCase}="row?.id" />
</el-tab-pane>
</ElTabPane>
#end
</el-tabs>
</ElTabs>
</template>
#end
<template #toolbar-tools>