import Api from "@/api/product/libraryrecords";
import type { IContentConfig } from "@/components/CURD/types";

const contentConfig: IContentConfig = {
  pageName: "sys:user",
  table: {
    border: true,
    highlightCurrentRow: true,
  },
  pagination: {
    background: true,
    layout: "prev,pager,next,jumper,total,sizes",
    pageSize: 20,
    pageSizes: [10, 20, 30, 50],
  },
  indexAction: function (params) {
    return Api.getList(params);
  },
  deleteAction: function (id) {
    return Api.delete(id);
  },
  modifyAction: function (data) {
    return Api.edit(data);
  },
  indexActionData: {},
  pk: "id",
  toolbar: [
    // {
    //   text: "入库记录",
    //   name: "manual-in",
    //   auth: "",
    // },
    // {
    //   text: "出库记录",
    //   name: "manual-out",
    //   auth: "",
    // },
    // {
    //   text: "报损记录",
    //   name: "damage-out",
    //   auth: "",
    // },
  ],
  defaultToolbar: ["refresh", "filter", "search"],
  cols: [
    // { type: "selection", width: 50, align: "center" },
    {
      label: "耗材名称",
      align: "center",
      prop: "conName",
    },
    {
      label: "单位",
      align: "center",
      prop: "unitName",
    },
    {
      label: "供应商",
      align: "center",
      prop: "vendorName",
    },
    {
      label: "变动原因",
      align: "center",
      templet: "custom",
      slotName: "conUnit",
    },
    {
      label: "出入库数量",
      align: "center",
      prop: "inOutNumber",
    },
    {
      label: "变动后的库存",
      align: "center",
      prop: "afterNumber",
    },
    {
      label: "创建时间",
      align: "center",
      prop: "createTime",
    },
    // {
    //   label: "操作",
    //   align: "center",
    //   fixed: "right",
    //   width: 280,
    //   templet: "tool",
    //   operat: ["edit", "delete"],
    // },
  ],
};

export default contentConfig;
