dispatch.js 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. import request from '@/utils/request'
  2. // ============ 应急事件统一档案(全生命周期闭环) ============
  3. // 接报登记(0 待核实) -> 初判核实(1 已核实 / 4 不实事件) -> 开始处置(2 处置中) -> 事件解除(3 已解除)
  4. // 转接 / 报送 / 处置跟踪 / 工作催办只写操作日志,不改变事件状态
  5. export function getEventPage(pageNum, pageSize, params) {
  6. return request({ url: '/api/dispatch/event/findByPage', method: 'get', params: { pageNum, pageSize, ...params } })
  7. }
  8. export function getEventDetail(id) {
  9. return request({ url: '/api/dispatch/event/getDetail/' + id, method: 'get' })
  10. }
  11. export function getEventStats(params) {
  12. return request({ url: '/api/dispatch/event/stats', method: 'get', params })
  13. }
  14. // 事件状态下拉项(后端返回 EventStatusEnum 的 编码 + 中文)
  15. export function getEventStatusOptions() {
  16. return request({ url: '/api/dispatch/event/statusOptions', method: 'get' })
  17. }
  18. // 接报登记
  19. export function saveEventReport(data) {
  20. return request({ url: '/api/dispatch/event/saveReport', method: 'post', data })
  21. }
  22. export function updateEventInfo(data) {
  23. return request({ url: '/api/dispatch/event/updateById', method: 'put', data })
  24. }
  25. export function deleteEventInfo(id) {
  26. return request({ url: '/api/dispatch/event/deleteById', method: 'delete', params: { id } })
  27. }
  28. // 初判核实:verifyResult 0-真实 1-不实
  29. export function verifyEventInfo(id, data) {
  30. return request({ url: '/api/dispatch/event/verify/' + id, method: 'put', data })
  31. }
  32. // 责任处置人下拉项(系统用户:昵称 + 联系电话 + 所属部门),选中后自动带出联系电话
  33. export function getUserOptions() {
  34. return request({ url: '/api/dispatch/event/userOptions', method: 'get' })
  35. }
  36. // 责任单位候选(系统部门,前端据 parentId 建树)
  37. export function getDeptOptions() {
  38. return request({ url: '/api/dispatch/event/deptOptions', method: 'get' })
  39. }
  40. // 调度首页看板(统计卡 + GIS 点位 + 处置中事件 + 类型/等级分布)
  41. export function getHomeBoard() {
  42. return request({ url: '/api/dispatch/event/home', method: 'get' })
  43. }
  44. // 我的催办消息(未读在前)+ 未读数
  45. export function getMyNotifies(limit = 20) {
  46. return request({ url: '/api/dispatch/notify/my', method: 'get', params: { limit } })
  47. }
  48. // 标记单条催办消息已读
  49. export function markNotifyRead(id) {
  50. return request({ url: '/api/dispatch/notify/read/' + id, method: 'post' })
  51. }
  52. // 全部标记已读
  53. export function markAllNotifiesRead() {
  54. return request({ url: '/api/dispatch/notify/readAll', method: 'post' })
  55. }
  56. // 转接 / 报送(不改状态)
  57. export function transferEvent(data) {
  58. return request({ url: '/api/dispatch/event/transfer', method: 'post', data })
  59. }
  60. export function reportEvent(data) {
  61. return request({ url: '/api/dispatch/event/report', method: 'post', data })
  62. }
  63. // 处置:开始处置 / 跟踪 / 解除
  64. export function startDisposeEvent(data) {
  65. return request({ url: '/api/dispatch/event/startDispose', method: 'post', data })
  66. }
  67. export function trackEvent(data) {
  68. return request({ url: '/api/dispatch/event/track', method: 'post', data })
  69. }
  70. export function releaseEventInfo(id, data) {
  71. return request({ url: '/api/dispatch/event/release/' + id, method: 'post', data })
  72. }
  73. // 工作催办(不改状态)
  74. export function getEventUrgePage(pageNum, pageSize, params) {
  75. return request({ url: '/api/dispatch/event/urge/findByPage', method: 'get', params: { pageNum, pageSize, ...params } })
  76. }
  77. export function urgeEvent(data) {
  78. return request({ url: '/api/dispatch/event/urge', method: 'post', data })
  79. }
  80. // 事件操作日志(时间线);operType 可选:8 为工作催办记录
  81. export function getEventLogs(eventId, operType) {
  82. return request({ url: '/api/dispatch/event/logs/' + eventId, method: 'get', params: { operType } })
  83. }
  84. // ============ 应急事件分级标准 ============
  85. export function getEventGradePage(pageNum, pageSize, params) {
  86. return request({ url: '/api/dispatch/grade/findByPage', method: 'get', params: { pageNum, pageSize, ...params } })
  87. }
  88. export function getEventGradeStatusOptions() {
  89. return request({ url: '/api/dispatch/grade/statusOptions', method: 'get' })
  90. }
  91. export function addEventGrade(data) {
  92. return request({ url: '/api/dispatch/grade/save', method: 'post', data })
  93. }
  94. export function updateEventGrade(data) {
  95. return request({ url: '/api/dispatch/grade/updateById', method: 'put', data })
  96. }
  97. export function deleteEventGrade(id) {
  98. return request({ url: '/api/dispatch/grade/deleteById', method: 'delete', params: { id } })
  99. }
  100. // ============ 应急预案(编辑 + 审批共用一套数据) ============
  101. // 0 草稿 -> 1 待审核 -> 2 已通过 / 3 已驳回;已通过的预案再保存视为「修订」,生成审核中的候选版本
  102. export function getEventPlanPage(pageNum, pageSize, params) {
  103. return request({ url: '/api/dispatch/plan/findByPage', method: 'get', params: { pageNum, pageSize, ...params } })
  104. }
  105. export function getEventPlanById(id) {
  106. return request({ url: '/api/dispatch/plan/getDetail/' + id, method: 'get' })
  107. }
  108. export function getPlanStatusOptions() {
  109. return request({ url: '/api/dispatch/plan/statusOptions', method: 'get' })
  110. }
  111. export function getPlanTemplates(pageNum = 1, pageSize = 50, params = {}) {
  112. return request({ url: '/api/dispatch/plan/templates', method: 'get', params: { pageNum, pageSize, ...params } })
  113. }
  114. // 新增草稿 / 修改预案 / 修订已通过预案
  115. export function saveEventPlan(data) {
  116. return request({ url: '/api/dispatch/plan/save', method: 'post', data })
  117. }
  118. export function deleteEventPlan(id) {
  119. return request({ url: '/api/dispatch/plan/deleteById', method: 'delete', params: { id } })
  120. }
  121. export function submitEventPlan(id) {
  122. return request({ url: '/api/dispatch/plan/submit/' + id, method: 'post' })
  123. }
  124. export function approvePlan(id, data) {
  125. return request({ url: '/api/dispatch/plan/approve/' + id, method: 'post', data })
  126. }
  127. export function rejectPlan(id, data) {
  128. return request({ url: '/api/dispatch/plan/reject/' + id, method: 'post', data })
  129. }
  130. export function getPlanVersions(planId) {
  131. return request({ url: '/api/dispatch/plan/versions/' + planId, method: 'get' })
  132. }
  133. export function getPlanVersion(versionId) {
  134. return request({ url: '/api/dispatch/plan/version/' + versionId, method: 'get' })
  135. }
  136. export function getPlanLogs(planId) {
  137. return request({ url: '/api/dispatch/plan/logs/' + planId, method: 'get' })
  138. }
  139. // ============ 数字预案库匹配(应急预案选择) ============
  140. export function getPlanLibraryList() {
  141. return request({ url: '/api/dispatch/plan-library/list', method: 'get' })
  142. }
  143. export function matchPlan(data) {
  144. return request({ url: '/api/dispatch/plan-library/match', method: 'post', data })
  145. }
  146. export function matchPlanByTopic(data) {
  147. return request({ url: '/api/dispatch/plan-library/matchByTopic', method: 'post', data })
  148. }
  149. export function getPlanMatchHistory(limit = 10) {
  150. return request({ url: '/api/dispatch/plan-library/history', method: 'get', params: { limit } })
  151. }
  152. export function applyPlan(data) {
  153. return request({ url: '/api/dispatch/plan-library/apply', method: 'post', data })
  154. }
  155. // ============ 应急事件事后评估(总结评估) ============
  156. // 事件(已解除) -> 四维评分 -> 生成报告/录入案例库
  157. export function getEventAssess(eventId) {
  158. return request({ url: '/api/dispatch/assess/findByEventId', method: 'get', params: { eventId } })
  159. }
  160. export function listEventAssess(eventIds) {
  161. return request({ url: '/api/dispatch/assess/listByEventIds', method: 'get', params: { eventIds: eventIds.join(',') } })
  162. }
  163. export function saveEventAssess(data) {
  164. return request({ url: '/api/dispatch/assess/save', method: 'post', data })
  165. }
  166. export function deleteEventAssess(eventId) {
  167. return request({ url: '/api/dispatch/assess/delete', method: 'delete', params: { eventId } })
  168. }