import type { IContentConfig } from "@/components/CURD/types";
import UserAPI from "@/api/product/index";

const contentConfig: IContentConfig = {
  pageName: "sys:user",
  table: {
    showOverflowTooltip: true,
  },
  toolbar: [],
  pagination: {
    background: true,
    layout: "prev,pager,next,jumper,total,sizes",
    pageSize: 10,
    pageSizes: [10, 20, 30, 50],
  },
  indexAction: function (params) {
    return UserAPI.getPage(params);
  },
  modifyAction(data) {
    // 模拟发起网络请求修改字段
    // console.log("modifyAction:", data);
    ElMessage.success(JSON.stringify(data));
    return Promise.resolve(null);
  },

  cols: [
    { type: "selection", width: 50, align: "center" },
    { label: "封面图", align: "center", prop: "coverImg", templet: "image" },
    { label: "商品信息", align: "center", prop: "name" },
    { label: "规格", align: "center", prop: "specSnap", },
    { label: "是否售罄", align: "center", prop: "isPauseSale", },
    { label: "售价", align: "center", prop: "lowPrice", },
    { label: "库存", align: "center", prop: "realSalesNumber", },
    { label: "销量", align: "center", prop: "stockNumber", },
    { label: "分类名称", align: "center", prop: "categoryName", },

  ],
};

export default contentConfig;
