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

419 lines
20 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
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
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. <svg
  21. v-if="
  22. operatorStore.disinfectStatus != 0 &&
  23. operatorStore.disinfectStatus != 3
  24. "
  25. @click="toDetail"
  26. xmlns="http://www.w3.org/2000/svg"
  27. xmlns:xlink="http://www.w3.org/1999/xlink"
  28. fill="none"
  29. version="1.1"
  30. width="218"
  31. height="50"
  32. viewBox="0 0 218 50"
  33. >
  34. <g>
  35. <g>
  36. <rect
  37. x="0"
  38. y="0"
  39. width="218"
  40. height="50"
  41. rx="25"
  42. fill="#06518B"
  43. fill-opacity="1"
  44. />
  45. </g>
  46. <g>
  47. <ellipse
  48. cx="26"
  49. cy="25"
  50. rx="19"
  51. ry="19"
  52. fill="#FFFFFF"
  53. fill-opacity="1"
  54. />
  55. </g>
  56. <g>
  57. <path
  58. d="M65.16,27.84L72.68,27.84L72.68,29.24L65.16,29.24L65.16,27.84ZM65.16,25.22L72.68,25.22L72.68,26.58L65.16,26.58L65.16,25.22ZM63.28,23.939999999999998L63.28,30.52L74.64,30.52L74.64,23.939999999999998L63.28,23.939999999999998ZM60.36,31.62L60.36,33.3L77.7,33.3L77.7,31.62L60.36,31.62ZM68,15.3325L68,17.740000000000002L60.1,17.740000000000002L60.1,19.4L66.08,19.4C64.42,21.14,61.96,22.68,59.62,23.46C60.02,23.84,60.56,24.52,60.84,24.98C63.5,23.92,66.2,21.96,68,19.68L68,23.32L69.88,23.32L69.88,19.68C71.72,21.9,74.44,23.82,77.12,24.82C77.4,24.34,77.96000000000001,23.64,78.36,23.28C75.94,22.52,73.44,21.08,71.78,19.4L77.92,19.4L77.92,17.740000000000002L69.88,17.740000000000002L69.88,15.3325L68,15.3325ZM87.36,28.06L95.44,28.06L95.44,29.24L87.36,29.24L87.36,28.06ZM87.36,26.82L87.36,25.68L95.44,25.68L95.44,26.82L87.36,26.82ZM87.36,30.48L95.44,30.48L95.44,31.72L87.36,31.72L87.36,30.48ZM96.84,15.455C93.56,16.05844,87.62,16.34,82.72,16.36C82.88,16.740000000000002,83.06,17.380000000000003,83.08,17.8C84.74,17.8,86.52,17.759999999999998,88.32,17.7L87.98,18.86L82.96000000000001,18.86L82.96000000000001,20.32L87.44,20.32C87.28,20.72,87.1,21.119999999999997,86.92,21.52L81.53999999999999,21.52L81.53999999999999,23.060000000000002L86.08,23.060000000000002C84.84,25.08,83.18,26.86,80.98,28.08C81.36,28.46,81.9,29.14,82.16,29.58C83.44,28.82,84.56,27.9,85.53999999999999,26.86L85.53999999999999,33.965599999999995L87.36,33.965599999999995L87.36,33.18L95.44,33.18L95.44,33.965599999999995L97.32,33.965599999999995L97.32,24.22L87.56,24.22C87.8,23.84,88.02,23.46,88.24,23.060000000000002L99.25999999999999,23.060000000000002L99.25999999999999,21.52L89,21.52L89.5,20.32L98.14,20.32L98.14,18.86L90.02,18.86L90.4,17.6C93.22,17.439999999999998,95.92,17.2,98,16.82L96.84,15.455ZM109.14,26.74C110.78,27.08,112.86,27.8,114,28.36L114.78,27.14C113.62,26.6,111.56,25.96,109.92,25.64L109.14,26.74ZM107.22,29.3C110,29.62,113.46000000000001,30.42,115.38,31.12L116.22,29.76C114.22,29.08,110.8,28.34,108.1,28.04L107.22,29.3ZM103.38,16.16L103.38,33.9256L105.2,33.9256L105.2,33.120000000000005L118.36,33.120000000000005L118.36,33.9256L120.24000000000001,33.9256L120.24000000000001,16.16L103.38,16.16ZM105.2,31.44L105.2,17.880000000000003L118.36,17.880000000000003L118.36,31.44L105.2,31.44ZM110.02000000000001,18.08C109.02000000000001,19.64,107.32,21.16,105.64,22.119999999999997C106,22.4,106.64,22.96,106.92,23.259999999999998C107.44,22.92,107.96000000000001,22.52,108.47999999999999,22.08C109.02000000000001,22.619999999999997,109.64,23.119999999999997,110.34,23.58C108.74000000000001,24.28,106.97999999999999,24.82,105.3,25.14C105.62,25.48,106,26.22,106.18,26.68C108.08,26.22,110.12,25.5,111.94,24.54C113.56,25.38,115.38,26.04,117.2,26.42C117.42,26,117.9,25.34,118.25999999999999,25C116.62,24.72,114.97999999999999,24.240000000000002,113.5,23.619999999999997C114.94,22.66,116.16,21.52,117,20.22L115.94,19.58L115.66,19.66L110.82,19.66C111.1,19.32,111.36,18.96,111.58,18.6L110.02000000000001,18.08ZM109.53999999999999,21.08L114.32,21.1C113.66,21.72,112.82,22.3,111.88,22.82C110.96000000000001,22.3,110.18,21.72,109.53999999999999,21.08ZM128.1,33.909400000000005C128.6,33.5691,129.42000000000002,33.2887,135.07999999999998,31.5472C134.95999999999998,31.1466,134.8,30.3859,134.76,29.8653L130.12,31.2066L130.12,27.2228C131.2,26.4819,132.2,25.6412,133.01999999999998,24.7603C134.56,28.9444,137.22,31.9275,141.38,33.3287C141.66,32.8084,142.2,32.067499999999995,142.62,31.6672C140.7,31.1266,139.1,30.2056,137.78,28.9844C139,28.2638,140.38,27.3228,141.56,26.4019L139.98000000000002,25.2606C139.16,26.0616,137.86,27.0625,136.72,27.8434C135.94,26.9025,135.32,25.8212,134.86,24.66L141.94,24.66L141.94,23.04L134.1,23.04L134.1,21.54L140.45999999999998,21.54L140.45999999999998,20L134.1,20L134.1,18.6L141.3,18.6L141.3,16.96L134.1,16.96L134.1,15.333120000000001L132.2,15.333120000000001L132.2,16.96L125.26,16.96L125.26,18.6L132.2,18.6L132.2,20L126.26,20L126.26,21.54L132.2,21.54L132.2,23.04L124.42,23.04L124.42,24.66L130.64,24.66C128.8,26.2216,126.16,27.6431,123.78,28.3837C124.2,28.7644,124.76,29.465,125.04,29.9053C126.0
  59. fill="#FFFFFF"
  60. fill-opacity="1"
  61. />
  62. </g>
  63. <g>
  64. <path
  65. d="M18,17L18.964553,17L18.964553,19.60926C19.31313,18.12349,20.6479,17.0156627,22.2421,17.0156627C24.10176,17.0156627,25.60839,18.5212,25.60839,20.37952C25.60839,22.23783,24.10176,23.74337,22.2421,23.74337C20.6479,23.74337,19.31313,22.635550000000002,18.964553,21.14977L18.964553,26.86717C19.24149,26.62166,19.58398,26.33394,19.96769,26.04506C21.33735,25.01374,22.52761,24.491329999999998,23.505670000000002,24.491329999999998C24.16542,24.491329999999998,24.722929999999998,24.84602,25.162770000000002,25.543860000000002C25.502290000000002,26.08362,25.745359999999998,26.76603,25.980710000000002,27.4272C26.32795,28.4065,26.68869,29.4205,27.20569,29.426299999999998C27.23849,29.4147,27.560650000000003,29.2759,28.1104,27.8378C28.502000000000002,26.81229,28.893700000000003,25.4494,29.2718,24.13084C29.6614,22.77374,30.0627,21.37229,30.4717,20.3294C30.8594,19.33663,31.3629,18.32265,32.15,18.32265L34,18.32265L34,19.28651L32.1654,19.28651C32.140299999999996,19.29807,32.0265,19.3694,31.8413,19.6759C31.6774,19.94771,31.497999999999998,20.34096,31.3089,20.8441C30.938499999999998,21.82723,30.5643,23.13229,30.2016,24.39687C29.802300000000002,25.790599999999998,29.3875,27.2325,28.961199999999998,28.3159C28.5561,29.3414,28.0333,30.3901,27.21148,30.3901C26.650109999999998,30.3901,26.171689999999998,30.0701,25.79166,29.439799999999998C25.506149999999998,28.9655,25.28623,28.3467,25.07403,27.749200000000002C24.597540000000002,26.405540000000002,24.205930000000002,25.45518,23.5076,25.45518C22.757170000000002,25.45518,21.73668,25.92361,20.559919999999998,26.80843C19.74317,27.4227,19.10877,28.0474,18.964553,28.1922L18.964553,32.0229L34,32.0229L34,32.9867L18.964553,32.9867L18.964553,33L18,33L18,17ZM23.939709999999998,18.68313C23.48638,18.23012,22.88449,17.979518,22.2421,17.979518C21.59971,17.979518,20.99783,18.23012,20.54449,18.68313C20.09115,19.13614,19.84037,19.73952,19.84037,20.37952C19.84037,21.01952,20.09115,21.622889999999998,20.54449,22.0759C20.99783,22.52892,21.60164,22.779519999999998,22.2421,22.779519999999998C22.88257,22.779519999999998,23.48638,22.52892,23.939709999999998,22.0759C24.39305,21.622889999999998,24.64384,21.01952,24.64384,20.37952C24.64384,19.73952,24.39305,19.13614,23.939709999999998,18.68313ZM22.05305,19.22289L21.0885,19.22289L21.0885,20.57229L21.08464,20.57229L21.08464,21.53614L23.39956,21.53614L23.39956,20.57229L22.05305,20.57229L22.05305,19.22289Z"
  66. fill-rule="evenodd"
  67. fill="#06518B"
  68. fill-opacity="1"
  69. />
  70. </g>
  71. </g>
  72. </svg>
  73. </div>
  74. </div>
  75. <div class="right_container">
  76. <div class="setting_title">
  77. <p>消毒设置</p>
  78. <p>SET</p>
  79. </div>
  80. <div class="set_form">
  81. <input
  82. type="number"
  83. :disabled="[1, 2].includes(operatorStore.disinfectStatus)"
  84. v-model="roomSize"
  85. class="room_size"
  86. id="room_size"
  87. @focus="handleShowKeyBoard"
  88. />
  89. <div class="log" @click="showLogPicker">{{ logVal }}</div>
  90. </div>
  91. <div
  92. :class="
  93. [1, 2].includes(operatorStore.disinfectStatus)
  94. ? 'start cant'
  95. : 'start style-btn'
  96. "
  97. @click="startDisinfect"
  98. >
  99. 开始消毒
  100. </div>
  101. <div class="progress">
  102. <p class="title">预计剩余时间</p>
  103. <!-- <div class="tube">
  104. <div
  105. class="pro"
  106. :style="{
  107. '--width': '50px',
  108. }"
  109. ></div>
  110. </div>
  111. <div class="num">000/100</div> -->
  112. <div class="time">
  113. {{
  114. operatorStore.estimatedRemainingTimeS == 0
  115. ? '已结束'
  116. : `${time_To_hhmmss(operatorStore.estimatedRemainingTimeS)}`
  117. }}
  118. </div>
  119. </div>
  120. </div>
  121. <!-- <WarnModal /> -->
  122. <LogPicker
  123. v-if="logVisible"
  124. :changeLogVal="changeLogVal"
  125. :logVal="logVal"
  126. />
  127. </div>
  128. </template>
  129. <script setup>
  130. import LogPicker from 'cpns/dialogs/LogPicker'
  131. import WarnModal from 'cpns/dialogs/WarnModal'
  132. import DisinfectantLiquidInfo from 'cpns/info/DisinfectantLiquidInfo'
  133. import EnvironmentInfo from 'cpns/info/EnvironmentInfo'
  134. import { ref, watch, onMounted, onUnmounted } from 'vue'
  135. import { useOperatorStore, useWebSocketStore } from '@/store'
  136. import { startDisinfectionJSON, getStateJSON } from '@/mock/command'
  137. import { showSuccessToast, showFailToast } from 'vant'
  138. import { time_To_hhmmss } from '@/utils'
  139. const operatorStore = useOperatorStore()
  140. const webSocketStore = useWebSocketStore()
  141. const props = defineProps({
  142. changeShowOperator: {
  143. type: Function,
  144. },
  145. handleShowKeyBoard: {
  146. type: Function,
  147. },
  148. hideKeyBoard: {
  149. type: Function,
  150. },
  151. input: {
  152. type: String,
  153. },
  154. })
  155. const toDetail = () => {
  156. // 判断当前消毒任务是否开始,如果开始时才生效 否则点击不生效
  157. if (operatorStore.disinfectStatus != 0) {
  158. props.changeShowOperator(false)
  159. }
  160. }
  161. const logVisible = ref(false)
  162. const logVal = ref('3')
  163. const roomSize = ref(0)
  164. watch(() => {
  165. if (props.input) {
  166. roomSize.value = props.input?.match(/\d+/g)[0]
  167. } else {
  168. roomSize.value = 0
  169. }
  170. })
  171. const changeLogVal = val => {
  172. logVal.value = val
  173. logVisible.value = false
  174. }
  175. const startDisinfect = () => {
  176. // 改变开始消毒状态 如果已经开始则不可点击
  177. if (![1, 2].includes(operatorStore.disinfectStatus)) {
  178. if (roomSize.value == 0) {
  179. showFailToast('请调整房间大小设置,不能为0')
  180. } else {
  181. localStorage.removeItem('bin')
  182. localStorage.removeItem('envir1')
  183. localStorage.removeItem('envir2')
  184. localStorage.clear()
  185. webSocketStore.sendCommandMsg(
  186. startDisinfectionJSON(parseInt(logVal.value), parseInt(roomSize.value)),
  187. )
  188. props.changeShowOperator(false)
  189. }
  190. }
  191. }
  192. const showLogPicker = () => {
  193. if (![1, 2].includes(operatorStore.disinfectStatus)) {
  194. logVisible.value = true
  195. }
  196. }
  197. const timer = ref(null)
  198. onMounted(() => {
  199. timer.value = setInterval(() => {
  200. webSocketStore.sendCommandMsg(getStateJSON)
  201. }, 1000)
  202. })
  203. onUnmounted(() => {
  204. timer.value = null
  205. })
  206. </script>
  207. <style lang="scss" scoped>
  208. .operator_main_content {
  209. margin-bottom: 19px;
  210. height: 580px;
  211. box-sizing: border-box;
  212. display: flex;
  213. align-items: center;
  214. .left_contaienr {
  215. margin-right: 30px;
  216. width: 766px;
  217. height: 580px;
  218. box-sizing: border-box;
  219. border-radius: 16px;
  220. background: #ffffff;
  221. padding: 20px;
  222. .info_cards {
  223. width: 726px;
  224. height: 470px;
  225. box-sizing: border-box;
  226. display: grid;
  227. grid-template-columns: repeat(2, 1fr);
  228. grid-template-rows: repeat(2, 1fr);
  229. column-gap: 20px;
  230. row-gap: 20px;
  231. margin-bottom: 20px;
  232. .card {
  233. width: 353px;
  234. height: 225px;
  235. border-radius: 17.5px;
  236. background: #06518b;
  237. }
  238. }
  239. .warn_wrap {
  240. display: flex;
  241. align-items: center;
  242. justify-content: space-between;
  243. box-sizing: border-box;
  244. width: 726px;
  245. height: 50px;
  246. border-radius: 6px;
  247. .warn_text {
  248. font-family: Source Han Sans CN;
  249. font-size: 12px;
  250. font-weight: 500;
  251. letter-spacing: 0.1em;
  252. color: #fa1c1c;
  253. background: #f6f6f6;
  254. width: 468px;
  255. height: 50px;
  256. border-radius: 6px;
  257. display: flex;
  258. align-items: center;
  259. padding-left: 22px;
  260. }
  261. .detail_btn {
  262. width: 105px;
  263. height: 40px;
  264. border-radius: 20px;
  265. background: #06518b;
  266. display: flex;
  267. align-items: center;
  268. justify-content: center;
  269. font-family: Source Han Sans CN;
  270. font-size: 18px;
  271. font-weight: normal;
  272. letter-spacing: 0.1em;
  273. color: #ffffff;
  274. }
  275. }
  276. }
  277. .right_container {
  278. height: 580px;
  279. box-sizing: border-box;
  280. border-radius: 16px;
  281. background: #ffffff;
  282. flex: 1;
  283. padding: 42px;
  284. padding-top: 32px;
  285. .setting_title {
  286. width: 340px;
  287. height: 45px;
  288. border-radius: 23px;
  289. background: #06518b;
  290. padding: 0 24px;
  291. box-sizing: border-box;
  292. display: flex;
  293. align-items: center;
  294. justify-content: space-between;
  295. font-family: Source Han Sans CN;
  296. font-size: 14px;
  297. font-weight: normal;
  298. letter-spacing: 0.1em;
  299. color: #ffffff;
  300. margin-bottom: 41px;
  301. }
  302. .set_form {
  303. width: 340px;
  304. height: 190px;
  305. box-sizing: border-box;
  306. margin-bottom: 41px;
  307. overflow: hidden;
  308. background: url(../assets/img/operator/form.png) no-repeat;
  309. background-size: 100% 100%;
  310. position: relative;
  311. .room_size {
  312. position: absolute;
  313. top: 45px;
  314. left: 23px;
  315. width: 189px;
  316. height: 20px;
  317. text-align: center;
  318. border: none;
  319. outline: none;
  320. }
  321. .log {
  322. position: absolute;
  323. top: 145px;
  324. left: 0px;
  325. width: 240px;
  326. height: 42px;
  327. text-align: center;
  328. display: flex;
  329. align-items: center;
  330. justify-content: center;
  331. font-family: Source Han Sans CN;
  332. font-size: 14px;
  333. font-weight: 500;
  334. letter-spacing: 0.06em;
  335. color: #0e0e0e;
  336. }
  337. }
  338. .start {
  339. margin-bottom: 30px;
  340. width: 340px;
  341. height: 45px;
  342. border-radius: 23px;
  343. background: #06518b;
  344. display: flex;
  345. align-items: center;
  346. justify-content: center;
  347. font-family: Source Han Sans CN;
  348. font-size: 14px;
  349. font-weight: normal;
  350. letter-spacing: 0.1em;
  351. color: #ffffff;
  352. position: relative;
  353. overflow: hidden;
  354. }
  355. .cant {
  356. background: #f4f4f4;
  357. }
  358. .progress {
  359. width: 340px;
  360. height: 114px;
  361. border-radius: 16px;
  362. opacity: 1;
  363. background: #f6f6f6;
  364. box-sizing: border-box;
  365. padding: 27px 24px 18px 27px;
  366. .title {
  367. font-family: Source Han Sans CN;
  368. font-size: 12px;
  369. font-weight: 350;
  370. letter-spacing: 0.06em;
  371. color: #9e9e9e;
  372. margin-bottom: 13px;
  373. }
  374. .time {
  375. text-align: center;
  376. padding: 10px;
  377. }
  378. .tube {
  379. width: 292px;
  380. height: 14px;
  381. border-radius: 7px;
  382. background: #ffffff;
  383. margin-bottom: 11px;
  384. position: relative;
  385. overflow: hidden;
  386. .pro {
  387. position: absolute;
  388. left: 0;
  389. top: 0;
  390. height: 14px;
  391. width: var(--width);
  392. border-radius: 7px;
  393. background: #06518b;
  394. }
  395. }
  396. .num {
  397. display: flex;
  398. justify-content: flex-end;
  399. font-family: Source Han Sans CN;
  400. font-size: 10px;
  401. font-weight: normal;
  402. letter-spacing: 0.06em;
  403. color: #9e9e9e;
  404. }
  405. }
  406. }
  407. }
  408. </style>