index.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import { httpGet } from '@/utils/http'
  2. import { getEnvBaseUrl } from '@/utils/index'
  3. /**
  4. * 设备查询:列表
  5. */
  6. export const getEquipContainerList = (params: any) => {
  7. return httpGet('/pressure/equip-container/page', params)
  8. }
  9. /**
  10. * 设备查询:详情
  11. */
  12. export const getEquipContainerById = (params: any) => {
  13. return httpGet('/pressure/equip-container/get', params)
  14. }
  15. /**
  16. * 部门列表
  17. */
  18. export const getDeptListApi = (params: any) => {
  19. return httpGet('/system/dept/list', params)
  20. }
  21. /**
  22. * 单位查询:列表
  23. */
  24. export const getSystemClientUnitList = (params: any) => {
  25. return httpGet('/system/client-unit/page', params)
  26. }
  27. /**
  28. * 单位查询:详情
  29. */
  30. export const getSystemClientUnitById = (params: any) => {
  31. return httpGet('/system/client-unit/get', params)
  32. }
  33. /**
  34. * 体系文件:列表
  35. */
  36. export const getStandardDocList = (params: any) => {
  37. return httpGet('/system/standard-doc/page', params)
  38. }
  39. /**
  40. * 体系文件:详情
  41. */
  42. export const getStandardDocFileByUploadId = (params: any) => {
  43. return httpGet('/system/standard-doc/file', params)
  44. }
  45. export const getStandardTemplate = (params: any) => {
  46. return httpGet('/pressure2/standard-template/v2/get', params)
  47. }
  48. export const getReportTemplateDetail = (params: any) => {
  49. return httpGet('/pressure/report-template/get', params)
  50. }
  51. export const getPressure2ReportTemplateDetail = (params: any) => {
  52. return httpGet('/pressure2/report-template/get', params)
  53. }
  54. export const getReportTemplateList = (params: any) => {
  55. return httpGet('/pressure/report-template/page', params)
  56. }
  57. export const uploadFile = (data: FormData) => {
  58. let requestUrl = '/infra/file/upload'
  59. if (JSON.parse(import.meta.env.VITE_APP_PROXY) && import.meta.env.MODE === 'development') {
  60. requestUrl = import.meta.env.VITE_APP_PROXY_PREFIX + requestUrl
  61. } else {
  62. requestUrl = getEnvBaseUrl() + requestUrl
  63. }
  64. const token = uni.getStorageSync('APP_ACCESS_TOKEN')
  65. const headers: Record<string, string> = {}
  66. if (token) {
  67. headers.Authorization = `Bearer ${token}`
  68. }
  69. return fetch(requestUrl, {
  70. method: 'POST',
  71. headers,
  72. body: data,
  73. }).then(res => res.json())
  74. }