RiverMonitor.vue 12 KB

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