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

View File

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

View File

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