import { FormProps, FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
import { uploadApi } from '/@/api/sys/upload';

export const searchFormSchema: FormSchema[] = [
  {
    field: 'jyrq',
    label: '检验日期',
    defaultValue: undefined,
    component: 'RangePicker',
    componentProps: {
      format: 'YYYY-MM-DD HH:mm:ss',
      style: { width: '100%' },
      getPopupContainer: () => document.body,
    },
  },

  {
    field: 'hjph',
    label: '合金牌号',
    defaultValue: undefined,
    component: 'Input',
  },
  {
    field: 'lch',
    label: '炉次号',
    defaultValue: undefined,
    component: 'Input',
  },
  {
    field: 'jyy',
    label: '检验员',
    defaultValue: undefined,
    component: 'User',
    componentProps: {
      suffix: 'ant-design:setting-outlined',
      placeholder: '请选择',
    },
  },

  {
    field: 'gkmc',
    label: '顾客名称',
    defaultValue: undefined,
    component: 'Input',
  },
  {
    field: 'cpms',
    label: '产品描述',
    defaultValue: undefined,
    component: 'Input',
  },
  // {
  //   field: 'gkyj',
  //   label: '顾客意见',
  //   defaultValue: undefined,
  //   component: 'Input',
  // },
];

export const columns: BasicColumn[] = [
  {
    resizable: true,
    dataIndex: 'jyrq',
    title: '检验日期',
    componentType: 'date',

    fixed: false,
    sorter: true,

    styleConfig: undefined,
    listStyle: undefined,
  },

  {
    resizable: true,
    dataIndex: 'hjph',
    title: '合金牌号',
    componentType: 'input',

    fixed: false,
    sorter: true,

    styleConfig: undefined,
    listStyle: '',
  },

  {
    resizable: true,
    dataIndex: 'lch',
    title: '炉次号',
    componentType: 'input',

    fixed: false,
    sorter: true,

    styleConfig: undefined,
    listStyle: '',
  },

  {
    resizable: true,
    dataIndex: 'jyy',
    title: '检验员',
    componentType: 'user',

    fixed: false,
    sorter: true,

    styleConfig: undefined,
    listStyle: undefined,
  },

  {
    resizable: true,
    dataIndex: 'gkmc',
    title: '顾客名称',
    componentType: 'input',

    fixed: false,
    sorter: true,

    styleConfig: undefined,
    listStyle: '',
  },

  {
    resizable: true,
    dataIndex: 'cpms',
    title: '产品描述',
    componentType: 'input',

    fixed: false,
    sorter: true,

    styleConfig: undefined,
    listStyle: '',
  },

  // {
  //   resizable: true,
  //   dataIndex: 'gkyj',
  //   title: '顾客意见',
  //   componentType: 'input',
  //
  //   fixed: false,
  //   sorter: true,
  //
  //   styleConfig: undefined,
  //   listStyle: '',
  // },
];
//表头合并配置
export const headerMergingData = [];
//表单事件
export const formEventConfigs = {
  0: [
    {
      type: 'circle',
      color: '#2774ff',
      text: '开始节点',
      icon: '#icon-kaishi',
      bgcColor: '#D8E5FF',
      isUserDefined: false,
    },
    {
      color: '#F6AB01',
      icon: '#icon-chushihua',
      text: '初始化表单',
      bgcColor: '#f9f5ea',
      isUserDefined: false,
      nodeInfo: { processEvent: [] },
    },
  ],
  1: [
    {
      color: '#B36EDB',
      icon: '#icon-shujufenxi',
      text: '获取表单数据',
      detail: '(新增无此操作)',
      bgcColor: '#F8F2FC',
      isUserDefined: false,
      nodeInfo: { processEvent: [] },
    },
  ],
  2: [
    {
      color: '#F8625C',
      icon: '#icon-jiazai',
      text: '加载表单',
      bgcColor: '#FFF1F1',
      isUserDefined: false,
      nodeInfo: { processEvent: [] },
    },
  ],
  3: [
    {
      color: '#6C6AE0',
      icon: '#icon-jsontijiao',
      text: '提交表单',
      bgcColor: '#F5F4FF',
      isUserDefined: false,
      nodeInfo: { processEvent: [] },
    },
  ],
  4: [
    {
      type: 'circle',
      color: '#F8625C',
      text: '结束节点',
      icon: '#icon-jieshuzhiliao',
      bgcColor: '#FFD6D6',
      isLast: true,
      isUserDefined: false,
    },
  ],
};
export const formProps: FormProps = {
  labelCol: { span: 3, offset: 0 },
  labelAlign: 'right',
  layout: 'horizontal',
  size: 'default',
  schemas: [
    {
      key: 'f188e9692087462aac6a522020688c2e',
      field: 'jyrq',
      label: '检验日期',
      type: 'date',
      component: 'DatePicker',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        span: '',
        defaultValue: '',
        width: '100%',
        placeholder: '请选择检验日期',
        format: 'YYYY-MM-DD HH:mm:ss',
        showLabel: true,
        allowClear: false,
        disabled: false,
        required: true,
        isShow: true,
        rules: [],
        events: {},
        isGetCurrent: false,
        tooltipConfig: { visible: false, title: '提示文本' },
        searchType: 'time',
        style: { width: '100%' },
      },
    },
    {
      key: '799a93464b4b49c6bd2909d456e7a4c8',
      field: 'hjph',
      label: '合金牌号',
      type: 'input',
      component: 'Input',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        width: '100%',
        span: '',
        defaultValue: '',
        placeholder: '请输入合金牌号',
        maxlength: null,
        prefix: '',
        suffix: '',
        addonBefore: '',
        addonAfter: '',
        disabled: false,
        allowClear: false,
        showLabel: true,
        required: true,
        rules: [],
        events: {},
        listStyle: '',
        isSave: false,
        isShow: true,
        scan: false,
        bordered: true,
        isShowAi: false,
        tooltipConfig: { visible: false, title: '提示文本' },
        style: { width: '100%' },
      },
    },
    {
      key: '201aed5bcd0e40babdb96ab36de532a7',
      field: 'lch',
      label: '炉次号',
      type: 'input',
      component: 'Input',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        width: '100%',
        span: '',
        defaultValue: '',
        placeholder: '请输入炉次号',
        maxlength: null,
        prefix: '',
        suffix: '',
        addonBefore: '',
        addonAfter: '',
        disabled: false,
        allowClear: false,
        showLabel: true,
        required: true,
        rules: [],
        events: {},
        listStyle: '',
        isSave: false,
        isShow: true,
        scan: false,
        bordered: true,
        isShowAi: false,
        tooltipConfig: { visible: false, title: '提示文本' },
        style: { width: '100%' },
      },
    },
    {
      key: '363aba04d8ba4b02949fbebbf583bcfb',
      field: 'jyy',
      label: '检验员',
      type: 'user',
      component: 'User',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        span: '',
        width: '100%',
        defaultValue: '',
        placeholder: '请选择人员',
        userType: 0,
        prefix: '',
        suffix: 'ant-design:setting-outlined',
        showLabel: true,
        disabled: false,
        required: true,
        multiple: true,
        isShow: true,
        events: {},
        tooltipConfig: { visible: false, title: '提示文本' },
        style: { width: '100%' },
      },
    },
    {
      key: '0d94de8ad3534799929c749459c66718',
      field: 'gkmc',
      label: '顾客名称',
      type: 'input',
      component: 'Input',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        width: '100%',
        span: '',
        defaultValue: '',
        placeholder: '请输入顾客名称',
        maxlength: null,
        prefix: '',
        suffix: '',
        addonBefore: '',
        addonAfter: '',
        disabled: false,
        allowClear: false,
        showLabel: true,
        required: true,
        rules: [],
        events: {},
        listStyle: '',
        isSave: false,
        isShow: true,
        scan: false,
        bordered: true,
        isShowAi: false,
        tooltipConfig: { visible: false, title: '提示文本' },
        style: { width: '100%' },
      },
    },
    {
      key: '3fb1db349e604818b34ec80d42822db8',
      field: 'cpms',
      label: '产品描述',
      type: 'input',
      component: 'Input',
      colProps: { span: 24 },
      defaultValue: '',
      componentProps: {
        width: '100%',
        span: '',
        defaultValue: '',
        placeholder: '请输入产品描述',
        maxlength: null,
        prefix: '',
        suffix: '',
        addonBefore: '',
        addonAfter: '',
        disabled: false,
        allowClear: false,
        showLabel: true,
        required: false,
        rules: [],
        events: {},
        listStyle: '',
        isSave: false,
        isShow: true,
        scan: false,
        bordered: true,
        isShowAi: false,
        tooltipConfig: { visible: false, title: '提示文本' },
        style: { width: '100%' },
      },
    },
    {
      key: '44070e74294f42ae9d45125821791884',
      field: 'images',
      label: '附件',
      type: 'upload',
      component: 'Upload',
      colProps: { span: 24 },
      componentProps: {
        api: uploadApi,
        span: '',
        defaultValue: '',
        accept: '',
        maxNumber: 5,
        maxSize: 5,
        showLabel: true,
        multiple: false,
        disabled: false,
        required: false,
        isShow: true,
        events: {},
        listType: 'text',
        sourceType: 'album,camera',
        tooltipConfig: { visible: false, title: '提示文本' },
      },
    },
    // {
    //   key: '2908e95b40994ef4aa819972bd840713',
    //   field: '',
    //   label: '分割线',
    //   colProps: { span: 24 },
    //   type: 'divider',
    //   component: 'Divider',
    //   componentProps: {
    //     dashed: false,
    //     orientation: 'left',
    //     text: '审批意见',
    //     isShow: true,
    //     style: { marginTop: '0px', marginBottom: '0px' },
    //   },
    // },
    // {
    //   key: '879e17939485432c8c0dfb17101a4942',
    //   field: 'gkyj',
    //   label: '顾客意见',
    //   type: 'input',
    //   component: 'Input',
    //   colProps: { span: 24 },
    //   defaultValue: '',
    //   componentProps: {
    //     width: '100%',
    //     span: '',
    //     defaultValue: '',
    //     placeholder: '请输入顾客意见',
    //     maxlength: null,
    //     prefix: '',
    //     suffix: '',
    //     addonBefore: '',
    //     addonAfter: '',
    //     disabled: false,
    //     allowClear: false,
    //     showLabel: true,
    //     required: false,
    //     rules: [],
    //     events: {},
    //     listStyle: '',
    //     isSave: false,
    //     isShow: true,
    //     scan: false,
    //     bordered: true,
    //     isShowAi: false,
    //     tooltipConfig: { visible: false, title: '提示文本' },
    //     style: { width: '100%' },
    //   },
    // },
  ],
  showActionButtonGroup: false,
  buttonLocation: 'center',
  actionColOptions: { span: 24 },
  showResetButton: false,
  showSubmitButton: false,
  hiddenComponent: [],
};
