echarts图表

master
rongweikang 2 years ago
parent 93fdea9c9b
commit 74b1901625

@ -63,6 +63,8 @@ import WaterTest from "./components/WaterTest/index";
/* 本页组件 END */
import Echarts from "./components/Echart";
import EchartsFullScean from "./components/EchartFullScean";
import Gears from "./components/Gears";
import "./FR200.less";
@ -231,9 +233,121 @@ class IotCarePlanFR200 extends Component<any, any> {
isShowHistoryMsg: false, // 是否显示正在同步历史
showEcharts: false,
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贴脸就会自动开始工作
jsonStatus: any = {}; // 同步设备返回数据,用于结束
@ -290,9 +404,9 @@ class IotCarePlanFR200 extends Component<any, any> {
this.getInstrumentClockSummary();
this.getInstrumentClockDetail();
}
componentDidMount() {}
componentDidMount() { }
componentWillUnmount() {}
componentWillUnmount() { }
componentDidShow() {
console.log("页面显示了");
@ -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() {
// 查询离线记录汇总
const queryInstructionParams = {
@ -730,8 +807,6 @@ class IotCarePlanFR200 extends Component<any, any> {
let gears: any = [];
let eDate: any = [];
echartsData?.map((item) => {
console.log(item, "查看数据");
const result = item.createTime.split(" ")[0].substring(5);
eDate.push(result);
item.nursingData = JSON.parse(item.nursingData);
@ -746,9 +821,6 @@ class IotCarePlanFR200 extends Component<any, any> {
gears,
eDate,
};
setStorageSync("moistureEachtsData", JSON.stringify(echartsData));
// go(`/recoding/pages/moisture_test_report/moisture_test_report?data=${allData.nursingData}&date=${allData.createTime}&modeId=${allData.modeId}&id=${allData.instrumentId}&echartsData=${JSON.stringify(echartsData)}`);
go(
`/recoding/pages/moisture_test_report/moisture_test_report?data=${nursingData}&date=${formattedDate}&modeId=${ActiveModeItemId}&id=${currentDeviceId}&echartsData=${JSON.stringify(
echartsData
@ -768,23 +840,42 @@ class IotCarePlanFR200 extends Component<any, any> {
this.showTips("检测到您的设备没有紧贴肌肤,请紧贴肌肤后重新尝试");
});
};
look() {
updata() {
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 });
let series = JSON.parse(JSON.stringify(that.state.series))
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) {
clearInterval(time);
}
}, 1000);
}
updata() {}
// 绘制能量图
drawProwerPicture() {}
full() {
this.setState({ isFullScreen: !this.state.isFullScreen });
}
/** 切换光照 */
onSwitchChange = async () => {
@ -1598,7 +1689,7 @@ class IotCarePlanFR200 extends Component<any, any> {
executePromises = async () => {
let waterStepList = this.state.waterStepList;
let waterStepIndex = this.state.waterStepIndex;
let that =this
let that = this
await new Promise<void>((resolve) => {
setTimeout(() => {
waterStepList[waterStepIndex].schedule = 100;
@ -2000,6 +2091,9 @@ class IotCarePlanFR200 extends Component<any, any> {
params.workMode = jsonStatus?.workMode;
params.modeId = this.state.ActiveModeItem.id;
params.modeName = this.state.ActiveModeItem.modeName;
console.log(jsonStatus, 555555555555);
}
} else {
params.jsonStatus = jsonStatus;
@ -2495,6 +2589,8 @@ class IotCarePlanFR200 extends Component<any, any> {
echartsData,
isShowReReadRecordConnect,
currentServiceData,
series,
isFullScreen
} = this.state;
return (
@ -2505,7 +2601,7 @@ class IotCarePlanFR200 extends Component<any, any> {
isCustomBack
customBack={this.customBack}
/>
{!isFullScreen && <View>
<View catchMove>
<PopupAlert
isShow={isModeLock}
@ -2640,9 +2736,9 @@ class IotCarePlanFR200 extends Component<any, any> {
deviceInfo={currentDevice}
close={this.connectionClose}
isDisconnect={!isConnectionBlutoot}
offlineChange={() => {}}
offlineChange={() => { }}
pairingChange={this.pairingChange}
upgradeFun={() => {}}
upgradeFun={() => { }}
/>
)}
@ -2669,7 +2765,7 @@ class IotCarePlanFR200 extends Component<any, any> {
showFullscreenBtn={false}
onLoadedMetaData={this.GetVideosTime}
/>
<button onClick={this.executePromises}></button>
{/* <button onClick={this.executePromises}>点击按钮</button> */}
{errorTips && (
<Block>
<View className="msg-tips">
@ -2714,11 +2810,14 @@ class IotCarePlanFR200 extends Component<any, any> {
onModeLockOpen={this.onModeLockOpen}
/>
)}
<button onClick={this.look.bind(this)}>echarts </button>
<button onClick={this.updata.bind(this)}> </button>
<button onClick={this.updata.bind(this)}> </button>
{/* <button onClick={this.updata.bind(this)}>添加数据 </button> */}
<View className={classnames({ show: showEcharts })}>
<Echarts data={echartsData}></Echarts>
<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>} */}
@ -2741,7 +2840,7 @@ class IotCarePlanFR200 extends Component<any, any> {
)}
</View>
<Footer
{/* <Footer
currentWorkModeType={currentWorkModeType}
isRuningTest={isRuningTest}
isStopNurse={isStopNurse}
@ -2749,9 +2848,20 @@ class IotCarePlanFR200 extends Component<any, any> {
onEmitSwitchChange={this.onSwitchChange}
onEmitEndPlan={this.onEndPlan}
onsuccess={this.onsuccess}
/>
/> */}
</View>
</Block>
</View>
}
{
isFullScreen && <View>
<button onClick={this.updata.bind(this)}> </button>
<EchartsFullScean series={series} full={this.full}></EchartsFullScean>
</View>
}
</Block >
);
}
}

@ -9,13 +9,13 @@ import echarts from "@/utils/echarts.min.js";
import "./index.less";
interface Props {
data: any
series: any,
full:any
}
function Index({ data }: Props) {
const buttonRef = useRef(null);
function Index({ series ,full}: Props) {
const echartsRef = useRef<EchartsHandle>(null);
const [options, setOptions] = useState({
animation: false,
@ -145,205 +145,33 @@ function Index({ data }: Props) {
color: "#ff8410",
},
},
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",
},
},
],
series: []
})
const level = [8, 7, 6, 5, 4, 3, 2];
const [newOptions, setNewOptions] = useState(options)
const [newData, setNewData] = useState(0)
const full = useCallback(() => {
// let box = document.getElementById("box");
// box?.classList.add('fullscreen')
let stop = 0
// let time = setInterval(function () {
// stop++
const updata = useCallback((res) => {
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);
option.series = JSON.parse(JSON.stringify(res))
// 更新图表数据
setNewOptions(option)
// if (stop > 20) {
// clearInterval(time)
// }
// }, 1000)
}, [])
const cancelFull = useCallback((res) => {
full()
}, [])
}, [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 = () => {
// T.setPageOrientation({
// orientation: "portrait",
// });
// // taro.setPageOrientation({
// // orientation: "landscape",
// // });
// },
updata(series)
}, [series])
return (
@ -359,7 +187,7 @@ function Index({ data }: Props) {
style={{ width: "630rpx", height: "260rpx", zIndex: 1 }}
/>
<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>
{level.map((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,37 +7,37 @@ import Echarts, { EChartOption, EchartsHandle } from "taro-react-echarts";
// import echarts from "@/utils/echarts.min.js";
import * as echarts from "echarts";
import React, { useState, useEffect,useMemo } from 'react';
import React, { useState, useEffect, useMemo } from 'react';
import "./index.less";
interface Props {
EchartsData:any
EchartsData: any
}
function Index({
EchartsData
}:Props) {
}: Props) {
let type =0
let type = 0
// console.log(EchartsData,'EchartsDataEchartsData');
switch(EchartsData.modeName) {
switch (EchartsData.modeName) {
case '基础班脸部':
type=37
type = 37
break;
case '基础版眼部':
type=25
type = 25
break;
case '法令纹Pro':
type=25
type = 25
break;
case '下颌线Pro':
type=19
type = 19
break;
case '抬头纹Pro':
type=13
type = 13
break;
default:
@ -81,17 +81,17 @@ function Index({
const steps = 81; // 80个颜色
const colors = generateColorArray(startColor, endColor, steps);
// const xList = [...new Array(type).fill(0).map((item, key) => key)];
let seriesData:any =[]
seriesData = EchartsData?.data?.groupedAa
const xList = [...new Array(type).fill(0).map((item, key) => key)];
// const seriesData = [
// ...xList.map((item) => {
// return Math.random() * 80;
// }),
// ];
const option: EChartOption = {
const colors = generateColorArray(startColor, endColor, steps);
// const xList = [...new Array(type).fill(0).map((item, key) => key)];
let seriesData: any = []
seriesData = EchartsData?.data?.groupedAa
const xList = [...new Array(type).fill(0).map((item, key) => key)];
// const seriesData = [
// ...xList.map((item) => {
// return Math.random() * 80;
// }),
// ];
const option: EChartOption = {
grid: {
// 让图表占满容器
top: "10rpx",
@ -175,88 +175,88 @@ 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: [
// 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], // 黄色
// },
// ]);;
// },
// },
// },
// },
// ],
// };
// {
// 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 (

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

@ -1,4 +1,4 @@
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 { go } from "@/utils/traoAPI";
import { InstrumentInfo } from "@/utils/Interface";
@ -160,8 +160,10 @@ class MoistureTestReport extends Component<any, any> {
}
return (
<Block>
// <Block>
<PageMeta
pageOrientation='portrait'
>
<Navbar isBack titleSlot='水分测试报告'></Navbar>
<View className='moisture_test_report'>
<View className='time'>{reportData.curDate}</View>
@ -302,8 +304,8 @@ class MoistureTestReport extends Component<any, any> {
<Image src='@/img/fr200/right.png' mode='aspectFill'></Image>
</View>
</View>
</Block >
</PageMeta>
// </Block >
);
}
}

Loading…
Cancel
Save