import API, { type editRequest } from "@/api/system/miniAppPages";
import type { IContentConfig } from "@/components/CURD/types";

const contentConfig: IContentConfig<editRequest> = {
  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: API.delete,
  // 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: "name",
    },
    {
      label: "图标",
      align: "center",
      prop: "icon",
      templet: "custom",
      slotName: "icon",
    },
    {
      label: "小程序页面路径",
      align: "center",
      prop: "path",
    },
    {
      label: "页面描述",
      align: "center",
      prop: "description",
    },
    {
      label: "排序",
      align: "center",
      prop: "sort",
    },
    {
      label: "状态",
      align: "center",
      prop: "status",
      templet: "custom",
      slotName: "status",
    },
    {
      label: "操作",
      align: "center",
      fixed: "right",
      width: 280,
      templet: "tool",
      operat: ["edit", "delete"],
    },
  ],
};

export default contentConfig;
