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

911 lines
22 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
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="update_device_container">
  3. <div class="row_wrap">
  4. <p class="title">消毒停止过氧化氢浓度(ppm)</p>
  5. <p class="num">
  6. <van-field
  7. class="field_font"
  8. type="number"
  9. v-model="stoped_gs"
  10. :clickable="true"
  11. :formatter="formatter1"
  12. readonly
  13. @click.stop="hideClickKey(3)"
  14. />
  15. </p>
  16. </div>
  17. <div class="row_wrap">
  18. <p class="title">消毒继续过氧化氢浓度(ppm)</p>
  19. <p class="num">
  20. <van-field
  21. type="number"
  22. class="field_font"
  23. v-model="continued_gs"
  24. :clickable="true"
  25. :formatter="formatter2"
  26. readonly
  27. @click.stop="hideClickKey(4)"
  28. />
  29. </p>
  30. </div>
  31. <div class="row_wrap">
  32. <p class="title">消毒停止相对湿度(%RH)</p>
  33. <p class="num">
  34. <van-field
  35. type="number"
  36. class="field_font"
  37. v-model="stoped_humi"
  38. :clickable="true"
  39. :formatter="formatter9"
  40. readonly
  41. @click.stop="hideClickKey(9)"
  42. />
  43. </p>
  44. </div>
  45. <div class="row_wrap">
  46. <p class="title">消毒继续相对湿度(%RH)</p>
  47. <p class="num">
  48. <van-field
  49. type="number"
  50. class="field_font"
  51. v-model="continued_humi"
  52. :clickable="true"
  53. :formatter="formatter10"
  54. readonly
  55. @click.stop="hideClickKey(10)"
  56. />
  57. </p>
  58. </div>
  59. <div class="row_wrap">
  60. <p class="title">消毒停止过氧化氢相对饱和度(%RS)</p>
  61. <p class="num">
  62. <van-field
  63. type="number"
  64. class="field_font"
  65. :formatter="formatter3"
  66. v-model="stoped_satur"
  67. :clickable="true"
  68. readonly
  69. @click.stop="hideClickKey(5)"
  70. />
  71. </p>
  72. </div>
  73. <div class="row_wrap">
  74. <p class="title">消毒继续过氧化氢相对饱和度(%RS)</p>
  75. <p class="num">
  76. <van-field
  77. type="number"
  78. class="field_font"
  79. :formatter="formatter4"
  80. v-model="continued_satur"
  81. :clickable="true"
  82. readonly
  83. @click.stop="hideClickKey(6)"
  84. />
  85. </p>
  86. </div>
  87. <div class="row_wrap">
  88. <p class="title">注射蠕动泵速率(g/min)</p>
  89. <p class="num">
  90. <van-field
  91. type="number"
  92. class="field_font"
  93. v-model="sprayLiquidConfigVal"
  94. :clickable="true"
  95. :formatter="formatter7"
  96. readonly
  97. @click.stop="hideClickKey(2)"
  98. />
  99. </p>
  100. </div>
  101. <div class="row_wrap" @click="showLogPicker">
  102. <p class="title">Log等级</p>
  103. <div class="num">
  104. <p class="log">{{ logVal }}</p>
  105. </div>
  106. </div>
  107. <div class="row_wrap">
  108. <p class="title">配方名称</p>
  109. <div>
  110. <input
  111. id="id_formula"
  112. type="text"
  113. v-model="formula_id"
  114. class="formula_input"
  115. placeholder="请输入配方名称"
  116. @focus="handleShowKeyBoard"
  117. />
  118. </div>
  119. </div>
  120. <van-number-keyboard
  121. v-model="addLiquidConfigVal"
  122. :title="addLiquidConfigVal"
  123. :show="addLiquidConfigValShow"
  124. @input="val => handleInput(val, 1)"
  125. theme="custom"
  126. close-button-text="确定"
  127. @close="setAddliquidVal"
  128. @blur="addLiquidConfigValShow = false"
  129. />
  130. <van-number-keyboard
  131. v-model="sprayLiquidConfigVal"
  132. @input="val => handleInput(val, 2)"
  133. :title="sprayLiquidConfigVal"
  134. :show="sprayLiquidConfigValShow"
  135. theme="custom"
  136. @close="setSprayLiquidVal"
  137. close-button-text="确定"
  138. @blur="sprayLiquidConfigValShow = false"
  139. />
  140. <van-number-keyboard
  141. v-model="stoped_gs"
  142. @input="val => handleInput(val, 3)"
  143. :title="stoped_gs"
  144. :show="stoped_gsShow"
  145. theme="custom"
  146. @close="setStopedGsVal"
  147. close-button-text="确定"
  148. @blur="stoped_gsShow = false"
  149. />
  150. <van-number-keyboard
  151. v-model="continued_gs"
  152. @input="val => handleInput(val, 4)"
  153. :title="continued_gs"
  154. @close="setcontinuedGsVal"
  155. :show="continued_gsShow"
  156. theme="custom"
  157. close-button-text="确定"
  158. @blur="continued_gsShow = false"
  159. />
  160. <van-number-keyboard
  161. v-model="stoped_satur"
  162. @input="val => handleInput(val, 5)"
  163. :title="stoped_satur"
  164. @close="setstopedSaturVal"
  165. :show="stoped_saturShow"
  166. theme="custom"
  167. close-button-text="确定"
  168. @blur="stoped_saturShow = false"
  169. />
  170. <van-number-keyboard
  171. v-model="continued_satur"
  172. @input="val => handleInput(val, 6)"
  173. :title="continued_satur"
  174. @close="setContinuedSaturVal"
  175. :show="continued_saturShow"
  176. theme="custom"
  177. close-button-text="确定"
  178. @blur="continued_saturShow = false"
  179. />
  180. <van-number-keyboard
  181. v-model="max_humidity"
  182. @input="val => handleInput(val, 7)"
  183. :title="max_humidity"
  184. @close="setMaxHumidityVal"
  185. :show="max_humidityShow"
  186. theme="custom"
  187. close-button-text="确定"
  188. @blur="max_humidityShow = false"
  189. />
  190. <van-number-keyboard
  191. theme="custom"
  192. close-button-text="确定"
  193. @input="val => handleInput(val, 8)"
  194. @close="setHeat_timeVal"
  195. v-model="pre_heat_time_s"
  196. :title="pre_heat_time_s"
  197. :show="pre_heat_time_sShow"
  198. @blur="pre_heat_time_sShow = false"
  199. />
  200. <van-number-keyboard
  201. @input="val => handleInput(val, 9)"
  202. theme="custom"
  203. close-button-text="确定"
  204. @close="setstoped_humiVal"
  205. v-model="stoped_humi"
  206. :title="stoped_humi"
  207. :show="stoped_humiShow"
  208. @blur="stoped_humiShow = false"
  209. />
  210. <van-number-keyboard
  211. theme="custom"
  212. @input="val => handleInput(val, 10)"
  213. close-button-text="确定"
  214. @close="setcontinued_humiVal"
  215. v-model="continued_humi"
  216. :title="continued_humi"
  217. :show="continued_humiShow"
  218. @blur="continued_humiShow = false"
  219. />
  220. <LogPicker
  221. v-if="logVisible"
  222. :hiddenLogVisible="hiddenLogVisible"
  223. :changeLogVal="changeLogVal"
  224. :logVal="logVal"
  225. />
  226. <div class="btns">
  227. <div class="btn" @click="save">修改</div>
  228. <div class="btn ml" @click="hiddleSettingModal">返回</div>
  229. </div>
  230. <div class="key_wrap" v-show="showkeyboard" id="keyboard_formula">
  231. <SimpleKeyboard
  232. @onKeyPress="onKeyPress"
  233. @onChange="onChange"
  234. :input="formula_id"
  235. />
  236. </div>
  237. </div>
  238. </template>
  239. <script setup>
  240. import { ref, onMounted, watch } from 'vue'
  241. import SimpleKeyboard from 'cpns/SimpleKeyboard'
  242. import { showSuccessToast, showFailToast } from 'vant'
  243. import {
  244. useSettingStore,
  245. useWebSocketStore,
  246. useOperatorStore,
  247. useFormulaStore,
  248. } from '@/store'
  249. import { storeToRefs } from 'pinia'
  250. import {
  251. setSettingValJSON,
  252. addFormulaJSON,
  253. getAllFormulaJSON,
  254. updateAllFormulaJSON,
  255. updateFormulaJSON,
  256. } from '@/mock/command'
  257. import LogPicker from 'cpns/dialogs/LogPicker'
  258. const settingStore = useSettingStore()
  259. const webSocketStore = useWebSocketStore()
  260. const operatorStore = useOperatorStore()
  261. const formulaStore = useFormulaStore()
  262. const max_humidity = ref('0')
  263. const continued_satur = ref(props.formulaInfo.continued_satur)
  264. const stoped_satur = ref(props.formulaInfo.stoped_satur)
  265. const continued_gs = ref(props.formulaInfo.continued_gs)
  266. const stoped_gs = ref(props.formulaInfo.stoped_gs)
  267. const addLiquidConfigVal = ref('0')
  268. const sprayLiquidConfigVal = ref(props.formulaInfo.injection_pump_speed)
  269. const stoped_humi = ref(props.formulaInfo.stoped_humi)
  270. const continued_humi = ref(props.formulaInfo.continued_humi)
  271. const pre_heat_time_s = ref('0')
  272. const pre_heat_time_sShow = ref(false)
  273. const addLiquidConfigValShow = ref(false)
  274. const sprayLiquidConfigValShow = ref(false)
  275. const stoped_gsShow = ref(false)
  276. const continued_gsShow = ref(false)
  277. const stoped_saturShow = ref(false)
  278. const continued_saturShow = ref(false)
  279. const max_humidityShow = ref(false)
  280. const stoped_humiShow = ref(false)
  281. const continued_humiShow = ref(false)
  282. const logVisible = ref(false)
  283. const logVal = ref(props.formulaInfo.loglevel)
  284. const formula_id = ref(props.formulaInfo.formula_id)
  285. // watch(formula_id, (newValue, oldValue) => {
  286. // if (newValue != '') {
  287. // // webSocketStore.sendCommandMsg(
  288. // // updateFormulaJSON('formula_id', newValue, props.formulaInfo.id),
  289. // // )
  290. // }
  291. // })
  292. const onKeyPress = button => {
  293. if (button == '{bksp}') {
  294. formula_id.value = formula_id.value.substr(0, formula_id.value.length - 1)
  295. }
  296. }
  297. const save = () => {
  298. if (formula_id.value == '') {
  299. showFailToast('配方名称不能为空')
  300. return
  301. }
  302. const data = {
  303. id: props.formulaInfo.id,
  304. formula_id: formula_id.value,
  305. loglevel: parseInt(logVal.value),
  306. injection_pump_speed: parseInt(sprayLiquidConfigVal.value),
  307. stoped_gs: parseInt(stoped_gs.value),
  308. continued_gs: parseInt(continued_gs.value),
  309. stoped_satur: parseInt(stoped_satur.value),
  310. continued_satur: parseInt(continued_satur.value),
  311. stoped_humi: parseInt(stoped_humi.value),
  312. continued_humi: parseInt(continued_humi.value),
  313. }
  314. console.log(data)
  315. webSocketStore.sendCommandMsg(updateAllFormulaJSON(data))
  316. webSocketStore.sendCommandMsg(getAllFormulaJSON)
  317. props.hideSettingModal()
  318. }
  319. const changeLogVal = val => {
  320. logVal.value = val
  321. logVisible.value = false
  322. // webSocketStore.sendCommandMsg(
  323. // updateFormulaJSON('loglevel', val, props.formulaInfo.id),
  324. // )
  325. }
  326. const hiddenLogVisible = () => {
  327. logVisible.value = false
  328. }
  329. const showLogPicker = () => {
  330. logVisible.value = true
  331. }
  332. const isFirstClick = ref(true)
  333. const props = defineProps({
  334. hideSettingModal: {
  335. type: Function,
  336. },
  337. formulaInfo: {
  338. type: Object,
  339. },
  340. })
  341. const hiddleSettingModal = () => {
  342. webSocketStore.sendCommandMsg(getAllFormulaJSON)
  343. props.hideSettingModal()
  344. }
  345. const hideClickKey = flag => {
  346. isFirstClick.value = true
  347. stoped_humiShow.value = false
  348. continued_humiShow.value = false
  349. pre_heat_time_sShow.value = false
  350. addLiquidConfigValShow.value = false
  351. sprayLiquidConfigValShow.value = false
  352. stoped_gsShow.value = false
  353. continued_gsShow.value = false
  354. stoped_saturShow.value = false
  355. continued_saturShow.value = false
  356. max_humidityShow.value = false
  357. if (flag == 1) {
  358. addLiquidConfigValShow.value = true
  359. }
  360. if (flag == 2) {
  361. sprayLiquidConfigValShow.value = true
  362. }
  363. if (flag == 3) {
  364. stoped_gsShow.value = true
  365. }
  366. if (flag == 4) {
  367. continued_gsShow.value = true
  368. }
  369. if (flag == 5) {
  370. stoped_saturShow.value = true
  371. }
  372. if (flag == 6) {
  373. continued_saturShow.value = true
  374. }
  375. if (flag == 7) {
  376. max_humidityShow.value = true
  377. }
  378. if (flag == 8) {
  379. pre_heat_time_sShow.value = true
  380. }
  381. if (flag == 9) {
  382. stoped_humiShow.value = true
  383. }
  384. if (flag == 10) {
  385. continued_humiShow.value = true
  386. }
  387. }
  388. const handleInput = (value, index) => {
  389. if (isFirstClick.value) {
  390. if (index == 1) {
  391. setTimeout(() => {
  392. addLiquidConfigVal.value = value + ''
  393. })
  394. }
  395. if (index == 2) {
  396. setTimeout(() => {
  397. sprayLiquidConfigVal.value = value + ''
  398. })
  399. }
  400. if (index == 3) {
  401. setTimeout(() => {
  402. stoped_gs.value = value + ''
  403. })
  404. }
  405. if (index == 4) {
  406. setTimeout(() => {
  407. continued_gs.value = value + ''
  408. })
  409. }
  410. if (index == 5) {
  411. setTimeout(() => {
  412. stoped_satur.value = value + ''
  413. })
  414. }
  415. if (index == 6) {
  416. setTimeout(() => {
  417. continued_satur.value = value + ''
  418. })
  419. }
  420. if (index == 7) {
  421. setTimeout(() => {
  422. max_humidity.value = value + ''
  423. })
  424. }
  425. if (index == 8) {
  426. setTimeout(() => {
  427. pre_heat_time_s.value = value + ''
  428. })
  429. }
  430. if (index == 9) {
  431. setTimeout(() => {
  432. stoped_humi.value = value + ''
  433. })
  434. }
  435. if (index == 10) {
  436. setTimeout(() => {
  437. continued_humi.value = value + ''
  438. })
  439. }
  440. isFirstClick.value = false
  441. }
  442. }
  443. const formatter1 = value => {
  444. if (parseInt(value) == 0) {
  445. return '0'
  446. }
  447. let arr = settingStore.allSettingList.filter(item => item.name == 'stoped_gs')
  448. if (arr && arr.length > 0) {
  449. if (parseInt(value) > arr[0].val_upper_limit) {
  450. return arr[0].val_upper_limit + ''
  451. }
  452. if (parseInt(value) < arr[0].val_lower_limit) {
  453. return arr[0].val_lower_limit + ''
  454. }
  455. }
  456. if (value == '') {
  457. return '0'
  458. }
  459. return value.replace(/^0+/gi, '')
  460. }
  461. const formatter2 = value => {
  462. if (parseInt(value) == 0) {
  463. return '0'
  464. }
  465. let arr = settingStore.allSettingList.filter(
  466. item => item.name == 'continued_gs',
  467. )
  468. if (arr && arr.length > 0) {
  469. if (parseInt(value) > arr[0].val_upper_limit) {
  470. return arr[0].val_upper_limit + ''
  471. }
  472. if (parseInt(value) < arr[0].val_lower_limit) {
  473. return arr[0].val_lower_limit + ''
  474. }
  475. }
  476. if (value == '') {
  477. return '0'
  478. }
  479. return value.replace(/^0+/gi, '')
  480. }
  481. const formatter3 = value => {
  482. if (parseInt(value) == 0) {
  483. return '0'
  484. }
  485. let arr = settingStore.allSettingList.filter(
  486. item => item.name == 'stoped_satur',
  487. )
  488. if (arr && arr.length > 0) {
  489. if (parseInt(value) > arr[0].val_upper_limit) {
  490. return arr[0].val_upper_limit + ''
  491. }
  492. if (parseInt(value) < arr[0].val_lower_limit) {
  493. return arr[0].val_lower_limit + ''
  494. }
  495. }
  496. if (value == '') {
  497. return '0'
  498. }
  499. return value.replace(/^0+/gi, '')
  500. }
  501. const formatter4 = value => {
  502. if (parseInt(value) == 0) {
  503. return '0'
  504. }
  505. let arr = settingStore.allSettingList.filter(
  506. item => item.name == 'continued_satur',
  507. )
  508. if (arr && arr.length > 0) {
  509. if (parseInt(value) > arr[0].val_upper_limit) {
  510. return arr[0].val_upper_limit + ''
  511. }
  512. if (parseInt(value) < arr[0].val_lower_limit) {
  513. return arr[0].val_lower_limit + ''
  514. }
  515. }
  516. if (value == '') {
  517. return '0'
  518. }
  519. return value.replace(/^0+/gi, '')
  520. }
  521. const formatter5 = value => {
  522. if (parseInt(value) == 0) {
  523. return '0'
  524. }
  525. let arr = settingStore.allSettingList.filter(
  526. item => item.name == 'max_humidity',
  527. )
  528. if (arr && arr.length > 0) {
  529. if (parseInt(value) > arr[0].val_upper_limit) {
  530. return arr[0].val_upper_limit + ''
  531. }
  532. if (parseInt(value) < arr[0].val_lower_limit) {
  533. return arr[0].val_lower_limit + ''
  534. }
  535. }
  536. if (value == '') {
  537. return '0'
  538. }
  539. return value.replace(/^0+/gi, '')
  540. }
  541. const formatter6 = value => {
  542. if (parseInt(value) == 0) {
  543. return '0'
  544. }
  545. let arr = settingStore.allSettingList.filter(
  546. item => item.name == 'drainage_pump_speed',
  547. )
  548. if (arr && arr.length > 0) {
  549. if (parseInt(value) > arr[0].val_upper_limit) {
  550. return arr[0].val_upper_limit + ''
  551. }
  552. if (parseInt(value) < arr[0].val_lower_limit) {
  553. return arr[0].val_lower_limit + ''
  554. }
  555. }
  556. if (value == '') {
  557. return '0'
  558. }
  559. return value.replace(/^0+/gi, '')
  560. }
  561. const formatter7 = value => {
  562. if (parseInt(value) == 0) {
  563. return '0'
  564. }
  565. let arr = settingStore.allSettingList.filter(
  566. item => item.name == 'injection_pump_speed',
  567. )
  568. if (arr && arr.length > 0) {
  569. if (parseInt(value) > arr[0].val_upper_limit) {
  570. return arr[0].val_upper_limit + ''
  571. }
  572. if (parseInt(value) < arr[0].val_lower_limit) {
  573. return arr[0].val_lower_limit + ''
  574. }
  575. }
  576. if (value == '') {
  577. return '0'
  578. }
  579. return value.replace(/^0+/gi, '')
  580. }
  581. const formatter8 = value => {
  582. if (parseInt(value) == 0) {
  583. return '0'
  584. }
  585. let arr = settingStore.allSettingList.filter(
  586. item => item.name == 'pre_heat_time_s',
  587. )
  588. if (arr && arr.length > 0) {
  589. if (parseInt(value) > arr[0].val_upper_limit) {
  590. return arr[0].val_upper_limit + ''
  591. }
  592. if (parseInt(value) < arr[0].val_lower_limit) {
  593. return arr[0].val_lower_limit + ''
  594. }
  595. }
  596. if (value == '') {
  597. return '0'
  598. }
  599. return value.replace(/^0+/gi, '')
  600. }
  601. const formatter9 = value => {
  602. if (parseInt(value) == 0) {
  603. return '0'
  604. }
  605. let arr = settingStore.allSettingList.filter(
  606. item => item.name == 'stoped_humi',
  607. )
  608. if (arr && arr.length > 0) {
  609. if (parseInt(value) > arr[0].val_upper_limit) {
  610. return arr[0].val_upper_limit + ''
  611. }
  612. if (parseInt(value) < arr[0].val_lower_limit) {
  613. return arr[0].val_lower_limit + ''
  614. }
  615. }
  616. if (value == '') {
  617. return '0'
  618. }
  619. return value.replace(/^0+/gi, '')
  620. }
  621. const formatter10 = value => {
  622. if (parseInt(value) == 0) {
  623. return '0'
  624. }
  625. let arr = settingStore.allSettingList.filter(
  626. item => item.name == 'continued_humi',
  627. )
  628. if (arr && arr.length > 0) {
  629. if (parseInt(value) > arr[0].val_upper_limit) {
  630. return arr[0].val_upper_limit + ''
  631. }
  632. if (parseInt(value) < arr[0].val_lower_limit) {
  633. return arr[0].val_lower_limit + ''
  634. }
  635. }
  636. if (value == '') {
  637. return '0'
  638. }
  639. return value.replace(/^0+/gi, '')
  640. }
  641. const setAddliquidVal = () => {
  642. const val = parseInt(addLiquidConfigVal.value)
  643. if (isNaN(val)) {
  644. showFailToast('设置失败,请填写正确参数')
  645. return
  646. }
  647. }
  648. const setStopedGsVal = () => {
  649. const val = parseInt(stoped_gs.value)
  650. if (isNaN(val)) {
  651. showFailToast('设置失败,请填写正确参数')
  652. return
  653. } else {
  654. // webSocketStore.sendCommandMsg(
  655. // updateFormulaJSON('stoped_gs', val, props.formulaInfo.id),
  656. // )
  657. }
  658. }
  659. const setcontinuedGsVal = () => {
  660. const val = parseInt(continued_gs.value)
  661. if (isNaN(val)) {
  662. showFailToast('设置失败,请填写正确参数')
  663. return
  664. } else {
  665. // webSocketStore.sendCommandMsg(
  666. // updateFormulaJSON('continued_gs', val, props.formulaInfo.id),
  667. // )
  668. }
  669. }
  670. const setstopedSaturVal = () => {
  671. const val = parseInt(stoped_satur.value)
  672. if (isNaN(val)) {
  673. showFailToast('设置失败,请填写正确参数')
  674. return
  675. } else {
  676. // webSocketStore.sendCommandMsg(
  677. // updateFormulaJSON('stoped_satur', val, props.formulaInfo.id),
  678. // )
  679. }
  680. }
  681. const setContinuedSaturVal = () => {
  682. const val = parseInt(continued_satur.value)
  683. if (isNaN(val)) {
  684. showFailToast('设置失败,请填写正确参数')
  685. return
  686. } else {
  687. // webSocketStore.sendCommandMsg(
  688. // updateFormulaJSON('continued_satur', val, props.formulaInfo.id),
  689. // )
  690. }
  691. }
  692. const setMaxHumidityVal = () => {
  693. const val = parseInt(max_humidity.value)
  694. if (isNaN(val)) {
  695. showFailToast('设置失败,请填写正确参数')
  696. return
  697. }
  698. }
  699. const setHeat_timeVal = () => {
  700. const val = parseInt(pre_heat_time_s.value)
  701. if (isNaN(val)) {
  702. showFailToast('设置失败,请填写正确参数')
  703. return
  704. }
  705. }
  706. const setstoped_humiVal = () => {
  707. const val = parseInt(stoped_humi.value)
  708. if (isNaN(val)) {
  709. showFailToast('设置失败,请填写正确参数')
  710. return
  711. } else {
  712. // webSocketStore.sendCommandMsg(
  713. // updateFormulaJSON('stoped_humi', val, props.formulaInfo.id),
  714. // )
  715. }
  716. }
  717. const setcontinued_humiVal = () => {
  718. const val = parseInt(continued_humi.value)
  719. if (isNaN(val)) {
  720. showFailToast('设置失败,请填写正确参数')
  721. return
  722. } else {
  723. // webSocketStore.sendCommandMsg(
  724. // updateFormulaJSON('continued_humi', val, props.formulaInfo.id),
  725. // )
  726. }
  727. }
  728. const setSprayLiquidVal = () => {
  729. const val = parseInt(sprayLiquidConfigVal.value)
  730. if (isNaN(val)) {
  731. showFailToast('设置失败,请填写正确参数')
  732. return
  733. } else {
  734. // webSocketStore.sendCommandMsg(
  735. // updateFormulaJSON('injection_pump_speed', val, props.formulaInfo.id),
  736. // )
  737. }
  738. }
  739. const showkeyboard = ref(false)
  740. const onChange = a => {
  741. formula_id.value = a
  742. }
  743. const handleShowKeyBoard = () => {
  744. showkeyboard.value = true
  745. }
  746. onMounted(() => {
  747. document.addEventListener('click', e => {
  748. let box = document.getElementById('keyboard_formula')
  749. let room = document.getElementById('id_formula')
  750. const arr = [
  751. 'hg-candidate-box-next',
  752. 'hg-candidate-box-btn-active',
  753. 'hg-candidate-box-prev',
  754. 'hg-candidate-box-list-item',
  755. ]
  756. if (
  757. !box?.contains(e.target) &&
  758. e.target != room &&
  759. !arr.includes(Array.from(e.target.classList)[0])
  760. ) {
  761. showkeyboard.value = false
  762. }
  763. })
  764. })
  765. </script>
  766. <style lang="scss" scoped>
  767. .update_device_container {
  768. box-sizing: border-box;
  769. width: 100%;
  770. height: 580px;
  771. display: grid;
  772. overflow: hidden;
  773. grid-template-columns: repeat(2, 1fr);
  774. row-gap: 20px;
  775. column-gap: 20px;
  776. padding: 20px;
  777. padding-bottom: 180px;
  778. position: relative;
  779. .btns {
  780. position: absolute;
  781. right: 20px;
  782. bottom: 20px;
  783. width: 300px;
  784. height: 68px;
  785. display: flex;
  786. align-items: center;
  787. justify-content: flex-end;
  788. .btn {
  789. width: 111px;
  790. height: 38px;
  791. border-radius: 19px;
  792. background: #06518b;
  793. display: flex;
  794. align-items: center;
  795. justify-content: center;
  796. font-family: Source Han Sans CN;
  797. font-size: 14px;
  798. font-weight: normal;
  799. line-height: normal;
  800. letter-spacing: 0.1em;
  801. color: #ffffff;
  802. }
  803. .ml {
  804. margin-left: 20px;
  805. }
  806. }
  807. .row_wrap {
  808. // width: 726px;
  809. height: 80px;
  810. border-radius: 14px;
  811. background: #f6f6f6;
  812. box-sizing: border-box;
  813. padding: 0 18px 0 40px;
  814. display: flex;
  815. align-items: center;
  816. justify-content: space-between;
  817. .title {
  818. font-family: Zona Pro;
  819. white-space: nowrap;
  820. font-size: 20px;
  821. font-weight: normal;
  822. letter-spacing: 0.06em;
  823. color: #000000;
  824. }
  825. .num {
  826. font-family: Source Han Sans CN;
  827. font-size: 24px;
  828. font-weight: 500;
  829. letter-spacing: 0.1em;
  830. color: #000000;
  831. display: flex;
  832. align-items: center;
  833. .log {
  834. width: 182px;
  835. display: flex;
  836. align-items: center;
  837. justify-content: center;
  838. }
  839. .field_font {
  840. font-size: 26px;
  841. width: 180px;
  842. }
  843. }
  844. .formula_input {
  845. border: none;
  846. height: 38px;
  847. padding: 0 12px;
  848. width: 220px;
  849. font-size: 22px;
  850. }
  851. .btn {
  852. width: 87px;
  853. height: 45px;
  854. border-radius: 23px;
  855. background: #06518b;
  856. font-family: Source Han Sans CN;
  857. font-size: 14px;
  858. font-weight: normal;
  859. letter-spacing: 0.1em;
  860. color: #ffffff;
  861. display: flex;
  862. align-items: center;
  863. justify-content: center;
  864. }
  865. }
  866. .key_wrap {
  867. position: absolute;
  868. right: 97px;
  869. bottom: 0;
  870. height: 245px;
  871. width: 520px;
  872. }
  873. }
  874. </style>