eq4.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. <template>
  2. <div class="page">
  3. <div class="pipeline">
  4. <div class="pipeline_module">
  5. <div class="tanks">
  6. <dv-percent-pond class="vertical_pond pond_pos1" :config="{ value: pondValue, lineDash }"
  7. style="width:270px;height:100px;" />
  8. <dv-percent-pond class="vertical_pond pond_pos2" :config="{ value: pondValue, lineDash }"
  9. style="width:270px;height:100px;" />
  10. <dv-percent-pond class="vertical_pond pond_pos3" :config="{ value: pondValue, lineDash }"
  11. style="width:270px;height:100px;" />
  12. <dv-percent-pond class="vertical_pond pond_pos4" :config="{ value: pondValue, lineDash }"
  13. style="width:270px;height:100px;" />
  14. </div>
  15. <!-- 蓝色管道 -->
  16. <div class="progress_blue">
  17. <b-progress :value="100" striped :animated="upInWaterState"
  18. class=" rotate_270 progress progress_pos1"></b-progress>
  19. <b-progress :value="100" striped :animated="upInWaterState"
  20. class=" rotate_270 progress progress_pos2"></b-progress>
  21. <b-progress :value="100" striped :animated="upInWaterState"
  22. class=" rotate_270 progress progress_pos3"></b-progress>
  23. <b-progress :value="100" striped :animated="upInWaterState"
  24. class=" rotate_270 progress progress_pos4"></b-progress>
  25. <b-progress :value="100" striped :animated="upInWaterState"
  26. class=" rotate_180 progress progress_pos5"></b-progress>
  27. <b-progress :value="100" striped :animated="upInWaterState || downInWaterState"
  28. class=" rotate_270 progress progress_pos6"></b-progress>
  29. <b-progress :value="100" striped :animated="upInWaterState"
  30. class=" rotate_270 progress progress_pos7"></b-progress>
  31. <b-progress :value="100" striped :animated="upInWaterState || outWaterState"
  32. class=" rotate_90 progress progress_pos8"
  33. :class="{ 'rotate_270': outWaterState, 'progress_green': outWaterState }"></b-progress>
  34. <b-progress :value="100" striped :animated="upInWaterState || outWaterState"
  35. class=" rotate_90 progress progress_pos9"
  36. :class="{ 'rotate_270': outWaterState, 'progress_green': outWaterState }"></b-progress>
  37. <b-progress :value="100" striped :animated="upInWaterState || outWaterState"
  38. class=" rotate_90 progress progress_pos10"
  39. :class="{ 'rotate_270': outWaterState, 'progress_green': outWaterState }"></b-progress>
  40. <b-progress :value="100" striped :animated="upInWaterState || outWaterState"
  41. class=" rotate_90 progress progress_pos11"
  42. :class="{ 'rotate_270': outWaterState, 'progress_green': outWaterState }"></b-progress>
  43. <b-progress :value="100" striped :animated="upInWaterState"
  44. class=" rotate_180 progress progress_pos12"></b-progress>
  45. <b-progress :value="100" striped :animated="upInWaterState || downInWaterState"
  46. class=" rotate_180 progress progress_pos34"></b-progress>
  47. </div>
  48. <!-- 黄色管道(气管) -->
  49. <div class="progress_yellow">
  50. <b-progress :value="100" striped :animated="upInGasState"
  51. class=" rotate_270 progress progress_pos13"></b-progress>
  52. <b-progress :value="100" striped :animated="upInGasState"
  53. class=" rotate_270 progress progress_pos14"></b-progress>
  54. <b-progress :value="100" striped :animated="upInGasState"
  55. class=" rotate_270 progress progress_pos15"></b-progress>
  56. <b-progress :value="100" striped :animated="upInGasState"
  57. class=" rotate_270 progress progress_pos16"></b-progress>
  58. <b-progress :value="100" striped :animated="upInGasState"
  59. class=" progress progress_pos17"></b-progress>
  60. <b-progress :value="100" striped :animated="downInGasState"
  61. class=" rotate_270 progress progress_pos18"></b-progress>
  62. <b-progress :value="100" striped :animated="downInGasState"
  63. class=" rotate_90 progress progress_pos19"></b-progress>
  64. <b-progress :value="100" striped :animated="downInGasState"
  65. class=" rotate_90 progress progress_pos20"></b-progress>
  66. <b-progress :value="100" striped :animated="downInGasState"
  67. class=" rotate_90 progress progress_pos21"></b-progress>
  68. <b-progress :value="100" striped :animated="downInGasState"
  69. class=" rotate_90 progress progress_pos22"></b-progress>
  70. <b-progress :value="100" striped :animated="downInGasState"
  71. class=" progress progress_pos23"></b-progress>
  72. <b-progress :value="100" striped :animated="upInGasState || downInGasState"
  73. class=" progress progress_pos35"></b-progress>
  74. </div>
  75. <!-- 淡蓝色管道(上排水) -->
  76. <div class="progress_blue_light">
  77. <b-progress :value="100" striped :animated="upInWaterState || downInWaterState"
  78. class=" rotate_90 progress progress_pos24"></b-progress>
  79. <b-progress :value="100" striped :animated="upInWaterState || downInWaterState"
  80. class=" rotate_90 progress progress_pos25"></b-progress>
  81. <b-progress :value="100" striped :animated="upInWaterState || downInWaterState"
  82. class=" rotate_90 progress progress_pos26"></b-progress>
  83. <b-progress :value="100" striped :animated="upInWaterState || downInWaterState"
  84. class=" rotate_90 progress progress_pos27"></b-progress>
  85. <b-progress :value="100" striped :animated="upInWaterState || downInWaterState"
  86. class=" progress progress_pos28"></b-progress>
  87. </div>
  88. <!-- 绿色管道(下排水) -->
  89. <div class="progress_green">
  90. <b-progress :value="100" striped :animated="outWaterState"
  91. class=" rotate_270 progress progress_pos29"></b-progress>
  92. <b-progress :value="100" striped :animated="outWaterState"
  93. class=" rotate_270 progress progress_pos30"></b-progress>
  94. <b-progress :value="100" striped :animated="outWaterState"
  95. class=" rotate_270 progress progress_pos31"></b-progress>
  96. <b-progress :value="100" striped :animated="outWaterState"
  97. class=" rotate_270 progress progress_pos32"></b-progress>
  98. <b-progress :value="100" striped :animated="outWaterState"
  99. class=" rotate_180 progress progress_pos33"></b-progress>
  100. </div>
  101. <!-- 阀门 -->
  102. <div class="valves">
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. </template>
  108. <script>
  109. export default {
  110. data() {
  111. return {
  112. //水库容量
  113. pondValue: 20,
  114. lineDash: [100, 0],//罐内水位线条样式
  115. interval: null,//定时器
  116. // animate: true,//是否动画
  117. //阀门状态数组
  118. upInWaterState: false,//上进水阀门状态
  119. downInWaterState: false,//下进水阀门状态
  120. outWaterState: false,//出水阀门状态
  121. upInGasState: false,//上进气阀门状态
  122. downInGasState: false,//下进气阀门状态
  123. };
  124. },
  125. mounted() {
  126. this.getValveState();
  127. },
  128. methods: {
  129. //获取阀门状态
  130. getValveState() {
  131. this.upInWaterState = this.$route.query.upInWaterState;
  132. this.downInWaterState = this.$route.query.downInWaterState;
  133. this.outWaterState = this.$route.query.outWaterState;
  134. this.upInGasState = this.$route.query.upInGasState;
  135. this.downInGasState = this.$route.query.downInGasState;
  136. if (this.upInWaterState || this.downInWaterState) {
  137. this.addWater();
  138. }
  139. if (this.outWaterState) {
  140. this.reduceWater();
  141. }
  142. },
  143. //水量增加
  144. addWater() {
  145. this.clearWaterInterval();
  146. this.interval = setInterval(() => {
  147. if (this.pondValue < 100) {
  148. this.pondValue += 1;
  149. } else {
  150. this.pondValue = 0;
  151. }
  152. }, 100);
  153. },
  154. //水量减少
  155. reduceWater() {
  156. this.clearWaterInterval();
  157. this.interval = setInterval(() => {
  158. if (this.pondValue > 0) {
  159. this.pondValue -= 1;
  160. } else {
  161. this.pondValue = 100;
  162. }
  163. }, 100);
  164. },
  165. //清除定时器
  166. clearWaterInterval() {
  167. clearInterval(this.interval);
  168. this.interval = null;
  169. },
  170. },
  171. };
  172. </script>
  173. <style scoped lang="scss">
  174. // .page {
  175. // width: 1920px;
  176. // height: 1080px;
  177. // }
  178. .pipeline {
  179. width: 1000px;
  180. height: 571px;
  181. display: flex;
  182. flex-direction: row;
  183. justify-content: space-around;
  184. .pipeline_module {
  185. margin-top: 100px;
  186. width: 700px;
  187. height: 400px;
  188. position: relative;
  189. .tanks {
  190. .vertical_pond {
  191. z-index: 110;
  192. transform: rotate(-90deg);
  193. /* 逆时针旋转90度 */
  194. transform-origin: 50% 50%;
  195. /* 设置旋转中心点 */
  196. }
  197. ::v-deep .dv-percent-pond text {
  198. display: none; //隐藏文字
  199. }
  200. .pond_pos1 {
  201. left: -50px;
  202. top: 155px;
  203. }
  204. .pond_pos2 {
  205. left: 120px;
  206. top: 55px;
  207. }
  208. .pond_pos3 {
  209. left: 290px;
  210. top: -45px;
  211. }
  212. .pond_pos4 {
  213. left: 460px;
  214. top: -145px;
  215. }
  216. }
  217. //进度条(管道)
  218. .progress {
  219. height: 8px;
  220. z-index: 10;
  221. }
  222. //旋转角度
  223. .rotate_90 {
  224. transform: rotate(90deg); //顺时针旋转90度
  225. transform-origin: 50% 50%;
  226. }
  227. .rotate_180 {
  228. transform: rotate(180deg); //顺时针旋转180度
  229. transform-origin: 50% 50%;
  230. }
  231. .rotate_270 {
  232. transform: rotate(-90deg); //顺时针旋转270度
  233. transform-origin: 50% 50%;
  234. }
  235. // 蓝色管道
  236. ::v-deep .progress_blue {
  237. .progress-bar-striped {
  238. background-image: linear-gradient(-45deg, transparent 50%, #0088ff 50%),
  239. linear-gradient(-135deg, transparent 50%, #0088ff 50%);
  240. background-size: 15px;
  241. // background-position: 0 0, 0.5rem 0.5rem;
  242. }
  243. .progress-bar {
  244. background-color: #edeef0;
  245. }
  246. }
  247. // 黄色管道
  248. ::v-deep .progress_yellow {
  249. .progress-bar-striped {
  250. background-image: linear-gradient(-45deg, transparent 50%, #FFA500 50%),
  251. linear-gradient(-135deg, transparent 50%, #FFA500 50%);
  252. background-size: 15px;
  253. // background-position: 0 0, 0.5rem 0.5rem;
  254. }
  255. .progress-bar {
  256. background-color: #edeef0 !important;
  257. }
  258. }
  259. //淡蓝色管道
  260. ::v-deep .progress_blue_light {
  261. .progress-bar-striped {
  262. background-image: linear-gradient(45deg,
  263. rgba(254, 254, 248, 1) 25%,
  264. transparent 25%,
  265. transparent 50%,
  266. rgba(254, 254, 248, 1) 50%,
  267. rgba(254, 254, 248, 1) 75%,
  268. transparent 75%,
  269. transparent) !important;
  270. background-size: 1rem 1rem !important;
  271. }
  272. .progress-bar {
  273. background-color: #60ccf0 !important;
  274. /* 蓝色 */
  275. }
  276. }
  277. // 绿色管道
  278. ::v-deep .progress_green {
  279. .progress-bar-striped {
  280. background-image: linear-gradient(-45deg, transparent 50%, #3ea934 50%),
  281. linear-gradient(-135deg, transparent 50%, #3ea934 50%) !important;
  282. background-size: 8px;
  283. // background-position: 0 0, 0.5rem 0.5rem;
  284. }
  285. .progress-bar {
  286. background-color: #edeef0 !important;
  287. }
  288. }
  289. .valves {
  290. .color_green {
  291. color: greenyellow !important;
  292. }
  293. .valve {
  294. color: #c4c6cc;
  295. z-index: 110;
  296. }
  297. // 阀门定位
  298. }
  299. //管道定位
  300. // 蓝色管道定位
  301. .progress_blue {
  302. .progress {
  303. z-index: 20; //管道层级
  304. }
  305. .rotate_90 {
  306. z-index: 21 !important; //管道层级
  307. }
  308. .progress_pos1 {
  309. position: absolute;
  310. left: 63px;
  311. top: 42px;
  312. width: 50px;
  313. }
  314. .progress_pos2 {
  315. position: absolute;
  316. left: 234px;
  317. top: 42px;
  318. width: 50px;
  319. }
  320. .progress_pos3 {
  321. position: absolute;
  322. left: 402px;
  323. top: 42px;
  324. width: 50px;
  325. }
  326. .progress_pos4 {
  327. position: absolute;
  328. left: 572px;
  329. top: 42px;
  330. width: 50px;
  331. }
  332. .progress_pos5 {
  333. position: absolute;
  334. left: 10px;
  335. top: 20px;
  336. width: 591px;
  337. }
  338. .progress_pos6 {
  339. position: absolute;
  340. left: -61px;
  341. top: -1px;
  342. width: 50px;
  343. }
  344. .progress_pos7 {
  345. position: absolute;
  346. left: -170px;
  347. top: 200px;
  348. width: 368px;
  349. }
  350. .progress_pos8 {
  351. position: absolute;
  352. left: 61px;
  353. top: 362px;
  354. width: 52px;
  355. }
  356. .progress_pos9 {
  357. position: absolute;
  358. left: 231px;
  359. top: 362px;
  360. width: 52px;
  361. }
  362. .progress_pos10 {
  363. position: absolute;
  364. left: 401px;
  365. top: 362px;
  366. width: 52px;
  367. }
  368. .progress_pos11 {
  369. position: absolute;
  370. left: 571px;
  371. top: 362px;
  372. width: 52px;
  373. }
  374. .progress_pos12 {
  375. position: absolute;
  376. left: 10px;
  377. top: 383px;
  378. width: 591px;
  379. }
  380. .progress_pos34 {
  381. position: absolute;
  382. left: -40px;
  383. top: 20px;
  384. width: 60px;
  385. }
  386. }
  387. // 黄色管道定位
  388. .progress_yellow {
  389. .progress {
  390. z-index: 10; //管道层级
  391. }
  392. .progress_pos13 {
  393. position: absolute;
  394. left: 82px;
  395. top: 33px;
  396. width: 70px;
  397. }
  398. .progress_pos14 {
  399. position: absolute;
  400. left: 252px;
  401. top: 33px;
  402. width: 70px;
  403. }
  404. .progress_pos15 {
  405. position: absolute;
  406. left: 422px;
  407. top: 33px;
  408. width: 70px;
  409. }
  410. .progress_pos16 {
  411. position: absolute;
  412. left: 592px;
  413. top: 33px;
  414. width: 70px;
  415. }
  416. .progress_pos17 {
  417. position: absolute;
  418. left: 113px;
  419. top: 1px;
  420. width: 565px;
  421. }
  422. .progress_pos18 {
  423. position: absolute;
  424. left: 468px;
  425. top: 204px;
  426. width: 410px;
  427. }
  428. .progress_pos19 {
  429. position: absolute;
  430. left: 529px;
  431. top: 371px;
  432. width: 74px;
  433. }
  434. .progress_pos20 {
  435. position: absolute;
  436. left: 363px;
  437. top: 371px;
  438. width: 74px;
  439. }
  440. .progress_pos21 {
  441. position: absolute;
  442. left: 192px;
  443. top: 371px;
  444. width: 74px;
  445. }
  446. .progress_pos22 {
  447. position: absolute;
  448. left: 24px;
  449. top: 371px;
  450. width: 74px;
  451. }
  452. .progress_pos23 {
  453. position: absolute;
  454. left: 58px;
  455. top: 405px;
  456. width: 618px;
  457. }
  458. .progress_pos35 {
  459. position: absolute;
  460. left: 670px;
  461. top: 1px;
  462. width: 100px;
  463. }
  464. }
  465. //淡蓝色管道定位
  466. .progress_blue_light {
  467. .progress {
  468. z-index: 30; //管道层级
  469. }
  470. .progress_pos24 {
  471. position: absolute;
  472. left: 13px;
  473. top: 23px;
  474. width: 90px;
  475. }
  476. .progress_pos25 {
  477. position: absolute;
  478. left: 184px;
  479. top: 23px;
  480. width: 90px;
  481. }
  482. .progress_pos26 {
  483. position: absolute;
  484. left: 354px;
  485. top: 23px;
  486. width: 90px;
  487. }
  488. .progress_pos27 {
  489. position: absolute;
  490. left: 524px;
  491. top: 23px;
  492. width: 90px;
  493. }
  494. .progress_pos28 {
  495. position: absolute;
  496. left: -3px;
  497. top: -18px;
  498. width: 576px;
  499. }
  500. }
  501. .progress_green {
  502. .progress {
  503. z-index: 40; //管道层级
  504. }
  505. .progress_pos29 {
  506. position: absolute;
  507. left: 62px;
  508. top: 411px;
  509. width: 50px;
  510. }
  511. .progress_pos30 {
  512. position: absolute;
  513. left: 232px;
  514. top: 411px;
  515. width: 50px;
  516. }
  517. .progress_pos31 {
  518. position: absolute;
  519. left: 402px;
  520. top: 411px;
  521. width: 50px;
  522. }
  523. .progress_pos32 {
  524. position: absolute;
  525. left: 572px;
  526. top: 411px;
  527. width: 50px;
  528. }
  529. .progress_pos33 {
  530. position: absolute;
  531. left: 84px;
  532. top: 433px;
  533. width: 688px;
  534. }
  535. }
  536. }
  537. }
  538. </style>