健康同学微信公众号h5项目
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

1095 lignes
34KB

  1. <template>
  2. <div class="location-monitor-container">
  3. <!-- nav -->
  4. <div class="nav-bar">
  5. <van-nav-bar title="健康监测" left-text="返回" @click-left="onNavBack" left-arrow>
  6. <template #right>
  7. <!-- <div class="setupClock_save" @click="onSubmit">保存</div> -->
  8. <van-button type="primary" @click="onSubmit" size="small">保存</van-button>
  9. </template>
  10. </van-nav-bar>
  11. </div>
  12. <!-- main -->
  13. <div class="main">
  14. <!-- 血压 -->
  15. <div class="list">
  16. <div class="item" v-show="false">
  17. <div class="left">
  18. <span class="title">血压监测:</span>
  19. </div>
  20. <div class="right">
  21. <!-- <img :src="rightIcon" alt=""> -->
  22. <van-switch v-model="healthConfig.bloodenable" :active-color="$green" />
  23. </div>
  24. </div>
  25. <div class="item left-gray" v-show="healthConfig.bloodenable">
  26. <div class="left">
  27. <span class="title gray">检测周期:</span>
  28. </div>
  29. <div class="right" @click="onClick('bloodinteval')">
  30. <span>{{ healthConfig.bloodinteval }}分钟</span>
  31. <img :src="rightIcon" alt="" />
  32. </div>
  33. </div>
  34. <div class="item left-gray" v-show="healthConfig.bloodenable">
  35. <div class="left">
  36. <span class="title gray">告警阈值-收缩压:</span>
  37. </div>
  38. <div class="right" @click="onClick('bloodmaxvalue')">
  39. <span>{{ healthConfig.bloodmaxvalue }}</span>
  40. <img :src="rightIcon" alt="" />
  41. </div>
  42. </div>
  43. <!-- <div class="item left-gray" v-show="healthConfig.bloodenable">
  44. <div class="left">
  45. <span class="title gray">告警阈值-舒张压:</span>
  46. </div>
  47. <div class="right" @click="onClick('bloodminvalue')">
  48. <span>{{ healthConfig.bloodminvalue}}</span>
  49. <img :src="rightIcon" alt="">
  50. </div>
  51. </div> -->
  52. <!-- <div class="item left-gray" v-show="healthConfig.bloodenable">
  53. <div class="left">
  54. <span class="title gray">告警周期:</span>
  55. </div>
  56. <div class="right" @click="onClick('bloodperiod')">
  57. <span>{{ healthConfig.bloodperiod}}</span>
  58. <img :src="rightIcon" alt="">
  59. </div>
  60. </div> -->
  61. <div class="item alarmType left-gray" v-show="healthConfig.bloodenable">
  62. <div class="left">
  63. <span class="title gray">告警方式:</span>
  64. </div>
  65. <div class="right">
  66. <!-- <img :src="rightIcon" alt=""> -->
  67. <div class="checkbox-group">
  68. <!-- <van-checkbox-group v-model="temperatureAlarmType" direction="horizontal" @change="onCheckChange('temperature')" -->
  69. <van-checkbox
  70. name="bloodvibrateenabled"
  71. v-model="healthConfig.bloodvibrateenabled"
  72. shape="square"
  73. direction="horizontal"
  74. >震动</van-checkbox
  75. >
  76. <van-checkbox
  77. name="bloodlcdenabled"
  78. v-model="healthConfig.bloodlcdenabled"
  79. shape="square"
  80. direction="horizontal"
  81. >亮屏</van-checkbox
  82. >
  83. <!-- <van-checkbox name="temperaturereportenabled" v-model="healthConfig.temperaturereportenabled" shape="square" direction="horizontal" @change="onChangeSingle('temperaturereportenabled')">上报数据</van-checkbox> -->
  84. <!-- </van-checkbox-group> -->
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. <!-- 体温 -->
  90. <div class="list">
  91. <div class="item">
  92. <div class="left">
  93. <span class="title">体温监测:</span>
  94. </div>
  95. <div class="right">
  96. <!-- <img :src="rightIcon" alt=""> -->
  97. <van-switch v-model="healthConfig.temperatureenabled" :active-color="$green" />
  98. </div>
  99. </div>
  100. <div class="item left-gray" v-show="healthConfig.temperatureenabled">
  101. <div class="left">
  102. <span class="title gray">检测周期:</span>
  103. </div>
  104. <div class="right" @click="onClick('temperatureinteval')">
  105. <span>{{ formatInteval(healthConfig.temperatureinteval) }}</span>
  106. <img :src="rightIcon" alt="" />
  107. </div>
  108. </div>
  109. <div class="item left-gray" v-show="healthConfig.temperatureenabled">
  110. <div class="left">
  111. <span class="title gray">告警阈值-高温:</span>
  112. </div>
  113. <div class="right" @click="onClick('temperaturemaxvalue')">
  114. <span>{{ healthConfig.temperaturemaxvalue }}度</span>
  115. <img :src="rightIcon" alt="" />
  116. </div>
  117. </div>
  118. <div class="item left-gray" v-show="false">
  119. <div class="left">
  120. <span class="title gray">告警阈值-低温:</span>
  121. </div>
  122. <div class="right" @click="onClick('temperatureminvalue')">
  123. <span>{{ healthConfig.temperatureminvalue }}度</span>
  124. <img :src="rightIcon" alt="" />
  125. </div>
  126. </div>
  127. <div class="item alarmType left-gray" v-show="healthConfig.temperatureenabled">
  128. <div class="left">
  129. <span class="title gray">告警方式:</span>
  130. </div>
  131. <div class="right">
  132. <!-- <img :src="rightIcon" alt=""> -->
  133. <div class="checkbox-group">
  134. <!-- <van-checkbox-group v-model="temperatureAlarmType" direction="horizontal" @change="onCheckChange('temperature')" -->
  135. <van-checkbox
  136. name="temperaturevibrateenabled"
  137. v-model="healthConfig.temperaturevibrateenabled"
  138. shape="square"
  139. direction="horizontal"
  140. >震动</van-checkbox
  141. >
  142. <van-checkbox
  143. name="temperaturelcdenabled"
  144. v-model="healthConfig.temperaturelcdenabled"
  145. shape="square"
  146. direction="horizontal"
  147. >亮屏</van-checkbox
  148. >
  149. <!-- <van-checkbox name="temperaturereportenabled" v-model="healthConfig.temperaturereportenabled" shape="square" direction="horizontal" @change="onChangeSingle('temperaturereportenabled')">上报数据</van-checkbox> -->
  150. <!-- </van-checkbox-group> -->
  151. </div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="list">
  156. <div class="item">
  157. <div class="left">
  158. <span class="title">心率监测:</span>
  159. </div>
  160. <div class="right">
  161. <!-- <img :src="rightIcon" alt=""> -->
  162. <van-switch v-model="healthConfig.heartrateenabled" :active-color="$green" />
  163. </div>
  164. </div>
  165. <div class="item left-gray" v-show="healthConfig.heartrateenabled">
  166. <div class="left">
  167. <span class="title gray">检测周期:</span>
  168. </div>
  169. <div class="right" @click="onClick('heartrateinteval')">
  170. <span>{{ formatInteval(healthConfig.heartrateinteval) }}</span>
  171. <img :src="rightIcon" alt="" />
  172. </div>
  173. </div>
  174. <div class="item left-gray" v-show="healthConfig.heartrateenabled">
  175. <div class="left">
  176. <span class="title gray">告警阈值-上限:</span>
  177. </div>
  178. <div class="right" @click="onClick('heartratemaxvalue')">
  179. <span>{{ healthConfig.heartratemaxvalue }}次</span>
  180. <img :src="rightIcon" alt="" />
  181. </div>
  182. </div>
  183. <div class="item left-gray" v-show="healthConfig.heartrateenabled">
  184. <div class="left">
  185. <span class="title gray">告警阈值-下限:</span>
  186. </div>
  187. <div class="right" @click="onClick('heartrateminvalue')">
  188. <span>{{ healthConfig.heartrateminvalue }}次</span>
  189. <img :src="rightIcon" alt="" />
  190. </div>
  191. </div>
  192. <div class="item alarmType left-gray" v-show="healthConfig.heartrateenabled">
  193. <div class="left">
  194. <span class="title gray">告警方式:</span>
  195. </div>
  196. <div class="right">
  197. <!-- <img :src="rightIcon" alt=""> -->
  198. <div class="checkbox-group">
  199. <!-- <van-checkbox-group v-model="heartrateAlarmType" direction="horizontal" > -->
  200. <van-checkbox
  201. name="heartratevibrateenabled"
  202. v-model="healthConfig.heartratevibrateenabled"
  203. shape="square"
  204. direction="horizontal"
  205. >震动</van-checkbox
  206. >
  207. <van-checkbox
  208. name="heartratelcdenabled"
  209. v-model="healthConfig.heartratelcdenabled"
  210. shape="square"
  211. direction="horizontal"
  212. >亮屏</van-checkbox
  213. >
  214. <!-- <van-checkbox name="heartratereportenabled" v-model="healthConfig.heartratereportenabled" shape="square" direction="horizontal" @change="onChangeSingle('heartratereportenabled')">上报数据</van-checkbox> -->
  215. <!-- </van-checkbox-group> -->
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. <div class="list">
  221. <div class="item">
  222. <div class="left">
  223. <span class="title">血氧监测:</span>
  224. </div>
  225. <div class="right">
  226. <!-- <img :src="rightIcon" alt=""> -->
  227. <van-switch v-model="healthConfig.spo2enabled" :active-color="$green" />
  228. </div>
  229. </div>
  230. <div class="item left-gray" v-show="healthConfig.spo2enabled">
  231. <div class="left">
  232. <span class="title gray">检测周期:</span>
  233. </div>
  234. <div class="right" @click="onClick('spo2inteval')">
  235. <span>{{ formatInteval(healthConfig.spo2inteval) }}</span>
  236. <img :src="rightIcon" alt="" />
  237. </div>
  238. </div>
  239. <!-- <div class="item left-gray" v-show="healthConfig.spo2enabled">
  240. <div class="left">
  241. <span class="title gray">告警阈值-高于:</span>
  242. </div>
  243. <div class="right" @click="onClick('spo2maxvalue')">
  244. <span>{{ healthConfig.spo2maxvalue}}%</span>
  245. <img :src="rightIcon" alt="">
  246. </div>
  247. </div> -->
  248. <div class="item left-gray" v-show="healthConfig.spo2enabled">
  249. <div class="left">
  250. <span class="title gray">告警阈值-低于:</span>
  251. </div>
  252. <div class="right" @click="onClick('spo2minvalue')">
  253. <span>{{ healthConfig.spo2minvalue }}%</span>
  254. <img :src="rightIcon" alt="" />
  255. </div>
  256. </div>
  257. <div class="item alarmType left-gray" v-show="healthConfig.spo2enabled">
  258. <div class="left">
  259. <span class="title gray">告警方式:</span>
  260. </div>
  261. <div class="right">
  262. <!-- <img :src="rightIcon" alt=""> -->
  263. <div class="checkbox-group">
  264. <!-- <van-checkbox-group v-model="heartrateAlarmType" direction="horizontal" > -->
  265. <van-checkbox
  266. name="spo2vibrateenabled"
  267. v-model="healthConfig.spo2vibrateenabled"
  268. shape="square"
  269. direction="horizontal"
  270. >震动</van-checkbox
  271. >
  272. <van-checkbox
  273. name="spo2lcdenabled"
  274. v-model="healthConfig.spo2lcdenabled"
  275. shape="square"
  276. direction="horizontal"
  277. >亮屏</van-checkbox
  278. >
  279. <!-- <van-checkbox name="spo2reportenabled" v-model="healthConfig.spo2reportenabled" shape="square" direction="horizontal" @change="onChangeSingle('spo2reportenabled')">上报数据</van-checkbox> -->
  280. <!-- </van-checkbox-group> -->
  281. </div>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. <!-- 弹窗 -->
  287. <van-dialog v-model="dialog.isDialogshow" show-cancel-button cancel-button-text="返回" :show-confirm-button="false">
  288. <template #title>
  289. <div class="title">
  290. <span>设置</span>
  291. </div>
  292. </template>
  293. <template #default>
  294. <div class="dialog-container">
  295. <div class="selectConfirm">
  296. <div class="con">
  297. <van-cell v-for="(item, index) in dialog.confirmData" :key="`selectVPT${index}`" @click="onSelect(item)">
  298. <div class="text">
  299. <div v-html="item.text"></div>
  300. </div>
  301. <em :class="['circle', { on: selectConfirmActive == index }]"></em>
  302. </van-cell>
  303. </div>
  304. </div>
  305. </div>
  306. </template>
  307. </van-dialog>
  308. </div>
  309. </template>
  310. <script>
  311. import ToastService from '@/services/toast-service';
  312. import DialogService from '@/services/dialog-service';
  313. import APIHealthy from '@/api/heathly';
  314. export default {
  315. name: '',
  316. data() {
  317. return {
  318. rightIcon: require('../../../assets/img/health/right_more.png'),
  319. checked: false,
  320. sampleinteval: '', //上报频率-定位检测
  321. temperatureAlarmType: ['temperaturevibrateenabled', 'temperaturelcdenabled', 'temperaturereportenabled'], //体温告警方式
  322. heartrateAlarmType: ['heartratevibrateenabled', 'heartratelcdenabled', 'heartratereportenabled'], //心率
  323. spo2AlarmType: ['spo2vibrateenabled', 'spo2lcdenabled', 'spo2reportenabled'], //血氧
  324. dialog: {
  325. isDialogshow: false,
  326. title: '上报频率',
  327. confirmData: []
  328. },
  329. // todo 以下这些弹窗列表可以用函数生成
  330. // 检测周期时间数据
  331. monitorList: [
  332. {
  333. text: '10分钟',
  334. model: 0,
  335. checked: false,
  336. value: 10
  337. },
  338. {
  339. text: '15分钟',
  340. model: 1,
  341. checked: false,
  342. value: 15
  343. },
  344. /* {
  345. text: "20分钟",
  346. model: 2,
  347. checked: false,
  348. value: 20
  349. }, */
  350. {
  351. text: '30分钟',
  352. model: 3,
  353. checked: false,
  354. value: 30
  355. },
  356. /* {
  357. text: "40分钟",
  358. model: 4,
  359. checked: false,
  360. value: 40
  361. },
  362. {
  363. text: "50分钟",
  364. model: 5,
  365. checked: false,
  366. value: 50
  367. }, */
  368. {
  369. text: '60分钟',
  370. model: 6,
  371. checked: false,
  372. value: 60
  373. },
  374. {
  375. text: '6小时',
  376. model: 7,
  377. checked: false,
  378. value: 360
  379. },
  380. {
  381. text: '8小时',
  382. model: 8,
  383. checked: false,
  384. value: 480
  385. }
  386. ],
  387. //血压弹窗收缩压数据
  388. bloodMaxList: [
  389. {
  390. text: '140',
  391. model: 0,
  392. checked: false,
  393. className: 'circle',
  394. value: 140,
  395. name: '血压监测'
  396. },
  397. {
  398. text: '160',
  399. model: 1,
  400. checked: false,
  401. className: 'circle',
  402. value: 160,
  403. name: '血压监测'
  404. },
  405. {
  406. text: '180',
  407. model: 2,
  408. checked: false,
  409. className: 'circle',
  410. value: 180,
  411. name: '血压监测'
  412. }
  413. ],
  414. //血压弹窗舒张值上限数据
  415. bloodMinList: [
  416. {
  417. text: '90',
  418. model: 0,
  419. checked: false,
  420. className: 'circle',
  421. value: 90,
  422. name: '血压监测'
  423. },
  424. {
  425. text: '100',
  426. model: 1,
  427. checked: false,
  428. className: 'circle',
  429. value: 100,
  430. name: '血压监测'
  431. },
  432. {
  433. text: '110',
  434. model: 2,
  435. checked: false,
  436. className: 'circle',
  437. value: 110,
  438. name: '血压监测'
  439. }
  440. ],
  441. //体温弹窗最大数据
  442. temperatureMaxList: [
  443. {
  444. text: '37.3°C(低烧)',
  445. model: 0,
  446. checked: false,
  447. className: 'circle',
  448. value: 37.3,
  449. name: '体温监测'
  450. },
  451. /* {
  452. text: "37.5°C",
  453. model: 1,
  454. checked: false,
  455. className: "circle",
  456. value: 37.5,
  457. name: '体温监测'
  458. }, */
  459. /* {
  460. text: "37.8°C",
  461. model: 2,
  462. checked: false,
  463. className: "circle",
  464. value: 37.8,
  465. name: '体温监测'
  466. }, */
  467. {
  468. text: '38.1°C(中烧)',
  469. model: 1,
  470. checked: false,
  471. className: 'circle',
  472. value: 38.1,
  473. name: '体温监测'
  474. },
  475. {
  476. text: '39.1°C(高烧)',
  477. model: 2,
  478. checked: false,
  479. className: 'circle',
  480. value: 39.1,
  481. name: '体温监测'
  482. }
  483. /* {
  484. text: "41°C",
  485. model: 5,
  486. checked: false,
  487. className: "circle",
  488. value: 41,
  489. name: '体温监测'
  490. },
  491. {
  492. text: "42°C",
  493. model: 6,
  494. checked: false,
  495. className: "circle",
  496. value: 42,
  497. name: '体温监测'
  498. },
  499. {
  500. text: "43°C",
  501. model: 7,
  502. checked: false,
  503. className: "circle",
  504. value: 43,
  505. name: '体温监测'
  506. }, */
  507. ],
  508. //体温弹窗最大数据
  509. temperatureMinList: [
  510. {
  511. text: '32°C',
  512. model: 0,
  513. checked: false,
  514. className: 'circle',
  515. value: 32,
  516. name: '体温监测'
  517. },
  518. {
  519. text: '33°C',
  520. model: 1,
  521. checked: false,
  522. className: 'circle',
  523. value: 33,
  524. name: '体温监测'
  525. },
  526. {
  527. text: '34°C',
  528. model: 2,
  529. checked: false,
  530. className: 'circle',
  531. value: 34,
  532. name: '体温监测'
  533. },
  534. {
  535. text: '35°C',
  536. model: 3,
  537. checked: false,
  538. className: 'circle',
  539. value: 38,
  540. name: '体温监测'
  541. },
  542. {
  543. text: '36°C',
  544. model: 4,
  545. checked: false,
  546. className: 'circle',
  547. value: 36,
  548. name: '体温监测'
  549. }
  550. /* {
  551. text: "37.1°C",
  552. model: 5,
  553. checked: false,
  554. className: "circle",
  555. value: 37.1,
  556. name: '体温监测'
  557. }, */
  558. ],
  559. //心率弹窗最大数据
  560. heartRateMaxList: [
  561. /* {
  562. text: "90次",
  563. model: 0,
  564. checked: false,
  565. className: "circle",
  566. value: 90,
  567. name: '心率监测'
  568. },
  569. {
  570. text: "100次",
  571. model: 1,
  572. checked: false,
  573. className: "circle",
  574. value: 100,
  575. name: '心率监测'
  576. }, */
  577. {
  578. text: '120次(非运动)',
  579. model: 0,
  580. checked: false,
  581. className: 'circle',
  582. value: 120,
  583. name: '心率监测'
  584. },
  585. /* {
  586. text: "140次",
  587. model: 3,
  588. checked: false,
  589. className: "circle",
  590. value: 140,
  591. name: '心率监测'
  592. },
  593. {
  594. text: "160次",
  595. model: 4,
  596. checked: false,
  597. className: "circle",
  598. value: 160,
  599. name: '心率监测'
  600. }, */
  601. {
  602. text: '180次(运动)',
  603. model: 1,
  604. checked: false,
  605. className: 'circle',
  606. value: 180,
  607. name: '心率监测'
  608. }
  609. /* {
  610. text: "200次",
  611. model: 6,
  612. checked: false,
  613. className: "circle",
  614. value: 200,
  615. name: '心率监测'
  616. }, */
  617. /* {
  618. text: "210次",
  619. model: 7,
  620. checked: false,
  621. className: "circle",
  622. value: 210,
  623. name: '心率监测'
  624. }, */
  625. ],
  626. //心率弹窗最小数据
  627. heartRateMinList: [
  628. {
  629. text: '40次',
  630. model: 0,
  631. checked: false,
  632. className: 'circle',
  633. value: 40,
  634. name: '心率监测'
  635. },
  636. {
  637. text: '50次',
  638. model: 1,
  639. checked: false,
  640. className: 'circle',
  641. value: 50,
  642. name: '心率监测'
  643. },
  644. {
  645. text: '60次',
  646. model: 2,
  647. checked: false,
  648. className: 'circle',
  649. value: 60,
  650. name: '心率监测'
  651. }
  652. /* {
  653. text: "60次",
  654. model: 3,
  655. checked: false,
  656. className: "circle",
  657. value: 60,
  658. name: '心率监测'
  659. },
  660. {
  661. text: "70次",
  662. model: 4,
  663. checked: false,
  664. className: "circle",
  665. value: 70,
  666. name: '心率监测'
  667. },
  668. {
  669. text: "80次",
  670. model: 5,
  671. checked: false,
  672. className: "circle",
  673. value: 80,
  674. name: '心率监测'
  675. }, */
  676. ],
  677. //血氧弹窗最小数据
  678. spo2MinList: [
  679. {
  680. text: '94%(轻微)',
  681. model: 0,
  682. checked: false,
  683. className: 'circle',
  684. value: 94,
  685. name: '血氧监测'
  686. },
  687. {
  688. text: '89%(中度)',
  689. model: 1,
  690. checked: false,
  691. className: 'circle',
  692. value: 89,
  693. name: '血氧监测'
  694. },
  695. {
  696. text: '85%(严重)',
  697. model: 2,
  698. checked: false,
  699. className: 'circle',
  700. value: 85,
  701. name: '血氧监测'
  702. },
  703. /* {
  704. text: "94%(默认)",
  705. model: 3,
  706. checked: false,
  707. className: "circle",
  708. value: 94,
  709. name: '血氧监测'
  710. }, */
  711. {
  712. text: '98%(临时测试)',
  713. model: 3,
  714. checked: false,
  715. className: 'circle',
  716. value: 98,
  717. name: '血氧监测'
  718. }
  719. ],
  720. //血氧弹窗最大数据
  721. spo2MaxList: [
  722. {
  723. text: '98%',
  724. model: 0,
  725. checked: false,
  726. className: 'circle',
  727. value: 98,
  728. name: '血氧监测'
  729. }
  730. ],
  731. selectConfirmActive: 0,
  732. currentDiallogName: '',
  733. healthConfig: {
  734. /* bloodenabled: false,
  735. bloodmaxvalue: 140, //血压-高温阈值
  736. bloodminvalue: 90, //血压-低温阈值
  737. bloodinteval: 60, //血压-检测周期
  738. bloodvibrateenabled: false, //血压异常时是否震动
  739. bloodlcdenabled: false, //血压异常时是否亮屏
  740. bloodreportenabled: true, //血压异常时是否上报数据
  741. bloodperiod: 60, //血压-检测周期 */
  742. temperatureenabled: false,
  743. temperaturemaxvalue: 38, //体温-高温阈值
  744. temperatureminvalue: 0, //体温-低温阈值
  745. temperatureinteval: 60, //体温-检测周期
  746. temperaturevibrateenabled: false, //体温异常时是否震动
  747. temperaturelcdenabled: false, //体温异常时是否亮屏
  748. temperaturereportenabled: true, //体温异常时是否上报数据
  749. heartrateenabled: false,
  750. heartratemaxvalue: 120, //心率-高温阈值
  751. heartrateminvalue: 40, //心率-低温阈值
  752. heartrateinteval: 60, //心率-检测周期
  753. heartratevibrateenabled: false, //心率异常时是否震动
  754. heartratelcdenabled: false, //心率异常时是否亮屏
  755. heartratereportenabled: true, //心率异常时是否上报数据
  756. spo2enabled: false,
  757. spo2maxvalue: 0, //血氧-高温阈值
  758. spo2inteval: 60,
  759. spo2minvalue: 94, //血氧-检测周期
  760. spo2vibrateenabled: false, //血氧异常时是否震动
  761. spo2lcdenabled: false, //血氧异常时是否亮屏
  762. spo2reportenabled: true, //血氧异常时是否上报数据
  763. imei: this.$store.getters.serialNo,
  764. isTime: true,
  765. times: [
  766. { startTime: '08:00', endTime: '12:00' },
  767. { startTime: '14:00', endTime: '16:00' }
  768. ]
  769. }
  770. };
  771. },
  772. computed: {
  773. imei() {
  774. return this.$store.getters.serialNo;
  775. }
  776. },
  777. created() {
  778. this.getHealthConfig();
  779. },
  780. methods: {
  781. onNavBack() {
  782. this.$router.push({
  783. name: 'watchSetting'
  784. });
  785. },
  786. onSubmit() {
  787. ToastService.loading({ message: '设置中' });
  788. // dataObj[Object.keys(tempData)[index]] = item
  789. let reqBody = {}; //用新对象去接收原来对象里的值
  790. Object.values(this.healthConfig).filter((item, index) => {
  791. if (typeof item === 'boolean') {
  792. item = item === false ? 0 : 1;
  793. reqBody[Object.keys(this.healthConfig)[index]] = item;
  794. } else {
  795. reqBody[Object.keys(this.healthConfig)[index]] = item;
  796. }
  797. });
  798. reqBody.temperaturemaxvalue = reqBody.temperaturemaxvalue * 10;
  799. reqBody.temperatureminvalue = /* reqBody.temperatureminvalue * 10 */ 0;
  800. reqBody.isTime = true;
  801. APIHealthy.setHealthConfig(reqBody)
  802. .then(res => {
  803. if (res.data.stateCode === 1) {
  804. ToastService.success({ message: '设置成功' });
  805. setTimeout(() => {
  806. this.$router.push({
  807. name: 'watchSetting'
  808. });
  809. }, 1500);
  810. } else {
  811. DialogService.confirm({
  812. title: '设置失败',
  813. message: `${res.data.message}`
  814. });
  815. }
  816. })
  817. .catch(e => {
  818. DialogService.confirm({
  819. title: '设置失败',
  820. message: `${e.message}`
  821. });
  822. })
  823. .finally(() => {
  824. setTimeout(() => {
  825. ToastService.clear();
  826. }, 1500);
  827. });
  828. },
  829. onSelect(data) {
  830. this.healthConfig[this.currentDiallogName] = data.value;
  831. this.selectConfirmActive = data.model;
  832. this.dialog.isDialogshow = false;
  833. },
  834. onClick(name) {
  835. this.currentDiallogName = name;
  836. this.dialog.confirmData = [];
  837. const intevalList = ['temperatureinteval', 'spo2inteval', 'heartrateinteval', 'bloodinteval'];
  838. if (intevalList.includes(name)) {
  839. this.dialog.confirmData = this.monitorList.filter(item => {
  840. if (name === 'bloodinteval') {
  841. return item.value >= 20;
  842. } /* else if(name === 'temperatureinteval') {
  843. let delData = [20, 40, 50];
  844. return delData.indexOf(item.value) === -1
  845. } */ else {
  846. return item.value;
  847. }
  848. });
  849. } else if (name === 'bloodmaxvalue') {
  850. // 血压-收缩压
  851. this.dialog.confirmData = this.bloodMaxList;
  852. } else if (name === 'bloodminvalue') {
  853. // 血压-舒张压
  854. this.dialog.confirmData = this.bloodMinList;
  855. } else if (name === 'temperaturemaxvalue') {
  856. // 体温最大
  857. this.dialog.confirmData = this.temperatureMaxList;
  858. } else if (name === 'temperatureminvalue') {
  859. // 体温最小
  860. this.dialog.confirmData = this.temperatureMinList;
  861. } else if (name === 'heartratemaxvalue') {
  862. // 心率最大
  863. this.dialog.confirmData = this.heartRateMaxList;
  864. } else if (name === 'heartrateminvalue') {
  865. // 心率最小
  866. this.dialog.confirmData = this.heartRateMinList;
  867. } else if (name === 'spo2minvalue') {
  868. // 测试环境 启用98% 正式环境屏蔽
  869. if (process.env.NODE_ENV === 'production') {
  870. this.spo2MinList = this.spo2MinList.filter(item => {
  871. return item.value !== 98;
  872. });
  873. }
  874. // 血氧最小
  875. this.dialog.confirmData = this.spo2MinList;
  876. } else if (name === 'spo2maxvalue') {
  877. // 血氧最小
  878. this.dialog.confirmData = this.spo2MaxList;
  879. }
  880. let seclectIndex = this.dialog.confirmData.findIndex(item => {
  881. return item.value === this.healthConfig[name];
  882. });
  883. this.selectConfirmActive = seclectIndex;
  884. this.dialog.isDialogshow = true;
  885. },
  886. getResult(number1, number2) {
  887. const result = parseInt(number1) / parseInt(number2);
  888. return result.toString().indexOf('.') != -1 ? parseInt(result).toFixed(2).slice(0, 1) : result;
  889. },
  890. getHealthConfig() {
  891. ToastService.loading({ message: '数据加载中' });
  892. APIHealthy.getHealthConfig({ imei: this.imei })
  893. .then(res => {
  894. ToastService.success({ message: '数据加载完成' });
  895. let data = res.data.data;
  896. if (data) {
  897. let healthObj = data.config;
  898. let healthConfig = this.healthConfig;
  899. healthConfig.heartrateenabled = healthObj.heartrateenabled === 1 ? true : false;
  900. healthConfig.heartratelcdenabled = healthObj.heartratelcdenabled === 1 ? true : false;
  901. healthConfig.heartratereportenabled = healthObj.heartratereportenabled === 1 ? true : false;
  902. healthConfig.heartratevibrateenabled = healthObj.heartratevibrateenabled === 1 ? true : false;
  903. healthConfig.heartrateminvalue = healthObj.heartrateminvalue === 0 ? 60 : healthObj.heartrateminvalue;
  904. healthConfig.heartratemaxvalue = healthObj.heartratemaxvalue === 0 ? 180 : healthObj.heartratemaxvalue;
  905. healthConfig.heartrateinteval = healthObj.heartrateinteval;
  906. healthConfig.spo2enabled = healthObj.spo2enabled === 1 ? true : false;
  907. healthConfig.spo2lcdenabled = healthObj.spo2lcdenabled === 1 ? true : false;
  908. healthConfig.spo2reportenabled = healthObj.spo2reportenabled === 1 ? true : false;
  909. healthConfig.spo2vibrateenabled = healthObj.spo2vibrateenabled === 1 ? true : false;
  910. healthConfig.spo2minvalue = healthObj.spo2minvalue === 95 ? 94 : healthObj.spo2minvalue;
  911. healthConfig.spo2maxvalue = /* healthObj.spo2maxvalue === 0 ? 98 : healthObj.spo2maxvalue */ 0;
  912. healthConfig.spo2inteval = healthObj.spo2inteval;
  913. healthConfig.temperatureenabled = healthObj.temperatureenabled === 1 ? true : false;
  914. healthConfig.temperaturelcdenabled = healthObj.temperaturelcdenabled === 1 ? true : false;
  915. healthConfig.temperaturereportenabled = healthObj.temperaturereportenabled === 1 ? true : false;
  916. healthConfig.temperaturevibrateenabled = healthObj.temperaturevibrateenabled === 1 ? true : false;
  917. healthConfig.temperatureinteval = healthObj.temperatureinteval;
  918. healthConfig.temperaturemaxvalue = healthObj.temperaturemaxvalue / 10;
  919. healthConfig.temperatureminvalue =
  920. healthObj.temperatureminvalue === 0 ? 36 : healthObj.temperatureminvalue / 10;
  921. }
  922. })
  923. .catch(e => {
  924. console.log('e', e);
  925. DialogService.confirm({
  926. message: `${e.message}`
  927. });
  928. })
  929. .finally(() => {
  930. setTimeout(() => {
  931. ToastService.clear();
  932. }, 1500);
  933. });
  934. },
  935. // 格式化某些特殊参数值的时间显示方式
  936. formatInteval(value) {
  937. return value >= 360 ? value / 60 + '小时' : value + '分钟';
  938. }
  939. }
  940. };
  941. </script>
  942. <style scoped lang="scss">
  943. .location-monitor-container {
  944. height: 100vh;
  945. overflow: hidden;
  946. .nav-bar {
  947. height: 100px;
  948. padding: 0 20px;
  949. }
  950. .main {
  951. height: calc(100vh - 160px);
  952. background-color: $background;
  953. padding: 20px;
  954. overflow: scroll;
  955. .list {
  956. height: auto;
  957. background-color: #fff;
  958. border-radius: 8px;
  959. margin-bottom: 20px;
  960. .item {
  961. height: auto;
  962. padding: 20px;
  963. display: flex;
  964. justify-content: space-between;
  965. align-items: center;
  966. border-bottom: 2px solid #e5e5e5;
  967. .left {
  968. @include center();
  969. span {
  970. color: #282828;
  971. font-size: 32px;
  972. }
  973. .title {
  974. font-weight: 450;
  975. &.gray {
  976. color: gray;
  977. }
  978. }
  979. }
  980. .right {
  981. /* width: 60%; */
  982. @include center();
  983. font-size: 32px;
  984. img {
  985. height: 35px;
  986. width: 35px;
  987. }
  988. span {
  989. font-size: 32px;
  990. margin-right: 10px;
  991. color: #aaaaaa;
  992. }
  993. .checkbox-group {
  994. @include center();
  995. .van-checkbox {
  996. padding: 5px;
  997. }
  998. }
  999. }
  1000. &.left-gray {
  1001. padding-left: 30px;
  1002. color: gray;
  1003. }
  1004. &.alarmType {
  1005. height: 180px;
  1006. display: flex;
  1007. justify-content: flex-start;
  1008. align-items: flex-start;
  1009. .left {
  1010. }
  1011. .right {
  1012. margin-left: 40px;
  1013. width: 60%;
  1014. display: flex;
  1015. justify-content: space-between;
  1016. align-items: flex-start;
  1017. }
  1018. }
  1019. }
  1020. }
  1021. }
  1022. .title {
  1023. font-size: 32px;
  1024. }
  1025. .selectConfirm {
  1026. padding: 0;
  1027. .con {
  1028. .van-cell {
  1029. height: 60px;
  1030. .van-cell__value {
  1031. em {
  1032. font-style: normal;
  1033. position: absolute;
  1034. top: 0;
  1035. right: 0;
  1036. @include colorAndFont(#999, 24);
  1037. &.circle {
  1038. width: 20px;
  1039. height: 20px;
  1040. border: 2px solid #bfbfbf;
  1041. border-radius: 50%;
  1042. position: absolute;
  1043. right: 15px;
  1044. &.on {
  1045. border-color: $green;
  1046. &:before {
  1047. content: '';
  1048. position: absolute;
  1049. left: 50%;
  1050. top: 50%;
  1051. transform: translate(-50%, -50%);
  1052. width: 14px;
  1053. height: 14px;
  1054. background: $green;
  1055. border-radius: 50%;
  1056. }
  1057. }
  1058. }
  1059. }
  1060. }
  1061. }
  1062. }
  1063. }
  1064. }
  1065. </style>