儿科患者端
This commit is contained in:
parent
dcc99e9591
commit
36f4d83ac3
File diff suppressed because it is too large
Load Diff
@ -31,6 +31,7 @@ Page({
|
|||||||
weightData: [],
|
weightData: [],
|
||||||
heightChart: null,
|
heightChart: null,
|
||||||
weightChart: null,
|
weightChart: null,
|
||||||
|
xAxis: [],
|
||||||
carList: [],
|
carList: [],
|
||||||
carLength: 0,
|
carLength: 0,
|
||||||
|
|
||||||
@ -130,18 +131,19 @@ Page({
|
|||||||
const res = await request('patient/chat/0', 'get')
|
const res = await request('patient/chat/0', 'get')
|
||||||
const heightData = []
|
const heightData = []
|
||||||
const weightData = []
|
const weightData = []
|
||||||
|
const xAxis = []
|
||||||
if(res.list.length > 0){
|
if(res.list.length > 0){
|
||||||
res.list.forEach(item => {
|
res.list.forEach(item => {
|
||||||
heightData.push(item.height)
|
heightData.push(item.height)
|
||||||
weightData.push(item.weight)
|
weightData.push(item.weight)
|
||||||
|
xAxis.push(item.age)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setData({
|
this.setData({
|
||||||
heightData,
|
heightData,
|
||||||
weightData,
|
weightData,
|
||||||
|
xAxis
|
||||||
|
|
||||||
});
|
});
|
||||||
this.initHeightChart()
|
this.initHeightChart()
|
||||||
@ -215,8 +217,18 @@ Page({
|
|||||||
// 初始化身高图表
|
// 初始化身高图表
|
||||||
initHeightChart() {
|
initHeightChart() {
|
||||||
const standardHeight = this.standardHeight
|
const standardHeight = this.standardHeight
|
||||||
const standardLower = standardHeight.map(item => item[0]);
|
|
||||||
const standardUpper = standardHeight.map(item => item[1]);
|
let totalList = []
|
||||||
|
standardHeight.forEach(item => {
|
||||||
|
props.xAxis.forEach(item2 => {
|
||||||
|
if(item.age == item2) {
|
||||||
|
totalList.push(item.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const standardLower = totalList.map(item => item[0]);
|
||||||
|
const standardUpper = totalList.map(item => item[1]);
|
||||||
const standardRange = standardUpper.map((up, i) => up - standardLower[i]);
|
const standardRange = standardUpper.map((up, i) => up - standardLower[i]);
|
||||||
|
|
||||||
const chartComp = this.selectComponent('#mychart-dom-height');
|
const chartComp = this.selectComponent('#mychart-dom-height');
|
||||||
@ -235,7 +247,7 @@ Page({
|
|||||||
return `${param.axisValue}\n${param.seriesName}: ${param.value} cm`;
|
return `${param.axisValue}\n${param.seriesName}: ${param.value} cm`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
xAxis: { type: 'category', boundaryGap: false, data: ['出生', '1月', '2月', '3月', '4月', '5月', '6月'] },
|
xAxis: { type: 'category', boundaryGap: false, data: this.data.xAxis },
|
||||||
yAxis: { x: 'center', type: 'value', splitLine: { lineStyle: { type: 'dashed' } } },
|
yAxis: { x: 'center', type: 'value', splitLine: { lineStyle: { type: 'dashed' } } },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
@ -274,8 +286,19 @@ Page({
|
|||||||
// 初始化体重图表
|
// 初始化体重图表
|
||||||
initWeightChart() {
|
initWeightChart() {
|
||||||
const standardWeight = this.standardWeight
|
const standardWeight = this.standardWeight
|
||||||
const standardLower = standardWeight.map(item => item[0]);
|
|
||||||
const standardUpper = standardWeight.map(item => item[1]);
|
let totalList = []
|
||||||
|
standardWeight.forEach(item => {
|
||||||
|
props.xAxis.forEach(item2 => {
|
||||||
|
if(item.age == item2) {
|
||||||
|
totalList.push(item.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const standardLower = totalList.map(item => item[0]);
|
||||||
|
const standardUpper = totalList.map(item => item[1]);
|
||||||
const standardRange = standardUpper.map((up, i) => up - standardLower[i]);
|
const standardRange = standardUpper.map((up, i) => up - standardLower[i]);
|
||||||
|
|
||||||
const chartComp = this.selectComponent('#mychart-dom-weight');
|
const chartComp = this.selectComponent('#mychart-dom-weight');
|
||||||
@ -294,7 +317,7 @@ Page({
|
|||||||
return `${param.axisValue}\n${param.seriesName}: ${param.value} cm`;
|
return `${param.axisValue}\n${param.seriesName}: ${param.value} cm`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
xAxis: { type: 'category', boundaryGap: false, data: ['出生', '1月', '2月', '3月', '4月', '5月', '6月'] },
|
xAxis: { type: 'category', boundaryGap: false, data: this.data.xAxis },
|
||||||
yAxis: { x: 'center', type: 'value', splitLine: { lineStyle: { type: 'dashed' } } },
|
yAxis: { x: 'center', type: 'value', splitLine: { lineStyle: { type: 'dashed' } } },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user