emergencyTrafficAccidents.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. <template>
  2. <div class="container">
  3. <div class="event-box">
  4. <div class="box-header">
  5. <div class="title-box">
  6. <div class="title"><i class="icon-speaker" />重大事件信息</div>
  7. </div>
  8. <div class="more">查看更多>></div>
  9. </div>
  10. <div class="event-content">
  11. <div class="text1">{{ noticeBarState.event_title }}</div>
  12. <div class="text2">{{ noticeBarState.time }}</div>
  13. </div>
  14. </div>
  15. <div class="content" style="margin-top: 0">
  16. <div class="card-box">
  17. <div class="card-item">
  18. <div class="text1">事故数量</div>
  19. <div class="text-box">
  20. <div class="text2">47</div>
  21. <div class="text3">起</div>
  22. </div>
  23. </div>
  24. <div class="card-item">
  25. <div class="text1">伤亡人数</div>
  26. <div class="text-box">
  27. <div class="text2">1,302</div>
  28. <div class="text3">人</div>
  29. </div>
  30. </div>
  31. <div class="card-item">
  32. <div class="text1">经济损失</div>
  33. <div class="text-box">
  34. <div class="text2">221</div>
  35. <div class="text3">万</div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="content" style="margin-top: 0">
  41. <div class="card">
  42. <div class="card-header">
  43. <i class="icon-line" />
  44. <div class="text">交通事故隐患点情况</div>
  45. </div>
  46. <div class="card-content2">
  47. <div class="card1">
  48. <div class="text1">交通事故隐患点总数</div>
  49. <div class="text-box">
  50. <div class="text-blue">10</div>
  51. <div class="text2">个</div>
  52. </div>
  53. </div>
  54. <div class="flex-box">
  55. <div class="card2">
  56. <div class="text1">高风险</div>
  57. <div class="text-box">
  58. <div class="text-red">2</div>
  59. <div class="text2">个</div>
  60. </div>
  61. </div>
  62. <div class="card3">
  63. <div class="text1">中风险</div>
  64. <div class="text-box">
  65. <div class="text-orange">3</div>
  66. <div class="text2">个</div>
  67. </div>
  68. </div>
  69. <div class="card4">
  70. <div class="text1">低风险</div>
  71. <div class="text-box">
  72. <div class="text-green">5</div>
  73. <div class="text2">个</div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="content">
  81. <div class="card">
  82. <div class="card-header">
  83. <i class="icon-line" />
  84. <div class="text">事故原因统计</div>
  85. </div>
  86. <Chart :option="option1" style="height: 200px" />
  87. </div>
  88. </div>
  89. <div class="content">
  90. <div class="card">
  91. <div class="card-header">
  92. <i class="icon-line" />
  93. <div class="text">事件列表</div>
  94. </div>
  95. <div class="select-box" @click="showPicker = true">
  96. <div class="text1">年度</div>
  97. <div class="select-item">
  98. <div class="label">{{ yearLabel ? yearLabel : "请选择" }}</div>
  99. <i class="icon-down" />
  100. </div>
  101. </div>
  102. <el-table :data="detailsData.dataList" border table-layout="auto">
  103. <el-table-column label="类型" prop="data1" align="center" />
  104. <el-table-column label="位置" prop="data2" align="center" />
  105. <el-table-column label="发生时间" prop="data3" align="center" />
  106. <el-table-column label="受伤人数" prop="data4" align="center" />
  107. <el-table-column label="死亡人数" prop="data5" align="center" />
  108. </el-table>
  109. </div>
  110. </div>
  111. <van-popup v-model:show="showPicker" round position="bottom">
  112. <van-picker
  113. :columns="columns"
  114. @cancel="showPicker = false"
  115. @confirm="onPickerConfirm"
  116. />
  117. </van-popup>
  118. </div>
  119. </template>
  120. <script lang="ts" setup name="cityEmergencyEvent">
  121. import { reactive, ref } from "vue";
  122. import { onClickOutside } from "@vueuse/core";
  123. import { chartOption7 } from "@/views/disasterRiskMonitor/chartOptions";
  124. import { ElTable, ElTableColumn } from "element-plus";
  125. const noticeBarState = reactive({
  126. show: false,
  127. event_id: "",
  128. time: "2024-03-01 12:12:12",
  129. event_title:
  130. "2025年3月24日,S10山海高速五指山往保亭方向32km+300m路段。一辆白色小型普通客车在快车道行驶时,突然向左偏离方向剐蹭了中央护栏…"
  131. });
  132. // 搜索
  133. const searchBoxRef = ref();
  134. let showSearch = ref();
  135. const queryParams = reactive({
  136. page: 0,
  137. page_size: 10,
  138. year: "",
  139. keywords: ""
  140. });
  141. let yearLabel = ref("");
  142. onClickOutside(searchBoxRef, event => {
  143. showSearch.value = false;
  144. });
  145. let detailsData = ref({
  146. dataList: []
  147. });
  148. const option1 = ref(chartOption7);
  149. let showPicker = ref(false);
  150. let columns = reactive([
  151. { text: "2024年", value: "2024" },
  152. { text: "2023年", value: "2023" },
  153. { text: "2022年", value: "2022" },
  154. { text: "2021年", value: "2021" }
  155. ]);
  156. const getImageUrl = name => {
  157. return new URL(
  158. `../../assets/images/disasterRiskMonitor/cityEmergencyEvent/${name}`,
  159. import.meta.url
  160. ).href;
  161. };
  162. let iconList = reactive({
  163. "1": {
  164. image: getImageUrl("icon2.png"),
  165. size: [20, 20]
  166. },
  167. "2": {
  168. image: getImageUrl("icon1.png"),
  169. size: [20, 20]
  170. }
  171. });
  172. const onPickerConfirm = ({ selectedOptions }) => {
  173. showPicker.value = false;
  174. yearLabel.value = selectedOptions[0].text;
  175. queryParams.year = selectedOptions[0].value;
  176. };
  177. const initData = () => {
  178. option1.value.xAxis.data = [
  179. "2024-01",
  180. "2024-02",
  181. "2024-03",
  182. "2024-04",
  183. "2024-05",
  184. "2024-06"
  185. ];
  186. option1.value.series[0].data = [
  187. 502.84, 205.97, 332.79, 281.55, 398.35, 214.02
  188. ];
  189. // 事件列表
  190. detailsData.value.dataList = [
  191. {
  192. data1: "追尾",
  193. data2: "茂名市电白区黄岭镇石头村",
  194. data3: "2024-12-14 12:12:13",
  195. data4: 1,
  196. data5: 0,
  197. longitude: "110.719914",
  198. latitude: "21.609269",
  199. dataType: "1"
  200. },
  201. {
  202. data1: "碰撞行人",
  203. data2: "茂名市茂南区羊角镇",
  204. data3: "2024-10-07 08:00:00",
  205. data4: 2,
  206. data5: 0,
  207. longitude: "110.984948",
  208. latitude: "21.669318",
  209. dataType: "1"
  210. }
  211. ];
  212. detailsData.value.dataList.forEach(item => {
  213. const icon =
  214. item.dataType && !!iconList[item.dataType].image
  215. ? iconList[item.dataType].image
  216. : "";
  217. item.icon = icon;
  218. item.image = icon;
  219. item.imageHover = icon;
  220. item.size = iconList[item.dataType].size;
  221. item.lnglat = [item.longitude, item.latitude];
  222. });
  223. };
  224. initData();
  225. </script>
  226. <style lang="scss" scoped>
  227. .container {
  228. .map {
  229. width: 100%;
  230. height: 250px;
  231. }
  232. .event-box {
  233. position: relative;
  234. width: 375px;
  235. height: 117px;
  236. background: url("@/assets/images/disasterRiskMonitor/cityEmergencyEvent/box1.png")
  237. no-repeat;
  238. background-size: 100% 100%;
  239. box-shadow: 0 2px 4px 0 rgba(228, 240, 255, 1);
  240. .box-header {
  241. display: flex;
  242. justify-content: space-between;
  243. align-items: center;
  244. padding: 0 6px;
  245. .more {
  246. font-size: 12px;
  247. color: #2c81ff;
  248. }
  249. }
  250. .title-box {
  251. height: 30px;
  252. background-color: #ffffff; /* 背景颜色 */
  253. transform: skewX(-20deg); /* 斜切变形 */
  254. box-shadow: 0 2px 4px 0 rgba(250, 217, 97, 0.18);
  255. padding: 0 10px;
  256. display: flex;
  257. align-items: center;
  258. border-radius: 2px;
  259. &::after {
  260. content: "";
  261. position: absolute;
  262. top: 0;
  263. right: -6px;
  264. transform: skewX(20deg);
  265. width: 11px;
  266. height: 27px;
  267. background: url("@/assets/images/disasterRiskMonitor/riverMonitor/thickness.png")
  268. no-repeat;
  269. background-size: 100% 100%;
  270. }
  271. .title {
  272. font-size: 14px;
  273. color: #ffaf00;
  274. transform: skewX(20deg);
  275. display: flex;
  276. align-items: center;
  277. .icon-speaker {
  278. display: inline-block;
  279. width: 16px;
  280. height: 16px;
  281. background: url("@/assets/images/disasterRiskMonitor/riverMonitor/speaker.png")
  282. no-repeat;
  283. background-size: 100% 100%;
  284. margin-right: 5px;
  285. }
  286. }
  287. }
  288. .event-content {
  289. padding: 0 10px;
  290. }
  291. .text1 {
  292. display: -webkit-box;
  293. -webkit-line-clamp: 3;
  294. -webkit-box-orient: vertical;
  295. overflow: hidden;
  296. text-overflow: ellipsis;
  297. font-size: 14px;
  298. color: #414f64;
  299. }
  300. .text2 {
  301. font-size: 12px;
  302. color: rgba(0, 0, 0, 0.45);
  303. text-align: right;
  304. }
  305. }
  306. }
  307. .search-box {
  308. padding: 16px 16px 10px;
  309. }
  310. .search-list {
  311. position: absolute;
  312. top: 50px;
  313. left: 0;
  314. z-index: 9;
  315. width: 100%;
  316. height: calc(100vh - 400px);
  317. overflow-y: auto;
  318. background-color: #ffffff;
  319. border-top: 1px solid #eeeeee;
  320. .item {
  321. padding: 8px 15px;
  322. border-bottom: 1px solid #eeeeee;
  323. }
  324. }
  325. .common-search {
  326. border: 1px solid #dce0ee;
  327. border-radius: 2px;
  328. padding: 0;
  329. :deep(.van-field__control) {
  330. &::placeholder {
  331. color: #c9cfd9;
  332. }
  333. }
  334. :deep(.van-search__content) {
  335. background-color: #ffffff;
  336. border: none !important;
  337. }
  338. :deep(.van-field__left-icon) {
  339. .van-icon__image {
  340. width: 12px;
  341. height: 12px;
  342. }
  343. }
  344. :deep(.van-field__right-icon) {
  345. width: 30px;
  346. height: 30px;
  347. padding: 0;
  348. .van-icon__image {
  349. width: 30px;
  350. height: 30px;
  351. }
  352. }
  353. .search-btn {
  354. font-size: 14px;
  355. color: #2c81ff;
  356. }
  357. }
  358. .card {
  359. background-color: #ffffff;
  360. border: 1px solid #eaedf7;
  361. border-radius: 4px;
  362. padding: 2px;
  363. margin-top: 16px;
  364. &:first-child {
  365. margin-top: 0;
  366. }
  367. .card-header {
  368. font-size: 16px;
  369. color: #414f64;
  370. font-weight: bold;
  371. line-height: 26px;
  372. padding: 11px 10px;
  373. display: flex;
  374. align-items: center;
  375. border-top-left-radius: 4px;
  376. border-top-right-radius: 4px;
  377. background-image: linear-gradient(180deg, #f3f7fd 0%, #ffffff 100%);
  378. .icon-line {
  379. display: inline-block;
  380. width: 6px;
  381. height: 16px;
  382. background: url("@/assets/images/line.jpg") no-repeat;
  383. background-size: 100% 100%;
  384. margin-right: 3px;
  385. }
  386. }
  387. }
  388. .content {
  389. padding: 0 16px;
  390. margin-top: 16px;
  391. }
  392. .select-box {
  393. display: flex;
  394. justify-content: flex-end;
  395. align-items: center;
  396. margin-bottom: 10px;
  397. padding-right: 20px;
  398. .text1 {
  399. font-size: 14px;
  400. color: #414f64;
  401. margin-right: 5px;
  402. }
  403. .select-item {
  404. background-color: #f4f7fc;
  405. padding: 5px;
  406. min-width: 92px;
  407. height: 32px;
  408. border-raduis: 4px;
  409. font-size: 14px;
  410. color: #414f64;
  411. display: flex;
  412. align-items: center;
  413. .label {
  414. flex: 1;
  415. }
  416. .icon-down {
  417. flex-shrink: 0;
  418. display: inline-block;
  419. width: 14px;
  420. height: 14px;
  421. background: url("@/assets/images/down.png") no-repeat;
  422. background-size: 100% 100%;
  423. margin-left: 5px;
  424. }
  425. }
  426. }
  427. .card-box {
  428. display: flex;
  429. justify-content: space-between;
  430. padding: 15px 10px;
  431. .card-item {
  432. width: 101px;
  433. height: 104px;
  434. background: url("@/assets/images/disasterRiskMonitor/geologicalDisaster/card3.png")
  435. no-repeat;
  436. background-size: 100% 100%;
  437. display: flex;
  438. flex-direction: column;
  439. align-items: center;
  440. padding-top: 9px;
  441. &:nth-child(2) {
  442. background: url("@/assets/images/disasterRiskMonitor/geologicalDisaster/card4.png")
  443. no-repeat;
  444. background-size: 100% 100%;
  445. }
  446. &:nth-child(3) {
  447. background: url("@/assets/images/disasterRiskMonitor/geologicalDisaster/card5.png")
  448. no-repeat;
  449. background-size: 100% 100%;
  450. }
  451. .text1 {
  452. font-size: 14px;
  453. color: #414f64;
  454. line-height: 26px;
  455. }
  456. .text-box {
  457. display: flex;
  458. align-items: baseline;
  459. .text2 {
  460. font-size: 24px;
  461. font-weight: bold;
  462. color: #ff2f3c;
  463. }
  464. .text3 {
  465. font-size: 12px;
  466. color: #414f64;
  467. line-height: 26px;
  468. margin-left: 5px;
  469. }
  470. }
  471. }
  472. }
  473. .card {
  474. background-color: #ffffff;
  475. border: 1px solid #eaedf7;
  476. box-shadow: 0 0 4px 0 #4554661a;
  477. border-radius: 4px;
  478. padding: 2px;
  479. margin-top: 16px;
  480. &:first-child {
  481. margin-top: 0;
  482. }
  483. .card-header {
  484. font-size: 16px;
  485. color: #414f64;
  486. font-weight: bold;
  487. line-height: 26px;
  488. padding: 11px 10px;
  489. display: flex;
  490. align-items: center;
  491. border-top-left-radius: 4px;
  492. border-top-right-radius: 4px;
  493. background-image: linear-gradient(180deg, #f3f7fd 0%, #ffffff 100%);
  494. .flex {
  495. display: flex;
  496. align-items: center;
  497. }
  498. .icon-line {
  499. display: inline-block;
  500. width: 6px;
  501. height: 16px;
  502. background: url("@/assets/images/line.jpg") no-repeat;
  503. background-size: 100% 100%;
  504. margin-right: 3px;
  505. }
  506. }
  507. .sub-text {
  508. font-size: 12px;
  509. padding: 0 5px;
  510. color: rgba(0, 0, 0, 0.45);
  511. margin-top: -7px;
  512. }
  513. .sub-text2 {
  514. font-size: 12px;
  515. font-weight: normal;
  516. padding: 0 5px;
  517. color: #7f8b9f;
  518. }
  519. .card-content {
  520. padding: 0 5px 13px 8px;
  521. //padding-bottom: 13px;
  522. display: flex;
  523. justify-content: space-between;
  524. .card1 {
  525. width: 147px;
  526. height: 99px;
  527. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/card5.png")
  528. no-repeat;
  529. background-size: 100% 100%;
  530. box-shadow: 0 2px 11px 0 rgba(44, 129, 255, 0.1);
  531. padding: 5px 15px;
  532. color: #ff2f3c;
  533. .text1 {
  534. font-size: 16px;
  535. font-weight: bold;
  536. }
  537. .text2 {
  538. font-size: 18px;
  539. font-weight: bold;
  540. }
  541. .text {
  542. font-size: 14px;
  543. }
  544. }
  545. .card2 {
  546. width: 169px;
  547. height: 99px;
  548. padding: 5px 8px;
  549. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/card6.png")
  550. no-repeat;
  551. background-size: 100% 100%;
  552. box-shadow: 0 2px 11px 0 rgba(44, 129, 255, 0.1);
  553. display: flex;
  554. flex-direction: column;
  555. justify-content: space-between;
  556. .tr {
  557. display: flex;
  558. justify-content: space-between;
  559. align-items: center;
  560. &:nth-child(1) {
  561. color: #ff2f3c;
  562. }
  563. &:nth-child(2) {
  564. color: #ff7d00;
  565. }
  566. &:nth-child(3) {
  567. color: #ffd45e;
  568. }
  569. .text1 {
  570. }
  571. .td {
  572. margin: 0 2px;
  573. font-size: 13px;
  574. &:nth-child(3) {
  575. font-size: 15px;
  576. font-weight: bold;
  577. }
  578. }
  579. }
  580. }
  581. }
  582. .card-content2 {
  583. padding-bottom: 7px;
  584. display: flex;
  585. flex-direction: column;
  586. align-items: center;
  587. .card1 {
  588. width: 341px;
  589. height: 84px;
  590. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/card1.png")
  591. no-repeat;
  592. background-size: 100% 100%;
  593. padding: 5px 185px 5px 27px;
  594. display: flex;
  595. flex-direction: column;
  596. justify-content: center;
  597. align-items: center;
  598. }
  599. .text1 {
  600. font-size: 14px;
  601. color: #414f64;
  602. line-height: 26px;
  603. }
  604. .text-box {
  605. display: flex;
  606. align-items: center;
  607. .text-blue {
  608. font-size: 24px;
  609. color: #2c81ff;
  610. font-width: bold;
  611. }
  612. .text-red {
  613. font-size: 24px;
  614. color: #ff2f3c;
  615. font-width: bold;
  616. }
  617. .text-orange {
  618. font-size: 24px;
  619. color: #ffaf00;
  620. font-width: bold;
  621. }
  622. .text-green {
  623. font-size: 24px;
  624. color: #40c75f;
  625. font-width: bold;
  626. }
  627. .text2 {
  628. font-size: 12px;
  629. color: #414f64;
  630. }
  631. }
  632. .flex-box {
  633. width: 328px;
  634. display: flex;
  635. justify-content: space-between;
  636. }
  637. .card2 {
  638. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/card2.png")
  639. no-repeat;
  640. }
  641. .card3 {
  642. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/card3.png")
  643. no-repeat;
  644. box-shadow: 0 1px 6px 0 rgba(245, 225, 160, 0.24);
  645. }
  646. .card4 {
  647. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/card4.png")
  648. no-repeat;
  649. box-shadow: 0 0 4px 0 rgba(69, 84, 102, 0.1);
  650. }
  651. .card2,
  652. .card3,
  653. .card4 {
  654. width: 106px;
  655. height: 71px;
  656. background-position: center center;
  657. background-size: 118px 84px;
  658. padding: 5px 27px 5px 27px;
  659. display: flex;
  660. flex-direction: column;
  661. justify-content: center;
  662. align-items: center;
  663. }
  664. }
  665. .card-content3 {
  666. .box1 {
  667. display: flex;
  668. align-items: center;
  669. margin: 12px 12px 12px 16px;
  670. .select-box {
  671. width: 80px;
  672. margin-left: 10px;
  673. display: flex;
  674. align-items: center;
  675. .icon-down {
  676. margin-left: 3px;
  677. display: inline-block;
  678. flex-shrink: 0;
  679. width: 14px;
  680. height: 14px;
  681. background: url("@/assets/images/down.png") no-repeat;
  682. background-size: 100% 100%;
  683. }
  684. }
  685. }
  686. .box2 {
  687. padding: 0 30px;
  688. display: flex;
  689. justify-content: space-between;
  690. .box-item {
  691. .icon1 {
  692. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/icon1.png")
  693. no-repeat;
  694. }
  695. .icon2 {
  696. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/icon2.png")
  697. no-repeat;
  698. }
  699. .icon3 {
  700. background: url("@/assets/images/disasterRiskMonitor/forestFirePrevention/icon3.png")
  701. no-repeat;
  702. }
  703. .icon1,
  704. .icon2,
  705. .icon3 {
  706. display: inline-block;
  707. width: 48px;
  708. height: 48px;
  709. background-size: 100% 100%;
  710. box-shadow:
  711. 0 2px 1px -1px #bcd7ffb5,
  712. inset 0 1px 3px 6px #ace2ff08;
  713. border-radius: 11px;
  714. }
  715. .text1 {
  716. font-size: 14px;
  717. color: #414f64;
  718. line-height: 26px;
  719. }
  720. .text-box {
  721. display: flex;
  722. align-items: center;
  723. .text-blue {
  724. font-size: 24px;
  725. margin-right: 5px;
  726. color: #80c2ff;
  727. }
  728. .text-orange {
  729. font-size: 24px;
  730. margin-right: 5px;
  731. color: #ffaf00;
  732. }
  733. .text-red {
  734. font-size: 24px;
  735. margin-right: 5px;
  736. color: #ff2f3c;
  737. }
  738. }
  739. }
  740. }
  741. }
  742. }
  743. </style>