From 924638c3c9eaefd011878b3b8b3108e1decdac32 Mon Sep 17 00:00:00 2001 From: qsj <731458905@qq.com> Date: Fri, 22 Mar 2024 17:59:42 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recoding/pages/recording/recording.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index 2517a77..f935e74 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -321,7 +321,6 @@ export default class Recording extends Component { let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids); let nursingData=JSON.parse(res2.data.data.nursingData) - nursingData.groupedAa.push(50) let obj ={ modeName:res2.data.data.modeName, data:nursingData From a3a27ec2c6719c56bfc817a8ffee95d18d04d049 Mon Sep 17 00:00:00 2001 From: rongweikang <1174906669@qq.com> Date: Fri, 22 Mar 2024 18:42:23 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E6=B0=B4=E5=88=86?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8Aecharts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/face_report/face_report.tsx | 145 +++++++++--------- .../moisture_test_report/Echarts/index.tsx | 13 +- .../moisture_test_report.tsx | 31 ++-- src/recoding/pages/recording/recording.tsx | 45 +++++- 4 files changed, 133 insertions(+), 101 deletions(-) diff --git a/src/recoding/pages/face_report/face_report.tsx b/src/recoding/pages/face_report/face_report.tsx index fc75668..13f8cc8 100644 --- a/src/recoding/pages/face_report/face_report.tsx +++ b/src/recoding/pages/face_report/face_report.tsx @@ -1,9 +1,9 @@ import Taro from "@tarojs/taro"; import classnames from "classnames"; import { Component, PropsWithChildren, useEffect, useState } from "react"; -import { Progress } from "@antmjs/vantui"; +import { Progress , Tab, Tabs, Dialog, Popup } from "@antmjs/vantui"; import { showModal } from "../../../utils/traoAPI"; -import { Tab, Tabs, Dialog, Popup } from "@antmjs/vantui"; + import { Block, View, Text, Image, Input, Button, Textarea, } from "@tarojs/components"; @@ -125,9 +125,6 @@ export default class Index extends Component { }).then(() => { let data = new Date Taro.setStorageSync('DayTime', data.toISOString()) - this.setState({ - clockShow: true - }) this.getClockStatistics(); this.setShow(false); @@ -280,25 +277,25 @@ delImg(i) { let { name, statistics, recordList, recordData, show,clockStatistics,punchInInfo,monthTime,reportShow } = this.state; return ( - - - - + + + + {statistics.nursingNum} - + - 本月护理天数 + 本月护理天数 - - {statistics.nursingTime} - 本月护理时间 + + {statistics.nursingTime} + 本月护理时间 {/* */} - - - - {recordData.createTime} + + + + {recordData.createTime} - + - - - {recordData.instrumentName} - - 模式:{recordData.modeName} - + + + {recordData.instrumentName} + + 模式:{recordData.modeName} + 护理时间:{recordData.nursingTime} - + 完成度: - + {" "} {recordData.completionPercentage * 100 > 100 ? 100 @@ -345,11 +342,11 @@ delImg(i) { - 历史记录 + 历史记录 {recordList.map((item) => ( - - - {item.createTime} + + + {item.createTime} - + - - - {item.instrumentName} - - 模式:{item.modeName} - 护理时间:{item.nursingTime} + + + {item.instrumentName} + + 模式:{item.modeName} + 护理时间:{item.nursingTime} - + 完成度: - + {" "} {item.completionPercentage * 100 > 100 ? 100 @@ -397,76 +394,76 @@ delImg(i) { ))} {reportShow ? ( - - 前往打卡 - + + 前往打卡 + 跳过 ): null} this.setState({ show: false })}> - + - 今日打卡 - + 今日打卡 + 本月您已打卡 - {clockStatistics[0]?.clockNum}{" "} + {clockStatistics[0]?.clockNum}{" "} 天,超越 - + {(clockStatistics[0]?.percentage * 100).toFixed(1)}% 花至用户 - + {punchInInfo.clockImageList.map((item, index) => ( - - + + ))} {punchInInfo.clockImageList.length < 3 && ( )} - - + + - + {"(" + (punchInInfo.clockContent.length || 0) + "/120)"} - - + + 确认提交 diff --git a/src/recoding/pages/moisture_test_report/Echarts/index.tsx b/src/recoding/pages/moisture_test_report/Echarts/index.tsx index 3b47257..2a70647 100644 --- a/src/recoding/pages/moisture_test_report/Echarts/index.tsx +++ b/src/recoding/pages/moisture_test_report/Echarts/index.tsx @@ -2,18 +2,17 @@ import Taro from "@tarojs/taro"; import classnames from "classnames"; import { Block, View, Image, Text, Input } from "@tarojs/components"; import { Popup, Progress, Slider } from "@antmjs/vantui"; -import { useRef } from "react"; +import { useEffect, useRef } from "react"; import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts"; import echarts from "@/utils/echarts.min.js"; import "./index.less"; interface Props { - Electricity: any; - matrixElectricity: any; - facialMaskConnectStatus: any; + echartsData: any } -function Index() { +function Index(echartsData: Props) { + let { gears, eDate } = echartsData.echartsData; const echartsRef = useRef(null); const option: EChartOption = { grid: { @@ -32,7 +31,7 @@ function Index() { splitLine: { show: true, }, - data: ['6.17', '6.18', '6.19', '6.20', '6.21', '6.22', '6.23'], + data:eDate, axisTick: { show: false }, @@ -76,7 +75,7 @@ function Index() { } ]) }, - data: [5, 3, 4, 6, 3, 4, 3], + data: gears, } ] }; diff --git a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx index bae9395..617950a 100644 --- a/src/recoding/pages/moisture_test_report/moisture_test_report.tsx +++ b/src/recoding/pages/moisture_test_report/moisture_test_report.tsx @@ -4,7 +4,7 @@ import { go } from "@/utils/traoAPI"; import { InstrumentInfo } from "@/utils/Interface"; import "taro-ui/dist/style/components/button.scss"; // 按需引入 -import Taro from "@tarojs/taro"; +import Taro, { setStorageSync } from "@tarojs/taro"; // 引入 Swiper, SwiperItem 组件 /*** redux ***/ @@ -13,6 +13,7 @@ import { setMobile } from "@/store/features/userInfo"; /*** redux end ***/ import Navbar from "@/components/navbar/navbar"; import Echarts from "./Echarts/index"; + import "./moisture_test_report.less"; class MoistureTestReport extends Component { @@ -40,7 +41,9 @@ class MoistureTestReport extends Component { imglist: [], id: 0, show: false, - modeId: 0 + modeId: 0, + echartsData: {}, + showEcharts: false }; } @@ -54,11 +57,9 @@ class MoistureTestReport extends Component { componentDidHide() { } onLoad(option) { - console.log(option.data); + console.log(option); let data = JSON.parse(option.data) - console.log(data); - let { reportData } = this.state reportData.curDate = option.date data.GearData.map(item => { @@ -78,18 +79,10 @@ class MoistureTestReport extends Component { } }) - this.setState({ reportData, modeId: option.modeId }); - this.moistureTest(option.id, reportData.curDate) + this.setState({ reportData, modeId: option.modeId, echartsData: JSON.parse(option.echartsData) }); + // this.moistureTest(option.id, reportData.curDate) } async initData() { } - async moistureTest(id, curDate) { - let data = { - queryDate: curDate, - instrumentId: id - } - let res = await InstrumentInfo.fr200.moistureTest(data); - - } toIndex() { Taro.reLaunch({ url: "/pages/index/index" }); @@ -99,7 +92,7 @@ class MoistureTestReport extends Component { } render() { - let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show, modeId } = this.state + let { name, imgUrl, reportData, reportData1, isClock, xinde, imglist, id, show, modeId, echartsData, showEcharts } = this.state const getStatusData = (level) => { var bgCssData = { @@ -263,9 +256,9 @@ class MoistureTestReport extends Component { - 肌肤整体 + 肌肤整体水分测试报告 - + @@ -310,7 +303,7 @@ class MoistureTestReport extends Component { - + ); } } diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index ebe3396..eb988b7 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -337,8 +337,51 @@ export default class Recording extends Component { }; // 打开第三种类型 three = async (item) => { - go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}&id=${item.instrumentId}`); + this.moistureTest(item) }; + + async moistureTest(allData) { + let data = { + queryDate: allData.createTime, + instrumentId: allData.instrumentId + } + let res = await InstrumentInfo.fr200.moistureTest(data); + let echartsData = res.data.rows + for (let i = 0; i < echartsData.length; i++) { + for (let j = i + 1; j < echartsData.length; j++) { + if (echartsData[i].createTime.split(' ')[0] == echartsData[j].createTime.split(' ')[0]) { + let result = Date.parse(echartsData[i].createTime) - Date.parse(echartsData[j].createTime) + if (result < 0) { + echartsData.splice(i, 1) + } else { + echartsData.splice(j, 1) + } + } + } + } + let gears: any = [] + let eDate: any = [] + echartsData.map(item => { + const result = item.createTime.split(' ')[0].substring(5); + eDate.push(result) + item.nursingData = JSON.parse(item.nursingData) + let level: any = 0 + item.nursingData.GearData.map(gear => { + level = level + gear.forehead + }) + level = Math.floor(level / 3) + gears.push(level) + }) + echartsData = { + gears, eDate + } + setStorageSync('moistureEachtsData', JSON.stringify(echartsData)) + + go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}`); + + } + + // 打开其他类型 AllDevice = async (item) => { console.log("打开其他类型", item); From 7e6046d9ebc33c5cb836d714583ef5a2ed2c262d Mon Sep 17 00:00:00 2001 From: rongweikang <1174906669@qq.com> Date: Fri, 22 Mar 2024 18:55:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 102 +++++++++++++++------- 1 file changed, 72 insertions(+), 30 deletions(-) diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index c2e3ce5..98f6e4f 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -290,9 +290,9 @@ class IotCarePlanFR200 extends Component { this.getInstrumentClockSummary(); this.getInstrumentClockDetail(); } - componentDidMount() {} + componentDidMount() { } - componentWillUnmount() {} + componentWillUnmount() { } componentDidShow() { console.log("页面显示了"); @@ -660,8 +660,8 @@ class IotCarePlanFR200 extends Component { }); // return; let { currentDevice, ActiveModeItem } = this.state; - let params:any = {}; - + let params: any = {}; + params = { instrumentId: currentDevice.id, instrumentName: currentDevice.name, @@ -672,14 +672,14 @@ class IotCarePlanFR200 extends Component { GearData: [...waterStepList], }) }; - + // params = { ...params, ...nursingData }; let res: any = await InstrumentInfo.apiNursingLog.addLog( JSON.stringify( params ) ); - setTimeout(async() => { + setTimeout(async () => { this.setState({ isShowNursingSuccess: false, }); @@ -688,13 +688,55 @@ class IotCarePlanFR200 extends Component { let year = date.getFullYear(); let month = (date.getMonth() + 1).toString().padStart(2, '0'); let day = date.getDate().toString().padStart(2, '0'); - + let formattedDate = `${year}.${month}.${day}`; - - go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${params.nursingData}&date=${formattedDate}&modeId=${ActiveModeItem.id}&id=${currentDevice.id}`); + this.moistureTest(params.nursingData, formattedDate, ActiveModeItem.id, currentDevice.id) }, 2000); }; + async moistureTest(nursingData, formattedDate, ActiveModeItemId, currentDeviceId) { + let data = { + queryDate: formattedDate, + instrumentId: currentDeviceId + } + let res = await InstrumentInfo.fr200.moistureTest(data); + let echartsData = res.data.rows + for (let i = 0; i < echartsData.length; i++) { + for (let j = i + 1; j < echartsData.length; j++) { + if (echartsData[i].createTime.split(' ')[0] == echartsData[j].createTime.split(' ')[0]) { + let result = Date.parse(echartsData[i].createTime) - Date.parse(echartsData[j].createTime) + if (result < 0) { + echartsData.splice(i, 1) + } else { + echartsData.splice(j, 1) + } + } + } + } + let gears: any = [] + let eDate: any = [] + echartsData.map(item => { + const result = item.createTime.split(' ')[0].substring(5); + eDate.push(result) + item.nursingData = JSON.parse(item.nursingData) + let level: any = 0 + item.nursingData.GearData.map(gear => { + level = level + gear.forehead + }) + level = Math.floor(level / 3) + gears.push(level) + }) + echartsData = { + gears, eDate + } + setStorageSync('moistureEachtsData', JSON.stringify(echartsData)) + + // go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}`); + go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${nursingData}&date=${formattedDate}&modeId=${ActiveModeItemId}&id=${currentDeviceId}&echartsData=${JSON.stringify(echartsData)}`); + + } + + /** * @name 不可切换光照提示 * @description 检测紧贴肌肤 @@ -720,10 +762,10 @@ class IotCarePlanFR200 extends Component { } }, 1000); } - updata() {} + updata() { } // 绘制能量图 - drawProwerPicture() {} + drawProwerPicture() { } /** 切换光照 */ onSwitchChange = async () => { @@ -1313,7 +1355,7 @@ class IotCarePlanFR200 extends Component { * @description 步骤+1并设置视频 */ waterTestNext(index) { - let ActiveModeItem =this.state.ActiveModeItem + let ActiveModeItem = this.state.ActiveModeItem if (index === 0 && ActiveModeItem.stepOneVideo) { this.VideoSrcLoad(ActiveModeItem.stepOneVideo); } else if (index === 1 && ActiveModeItem.stepTwoVideo) { @@ -1563,7 +1605,7 @@ class IotCarePlanFR200 extends Component { // 水分测试需要特殊处理 // 水分测试准备 水分测试工作 水分测试启动 if (ActiveModeItem.modeType === "moistureTest") { - let that =this + let that = this sendParams.testStatus = "standby"; // 切换为准备 let waterStepList = this.state.waterStepList; let waterStepIndex = this.state.waterStepIndex; @@ -1970,8 +2012,8 @@ class IotCarePlanFR200 extends Component { // 脸部one todoPromise = async () => { const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); - console.log(nowFR200NursingHistory,'nowFR200NursingHistory'); - + console.log(nowFR200NursingHistory, 'nowFR200NursingHistory'); + // 护理脸部 if (nowFR200NursingHistory.jsonStatus.workMode === "face") { // 把working=工作中的状态数据筛选出来 @@ -2036,7 +2078,7 @@ class IotCarePlanFR200 extends Component { }; return nursingData; - } + } }; // 计算挡位 @@ -2211,9 +2253,9 @@ class IotCarePlanFR200 extends Component { let report = true; go( "/recoding/pages/face_report_one/face_report_one?id=" + - id + - "&report=" + - report + id + + "&report=" + + report ); } else if ("moistureTest" === nursingData.workMode) { console.log("水分测试"); @@ -2221,9 +2263,9 @@ class IotCarePlanFR200 extends Component { let report = true; go( "/recoding/pages/face_report/face_report?id=" + - this.state.currentDevice.id+ - "&report=" + - report + this.state.currentDevice.id + + "&report=" + + report ); // go( // "/recoding/pages/face_report/face_report?id=" + @@ -2540,9 +2582,9 @@ class IotCarePlanFR200 extends Component { deviceInfo={currentDevice} close={this.connectionClose} isDisconnect={!isConnectionBlutoot} - offlineChange={() => {}} + offlineChange={() => { }} pairingChange={this.pairingChange} - upgradeFun={() => {}} + upgradeFun={() => { }} /> )} @@ -2625,12 +2667,12 @@ class IotCarePlanFR200 extends Component { {(ActiveModeItem.modeType === "maskPenetration" || ActiveModeItem.modeType === "essence") && ( - - )} + + )} {ActiveModeItem.modeType === "moistureTest" && ( Date: Fri, 22 Mar 2024 19:26:24 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=8A=A4=E7=90=86=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.config.ts | 2 +- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 98 ++++++++++++---------- src/recoding/pages/recording/recording.tsx | 42 +++++----- 3 files changed, 76 insertions(+), 66 deletions(-) diff --git a/src/app.config.ts b/src/app.config.ts index 880b905..25015c7 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -85,7 +85,7 @@ export default defineAppConfig({ "pages/recording/recording", "pages/face_report_one/face_report_one", "pages/moisture_test_report/moisture_test_report", - + "pages/face_report/face_report", ], }, { diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index c2e3ce5..2f4e44f 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -290,9 +290,9 @@ class IotCarePlanFR200 extends Component { this.getInstrumentClockSummary(); this.getInstrumentClockDetail(); } - componentDidMount() {} + componentDidMount() { } - componentWillUnmount() {} + componentWillUnmount() { } componentDidShow() { console.log("页面显示了"); @@ -660,8 +660,8 @@ class IotCarePlanFR200 extends Component { }); // return; let { currentDevice, ActiveModeItem } = this.state; - let params:any = {}; - + let params: any = {}; + params = { instrumentId: currentDevice.id, instrumentName: currentDevice.name, @@ -672,14 +672,14 @@ class IotCarePlanFR200 extends Component { GearData: [...waterStepList], }) }; - + // params = { ...params, ...nursingData }; let res: any = await InstrumentInfo.apiNursingLog.addLog( JSON.stringify( params ) ); - setTimeout(async() => { + setTimeout(async () => { this.setState({ isShowNursingSuccess: false, }); @@ -688,9 +688,9 @@ class IotCarePlanFR200 extends Component { let year = date.getFullYear(); let month = (date.getMonth() + 1).toString().padStart(2, '0'); let day = date.getDate().toString().padStart(2, '0'); - + let formattedDate = `${year}.${month}.${day}`; - + go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${params.nursingData}&date=${formattedDate}&modeId=${ActiveModeItem.id}&id=${currentDevice.id}`); }, 2000); }; @@ -720,10 +720,10 @@ class IotCarePlanFR200 extends Component { } }, 1000); } - updata() {} + updata() { } // 绘制能量图 - drawProwerPicture() {} + drawProwerPicture() { } /** 切换光照 */ onSwitchChange = async () => { @@ -1313,7 +1313,7 @@ class IotCarePlanFR200 extends Component { * @description 步骤+1并设置视频 */ waterTestNext(index) { - let ActiveModeItem =this.state.ActiveModeItem + let ActiveModeItem = this.state.ActiveModeItem if (index === 0 && ActiveModeItem.stepOneVideo) { this.VideoSrcLoad(ActiveModeItem.stepOneVideo); } else if (index === 1 && ActiveModeItem.stepTwoVideo) { @@ -1563,7 +1563,7 @@ class IotCarePlanFR200 extends Component { // 水分测试需要特殊处理 // 水分测试准备 水分测试工作 水分测试启动 if (ActiveModeItem.modeType === "moistureTest") { - let that =this + let that = this sendParams.testStatus = "standby"; // 切换为准备 let waterStepList = this.state.waterStepList; let waterStepIndex = this.state.waterStepIndex; @@ -1970,8 +1970,8 @@ class IotCarePlanFR200 extends Component { // 脸部one todoPromise = async () => { const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); - console.log(nowFR200NursingHistory,'nowFR200NursingHistory'); - + console.log(nowFR200NursingHistory, 'nowFR200NursingHistory'); + // 护理脸部 if (nowFR200NursingHistory.jsonStatus.workMode === "face") { // 把working=工作中的状态数据筛选出来 @@ -2036,7 +2036,8 @@ class IotCarePlanFR200 extends Component { }; return nursingData; - } + } + return { nursingData:JSON.stringify({workMode: nowFR200NursingHistory.workMode,}) } }; // 计算挡位 @@ -2073,11 +2074,14 @@ class IotCarePlanFR200 extends Component { }; } let res1: any = await this.todoPromise(); + if(res1){ + params = { ...params, ...res1 }; + } console.log(res1, "查看返回数据"); - params = { ...params, ...res1 }; - let res: any = await InstrumentInfo.apiNursingLog.addLog(params); - console.log("PostNursingLogClock", res); - if (res.data.code === 200) { + + let res2: any = await InstrumentInfo.apiNursingLog.addLog(params); + console.log("PostNursingLogClock", res2); + if (res2.data.code === 200) { let params = { instrumentId: currentDevice.id, }; @@ -2095,7 +2099,7 @@ class IotCarePlanFR200 extends Component { isShowNursingSuccess: false, }); - this.goFaceReport(res1, ActiveModeItem.id); // 跳转 + this.goFaceReport(res1, ActiveModeItem.id, res2.data.data, currentDevice.id); // 跳转 }, 2000); } } @@ -2191,7 +2195,7 @@ class IotCarePlanFR200 extends Component { }; /** 完成护理提交:跳转护理报告页 */ - goFaceReport = (data, id) => { + goFaceReport = async (data, id, deviceid, currentDevice) => { let nursingData = JSON.parse(data.nursingData); // 跳转前置空定时器,防止重复提交 if (currentTimeTimer) clearInterval(currentTimeTimer); @@ -2204,31 +2208,39 @@ class IotCarePlanFR200 extends Component { "headLiftingPro", ].includes(nursingData.workMode) ) { - // let obj = { - // modeName: nursingData.modeName, - // data: nursingData, - // }; + let ids = Number(deviceid) + // 获取echarts数据 这个是获取接口更新echarts页面 + let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids); + + let nursingDatas = JSON.parse(res2.data.data.nursingData) + let obj = { + modeName: res2.data.data.modeName, + data: nursingDatas + } + let report = true; go( "/recoding/pages/face_report_one/face_report_one?id=" + - id + - "&report=" + - report + ids + + "&report=" + + report + "&obj=" + + JSON.stringify(obj) ); } else if ("moistureTest" === nursingData.workMode) { console.log("水分测试"); } else { + console.log('跳转11111111'); + let report = true; + go( "/recoding/pages/face_report/face_report?id=" + - this.state.currentDevice.id+ - "&report=" + - report + deviceid + + "&recordId=" + currentDevice + + "&report=" + + report ); - // go( - // "/recoding/pages/face_report/face_report?id=" + - // this.state.currentDevice.id - // ); + } }; @@ -2540,9 +2552,9 @@ class IotCarePlanFR200 extends Component { deviceInfo={currentDevice} close={this.connectionClose} isDisconnect={!isConnectionBlutoot} - offlineChange={() => {}} + offlineChange={() => { }} pairingChange={this.pairingChange} - upgradeFun={() => {}} + upgradeFun={() => { }} /> )} @@ -2625,12 +2637,12 @@ class IotCarePlanFR200 extends Component { {(ActiveModeItem.modeType === "maskPenetration" || ActiveModeItem.modeType === "essence") && ( - - )} + + )} {ActiveModeItem.modeType === "moistureTest" && ( { setStorageSync("instrument_detail", instrument); } }) - console.log(item,'查看'); - + console.log(item, '查看'); + if ([1, 2, 3, 4, 5].includes(item.jumpType)) { this.One(item); } else if (item.jumpType === 0) { @@ -316,24 +316,22 @@ export default class Recording extends Component { } // 打开第一种类型 One = async (item) => { - let ids =Number(item.id) - // 获取echarts数据 这个是获取接口更新echarts页面 - let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids); - let nursingData=JSON.parse(res2.data.data.nursingData) - - let obj ={ - modeName:res2.data.data.modeName, - data:nursingData - } - + let ids = Number(item.id) + // 获取echarts数据 这个是获取接口更新echarts页面 + let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(ids); + let nursingData = JSON.parse(res2.data.data.nursingData) + let obj = { + modeName: res2.data.data.modeName, + data: nursingData + } let report = false; - + go( "/recoding/pages/face_report_one/face_report_one?id=" + - item.id + - "&report=" + - report+ "&obj=" + - JSON.stringify(obj) + item.id + + "&report=" + + report + "&obj=" + + JSON.stringify(obj) ); }; // 打开第二种类型 @@ -342,15 +340,15 @@ export default class Recording extends Component { let report = false; go( "/recoding/pages/face_report/face_report?id=" + - item.id + - "&recordId=" + item.instrumentId+ - "&report=" + - report + item.id + + "&recordId=" + item.instrumentId + + "&report=" + + report ); }; // 打开第三种类型 three = async (item) => { - + go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}&id=${item.instrumentId}`); }; // 打开其他类型 From 4c77ad357cabdbdc964386fcd5d889fe5cc5caca Mon Sep 17 00:00:00 2001 From: qsj <731458905@qq.com> Date: Fri, 22 Mar 2024 20:08:38 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=B0=B4=E5=88=86=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8A=A4=E7=90=86=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/moduleIOT/pages/iotCarePlan/FR200.tsx | 27 ++++++++++++++-------- src/recoding/pages/recording/recording.tsx | 7 +++++- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/moduleIOT/pages/iotCarePlan/FR200.tsx b/src/moduleIOT/pages/iotCarePlan/FR200.tsx index e62be4a..e4c839a 100644 --- a/src/moduleIOT/pages/iotCarePlan/FR200.tsx +++ b/src/moduleIOT/pages/iotCarePlan/FR200.tsx @@ -691,7 +691,7 @@ class IotCarePlanFR200 extends Component { let formattedDate = `${year}.${month}.${day}`; - + this.moistureTest(params.nursingData, formattedDate, ActiveModeItem.id, currentDevice.id) }, 2000); }; @@ -717,12 +717,14 @@ class IotCarePlanFR200 extends Component { } let gears: any = [] let eDate: any = [] - echartsData.map(item => { + echartsData?.map(item => { + console.log(item,'查看数据'); + const result = item.createTime.split(' ')[0].substring(5); eDate.push(result) item.nursingData = JSON.parse(item.nursingData) let level: any = 0 - item.nursingData.GearData.map(gear => { + item.nursingData?.GearData?.map(gear => { level = level + gear.forehead }) level = Math.floor(level / 3) @@ -2017,7 +2019,13 @@ class IotCarePlanFR200 extends Component { console.log(nowFR200NursingHistory, 'nowFR200NursingHistory'); // 护理脸部 - if (nowFR200NursingHistory.jsonStatus.workMode === "face") { + if ([ + "face", + "eyes", + "nasolabialFold", + "mandibularLine", + "headLiftingPro", + ].includes(nowFR200NursingHistory.jsonStatus.workMode)) { // 把working=工作中的状态数据筛选出来 let filtered = nowFR200NursingHistory.dataArray.filter( (item) => item.workStatus === "working" @@ -2081,7 +2089,7 @@ class IotCarePlanFR200 extends Component { return nursingData; } - return { nursingData:JSON.stringify({workMode: nowFR200NursingHistory.workMode,}) } + return { nursingData: JSON.stringify({ workMode: nowFR200NursingHistory.workMode, }),showFace:true } }; // 计算挡位 @@ -2118,11 +2126,12 @@ class IotCarePlanFR200 extends Component { }; } let res1: any = await this.todoPromise(); - if(res1){ + if (!res1?.showFace) { + params = { ...params, ...res1 }; } console.log(res1, "查看返回数据"); - + let res2: any = await InstrumentInfo.apiNursingLog.addLog(params); console.log("PostNursingLogClock", res2); if (res2.data.code === 200) { @@ -2274,9 +2283,9 @@ class IotCarePlanFR200 extends Component { console.log("水分测试"); } else { console.log('跳转11111111'); - + let report = true; - + go( "/recoding/pages/face_report/face_report?id=" + deviceid + diff --git a/src/recoding/pages/recording/recording.tsx b/src/recoding/pages/recording/recording.tsx index b46234e..f3c6f1a 100644 --- a/src/recoding/pages/recording/recording.tsx +++ b/src/recoding/pages/recording/recording.tsx @@ -357,6 +357,8 @@ export default class Recording extends Component { instrumentId: allData.instrumentId } let res = await InstrumentInfo.fr200.moistureTest(data); + console.log(res,'查看返回数据'); + let echartsData = res.data.rows for (let i = 0; i < echartsData.length; i++) { for (let j = i + 1; j < echartsData.length; j++) { @@ -372,12 +374,15 @@ export default class Recording extends Component { } let gears: any = [] let eDate: any = [] + console.log(echartsData,'echartsDataechartsData'); + echartsData.map(item => { + const result = item.createTime.split(' ')[0].substring(5); eDate.push(result) item.nursingData = JSON.parse(item.nursingData) let level: any = 0 - item.nursingData.GearData.map(gear => { + item.nursingData?.GearData?.map(gear => { level = level + gear.forehead }) level = Math.floor(level / 3)