儿科患者端
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: [],
|
||||
heightChart: null,
|
||||
weightChart: null,
|
||||
xAxis: [],
|
||||
carList: [],
|
||||
carLength: 0,
|
||||
|
||||
@ -130,18 +131,19 @@ Page({
|
||||
const res = await request('patient/chat/0', 'get')
|
||||
const heightData = []
|
||||
const weightData = []
|
||||
|
||||
const xAxis = []
|
||||
if(res.list.length > 0){
|
||||
res.list.forEach(item => {
|
||||
heightData.push(item.height)
|
||||
weightData.push(item.weight)
|
||||
|
||||
xAxis.push(item.age)
|
||||
})
|
||||
}
|
||||
|
||||
this.setData({
|
||||
heightData,
|
||||
weightData,
|
||||
xAxis
|
||||
|
||||
});
|
||||
this.initHeightChart()
|
||||
@ -215,8 +217,18 @@ Page({
|
||||
// 初始化身高图表
|
||||
initHeightChart() {
|
||||
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 chartComp = this.selectComponent('#mychart-dom-height');
|
||||
@ -235,7 +247,7 @@ Page({
|
||||
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' } } },
|
||||
series: [
|
||||
{
|
||||
@ -274,8 +286,19 @@ Page({
|
||||
// 初始化体重图表
|
||||
initWeightChart() {
|
||||
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 chartComp = this.selectComponent('#mychart-dom-weight');
|
||||
@ -294,7 +317,7 @@ Page({
|
||||
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' } } },
|
||||
series: [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user