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

const columns = [
  {
    type: "selection",
    width: 55,
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    label: "序号",
    type: "index",
    width: 70,
    hide: ({ checkList }) => !checkList.includes("序号列")
  },
  {
    label: "账号",
    prop: "username"
  },

  {
    label: "角色",
    prop: "role_name"
  },
  {
    label: "状态",
    prop: "status",
    ...renderStatus(STATUS_OPTIONS)
  },
  {
    label: "创建时间",
    width: 160,
    prop: "addtime"
  },
  {
    label: "操作",
    fixed: "right",
    width: 200,
    slot: "operation"
  }
];

const contentConfig: ContentConfig = {
  title: "运营账号",
  columns,
  apis: {
    httpAdd,
    httpList,
    httpUpdate,
    httpStatus,
    httpDelete,
    httpChangePwd
  }
};

export default contentConfig;
