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

const columns = [
  {
    type: "selection",
    width: 55,
    hide: ({ checkList }) => !checkList.includes("勾选列")
  },
  {
    prop: "action_name",
    label: "按钮名称"
  },
  {
    prop: "action_code",
    label: "按钮编码"
  },

  {
    prop: "status",
    label: "状态",
    width: "70px",
    ...renderStatus(STATUS_OPTIONS)
  },
  {
    prop: "addtime",
    label: "创建时间"
  },

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

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

export default contentConfig;
