import ShopStaffApi, { type getListRequest } from "@/api/account/shopStaff";
import type { PageShopStaff } from "@/api/account/shopStaff";
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],
  },
  deleteAction: function (id: string) {
    return ShopStaffApi.delete(id);
  },
  indexAction: function (params: getListRequest) {
    return ShopStaffApi.getList(params);
  },
  // modifyAction: function (data) {
  //   // return ShopStaffApi.edit(data);
  // },
  pk: "id",
  toolbar: ["add"],
  defaultToolbar: ["refresh", "filter", "search"],
  cols: [
    { type: "selection", width: 50, align: "center" },
    { prop: "id", width: 50, align: "center", show: false },
    {
      label: "员工名称",
      align: "center",
      prop: "name",
    },
    {
      label: "员工编号",
      align: "center",
      prop: "code",
    },
    {
      label: "员工角色",
      align: "center",
      prop: "roleName",
    },
    {
      label: "最大优惠金额",
      align: "center",
      prop: "maxDiscountAmount",
    },
    {
      label: "优惠类型",
      align: "center",
      prop: "discountType",
      templet: "custom",
      slotName: "options",
    },
    {
      label: "操作",
      align: "center",
      templet: "tool",
      width: 240,
      operat: ["edit", "delete",
        {
          name: "change_pwd",
          auth: "password:reset",
          icon: "refresh-left",
          text: "修改密码",
          type: "primary",
          isBtn: true,
        }
      ],
    },
  ],
};

export default contentConfig;
