import type { VbenFormProps } from '#/adapter/form';


// 门店信息录入表单配置
export const modalFormProps: VbenFormProps = {
  wrapperClass: 'grid-cols-12',
  commonConfig: {
    formItemClass: 'col-span-12',
    componentProps: {
      class: 'w-full',
    },
  },
  layout: 'horizontal',
  schema: [
    {
      component: 'VbenInput',
      fieldName: 'id',
      label: 'ID',
      formItemClass: 'col-span-6',
      dependencies: {
        show: false,
        triggerFields: ['id'],
      },
    },
    {
      component: 'Divider',
      fieldName: '',
      label: '',
      rules: 'required',
      hideLabel: true,
      renderComponentContent: () => {
        return {
          default: () => {
            return '基础信息';
          },
        };
      },
    },
    {
      component: 'Avatar',
      formItemClass: 'col-span-6',
      fieldName: 'see_rate',
      label: '公章',
    },
    {
      component: 'VbenInput',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入门店名称',
      },
      fieldName: 'name',
      label: '门店名称',
      rules: 'required',
    },
    {
      component: 'VbenInput',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入ERP ID',
      },
      fieldName: 'erp_id',
      label: 'ERP ID',
    },
    {
      component: 'RadioGroup',
      formItemClass: 'col-span-6',
      componentProps: {
        options: [
          { label: '诊所', value: 0 },
          { label: '药店', value: 1 },
        ],
      },
      fieldName: 'type',
      label: '门店类型',
      rules: 'required',
      defaultValue: 0,
    },
    {
      component: 'RadioGroup',
      formItemClass: 'col-span-6',
      componentProps: {
        options: [
          { label: '不包邮', value: 0 },
          { label: '包邮', value: 1 },
        ],
        placeholder: '是否包邮',
      },
      fieldName: 'is_shipping_free',
      label: '是否包邮',
      rules: 'required',
    },
    {
      component: 'RadioGroup',
      formItemClass: 'col-span-6',
      componentProps: {
        options: [
          { label: '西医诊所', value: 1 },
          { label: '中医诊所', value: 2 },
        ],
        placeholder: '诊所类型',
      },
      fieldName: 'clinic_type',
      label: '诊所类型',
      rules: 'required',
      defaultValue: 2,
    },
    {
      component: 'RadioGroup',
      formItemClass: 'col-span-6',
      componentProps: {
        options: [
          { label: '订阅价格波动', value: 0 },
          { label: '不订阅价格波动', value: 1 },
        ],
        placeholder: '是否订阅价格波动',
      },
      fieldName: 'subscribe_price_change',
      label: '是否订阅价格波动',
      defaultValue: 0,
      rules: 'required',
    },
    {
      component: 'VbenInput',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入联系人姓名',
      },
      fieldName: 'contact',
      label: '联系人姓名',
      rules: 'required',
    },
    {
      component: 'VbenInput',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入联系人手机号',
      },
      fieldName: 'mobile',
      label: '联系人手机号',
      rules: 'required',
    },
    {
      component: 'PromoterPicker',
      formItemClass: 'col-span-6',
      fieldName: 'code',
      label: '业务员',
      rules: 'required',
    },
    {
      component: 'TimePicker',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请选择开始营业时间',
        format: 'HH:mm',
      },
      fieldName: 'start_time',
      label: '开始营业时间',
      rules: 'required',
    },
    {
      component: 'TimePicker',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请选择结束营业时间',
        format: 'HH:mm',
      },
      fieldName: 'end_time',
      label: '结束营业时间',
      rules: 'required',
    },
    {
      component: 'RegionAddressPicker',
      fieldName: 'address',
      label: '省市区',
      rules: 'required',
    },
    {
      component: 'Textarea',
      componentProps: {
        placeholder: '请输入详细地址',
      },
      fieldName: 'position',
      label: '详细地址',
      rules: 'required',
    },
    {
      component: 'UploadImage',
      fieldName: 'url',
      label: '轮播图',
      rules: 'required',
      componentProps: {
        maxCount: 9,
      },
    },
    {
      component: 'UploadImage',
      fieldName: 'contract_files',
      label: '合同文件',
      componentProps: {
        maxCount: 10,
        accept: '.pdf,.doc,.docx,.jpg,.jpeg,.png',
      },
    },
    {
      component: 'Divider',
      fieldName: '',
      label: 'x',
      rules: 'required',
      hideLabel: true,
      renderComponentContent: () => {
        return {
          default: () => {
            return '销售比例信息';
          },
        };
      },
    },
    {
      component: 'InputNumber',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入中药采购价比例',
      },
      fieldName: 'z_buy_percent',
      label: '中药采购价比例',
      rules: 'required',
      suffix: () => '%',
      defaultValue: 100,
    },
    {
      component: 'InputNumber',
      formItemClass: 'col-span-6',
      componentProps: {
        placeholder: '请输入中药销售比例',
      },
      fieldName: 'z_sale_percent',
      label: '中药销售比例',
      rules: 'required',
      suffix: () => '%',
      defaultValue: 100,
    },
  ],
  showDefaultActions: false,
};
