RiverMonitor.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <template>
  2. <div class="menu-content">
  3. <div class="gradient-text common-dialog-title2">河道监测</div>
  4. <div class="flex-box">
  5. <div class="data-box1">
  6. <div class="box-text1">漫坝</div>
  7. <div class="box-text2">{{ validateNum(riverMonitorData.statusList[0]?.value) }}</div>
  8. </div>
  9. <div class="data-box2">
  10. <div class="box-text1">超保证</div>
  11. <div class="box-text2">{{ validateNum(riverMonitorData.statusList[1]?.value) }}</div>
  12. </div>
  13. <div class="data-box3">
  14. <div class="box-text1">超警戒</div>
  15. <div class="box-text2">{{ validateNum(riverMonitorData.statusList[2]?.value) }}</div>
  16. </div>
  17. </div>
  18. <div class="custom-table">
  19. <div class="th">
  20. <div class="td">名称</div>
  21. <div class="td">所属区县</div>
  22. <div class="td">汛限水位(m)</div>
  23. <div class="td">当前水位(m)</div>
  24. <div class="td">差值</div>
  25. </div>
  26. <div class="table-content">
  27. <div v-for="(item, index) in riverMonitorData.listData" :key="index" class="tr" @click="handleShowDialog(item)">
  28. <div class="td">{{ item.name }}</div>
  29. <div class="td">{{ item.area }}</div>
  30. <div class="td td-text">{{ item.warningLevel }}</div>
  31. <div class="td td-text">{{ item.waterLevel }}</div>
  32. <div :class="item.warningLevel > item.waterLevel ? 'td td-text text-green' : 'td td-text text-danger'">{{ item.waterDiff }}</div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <Dialog v-model="showDialog" type="xl" title="河道监测" draggable hide-footer>
  38. <div class="flex">
  39. <div class="detail-container">
  40. <div class="flex">
  41. <div class="info-box">
  42. <div class="info-header">
  43. <div class="gradient-text info-title">测站名称:{{ selectRow.name }}</div>
  44. </div>
  45. <div class="info-content">
  46. <div class="info-item">
  47. <div>水系河流名称:</div>
  48. <div>{{ selectRow.data1 }}</div>
  49. </div>
  50. <div class="info-item">
  51. <div>流域名称:</div>
  52. <div>{{ selectRow.data2 }}</div>
  53. </div>
  54. <div class="info-item">
  55. <div>水系站址:</div>
  56. <div>{{ selectRow.data3 }}</div>
  57. </div>
  58. <div class="info-item">
  59. <div>超警戒水位:</div>
  60. <div>{{ selectRow.waterDiff }}</div>
  61. </div>
  62. <div class="info-item">
  63. <div>时间:</div>
  64. <div>{{ selectRow.data5 }}</div>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="box1">
  69. <div class="box1-title">降雨过程实况</div>
  70. <Chart :option="chartOption1" style="width: 100%; flex: 1" />
  71. </div>
  72. </div>
  73. <div>
  74. <div class="box2">
  75. <div class="box2-title">过去24小时河流水位变化图</div>
  76. <Chart :option="chartOption2" style="width: 100%; height: 400px" />
  77. </div>
  78. </div>
  79. </div>
  80. <div class="right-box">
  81. <div style="display: flex; align-items: center">
  82. <div class="flex-box2">
  83. <div class="title2">附近视频</div>
  84. </div>
  85. <el-select v-model="queryParams2.radius" class="custom-select" popper-class="custom-popper" :teleported="false" style="width: 210px">
  86. <el-option v-for="item in radiusOption" :key="item.value" :label="item.label" :value="item.value" />
  87. </el-select>
  88. </div>
  89. <div class="video-box">
  90. <video-container :video-data="videoMonitorData" />
  91. </div>
  92. </div>
  93. </div>
  94. </Dialog>
  95. </template>
  96. <script lang="ts" setup name="RiverMonitor">
  97. import { option1, option2 } from './echartOptions';
  98. import { getRiverCourseLevel, getRiverList, getRiverWaterStatus } from '@/api/globalMap/riverMonitor';
  99. import { parseTime, validateNum } from '@/utils/ruoyi';
  100. import { getVideoInfo } from '@/api/globalMap';
  101. // 请求参数
  102. const queryParams = reactive({
  103. area: ''
  104. });
  105. // 总数量
  106. let total = ref(0);
  107. // 数据
  108. const riverMonitorData = reactive({
  109. time: '',
  110. statusList: [],
  111. listData: []
  112. });
  113. // 获取数据
  114. const initData = async () => {
  115. getRiverList(queryParams).then((res) => {
  116. riverMonitorData.listData = res.data.list;
  117. });
  118. getRiverWaterStatus().then((res) => {
  119. riverMonitorData.statusList = res.rows || [];
  120. });
  121. };
  122. initData();
  123. // 弹窗数据
  124. const detailData = reactive({
  125. name: '茂名',
  126. data1: '粤西沿海',
  127. data2: '粤西沿海诸河',
  128. data3: '广东省茂名市茂南区站',
  129. data4: '-1.32m',
  130. data5: '2024-08-23 10:00:00'
  131. });
  132. let chartOption1 = ref(option1);
  133. let chartOption2 = ref(option2);
  134. let showDialog = ref(false);
  135. let videoMonitorData = ref([]);
  136. const radiusOption = reactive([
  137. { label: '500米', value: '500' },
  138. { label: '1000米', value: '1000' },
  139. { label: '1500米', value: '1500' },
  140. { label: '2000米', value: '2000' }
  141. ]);
  142. // 请求参数
  143. const queryParams2 = reactive({
  144. current: 1,
  145. size: 9,
  146. location: '',
  147. radius: '500'
  148. });
  149. let selectRow = ref({
  150. name: '',
  151. waterDiff: ''
  152. });
  153. const handleShowDialog = (row) => {
  154. showDialog.value = false;
  155. selectRow.value = {
  156. name: '',
  157. waterDiff: ''
  158. };
  159. videoMonitorData.value = [];
  160. nextTick(() => {
  161. chartOption1.value.xAxis.data = ['12时', '15时', '18时', '21时', '0时', '3时', '6时', '9时'];
  162. chartOption1.value.series[0].data = [123, 232, '', '', '', '', '', ''];
  163. chartOption1.value.series[1].data = [123, 232, '', '', '', '', '', ''];
  164. chartOption1.value.series[2].data = [123, 232, '', '', '', '', '', ''];
  165. getRiverCourseLevel({ code: row.code }).then((res) => {
  166. const data = res.data.list;
  167. const time = [];
  168. const resultData = [];
  169. selectRow.value = data;
  170. data.forEach((item) => {
  171. time.push(parseTime(item.time, '{h}'));
  172. resultData.push(item.water_level);
  173. });
  174. let warning = [];
  175. resultData.forEach(() => {
  176. warning.push(resultData[0] * 1.5);
  177. });
  178. chartOption2.value.xAxis[0].data = time;
  179. chartOption2.value.series[0].data = resultData;
  180. chartOption2.value.series[1].data = warning;
  181. // chartOption2.value.series[0].markLine.data[0].yAxis = row.warningLevel;
  182. });
  183. queryParams2.location = `POINT(${row.longitude} ${row.latitude})`;
  184. getVideoInfo(queryParams2).then((res) => {
  185. res.data?.list.forEach((item) => {
  186. item.video_code = item.indexcode;
  187. });
  188. videoMonitorData.value = res.data?.list;
  189. });
  190. showDialog.value = true;
  191. });
  192. };
  193. </script>
  194. <style lang="scss" scoped>
  195. .menu-content {
  196. width: 574px;
  197. height: 581px;
  198. background: url('@/assets/images/map/rightMenu/content.png') no-repeat;
  199. background-size: 100% 100%;
  200. padding: 60px 10px 10px 15px;
  201. font-size: 14px;
  202. position: relative;
  203. color: #ffffff;
  204. }
  205. .detail-container {
  206. font-size: 16px;
  207. padding: 0;
  208. .dialog-content {
  209. display: flex;
  210. }
  211. .info-box {
  212. width: 260px;
  213. height: 200px;
  214. background: url('@/assets/images/map/rightMenu/box2.png') no-repeat;
  215. background-size: 100% 100%;
  216. padding: 11px;
  217. .info-header {
  218. width: 167px;
  219. height: 30px;
  220. padding-left: 25px;
  221. padding-top: 5px;
  222. background: url(@/assets/images/map/rightMenu/titleBox1.png) no-repeat;
  223. background-size: 100% 100%;
  224. .info-title {
  225. font-size: 18px;
  226. }
  227. }
  228. .info-content {
  229. padding: 0 10px 6px 10px;
  230. font-size: 16px;
  231. color: #a8ccde;
  232. }
  233. .info-item {
  234. display: flex;
  235. align-items: center;
  236. padding: 5px 0;
  237. white-space: nowrap;
  238. overflow: hidden;
  239. text-overflow: ellipsis;
  240. }
  241. }
  242. .box1 {
  243. width: 260px;
  244. height: 200px;
  245. display: flex;
  246. flex-direction: column;
  247. margin-left: 10px;
  248. margin-right: 10px;
  249. .box1-title {
  250. height: 27px;
  251. background: url('@/assets/images/map/rightMenu/titleBox2.png') no-repeat;
  252. background-size: 135px 20px;
  253. padding-left: 28px;
  254. font-size: 16px;
  255. color: #f4f7fa;
  256. }
  257. }
  258. .box2 {
  259. width: 530px;
  260. margin-top: 10px;
  261. margin-right: 10px;
  262. .box2-title {
  263. height: 27px;
  264. background: url('@/assets/images/map/rightMenu/titleBox2.png') no-repeat;
  265. background-size: 135px 20px;
  266. padding-left: 28px;
  267. font-size: 16px;
  268. color: #f4f7fa;
  269. }
  270. }
  271. }
  272. .right-box {
  273. flex: 1;
  274. display: flex;
  275. flex-direction: column;
  276. .flex-box2 {
  277. background: url('@/assets/images/map/rightMenu/titleBox2.png') no-repeat;
  278. background-size: 135px 20px;
  279. padding-left: 28px;
  280. display: flex;
  281. align-items: center;
  282. .title2 {
  283. font-size: 16px;
  284. flex-shrink: 0;
  285. margin-right: 10px;
  286. color: #f4f7fa;
  287. padding-bottom: 23px;
  288. }
  289. }
  290. .video-box {
  291. margin-top: 10px;
  292. height: 565px;
  293. display: flex;
  294. flex-wrap: wrap;
  295. }
  296. }
  297. .flex-box {
  298. display: flex;
  299. justify-content: space-between;
  300. width: 100%;
  301. .data-box1,
  302. .data-box2,
  303. .data-box3 {
  304. width: 186px;
  305. height: 58px;
  306. position: relative;
  307. display: flex;
  308. justify-content: space-between;
  309. align-items: center;
  310. margin-right: 20px;
  311. padding-left: 66px;
  312. padding-right: 20px;
  313. &:last-child {
  314. margin-right: 0;
  315. }
  316. .box-text1 {
  317. color: #fff;
  318. font-size: 14px;
  319. width: 50px;
  320. &::after {
  321. content: '';
  322. width: 1px;
  323. height: 48px;
  324. background: url('@/assets/images/map/rightMenu/line.png') no-repeat;
  325. background-size: 100% 100%;
  326. margin: 0 30px;
  327. }
  328. }
  329. .box-text2 {
  330. /* 设置字体透明 */
  331. color: transparent;
  332. /* 设置线性渐变,从红色渐变到蓝色 */
  333. background-image: linear-gradient(to bottom, #ffffff 50%, #3075d3 100%);
  334. /* 使用 -webkit-background-clip 属性将背景剪裁至文本形状 */
  335. -webkit-background-clip: text;
  336. /* 非Webkit内核浏览器需要使用标准前缀 */
  337. background-clip: text;
  338. /* 把当前元素设置为行内块,以便能够应用背景 */
  339. display: inline-block;
  340. font-family: 'YouSheBiaoTiHei';
  341. font-size: 16px;
  342. }
  343. }
  344. .data-box1 {
  345. background: url('@/assets/images/map/rightMenu/dataBox1.png') no-repeat;
  346. background-size: 100% 100%;
  347. }
  348. .data-box2 {
  349. background: url('@/assets/images/map/rightMenu/dataBox2.png') no-repeat;
  350. background-size: 100% 100%;
  351. }
  352. .data-box3 {
  353. background: url('@/assets/images/map/rightMenu/dataBox3.png') no-repeat;
  354. background-size: 100% 100%;
  355. }
  356. }
  357. .custom-table {
  358. width: 550px;
  359. .table-content {
  360. height: 290px;
  361. overflow-y: auto;
  362. overflow-x: hidden;
  363. }
  364. .th {
  365. background: url('@/assets/images/map/rightMenu/th.png') no-repeat;
  366. background-size: 100% 100%;
  367. display: flex;
  368. padding: 7px 12px;
  369. height: 32px;
  370. }
  371. .tr {
  372. background: url('@/assets/images/map/rightMenu/td.png') no-repeat;
  373. background-size: 100% 100%;
  374. display: flex;
  375. padding: 7px 12px;
  376. &:hover {
  377. background: url('@/assets/images/map/rightMenu/td_checked.png') no-repeat;
  378. background-size: 100% 100%;
  379. }
  380. }
  381. .td {
  382. flex: 1;
  383. color: #edfaff;
  384. font-size: 14px;
  385. display: flex;
  386. justify-content: center;
  387. align-items: center;
  388. cursor: pointer;
  389. }
  390. .td-text {
  391. /* 设置字体透明 */
  392. color: transparent;
  393. /* 使用 -webkit-background-clip 属性将背景剪裁至文本形状 */
  394. -webkit-background-clip: text;
  395. /* 非Webkit内核浏览器需要使用标准前缀 */
  396. background-clip: text;
  397. font-family: 'YouSheBiaoTiHei';
  398. /* 设置线性渐变,从红色渐变到蓝色 */
  399. background-image: linear-gradient(to bottom, #ffffff 50%, #3075d3 100%);
  400. font-size: 14px;
  401. }
  402. .text-green {
  403. background-image: linear-gradient(to bottom, #ffffff 50%, #40c75f 100%);
  404. }
  405. .text-danger {
  406. background-image: linear-gradient(to bottom, #ffffff 50%, #ff2f3c 100%);
  407. }
  408. }
  409. //.custom-select {
  410. // width: 148px;
  411. // height: 38px;
  412. // line-height: 38px;
  413. // :deep(.el-select__wrapper) {
  414. // background-color: #081b41;
  415. // box-shadow: 0 0 0 1px #126cf7 inset;
  416. // }
  417. // :deep(.el-select__placeholder) {
  418. // font-size: 30px;
  419. // color: #eaf3fc;
  420. // }
  421. //}
  422. </style>