index.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <view class="container">
  3. <!-- 顶部导航 -->
  4. <!-- <view class="header">
  5. <view class="nav-bar">
  6. <text class="title">事件处理中心</text>
  7. </view>
  8. </view> -->
  9. <!-- 滚动区域 -->
  10. <scroll-view scroll-y class="content">
  11. <!-- 事件信息 -->
  12. <view class="event-info">
  13. <view class="event-header">
  14. <!-- <text class="event-id">报警编号: {{eventDetail.id}}</text> -->
  15. <text class="event-status">{{eventDetail.statusText}}</text>
  16. </view>
  17. <view class="event-detail">
  18. <view class="detail-item">
  19. <text class="label">发生时间:</text>
  20. <text class="value">{{eventDetail.time}}</text>
  21. </view>
  22. <view class="detail-item">
  23. <text class="label">事件地点:</text>
  24. <text class="value">{{eventDetail.location}}</text>
  25. </view>
  26. <view class="detail-item">
  27. <text class="label">事件类型:</text>
  28. <text class="value">{{eventDetail.type}}</text>
  29. </view>
  30. <view class="detail-item">
  31. <text class="label">严重程度:</text>
  32. <text class="value danger">{{eventDetail.level}}</text>
  33. </view>
  34. </view>
  35. <view class="event-desc">
  36. <text class="desc-title">事件描述</text>
  37. <text class="desc-content">{{eventDetail.description}}</text>
  38. </view>
  39. </view>
  40. <!-- 紧急联动 -->
  41. <view class="emergency-section">
  42. <text class="section-title">紧急联动</text>
  43. <view class="emergency-grid">
  44. <view class="grid-item" v-for="(item, index) in emergencyList" :key="index" @click="handleEmergency(item)">
  45. <uni-icons :type="item.icon" size="28" :color="item.color" />
  46. <text class="grid-text">{{item.text}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 告警信息 -->
  51. <view class="alert-section">
  52. <text class="section-title">处理信息</text>
  53. <textarea class="alert-input" placeholder="请输入处理信息内容" v-model="alertMessage" />
  54. <!-- <view class="alert-actions">
  55. <uni-button class="select-btn" @click="selectReceivers">选择接收人</uni-button>
  56. <uni-button type="primary" @click="sendAlert">发送告警</uni-button>
  57. </view> -->
  58. </view>
  59. </scroll-view>
  60. <!-- 底部操作栏 -->
  61. <view class="footer">
  62. <view class="footer-container">
  63. <text class="mark-text">标记为</text>
  64. <picker :range="alarmArr" :value="index" @change="handleChange">
  65. <button type="primary" size="mini" class="mark-stats">{{alarmArr[index]}}</button>
  66. </picker>
  67. </view>
  68. </view>
  69. <view class="commit">
  70. <uni-button type="default" @click="markComplete">完成</uni-button>
  71. </view>
  72. </view>
  73. </template>
  74. <script lang="ts" setup>
  75. interface EventItem {
  76. id : number;
  77. status : "ignore" | "mistake" | "completed" | "processing" | "pending";
  78. statusText : string;
  79. time : string;
  80. location : string;
  81. level : string;
  82. levelClass : string;
  83. type : string;
  84. description : string;
  85. person : string;
  86. }
  87. import {onMounted, ref} from 'vue';
  88. import {clientPostWithQueryParams} from '../../utils/request';
  89. const alertMessage = ref('');
  90. const alarmArr = ref(["处理中", "已处理", "误报", "忽略"]);
  91. const index = ref(1);
  92. const handleChange = (q) => {
  93. index.value = q.detail.value;
  94. }
  95. const emergencyList = ref([
  96. { text: '110警察', icon: 'phone-filled', color: '#2979ff' },
  97. { text: '119消防', icon: 'fire-filled', color: '#f56c6c' },
  98. { text: '120急救', icon: 'plus-filled', color: '#19be6b' }
  99. ]);
  100. const goBack = () => {
  101. uni.navigateBack();
  102. };
  103. const handleEmergency = (item : any) => {
  104. uni.showModal({
  105. title: '确认操作',
  106. content: `是否确认拨打${item.text}?`,
  107. success: (res) => {
  108. if (res.confirm) {
  109. uni.showToast({ title: `正在拨打${item.text}`, icon: 'none' });
  110. }
  111. }
  112. });
  113. };
  114. const selectReceivers = () => {
  115. uni.showToast({ title: '选择接收人功能开发中', icon: 'none' });
  116. };
  117. const sendAlert = () => {
  118. alertMessage.value = '';
  119. };
  120. const markEvent = async () => {
  121. const res = await clientPostWithQueryParams("/visualization/fireFighting/getAlarmEventProcessing",{
  122. alarmCode:eventDetail.value.id,
  123. alarmDate:eventDetail.value.time,
  124. handleStat:index.value + 1,
  125. handleMessage:alertMessage.value
  126. })
  127. console.log(res);
  128. if(res.code !== 200){
  129. uni.showToast({
  130. title:"请求失败",
  131. duration:2000
  132. })
  133. }else{
  134. uni.showToast({
  135. title:"操作成功",
  136. duration:2000
  137. })
  138. uni.navigateBack();
  139. }
  140. }
  141. const markComplete = () => {
  142. uni.showModal({
  143. title: '确认完成',
  144. content: '是否确认将该事件标记为'+alarmArr.value[index.value]+"?",
  145. success: (res) => {
  146. if (res.confirm) {
  147. markEvent();
  148. }
  149. }
  150. });
  151. };
  152. // const escalateEvent = () => {
  153. // uni.showModal({
  154. // title: '事件升级',
  155. // content: '是否确认将该事件升级处理?',
  156. // success: (res) => {
  157. // if (res.confirm) {
  158. // uni.showToast({ title: '事件已升级', icon: 'success' });
  159. // }
  160. // }
  161. // });
  162. // };
  163. const eventDetail = ref<EventItem>({
  164. id: 0,
  165. status: 'ignore',
  166. statusText: '',
  167. time: '',
  168. location: '',
  169. level: '',
  170. levelClass: '',
  171. type: '',
  172. description: '',
  173. person: ''
  174. });
  175. onMounted(() => {
  176. eventDetail.value = uni.getStorageSync("eventDetail");
  177. })
  178. </script>
  179. <style scoped>
  180. page {
  181. height: 100%;
  182. }
  183. .container {
  184. display: flex;
  185. flex-direction: column;
  186. background-color: #f5f5f5;
  187. }
  188. .header {
  189. flex-shrink: 0;
  190. background-color: #ffffff;
  191. border-bottom: 1px solid #eaeaea;
  192. }
  193. .nav-bar {
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. padding: 20rpx 30rpx;
  198. }
  199. .title {
  200. font-size: 16px;
  201. font-weight: 500;
  202. color: #333333;
  203. }
  204. .content {
  205. flex: 1;
  206. overflow: auto;
  207. }
  208. .event-info {
  209. background-color: #ffffff;
  210. padding: 30rpx;
  211. margin-bottom: 20rpx;
  212. }
  213. .event-header {
  214. display: flex;
  215. justify-content: space-between;
  216. align-items: center;
  217. margin-bottom: 20rpx;
  218. }
  219. .event-id {
  220. font-size: 14px;
  221. color: #666666;
  222. width: 70vw;
  223. }
  224. .event-status {
  225. font-size: 12px;
  226. color: #2979ff;
  227. background-color: #ecf5ff;
  228. padding: 4rpx 16rpx;
  229. border-radius: 4px;
  230. }
  231. .event-detail {
  232. margin-bottom: 30rpx;
  233. }
  234. .detail-item {
  235. display: flex;
  236. margin-bottom: 16rpx;
  237. }
  238. .label {
  239. font-size: 14px;
  240. color: #666666;
  241. width: 160rpx;
  242. }
  243. .value {
  244. font-size: 14px;
  245. color: #333333;
  246. }
  247. .value.danger {
  248. color: #f56c6c;
  249. }
  250. .event-desc {
  251. background-color: #f8f8f8;
  252. padding: 20rpx;
  253. border-radius: 8rpx;
  254. }
  255. .desc-title {
  256. font-size: 14px;
  257. color: #333333;
  258. font-weight: 500;
  259. margin-bottom: 16rpx;
  260. display: block;
  261. }
  262. .desc-content {
  263. font-size: 14px;
  264. color: #666666;
  265. line-height: 1.5;
  266. }
  267. .security-section {
  268. background-color: #ffffff;
  269. padding: 30rpx;
  270. margin-bottom: 20rpx;
  271. }
  272. .section-header {
  273. display: flex;
  274. justify-content: space-between;
  275. align-items: center;
  276. margin-bottom: 20rpx;
  277. }
  278. .section-title {
  279. font-size: 16px;
  280. font-weight: 500;
  281. color: #333333;
  282. }
  283. .security-list {
  284. background-color: #ffffff;
  285. }
  286. .security-item {
  287. display: flex;
  288. justify-content: space-between;
  289. align-items: center;
  290. padding: 20rpx 0;
  291. border-bottom: 1px solid #eaeaea;
  292. }
  293. .security-item:last-child {
  294. border-bottom: none;
  295. }
  296. .security-info {
  297. display: flex;
  298. align-items: center;
  299. }
  300. .avatar-box {
  301. position: relative;
  302. margin-right: 20rpx;
  303. }
  304. .avatar {
  305. width: 80rpx;
  306. height: 80rpx;
  307. border-radius: 50%;
  308. }
  309. .status-dot {
  310. position: absolute;
  311. right: 0;
  312. bottom: 0;
  313. width: 16rpx;
  314. height: 16rpx;
  315. border-radius: 50%;
  316. border: 2px solid #ffffff;
  317. }
  318. .online {
  319. background-color: #19be6b;
  320. }
  321. .offline {
  322. background-color: #999999;
  323. }
  324. .info-content {
  325. display: flex;
  326. flex-direction: column;
  327. }
  328. .name {
  329. font-size: 14px;
  330. color: #333333;
  331. margin-bottom: 8rpx;
  332. }
  333. .location {
  334. font-size: 12px;
  335. color: #999999;
  336. }
  337. .action-area {
  338. display: flex;
  339. align-items: center;
  340. }
  341. .distance {
  342. font-size: 12px;
  343. color: #666666;
  344. margin-right: 20rpx;
  345. }
  346. .emergency-section {
  347. background-color: #ffffff;
  348. padding: 30rpx;
  349. margin-bottom: 20rpx;
  350. }
  351. .emergency-grid {
  352. display: grid;
  353. grid-template-columns: repeat(4, 1fr);
  354. gap: 20rpx;
  355. margin-top: 20rpx;
  356. }
  357. .grid-item {
  358. display: flex;
  359. flex-direction: column;
  360. align-items: center;
  361. justify-content: center;
  362. background-color: #ffffff;
  363. padding: 20rpx;
  364. border-radius: 8rpx;
  365. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  366. }
  367. .grid-text {
  368. font-size: 12px;
  369. color: #666666;
  370. margin-top: 12rpx;
  371. }
  372. .alert-section {
  373. background-color: #ffffff;
  374. padding: 30rpx;
  375. /* margin-bottom: 120rpx; */
  376. }
  377. .alert-input {
  378. width: 100%;
  379. height: 200rpx;
  380. background-color: #f8f8f8;
  381. border-radius: 8rpx;
  382. padding: 20rpx;
  383. font-size: 14px;
  384. margin: 20rpx 0;
  385. box-sizing: border-box;
  386. }
  387. .alert-actions {
  388. display: flex;
  389. justify-content: flex-end;
  390. gap: 20rpx;
  391. }
  392. .select-btn {
  393. background-color: #ffffff !important;
  394. border: 1px solid #dcdfe6 !important;
  395. }
  396. .footer {
  397. display: flex;
  398. margin: 20rpx 0rpx;
  399. background: #fff;
  400. font-size: 16px;
  401. }
  402. .footer-container{
  403. display: flex;
  404. gap: 20rpx;
  405. margin: 30rpx;
  406. }
  407. .mark-text{
  408. line-height: 50rpx;
  409. }
  410. /*
  411. .mark-stats {
  412. color: #2979ff;
  413. border: 1px solid #ccc;
  414. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  415. } */
  416. .commit{
  417. }
  418. </style>