This commit is contained in:
@zuopngfei 2025-07-03 19:01:12 +08:00
parent 19bab3fcd2
commit 23121bf52a
3 changed files with 24 additions and 7 deletions

View File

@ -19,6 +19,10 @@ const props = defineProps({
label: {
type: String,
default: ''
},
xAxis:{
type: Array,
default: () => []
}
})
onMounted(() => {
@ -40,7 +44,7 @@ onMounted(() => {
},
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
data: props.xAxis,
boundaryGap: false,
},

View File

@ -41,6 +41,10 @@ const props = defineProps({
label: {
type: String,
default: ''
},
xAxis:{
type: Array,
default: () => []
}
})
@ -79,7 +83,7 @@ onMounted(() => {
},
xAxis: {
type: 'category',
data: props.months,
data: props.xAxis,
boundaryGap: false,
},
yAxis: {

View File

@ -74,6 +74,7 @@
<myEchartsSh v-if="!isLoading" ref="heightEcharts" id="heightEcharts" :sex="userInfo.conception_type"
:legendData="['实际身高', '标准范围']"
:actual-height="chatData.height"
:x-axis="chatData.age"
:label="'身高'" />
</div>
<div class="title">
@ -81,8 +82,9 @@
</div>
<div class="echats" v-loading="isLoading">
<myEchartsSh v-if="!isLoading" ref="weightEcharts" id="weightEcharts" :sex="userInfo.conception_type"
:legendData="['实际体重', '标准范围']"
:legendData="['实际体重', '标准范围']"
:actual-height="chatData.weight"
:x-axis="chatData.age"
:label="'体重'" />
</div>
<div class="title">
@ -90,14 +92,18 @@
</div>
<div class="echats" v-loading="isLoading">
<myEcharts v-if="!isLoading" ref="totalBilirubinEcharts" id="totalBilirubinEcharts"
:dataX="chatData.totalBilirubin" :label="'总胆红素'" />
:dataX="chatData.totalBilirubin"
:x-axis="chatData.age"
:label="'总胆红素'" />
</div>
<div class="title">
<h2>直接胆红素趋势</h2>
</div>
<div class="echats" v-loading="isLoading">
<myEcharts v-if="!isLoading" ref="directBilirubinEcharts" id="directBilirubinEcharts"
:dataX="chatData.directBilirubin" :label="'直接胆红素'" />
:dataX="chatData.directBilirubin"
:x-axis="chatData.age"
:label="'直接胆红素'" />
</div>
<el-dialog v-model="dialogVisible" title="" width="850px">
<div style="padding-left: 20px;">
@ -203,7 +209,8 @@ const chatData = ref({
height: [],
weight: [],
totalBilirubin: [],
directBilirubin: []
directBilirubin: [],
age: [],
})
const getTableData = async () => {
try {
@ -221,7 +228,8 @@ const getTableData = async () => {
height: [],
weight: [],
totalBilirubin: [],
directBilirubin: []
directBilirubin: [],
age: []
}
chatRes.list.forEach(item => {
@ -229,6 +237,7 @@ const getTableData = async () => {
chatData.value.weight.push(item.weight)
chatData.value.totalBilirubin.push(item.total_bilirubin)
chatData.value.directBilirubin.push(item.direct_bilirubin)
chatData.value.age.push(item.age)
})
} catch (error) {
console.error('Error fetching data:', error)