diff --git a/src/components/myEcahts.vue b/src/components/myEcahts.vue index 6cdf7d8..13fc87e 100644 --- a/src/components/myEcahts.vue +++ b/src/components/myEcahts.vue @@ -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, }, diff --git a/src/components/myEcahtsSh.vue b/src/components/myEcahtsSh.vue index 0bc5b4a..993f330 100644 --- a/src/components/myEcahtsSh.vue +++ b/src/components/myEcahtsSh.vue @@ -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: { diff --git a/src/views/user/userDetail.vue b/src/views/user/userDetail.vue index 602b1be..de03390 100644 --- a/src/views/user/userDetail.vue +++ b/src/views/user/userDetail.vue @@ -74,6 +74,7 @@
@@ -81,8 +82,9 @@
@@ -90,14 +92,18 @@
+ :dataX="chatData.totalBilirubin" + :x-axis="chatData.age" + :label="'总胆红素'" />

直接胆红素趋势

+ :dataX="chatData.directBilirubin" + :x-axis="chatData.age" + :label="'直接胆红素'" />
@@ -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)