import { ContentConfig } from "/@/components/PageContent";
import {
  httpList,
  httpAdd,
  httpUpdate,
  httpStatus,
  httpDelete
} from "/@/api/operate/setUserVideo";
import { renderStatus } from "/@/utils/column-helper";
import { STATUS_OPTIONS } from "/@/config/status";

const columns = [
  {
    type: "selection",
    width: 55,
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },

  {
    prop: "id",
    label: "ID"
  },
  {
    prop: "title",
    label: "卡类型"
  },

  {
    prop: "status",
    label: "状态",
    ...renderStatus(STATUS_OPTIONS)
  },
  {
    prop: "contacts",
    label: "联系人"
  },
  {
    prop: "mobile",
    label: "联系方式"
  },
  {
    prop: "addtime",
    label: "创建时间",
    sortable: true
  },

  {
    label: "操作",
    fixed: "right",
    width: 160,
    slot: "operation"
  }
];

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

export default contentConfig;
