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

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