import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';

export const searchFormSchema: FormSchema[] = [
  // {
  //   field: 'setupType',
  //   label: '类型',
  //   component: 'XjrSelect',
  //   componentProps: {
  //     datasourceType: 'staticData',
  //     staticOptions: [
  //       { key: 1, label: '项目类型', value: '1' },
  //       { key: 2, label: '项目阶段', value: '2' },
  //       { key: 3, label: '项目状态', value: '3' },
  //       { key: 4, label: '项目来源', value: '4' },
  //     ],
  //     labelField: 'label',
  //     valueField: 'value',

  //     getPopupContainer: () => document.body,
  //   },
  //   colProps: { span: 8 },
  // },
  {
    field: 'state',
    label: '状态',
    component: 'Select',
    componentProps: {
      getPopupContainer: () => document.body,
      options: [
        {
          label: '开',
          value: 1,
        },
        {
          label: '关',
          value: 0,
        },
      ],
    },
    colProps: { span: 8 },
  },
  {
    field: 'name',
    label: '名称',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const columns: BasicColumn[] = [
  // {
  //   dataIndex: 'setupType',
  //   title: '类型',
  //   componentType: 'select',

  //   customRender: ({ record }) => {
  //     const staticOptions = [
  //       { key: 1, label: '项目类型', value: '1' },
  //       { key: 2, label: '项目阶段', value: '2' },
  //       { key: 3, label: '项目状态', value: '3' },
  //       { key: 4, label: '项目来源', value: '4' },
  //     ];
  //     return staticOptions.filter((x) => x.value === record.setupType)[0].label;
  //   },
  //   sorter: true,
  // },

  {
    dataIndex: 'name',
    title: '项目类型名称',
    componentType: 'input',

    sorter: true,
  },

  {
    dataIndex: 'state',
    title: '状态',
    componentType: 'switch',

    sorter: true,
  },

  {
    dataIndex: 'remark',
    title: '备注',
    componentType: 'textarea',

    sorter: true,
  },

  {
    dataIndex: 'createUserId',
    title: '创建人',
    componentType: 'info',

    sorter: true,
  },

  {
    dataIndex: 'createDate',
    title: '创建时间',
    componentType: 'info',

    sorter: true,
  },
];
export const columns2: BasicColumn[] = [
  {
    dataIndex: 'name',
    title: '项目阶段名称',
    componentType: 'input',

    sorter: true,
  },

  {
    dataIndex: 'state',
    title: '状态',
    componentType: 'switch',

    sorter: true,
  },

  {
    dataIndex: 'createUserId',
    title: '创建人',
    componentType: 'info',

    sorter: true,
  },

  {
    dataIndex: 'createDate',
    title: '创建时间',
    componentType: 'info',

    sorter: true,
  },
];
export const columns3: BasicColumn[] = [
  {
    dataIndex: 'name',
    title: '项目状态名称',
    componentType: 'input',

    sorter: true,
  },

  {
    dataIndex: 'state',
    title: '状态',
    componentType: 'switch',

    sorter: true,
  },

  {
    dataIndex: 'createUserId',
    title: '创建人',
    componentType: 'info',

    sorter: true,
  },

  {
    dataIndex: 'createDate',
    title: '创建时间',
    componentType: 'info',

    sorter: true,
  },
];
export const columns4: BasicColumn[] = [
  {
    dataIndex: 'name',
    title: '项目来源名称',
    componentType: 'input',

    sorter: true,
  },

  {
    dataIndex: 'state',
    title: '状态',
    componentType: 'switch',

    sorter: true,
  },

  {
    dataIndex: 'createUserId',
    title: '创建人',
    componentType: 'info',

    sorter: true,
  },

  {
    dataIndex: 'createDate',
    title: '创建时间',
    componentType: 'info',

    sorter: true,
  },
];

export const formProps: FormProps = {
  // labelCol: { offset: 0, span: 3 },
  labelWidth: 120,
  labelAlign: 'right',
  layout: 'horizontal',
  size: 'default',
  schemas: [
    // {
    //   key: 'f01e68f60c094abc8236931f757c424b',
    //   field: 'setupType',
    //   label: '类型',
    //   type: 'select',
    //   component: 'XjrSelect',
    //   colProps: { span: 24 },
    //   componentProps: {
    //     width: '100%',
    //     span: '',
    //     placeholder: '请选择',
    //     showLabel: true,
    //     showSearch: false,
    //     clearable: false,
    //     disabled: false,
    //     staticOptions: [
    //       { key: 1, label: '项目类型', value: '1' },
    //       { key: 2, label: '项目阶段', value: '2' },
    //       { key: 3, label: '项目状态', value: '3' },
    //       { key: 4, label: '项目来源', value: '4' },
    //     ],
    //     defaultSelect: '1',
    //     datasourceType: 'staticData',
    //     params: null,
    //     labelField: 'label',
    //     valueField: 'value',
    //     apiConfig: {},
    //     dicOptions: [],
    //     required: false,
    //     rules: [],
    //     events: {},
    //     style: { width: '100%' },
    //   },
    // },
    {
      key: 'd5ccc8ba7bc84b8aa6be63e18658dc3d',
      field: 'name',
      label: '名称',
      type: 'input',
      component: 'Input',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        defaultValue: '',
        prefix: '',
        rules: [],
        suffix: '',
        addonAfter: '',
        showLabel: true,
        required: true,
        width: '100%',
        disabled: false,
        placeholder: '项目名称请输入',
        allowClear: false,
        addonBefore: '',
        events: {},
        span: '',
        style: { width: '100%' },
      },
    },
    {
      key: '849f269673d84e8fa72cc3a66db6ab0e',
      field: 'sort',
      label: '类型排序',
      type: 'number',
      component: 'InputNumber',
      colProps: { span: 24 },
      defaultValue: 0,
      componentProps: {
        width: '100%',
        span: '',
        defaultValue: 0,
        min: 0,
        //max: 100,
        step: 1,
        maxlength: null,
        disabled: false,
        showLabel: true,
        controls: true,
        required: false,
        subTotal: false,
        rules: [],
        events: {},
        style: { width: '100%' },
      },
    },
    {
      key: '71e657d0893544e8947a28ef9d3f56ed',
      field: 'state',
      label: '状态',
      type: 'switch',
      component: 'Switch',
      colProps: { span: 24 },
      defaultValue: 1,
      componentProps: {
        defaultValue: 1,
        unCheckedChildren: '',
        unCheckedColor: '#bbbdbf',
        checkedChildren: '',
        showLabel: true,
        checkedColor: '#5e95ff',
        disabled: false,
        events: {},
        span: '',
        style: {},
      },
    },
    {
      key: '2b3701ac84d04b0fae00fd6afde6fd54',
      field: 'remark',
      label: '备注',
      type: 'textarea',
      component: 'InputTextArea',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        width: '100%',
        span: '',
        defaultValue: '',
        placeholder: '请输入备注',
        maxlength: 200,
        rows: 4,
        autoSize: false,
        showCount: false,
        disabled: false,
        showLabel: true,
        allowClear: false,
        required: false,
        rules: [],
        events: {},
        style: { width: '100%' },
      },
    },
    // {
    //   key: '2d20943203ab4a15a5a69999752473f4',
    //   field: 'createUserId',
    //   label: '创建人',
    //   type: 'info',
    //   component: 'Info',
    //   colProps: { span: 24 },
    //   componentProps: {
    //     showLabel: true,
    //     infoType: 0,
    //     width: '100%',
    //     disabled: true,
    //     placeholder: '',
    //     loadAgain: false,
    //     span: '',
    //     style: { width: '100%' },
    //   },
    // },
    // {
    //   key: 'b0a36d706db1482289b6a949e9ff1352',
    //   field: 'createDate',
    //   label: '创建时间',
    //   type: 'info',
    //   component: 'Info',
    //   colProps: { span: 24 },
    //   componentProps: {
    //     showLabel: true,
    //     infoType: 2,
    //     width: '100%',
    //     disabled: true,
    //     placeholder: '',
    //     loadAgain: false,
    //     span: '',
    //     style: { width: '100%' },
    //   },
    // },
  ],
  showActionButtonGroup: false,
  buttonLocation: 'center',
  actionColOptions: { span: 24 },
  showResetButton: false,
  showSubmitButton: false,
  hiddenComponent: [],
};
