回看报告

master
qsj 2 years ago
parent cf920fd2c8
commit af205347e6

@ -2020,9 +2020,12 @@ class IotCarePlanFR200 extends Component<any, any> {
} else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试");
} else {
let report = true;
go(
"/recoding/pages/face_report/face_report?id=" +
this.state.currentDevice.id
this.state.currentDevice.id+
"&report=" +
report
);
}
};

@ -4,7 +4,10 @@ import { Block, View, Image, Text, Input } from "@tarojs/components";
import { Popup, Progress, Slider } from "@antmjs/vantui";
import { useRef } from "react";
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 React, { useState, useEffect,useMemo } from 'react';
import "./index.less";
@ -15,7 +18,11 @@ interface Props {
function Index({
EchartsData
}:Props) {
let type =0
// console.log(EchartsData,'EchartsDataEchartsData');
switch(EchartsData.modeName) {
case '基础班脸部':
type=37
@ -35,7 +42,15 @@ function Index({
default:
}
// const chartRef = useRef(null);
// console.log(chartRef,'chartRefchartRef');
// let chartInstance = echarts.init(chartRef.current);
const echartsRef = useRef<EchartsHandle>(null);
// const echartsRef = useRef< null>(null);
// let echartsRef:any = React.createRef();;
// console.log(chartRef,'echartsRefechartsRef',chartInstance);
function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor);
var endRGB = hexToRgb(endColor);
@ -73,18 +88,16 @@ function Index({
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 =[]
seriesData = EchartsData?.data?.groupedAa
// const xList = [...new Array(37).fill(0).map((item, key) => key)];
const xList = [...new Array(37).fill(0).map((item, key) => key)];
// const seriesData = [
// ...xList.map((item) => {
// return Math.random() * 80;
// }),
// ];
const option: EChartOption ={
let [option, setOption] = useState<EChartOption>({
grid: {
// 让图表占满容器
top: "10rpx",
@ -165,8 +178,140 @@ seriesData = EchartsData?.data?.groupedAa
},
},
],
};
let arr = [2, 3, 4, 5, 6, 7]
})
useEffect(() =>{
setOption({...option,
series:[
{
barCategoryGap: '0%',
data: [11,22,33,44,55,55],
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], // 黄色
},
]);;
},
},
},
},
]})
console.log(option,'optionoption',xList);
},[EchartsData])
// 基于 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: [
// {
// 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], // 黄色
// },
// ]);;
// },
// },
// },
// },
// ],
// };
// const chartOptions = useMemo(() => {
// console.log(option,'optionoptionoption');
// return option;
// }, [EchartsData]);
// // 使用 useMemo 来记住创建的 ECharts 实例
// const chartRef = useMemo(() => {
// return option;
// }, []); // 空数组意味着 chartRef 仅在组件挂载时创建一次
return (
<Block>
<Echarts

@ -76,29 +76,32 @@ export default class Index extends Component<any, any> {
}
}
async getRecord(id, recordId) {
console.log("id, recordId", id, recordId);
async getRecord(id, instrumentId) {
console.log("id, instrumentId", id, instrumentId);
let data = {};
if (id != null) {
data["instrumentId"] = id;
data["instrumentId"] = instrumentId;
}
// 获取当前
let res1 = await InstrumentInfo.apiNursingLog.getRecordNow(id);
// 获取历史记录列表
let res = await InstrumentInfo.apiNursingLog.getRecord(data);
res1.data.data.nursingTime = this.getTime(res1.data.data.nursingTime);
res1.data.data.createTime = getdates(res1.data.data.createTime).replace(/-/g, ".");
this.setState({ recordData: res1.data.data });
if (res.data.code === 200) {
if (recordId) {
if (instrumentId) {
res.data.rows.map((item) => {
item.nursingTime = this.getTime(item.nursingTime);
item.createTime = getdates(item.createTime).replace(/-/g, ".");
if (item.id == recordId) {
this.setState({ recordData: item });
}
});
} else {
this.setState({ recordData: res.data.rows[0] });
}
this.setState({
recordList: res.data.rows.filter((item) => item.id != recordId),
recordList: res.data.rows.filter((item) => item.id != instrumentId),
});
}
}
@ -313,7 +316,7 @@ export default class Index extends Component<any, any> {
<View className="main m-x-30">
<View className="products_item" style="border: none">
<View className="products_top flex aitems">
<View className="add_time">{recordData.createTime}</View>
<View className="add_time">{recordData?.createTime}</View>
<View
className={classnames("tag", {
tag_active: recordData.online === 2,

@ -79,8 +79,16 @@ export default class Index extends Component<any, any> {
if (id != null) {
data["instrumentId"] = id;
}
let res = await InstrumentInfo.apiNursingLog.getStatistics(data);
let res = await InstrumentInfo.apiNursingLog.getStatisticsFace(data);
let res2 = await InstrumentInfo.apiNursingLog.getStatiCDE(id);
let nursingData=JSON.parse(res2.data.data.nursingData)
let obj ={
modeName:res2.data.data.modeName,
data:nursingData
}
this.init({
obj:JSON.stringify(obj)
})
if (res.data.code === 200) {
this.setState({ statistics: res.data.data });
}
@ -275,12 +283,15 @@ export default class Index extends Component<any, any> {
reportShow: Bool
})
}
this.init(options)
// this.init(options)
this.getRouteId();
// this.getClockStatistics()
}
init(options){
let obj =JSON.parse(options.obj)
console.log(obj,'obj111111111111111');
let recordData =this.state.recordData
let modeImage =this.state.modeImage
@ -309,7 +320,6 @@ export default class Index extends Component<any, any> {
}
this.setState({recordData,modeImage,EchartsData:{...obj}})
console.log(obj,'查看');
}

@ -327,13 +327,20 @@ export default class Recording extends Component<any, any> {
"/recoding/pages/face_report_one/face_report_one?id=" +
item.id +
"&report=" +
report+ "&obj=" +
JSON.stringify(obj)
report
);
};
// 打开第二种类型
two = async (item) => {
console.log("打开第二种类型", item);
let report = false;
go(
"/recoding/pages/face_report/face_report?id=" +
item.id +
"&recordId=" + item.instrumentId+
"&report=" +
report
);
};
// 打开第三种类型
three = async (item) => {

@ -406,6 +406,13 @@ export const InstrumentInfo = {
url: "/nursingLog/record" + paramsToUrlQueryString(data),
method: "get",
});
},
/**查询用户护理记录(当前)*/
getRecordNow: (data) => {
return Ajax({
url: `/nursingLog/${data}` ,
method: "get",
});
},
/**查询用户护理记录的当月统计信息*/
getStatistics: (data) => {
@ -414,6 +421,21 @@ export const InstrumentInfo = {
method: "get",
});
},
/*脸部能量时间*/
getStatisticsFace: (data) => {
return Ajax({
url: "/nursingLog/fr200/statistics" + paramsToUrlQueryString(data),
method: "get",
});
},
/**获取脸部能量图数据*/
getStatiCDE: (data) => {
return Ajax({
url: `/nursingLog/${data}`,
method: "get",
});
},
},
};
//localhost:9204/instrument/getInstrumentInfoBySerial

Loading…
Cancel
Save