import UserAPI from "@/api/product/specificationsconfig";

import RoleAPI from "@/api/system/role";
import type { UserPageQuery } from "@/api/system/user";
import type { IContentConfig } from "@/components/CURD/types";

const contentConfig: IContentConfig<UserPageQuery> = {
  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],
  },
  indexActionData: { name: "", orderBy: "" },
  indexAction: function (params) {
    return UserAPI.getPage(params);
  },
  deleteAction: UserAPI.deleteByIds,
  // importAction(file) {
  //   return UserAPI.import(1, file);
  // },
  // exportAction: UserAPI.export,
  modifyAction: UserAPI.update,

  // importTemplate: UserAPI.downloadTemplate,
  // importsAction(data) {
  //   // 模拟导入数据
  //   console.log("importsAction", data);
  //   return Promise.resolve();
  // },
  // exportsAction: async function (params) {
  //   // 模拟获取到的是全量数据
  //   const res = await UserAPI.getPage(params);
  //   console.log("exportsAction", res.list);
  //   return res.list;
  // },
  pk: "id",
  toolbar: [
    {
      icon: "plus",
      text: "新增",
      type: "primary",
      name: "add",
      auth: "import",
    },
  ],
  cols: [
    // { type: "selection", width: 50, align: "center" },
    { label: "模板名称", align: "center", slotName: "deptName", templet: "custom", },
    { label: "完整名称", align: "center", prop: "fullName" },
    // {
    //   label: "操作",
    //   align: "center",
    //   fixed: "right",
    //   width: 280,
    //   templet: "operates",
    // },
    {
      label: "操作",
      width: '150',
      slotName: "operates",
      templet: "custom",
      align: "left",
    },
  ],
};

export default contentConfig;
