Emulsion.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <div class="emulsion common-card">
  3. <h4>乳液自动化配比</h4>
  4. <div class="equipment">
  5. <div class="enter">
  6. <span>纯水入口</span>
  7. <div class="block"></div>
  8. </div>
  9. <div class="water-box common-box">
  10. <span class="title">纯水箱</span>
  11. <div class="box-wrap">
  12. <span>120</span>
  13. <span>90</span>
  14. <span>60</span>
  15. <span>30</span>
  16. <div class="box" :style="{height: `${waterLevel.water / 1.5}%`}"></div>
  17. </div>
  18. </div>
  19. <div class="enter" style="position: absolute; width: 350px; bottom: 0; left: 184px">
  20. <span>水泵</span>
  21. <div class="block"></div>
  22. </div>
  23. <div class="oil-box common-box">
  24. <span class="title">油箱</span>
  25. <div class="box-wrap">
  26. <span>120</span>
  27. <span>90</span>
  28. <span>60</span>
  29. <span>30</span>
  30. <div class="box" :style="{height: `${waterLevel.oil / 1.5}%`}"></div>
  31. </div>
  32. </div>
  33. <div class="enter" style="width: 200px; justify-content: center;">
  34. <div class="block"></div>
  35. </div>
  36. <div class="liquid-box common-box">
  37. <span class="title">液箱</span>
  38. <div class="box-wrap">
  39. <span>120</span>
  40. <span>90</span>
  41. <span>60</span>
  42. <span>30</span>
  43. <div class="box" :style="{height: `${waterLevel.liquid / 1.5}%`}"></div>
  44. </div>
  45. </div>
  46. <img class="first fan" src="~@/assets/img/fan.png" alt="">
  47. <img class="second fan" src="~@/assets/img/fan.png" alt="">
  48. </div>
  49. <div class="data">
  50. <span>水箱水位<span style="color: orange;">{{ waterLevel.water }}</span>cm</span>
  51. <span>油箱油位<span style="color: orange;">{{ waterLevel.oil }}</span>cm</span>
  52. <span>液总用量 ? cm</span>
  53. <span>液流量 ? cm</span>
  54. <span>液位<span style="color: orange;">{{ waterLevel.liquid }}</span>cm</span>
  55. <span>液流量 ? cm</span>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. waterLevel: {
  64. water: 150,
  65. oil: 30,
  66. liquid: 70
  67. }
  68. }
  69. },
  70. created() {
  71. this.getdata()
  72. },
  73. methods: {
  74. getdata(){
  75. this.axios
  76. .get(
  77. "http://10.170.51.43:8082/hbase/getMpInfoByHbaseTablename/?hbasetablename=end"
  78. )
  79. .then((res) => {
  80. this.waterLevel.water = res.data[0].shuiwei;
  81. this.waterLevel.oil = res.data[0].youxiang;
  82. this.waterLevel.liquid = res.data[0].yexiang;
  83. console.log(this.waterLevel)
  84. });
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .emulsion {
  91. color: rgb(0, 0, 0);
  92. margin: 10px;
  93. position: relative;
  94. h4 {
  95. margin: 10px 0;
  96. }
  97. .equipment {
  98. display: flex;
  99. position: relative;
  100. .enter {
  101. display: flex;
  102. flex-flow: column;
  103. justify-content: flex-end;
  104. span {
  105. padding: 0 10px;
  106. }
  107. .block {
  108. background-color: rgba(105, 90, 205, 0.466);
  109. height: 20px;
  110. width: 100%;
  111. }
  112. }
  113. .common-box {
  114. display: flex;
  115. flex-flow: column nowrap;
  116. .title {
  117. text-align: center;
  118. }
  119. .box-wrap {
  120. background-image: linear-gradient(to right, #ffffff50, #0000005e, #ffffff50);
  121. width: 100px;
  122. display: flex;
  123. flex-flow: column;
  124. justify-content: space-evenly;
  125. position: relative;
  126. height: 150px;
  127. span {
  128. margin-left: 10px;
  129. }
  130. .box {
  131. position: absolute;
  132. width: 100%;
  133. height: 20px;
  134. background-color: rgba($color: blue, $alpha: .5);
  135. bottom: 0;
  136. }
  137. }
  138. }
  139. .water-box {
  140. .box-wrap {
  141. height: 150px;
  142. .box {
  143. background-color: rgba($color: blue, $alpha: .5);
  144. }
  145. }
  146. }
  147. .oil-box {
  148. margin-left: 50px;
  149. .box-wrap {
  150. height: 100px;
  151. .box {
  152. background-color: rgba($color: yellow, $alpha: .5);
  153. }
  154. }
  155. }
  156. .liquid-box {
  157. .box-wrap {
  158. height: 150px;
  159. .box {
  160. background-color: rgba($color: yellow, $alpha: .5);
  161. }
  162. }
  163. }
  164. .fan {
  165. position: absolute;
  166. height: 40px;
  167. background-color: rgb(255, 255, 255);
  168. border-radius: 50%;
  169. left: 300px;
  170. animation: turn 3s linear infinite;
  171. }
  172. .fan.first {
  173. left: 300px;
  174. bottom: -10px;
  175. }
  176. .fan.second {
  177. left: 420px;
  178. top: 65px;
  179. }
  180. }
  181. .data {
  182. display: flex;
  183. justify-content: space-between;
  184. font-size: 12px;
  185. margin-top: 20px;
  186. }
  187. }
  188. @keyframes turn {
  189. 0% {
  190. transform: rotate(0);
  191. }
  192. 100% {
  193. transform: rotate(360deg);
  194. }
  195. }
  196. </style>