新型管道消毒机前端代码
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.

235 lines
5.4 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
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
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="progress_container">
  3. <div class="header_wrap">
  4. <div class="left_progress">
  5. <div class="left_time_tag">剩余时间</div>
  6. <p class="time">{{ operatorStore.estimatedRemainingTimeS }} S</p>
  7. <!-- <div class="progress_bg">
  8. <div
  9. class="pro"
  10. :style="{
  11. '--width': '325px',
  12. }"
  13. ></div>
  14. </div> -->
  15. </div>
  16. <div class="right_btns">
  17. <div
  18. :class="operatorStore.disinfectStatus ? 'btn active' : 'btn'"
  19. @click="pauseDisinfect"
  20. >
  21. 暂停消毒
  22. </div>
  23. <div
  24. :class="operatorStore.disinfectStatus ? 'btn ml' : 'btn ml active'"
  25. @click="continueDisinfect"
  26. >
  27. 继续消毒
  28. </div>
  29. </div>
  30. </div>
  31. <div class="echarts_wrap">
  32. <div class="single_wrap">
  33. <p class="title">设备温度/湿度/过氧化氢浓度</p>
  34. <div class="echarts_box"></div>
  35. </div>
  36. <div class="single_wrap">
  37. <p class="title">环境1/湿度/过氧化氢浓度</p>
  38. <div class="echarts_box"></div>
  39. </div>
  40. <div class="single_wrap">
  41. <p class="title">环境2/湿度/过氧化氢浓度</p>
  42. <div class="echarts_box"></div>
  43. </div>
  44. </div>
  45. <div class="detail_wrap">
  46. <div class="detail" @click="showDetail">详情</div>
  47. </div>
  48. </div>
  49. </template>
  50. <script setup>
  51. import { useOperatorStore, useWebSocketStore } from '@/store'
  52. import {
  53. stopDisinfectionJSON,
  54. getStateJSON,
  55. getAllRecordsJSON,
  56. } from '@/mock/command'
  57. import { onMounted, onUnmounted, ref } from 'vue'
  58. const operatorStore = useOperatorStore()
  59. const webSocketStore = useWebSocketStore()
  60. const props = defineProps({
  61. changeShowOperator: {
  62. type: Function,
  63. },
  64. })
  65. const showDetail = () => {
  66. props.changeShowOperator(true)
  67. }
  68. const timer = ref(null)
  69. onMounted(() => {
  70. timer.value = setInterval(() => {
  71. webSocketStore.sendCommandMsg(getStateJSON)
  72. }, 1000)
  73. })
  74. onUnmounted(() => {
  75. timer.value = null
  76. })
  77. const pauseDisinfect = () => {
  78. if (operatorStore.disinfectStatus) {
  79. webSocketStore.sendCommandMsg(stopDisinfectionJSON)
  80. operatorStore.updateDisinfectStatus(false)
  81. }
  82. }
  83. const continueDisinfect = () => {
  84. if (!operatorStore.disinfectStatus) {
  85. operatorStore.updateDisinfectStatus(true)
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .progress_container {
  91. margin-bottom: 30px;
  92. height: 580px;
  93. box-sizing: border-box;
  94. background: #ffffff;
  95. border-radius: 16px;
  96. padding: 20px;
  97. padding-bottom: 30px;
  98. .header_wrap {
  99. display: flex;
  100. align-items: center;
  101. margin-bottom: 49px;
  102. .left_progress {
  103. width: 860px;
  104. height: 80px;
  105. border-radius: 14px;
  106. background: #f6f6f6;
  107. box-sizing: border-box;
  108. padding: 0 23px;
  109. display: flex;
  110. align-items: center;
  111. .left_time_tag {
  112. width: 158.66px;
  113. height: 45px;
  114. border-radius: 23px;
  115. opacity: 1;
  116. background: #06518b;
  117. display: flex;
  118. align-items: center;
  119. justify-content: center;
  120. font-family: Source Han Sans CN;
  121. font-size: 14px;
  122. font-weight: normal;
  123. letter-spacing: 0.1em;
  124. color: #ffffff;
  125. margin-right: 73px;
  126. }
  127. .time {
  128. width: 90px;
  129. height: 20px;
  130. font-family: Source Han Sans CN;
  131. font-size: 14px;
  132. font-weight: 500;
  133. letter-spacing: 0.1em;
  134. color: #000000;
  135. margin-right: 85px;
  136. display: flex;
  137. align-items: center;
  138. }
  139. .progress_bg {
  140. width: 396px;
  141. height: 14px;
  142. border-radius: 7px;
  143. background: #ffffff;
  144. position: relative;
  145. overflow: hidden;
  146. .pro {
  147. position: absolute;
  148. left: 0;
  149. top: 0;
  150. height: 14px;
  151. border-radius: 7px;
  152. background: #06518b;
  153. width: var(--width);
  154. }
  155. }
  156. }
  157. .right_btns {
  158. display: flex;
  159. align-items: center;
  160. box-sizing: border-box;
  161. margin-left: 20px;
  162. .btn {
  163. width: 140px;
  164. height: 45px;
  165. border-radius: 23px;
  166. background: #f6f6f6;
  167. display: flex;
  168. align-items: center;
  169. justify-content: center;
  170. font-family: Source Han Sans CN;
  171. font-size: 14px;
  172. font-weight: normal;
  173. letter-spacing: 0.1em;
  174. color: #d8d8d8;
  175. }
  176. .active {
  177. color: #ffffff;
  178. background: #06518b;
  179. }
  180. .ml {
  181. margin-left: 20px;
  182. }
  183. }
  184. }
  185. .echarts_wrap {
  186. height: 351px;
  187. display: flex;
  188. align-items: center;
  189. margin-bottom: 19px;
  190. .single_wrap {
  191. flex: 1;
  192. height: 351px;
  193. .title {
  194. font-family: Source Han Sans CN;
  195. font-size: 14px;
  196. font-weight: 500;
  197. letter-spacing: 0.1em;
  198. color: #000000;
  199. margin-bottom: 24px;
  200. padding-left: 11px;
  201. }
  202. .echarts_box {
  203. width: 380px;
  204. height: 308px;
  205. }
  206. }
  207. }
  208. .detail_wrap {
  209. display: flex;
  210. align-items: center;
  211. justify-content: flex-end;
  212. padding-right: 16px;
  213. .detail {
  214. width: 105px;
  215. height: 31px;
  216. border-radius: 16px;
  217. background: #06518b;
  218. display: flex;
  219. align-items: center;
  220. justify-content: center;
  221. font-family: Source Han Sans CN;
  222. font-size: 12px;
  223. font-weight: normal;
  224. letter-spacing: 0.1em;
  225. color: #ffffff;
  226. }
  227. }
  228. }
  229. </style>