import Api from "@/api/product/cons-group";
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({});
  },
  modifyAction: function (data) {
    return Api.edit(data);
  },
  pk: "id",
  toolbar: [
    {
      icon: "plus",
      text: "新增",
      type: "primary",
      name: "add",
      auth: "import",
    },
  ],
  defaultToolbar: ["refresh", "filter", "search"],
  cols: [
    // { type: "selection", width: 50, align: "center" },
    {
      label: "ID",
      align: "center",
      prop: "id",
    },
    {
      label: "耗材类型名称",
      align: "center",
      prop: "name",
    },

    {
      label: "状态",
      align: "center",
      prop: "status",
      templet: 'custom',
      slotName: 'switch'
    },

    {
      label: "操作",
      align: "center",
      fixed: "right",
      width: 280,
      templet: "tool",
      operat: [{ text: "编辑", icon: 'edit', name: "edit"}],
    },
  ],
};

export default contentConfig;
