refactor: 代码生成代码优化

This commit is contained in:
puhui999
2025-04-15 18:19:29 +08:00
parent f27774c1fc
commit 3cc9adc5b3
7 changed files with 60 additions and 89 deletions

View File

@@ -8,7 +8,11 @@ import { computed, ref, watch } from 'vue';
import { isEmpty } from '@vben/utils';
import { useGenerationInfoBaseFormSchema, useSubTableFormSchema, useTreeTableFormSchema } from '../data';
import {
useGenerationInfoBaseFormSchema,
useGenerationInfoSubTableFormSchema,
useGenerationInfoTreeFormSchema
} from '../data';
const props = defineProps<{
columns?: InfraCodegenApi.CodegenColumn[];
@@ -55,14 +59,14 @@ const [SubForm, subFormApi] = useVbenForm({
/** 更新树表信息表单 schema */
function updateTreeSchema(): void {
treeFormApi.setState({
schema: useTreeTableFormSchema(props.columns)
schema: useGenerationInfoTreeFormSchema(props.columns)
});
}
/** 更新主子表信息表单 schema */
function updateSubSchema(): void {
subFormApi.setState({
schema: useSubTableFormSchema(props.columns, tables.value)
schema: useGenerationInfoSubTableFormSchema(props.columns, tables.value)
});
}