import type { FormSchema } from '/@/components/Form/index';
export const schemas: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: '平台名称',
    colProps: {
      span: 24,
    },
    componentProps: {
      maxLength: 255,
      placeholder: '请输入平台名称',
    },
    dynamicRules: () => {
      return [
        {
          required: false,
          validator: (_, value) => {
            if (String(value).length > 255) {
              return Promise.reject('字数不超过255个字');
            }
            return Promise.resolve();
          },
        },
      ];
    },
  },
  {
    field: 'logo',
    component: 'Upload',
    label: 'APP Logo',
    colProps: {
      span: 24,
    },
    slot: 'logoUpload',
  },
  {
    field: 'background',
    component: 'Input',
    label: '登录页背景图片',
    colProps: {
      span: 24,
    },
    slot: 'bgUpload',
  },
  {
    field: 'backgroundColor',
    component: 'AutoComplete',
    label: '登录页背景颜色',
    colProps: {
      span: 24,
    },
    slot: 'colorInput',
  },
  {
    field: 'background',
    component: 'Input',
    label: '首页轮播图',
    colProps: {
      span: 24,
    },
    slot: 'homeSwiper',
  },
];
