import { h } from "vue";
import { httpList, httpStatus, httpCreate, httpDelete, httpUpdate } from "/@/api/serviceParam/brand";

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

const columns = [
  {
    prop: "id",
    label: "ID",
  },
  {
    prop: "brand_name",
    label: "品牌名称",
  },
  {
    prop: "status",
    label: "状态",
    width: "80px",
    cellRenderer: ({ row }) => {
      return h(ElTag,
        { type: String(row.status) === "1" ? "success" : "danger" },
        { default: () => (String(row.status) === "1" ? "启用" : "禁用")}
      );
    }
  },
  {
    prop: "company_name",
    label: "申请人部门",
    minWidth: "150px",
  },
  {
    prop: "creater",
    label: "创建人",
  },
  {
    prop: "addtime",
    label: "创建时间",
  },
  {
    prop: "",
    label: "操作",
    fixed: "right",
    slot: "operation",
  }
]


const contentConfig: ContentConfig = {
  title: "商品品牌",
  columns,
  apis: {
    httpList,
    httpAdd: httpCreate,
    httpStatus,
    httpDelete,
    httpUpdate
  }
};

export default contentConfig;
