index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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">事件编号: EV20240101001</text>
  15. <text class="event-status">处理中</text>
  16. </view>
  17. <view class="event-detail">
  18. <view class="detail-item">
  19. <text class="label">发生时间:</text>
  20. <text class="value">2024-01-01 10:30</text>
  21. </view>
  22. <view class="detail-item">
  23. <text class="label">事件地点:</text>
  24. <text class="value">A区域-1号楼-101室</text>
  25. </view>
  26. <view class="detail-item">
  27. <text class="label">事件类型:</text>
  28. <text class="value">安全隐患</text>
  29. </view>
  30. <view class="detail-item">
  31. <text class="label">严重程度:</text>
  32. <text class="value danger">高危</text>
  33. </view>
  34. </view>
  35. <view class="event-desc">
  36. <text class="desc-title">事件描述</text>
  37. <text class="desc-content">发现可疑人员在A区域徘徊,疑似携带危险物品,需要立即处理。</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. <uni-button type="default" @click="markComplete">标记处理完成</uni-button>
  63. <uni-button type="warn" @click="escalateEvent">事件升级</uni-button>
  64. </view>
  65. </view>
  66. </template>
  67. <script lang="ts" setup>
  68. import { ref } from 'vue';
  69. const alertMessage = ref('');
  70. const securityList = ref([
  71. {
  72. name: '张警官',
  73. avatar: 'https://ai-public.mastergo.com/ai/img_res/40599d84c3ff6f1f857d0d5b1209e880.jpg',
  74. location: 'A区域-2号楼',
  75. distance: '50',
  76. online: true
  77. },
  78. {
  79. name: '李警官',
  80. avatar: 'https://ai-public.mastergo.com/ai/img_res/ab6b488f45c3634c6f8a5b2b8c0df36e.jpg',
  81. location: 'B区域-1号楼',
  82. distance: '150',
  83. online: true
  84. },
  85. {
  86. name: '王警官',
  87. avatar: 'https://ai-public.mastergo.com/ai/img_res/9334d63f8a4889e90da6858a94fd5306.jpg',
  88. location: 'C区域-3号楼',
  89. distance: '200',
  90. online: false
  91. }
  92. ]);
  93. const emergencyList = ref([
  94. { text: '110警察', icon: 'phone-filled', color: '#2979ff' },
  95. { text: '119消防', icon: 'fire-filled', color: '#f56c6c' },
  96. { text: '120急救', icon: 'plus-filled', color: '#19be6b' }
  97. ]);
  98. const goBack = () => {
  99. uni.navigateBack();
  100. };
  101. const handleEmergency = (item : any) => {
  102. uni.showModal({
  103. title: '确认操作',
  104. content: `是否确认拨打${item.text}?`,
  105. success: (res) => {
  106. if (res.confirm) {
  107. uni.showToast({ title: `正在拨打${item.text}`, icon: 'none' });
  108. }
  109. }
  110. });
  111. };
  112. const selectReceivers = () => {
  113. uni.showToast({ title: '选择接收人功能开发中', icon: 'none' });
  114. };
  115. const sendAlert = () => {
  116. if (!alertMessage.value) {
  117. uni.showToast({ title: '请输入告警信息', icon: 'none' });
  118. return;
  119. }
  120. uni.showToast({ title: '告警信息已发送', icon: 'success' });
  121. alertMessage.value = '';
  122. };
  123. const markComplete = () => {
  124. uni.showModal({
  125. title: '确认完成',
  126. content: '是否确认将该事件标记为已处理完成?',
  127. success: (res) => {
  128. if (res.confirm) {
  129. uni.showToast({ title: '事件已标记完成', icon: 'success' });
  130. }
  131. }
  132. });
  133. };
  134. const escalateEvent = () => {
  135. uni.showModal({
  136. title: '事件升级',
  137. content: '是否确认将该事件升级处理?',
  138. success: (res) => {
  139. if (res.confirm) {
  140. uni.showToast({ title: '事件已升级', icon: 'success' });
  141. }
  142. }
  143. });
  144. };
  145. </script>
  146. <style>
  147. page {
  148. height: 100%;
  149. }
  150. .container {
  151. height: 100%;
  152. display: flex;
  153. flex-direction: column;
  154. background-color: #f5f5f5;
  155. }
  156. .header {
  157. flex-shrink: 0;
  158. background-color: #ffffff;
  159. border-bottom: 1px solid #eaeaea;
  160. }
  161. .nav-bar {
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. padding: 20rpx 30rpx;
  166. }
  167. .title {
  168. font-size: 16px;
  169. font-weight: 500;
  170. color: #333333;
  171. }
  172. .content {
  173. flex: 1;
  174. overflow: auto;
  175. }
  176. .event-info {
  177. background-color: #ffffff;
  178. padding: 30rpx;
  179. margin-bottom: 20rpx;
  180. }
  181. .event-header {
  182. display: flex;
  183. justify-content: space-between;
  184. align-items: center;
  185. margin-bottom: 20rpx;
  186. }
  187. .event-id {
  188. font-size: 14px;
  189. color: #666666;
  190. }
  191. .event-status {
  192. font-size: 12px;
  193. color: #2979ff;
  194. background-color: #ecf5ff;
  195. padding: 4rpx 16rpx;
  196. border-radius: 4px;
  197. }
  198. .event-detail {
  199. margin-bottom: 30rpx;
  200. }
  201. .detail-item {
  202. display: flex;
  203. margin-bottom: 16rpx;
  204. }
  205. .label {
  206. font-size: 14px;
  207. color: #666666;
  208. width: 160rpx;
  209. }
  210. .value {
  211. font-size: 14px;
  212. color: #333333;
  213. }
  214. .value.danger {
  215. color: #f56c6c;
  216. }
  217. .event-desc {
  218. background-color: #f8f8f8;
  219. padding: 20rpx;
  220. border-radius: 8rpx;
  221. }
  222. .desc-title {
  223. font-size: 14px;
  224. color: #333333;
  225. font-weight: 500;
  226. margin-bottom: 16rpx;
  227. display: block;
  228. }
  229. .desc-content {
  230. font-size: 14px;
  231. color: #666666;
  232. line-height: 1.5;
  233. }
  234. .security-section {
  235. background-color: #ffffff;
  236. padding: 30rpx;
  237. margin-bottom: 20rpx;
  238. }
  239. .section-header {
  240. display: flex;
  241. justify-content: space-between;
  242. align-items: center;
  243. margin-bottom: 20rpx;
  244. }
  245. .section-title {
  246. font-size: 16px;
  247. font-weight: 500;
  248. color: #333333;
  249. }
  250. .security-list {
  251. background-color: #ffffff;
  252. }
  253. .security-item {
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. padding: 20rpx 0;
  258. border-bottom: 1px solid #eaeaea;
  259. }
  260. .security-item:last-child {
  261. border-bottom: none;
  262. }
  263. .security-info {
  264. display: flex;
  265. align-items: center;
  266. }
  267. .avatar-box {
  268. position: relative;
  269. margin-right: 20rpx;
  270. }
  271. .avatar {
  272. width: 80rpx;
  273. height: 80rpx;
  274. border-radius: 50%;
  275. }
  276. .status-dot {
  277. position: absolute;
  278. right: 0;
  279. bottom: 0;
  280. width: 16rpx;
  281. height: 16rpx;
  282. border-radius: 50%;
  283. border: 2px solid #ffffff;
  284. }
  285. .online {
  286. background-color: #19be6b;
  287. }
  288. .offline {
  289. background-color: #999999;
  290. }
  291. .info-content {
  292. display: flex;
  293. flex-direction: column;
  294. }
  295. .name {
  296. font-size: 14px;
  297. color: #333333;
  298. margin-bottom: 8rpx;
  299. }
  300. .location {
  301. font-size: 12px;
  302. color: #999999;
  303. }
  304. .action-area {
  305. display: flex;
  306. align-items: center;
  307. }
  308. .distance {
  309. font-size: 12px;
  310. color: #666666;
  311. margin-right: 20rpx;
  312. }
  313. .emergency-section {
  314. background-color: #ffffff;
  315. padding: 30rpx;
  316. margin-bottom: 20rpx;
  317. }
  318. .emergency-grid {
  319. display: grid;
  320. grid-template-columns: repeat(4, 1fr);
  321. gap: 20rpx;
  322. margin-top: 20rpx;
  323. }
  324. .grid-item {
  325. display: flex;
  326. flex-direction: column;
  327. align-items: center;
  328. justify-content: center;
  329. background-color: #ffffff;
  330. padding: 20rpx;
  331. border-radius: 8rpx;
  332. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  333. }
  334. .grid-text {
  335. font-size: 12px;
  336. color: #666666;
  337. margin-top: 12rpx;
  338. }
  339. .alert-section {
  340. background-color: #ffffff;
  341. padding: 30rpx;
  342. margin-bottom: 120rpx;
  343. }
  344. .alert-input {
  345. width: 100%;
  346. height: 200rpx;
  347. background-color: #f8f8f8;
  348. border-radius: 8rpx;
  349. padding: 20rpx;
  350. font-size: 14px;
  351. margin: 20rpx 0;
  352. box-sizing: border-box;
  353. }
  354. .alert-actions {
  355. display: flex;
  356. justify-content: flex-end;
  357. gap: 20rpx;
  358. }
  359. .select-btn {
  360. background-color: #ffffff !important;
  361. border: 1px solid #dcdfe6 !important;
  362. }
  363. .footer {
  364. position: fixed;
  365. bottom: 0;
  366. left: 0;
  367. right: 0;
  368. display: flex;
  369. justify-content: space-between;
  370. padding: 20rpx 30rpx;
  371. background-color: #ffffff;
  372. box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  373. }
  374. </style>