script.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { UN_REQ_NUM } from "@/constant/sys";
  2. import {
  3. getCaseScriptSaveOrUpdateUrl,
  4. getCaseScriptInfoUrl,
  5. axios,
  6. } from "@/request";
  7. export enum FireStatus {
  8. all = UN_REQ_NUM,
  9. incomplete = 0,
  10. complete = 1,
  11. }
  12. export type Fire = {
  13. accidentDate: string;
  14. createTime: string;
  15. creatorDeptId: string;
  16. caseId: number;
  17. mapShow: boolean;
  18. creatorId: string;
  19. creatorName: string;
  20. deptId: string;
  21. editTime: string;
  22. editorId: string;
  23. editorName: string;
  24. fireReason: string;
  25. id: string;
  26. isTeached: number;
  27. organizerDeptName: string;
  28. organizerUsers: string;
  29. projectAddress: string;
  30. latAndLong: string;
  31. latlng: string;
  32. projectName: string;
  33. projectSite: string;
  34. projectSiteCode: string;
  35. projectSn: string;
  36. status: FireStatus;
  37. statusDesc: string;
  38. updateTime: string;
  39. isDelete?: number;
  40. field1: string;
  41. field2: string;
  42. field3: string;
  43. field4: string;
  44. field5: string;
  45. field6: string;
  46. field7: string;
  47. field8: string;
  48. field9: string;
  49. field10: string;
  50. };
  51. export enum FirePaggingRoute {
  52. fire = 1,
  53. teached = 2,
  54. }
  55. export const getCaseScriptInfo = async (caseId) =>
  56. (await axios.get(getCaseScriptInfoUrl, { params:{caseId, ingoreRes: true} }));
  57. export const CaseScriptSaveOrUpdate = async (fire: Omit<Fire, "id">) =>
  58. axios.post(getCaseScriptSaveOrUpdateUrl, fire, {params: {ingoreRes: true}});