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
78 lines
1.8 KiB
TypeScript
78 lines
1.8 KiB
TypeScript
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: 'IconPicker',
|
|
componentProps: {
|
|
placeholder: '请输入菜单图标',
|
|
},
|
|
fieldName: 'icon',
|
|
label: '菜单图标',
|
|
defaultValue: '',
|
|
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,
|
|
};
|