reportManager.api.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import { defHttp } from '/@/utils/http/axios';
  2. import { Modal } from 'ant-design-vue';
  3. enum Api {
  4. reportList = '/safety/reportInfo/list',
  5. save = '/safety/reportInfo/createReportFile',
  6. deleteById = '/safety/reportInfo/delete',
  7. downLoad = '/safety/reportInfo/download',
  8. hisList = '/safety/reportLog/list',
  9. hisdownload = '/safety/reportLog/download',
  10. getQuery = '/sys/dict/reportKind/query',
  11. getUpload = '/safety/reportInfo/upload',
  12. reportAdd= '/ventanaly-company/company/reportData/add',
  13. queryDepartTreeSync= '/sys/sysDepart/queryDepartTreeSync',
  14. synReportFile='/safety/reportInfo/synReportFile',
  15. listMap='/ventanaly-company/company/reportData/list',
  16. reportEdit='/ventanaly-company/company/reportData/edit',
  17. reportDel='/ventanaly-company/company/reportData/delete',
  18. queryTreeList='/sys/sysDepart/queryTreeList'
  19. }
  20. /**
  21. * 部门树列表
  22. * @param params
  23. */
  24. export const queryTreeList = () => defHttp.get({ url: Api.queryTreeList, });
  25. /**
  26. * 报表数据映射列表
  27. * @param params
  28. */
  29. export const listMap = (params) => defHttp.get({ url: Api.listMap, params });
  30. /**
  31. * 同步报表到文件共享中心
  32. * @param params
  33. */
  34. export const synReportFile = (params) => defHttp.post({ url: Api.synReportFile, params });
  35. /**
  36. * 报表数据映射-所属部门编号列表
  37. * @param params
  38. */
  39. export const queryDepartTreeSync = () => defHttp.get({ url: Api.queryDepartTreeSync});
  40. /**
  41. * 报表数据映射-添加
  42. * @param params
  43. */
  44. export const reportAdd = (params) => defHttp.post({ url: Api.reportAdd, params });
  45. /**
  46. * 报表数据映射-编辑
  47. * @param params
  48. */
  49. export const reportEdit = (params) => defHttp.post({ url: Api.reportEdit, params });
  50. /**
  51. * 报表数据映射-删除
  52. */
  53. export const reportDel = (params, handleSuccess) => {
  54. return defHttp.delete({ url: Api.reportDel, params }, { joinParamsToUrl: true }).then(() => {
  55. handleSuccess();
  56. });
  57. };
  58. /**
  59. * 列表接口
  60. * @param params
  61. */
  62. export const reportList = (params) => defHttp.get({ url: Api.reportList, params });
  63. /**
  64. * 历史记录列表接口
  65. * @param params
  66. */
  67. export const hisList = (params) => defHttp.get({ url: Api.hisList, params });
  68. /**
  69. * 保存或者更新用户
  70. * @param params
  71. */
  72. export const save = (params) => defHttp.post({ url: Api.save, params });
  73. /**
  74. * 删除用户
  75. */
  76. export const deleteById = (params, handleSuccess) => {
  77. return defHttp.delete({ url: Api.deleteById, params }, { joinParamsToUrl: true }).then(() => {
  78. handleSuccess();
  79. });
  80. };
  81. /*
  82. 下载
  83. */
  84. export const downLoad = (params) => defHttp.post({ url: Api.downLoad, params, responseType: 'blob' });
  85. /*
  86. 报表历史记录下载
  87. */
  88. export const hisdownload = (params) => defHttp.post({ url: Api.hisdownload, params, responseType: 'blob' });
  89. /**
  90. * 报表菜单类型
  91. * @param params
  92. */
  93. export const getQuery = () => defHttp.get({ url: Api.getQuery });
  94. /**
  95. * 报表或模板上传
  96. * @param params
  97. */
  98. export const getUpload = (params) => defHttp.post({ headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, url: Api.getUpload, params });