import Api from "@/api/account/payType";
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: ["add"],
  defaultToolbar: ["refresh", "filter", "search"],
  cols: [
    // { type: "selection", width: 50, align: "center" },
    {
      label: "图标",
      align: "center",
      prop: "icon",
      templet: 'image'
    },
    {
      label: "支付方式",
      align: "center",
      prop: "payName",
    },
    {
      label: "支付类型",
      align: "center",
      prop: "payType",
    },

    {
      label: "开钱箱权限",
      align: "center",
      prop: "isOpenCashDrawer",
      templet: 'custom',
      slotName: 'switch'
    },
    {
      label: "是否生效",
      align: "center",
      prop: "isDisplay",
      templet: 'custom',
      slotName: 'switch'
    },
    {
      label: "条件排序",
      align: "center",
      prop: "sorts",
    },
    {
      label: "操作",
      align: "center",
      fixed: "right",
      width: 280,
      templet: "tool",
      operat: ["edit"],
    },
  ],
};

export default contentConfig;
