import { listDictModel } from '/@/api/common';
import { BasicColumn, FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '日期',
    dataIndex: 'returnTime',
    width: 200,
    align: 'left',
  },
  {
    title: '转归类型',
    dataIndex: 'type',
    align: 'left',
    width: 200,
  },
  {
    title: '备注',
    dataIndex: 'remark',
    align: 'left',
  },
  {
    title: '记录人',
    dataIndex: 'updatorName',
    align: 'left',
    width: 120,
  },
];

// 表单新增编辑
export const dataFormSchema: FormSchema[] = [
  {
    label: '转归日期',
    field: 'returnTime',
    required: true,
    component: 'DatePicker',
    componentProps: () => {
      return {
        placeholder: '请输入转归日期',
        getPopupContainer: () => document.body,
        valueFormat: 'YYYY-MM-DD',
      };
    },
  },
  {
    label: '转归类型',
    field: 'type',
    required: true,
    component: 'ApiSelect',
    componentProps: {
      api: listDictModel,
      params: {
        dictCode: 'pb_return',
        dictSort: true,
      },
      getPopupContainer: () => document.body,
      placeholder: '请输入转归类型',
    },
  },
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
    componentProps: {
      placeholder: '请输入备注',
    },
  },
];
