home_monitoring.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. <template>
  2. <view>
  3. <view class="position-relative bghead" style="margin-top: -80rpx;">
  4. <image src="@/static/other/tou.png" mode="widthFix" class="w-100"></image>
  5. </view>
  6. <view class="p-3">
  7. <view class="centerY mb-3 w-100 font-bold">
  8. <view class="bule_line" style="height: 26rpx;"></view>
  9. <text class="font-bold text-dark ml-2 fs-16 line-height1">身体健康数据</text>
  10. </view>
  11. <view class="bg-white" style="border-radius: 16rpx;overflow: hidden;">
  12. <view class="px-2 py-1 centerY" style="background: linear-gradient(180deg, #F6FFFF 0%, #EAFEFF 100%);">
  13. <view class="w-15">
  14. <view class="picbox">
  15. <image class="picimg" src="@/static/other/xy.png" mode="aspectFit"></image>
  16. </view>
  17. </view>
  18. <view class=" ml-2">
  19. <view class="fs-14 font-bold line-height1" style="color: #35B79C;">血压</view>
  20. <view class="fs-10">
  21. <text class="text-gry">测量时间</text>
  22. </view>
  23. </view>
  24. <view class="ml-auto fs-14">
  25. <view class="font-bold text-right line-height1" style="color: #868687;">
  26. {{'70/150 mmHg'}}
  27. </view>
  28. <view class="fs-12 centerY" style="color: #868687 ;">
  29. <text class="iconfont Clock"></text>
  30. <view class="ml-1">
  31. {{'2022-11-22 14:20:20'}}
  32. </view>
  33. </view>
  34. </view>
  35. <view class="iconfont Chevron-Right fs-24" style="color: #35B79C;"></view>
  36. </view>
  37. <view class="px-3 py-2">
  38. <view class="fs-14 text-gry mb-1">
  39. 近7次测量记录
  40. </view>
  41. <view class="">
  42. <view id="echarts1" class="echarts"></view>
  43. </view>
  44. <view class="mt-3 p-2 mb-2" style="box-shadow: 0px 2px 13px 2px rgba(211,212,214,0.45);border-radius: 8px;">
  45. <view class="centerY">
  46. <image class="w-10" src="@/static/other/xy2.png" mode="widthFix"></image>
  47. <view class="fs-14 font-bold ml-2 space-nowrap">
  48. 血压标准
  49. </view>
  50. <view class=" ml-2 fs-12" style="color: #868687;">
  51. <view class="">
  52. 收缩压:90~139 mmHg
  53. </view>
  54. <view class="">
  55. 舒张压:60~90 mmHg
  56. </view>
  57. </view>
  58. </view>
  59. <view class="centerY mt-2">
  60. <image class="w-10" src="@/static/other/zjjy.png" mode="widthFix"></image>
  61. <view class="fs-14 font-bold ml-2 space-nowrap">
  62. 专家建议
  63. </view>
  64. <view class=" ml-2 fs-12" style="color: #868687;">
  65. 正常
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="bg-white mt-2" style="border-radius: 16rpx;overflow: hidden;">
  72. <view class="px-2 py-1 centerY" style="background: linear-gradient(180deg, #ebf6ff 0%, #D4EBFF 100%);">
  73. <view class="w-15 ">
  74. <view class="picbox">
  75. <image class="picimg" src="@/static/other/xuet.png" mode="aspectFit"></image>
  76. </view>
  77. </view>
  78. <view class=" ml-2">
  79. <view class="fs-14 font-bold line-height1" style="color: #369FE5;">血糖</view>
  80. <view class="fs-10">
  81. <text class="text-gry">测量时间</text>
  82. </view>
  83. </view>
  84. <view class="ml-auto fs-14">
  85. <view class="font-bold text-right line-height1" style="color: #868687;">
  86. {{'4.5 mmol/L'}}
  87. </view>
  88. <view class=" centerY" style="color: #868687 ;">
  89. <text class="iconfont Clock"></text>
  90. <view class="fs-12 ml-1">
  91. {{'2022-11-22 14:20:20'}}
  92. </view>
  93. </view>
  94. </view>
  95. <view class="iconfont Chevron-Right fs-24" style="color: #369FE5;"></view>
  96. </view>
  97. <view class="px-3 py-2">
  98. <view class="fs-14 text-gry mb-1">
  99. 近7次测量记录
  100. </view>
  101. <view class="">
  102. <view id="echarts2" class="echarts"></view>
  103. </view>
  104. <view class="mt-3 p-2 mb-2" style="box-shadow: 0px 2px 13px 2px rgba(211,212,214,0.45);border-radius: 8px;">
  105. <view class="centerY">
  106. <image class="w-10" src="@/static/other/xtfw.png" mode="widthFix"></image>
  107. <view class="fs-14 font-bold ml-2 space-nowrap">
  108. 血糖标准
  109. </view>
  110. <view class=" ml-2 fs-12" style="color: #868687;">
  111. <view class="">
  112. 3.9~6.9 mmol/L
  113. </view>
  114. </view>
  115. </view>
  116. <view class="centerY mt-2">
  117. <image class="w-10" src="@/static/other/zjjy.png" mode="widthFix"></image>
  118. <view class="fs-14 font-bold ml-2 space-nowrap">
  119. 专家建议
  120. </view>
  121. <view class=" ml-2 fs-12" style="color: #868687;">
  122. 正常
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="bg-white mt-2" style="border-radius: 16rpx;overflow: hidden;">
  129. <view class="px-2 py-1 centerY" style="background: linear-gradient(180deg, #F6FFFF 0%, #EAFEFF 100%);">
  130. <view class="w-15 ">
  131. <view class="picbox">
  132. <image class="picimg" src="@/static/other/xinl.png" mode="aspectFit"></image>
  133. </view>
  134. </view>
  135. <view class=" ml-2">
  136. <view class="fs-14 font-bold line-height1" style="color: #35B79C">心率</view>
  137. <view class="fs-10">
  138. <text class="text-gry">测量时间</text>
  139. </view>
  140. </view>
  141. <view class="ml-auto fs-14">
  142. <view class="font-bold text-right line-height1" style="color: #868687;">
  143. {{'80 次/分钟'}}
  144. </view>
  145. <view class="fs-10 centerY" style="color: #868687 ;">
  146. <text class="iconfont Clock"></text>
  147. <view class="ml-1">
  148. {{'2022-11-22 14:20:20'}}
  149. </view>
  150. </view>
  151. </view>
  152. <view class="iconfont Chevron-Right fs-24" style="color: #35B79C "></view>
  153. </view>
  154. <view class="px-3 py-2">
  155. <view class="fs-14 text-gry mb-1">
  156. 近7次测量记录
  157. </view>
  158. <view class="">
  159. <view id="echarts3" class="echarts"></view>
  160. </view>
  161. <view class="mt-3 p-2 mb-2" style="box-shadow: 0px 2px 13px 2px rgba(211,212,214,0.45);border-radius: 8px;">
  162. <view class="centerY">
  163. <image class="w-10" src="@/static/other/xlfw.png" mode="widthFix"></image>
  164. <view class="fs-14 font-bold ml-2 space-nowrap">
  165. 心率标准
  166. </view>
  167. <view class=" ml-2 fs-12" style="color: #868687;">
  168. 60~100 次/分钟
  169. </view>
  170. </view>
  171. <view class="centerY mt-2">
  172. <image class="w-10" src="@/static/other/zjjy.png" mode="widthFix"></image>
  173. <view class="fs-14 font-bold ml-2 space-nowrap">
  174. 专家建议
  175. </view>
  176. <view class=" ml-2 fs-12" style="color: #868687;">
  177. 正常
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. </template>
  186. <script>
  187. export default {
  188. data() {
  189. return {
  190. };
  191. },
  192. onReady() {},
  193. methods: {
  194. changeOption() {
  195. const data = this.option.series[0].data
  196. // 随机更新示例数据
  197. data.forEach((item, index) => {
  198. data.splice(index, 1, Math.random() * 40)
  199. })
  200. },
  201. onViewClick(options) {
  202. console.log(options)
  203. }
  204. },
  205. onPullDownRefresh() {
  206. setTimeout(()=>{
  207. uni.stopPullDownRefresh()
  208. },1000)
  209. }
  210. }
  211. </script>
  212. <script module="echarts" lang="renderjs">
  213. import * as echarts from 'echarts';
  214. let dataList = [{
  215. "id": 41,
  216. "idCard": null,
  217. "checkType": "ExamBloodGlucose",
  218. "medicalRecordId": null,
  219. "authorizationCode": null,
  220. "glu": "5.8",
  221. "deviceUuid": "355D0003795",
  222. "sbp": 110,
  223. "rbp": 80,
  224. "pulse": 80,
  225. "uploadTime": "2022-09-26 07:08:00",
  226. "createTime": "2022-09-26T07:06:54",
  227. "updateTime": "2022-09-26T07:06:54",
  228. "isDelete": 0,
  229. "aorB": null
  230. }, {
  231. "id": 39,
  232. "idCard": null,
  233. "checkType": "ExamBloodGlucose",
  234. "medicalRecordId": null,
  235. "authorizationCode": null,
  236. "glu": "5.5",
  237. "deviceUuid": "355D0003795",
  238. "sbp": 130,
  239. "rbp": 87,
  240. "pulse": 82,
  241. "uploadTime": "2022-09-23 06:20:00",
  242. "createTime": "2022-09-23T06:19:45",
  243. "updateTime": "2022-09-23T06:19:45",
  244. "isDelete": 0,
  245. "aorB": null
  246. }, {
  247. "id": 25,
  248. "idCard": null,
  249. "checkType": "ExamBloodGlucose",
  250. "medicalRecordId": null,
  251. "authorizationCode": null,
  252. "glu": "7.3",
  253. "deviceUuid": "355D0003795",
  254. "sbp": 125,
  255. "rbp": 95,
  256. "pulse": 95,
  257. "uploadTime": "2022-09-13 06:04:00",
  258. "createTime": "2022-09-13T06:04:26",
  259. "updateTime": "2022-09-13T06:04:26",
  260. "isDelete": 0,
  261. "aorB": null
  262. }, {
  263. "id": 24,
  264. "idCard": null,
  265. "checkType": "ExamBloodGlucose",
  266. "medicalRecordId": null,
  267. "authorizationCode": null,
  268. "glu": "9.1",
  269. "deviceUuid": "355D0003795",
  270. "sbp": 135,
  271. "rbp": 84,
  272. "pulse": 77,
  273. "uploadTime": "2022-09-12 07:56:00",
  274. "createTime": "2022-09-12T07:56:53",
  275. "updateTime": "2022-09-12T07:56:53",
  276. "isDelete": 0,
  277. "aorB": null
  278. }, {
  279. "id": 23,
  280. "idCard": null,
  281. "checkType": "ExamBloodGlucose",
  282. "medicalRecordId": null,
  283. "authorizationCode": null,
  284. "glu": "7.7",
  285. "deviceUuid": "355D0003795",
  286. "sbp": 143,
  287. "rbp": 90,
  288. "pulse": 89,
  289. "uploadTime": "2022-09-12 05:38:00",
  290. "createTime": "2022-09-12T05:38:40",
  291. "updateTime": "2022-09-12T05:38:40",
  292. "isDelete": 0,
  293. "aorB": null
  294. }, {
  295. "id": 22,
  296. "idCard": null,
  297. "checkType": "ExamBloodGlucose",
  298. "medicalRecordId": null,
  299. "authorizationCode": null,
  300. "glu": "17.8",
  301. "deviceUuid": "355D0003795",
  302. "sbp": 133,
  303. "rbp": 80,
  304. "pulse": 85,
  305. "uploadTime": "2022-09-11 15:51:00",
  306. "createTime": "2022-09-11T15:52:00",
  307. "updateTime": "2022-09-11T15:52:00",
  308. "isDelete": 0,
  309. "aorB": null
  310. }, {
  311. "id": 21,
  312. "idCard": null,
  313. "checkType": "ExamBloodGlucose",
  314. "medicalRecordId": null,
  315. "authorizationCode": null,
  316. "glu": "6.5",
  317. "deviceUuid": "355D0003795",
  318. "sbp": 123,
  319. "rbp": 75,
  320. "pulse": 86,
  321. "uploadTime": "2022-09-08 07:15:00",
  322. "createTime": "2022-09-08T07:13:21",
  323. "updateTime": "2022-09-08T07:13:21",
  324. "isDelete": 0,
  325. "aorB": null
  326. }]
  327. const config = {
  328. pulse: [60, 100],
  329. temperature: [36.5, 37.5],
  330. shrink: [90, 139],
  331. diastole: [60, 90],
  332. shrinktop: [90, 149], //大于65
  333. shrinklow: [90, 139], //小于65
  334. bmi: [18.50, 23.90],
  335. urine1: [
  336. [53, 106],
  337. [44, 97], "肌酐"
  338. ],
  339. urine2: [0, 30, "微量白蛋白"],
  340. urine3: [8.4, 13.2, "尿微/肌酐"],
  341. kidney1: [
  342. [208, 428],
  343. [155, 357], "血尿酸"
  344. ],
  345. kidney2: [
  346. [54, 133],
  347. [44, 97], "血肌酐"
  348. ],
  349. kidney3: [13.9, 6.1, "尿素氮"],
  350. bloodFat1: [0.45, 1.7, "甘油三酯"],
  351. bloodFat2: [2.85, 5.69, "总胆固醇"],
  352. bloodFat3: [0, 3.4, "低密度脂蛋白"],
  353. bloodFat4: [1.16, 1.55, "高密度脂蛋白"],
  354. lvision: [1.0, 5.0, '左视力'],
  355. rvision: [1.0, 5.0, '右视力'],
  356. bloodGlucose: [3.9, 6.9, '血糖'],
  357. chol: [2.85, 5.69, '总胆固醇'],
  358. ua: [
  359. [149, 416],
  360. [89, 357], '尿酸'
  361. ],
  362. spo2: [95, 99, '血氧'],
  363. rxyl: [0, 0],
  364. ryjl: [0, 0],
  365. }
  366. let info = {
  367. "id": 905,
  368. "username": "罗桂花",
  369. "birthday": "1945-12-28",
  370. "age": 77,
  371. "sex": 2,
  372. "idCard": "330222194512283184",
  373. "socialInsurance": "1111",
  374. "tod": "[]",
  375. "phone": "15854712036",
  376. "nation": "汉族",
  377. "culture": "高中",
  378. "occupation": "自由职业",
  379. "marriage": "已婚",
  380. "address": "[\"330000\",\"330100\",\"330122\"]",
  381. "addressDetail": "111",
  382. "province": "浙江省",
  383. "city": "杭州市",
  384. "area": "桐庐县",
  385. "town": "附海镇",
  386. "village": "花木村",
  387. "healthIndex": null,
  388. "complication": "[]",
  389. "acutecomplications": null,
  390. "medicalInsuranceType": 1,
  391. "chronicDiseaseType": 4,
  392. "gxyIllTime": null,
  393. "tnbIllTime": null,
  394. "diseaseHistory": null,
  395. "familyHistory": null,
  396. "saltiness": "",
  397. "hospitalId": 103,
  398. "registUserId": 78,
  399. "nextVisitTime": null,
  400. "newVisitDate": null,
  401. "disability": null,
  402. "povertySituation": null,
  403. "healthImportance": null,
  404. "lvhTime": null,
  405. "lvh": null,
  406. "carotidPlaque": null,
  407. "carotidPlaqueTime": null,
  408. "hyperhomocysteinemia": null,
  409. "mentalIllness": null,
  410. "acuteDisease": null,
  411. "chronicDisease": null,
  412. "chronicConfirmedTime": null,
  413. "acuteConfirmedTime": null,
  414. "hospitalTime": null,
  415. "acuteRiskLevel": null,
  416. "chronicRiskLevel": null,
  417. "andComplication": "[]",
  418. "project": null,
  419. "isSend": "0",
  420. "createTime": "2022-11-23 13:14:24",
  421. "updateTime": "2022-11-23T13:14:24",
  422. "isDelete": 0
  423. }
  424. export default {
  425. mounted() {
  426. console.log(echarts)
  427. this.chartOption1(dataList, 'echarts1')
  428. this.chartOption2(dataList, 'echarts2')
  429. this.chartOption3(dataList, 'echarts3')
  430. // this.initChart('echarts1', this.option)
  431. // this.initChart('echarts2', this.option2)
  432. },
  433. methods: {
  434. initChart(dom, option) {
  435. let chart = echarts.init(document.getElementById(dom))
  436. chart.setOption(option)
  437. },
  438. // updateEcharts(newValue, oldValue, ownerInstance, instance) {
  439. // // 监听 service 层数据变更
  440. // myChart.setOption(newValue)
  441. // },
  442. onClick(event, ownerInstance) {
  443. // 调用 service 层的方法
  444. ownerInstance.callMethod('onViewClick', {
  445. test: 'test'
  446. })
  447. },
  448. check({
  449. type,
  450. value,
  451. age,
  452. sex
  453. }) {
  454. let msg = info
  455. let arr = config
  456. if (type == 'shrink' && age) {
  457. if (msg.age > 65) {
  458. if (value > arr['shrinktop'][1]) {
  459. return true
  460. }
  461. if (value < arr['shrinktop'][0]) {
  462. return true
  463. }
  464. } else {
  465. if (value > arr['shrinklow'][1]) {
  466. return true
  467. }
  468. if (value < arr['shrinklow'][0]) {
  469. return true
  470. }
  471. }
  472. }
  473. if (sex) {
  474. if (msg.sex == 1) {
  475. if (value > arr[type][0][1]) {
  476. return true
  477. }
  478. if (value < arr[type][0][0]) {
  479. return true
  480. }
  481. } else {
  482. if (value > arr[type][1][1]) {
  483. return true
  484. }
  485. if (value < arr[type][1][0]) {
  486. return true
  487. }
  488. }
  489. }
  490. if (value > arr[type][1]) {
  491. return true
  492. }
  493. if (value < arr[type][0]) {
  494. return true
  495. }
  496. return false
  497. },
  498. chartOption1(data, dom) {
  499. // console.log(data)
  500. let data1 = [],
  501. data2 = [],
  502. data3 = [],
  503. time = []
  504. data.map((item) => {
  505. time.push(this.$mf.timeTrans({time:item.uploadTime,format:'M.D'}))
  506. data1.push(item.sbp)
  507. data2.push(item.rbp)
  508. data3.push(item.pulse)
  509. })
  510. let arr = []
  511. data.map((item, index) => {
  512. if (this.check({
  513. type: 'shrink',
  514. value: data1[index],
  515. age: true
  516. })) {
  517. arr.push({
  518. name: '收缩压',
  519. value: [item.uploadTime, data1[index]],
  520. symbolSize: 8,
  521. })
  522. }
  523. if (this.check({
  524. type: 'diastole',
  525. value: data2[index]
  526. })) {
  527. arr.push({
  528. name: '舒张压',
  529. value: [item.uploadTime, data2[index]],
  530. symbolSize: 8,
  531. })
  532. }
  533. })
  534. // console.log(arr)
  535. var option = (option = {
  536. legend: {
  537. data: ['收缩压', '舒张压', '心率'],
  538. },
  539. tooltip: {
  540. formatter: function(params) {
  541. console.log(params)
  542. let str =
  543. '<view style="padding:0px;width:140px"><view>' +
  544. params[0].name +
  545. '</view><view class="centerY" style="margin-top:6px"><view style="background:#5470c6;width:10px;height:10px;border-radius: 50%;" ></view><view class="" style="margin-left:4px">' +
  546. params[0].seriesName +
  547. '</view> <view class="ml-auto font-bold">' +
  548. params[0].value +
  549. '</view></view> <view class="centerY" style="margin-top:6px"><view style="background:#91cc75;width:10px;height:10px;border-radius: 50%;" ></view><view class="" style="margin-left:4px">' +
  550. params[1].seriesName +
  551. '</view><view class="ml-auto font-bold">' +
  552. params[1].value +
  553. '</view></view><view class="centerY" style="margin-top:6px"><view style="background:#fac858;width:10px;height:10px;border-radius: 50%;" ></view><view class="" style="margin-left:4px">' +
  554. params[2].seriesName +
  555. '</view><view class="ml-auto font-bold">' +
  556. params[2].value +
  557. '</view></view></view>'
  558. return str
  559. },
  560. trigger: 'axis',
  561. axisPointer: {
  562. type: 'cross',
  563. label: {
  564. backgroundColor: '#6a7985',
  565. },
  566. },
  567. },
  568. grid: {
  569. top: '20%',
  570. left: '3%',
  571. right: '5%',
  572. bottom: '3%',
  573. containLabel: true,
  574. },
  575. xAxis: [{
  576. type: 'category',
  577. axisPointer: {
  578. type: 'shadow',
  579. },
  580. data: time.reverse(),
  581. }, ],
  582. yAxis: [{
  583. type: 'value',
  584. }, ],
  585. series: [{
  586. name: '收缩压',
  587. label: {
  588. show: true,
  589. formatter: '{@score}',
  590. position: 'top'
  591. },
  592. smooth: true,
  593. type: 'line',
  594. data: data1.reverse(),
  595. },
  596. {
  597. name: '舒张压',
  598. label: {
  599. show: true,
  600. formatter: '{@score}',
  601. position: 'bottom',
  602. },
  603. smooth: true,
  604. type: 'line',
  605. data: data2.reverse(),
  606. },
  607. {
  608. type: 'effectScatter',
  609. coordinateSystem: 'cartesian2d',
  610. data: arr,
  611. showEffectOn: 'render',
  612. // zlevel:1,
  613. rippleEffect: {
  614. // 波纹的绘制方式,可选'stroke'和'fill'
  615. brushType: 'fill',
  616. },
  617. itemStyle: {
  618. color: '#F2597F'
  619. },
  620. hoverAnimation: false,
  621. },
  622. ],
  623. })
  624. if (document.getElementById(dom)) {
  625. this.initChart(dom, option)
  626. }
  627. },
  628. chartOption2(data) {
  629. // console.log(data)
  630. let data1 = [],
  631. time = []
  632. data.map((item) => {
  633. time.push(this.$mf.timeTrans({time:item.uploadTime,format:'M.D'}))
  634. data1.push(item.glu)
  635. })
  636. let arr = []
  637. data.map((item, index) => {
  638. if (this.check({
  639. type: 'bloodGlucose',
  640. value: data1[index],
  641. age: true
  642. })) {
  643. arr.push({
  644. name: '血糖',
  645. value: [item.uploadTime, data1[index]],
  646. symbolSize: 8,
  647. })
  648. }
  649. })
  650. var option = (option = {
  651. legend: {
  652. data: ['血糖'],
  653. },
  654. tooltip: {
  655. trigger: 'axis',
  656. axisPointer: {
  657. type: 'cross',
  658. label: {
  659. backgroundColor: '#6a7985',
  660. },
  661. },
  662. },
  663. grid: {
  664. top: '20%',
  665. left: '3%',
  666. right: '5%',
  667. bottom: '3%',
  668. containLabel: true,
  669. },
  670. xAxis: [{
  671. type: 'category',
  672. axisPointer: {
  673. type: 'shadow',
  674. },
  675. data: time.reverse(),
  676. }, ],
  677. yAxis: [{
  678. type: 'value',
  679. }, ],
  680. series: [{
  681. name: '血糖',
  682. label: {
  683. show: true,
  684. formatter: '{@score}',
  685. position: 'top'
  686. },
  687. smooth: true,
  688. type: 'line',
  689. data: data1.reverse(),
  690. itemStyle: {
  691. color: '#369FE5'
  692. },
  693. },
  694. {
  695. type: 'effectScatter',
  696. coordinateSystem: 'cartesian2d',
  697. data: arr,
  698. showEffectOn: 'render',
  699. // zlevel:1,
  700. rippleEffect: {
  701. // 波纹的绘制方式,可选'stroke'和'fill'
  702. brushType: 'fill',
  703. },
  704. itemStyle: {
  705. color: '#F2597F'
  706. },
  707. hoverAnimation: false,
  708. },
  709. ],
  710. })
  711. this.$nextTick(() => {
  712. if (document.getElementById('echarts2')) {
  713. this.initChart('echarts2', option)
  714. }
  715. })
  716. },
  717. chartOption3(data, dom) {
  718. // console.log(data)
  719. let data1 = [],
  720. data2 = [],
  721. data3 = [],
  722. time = []
  723. data.map((item) => {
  724. time.push(this.$mf.timeTrans({time:item.uploadTime,format:'M.D'}))
  725. data3.push(item.pulse)
  726. })
  727. let arr = []
  728. data.map((item, index) => {
  729. if (this.check({
  730. type: 'pulse',
  731. value: data3[index]
  732. })) {
  733. arr.push({
  734. name: '心率',
  735. value: [item.uploadTime, data3[index]],
  736. symbolSize: 10,
  737. })
  738. }
  739. })
  740. // console.log(arr)
  741. var option = (option = {
  742. legend: {
  743. data: ['心率'],
  744. },
  745. tooltip: {
  746. trigger: 'axis',
  747. axisPointer: {
  748. type: 'cross',
  749. label: {
  750. backgroundColor: '#6a7985',
  751. },
  752. },
  753. },
  754. grid: {
  755. top: '20%',
  756. left: '3%',
  757. right: '5%',
  758. bottom: '3%',
  759. containLabel: true,
  760. },
  761. xAxis: [{
  762. type: 'category',
  763. axisPointer: {
  764. type: 'shadow',
  765. },
  766. data: time.reverse(),
  767. }, ],
  768. yAxis: [{
  769. type: 'value',
  770. }, ],
  771. series: [{
  772. name: '心率',
  773. label: {
  774. show: true,
  775. formatter: '{@score}',
  776. position: 'top',
  777. },
  778. itemStyle: {
  779. color: '#35B79C'
  780. },
  781. smooth: true,
  782. type: 'line',
  783. data: data3.reverse(),
  784. areaStyle: {
  785. color: {
  786. type: 'linear',
  787. x: 0,
  788. y: 0,
  789. x2: 0,
  790. y2: 1,
  791. global: false,
  792. colorStops: [{
  793. offset: 0,
  794. color: 'rgba(53,183,156,.7)'
  795. },
  796. {
  797. offset: 0.5,
  798. color: 'rgba(53,183,156,0.3)'
  799. },
  800. {
  801. offset: 1,
  802. color: 'rgba(53,183,156,0)'
  803. }
  804. ]
  805. }
  806. },
  807. },
  808. {
  809. type: 'effectScatter',
  810. coordinateSystem: 'cartesian2d',
  811. data: arr,
  812. showEffectOn: 'render',
  813. // zlevel:1,
  814. rippleEffect: {
  815. // 波纹的绘制方式,可选'stroke'和'fill'
  816. brushType: 'fill',
  817. },
  818. itemStyle: {
  819. color: '#F2597F'
  820. },
  821. hoverAnimation: false,
  822. },
  823. ],
  824. })
  825. if (document.getElementById(dom)) {
  826. this.initChart(dom, option)
  827. }
  828. },
  829. }
  830. }
  831. </script>
  832. <style lang="scss">
  833. page {
  834. background: #F5F9FF;
  835. }
  836. .echarts {
  837. width: 100%;
  838. height: 400rpx;
  839. }
  840. </style>