import { ContentConfig } from "/@/components/PageContent";
import {
  // httpDelete,
  httpList,
  httpUpdate
} from "/@/api/mobile/user";
import { renderStatus, timeInterval } from "/@/utils/column-helper";
import { ACCOUNT_STATUS_OPTIONS } from "/@/config/status";

const columns = [
  {
    type: "selection",
    width: 55,
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    prop: "username",
    label: "账号",
    minWidth: "140px"
  },
  {
    prop: "status",
    label: "状态",
    minWidth: "90px",
    ...renderStatus(ACCOUNT_STATUS_OPTIONS)
  },
  {
    prop: "name",
    label: "客户姓名",
    minWidth: "100px"
  },
  {
    prop: "mobile",
    label: "客户手机号",
    minWidth: "110"
  },
  {
    prop: "time",
    minWidth: "310",
    label: "账户有效期",
    ...timeInterval(["starttime", "expiretime"], "~")
  },
  {
    prop: "activetime",
    label: "账户激活时间",
    width: "180px"
  },
  {
    prop: "addtime",
    label: "创建时间",
    minWidth: "160px"
  },

  {
    label: "操作",
    fixed: "right",
    width: 120,
    slot: "operation"
  }
];
const contentConfig: ContentConfig = {
  title: "用户管理",
  columns,
  apis: {
    // httpDelete,
    httpList,
    httpUpdate
  },
  notPreview: false
};

export default contentConfig;
