新型管道消毒机前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

234 lines
4.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="seal_test_container">
  3. <div class="title_wrap">
  4. <img class="icon" :src="SealPng" alt="" />
  5. <div class="title">实时压力表</div>
  6. </div>
  7. <div class="echarts_box" id="seal_echarts"></div>
  8. <div class="oper_box">
  9. <img class="air_img" :src="StopAir" alt="" />
  10. <img class="air_img" :src="StartAir" alt="" />
  11. </div>
  12. </div>
  13. </template>
  14. <script setup>
  15. import * as echarts from 'echarts'
  16. import { ref, onMounted, onBeforeUnmount } from 'vue'
  17. import SealPng from '@/assets/img/seal/seal.png'
  18. import StartAir from '@/assets/img/seal/start.png'
  19. import StopAir from '@/assets/img/seal/stop.png'
  20. import DisStart from '@/assets/img/seal/dis_start.png'
  21. import DisStop from '@/assets/img/seal/dis_stop.png'
  22. import { useSealStore } from '@/store'
  23. const sealStore = useSealStore()
  24. const sealCharts = ref(null)
  25. const sealOptions = ref({
  26. series: [
  27. {
  28. type: 'gauge',
  29. min: 0,
  30. max: 800,
  31. progress: {
  32. show: true,
  33. width: 18,
  34. itemStyle: {
  35. color: '#3442aa',
  36. },
  37. },
  38. pointer: {
  39. itemStyle: {
  40. color: '#3442aa',
  41. },
  42. },
  43. axisLine: {
  44. lineStyle: {
  45. width: 18,
  46. },
  47. },
  48. axisTick: {
  49. show: false,
  50. },
  51. splitLine: {
  52. length: 15,
  53. lineStyle: {
  54. width: 2,
  55. color: '#999',
  56. },
  57. },
  58. axisLabel: {
  59. distance: 25,
  60. color: '#999',
  61. fontSize: 20,
  62. },
  63. anchor: {
  64. show: true,
  65. showAbove: true,
  66. size: 25,
  67. itemStyle: {
  68. borderWidth: 10,
  69. borderColor: '#3442aa',
  70. },
  71. },
  72. title: {
  73. show: false,
  74. },
  75. detail: {
  76. valueAnimation: true,
  77. fontSize: 40,
  78. color: '#3442aa',
  79. formatter: '{value} KPa',
  80. offsetCenter: [0, '70%'],
  81. },
  82. data: [
  83. {
  84. value: sealStore.currentAirPressure,
  85. },
  86. ],
  87. },
  88. ],
  89. })
  90. const timer = ref(null)
  91. onBeforeUnmount(() => {
  92. timer.value = null
  93. })
  94. onMounted(() => {
  95. sealCharts.value = echarts.init(document.getElementById('seal_echarts'))
  96. sealCharts.value.setOption(sealOptions.value)
  97. timer.value = setInterval(() => {
  98. sealCharts.value.setOption({
  99. series: [
  100. {
  101. type: 'gauge',
  102. min: 0,
  103. max: 800,
  104. progress: {
  105. show: true,
  106. width: 18,
  107. itemStyle: {
  108. color: '#3442aa',
  109. },
  110. },
  111. pointer: {
  112. itemStyle: {
  113. color: '#3442aa',
  114. },
  115. },
  116. axisLine: {
  117. lineStyle: {
  118. width: 18,
  119. },
  120. },
  121. axisTick: {
  122. show: false,
  123. },
  124. splitLine: {
  125. length: 15,
  126. lineStyle: {
  127. width: 2,
  128. color: '#999',
  129. },
  130. },
  131. axisLabel: {
  132. distance: 25,
  133. color: '#999',
  134. fontSize: 20,
  135. },
  136. anchor: {
  137. show: true,
  138. showAbove: true,
  139. size: 25,
  140. itemStyle: {
  141. borderWidth: 10,
  142. borderColor: '#3442aa',
  143. },
  144. },
  145. title: {
  146. show: false,
  147. },
  148. detail: {
  149. valueAnimation: true,
  150. fontSize: 40,
  151. color: '#3442aa',
  152. formatter: '{value} KPa',
  153. offsetCenter: [0, '70%'],
  154. },
  155. data: [
  156. {
  157. value: sealStore.currentAirPressure,
  158. },
  159. ],
  160. },
  161. ],
  162. })
  163. }, 1000)
  164. })
  165. </script>
  166. <style lang="scss" scoped>
  167. .seal_test_container {
  168. margin-bottom: 19px;
  169. height: 580px;
  170. box-sizing: border-box;
  171. border-radius: 16px;
  172. display: flex;
  173. align-items: center;
  174. margin-right: 30px;
  175. width: 1220px;
  176. height: 580px;
  177. box-sizing: border-box;
  178. border-radius: 16px;
  179. background: #ffffff;
  180. position: relative;
  181. .title_wrap {
  182. position: absolute;
  183. left: 28px;
  184. top: 28px;
  185. width: 141px;
  186. height: 31px;
  187. box-sizing: border-box;
  188. display: flex;
  189. align-items: center;
  190. .title {
  191. font-family: 思源黑体;
  192. font-size: 20px;
  193. font-weight: bold;
  194. line-height: normal;
  195. letter-spacing: 0.02em;
  196. font-feature-settings: 'kern' on;
  197. color: #000000;
  198. margin-left: 9px;
  199. }
  200. .icon {
  201. width: 30px;
  202. height: 30px;
  203. }
  204. }
  205. .oper_box {
  206. position: absolute;
  207. left: 28px;
  208. bottom: 28px;
  209. width: 1164px;
  210. box-sizing: border-box;
  211. padding: 0 120px;
  212. height: 110px;
  213. display: flex;
  214. align-items: center;
  215. justify-content: space-between;
  216. .air_img {
  217. width: 341px;
  218. height: 110px;
  219. }
  220. }
  221. .echarts_box {
  222. height: 580px;
  223. position: absolute;
  224. left: 0;
  225. top: -36px;
  226. width: 1220px;
  227. }
  228. }
  229. </style>