From 5b7df709f16748b85e102248154c5154e0fe9826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Wed, 3 Jun 2026 16:15:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=20=E5=A2=9E=E5=8A=A0=E5=A4=9A?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=A8=A1=E6=9D=BF=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/tool/gen/types.ts | 2 ++ src/pages/tool/gen/components/GenInfoForm.tsx | 26 ++++++++++++++++++- src/pages/tool/gen/edit.tsx | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/api/tool/gen/types.ts b/src/api/tool/gen/types.ts index 8abca9ed..1df3215b 100644 --- a/src/api/tool/gen/types.ts +++ b/src/api/tool/gen/types.ts @@ -55,6 +55,7 @@ export interface DbTableVO extends Omit { uniqueFields?: string[]; enableSort?: boolean; sortField?: string; + frontendType?: string; treeRootValue?: string; treeAncestorsField?: string; treeOrderField?: string; @@ -79,6 +80,7 @@ export interface TableVO extends BaseEntity { tableComment?: string; className?: string; tplCategory?: string; + frontendType?: string; packageName?: string; moduleName?: string; businessName?: string; diff --git a/src/pages/tool/gen/components/GenInfoForm.tsx b/src/pages/tool/gen/components/GenInfoForm.tsx index 437a9ac7..45469c4f 100644 --- a/src/pages/tool/gen/components/GenInfoForm.tsx +++ b/src/pages/tool/gen/components/GenInfoForm.tsx @@ -1,5 +1,6 @@ import type { FormInstance } from 'antd'; -import { Col, Form, Input, Row, Select, Switch, TreeSelect } from 'antd'; +import { QuestionCircleOutlined } from '@ant-design/icons'; +import { Col, Form, Input, Radio, Row, Select, Switch, Tooltip, TreeSelect } from 'antd'; import { useMemo } from 'react'; import type { MenuVO } from '@/api/system/menu/types'; import type { DbColumnVO, DbTableVO } from '@/api/tool/gen/types'; @@ -28,6 +29,10 @@ export default function GenInfoForm({ form, columns, menuOptions }: GenInfoFormP label: `${column.columnName}:${column.columnComment || ''}`, value: column.columnName })); + const frontendTypeOptions = [ + { label: 'Vue', value: 'vue' }, + { label: 'React', value: 'react' } + ]; return ( <> @@ -42,6 +47,25 @@ export default function GenInfoForm({ form, columns, menuOptions }: GenInfoFormP /> + + + 前端模板{' '} + + + + + } + rules={[ + { required: true, message: '请选择前端模板' }, + { pattern: /^[A-Za-z0-9_-]+$/, message: '仅支持字母、数字、下划线和中划线' } + ]} + > + + + diff --git a/src/pages/tool/gen/edit.tsx b/src/pages/tool/gen/edit.tsx index d6c6d311..6abbe3f4 100644 --- a/src/pages/tool/gen/edit.tsx +++ b/src/pages/tool/gen/edit.tsx @@ -30,6 +30,7 @@ function withDefaults(info: DbTableVO): DbTableVO { uniqueFields: normalizeStringArray(info.uniqueFields), enableSort: info.enableSort ?? false, sortField: info.sortField ?? '', + frontendType: info.frontendType || 'react', treeRootValue: info.treeRootValue ?? '0', treeAncestorsField: info.treeAncestorsField ?? '', treeOrderField: info.treeOrderField ?? ''