qsj 2 years ago
commit c5cf3021f8

@ -63,6 +63,8 @@ import WaterTest from "./components/WaterTest/index";
/* 本页组件 END */ /* 本页组件 END */
import Echarts from "./components/Echart"; import Echarts from "./components/Echart";
import EchartsFullScean from "./components/EchartFullScean";
import Gears from "./components/Gears"; import Gears from "./components/Gears";
import "./FR200.less"; import "./FR200.less";
@ -231,9 +233,121 @@ class IotCarePlanFR200 extends Component<any, any> {
isShowHistoryMsg: false, // 是否显示正在同步历史 isShowHistoryMsg: false, // 是否显示正在同步历史
showEcharts: false, showEcharts: false,
echartsData: "", //传给echarts图表的数据 echartsData: "", //传给echarts图表的数据
series: [
{
data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4],
type: "line",
smooth: true,
z: 1,
areaStyle: {},
color: "red",
},
{
data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4],
type: "line",
smooth: true,
symbolSize: 10,
lineStyle: {
color: "#ff8410",
width: 1,
},
itemStyle: {
color: "#ff8410",
},
},
{
name: "a",
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: "bar",
barWidth: 22,
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#ffcf56",
},
},
{
name: "b",
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#febb22",
},
},
{
name: "c",
data: [0, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#ffac28",
},
},
{
name: "d",
data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 1],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#ff8410",
},
},
{
name: "e",
data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#f85804",
},
},
{
name: "f",
data: [0, 0, 0, 0, 0, 1, 1, 0, 1, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#e02e14",
},
},
{
name: "h",
data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#b30016",
},
},
{
name: "i",
data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#750010",
},
},
],
}; };
} }
isFullScreen: boolean = false;
// 不涉及渲染的页面变量 // 不涉及渲染的页面变量
isRuning: any = true; // 设备默认运行中fr200贴脸就会自动开始工作 isRuning: any = true; // 设备默认运行中fr200贴脸就会自动开始工作
jsonStatus: any = {}; // 同步设备返回数据,用于结束 jsonStatus: any = {}; // 同步设备返回数据,用于结束
@ -339,43 +453,6 @@ class IotCarePlanFR200 extends Component<any, any> {
} }
} }
getOption() {
const option = {
grid: { top: 8, right: 8, bottom: 24, left: 36 },
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
},
yAxis: {
type: "value",
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
smooth: true,
},
],
tooltip: {
trigger: "axis",
},
// title: {
// text: 'ECharts 示例'
// },
// tooltip: {},
// xAxis: {
// data: ['A', 'B', 'C', 'D', 'E']
// },
// yAxis: {},
// series: [{
// name: '数量',
// type: 'bar',
// data: [5, 20, 36, 10, 10]
// }]
};
return option;
}
async init() { async init() {
// 查询离线记录汇总 // 查询离线记录汇总
const queryInstructionParams = { const queryInstructionParams = {
@ -731,8 +808,6 @@ class IotCarePlanFR200 extends Component<any, any> {
let gears: any = []; let gears: any = [];
let eDate: any = []; let eDate: any = [];
echartsData?.map((item) => { echartsData?.map((item) => {
console.log(item, "查看数据");
const result = item.createTime.split(" ")[0].substring(5); const result = item.createTime.split(" ")[0].substring(5);
eDate.push(result); eDate.push(result);
item.nursingData = JSON.parse(item.nursingData); item.nursingData = JSON.parse(item.nursingData);
@ -769,28 +844,52 @@ class IotCarePlanFR200 extends Component<any, any> {
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试"); this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
}); });
}; };
look() { updata() {
let that = this; let that = this;
// this.setState({ showEcharts: !this.state.showEcharts });
let stop = 0; let stop = 0;
let time = setInterval(function () { let time = setInterval(function () {
stop++; stop++;
let random = Math.random(); let series = JSON.parse(JSON.stringify(that.state.series));
that.setState({ echartsData: random }); let num = Math.floor(Math.random() * 9);
let count = 0;
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);
}
}
});
// 更新图表数据
that.setState({ series });
if (stop >= 20) { if (stop >= 20) {
clearInterval(time); clearInterval(time);
} }
}, 1000); }, 1000);
} }
updata() {}
// 绘制能量图 full() {
drawProwerPicture() {} this.setState({ isFullScreen: !this.state.isFullScreen });
}
/** 切换光照 */ /** 切换光照 */
onSwitchChange = async () => { onSwitchChange = async () => {
// todo let { isStopNurse, ActiveModeItem } = this.state;
let { isStopNurse } = this.state;
console.log("切换光照,", ActiveModeItem);
if (ActiveModeItem.modeType === "led") {
this.onSwitchChangeLED();
return;
}
if (isStopNurse) { if (isStopNurse) {
// 开始光照逻辑 // 开始光照逻辑
this.onNursingTap(); this.onNursingTap();
@ -804,6 +903,37 @@ class IotCarePlanFR200 extends Component<any, any> {
isStopNurse: !isStopNurse, isStopNurse: !isStopNurse,
}); });
}; };
/** LED切换模式 */
onSwitchChangeLED = () => {
let { isStopNurse } = this.state;
if (isStopNurse) {
// 开始光照逻辑
this.onNursingTap();
this.switchVideoPlay(); // 开始
} else {
// 暂停光照逻辑
let sendParams: any = {
...deviceCommandSamples.pause,
workMode: "led", // 使用模式
workStatus: "standby",
};
const pauseArrayBuffer = deviceToolKitInstance.toBleCommand(
sendParams as any
);
sendCommand({
value: pauseArrayBuffer,
}).then(() => {
this.workStatus = "pause";
this.resetTimer();
console.info(`发送暂停指令成功 参数为 =>`, sendParams);
});
// this.handleWorkStatus(false, MODE_WORKING_ENUM.PAUSE);
this.switchVideoPause(); // 暂停
}
this.setState({
isStopNurse: !isStopNurse,
});
};
/** /**
* @name * @name
@ -1642,7 +1772,6 @@ class IotCarePlanFR200 extends Component<any, any> {
workMode: ActiveModeItem.modeType, // 使用模式 workMode: ActiveModeItem.modeType, // 使用模式
workStatus: newWorkStatus, workStatus: newWorkStatus,
}; };
console.log(ActiveModeItem, "查看工作状态");
// 水分测试需要特殊处理 // 水分测试需要特殊处理
// 水分测试准备 水分测试工作 水分测试启动 // 水分测试准备 水分测试工作 水分测试启动
@ -1997,6 +2126,8 @@ class IotCarePlanFR200 extends Component<any, any> {
params.workMode = jsonStatus?.workMode; params.workMode = jsonStatus?.workMode;
params.modeId = this.state.ActiveModeItem.id; params.modeId = this.state.ActiveModeItem.id;
params.modeName = this.state.ActiveModeItem.modeName; params.modeName = this.state.ActiveModeItem.modeName;
console.log(jsonStatus, 555555555555);
} }
} else { } else {
params.jsonStatus = jsonStatus; params.jsonStatus = jsonStatus;
@ -2497,6 +2628,8 @@ class IotCarePlanFR200 extends Component<any, any> {
echartsData, echartsData,
isShowReReadRecordConnect, isShowReReadRecordConnect,
currentServiceData, currentServiceData,
series,
isFullScreen,
} = this.state; } = this.state;
return ( return (
@ -2507,249 +2640,324 @@ class IotCarePlanFR200 extends Component<any, any> {
isCustomBack isCustomBack
customBack={this.customBack} customBack={this.customBack}
/> />
{!isFullScreen && (
<View>
<View catchMove>
<PopupAlert
isShow={isModeLock}
zIndex={10020}
myClassName="level-up"
title="提示"
content="该模式即将上线,敬请期待"
confirmButtonText="我知道了"
textAlgin="center"
close={this.onModeLockClose}
confirm={this.onModeLockClose}
/>
<PopupInstrumentUploadTips
isShow={isFirstTipShow}
zIndex={10020}
myClassName="level-up"
title="打卡介绍"
data={nurseInfo}
close={this.onTipShowClose}
confirm={this.onTipShowClose}
/>
<View catchMove> <PopupCountdown isShow={isShowCountdown} countdown={countdown} />
<PopupAlert
isShow={isModeLock} <PopupConfirm
zIndex={10020} isLarge
myClassName="level-up" isClose
title="提示" isShow={isEndCarePlan}
content="该模式即将上线,敬请期待" title="提示"
confirmButtonText="我知道了" content="是否结束护理"
textAlgin="center" textAlgin="center"
close={this.onModeLockClose} cancelButtonText="取消"
confirm={this.onModeLockClose} confirmButtonText="确定"
/> close={this.cancelEndBtn}
<PopupInstrumentUploadTips confirm={this.confirmEndBtn}
isShow={isFirstTipShow}
zIndex={10020}
myClassName="level-up"
title="打卡介绍"
data={nurseInfo}
close={this.onTipShowClose}
confirm={this.onTipShowClose}
/>
<PopupCountdown isShow={isShowCountdown} countdown={countdown} />
<PopupConfirm
isLarge
isClose
isShow={isEndCarePlan}
title="提示"
content="是否结束护理"
textAlgin="center"
cancelButtonText="取消"
confirmButtonText="确定"
close={this.cancelEndBtn}
confirm={this.confirmEndBtn}
/>
<PopupConfirm
isLarge
isClose
isShow={isSwitchActiveMode}
title="护理模式切换"
content={
<ModeListView
ModeID={ModeID}
activeModeID={activeModeID}
isPop
isShowNurse={isShowNurse}
ModeList={ModeList}
ModeType={ModeType}
onEmit={this.switchModeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/> />
} <PopupConfirm
textAlgin="center" isLarge
cancelButtonText="取消" isClose
confirmButtonText="确定" isShow={isSwitchActiveMode}
close={this.cancelModeSwitchBtn} title="护理模式切换"
confirm={this.confirmModeSwitchBtn} content={
/> <ModeListView
ModeID={ModeID}
{ActiveModeItem.openSourceData.length > 0 && ( activeModeID={activeModeID}
<PopupStepTips isPop
isShow={isShowStepTips} isShowNurse={isShowNurse}
isLarge ModeList={ModeList}
isFirstEntry={false} ModeType={ModeType}
confirmButtonText="知道了" onEmit={this.switchModeCurrentFun}
data={ActiveModeItem.openSourceData} onEmitShowAll={this.openModeSwitch}
close={this.closeStepTips} onModeLockOpen={this.onModeLockOpen}
/> />
)} }
textAlgin="center"
<PopupAlert cancelButtonText="取消"
isShow={isNotEnoughTime} confirmButtonText="确定"
isClose close={this.cancelModeSwitchBtn}
title="提示" confirm={this.confirmModeSwitchBtn}
content="您的本次护理时间不足,请重新护理" />
confirmButtonText="确认"
textAlgin="center" <Popup
close={this.closeNotEnoughTime} show={isShowHistoryMsg}
confirm={this.closeNotEnoughTime} className="custom-popup"
/> overlay={false}
>
<PopupAlert <View className="sync-history-msg">...</View>
isShow={isShowErrorTipsText} </Popup>
isClose </View>
zIndex={10020}
myClassName="level-up" <View>
title="提示" <View className="iot-main">
content={errorTipsText} <View className="banner-box">
confirmButtonText="知道了" <View>
textAlgin="center" <Video
close={this.closeErrorTipsText} className="video-or-image"
confirm={this.closeErrorTipsText} src={currentVideoSrc}
/> loop
id="myVideo"
<PopupConfirm objectFit="cover"
isShow={isShowTipsSave} enablePlayGesture
isClose showFullscreenBtn={false}
zIndex={10020} onLoadedMetaData={this.GetVideosTime}
myClassName="level-up" />
title="提示"
content={ {errorTips && (
<Block> <Block>
<View></View> <View className="msg-tips">
<View></View> <Image
</Block> className="msg-tips-img"
} src={require("@/img/tips.png")}
cancelButtonText="取消" />
confirmButtonText="确认" <View className="msg-tips-content">{errorTips}</View>
textAlgin="center" </View>
close={this.closeTipsSave} </Block>
cancel={this.cancelTipsSave} )}
confirm={this.confirmTipsSave} </View>
/>
<PopupStatus
isShow={isShowNursingSuccess}
isClose
title="您已结束本次护理"
type="success"
content="正在上传护理记录……"
confirmButtonText="知道了"
textAlgin="center"
close={() => {
/*不需要做处理*/
}}
/>
{isConnectShow && (
<ConnectionBluetoot
deviceInfo={currentDevice}
close={this.connectionClose}
isDisconnect={!isConnectionBlutoot}
offlineChange={() => {}}
pairingChange={this.pairingChange}
upgradeFun={() => {}}
/>
)}
<Popup
show={isShowHistoryMsg}
className="custom-popup"
overlay={false}
>
<View className="sync-history-msg">...</View>
</Popup>
</View>
<View>
<View className="iot-main">
<View className="banner-box">
<View>
<Video
className="video-or-image"
src={currentVideoSrc}
loop
id="myVideo"
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
{errorTips && ( {ActiveModeItem.modeType !== "moistureTest" && (
<Block> <View className="fr200-iot-device">
<View className="msg-tips"> <View className="item">
<Image <Text className="device-time">
className="msg-tips-img" <Text className="time">{currentTime}</Text>
src={require("@/img/tips.png")} </Text>
</View>
<View className="line" />
<View className="item">
<Text className="gear">
{ActiveModeItem.modeType === "led"
? "-"
: currentGear}
</Text>
</View>
<View className="line" />
<ElectricityView
Electricity={Electricity}
DeviceConnectStatus={DeviceConnectStatus}
/> />
<View className="msg-tips-content">{errorTips}</View>
</View> </View>
</Block> )}
</View>
{ModeList.length > 0 && (
<ModeListView
isPop={false}
isShowNurse={isShowNurse}
ModeList={ModeList}
ModeType={ModeType}
ModeID={ModeID}
activeModeID={activeModeID}
onEmit={this.modeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/>
)} )}
</View> {/* <button onClick={this.look.bind(this)}>echarts </button>
<button onClick={this.updata.bind(this)}> </button> */}
{ActiveModeItem.modeType !== "moistureTest" && ( <PopupAlert
<View className="fr200-iot-device"> isShow={isNotEnoughTime}
<View className="item"> isClose
<Text className="device-time"> title="提示"
<Text className="time">{currentTime}</Text> content="您的本次护理时间不足,请重新护理"
</Text> confirmButtonText="确认"
</View> textAlgin="center"
<View className="line" /> close={this.closeNotEnoughTime}
<View className="item"> confirm={this.closeNotEnoughTime}
/>
<Text className="gear">
{ActiveModeItem.modeType === "led" ? "-" : currentGear} <PopupAlert
</Text> isShow={isShowErrorTipsText}
isClose
</View> zIndex={10020}
<View className="line" /> myClassName="level-up"
<ElectricityView title="提示"
Electricity={Electricity} content={errorTipsText}
DeviceConnectStatus={DeviceConnectStatus} confirmButtonText="知道了"
textAlgin="center"
close={this.closeErrorTipsText}
confirm={this.closeErrorTipsText}
/>
<PopupConfirm
isShow={isShowTipsSave}
isClose
zIndex={10020}
myClassName="level-up"
title="提示"
content={
<Block>
<View></View>
<View></View>
</Block>
}
cancelButtonText="取消"
confirmButtonText="确认"
textAlgin="center"
close={this.closeTipsSave}
cancel={this.cancelTipsSave}
confirm={this.confirmTipsSave}
/>
<PopupStatus
isShow={isShowNursingSuccess}
isClose
title="您已结束本次护理"
type="success"
content="正在上传护理记录……"
confirmButtonText="知道了"
textAlgin="center"
close={() => {
/*不需要做处理*/
}}
/>
{isConnectShow && (
<ConnectionBluetoot
deviceInfo={currentDevice}
close={this.connectionClose}
isDisconnect={!isConnectionBlutoot}
offlineChange={() => {}}
pairingChange={this.pairingChange}
upgradeFun={() => {}}
/> />
</View> )}
)}
</View>
{ModeList.length > 0 && ( <Popup
<ModeListView show={isShowHistoryMsg}
isPop={false} className="custom-popup"
isShowNurse={isShowNurse} overlay={false}
ModeList={ModeList} >
ModeType={ModeType} <View className="sync-history-msg">...</View>
ModeID={ModeID} </Popup>
activeModeID={activeModeID} </View>
onEmit={this.modeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/>
)}
{/* <button onClick={this.look.bind(this)}>echarts </button>
<button onClick={this.updata.bind(this)}> </button> */}
<View className={classnames({ show: showEcharts })}> <View>
<Echarts data={echartsData}></Echarts> <View className="iot-main">
</View> <View className="banner-box">
{/* {(ActiveModeItem.modeType === "face" || <View>
<Video
className="video-or-image"
src={currentVideoSrc}
loop
id="myVideo"
objectFit="cover"
enablePlayGesture
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
{/* <button onClick={this.executePromises}>点击按钮</button> */}
{errorTips && (
<Block>
<View className="msg-tips">
<Image
className="msg-tips-img"
src={require("@/img/tips.png")}
/>
<View className="msg-tips-content">
{errorTips}
</View>
</View>
</Block>
)}
</View>
<View className="fr200-iot-device">
<View className="item">
<Text className="device-time">
<Text className="time">{currentTime}</Text>
</Text>
</View>
<View className="line" />
<View className="item">
<Text className="gear">{currentGear}</Text>
</View>
<View className="line" />
<ElectricityView
Electricity={Electricity}
DeviceConnectStatus={DeviceConnectStatus}
/>
</View>
</View>
{ModeList.length > 0 && (
<ModeListView
isPop={false}
isShowNurse={isShowNurse}
ModeList={ModeList}
ModeType={ModeType}
ModeID={ModeID}
activeModeID={activeModeID}
onEmit={this.modeCurrentFun}
onEmitShowAll={this.openModeSwitch}
onModeLockOpen={this.onModeLockOpen}
/>
)}
<button onClick={this.updata.bind(this)}>
{" "}
</button>
{/* <button onClick={this.updata.bind(this)}>添加数据 </button> */}
<View className={classnames({ show: showEcharts })}>
<Echarts
series={series}
full={this.full.bind(this)}
></Echarts>
<EchartsFullScean
series={series}
full={this.full}
></EchartsFullScean>
</View>
{/* {(ActiveModeItem.modeType === "face" ||
ActiveModeItem.modeType === "eyes") && <Echarts></Echarts>} */} ActiveModeItem.modeType === "eyes") && <Echarts></Echarts>} */}
{(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
isRuningTest={isRuningTest} isRuningTest={isRuningTest}
stepList={waterStepList} stepList={waterStepList}
stepIndex={waterStepIndex} stepIndex={waterStepIndex}
></WaterTest> ></WaterTest>
)} )}
</View> </View>
<Footer {/* <Footer
currentWorkModeType={currentWorkModeType} currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest} isRuningTest={isRuningTest}
isStopNurse={isStopNurse} isStopNurse={isStopNurse}
@ -2757,8 +2965,21 @@ class IotCarePlanFR200 extends Component<any, any> {
onEmitSwitchChange={this.onSwitchChange} onEmitSwitchChange={this.onSwitchChange}
onEmitEndPlan={this.onEndPlan} onEmitEndPlan={this.onEndPlan}
onsuccess={this.onsuccess} onsuccess={this.onsuccess}
/> /> */}
</View> </View>
</View>
</View>
)}
{isFullScreen && (
<View>
<button onClick={this.updata.bind(this)}> </button>
<EchartsFullScean
series={series}
full={this.full}
></EchartsFullScean>
</View>
)}
</Block> </Block>
); );
} }

@ -9,13 +9,13 @@ import echarts from "@/utils/echarts.min.js";
import "./index.less"; import "./index.less";
interface Props { interface Props {
data: any series: any,
full:any
} }
function Index({ data }: Props) { function Index({ series ,full}: Props) {
const buttonRef = useRef(null);
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
const [options, setOptions] = useState({ const [options, setOptions] = useState({
animation: false, animation: false,
@ -145,205 +145,33 @@ function Index({ data }: Props) {
color: "#ff8410", color: "#ff8410",
}, },
}, },
series: [ series: []
{
data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4],
type: "line",
smooth: true,
z: 1,
areaStyle: {},
color: "red",
},
{
data: [2, 3, 5, 3, 5, 6, 8, 5, 6, 4],
type: "line",
smooth: true,
symbolSize: 5,
lineStyle: {
color: "#ff8410",
width: 1,
},
itemStyle: {
color: "#ff8410",
},
},
{
name: "a",
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: "bar",
barWidth: 12,
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#ffcf56",
},
},
{
name: "b",
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#febb22",
},
},
{
name: "c",
data: [0, 1, 1, 1, 1, 1, 1, 1, 1, 1],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#ffac28",
},
},
{
name: "d",
data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 1],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#ff8410",
},
},
{
name: "e",
data: [0, 0, 1, 0, 1, 1, 1, 1, 1, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#f85804",
},
},
{
name: "f",
data: [0, 0, 0, 0, 0, 1, 1, 0, 1, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#e02e14",
},
},
{
name: "h",
data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#b30016",
},
},
{
name: "i",
data: [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],
type: "bar",
z: 2,
stack: "x",
visualMap: false,
itemStyle: {
color: "#750010",
},
},
],
}) })
const level = [8, 7, 6, 5, 4, 3, 2]; const level = [8, 7, 6, 5, 4, 3, 2];
const [newOptions, setNewOptions] = useState(options) const [newOptions, setNewOptions] = useState(options)
const [newData, setNewData] = useState(0)
const full = useCallback(() => {
// let box = document.getElementById("box");
// box?.classList.add('fullscreen')
const updata = useCallback((res) => {
let stop = 0
// let time = setInterval(function () {
// stop++
let option = JSON.parse(JSON.stringify(options)) let option = JSON.parse(JSON.stringify(options))
let num = Math.floor(Math.random() * 9) option.series = JSON.parse(JSON.stringify(res))
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) setNewOptions(option)
// if (stop > 20) { }, [])
// clearInterval(time)
// } const cancelFull = useCallback((res) => {
// }, 1000) full()
}, [])
}, [data])
useEffect(() => { useEffect(() => {
setOptions(newOptions) setOptions(newOptions)
}, [newOptions]); }, [newOptions]);
useEffect(() => {
setNewData(data)
}, [data]);
useEffect(() => { useEffect(() => {
let option = JSON.parse(JSON.stringify(options)) updata(series)
let num = Math.floor(newData * 9) }, [series])
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 = () => {
// T.setPageOrientation({
// orientation: "portrait",
// });
// // taro.setPageOrientation({
// // orientation: "landscape",
// // });
// },
return ( return (
@ -359,7 +187,7 @@ function Index({ data }: Props) {
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' ref={buttonRef} src={require("@/img/full-scran.png")} onClick={full}></Image> <Image className='full' src={require("@/img/full-scran.png")} onClick={cancelFull}></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}>

@ -0,0 +1,106 @@
.box_full {
width: 690rpx;
height: 83vh;
margin: 28rpx auto 150rpx;
background-color: #fff;
border-radius: 30rpx;
padding: 35rpx 25rpx 25rpx 35rpx;
box-sizing: border-box;
position: relative;
// writing-mode: vertical-lr;
// text-orientation: upright;
// white-space: nowrap;
// font-size: 18px;
// font-weight: bold;
// background-color: #c2e5f3;
// color: #fff;
// width: 100%;
}
.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_background1 {
position: absolute;
top: 330rpx;
left: -326rpx;
width: 83vh;
height: 690rpx;
border-radius: 30rpx;
background-color: rgba(0, 0, 0, 0);
transform: rotate(90deg);
.power {
margin: 56rpx 0 103rpx 38rpx;
font-family: PingFang-SC;
font-weight: 500;
font-size: 36rpx;
color: #cccccc;
}
.part {
width: 48rpx;
height: 48rpx;
position: absolute;
top: 37rpx;
right: 37rpx;
z-index: 100;
transform: rotate(90deg);
}
.line {
margin: 0 30rpx 0 52rpx;
font-family: PingFang-SC;
font-size: 28rpx;
color: #cccccc;
display: flex;
position: relative;
height: 47rpx;
.bottom_line {
// border-bottom: 1rpx #ccc dashed;
width: 550rpx;
margin-left: 20rpx;
position: absolute;
bottom: -6rpx;
right: 74rpx;
height: 4rpx;
color: #fff;
}
}
.time {
position: absolute;
bottom: 62rpx;
right: 44rpx;
font-family: PingFang-SC;
font-size: 36rpx;
color: #cccccc;
}
}
page {
background: #f8f8f8;
background: #f3f3f3;
}

@ -0,0 +1,212 @@
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 { useEffect, useRef, useState, useCallback } from "react";
import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
import echarts from "@/utils/echarts.min.js";
import "./index.less";
interface Props {
series: any,
full: any
}
function Index({ series, full }: Props) {
const echartsRef = useRef<EchartsHandle>(null);
const [options, setOptions] = useState({
animation: false,
grid: {
// 让图表占满容器
// containLabel: true,
top: "32rpx",
left: "48rpx",
right: "86rpx",
bottom: "68rpx",
},
// legend: {
// itemStyle: {
// decal: {
// rotation: 90
// }
// }
// },
yAxis: {
// name: '',
// nameGap: 5,
// nameTextStyle: {
// color: '#e4e4e4',
// fontSize:7
// },
type: "category",
inverse: true,
axisLine: {
//坐标轴轴线相关设置。数学上的x轴
show: true,
lineStyle: {
color: "#cccccc",
},
},
axisLabel: {
//坐标轴刻度标签的相关设置
color: "#cccccc",
fontSize: 14,
rotate: -90,
margin: 18
},
axisTick: {
show: false,
},
data: [
"00:01",
"00:02",
"00:03",
"00:04",
"00:05",
"00:06",
"00:07",
"00:08",
"00:09",
"00:10",
],
},
xAxis: {
type: "value",
min: 0,
max: 8,
splitNumber: 8,
splitLine: {
show: true,
lineStyle: {
color: "#cccccc",
type: [4, 2],
dashOffset: 4,
},
},
axisLine: {
show: false,
},
axisLabel: {
show: false,
},
axisTick: {
show: false,
},
},
visualMap: {
z: 1,
top: 0,
right: 0,
seriesIndex: 0,
show: false,
dimension: 0,
pieces: [
{
gt: 0,
lte: 1,
color: "#fff8c9",
},
{
gt: 1,
lte: 2,
color: "#fff0c6",
},
{
gt: 2,
lte: 3,
color: "#ffe5c3",
},
{
gt: 3,
lte: 4,
color: "#ffdbbf",
},
{
gt: 4,
lte: 5,
color: "#ffcfbb",
},
{
gt: 5,
lte: 6,
color: "#ffbab5",
},
{
gt: 6,
lte: 7,
color: "#ffb4b3",
},
{
gt: 7,
lte: 8,
color: "#ffb4b3",
},
],
outOfRange: {
color: "#ff8410",
},
},
series: []
})
const level = [8, 7, 6, 5, 4, 3, 2];
const [newOptions, setNewOptions] = useState(options)
const updata = useCallback((res) => {
let option = JSON.parse(JSON.stringify(options))
option.series = JSON.parse(JSON.stringify(res))
// 更新图表数据
setNewOptions(option)
}, [])
const cancelFull = useCallback((res) => {
console.log(1111);
full()
}, [])
useEffect(() => {
setOptions(newOptions)
}, [newOptions]);
useEffect(() => {
updata(series)
}, [series])
return (
<Block>
<View id='box' className='box_full'>
<Echarts
force-use-old-canvas='false'
echarts={echarts}
option={options}
ref={echartsRef}
// isPage={false}
// style自定义设置echarts宽高
style={{ width: "620rpx", height: "80vh", zIndex: 1 }}
/>
<View className='box_background1'>
<Image className='part' src={require("@/img/part-scran.png")} onClick={cancelFull}></Image>
<View className='power'></View>
{level.map((item) => (
<View className='line' key={item}>
<View className='number'>{item}</View>
<View className='bottom_line'></View>
</View>
))}
<View className='line'>
<View className='number'>1</View>
</View>
<View className='time'></View>
</View>
</View>
</Block >
);
}
export default Index;

@ -7,44 +7,44 @@ import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
// import echarts from "@/utils/echarts.min.js"; // import echarts from "@/utils/echarts.min.js";
import * as echarts from "echarts"; import * as echarts from "echarts";
import React, { useState, useEffect,useMemo } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import "./index.less"; import "./index.less";
interface Props { interface Props {
EchartsData:any EchartsData: any
} }
function Index({ function Index({
EchartsData EchartsData
}:Props) { }: Props) {
let type =0 let type = 0
// console.log(EchartsData,'EchartsDataEchartsData'); // console.log(EchartsData,'EchartsDataEchartsData');
switch(EchartsData.modeName) { switch (EchartsData.modeName) {
case '基础班脸部': case '基础班脸部':
type=37 type = 37
break; break;
case '基础版眼部': case '基础版眼部':
type=25 type = 25
break; break;
case '法令纹Pro': case '法令纹Pro':
type=25 type = 25
break; break;
case '下颌线Pro': case '下颌线Pro':
type=19 type = 19
break; break;
case '抬头纹Pro': case '抬头纹Pro':
type=13 type = 13
break; break;
default: default:
} }
const echartsRef = useRef<EchartsHandle>(null); const echartsRef = useRef<EchartsHandle>(null);
function generateColorArray(startColor, endColor, steps) { function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor); var startRGB = hexToRgb(startColor);
var endRGB = hexToRgb(endColor); var endRGB = hexToRgb(endColor);
@ -81,33 +81,33 @@ function Index({
const steps = 81; // 80个颜色 const steps = 81; // 80个颜色
const colors = generateColorArray(startColor, endColor, steps); const colors = generateColorArray(startColor, endColor, steps);
// const xList = [...new Array(type).fill(0).map((item, key) => key)]; // const xList = [...new Array(type).fill(0).map((item, key) => key)];
let seriesData:any =[] let seriesData: any = []
seriesData = EchartsData?.data?.groupedAa seriesData = EchartsData?.data?.groupedAa
const xList = [...new Array(type).fill(0).map((item, key) => key)]; const xList = [...new Array(type).fill(0).map((item, key) => key)];
// const seriesData = [ // const seriesData = [
// ...xList.map((item) => { // ...xList.map((item) => {
// return Math.random() * 80; // return Math.random() * 80;
// }), // }),
// ]; // ];
const option: EChartOption = { const option: EChartOption = {
grid: { grid: {
// 让图表占满容器 // 让图表占满容器
top: "10rpx", top: "10rpx",
left: "45rpx", left: "45rpx",
right: "28rpx", right: "28rpx",
bottom: "17rpx", bottom: "17rpx",
}, },
xAxis: { xAxis: {
type: "category", type: "category",
data: [...xList], data: [...xList],
axisLabel: { axisLabel: {
interval: 5, interval: 5,
formatter: function (value, index) { formatter: function (value, index) {
return value * 10 + 's'; return value * 10 + 's';
}, },
textStyle: { textStyle: {
color: '#999999', // 文字颜色 color: '#999999', // 文字颜色
fontSize: 8 // 文字大小 fontSize: 8 // 文字大小
}, },
@ -173,90 +173,90 @@ const option: EChartOption = {
}, },
], ],
} }
// 基于 EchartsData 生成 ECharts 配置
// const option: EChartOption ={
// grid: {
// // 让图表占满容器
// top: "10rpx",
// left: "45rpx",
// right: "28rpx",
// bottom: "17rpx",
// },
// xAxis: {
// type: "category",
// data: [...xList],
// axisLabel: {
// interval: 5,
// formatter: function (value, index) {
// return value * 10 + 's';
// },
// textStyle: {
// color: '#999999', // 文字颜色
// fontSize: 8 // 文字大小
// },
// },
// axisTick: {
// // alignWithLabel: true,
// show: false,
// interval: 9,
// },
// // axisLine: {
// // show: false,
// // },
// },
// yAxis: [
// {
// min: 0,
// max: 80,
// splitNumber: 10,
// axisLabel: {
// formatter: function (value, index) {
// const num = value / 10 + 1
// return num === 9 ? '' : num + '级';
// },
// textStyle: {
// color: '#999999', // 文字颜色
// fontSize: 8 // 文字大小
// },
// },
// type: "value",
// splitLine: {
// lineStyle: {
// color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"],
// type: 'dashed'
// },
// }
// },
// ],
// series: [
// { // 基于 EchartsData 生成 ECharts 配置
// barCategoryGap: '0%', // const option: EChartOption ={
// data: seriesData, // grid: {
// type: "bar", // // 让图表占满容器
// // barWidth: 15, // top: "10rpx",
// gapWidth: "0%", // left: "45rpx",
// itemStyle: { // right: "28rpx",
// normal: { // bottom: "17rpx",
// color: function (params) { // },
// var value = params.data; // xAxis: {
// return new echarts.graphic.LinearGradient(0, 0, 0, 1, [ // type: "category",
// { // data: [...xList],
// offset: 0, // axisLabel: {
// color: colors[parseInt(value)], // 红色 // interval: 5,
// }, // formatter: function (value, index) {
// { // return value * 10 + 's';
// offset: 1, // },
// color: colors[0], // 黄色 // textStyle: {
// }, // color: '#999999', // 文字颜色
// ]);; // fontSize: 8 // 文字大小
// }, // },
// }, // },
// }, // axisTick: {
// }, // // alignWithLabel: true,
// ], // show: false,
// }; // interval: 9,
// },
// // axisLine: {
// // show: false,
// // },
// },
// yAxis: [
// {
// min: 0,
// max: 80,
// splitNumber: 10,
// axisLabel: {
// formatter: function (value, index) {
// const num = value / 10 + 1
// return num === 9 ? '' : num + '级';
// },
// textStyle: {
// color: '#999999', // 文字颜色
// fontSize: 8 // 文字大小
// },
// },
// type: "value",
// splitLine: {
// lineStyle: {
// color: ["#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#ccc", "#fff"],
// type: 'dashed'
// },
// }
// },
// ],
// series: [
// {
// barCategoryGap: '0%',
// data: seriesData,
// type: "bar",
// // barWidth: 15,
// gapWidth: "0%",
// itemStyle: {
// normal: {
// color: function (params) {
// var value = params.data;
// return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: colors[parseInt(value)], // 红色
// },
// {
// offset: 1,
// color: colors[0], // 黄色
// },
// ]);;
// },
// },
// },
// },
// ],
// };
return ( return (

@ -31,7 +31,6 @@ function Index({
let PermeationList = ModeList.filter((item) => item.modeClass === 3); // 专研促渗 let PermeationList = ModeList.filter((item) => item.modeClass === 3); // 专研促渗
let SensitiveList = ModeList.filter((item) => item.modeClass === 4); // 敏感期护理 let SensitiveList = ModeList.filter((item) => item.modeClass === 4); // 敏感期护理
let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤 let IntelligenceList = ModeList.filter((item) => item.modeClass === 5); // 智能测肤
console.log(activeModeID, "查看id", BaseList, ModeList);
const onItemClick = (item) => { const onItemClick = (item) => {
if (item.lock) { if (item.lock) {
onModeLockOpen(); // 点击了锁定模式 onModeLockOpen(); // 点击了锁定模式

@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "水分测试",
enablePageMeta: true,
});

@ -1,4 +1,12 @@
import { Block, View, Text, Image, Input, Button } from "@tarojs/components"; import {
Block,
View,
Text,
Image,
Input,
Button,
PageMeta,
} from "@tarojs/components";
import { Component, PropsWithChildren, useEffect, useState } from "react"; import { Component, PropsWithChildren, useEffect, useState } from "react";
import { go } from "@/utils/traoAPI"; import { go } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface"; import { InstrumentInfo } from "@/utils/Interface";
@ -21,94 +29,110 @@ class MoistureTestReport extends Component<any, any> {
super(props); super(props);
this.state = { this.state = {
name: "重新登录", name: "重新登录",
imgUrl: '', imgUrl: "",
reportShow: true, reportShow: true,
reportData: { reportData: {
curDate: '', curDate: "",
shuifenLevel: { shuifenLevel: {
head: 2, head: 2,
leftFace: 3, leftFace: 3,
rightFace: 7 rightFace: 7,
}, },
shuifenList: [], shuifenList: [],
shuifenGear: { shuifenGear: {
head: 0, head: 0,
leftFace: 0, leftFace: 0,
rightFace: 0 rightFace: 0,
} },
}, },
isClock: false, isClock: false,
xinde: '', xinde: "",
imglist: [], imglist: [],
id: 0, id: 0,
show: false, show: false,
modeId: 0, modeId: 0,
echartsData: {}, echartsData: {},
showEcharts: false showEcharts: false,
}; };
} }
componentDidMount() {}
componentDidMount() { } componentWillUnmount() {}
componentWillUnmount() { }
componentDidShow() { } componentDidShow() {}
componentDidHide() { } componentDidHide() {}
onLoad(option) { onLoad(option) {
console.log(option); console.log(option);
let Bool = JSON.parse(option?.report) let Bool = JSON.parse(option?.report);
if (!Bool) { if (!Bool) {
this.setState({ this.setState({
reportShow: Bool reportShow: Bool,
}) });
} }
let data = JSON.parse(option.data) let data = JSON.parse(option.data);
let { reportData } = this.state let { reportData } = this.state;
reportData.curDate = option.date reportData.curDate = option.date;
reportData.curDate = option.report reportData.curDate = option.report;
data.GearData.map(item => { data.GearData.map((item) => {
if (item.name == '额头') { if (item.name == "额头") {
reportData.shuifenLevel.head = item.forehead reportData.shuifenLevel.head = item.forehead;
let gear = Math.ceil((11 - reportData.shuifenLevel.head) / 2) let gear = Math.ceil((11 - reportData.shuifenLevel.head) / 2);
reportData.shuifenGear.head = gear reportData.shuifenGear.head = gear;
} else if (item.name == "左脸颊") {
} else if (item.name == '左脸颊') { reportData.shuifenLevel.leftFace = item.forehead;
reportData.shuifenLevel.leftFace = item.forehead let gear = Math.ceil((11 - reportData.shuifenLevel.leftFace) / 2);
let gear = Math.ceil((11 - reportData.shuifenLevel.leftFace) / 2) reportData.shuifenGear.leftFace = gear;
reportData.shuifenGear.leftFace = gear } else if (item.name == "右脸颊") {
} else if (item.name == '右脸颊') { reportData.shuifenLevel.rightFace = item.forehead;
reportData.shuifenLevel.rightFace = item.forehead let gear = Math.ceil((11 - reportData.shuifenLevel.rightFace) / 2);
let gear = Math.ceil((11 - reportData.shuifenLevel.rightFace) / 2) reportData.shuifenGear.rightFace = gear;
reportData.shuifenGear.rightFace = gear
} }
}) });
this.setState({ reportData, modeId: option.modeId, echartsData: JSON.parse(option.echartsData) }); this.setState({
reportData,
modeId: option.modeId,
echartsData: JSON.parse(option.echartsData),
});
// this.moistureTest(option.id, reportData.curDate) // this.moistureTest(option.id, reportData.curDate)
} }
async initData() { } async initData() {}
toIndex() { toIndex() {
Taro.reLaunch({ url: "/pages/index/index" }); Taro.reLaunch({ url: "/pages/index/index" });
} }
toNursing() { toNursing() {
go(`/moduleIOT/pages/iotCarePlan/FR200?modeId=${this.state.modeId}`) go(`/moduleIOT/pages/iotCarePlan/FR200?modeId=${this.state.modeId}`);
} }
render() { render() {
let { name, imgUrl, reportData, reportData1, reportShow, isClock, xinde, imglist, id, show, modeId, echartsData, showEcharts } = this.state let {
name,
imgUrl,
reportData,
reportData1,
reportShow,
isClock,
xinde,
imglist,
id,
show,
modeId,
echartsData,
showEcharts,
} = this.state;
const getStatusData = (level) => { const getStatusData = (level) => {
var bgCssData = { var bgCssData = {
serious: 'background: #FFE3E3', serious: "background: #FFE3E3",
moderate: 'background: #FFEBDC', moderate: "background: #FFEBDC",
slight: 'background: #F6FCFF', slight: "background: #F6FCFF",
normal: 'background: #F8F8F8', normal: "background: #F8F8F8",
sufficient: 'background: #F8F8F8' sufficient: "background: #F8F8F8",
} };
// var progressBgData = { // var progressBgData = {
// serious: 'background: #FF9393', // serious: 'background: #FF9393',
// moderate: 'background: #FFC58C', // moderate: 'background: #FFC58C',
@ -117,187 +141,293 @@ class MoistureTestReport extends Component<any, any> {
// sufficient: 'background: #9FDBF3' // sufficient: 'background: #9FDBF3'
// } // }
var progressBgData = { var progressBgData = {
serious: '#FF9393', serious: "#FF9393",
moderate: '#FFC58C', moderate: "#FFC58C",
slight: '#E5F3F9', slight: "#E5F3F9",
normal: '#C2E5F3', normal: "#C2E5F3",
sufficient: '#9FDBF3' sufficient: "#9FDBF3",
} };
if (level >= 1 && level <= 2) { if (level >= 1 && level <= 2) {
return { return {
bg: bgCssData.serious, bg: bgCssData.serious,
title: '严重缺水', title: "严重缺水",
gear: 5, gear: 5,
img: 'serious', img: "serious",
progressBg: progressBgData.serious progressBg: progressBgData.serious,
} };
} else if (level >= 3 && level <= 4) { } else if (level >= 3 && level <= 4) {
return { return {
bg: bgCssData.moderate, bg: bgCssData.moderate,
title: '中度缺水', title: "中度缺水",
gear: 4, gear: 4,
img: 'moderate', img: "moderate",
progressBg: progressBgData.moderate progressBg: progressBgData.moderate,
} };
} else if (level >= 5 && level <= 6) { } else if (level >= 5 && level <= 6) {
return { return {
bg: bgCssData.slight, bg: bgCssData.slight,
title: '轻微缺水', title: "轻微缺水",
gear: 3, gear: 3,
img: 'slight', img: "slight",
progressBg: progressBgData.slight progressBg: progressBgData.slight,
} };
} else if (level >= 7 && level <= 8) { } else if (level >= 7 && level <= 8) {
return { return {
bg: bgCssData.normal, bg: bgCssData.normal,
title: '水分正常', title: "水分正常",
gear: 2, gear: 2,
img: 'normal', img: "normal",
progressBg: progressBgData.normal progressBg: progressBgData.normal,
} };
} else if (level >= 9 && level <= 10) { } else if (level >= 9 && level <= 10) {
return { return {
bg: bgCssData.sufficient, bg: bgCssData.sufficient,
title: '水分充足', title: "水分充足",
gear: 1, gear: 1,
img: 'sufficient', img: "sufficient",
progressBg: progressBgData.sufficient progressBg: progressBgData.sufficient,
} };
} }
} };
return ( return (
<Block> <Block>
<Navbar isBack titleSlot="水分测试报告"></Navbar>
<Navbar isBack titleSlot='水分测试报告'></Navbar> <View className="moisture_test_report">
<View className='moisture_test_report'> <View className="time">{reportData.curDate}</View>
<View className='time'>{reportData.curDate}</View> <View className="report_data">
<View className='report_data'> <View
<View className='forehead moisture_block flex' style={getStatusData(reportData.shuifenLevel.head)!.bg}> className="forehead moisture_block flex"
<Image className='moisture_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.head)!.img}.png`)} mode='aspectFill'></Image> style={getStatusData(reportData.shuifenLevel.head)!.bg}
<View className='pos_info'> >
<View className='top'></View> <Image
<View className='bottom'>{getStatusData(reportData.shuifenLevel.head)!.title}</View> className="moisture_img"
<View className='bottom'></View> src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.head)!.img
}.png`)}
mode="aspectFill"
></Image>
<View className="pos_info">
<View className="top"></View>
<View className="bottom">
{getStatusData(reportData.shuifenLevel.head)!.title}
</View>
<View className="bottom"></View>
</View> </View>
</View> </View>
<View className='left_face moisture_block flex' style={getStatusData(reportData.shuifenLevel.leftFace)!.bg}> <View
<Image className='moisture_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.leftFace)!.img}.png`)} mode='aspectFill'></Image> className="left_face moisture_block flex"
<View className='pos_info'> style={getStatusData(reportData.shuifenLevel.leftFace)!.bg}
<View className='top'></View> >
<View className='bottom'>{getStatusData(reportData.shuifenLevel.leftFace)!.title}</View> <Image
<View className='bottom'></View> className="moisture_img"
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.leftFace)!.img
}.png`)}
mode="aspectFill"
></Image>
<View className="pos_info">
<View className="top"></View>
<View className="bottom">
{getStatusData(reportData.shuifenLevel.leftFace)!.title}
</View>
<View className="bottom"></View>
</View> </View>
</View> </View>
<View className='right_face moisture_block flex' style={getStatusData(reportData.shuifenLevel.rightFace)!.bg}> <View
<Image className='moisture_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.rightFace)!.img}.png`)} mode='aspectFill'></Image> className="right_face moisture_block flex"
<View className='pos_info'> style={getStatusData(reportData.shuifenLevel.rightFace)!.bg}
<View className='top'></View> >
<View className='bottom'>{getStatusData(reportData.shuifenLevel.rightFace)!.title}</View> <Image
<View className='bottom'></View> className="moisture_img"
src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.rightFace)!.img
}.png`)}
mode="aspectFill"
></Image>
<View className="pos_info">
<View className="top"></View>
<View className="bottom">
{getStatusData(reportData.shuifenLevel.rightFace)!.title}
</View>
<View className="bottom"></View>
</View> </View>
</View> </View>
<View className='example_box'> <View className="example_box">
<Image className='banner_img' src='@/img/fr200/shuifen.png' mode='aspectFill'></Image> <Image
<View className='line1'></View> className="banner_img"
<View className='line2'></View> src="@/img/fr200/shuifen.png"
<View className='line3'></View> mode="aspectFill"
></Image>
<View className="line1"></View>
<View className="line2"></View>
<View className="line3"></View>
</View> </View>
<View className='moisture_level_info'> <View className="moisture_level_info">
<View className='level_info'> <View className="level_info">
<View className='items flex aitems'> <View className="items flex aitems">
<View className='pos_name'></View> <View className="pos_name"></View>
<View className='progress'> <View className="progress">
<View className='progress_width' style={{ width: `${reportData.shuifenLevel.head * 10}%`, backgroundColor: getStatusData(reportData.shuifenLevel.head)!.progressBg }}></View> <View
className="progress_width"
style={{
width: `${reportData.shuifenLevel.head * 10}%`,
backgroundColor: getStatusData(
reportData.shuifenLevel.head
)!.progressBg,
}}
></View>
{/* style='{width: {reportData.shuifenLevel.head * 10}%;{util.getStatusData(reportData.shuifenLevel.head).progressBg}}' */} {/* style='{width: {reportData.shuifenLevel.head * 10}%;{util.getStatusData(reportData.shuifenLevel.head).progressBg}}' */}
</View> </View>
<View className='level'>{reportData.shuifenLevel.head}</View> <View className="level">
{reportData.shuifenLevel.head}
</View>
</View> </View>
<View className='items flex aitems'> <View className="items flex aitems">
<View className='pos_name'></View> <View className="pos_name"></View>
<View className='progress'> <View className="progress">
<View className='progress_width left_face_progress' style={{ width: `${reportData.shuifenLevel.leftFace * 10}%`, backgroundColor: getStatusData(reportData.shuifenLevel.leftFace)!.progressBg }}></View> <View
className="progress_width left_face_progress"
style={{
width: `${reportData.shuifenLevel.leftFace * 10}%`,
backgroundColor: getStatusData(
reportData.shuifenLevel.leftFace
)!.progressBg,
}}
></View>
</View>
<View className="level">
{reportData.shuifenLevel.leftFace}
</View> </View>
<View className='level'>{reportData.shuifenLevel.leftFace}</View>
</View> </View>
<View className='items flex aitems'> <View className="items flex aitems">
<View className='pos_name'></View> <View className="pos_name"></View>
<View className='progress'> <View className="progress">
<View className='progress_width right_face_progress' style={{ width: `${reportData.shuifenLevel.rightFace * 10}%`, backgroundColor: getStatusData(reportData.shuifenLevel.rightFace)!.progressBg }}></View> <View
className="progress_width right_face_progress"
style={{
width: `${reportData.shuifenLevel.rightFace * 10}%`,
backgroundColor: getStatusData(
reportData.shuifenLevel.rightFace
)!.progressBg,
}}
></View>
</View>
<View className="level">
{reportData.shuifenLevel.rightFace}
</View> </View>
<View className='level'>{reportData.shuifenLevel.rightFace}</View>
</View> </View>
</View> </View>
<View className='moisture_level'> <View className="moisture_level">
<View className='level_txt flex aitems jcenter'> <View className="level_txt flex aitems jcenter">
<View className='circle normal'></View> <View className="circle normal"></View>
<View className='txt'></View> <View className="txt"></View>
</View> </View>
<View className='level_list flex'> <View className="level_list flex">
<View className='items flex aitems'> <View className="items flex aitems">
<View className='circle serious'></View> <View className="circle serious"></View>
<View className='txt'>1-2</View> <View className="txt">1-2</View>
</View> </View>
<View className='items flex aitems'> <View className="items flex aitems">
<View className='circle moderate'></View> <View className="circle moderate"></View>
<View className='txt'>3-4</View> <View className="txt">3-4</View>
</View> </View>
<View className='items flex aitems'> <View className="items flex aitems">
<View className='circle slight'></View> <View className="circle slight"></View>
<View className='txt'>5-6</View> <View className="txt">5-6</View>
</View> </View>
<View className='items flex aitems'> <View className="items flex aitems">
<View className='circle normal'></View> <View className="circle normal"></View>
<View className='txt'>7-8</View> <View className="txt">7-8</View>
</View> </View>
<View className='items flex aitems'> <View className="items flex aitems">
<View className='circle sufficient'></View> <View className="circle sufficient"></View>
<View className='txt'>9-10</View> <View className="txt">9-10</View>
</View> </View>
</View> </View>
<View className='pour'></View> <View className="pour">
</View>
</View> </View>
</View> </View>
</View> </View>
</View>
<View className="report_chart">
<View className="chart_title common_title"></View>
<View className="container">
<Echarts echartsData={echartsData}></Echarts>
</View>
</View>
<View className='report_chart'> <View className="gear_recommend">
<View className='chart_title common_title'></View> <View className="gear_header flex aitems sb">
<View className='container'> <View className="gear_title common_title"></View>
<Echarts echartsData={echartsData}></Echarts> {reportShow ? <View className="gear_btn"></View> : null}
</View>
<View className="gear_content flex aitems sb">
<View className="left_content">
<Image
className="banner_img"
src="@/img/fr200/mian-mo.png"
mode="aspectFill"
></Image>
<View className="type"></View>
</View> </View>
</View> </View>
<View className='gear_recommend'> <View className="gear_recommend">
<View className='gear_header flex aitems sb'> <View className="gear_header flex aitems sb">
<View className='gear_title common_title'></View> <View className="gear_title common_title"></View>
{reportShow ? ( <View className="gear_btn"></View>
<View className='gear_btn'></View>
) : null}
</View> </View>
<View className='gear_content flex aitems sb'> <View className="gear_content flex aitems sb">
<View className='left_content'> <View className="left_content">
<Image className='banner_img' src='@/img/fr200/mian-mo.png' mode='aspectFill'></Image> <Image
<View className='type'></View> className="banner_img"
src="@/img/fr200/mian-mo.png"
mode="aspectFill"
></Image>
<View className="type"></View>
</View> </View>
<View className='right_content flex aitems'> <View className="right_content flex aitems">
<View className='gear_list flex aitems sa'> <View className="gear_list flex aitems sa">
<View className='items flex aitems jcenter'> <View className="items flex aitems jcenter">
<Image className='gear_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.head)!.gear}.png`)} mode='aspectFill'></Image> <Image
<View className='name'></View> className="gear_img"
<View className='level'>{reportData.shuifenGear.head}</View> src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.head)!.gear
}.png`)}
mode="aspectFill"
></Image>
<View className="name"></View>
<View className="level">
{reportData.shuifenGear.head}
</View>
</View> </View>
<View className='items flex aitems jcenter'> <View className="items flex aitems jcenter">
<Image className='gear_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.leftFace)!.gear}.png`)} mode='aspectFill'></Image> <Image
<View className='name'></View> className="gear_img"
<View className='level'>{reportData.shuifenGear.leftFace}</View> src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.leftFace)!.gear
}.png`)}
mode="aspectFill"
></Image>
<View className="name"></View>
<View className="level">
{reportData.shuifenGear.leftFace}
</View>
</View> </View>
<View className='items flex aitems jcenter'> <View className="items flex aitems jcenter">
<Image className='gear_img' src={require(`@/img/fr200/${getStatusData(reportData.shuifenLevel.rightFace)!.gear}.png`)} mode='aspectFill'></Image> <Image
<View className='name'></View> className="gear_img"
<View className='level'>{reportData.shuifenGear.rightFace}</View> src={require(`@/img/fr200/${
getStatusData(reportData.shuifenLevel.rightFace)!.gear
}.png`)}
mode="aspectFill"
></Image>
<View className="name"></View>
<View className="level">
{reportData.shuifenGear.rightFace}
</View>
</View> </View>
</View> </View>
</View> </View>
@ -306,17 +436,17 @@ class MoistureTestReport extends Component<any, any> {
</View> </View>
{reportShow ? ( {reportShow ? (
<View className='go_clock_in flex sb aitems' > <View className="go_clock_in flex sb aitems">
<View className='go_clock_btn' onClick={this.toNursing.bind(this)}></View> <View className="go_clock_btn" onClick={this.toNursing.bind(this)}>
<View className='jump_box flex aitems' onClick={this.toIndex}>
<View className='txt'></View> </View>
<Image src='@/img/fr200/right.png' mode='aspectFill'></Image> <View className="jump_box flex aitems" onClick={this.toIndex}>
<View className="txt"></View>
<Image src="@/img/fr200/right.png" mode="aspectFill"></Image>
</View> </View>
</View> </View>
) : null} ) : null}
</Block>
</Block >
); );
} }
} }

@ -403,13 +403,18 @@ export default class Recording extends Component<any, any> {
gears.push(level); gears.push(level);
}); });
echartsData = { echartsData = {
gears, eDate gears,
} eDate,
setStorageSync('moistureEachtsData', JSON.stringify(echartsData)) };
let report =false 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)}&report=${report }`); let report = false;
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)}&report=${report}`
);
} }
// 打开其他类型 // 打开其他类型

Loading…
Cancel
Save