import { httpList } from "/@/api/serviceParam/searchSort";

import { h } from "vue";
import { ContentConfig } from "/@/components/PageContent";
import { ElTag } from "element-plus";

const columns = [
  {
    prop: "id",
    label: "ID",
    width: "80px",
    align:'center'
  },
  {
    prop: "cat_name",
    label: "分类名称",
    width: "140px",
  },
  {
    label: "状态",
    prop: "status",
    width: 100,
    cellRenderer: ({ row }) => {
      return h( ElTag,
        { type: String(row.status) === "1" ? "success" : "danger" },
        { default: () => (String(row.status) === "1" ? "启用" : "禁用")}
      );
    }
  },
  {
    prop: "level",
    label: "分类等级",
    width: "70px",
  },
  {
    prop: "fund_code",
    label: "财务核算码",
    width: "130px",
  },
  {
    prop: "specs",
    label: "关联规格",
    width: "130px",
  },
  {
    prop: "cat_desc",
    label: "售后说明",
  },
  // {
  //   prop: "company_name",
  //   label: "创建人部门",
  //   minWidth: "150px",
  // },
  // {
  //   prop: "creater",
  //   label: "创建人",
  //   width: "70px",
  // },

  {
    prop: "addtime",
    label: "创建时间",
    width: "145px",
  },
];

const contentConfig: ContentConfig = {
  title: "商品分类查询",
  columns,
  apis: {
    httpList
  }
};

export default contentConfig;
