RiverMonitor.vue 12 KB

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