export default function useColumns() {
  const SearchColumns = [
    {
      item: { key: "dateStart", title: "开始时间", },
      attr: {
        is: "el-date-picker",
        type: "date",
        placeholder: "选择日期",
        valueFormat: "yyyy-MM-dd",
      },
    },
    {
      item: { key: "dateOver", title: "结束时间", },
      attr: {
        is: "el-date-picker",
        type: "date",
        placeholder: "选择日期",
        valueFormat: "yyyy-MM-dd",
      },
    },
    {
      item: { key: "logType", title: "日志类型", },
      attr: {
        is: "el-select",
        dictName: "log_type",
      },
    },
    {
      item: { key: "userName", title: "员工", },
      attr: {
        is: "el-popover-select-v2",
        referName: "CONTACTS_PARAM",
        valueKey: "name",
        dataMapping: {
          userCode: "code",
        },
      },
    },
    {
      item: { key: "deptName", title: "部门", },
      attr: {
        is: "el-popover-select-v2",
        referName: "DEPT_PARAM",
        valueKey: "name",
        // dataMapping: {
        //   deptCode: "code",
        // },
      },
    },
  ];

  const TableColumns = [
    {
      item: { key: "userCode", title: "员工工号", width: 100, },
      attr: {},
    },
    {
      item: { key: "userName", title: "员工姓名", width: 100, },
      attr: {},
    },
    {
      item: { key: "firstDepartment", title: "一级部门", },
      attr: {},
    },
    {
      item: { key: "secondDepartment", title: "二级部门", },
      attr: {},
    },
    {
      item: { key: "thirdDepartment", title: "三级部门", },
      attr: {},
    },
    {
      item: { key: "payableCopies", title: "应交份数", width: 100, },
      attr: {
        formatter: (prop) => {
          return prop.payableCopies
        },
      },
    },
    {
      item: { key: "actualDeliveryCopies", title: "实交份数", width: 100, },
      attr: {
        formatter: (prop) => {
          return prop.actualDeliveryCopies
        },
      },
    },
    {
      item: { key: "lackCopies", title: "缺交份数", width: 100, },
      attr: {
        formatter: (prop) => {
          return prop.lackCopies
        },
      },
    },
    {
      item: { key: "beFurlough", title: "休假", width: 100, },
      attr: {
        formatter: (prop) => {
          return prop.beFurlough
        },
      },
    },
  ].map(({ item, attr }) => ({
    attr,
    item: {
      ...item,
      sortabled: true,
      fixedabled: true,
      filterabled: true,
      hiddenabled: true,
    },
  }));
  return { SearchColumns, TableColumns }
}