| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import { DescItem } from '/@/components/Description';
- import { BasicColumn, FormSchema } from '/@/components/Table';
- import { validateStr } from '/@/utils/validate';
- export const columns: BasicColumn[] = [
- {
- title: '门户编码',
- dataIndex: 'code',
- },
- {
- title: '门户名称',
- dataIndex: 'name',
- },
- {
- title: '门户类型',
- dataIndex: 'type',
- },
- ];
- // 表单列定义
- export const searchFormSchema: FormSchema[] = [
- {
- label: '门户编码',
- field: 'code',
- component: 'Input',
- componentProps: {
- placeholder: '请输入门户编码',
- },
- },
- {
- label: '门户名称',
- field: 'name',
- component: 'Input',
- componentProps: {
- placeholder: '请输入门户名称',
- },
- },
- ];
- // 表单新增编辑
- export const dataFormSchema: FormSchema[] = [
- {
- label: '门户编码',
- field: 'code',
- component: 'Input',
- componentProps: {
- placeholder: '请输入门户编码',
- },
- dynamicRules: () => {
- return [
- {
- required: true,
- validator: async (_, value) => {
- if (!value) {
- return Promise.reject('门户编码不能为空');
- }
- if (validateStr(value)) {
- return Promise.reject('门户编码为字母或数字组成');
- }
- return Promise.resolve();
- },
- },
- ];
- },
- },
- {
- label: '门户名称',
- field: 'name',
- required: true,
- component: 'Input',
- componentProps: {
- placeholder: '请输入门户名称',
- },
- },
- {
- label: '备注',
- field: 'remark',
- component: 'InputTextArea',
- componentProps: {
- placeholder: '请输入备注',
- },
- },
- ];
- // 表单详情查看
- export const viewSchema: DescItem[] = [
- {
- label: '门户编码',
- field: 'code',
- },
- {
- label: '门户名称',
- field: 'name',
- },
- {
- label: '门户类型',
- field: 'type',
- },
- {
- label: '备注',
- field: 'remark',
- },
- ];
|