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
57 lines
1.3 KiB
TypeScript
57 lines
1.3 KiB
TypeScript
import type { VbenFormProps } from '#/adapter/form';
|
|
|
|
import { getRoleOption } from '#/views/system/role/api';
|
|
|
|
export const formOptions: VbenFormProps = {
|
|
// 默认展开
|
|
collapsed: false,
|
|
schema: [
|
|
{
|
|
component: 'VbenInput',
|
|
componentProps: {
|
|
placeholder: '输入名称',
|
|
},
|
|
defaultValue: '',
|
|
fieldName: 'nick_name',
|
|
label: '管理员名称',
|
|
},
|
|
{
|
|
component: 'VbenInput',
|
|
componentProps: {
|
|
placeholder: '输入手机号码',
|
|
},
|
|
defaultValue: '',
|
|
fieldName: 'phone',
|
|
label: '手机号码',
|
|
},
|
|
{
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
allowClear: true,
|
|
filterOption: true,
|
|
showSearch: true,
|
|
// 菜单接口转options格式
|
|
afterFetch: (data: { id: number; name: string }[]) => {
|
|
return data.map((item: any) => ({
|
|
label: item.name,
|
|
value: item.id,
|
|
}));
|
|
},
|
|
api: getRoleOption,
|
|
placeholder: '请选择',
|
|
},
|
|
fieldName: 'role_id',
|
|
label: '角色',
|
|
},
|
|
],
|
|
// 控制表单是否显示折叠按钮
|
|
showCollapseButton: true,
|
|
submitButtonOptions: {
|
|
content: '查询',
|
|
},
|
|
// 是否在字段值改变时提交表单
|
|
submitOnChange: true,
|
|
// 按下回车时是否提交表单
|
|
submitOnEnter: false,
|
|
};
|