import { defHttp } from '/@/utils/http/axios';
import { PageParams, DelParams, roleParams } from './model';
import { Result } from '/#/axios';

enum Api {
  pageList = '/zfb-api/zfb/shop/staffPerm/companyList',
  cameraList = '/zfb-api/zfb/cameraIncrement/staticsByCompany',
  staffList = '/zfb-api/zfb/shop/staffPerm/list',
  cameraDetailList = '/zfb-api/zfb/cameraIncrement/list',
  preDel = '/zfb-api/zfb/shop/sys/user/preDeleteStaff',
  roleList = '/zfb-api/zfb/shop/sys/user/roleList',
  getRoleListByParam = '/zfb-api/zfb/shop/sys/user/getRoleListByParam',
  staffPermSave = '/zfb-api/zfb/shop/staffPerm/save',
  staffPermBind = '/zfb-api/zfb/shop/staffPerm/bind',
  staffPermUpdate = '/zfb-api/zfb/shop/staffPerm/update',
  bindStaffList = '/zfb-api/zfb/shop/staffPerm/bindStaffList',
  cameraBind = '/zfb-api/zfb/cameraIncrement/bindCamera',
  staffPermUnbind = '/zfb-api/zfb/shop/staffPerm/unbind',
  cameraUnbind = '/zfb-api/zfb/cameraIncrement/unbind',
  update = '/zfb-api/zfb/shop/sys/user/update',
  checkUser = '/zfb-api/zfb/user/checkUserExists',
  deleteStaff = '/zfb-api/zfb/shop/sys/user/deleteStaff',
  getNumByStaff = '/zfb-api/zfb/shop/sys/user/getNumByStaff',
  allList = '/zfb-api/zfb/shop/staffPerm/allList',
  cameraallList = '/zfb-api/zfb/cameraIncrement/list',
  allListType = '/zfb-api/zfb/shop/staffPerm/allListType',
  deviceType = '/zfb-api/zfb/cameraIncrement/incrementTypes',
  addCamrea = '/zfb-api/zfb/cameraIncrement/add',
  deleteRights = '/zfb-api/zfb/shop/staffPerm/delete',
}

/**
 * @description: Get sample list value
 */

export const ListApi = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.pageList,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const cameraListApi = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.cameraList,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const staffList = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.staffList,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const cameraDetailList = (params: PageParams) =>
  defHttp.post<Result>({
    url: Api.cameraDetailList,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const getNumByStaff = (params: any) =>
  defHttp.get<Result>({
    url: Api.getNumByStaff,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const delApi = (params: DelParams) =>
  defHttp.post<Result>({
    url: Api.deleteStaff,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const preDelApi = (params: number) =>
  defHttp.post<Result>({
    url: Api.preDel,
    params: { userId: params },
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const getRoleListByParam = (params: roleParams) =>
  defHttp.post<Result>({
    url: Api.getRoleListByParam,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const roleLIstApi = (params) =>
  defHttp.post<Result>({
    url: Api.roleList,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const checkUserApi = (params) =>
  defHttp.post<boolean>({
    url: Api.checkUser,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const unbindRights = (params) =>
  defHttp.post<Result>({
    url: Api.staffPermUnbind,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const deleteRights = (params) =>
  defHttp.post<Result>({
    url: Api.deleteRights,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const unbindCamera = (params) =>
  defHttp.post<Result>({
    url: Api.cameraUnbind,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const staffPermUpdate = (params) =>
  defHttp.post<Result>({
    url: Api.staffPermUpdate,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const bindRights = (params) =>
  defHttp.post<Result>({
    url: Api.staffPermBind,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const bindStaffList = (params) =>
  defHttp.get<Result>({
    url: Api.bindStaffList,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const bindCamera = (params) =>
  defHttp.post<Result>({
    url: Api.cameraBind,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const saveRights = (params) =>
  defHttp.post<Result>({
    url: Api.staffPermSave,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const updateApi = (params) =>
  defHttp.post<Result>({
    url: Api.update,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const deviceType = (params: any) =>
  defHttp.get<Result>({
    url: Api.deviceType,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
export const getAllList = (params: any) =>
  defHttp.get<Result>({
    url: Api.allList,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const addCamrea = (params: any) =>
  defHttp.post<Result>({
    url: Api.addCamrea,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const getCameraallList = (params: any) =>
  defHttp.get<Result>({
    url: Api.cameraallList,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });

export const allListType = (params: any) =>
  defHttp.get<Result>({
    url: Api.allListType,
    params,
    data: params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
