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

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

const columns = [
  {
    prop: "id",
    label: "ID",
    minWidth: "60px",
  },
  {
    prop: "channel_name",
    label: "支付渠道名称",
    width: "230px",
  },
  {
    prop: "companyName",
    label: "业务公司名称",
    width: "230px",
  },
  {
    label: "状态",
    prop: "status",
    width: 100,
    cellRenderer: ({ row }) => {
      return h(
        ElTag,
        {
          type: String(row.status) === "1" ? "success" : "danger"
        },
        {
          default: () => (String(row.status) === "1" ? "启用" : "禁用")
        }
      );
    }
  },
  {
    prop: "apply_name",
    label: "创建人",
    width: "230px",
  },
  {
    prop: "addtime",
    label: "创建时间",
    width: "260px",
  },
  {
    prop: "",
    label: "操作",
    fixed: "right",
    width: "140px",
    _noset_: true,
    slot: "operation",
  },
];

const contentConfig: ContentConfig = {
  title: "公司账号角色查询",
  columns,
  apis: {
    httpList,
    httpAdd: true,
    httpStatus,
    httpUpdate: true
  }
};

export default contentConfig;
