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

220 lines
5.1 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
  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">1000:00:00</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 { stopDisinfectionJSON } from '@/mock/command'
  53. const operatorStore = useOperatorStore()
  54. const webSocketStore = useWebSocketStore()
  55. const props = defineProps({
  56. changeShowOperator: {
  57. type: Function,
  58. },
  59. })
  60. const showDetail = () => {
  61. props.changeShowOperator(true)
  62. }
  63. const pauseDisinfect = () => {
  64. if (operatorStore.disinfectStatus) {
  65. webSocketStore.sendCommandMsg(stopDisinfectionJSON)
  66. operatorStore.updateDisinfectStatus(false)
  67. }
  68. }
  69. const continueDisinfect = () => {
  70. if (!operatorStore.disinfectStatus) {
  71. operatorStore.updateDisinfectStatus(true)
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .progress_container {
  77. margin-bottom: 30px;
  78. height: 580px;
  79. box-sizing: border-box;
  80. background: #ffffff;
  81. border-radius: 16px;
  82. padding: 20px;
  83. padding-bottom: 30px;
  84. .header_wrap {
  85. display: flex;
  86. align-items: center;
  87. margin-bottom: 49px;
  88. .left_progress {
  89. width: 860px;
  90. height: 80px;
  91. border-radius: 14px;
  92. background: #f6f6f6;
  93. box-sizing: border-box;
  94. padding: 0 23px;
  95. display: flex;
  96. align-items: center;
  97. .left_time_tag {
  98. width: 158.66px;
  99. height: 45px;
  100. border-radius: 23px;
  101. opacity: 1;
  102. background: #06518b;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. font-family: Source Han Sans CN;
  107. font-size: 14px;
  108. font-weight: normal;
  109. letter-spacing: 0.1em;
  110. color: #ffffff;
  111. margin-right: 73px;
  112. }
  113. .time {
  114. width: 90px;
  115. height: 20px;
  116. font-family: Source Han Sans CN;
  117. font-size: 14px;
  118. font-weight: 500;
  119. letter-spacing: 0.1em;
  120. color: #000000;
  121. margin-right: 85px;
  122. display: flex;
  123. align-items: center;
  124. }
  125. .progress_bg {
  126. width: 396px;
  127. height: 14px;
  128. border-radius: 7px;
  129. background: #ffffff;
  130. position: relative;
  131. overflow: hidden;
  132. .pro {
  133. position: absolute;
  134. left: 0;
  135. top: 0;
  136. height: 14px;
  137. border-radius: 7px;
  138. background: #06518b;
  139. width: var(--width);
  140. }
  141. }
  142. }
  143. .right_btns {
  144. display: flex;
  145. align-items: center;
  146. box-sizing: border-box;
  147. margin-left: 20px;
  148. .btn {
  149. width: 140px;
  150. height: 45px;
  151. border-radius: 23px;
  152. background: #f6f6f6;
  153. display: flex;
  154. align-items: center;
  155. justify-content: center;
  156. font-family: Source Han Sans CN;
  157. font-size: 14px;
  158. font-weight: normal;
  159. letter-spacing: 0.1em;
  160. color: #d8d8d8;
  161. }
  162. .active {
  163. color: #ffffff;
  164. background: #06518b;
  165. }
  166. .ml {
  167. margin-left: 20px;
  168. }
  169. }
  170. }
  171. .echarts_wrap {
  172. height: 351px;
  173. display: flex;
  174. align-items: center;
  175. margin-bottom: 19px;
  176. .single_wrap {
  177. flex: 1;
  178. height: 351px;
  179. .title {
  180. font-family: Source Han Sans CN;
  181. font-size: 14px;
  182. font-weight: 500;
  183. letter-spacing: 0.1em;
  184. color: #000000;
  185. margin-bottom: 24px;
  186. padding-left: 11px;
  187. }
  188. .echarts_box {
  189. width: 380px;
  190. height: 308px;
  191. }
  192. }
  193. }
  194. .detail_wrap {
  195. display: flex;
  196. align-items: center;
  197. justify-content: flex-end;
  198. padding-right: 16px;
  199. .detail {
  200. width: 105px;
  201. height: 31px;
  202. border-radius: 16px;
  203. background: #06518b;
  204. display: flex;
  205. align-items: center;
  206. justify-content: center;
  207. font-family: Source Han Sans CN;
  208. font-size: 12px;
  209. font-weight: normal;
  210. letter-spacing: 0.1em;
  211. color: #ffffff;
  212. }
  213. }
  214. }
  215. </style>