添加跳转数据

master
rongweikang 2 years ago
parent 0bdf48e9a3
commit 7e6046d9eb

@ -290,9 +290,9 @@ class IotCarePlanFR200 extends Component<any, any> {
this.getInstrumentClockSummary(); this.getInstrumentClockSummary();
this.getInstrumentClockDetail(); this.getInstrumentClockDetail();
} }
componentDidMount() {} componentDidMount() { }
componentWillUnmount() {} componentWillUnmount() { }
componentDidShow() { componentDidShow() {
console.log("页面显示了"); console.log("页面显示了");
@ -660,8 +660,8 @@ class IotCarePlanFR200 extends Component<any, any> {
}); });
// return; // return;
let { currentDevice, ActiveModeItem } = this.state; let { currentDevice, ActiveModeItem } = this.state;
let params:any = {}; let params: any = {};
params = { params = {
instrumentId: currentDevice.id, instrumentId: currentDevice.id,
instrumentName: currentDevice.name, instrumentName: currentDevice.name,
@ -672,14 +672,14 @@ class IotCarePlanFR200 extends Component<any, any> {
GearData: [...waterStepList], GearData: [...waterStepList],
}) })
}; };
// params = { ...params, ...nursingData }; // params = { ...params, ...nursingData };
let res: any = await InstrumentInfo.apiNursingLog.addLog( let res: any = await InstrumentInfo.apiNursingLog.addLog(
JSON.stringify( JSON.stringify(
params params
) )
); );
setTimeout(async() => { setTimeout(async () => {
this.setState({ this.setState({
isShowNursingSuccess: false, isShowNursingSuccess: false,
}); });
@ -688,13 +688,55 @@ class IotCarePlanFR200 extends Component<any, any> {
let year = date.getFullYear(); let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0'); let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0'); let day = date.getDate().toString().padStart(2, '0');
let formattedDate = `${year}.${month}.${day}`; let formattedDate = `${year}.${month}.${day}`;
this.moistureTest(params.nursingData, formattedDate, ActiveModeItem.id, currentDevice.id)
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${params.nursingData}&date=${formattedDate}&modeId=${ActiveModeItem.id}&id=${currentDevice.id}`);
}, 2000); }, 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 * @name
* @description * @description
@ -720,10 +762,10 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
}, 1000); }, 1000);
} }
updata() {} updata() { }
// 绘制能量图 // 绘制能量图
drawProwerPicture() {} drawProwerPicture() { }
/** 切换光照 */ /** 切换光照 */
onSwitchChange = async () => { onSwitchChange = async () => {
@ -1313,7 +1355,7 @@ class IotCarePlanFR200 extends Component<any, any> {
* @description +1 * @description +1
*/ */
waterTestNext(index) { waterTestNext(index) {
let ActiveModeItem =this.state.ActiveModeItem let ActiveModeItem = this.state.ActiveModeItem
if (index === 0 && ActiveModeItem.stepOneVideo) { if (index === 0 && ActiveModeItem.stepOneVideo) {
this.VideoSrcLoad(ActiveModeItem.stepOneVideo); this.VideoSrcLoad(ActiveModeItem.stepOneVideo);
} else if (index === 1 && ActiveModeItem.stepTwoVideo) { } else if (index === 1 && ActiveModeItem.stepTwoVideo) {
@ -1563,7 +1605,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 水分测试需要特殊处理 // 水分测试需要特殊处理
// 水分测试准备 水分测试工作 水分测试启动 // 水分测试准备 水分测试工作 水分测试启动
if (ActiveModeItem.modeType === "moistureTest") { if (ActiveModeItem.modeType === "moistureTest") {
let that =this let that = this
sendParams.testStatus = "standby"; // 切换为准备 sendParams.testStatus = "standby"; // 切换为准备
let waterStepList = this.state.waterStepList; let waterStepList = this.state.waterStepList;
let waterStepIndex = this.state.waterStepIndex; let waterStepIndex = this.state.waterStepIndex;
@ -1970,8 +2012,8 @@ class IotCarePlanFR200 extends Component<any, any> {
// 脸部one // 脸部one
todoPromise = async () => { todoPromise = async () => {
const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); const nowFR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
console.log(nowFR200NursingHistory,'nowFR200NursingHistory'); console.log(nowFR200NursingHistory, 'nowFR200NursingHistory');
// 护理脸部 // 护理脸部
if (nowFR200NursingHistory.jsonStatus.workMode === "face") { if (nowFR200NursingHistory.jsonStatus.workMode === "face") {
// 把working=工作中的状态数据筛选出来 // 把working=工作中的状态数据筛选出来
@ -2036,7 +2078,7 @@ class IotCarePlanFR200 extends Component<any, any> {
}; };
return nursingData; return nursingData;
} }
}; };
// 计算挡位 // 计算挡位
@ -2211,9 +2253,9 @@ class IotCarePlanFR200 extends Component<any, any> {
let report = true; let report = true;
go( go(
"/recoding/pages/face_report_one/face_report_one?id=" + "/recoding/pages/face_report_one/face_report_one?id=" +
id + id +
"&report=" + "&report=" +
report report
); );
} else if ("moistureTest" === nursingData.workMode) { } else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试"); console.log("水分测试");
@ -2221,9 +2263,9 @@ class IotCarePlanFR200 extends Component<any, any> {
let report = true; let report = true;
go( go(
"/recoding/pages/face_report/face_report?id=" + "/recoding/pages/face_report/face_report?id=" +
this.state.currentDevice.id+ this.state.currentDevice.id +
"&report=" + "&report=" +
report report
); );
// go( // go(
// "/recoding/pages/face_report/face_report?id=" + // "/recoding/pages/face_report/face_report?id=" +
@ -2540,9 +2582,9 @@ class IotCarePlanFR200 extends Component<any, any> {
deviceInfo={currentDevice} deviceInfo={currentDevice}
close={this.connectionClose} close={this.connectionClose}
isDisconnect={!isConnectionBlutoot} isDisconnect={!isConnectionBlutoot}
offlineChange={() => {}} offlineChange={() => { }}
pairingChange={this.pairingChange} pairingChange={this.pairingChange}
upgradeFun={() => {}} upgradeFun={() => { }}
/> />
)} )}
@ -2625,12 +2667,12 @@ class IotCarePlanFR200 extends Component<any, any> {
{(ActiveModeItem.modeType === "maskPenetration" || {(ActiveModeItem.modeType === "maskPenetration" ||
ActiveModeItem.modeType === "essence") && ( ActiveModeItem.modeType === "essence") && (
<Gears <Gears
onEmitMinus={this.handleMinus} onEmitMinus={this.handleMinus}
onEmitAdd={this.handleAdd} onEmitAdd={this.handleAdd}
GearData={GearData} GearData={GearData}
></Gears> ></Gears>
)} )}
{ActiveModeItem.modeType === "moistureTest" && ( {ActiveModeItem.modeType === "moistureTest" && (
<WaterTest <WaterTest

Loading…
Cancel
Save