script.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. let res = await axios.get(getCaseScriptInfoUrl, { params:{caseId, ingoreRes: true} });
  57. console.log(res);
  58. if(res && res.code === 0) {
  59. return res.data;
  60. }else{
  61. // window.location.href = '/'
  62. throw "用户未登录";
  63. }
  64. }
  65. export const CaseScriptSaveOrUpdate = async (fire: Omit<Fire, "id">) =>
  66. axios.post(getCaseScriptSaveOrUpdateUrl, fire, {params: {ingoreRes: true}});