回看报告

master
qsj 2 years ago
parent cf920fd2c8
commit af205347e6

@ -2020,9 +2020,12 @@ class IotCarePlanFR200 extends Component<any, any> {
} else if ("moistureTest" === nursingData.workMode) { } else if ("moistureTest" === nursingData.workMode) {
console.log("水分测试"); console.log("水分测试");
} else { } else {
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
); );
} }
}; };

@ -4,7 +4,10 @@ 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 { useRef } 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 * as echarts from "echarts";
import React, { useState, useEffect,useMemo } from 'react';
import "./index.less"; import "./index.less";
@ -15,7 +18,11 @@ interface Props {
function Index({ function Index({
EchartsData EchartsData
}:Props) { }:Props) {
let type =0 let type =0
// console.log(EchartsData,'EchartsDataEchartsData');
switch(EchartsData.modeName) { switch(EchartsData.modeName) {
case '基础班脸部': case '基础班脸部':
type=37 type=37
@ -35,7 +42,15 @@ function Index({
default: default:
} }
// const chartRef = useRef(null);
// console.log(chartRef,'chartRefchartRef');
// let chartInstance = echarts.init(chartRef.current);
const echartsRef = useRef<EchartsHandle>(null); 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) { function generateColorArray(startColor, endColor, steps) {
var startRGB = hexToRgb(startColor); var startRGB = hexToRgb(startColor);
var endRGB = hexToRgb(endColor); var endRGB = hexToRgb(endColor);
@ -73,18 +88,16 @@ function Index({
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(37).fill(0).map((item, key) => key)]; const xList = [...new Array(37).fill(0).map((item, key) => key)];
// const seriesData = [ // const seriesData = [
// ...xList.map((item) => { // ...xList.map((item) => {
// return Math.random() * 80; // return Math.random() * 80;
// }), // }),
// ]; // ];
let [option, setOption] = useState<EChartOption>({
const option: EChartOption ={
grid: { grid: {
// 让图表占满容器 // 让图表占满容器
top: "10rpx", 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 ( return (
<Block> <Block>
<Echarts <Echarts

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

@ -79,8 +79,16 @@ export default class Index extends Component<any, any> {
if (id != null) { if (id != null) {
data["instrumentId"] = id; 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) { if (res.data.code === 200) {
this.setState({ statistics: res.data.data }); this.setState({ statistics: res.data.data });
} }
@ -275,12 +283,15 @@ export default class Index extends Component<any, any> {
reportShow: Bool reportShow: Bool
}) })
} }
this.init(options) // this.init(options)
this.getRouteId(); this.getRouteId();
// this.getClockStatistics() // this.getClockStatistics()
} }
init(options){ init(options){
let obj =JSON.parse(options.obj) let obj =JSON.parse(options.obj)
console.log(obj,'obj111111111111111');
let recordData =this.state.recordData let recordData =this.state.recordData
let modeImage =this.state.modeImage let modeImage =this.state.modeImage
@ -309,7 +320,6 @@ export default class Index extends Component<any, any> {
} }
this.setState({recordData,modeImage,EchartsData:{...obj}}) 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=" + "/recoding/pages/face_report_one/face_report_one?id=" +
item.id + item.id +
"&report=" + "&report=" +
report+ "&obj=" + report
JSON.stringify(obj)
); );
}; };
// 打开第二种类型 // 打开第二种类型
two = async (item) => { two = async (item) => {
console.log("打开第二种类型", 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) => { three = async (item) => {

@ -406,6 +406,13 @@ export const InstrumentInfo = {
url: "/nursingLog/record" + paramsToUrlQueryString(data), url: "/nursingLog/record" + paramsToUrlQueryString(data),
method: "get", method: "get",
}); });
},
/**查询用户护理记录(当前)*/
getRecordNow: (data) => {
return Ajax({
url: `/nursingLog/${data}` ,
method: "get",
});
}, },
/**查询用户护理记录的当月统计信息*/ /**查询用户护理记录的当月统计信息*/
getStatistics: (data) => { getStatistics: (data) => {
@ -414,6 +421,21 @@ export const InstrumentInfo = {
method: "get", 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 //localhost:9204/instrument/getInstrumentInfoBySerial

Loading…
Cancel
Save