解决冲突

master
qsj 2 years ago
commit b2f8a48528

@ -1 +1,5 @@
@import url(./WL200.less); @import url(./WL200.less);
.show {
display: none;
}

@ -3,16 +3,15 @@ import dayjs from "dayjs";
import classnames from "classnames"; import classnames from "classnames";
import { debounce } from "lodash"; import { debounce } from "lodash";
// eslint-disable-next-line import/no-named-as-default
import React, { import React, {
Component, Component,
PropsWithChildren, PropsWithChildren,
useEffect, useEffect,
useState, useState,
} from "react"; } from "react";
/*** redux ***/
import Echarts from "./components/Echart/index"; import { connect } from "react-redux";
import Gears from "./components/Gears/index"; /*** redux end ***/
import { import {
Block, Block,
View, View,
@ -23,9 +22,27 @@ import {
Button, Button,
} from "@tarojs/components"; } from "@tarojs/components";
/*** redux ***/ import {
import { connect } from "react-redux"; notifyBLECharacteristicValueChange,
/*** redux end ***/ sendCommand,
} from "@/utils/bluetoothWXAPI";
import {
deviceCommandSamples,
bleCommandSamples,
} from "@/components/bluetoot/connection/wl200";
import { minSecToS, s_to_ms, s_to_hms, sleep, s_to_s } from "@/utils/util";
// import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100";
import {
DeviceToolKit as DeviceToolKitWM,
TResponseFromDevice as TResponseFromDeviceWM,
} from "@flossom-npm/iot-translater";
import commandMap from "@/utils/commandMap";
import { Popup } from "@antmjs/vantui";
import { fr200BleCommand } from "@/components/bluetoot/connection/fr200";
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
/* 公共组件 */ /* 公共组件 */
import Navbar from "@/components/navbar/navbar"; import Navbar from "@/components/navbar/navbar";
@ -45,28 +62,13 @@ import Footer from "./components/Footer/FR200";
import WaterTest from "./components/WaterTest/index"; import WaterTest from "./components/WaterTest/index";
/* 本页组件 END */ /* 本页组件 END */
import { go, getStorageSync, setStorageSync, msg } from "@/utils/traoAPI"; import Echarts from "./components/Echart";
import { InstrumentInfo } from "@/utils/Interface"; import Gears from "./components/Gears";
import "./FR200.less"; import "./FR200.less";
import {
notifyBLECharacteristicValueChange,
sendCommand,
} from "@/utils/bluetoothWXAPI";
import {
deviceCommandSamples,
bleCommandSamples,
} from "@/components/bluetoot/connection/wl200";
import { minSecToS, s_to_ms, s_to_hms, sleep, s_to_s } from "@/utils/util";
// import { DeviceToolKit as DeviceToolKitWE100 } from "@flossom-npm/iot-translater-we100";
import {
DeviceToolKit as DeviceToolKitWM,
TResponseFromDevice as TResponseFromDeviceWM,
} from "@flossom-npm/iot-translater";
import commandMap from "@/utils/commandMap";
import { Popup } from "@antmjs/vantui";
import { fr200BleCommand } from "@/components/bluetoot/connection/fr200";
const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200"); const deviceToolKitInstanceFR200 = new DeviceToolKitWM("FR200");
let deviceToolKitInstance = deviceToolKitInstanceFR200; let deviceToolKitInstance = deviceToolKitInstanceFR200;
@ -220,6 +222,9 @@ class IotCarePlanFR200 extends Component<any, any> {
// isFirstEntryMode: false, // 模式首次打开 // isFirstEntryMode: false, // 模式首次打开
isShowHistoryMsg: false, // 是否显示正在同步历史 isShowHistoryMsg: false, // 是否显示正在同步历史
showEcharts: false,
echartsData: '' //传给echarts图表的数据
}; };
} }
@ -272,10 +277,11 @@ class IotCarePlanFR200 extends Component<any, any> {
this.initData(); this.initData();
this.getInstrumentClockSummary(); this.getInstrumentClockSummary();
this.getInstrumentClockDetail(); this.getInstrumentClockDetail();
} }
componentDidMount() {} componentDidMount() { }
componentWillUnmount() {} componentWillUnmount() { }
componentDidShow() { componentDidShow() {
console.log("页面显示了"); console.log("页面显示了");
@ -423,6 +429,10 @@ class IotCarePlanFR200 extends Component<any, any> {
this.modeCurrentFun(res.data.data[0]); this.modeCurrentFun(res.data.data[0]);
}, 100); }, 100);
} }
let res1 = res.data.data.find(e => e.id == this.state.activeModeID)
setTimeout(() => {
this.modeCurrentFun(res1);
}, 100);
} else { } else {
this.setState({ ModeList: [] }); this.setState({ ModeList: [] });
} }
@ -501,6 +511,15 @@ class IotCarePlanFR200 extends Component<any, any> {
currentWorkModeType, currentWorkModeType,
}); });
setTimeout(() => {
// 设置时间组合
if (data.serviceData.length > 0) {
this.setServiceTimeData();
}
});
// 开发中,暂时允许直接切换 // 开发中,暂时允许直接切换
// 每次切换模式时清空一下历史数据 // 每次切换模式时清空一下历史数据
this.changeItemUpdateFR200NursingHistory(); this.changeItemUpdateFR200NursingHistory();
@ -672,9 +691,27 @@ class IotCarePlanFR200 extends Component<any, any> {
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试"); this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
}); });
}; };
look() {
let that = this
// this.setState({ showEcharts: !this.state.showEcharts });
let stop = 0
let time = setInterval(function () {
stop++
let random = Math.random();
that.setState({ echartsData: random })
if (stop >= 20) {
clearInterval(time)
}
}, 1000)
}
updata() {
}
// 绘制能量图 // 绘制能量图
drawProwerPicture() {} drawProwerPicture() { }
/** 切换光照 */ /** 切换光照 */
onSwitchChange = async () => { onSwitchChange = async () => {
@ -1675,6 +1712,7 @@ class IotCarePlanFR200 extends Component<any, any> {
console.log("保存setFR200NursingHistory"); console.log("保存setFR200NursingHistory");
}; };
/** 更新WL200护理历史运行时间 */ /** 更新WL200护理历史运行时间 */
updateFR200NursingHistory = (data: any = null, jsonStatus = null) => { updateFR200NursingHistory = (data: any = null, jsonStatus = null) => {
this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory"); this.FR200NursingHistory = Taro.getStorageSync("FR200NursingHistory");
@ -1692,6 +1730,8 @@ class IotCarePlanFR200 extends Component<any, any> {
if (!params.dataArray) params.dataArray = []; if (!params.dataArray) params.dataArray = [];
params.dataArray.push(jsonStatus); params.dataArray.push(jsonStatus);
params.jsonStatus = jsonStatus; params.jsonStatus = jsonStatus;
} }
} }
Taro.setStorageSync("FR200NursingHistory", params); Taro.setStorageSync("FR200NursingHistory", params);
@ -1700,7 +1740,7 @@ class IotCarePlanFR200 extends Component<any, any> {
// 基础模式可在这里调用函数更新图标Echarts // 基础模式可在这里调用函数更新图标Echarts
// 最新一条数据jsonStatus // 最新一条数据jsonStatus
// 注意事项只拿working状态 // 注意事项只拿working状态
// todo // todo
} else { } else {
this.setFR200NursingHistory(jsonStatus); this.setFR200NursingHistory(jsonStatus);
} }
@ -2011,11 +2051,11 @@ 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 +
"&obj=" + "&obj=" +
JSON.stringify(obj) JSON.stringify(obj)
); );
} else if ("moistureTest" === nursingData.workMode) { } else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试"); console.log("水分测试");
@ -2027,6 +2067,10 @@ class IotCarePlanFR200 extends Component<any, any> {
"&report=" + "&report=" +
report report
); );
// go(
// "/recoding/pages/face_report/face_report?id=" +
// this.state.currentDevice.id
// );
} }
}; };
@ -2177,6 +2221,10 @@ class IotCarePlanFR200 extends Component<any, any> {
isShowHistoryMsg, isShowHistoryMsg,
isModeLock, isModeLock,
TestModeStepIndex, TestModeStepIndex,
showEcharts,
echartsData,
isShowReReadRecordConnect,
currentServiceData
} = this.state; } = this.state;
return ( return (
@ -2192,19 +2240,19 @@ class IotCarePlanFR200 extends Component<any, any> {
<PopupAlert <PopupAlert
isShow={isModeLock} isShow={isModeLock}
zIndex={10020} zIndex={10020}
myClassName="level-up" myClassName='level-up'
title="提示" title='提示'
content="该模式即将上线,敬请期待" content='该模式即将上线,敬请期待'
confirmButtonText="我知道了" confirmButtonText='我知道了'
textAlgin="center" textAlgin='center'
close={this.onModeLockClose} close={this.onModeLockClose}
confirm={this.onModeLockClose} confirm={this.onModeLockClose}
/> />
<PopupInstrumentUploadTips <PopupInstrumentUploadTips
isShow={isFirstTipShow} isShow={isFirstTipShow}
zIndex={10020} zIndex={10020}
myClassName="level-up" myClassName='level-up'
title="打卡介绍" title='打卡介绍'
data={nurseInfo} data={nurseInfo}
close={this.onTipShowClose} close={this.onTipShowClose}
confirm={this.onTipShowClose} confirm={this.onTipShowClose}
@ -2216,11 +2264,11 @@ class IotCarePlanFR200 extends Component<any, any> {
isLarge isLarge
isClose isClose
isShow={isEndCarePlan} isShow={isEndCarePlan}
title="提示" title='提示'
content="是否结束护理" content='是否结束护理'
textAlgin="center" textAlgin='center'
cancelButtonText="取消" cancelButtonText='取消'
confirmButtonText="确定" confirmButtonText='确定'
close={this.cancelEndBtn} close={this.cancelEndBtn}
confirm={this.confirmEndBtn} confirm={this.confirmEndBtn}
/> />
@ -2228,7 +2276,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isLarge isLarge
isClose isClose
isShow={isSwitchActiveMode} isShow={isSwitchActiveMode}
title="护理模式切换" title='护理模式切换'
content={ content={
<ModeListView <ModeListView
ModeID={ModeID} ModeID={ModeID}
@ -2242,9 +2290,9 @@ class IotCarePlanFR200 extends Component<any, any> {
onModeLockOpen={this.onModeLockOpen} onModeLockOpen={this.onModeLockOpen}
/> />
} }
textAlgin="center" textAlgin='center'
cancelButtonText="取消" cancelButtonText='取消'
confirmButtonText="确定" confirmButtonText='确定'
close={this.cancelModeSwitchBtn} close={this.cancelModeSwitchBtn}
confirm={this.confirmModeSwitchBtn} confirm={this.confirmModeSwitchBtn}
/> />
@ -2254,7 +2302,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isShow={isShowStepTips} isShow={isShowStepTips}
isLarge isLarge
isFirstEntry={false} isFirstEntry={false}
confirmButtonText="知道了" confirmButtonText='知道了'
data={ActiveModeItem.openSourceData} data={ActiveModeItem.openSourceData}
close={this.closeStepTips} close={this.closeStepTips}
/> />
@ -2263,10 +2311,10 @@ class IotCarePlanFR200 extends Component<any, any> {
<PopupAlert <PopupAlert
isShow={isNotEnoughTime} isShow={isNotEnoughTime}
isClose isClose
title="提示" title='提示'
content="您的本次护理时间不足,请重新护理" content='您的本次护理时间不足,请重新护理'
confirmButtonText="确认" confirmButtonText='确认'
textAlgin="center" textAlgin='center'
close={this.closeNotEnoughTime} close={this.closeNotEnoughTime}
confirm={this.closeNotEnoughTime} confirm={this.closeNotEnoughTime}
/> />
@ -2275,11 +2323,11 @@ class IotCarePlanFR200 extends Component<any, any> {
isShow={isShowErrorTipsText} isShow={isShowErrorTipsText}
isClose isClose
zIndex={10020} zIndex={10020}
myClassName="level-up" myClassName='level-up'
title="提示" title='提示'
content={errorTipsText} content={errorTipsText}
confirmButtonText="知道了" confirmButtonText='知道了'
textAlgin="center" textAlgin='center'
close={this.closeErrorTipsText} close={this.closeErrorTipsText}
confirm={this.closeErrorTipsText} confirm={this.closeErrorTipsText}
/> />
@ -2288,17 +2336,17 @@ class IotCarePlanFR200 extends Component<any, any> {
isShow={isShowTipsSave} isShow={isShowTipsSave}
isClose isClose
zIndex={10020} zIndex={10020}
myClassName="level-up" myClassName='level-up'
title="提示" title='提示'
content={ content={
<Block> <Block>
<View></View> <View></View>
<View></View> <View></View>
</Block> </Block>
} }
cancelButtonText="取消" cancelButtonText='取消'
confirmButtonText="确认" confirmButtonText='确认'
textAlgin="center" textAlgin='center'
close={this.closeTipsSave} close={this.closeTipsSave}
cancel={this.cancelTipsSave} cancel={this.cancelTipsSave}
confirm={this.confirmTipsSave} confirm={this.confirmTipsSave}
@ -2307,11 +2355,11 @@ class IotCarePlanFR200 extends Component<any, any> {
<PopupStatus <PopupStatus
isShow={isShowNursingSuccess} isShow={isShowNursingSuccess}
isClose isClose
title="您已结束本次护理" title='您已结束本次护理'
type="success" type='success'
content="正在上传护理记录……" content='正在上传护理记录……'
confirmButtonText="知道了" confirmButtonText='知道了'
textAlgin="center" textAlgin='center'
close={() => { close={() => {
/*不需要做处理*/ /*不需要做处理*/
}} }}
@ -2322,57 +2370,69 @@ 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={() => { }}
/> />
)} )}
<Popup <Popup
show={isShowHistoryMsg} show={isShowHistoryMsg}
className="custom-popup" className='custom-popup'
overlay={false} overlay={false}
> >
<View className="sync-history-msg">...</View> <View className='sync-history-msg'>...</View>
</Popup> </Popup>
</View> </View>
<View> <View>
<View className="iot-main"> <View className='iot-main'>
<View className="banner-box"> <View className='banner-box'>
<View> <View>
<Video {!isShowNurse && (
className="video-or-image" <Video
src={ActiveModeItem.modeVideo} className='video-or-image'
loop src={ActiveModeItem.modeVideo}
id="myVideo" loop
objectFit="cover" />
enablePlayGesture )}
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
{isShowNurse && (
<Block>
{isStopNurse ? (
<Image
className='video-or-image'
src={currentServiceData.stopSource}
/>
) : (
<Image
className='video-or-image'
src={currentServiceData.startSource}
/>
)}
</Block>
)}
{errorTips && ( {errorTips && (
<Block> <Block>
<View className="msg-tips"> <View className='msg-tips'>
<Image <Image
className="msg-tips-img" className='msg-tips-img'
src={require("@/img/tips.png")} src={require("@/img/tips.png")}
/> />
<View className="msg-tips-content">{errorTips}</View> <View className='msg-tips-content'>{errorTips}</View>
</View> </View>
</Block> </Block>
)} )}
</View> </View>
<View className="iot-device"> <View className='iot-device'>
<View className="item"> <View className='item'>
<Text className="device-time"> <Text className='device-time'>
<Text className="time">{currentTime}</Text> <Text className='time'>{currentTime}</Text>
</Text> </Text>
</View> </View>
<View className="line" /> <View className='line' />
<ElectricityView <ElectricityView
Electricity={Electricity} Electricity={Electricity}
matrixElectricity={matrixElectricity} matrixElectricity={matrixElectricity}
@ -2394,25 +2454,22 @@ class IotCarePlanFR200 extends Component<any, any> {
onModeLockOpen={this.onModeLockOpen} onModeLockOpen={this.onModeLockOpen}
/> />
)} )}
<button onClick={this.look.bind(this)} >echarts </button>
<button onClick={this.updata.bind(this)} > </button>
<View className={classnames({ 'show': showEcharts })}><Echarts data={echartsData} ></Echarts></View>
{/* {(ActiveModeItem.modeType === "face" || {/* {(ActiveModeItem.modeType === "face" ||
ActiveModeItem.modeType === "eyes") && ( ActiveModeItem.modeType === "eyes") && <Echarts></Echarts>} */}
<Block>
<Echarts></Echarts>
</Block>
)} */}
{/* <View style="display:none;">
<Echarts></Echarts>
</View> */}
{(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

@ -1,13 +1,41 @@
.box { .box {
width: 690rpx; width: 690rpx;
height: 320rpx; height: 320rpx;
margin: 28rpx auto; margin: 28rpx auto 150rpx;
background-color: #fff; background-color: #fff;
border-radius: 30rpx; border-radius: 30rpx;
padding: 35rpx 25rpx 25rpx 35rpx; padding: 35rpx 25rpx 25rpx 35rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
} }
.fullscreen {
position: fixed;
top: 450rpx;
left: -450rpx;
right: 0;
bottom: 0;
width: 100vh;
height: 100vw;
z-index: 9999;
background-color: rgba(0, 0, 0, 0.5); /* 背景色 */
transform: rotate(90deg);
// animation: rotate 0s linear;
}
@keyframes rotate {
from {
width: 690rpx;
height: 320rpx;
transform: rotate(0deg);
}
to {
width: 100vh;
height: 100vw;
transform: rotate(0deg);
}
}
.box_background { .box_background {
position: absolute; position: absolute;
top: 0; top: 0;
@ -29,6 +57,7 @@
position: absolute; position: absolute;
top: 32rpx; top: 32rpx;
right: 26rpx; right: 26rpx;
z-index: 2;
} }
.line { .line {
margin: 0 0 6rpx 35rpx; margin: 0 0 6rpx 35rpx;

@ -2,25 +2,23 @@ import Taro from "@tarojs/taro";
import classnames from "classnames"; import classnames from "classnames";
import { Block, View, Image, Text, Input } from "@tarojs/components"; import { Block, View, Image, Text, Input } from "@tarojs/components";
import { Popup, Progress, Slider } from "@antmjs/vantui"; import { Popup, Progress, Slider } from "@antmjs/vantui";
import { useRef } from "react"; import { useEffect, useRef, useState, useCallback } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts"; import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
import echarts from "@/utils/echarts.min.js"; import echarts from "@/utils/echarts.min.js";
import "./index.less"; import "./index.less";
interface Props { interface Props {
Electricity: any; data: any
matrixElectricity: any;
facialMaskConnectStatus: any;
} }
function Index() { function Index({ data }: Props) {
const buttonRef = useRef(null);
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
const option: EChartOption = { const [options, setOptions] = useState({
animation: false,
grid: { grid: {
// 让图表占满容器 // 让图表占满容器
top: "28rpx", top: "28rpx",
@ -258,14 +256,82 @@ function Index() {
}, },
}, },
], ],
}; })
const level = [8, 7, 6, 5, 4, 3, 2]; const level = [8, 7, 6, 5, 4, 3, 2];
const full = () => { const [newOptions, setNewOptions] = useState(options)
let box = document.getElementById("box"); const [newData, setNewData] = useState(0)
box?.classList.add('fullscreen') const full = useCallback(() => {
} // let box = document.getElementById("box");
// box?.classList.add('fullscreen')
let stop = 0
// let time = setInterval(function () {
// stop++
let option = JSON.parse(JSON.stringify(options))
let num = Math.floor(Math.random() * 9)
let count = 0
options.series.map(item => {
if (item.type === 'line') {
item.data.splice(0, 1)
item.data.push(num)
}
if (item.type === 'bar') {
count++
item.data.splice(0, 1)
if (count <= num) {
item.data.push(1)
} else {
item.data.push(0)
}
}
})
console.log(option);
// 更新图表数据
setNewOptions(option)
// if (stop > 20) {
// clearInterval(time)
// }
// }, 1000)
}, [data])
useEffect(() => {
setOptions(newOptions)
}, [newOptions]);
useEffect(() => {
setNewData(data)
}, [data]);
useEffect(() => {
let option = JSON.parse(JSON.stringify(options))
let num = Math.floor(newData * 9)
let count = 0
options.series.map(item => {
if (item.type === 'line') {
item.data.splice(0, 1)
item.data.push(num)
}
if (item.type === 'bar') {
count++
item.data.splice(0, 1)
if (count <= num) {
item.data.push(1)
} else {
item.data.push(0)
}
}
})
console.log(option, data);
// 更新图表数据
setNewOptions(option)
}, [newData])
// 当 someProp 变化时执行
// const quanping = () => { // const quanping = () => {
// T.setPageOrientation({ // T.setPageOrientation({
// orientation: "portrait", // orientation: "portrait",
@ -278,20 +344,21 @@ function Index() {
// }, // },
return ( return (
<Block> <Block>
<View id='box' className='box'> <View id='box' className='box'>
<Echarts <Echarts
force-use-old-canvas='false' force-use-old-canvas='false'
echarts={echarts} echarts={echarts}
option={option} option={options}
ref={echartsRef} ref={echartsRef}
// isPage={false} // isPage={false}
// style自定义设置echarts宽高 // style自定义设置echarts宽高
style={{ width: "630rpx", height: "260rpx", zIndex: 1 }} style={{ width: "630rpx", height: "260rpx", zIndex: 1 }}
/> />
<View className='box_background'> <View className='box_background'>
<Image className='full' src={require("@/img/full-scran.png")} onClick={full}></Image> <Image className='full' ref={buttonRef} src={require("@/img/full-scran.png")} onClick={full}></Image>
<View className='power'></View> <View className='power'></View>
{level.map((item) => ( {level.map((item) => (
<View className='line' key={item}> <View className='line' key={item}>

@ -1,5 +1,7 @@
import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; import { Block, View, Text, Image, Input, Button } from "@tarojs/components";
import { Component, PropsWithChildren, useEffect, useState } from "react"; import { Component, PropsWithChildren, useEffect, useState } from "react";
import { go } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
import "taro-ui/dist/style/components/button.scss"; // 按需引入 import "taro-ui/dist/style/components/button.scss"; // 按需引入
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
@ -12,7 +14,6 @@ import { setMobile } from "@/store/features/userInfo";
import Navbar from "@/components/navbar/navbar"; import Navbar from "@/components/navbar/navbar";
import Echarts from "./Echarts/index"; import Echarts from "./Echarts/index";
import "./moisture_test_report.less"; import "./moisture_test_report.less";
import { go } from "@/utils/traoAPI";
class MoistureTestReport extends Component<any, any> { class MoistureTestReport extends Component<any, any> {
constructor(props) { constructor(props) {
@ -34,6 +35,7 @@ class MoistureTestReport extends Component<any, any> {
rightFace: 0 rightFace: 0
} }
}, },
instrumentId: 0,
isClock: false, isClock: false,
xinde: '', xinde: '',
imglist: [], imglist: [],
@ -72,9 +74,19 @@ class MoistureTestReport extends Component<any, any> {
reportData.shuifenGear.rightFace = gear reportData.shuifenGear.rightFace = gear
} }
}) })
this.setState({ reportData, modeId: option.modeId }); this.setState({ reportData, modeId: option.modeId, instrumentId: option.id });
this.moistureTest()
} }
async initData() { } async initData() { }
async moistureTest() {
let data = {
queryDate: this.state.reportData.curDate,
instrumentId: this.state.instrumentId
}
let res = await InstrumentInfo.fr200.moistureTest(data);
}
toIndex() { toIndex() {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.reLaunch({ url: "/pages/index/index" });
} }
@ -83,7 +95,7 @@ class MoistureTestReport extends Component<any, any> {
} }
render() { 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, instrumentId } = this.state
const getStatusData = (level) => { const getStatusData = (level) => {
var bgCssData = { var bgCssData = {

@ -299,8 +299,8 @@ export default class Recording extends Component<any, any> {
setStorageSync("instrument_detail", instrument); setStorageSync("instrument_detail", instrument);
} }
}) })
if ([1,2,3,4,5].includes(item.jumpType)) { if ([1, 2, 3, 4, 5].includes(item.jumpType)) {
this.One(item); this.One(item);
} else if (item.jumpType === 0) { } else if (item.jumpType === 0) {
this.two(item); this.two(item);
@ -309,20 +309,20 @@ export default class Recording extends Component<any, any> {
} else { } else {
this.AllDevice(item); this.AllDevice(item);
} }
// let report =false // let report =false
// go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId+ "&report=" + report ); // go("/pages/face_report/face_report?id=" + id + "&recordId=" + recordId+ "&report=" + report );
} }
// 打开第一种类型 // 打开第一种类型
One = async (item) => { One = async (item) => {
let report = false; let report = false;
let nursingData=JSON.parse(item.nursingData) // let nursingData = JSON.parse(item.nursingData)
let obj ={ // let obj = {
modeName:item.modeName, // modeName: item.modeName,
data:nursingData // data: nursingData
} // }
console.log("打开第一种类型", item,obj); // console.log("打开第一种类型", item, obj);
go( go(
"/recoding/pages/face_report_one/face_report_one?id=" + "/recoding/pages/face_report_one/face_report_one?id=" +
item.id + item.id +
@ -344,7 +344,7 @@ export default class Recording extends Component<any, any> {
}; };
// 打开第三种类型 // 打开第三种类型
three = async (item) => { three = async (item) => {
go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}`); go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${item.nursingData}&date=${item.createTime}&modeId=${item.modeId}&id=${item.instrumentId}`);
}; };
// 打开其他类型 // 打开其他类型
AllDevice = async (item) => { AllDevice = async (item) => {

@ -437,6 +437,15 @@ export const InstrumentInfo = {
}); });
}, },
}, },
fr200:{
// 查询用户FR200水分报告护理记录
moistureTest: (data) => {
return Ajax({
url: "/nursingLog/record/fr200/moistureTest" + paramsToUrlQueryString(data),
method: "get",
});
},
}
}; };
//localhost:9204/instrument/getInstrumentInfoBySerial //localhost:9204/instrument/getInstrumentInfoBySerial

Loading…
Cancel
Save