管道式消毒机
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.

318 lines
7.5 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
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="operator_main_content">
  3. <div class="left_contaienr">
  4. <div class="info_cards">
  5. <div class="card">
  6. <DisinfectantLiquidInfo />
  7. </div>
  8. <div class="card">
  9. <EnvironmentInfo :cardType="1" />
  10. </div>
  11. <div class="card">
  12. <EnvironmentInfo :cardType="2" />
  13. </div>
  14. <div class="card">
  15. <EnvironmentInfo :cardType="3" />
  16. </div>
  17. </div>
  18. <div class="warn_wrap">
  19. <p class="warn_text">警报信息</p>
  20. <div
  21. class="detail_btn"
  22. v-if="operatorStore.disinfectStatus"
  23. @click="toDetail"
  24. >
  25. 详情
  26. </div>
  27. </div>
  28. </div>
  29. <div class="right_container">
  30. <div class="setting_title">
  31. <p>消毒设置</p>
  32. <p>SET</p>
  33. </div>
  34. <div class="set_form">
  35. <input
  36. type="number"
  37. :disabled="operatorStore.disinfectStatus"
  38. v-model="roomSize"
  39. class="room_size"
  40. />
  41. <div class="log" @click="showLogPicker">{{ logVal }}</div>
  42. </div>
  43. <div
  44. :class="operatorStore.disinfectStatus ? 'start cant' : 'start'"
  45. @click="startDisinfect"
  46. >
  47. 开始消毒
  48. </div>
  49. <div class="progress">
  50. <p class="title">消毒进度</p>
  51. <div class="tube">
  52. <div
  53. class="pro"
  54. :style="{
  55. '--width': '50px',
  56. }"
  57. ></div>
  58. </div>
  59. <div class="num">000/100</div>
  60. </div>
  61. </div>
  62. <!-- <WarnModal /> -->
  63. <LogPicker
  64. v-if="logVisible"
  65. :changeLogVal="changeLogVal"
  66. :logVal="logVal"
  67. />
  68. </div>
  69. </template>
  70. <script setup>
  71. import LogPicker from 'cpns/dialogs/LogPicker'
  72. import WarnModal from 'cpns/dialogs/WarnModal'
  73. import DisinfectantLiquidInfo from 'cpns/info/DisinfectantLiquidInfo'
  74. import EnvironmentInfo from 'cpns/info/EnvironmentInfo'
  75. import { ref } from 'vue'
  76. import { useOperatorStore, useWebSocketStore } from '@/store'
  77. import { startDisinfectionJSON } from '@/mock/command'
  78. import { showSuccessToast, showFailToast } from 'vant'
  79. const operatorStore = useOperatorStore()
  80. const webSocketStore = useWebSocketStore()
  81. const props = defineProps({
  82. changeShowOperator: {
  83. type: Function,
  84. },
  85. })
  86. const toDetail = () => {
  87. // 判断当前消毒任务是否开始,如果开始时才生效 否则点击不生效
  88. if (operatorStore.disinfectStatus) {
  89. props.changeShowOperator(false)
  90. }
  91. }
  92. const logVisible = ref(false)
  93. const logVal = ref(1)
  94. const roomSize = ref(0)
  95. const changeLogVal = val => {
  96. logVal.value = val
  97. logVisible.value = false
  98. }
  99. const startDisinfect = () => {
  100. // 改变开始消毒状态 如果已经开始则不可点击
  101. if (!operatorStore.disinfectStatus) {
  102. if (roomSize.value == 0) {
  103. showFailToast('请调整房间大小设置,不能为0')
  104. } else {
  105. webSocketStore.sendCommandMsg(
  106. startDisinfectionJSON(logVal.value, roomSize.value),
  107. )
  108. operatorStore.updateDisinfectStatus(true)
  109. props.changeShowOperator(false)
  110. }
  111. }
  112. }
  113. const showLogPicker = () => {
  114. if (!operatorStore.disinfectStatus) {
  115. logVisible.value = true
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped>
  120. .operator_main_content {
  121. margin-bottom: 30px;
  122. height: 580px;
  123. box-sizing: border-box;
  124. display: flex;
  125. align-items: center;
  126. .left_contaienr {
  127. margin-right: 30px;
  128. width: 766px;
  129. height: 580px;
  130. box-sizing: border-box;
  131. border-radius: 16px;
  132. background: #ffffff;
  133. padding: 20px;
  134. .info_cards {
  135. width: 726px;
  136. height: 470px;
  137. box-sizing: border-box;
  138. display: grid;
  139. grid-template-columns: repeat(2, 1fr);
  140. grid-template-rows: repeat(2, 1fr);
  141. column-gap: 20px;
  142. row-gap: 20px;
  143. margin-bottom: 20px;
  144. .card {
  145. width: 353px;
  146. height: 225px;
  147. border-radius: 17.5px;
  148. background: #06518b;
  149. }
  150. }
  151. .warn_wrap {
  152. display: flex;
  153. align-items: center;
  154. justify-content: space-between;
  155. box-sizing: border-box;
  156. padding: 0 20px;
  157. width: 726px;
  158. height: 50px;
  159. border-radius: 6px;
  160. background: #f6f6f6;
  161. .warn_text {
  162. font-family: Source Han Sans CN;
  163. font-size: 12px;
  164. font-weight: 500;
  165. letter-spacing: 0.1em;
  166. color: #fa1c1c;
  167. }
  168. .detail_btn {
  169. width: 105px;
  170. height: 31px;
  171. border-radius: 16px;
  172. background: #06518b;
  173. display: flex;
  174. align-items: center;
  175. justify-content: center;
  176. font-family: Source Han Sans CN;
  177. font-size: 12px;
  178. font-weight: normal;
  179. letter-spacing: 0.1em;
  180. color: #ffffff;
  181. }
  182. }
  183. }
  184. .right_container {
  185. height: 580px;
  186. box-sizing: border-box;
  187. border-radius: 16px;
  188. background: #ffffff;
  189. flex: 1;
  190. padding: 42px;
  191. padding-top: 32px;
  192. .setting_title {
  193. width: 340px;
  194. height: 45px;
  195. border-radius: 23px;
  196. background: #06518b;
  197. padding: 0 24px;
  198. box-sizing: border-box;
  199. display: flex;
  200. align-items: center;
  201. justify-content: space-between;
  202. font-family: Source Han Sans CN;
  203. font-size: 14px;
  204. font-weight: normal;
  205. letter-spacing: 0.1em;
  206. color: #ffffff;
  207. margin-bottom: 41px;
  208. }
  209. .set_form {
  210. width: 340px;
  211. height: 190px;
  212. box-sizing: border-box;
  213. margin-bottom: 41px;
  214. overflow: hidden;
  215. background: url(../assets/img/operator/form.png) no-repeat;
  216. background-size: 100% 100%;
  217. position: relative;
  218. .room_size {
  219. position: absolute;
  220. top: 45px;
  221. left: 23px;
  222. width: 189px;
  223. height: 20px;
  224. text-align: center;
  225. border: none;
  226. outline: none;
  227. }
  228. .log {
  229. position: absolute;
  230. top: 145px;
  231. left: 0px;
  232. width: 240px;
  233. height: 42px;
  234. text-align: center;
  235. display: flex;
  236. align-items: center;
  237. justify-content: center;
  238. font-family: Source Han Sans CN;
  239. font-size: 14px;
  240. font-weight: 500;
  241. letter-spacing: 0.06em;
  242. color: #0e0e0e;
  243. }
  244. }
  245. .start {
  246. margin-bottom: 30px;
  247. width: 340px;
  248. height: 45px;
  249. border-radius: 23px;
  250. background: #06518b;
  251. display: flex;
  252. align-items: center;
  253. justify-content: center;
  254. font-family: Source Han Sans CN;
  255. font-size: 14px;
  256. font-weight: normal;
  257. letter-spacing: 0.1em;
  258. color: #ffffff;
  259. }
  260. .cant {
  261. background: #f4f4f4;
  262. }
  263. .progress {
  264. width: 340px;
  265. height: 114px;
  266. border-radius: 16px;
  267. opacity: 1;
  268. background: #f6f6f6;
  269. box-sizing: border-box;
  270. padding: 27px 24px 18px 27px;
  271. .title {
  272. font-family: Source Han Sans CN;
  273. font-size: 12px;
  274. font-weight: 350;
  275. letter-spacing: 0.06em;
  276. color: #9e9e9e;
  277. margin-bottom: 13px;
  278. }
  279. .tube {
  280. width: 292px;
  281. height: 14px;
  282. border-radius: 7px;
  283. background: #ffffff;
  284. margin-bottom: 11px;
  285. position: relative;
  286. overflow: hidden;
  287. .pro {
  288. position: absolute;
  289. left: 0;
  290. top: 0;
  291. height: 14px;
  292. width: var(--width);
  293. border-radius: 7px;
  294. background: #06518b;
  295. }
  296. }
  297. .num {
  298. display: flex;
  299. justify-content: flex-end;
  300. font-family: Source Han Sans CN;
  301. font-size: 10px;
  302. font-weight: normal;
  303. letter-spacing: 0.06em;
  304. color: #9e9e9e;
  305. }
  306. }
  307. }
  308. }
  309. </style>