import { ContentConfig } from "/@/components/PageContent";
import {
  httpList,
  httpAdd,
  httpUpdate,
  httpStatus
} from "/@/api/operate/setTheme";
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: "company_title",
    label: "公司名称"
  },
  {
    prop: "card_title",
    label: "卡类型"
  },
  {
    prop: "code",
    label: "主题编号"
  },

  {
    prop: "status",
    label: "状态",
    ...renderStatus(STATUS_OPTIONS)
  },

  {
    prop: "addtime",
    label: "创建时间",
    sortable: true,
    width: 160
  },

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

const contentConfig: ContentConfig = {
  title: "主题设置",
  columns,
  apis: {
    httpAdd,
    httpList,
    httpUpdate,
    httpStatus
  }
};

export default contentConfig;
