warning.api.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { defHttp } from '/@/utils/http/axios';
  2. import { Modal } from 'ant-design-vue';
  3. enum Api {
  4. list = '/ventanaly-device/safety/ventanalyMonitorLimit/list',
  5. save = '/ventanaly-device/safety/ventanalyMonitorLimit/add',
  6. edit = '/ventanaly-device/safety/ventanalyMonitorLimit/edit',
  7. deleteById = '/ventanaly-device/safety/ventanalyMonitorLimit/delete',
  8. limitList = '/ventanaly-device/safety/limitLevel/list',
  9. limitSave = '/ventanaly-device/safety/limitLevel/add',
  10. limitEdit = '/ventanaly-device/safety/limitLevel/edit',
  11. limitDeleteById = '/ventanaly-device/safety/limitLevel/delete',
  12. importExcel = '/sys/user/importExcel',
  13. exportXls = '/sys/user/exportXls',
  14. }
  15. /**
  16. * 导出api
  17. * @param params
  18. */
  19. export const getExportUrl = Api.exportXls;
  20. /**
  21. * 导入api
  22. */
  23. export const getImportUrl = Api.importExcel;
  24. /**
  25. * 列表接口
  26. * @param params
  27. */
  28. export const list = (params) => defHttp.get({ url: Api.list, params });
  29. export const save = (params) => defHttp.post({ url: Api.save, params });
  30. export const edit = (params) => defHttp.put({ url: Api.edit, params });
  31. export const limitSave = (params) => defHttp.post({ url: Api.limitSave, params });
  32. export const limitEdit = (params) => defHttp.put({ url: Api.limitEdit, params });
  33. export const limitDeleteById = (params, handleSuccess) => {
  34. return defHttp.delete({ url: Api.limitDeleteById, params }, { joinParamsToUrl: true }).then(() => {
  35. handleSuccess();
  36. });
  37. };
  38. /**
  39. * 删除用户
  40. */
  41. export const deleteById = (params, handleSuccess) => {
  42. return defHttp.delete({ url: Api.deleteById, params }, { joinParamsToUrl: true }).then(() => {
  43. handleSuccess();
  44. });
  45. };
  46. /**
  47. * 保存或者更新用户
  48. * @param params
  49. */
  50. export const saveOrUpdate = (params, isUpdate) => {
  51. const url = isUpdate ? Api.edit : Api.save;
  52. return defHttp.put({ url: url, params });
  53. };
  54. export const limitList = (params) => defHttp.get({ url: Api.limitList, params });