fix: 搭建代码生成页面
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
2025-05-12 17:04:27 +08:00
parent bc3b9e1129
commit eb893e44a3
11 changed files with 765 additions and 115 deletions

View File

@@ -0,0 +1,66 @@
import type { VbenFormProps } from '#/adapter/form';
import { getMenuTreeOption } from '#/views/system/menu/api';
export const codeGenerationForm: VbenFormProps = {
wrapperClass: 'grid-cols-12', // 24栅格,
commonConfig: {
formItemClass: 'col-span-12',
// 所有表单项
componentProps: {
class: 'w-full',
},
},
// handleSubmit: onSubmit,
layout: 'horizontal',
schema: [
{
component: 'VbenInput',
componentProps: {
placeholder: '请输入类名',
},
fieldName: 'class_name',
label: '类名',
rules: 'required',
formItemClass: 'col-span-6',
},
{
component: 'VbenInput',
componentProps: {
placeholder: '请输入中文名称',
},
fieldName: 'class_comment',
label: '中文名称',
rules: 'required',
formItemClass: 'col-span-6',
},
{
component: 'InputNumber',
componentProps: {
placeholder: '请输入排序',
},
fieldName: 'sort',
label: '排序',
defaultValue: 9999,
rules: 'required',
formItemClass: 'col-span-6',
},
{
component: 'ApiTreeSelect',
// 对应组件的参数
componentProps: {
childrenField: 'children',
labelField: 'title',
valueField: 'id',
// 菜单接口
api: getMenuTreeOption,
},
defaultValue: 0,
fieldName: 'pid',
label: '父级菜单',
formItemClass: 'col-span-6',
rules: 'required',
},
],
showDefaultActions: false,
};