import { httpList, httpStatus,httpDelete } from "/@/api/serviceParam/orderuse";

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

const columns = [
  {
    prop: "id",
    label: "ID",
    width:"80px"
  },
  {
    prop: "order_use",
    label: "订单用途名称",
  },
  {
    label: "状态",
    prop: "status",
    width: 100,
    cellRenderer: ({ row }) => {
      return h( ElTag,
        { type: String(row.status) === "1" ? "success" : "danger" },
        { default: () => (String(row.status) === "1" ? "启用" : "禁用")}
      );
    }
  },
  {
    prop: "creater",
    label: "创建人",
  },
  {
    prop: "addtime",
    label: "创建时间",
    // ,
  },
  {
    prop: "",
    label: "操作",
    fixed: "right",
    minWidth: "90px",
    slot: "operation",
  },
];

const contentConfig: ContentConfig = {
  title: "订单用途管理",
  columns,
  apis: {
    httpList,
    httpAdd: true,
    httpStatus,
    httpUpdate: true,
    httpDelete
  }
};

export default contentConfig;
