From 98b9fdc80abc60b5e57370328ea51cf06365bab0 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 23 六月 2025 20:31:10 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/patient/profile/index.vue |  540 +++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 392 insertions(+), 148 deletions(-)

diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue
index 53093d6..44e3e0a 100644
--- a/src/views/patient/patient/profile/index.vue
+++ b/src/views/patient/patient/profile/index.vue
@@ -54,13 +54,13 @@
           >
         </el-tabs>
       </el-tab-pane>
-      <!-- <el-tab-pane name="monitor">
+      <el-tab-pane name="monitor">
         <span class="mulsz" slot="label"
           ><i class="el-icon-s-data"></i> 鍋ュ悍鐩戞祴</span
         >
 
-        <el-tabs v-model="sontwoactiveName" @tab-click="handleClick">
-          <el-tab-pane name="blood"
+        <el-tabs v-model="sontwoactiveName">
+          <!-- <el-tab-pane name="blood"
             ><span class="mulsz" slot="label"
               ><i class="el-icon-s-operation"></i> 琛�鍘�</span
             ></el-tab-pane
@@ -69,13 +69,13 @@
             ><span class="mulsz" slot="label"
               ><i class="el-icon-odometer"></i>琛�绯�
             </span></el-tab-pane
-          >
+          > -->
           <el-tab-pane name="weight"
             ><span class="mulsz" slot="label"
-              ><i class="el-icon-s-data"></i>浣撻噸
+              ><i class="el-icon-s-data"></i>韬珮澶村洿瓒嬪娍
             </span></el-tab-pane
           >
-          <el-tab-pane name="heartrate"
+          <!-- <el-tab-pane name="heartrate"
             ><span class="mulsz" slot="label"
               ><i class="el-icon-s-operation"></i>蹇冪巼
             </span></el-tab-pane
@@ -89,9 +89,9 @@
             ><span class="mulsz" slot="label"
               ><i class="el-icon-s-opportunity"></i>浣撴俯
             </span></el-tab-pane
-          >
-        </el-tabs></el-tab-pane
-      > -->
+          > -->
+        </el-tabs>
+      </el-tab-pane>
       <el-tab-pane name="serve">
         <span class="mulsz" slot="label"
           ><i class="el-icon-s-custom"></i> 鏈嶅姟璁板綍</span
@@ -172,6 +172,8 @@
                       v-model="inputValue"
                       @change="handleInputConfirm"
                       filterable
+                      remote
+                      :remote-method="remoteMethod"
                       allow-create
                       default-first-option
                       placeholder="璇烽�夋嫨/鏌ヨ"
@@ -422,7 +424,7 @@
             prop="leavehospitaldistrictname"
             width="120"
           />
-          <el-table-column
+          <!-- <el-table-column
             label="涓绘不鍖荤敓"
             align="center"
             key="drname"
@@ -436,7 +438,7 @@
             key="nurseName"
             prop="nurseName"
             width="120"
-          />
+          /> -->
         </el-table>
         <pagination
           v-show="total > 0"
@@ -520,7 +522,6 @@
             prop="bedNo"
             width="120"
           />
-
         </el-table>
       </div>
       <!-- 鍑洪櫌 -->
@@ -598,7 +599,6 @@
             prop="bedNo"
             width="120"
           />
-
         </el-table>
       </div>
     </div>
@@ -619,26 +619,22 @@
               border-left: 4px solid rgb(190, 65, 134);
             "
           >
-          <span v-if="item.serviceType==2">鍑洪櫌闅忚</span>
-          <span v-if="item.serviceType==1">鐩戞祴璇勪及</span>
-          <span v-if="item.serviceType==3">闂ㄨ瘖闅忚</span>
-          <span v-if="item.serviceType==4">瀹f暀鍏虫��</span>
+            <span v-if="item.serviceType == 2">鍑洪櫌闅忚</span>
+            <span v-if="item.serviceType == 1">鐩戞祴璇勪及</span>
+            <span v-if="item.serviceType == 3">闂ㄨ瘖闅忚</span>
+            <span v-if="item.serviceType == 4">瀹f暀鍏虫��</span>
           </div>
           <el-divider></el-divider>
           <div style="margin-top: 10px">
-            鏈嶅姟鍚嶇О锛�<span style="color: #2775b6"
-              >{{ item.templatename }}</span
-            >
+            鏈嶅姟鍚嶇О锛�<span style="color: #2775b6">{{
+              item.templatename
+            }}</span>
           </div>
           <div style="margin-top: 10px">
-            鍒涘缓鏃堕棿锛�<span style="color: #2775b6"
-              >{{item.createTime}}</span
-            >
+            鍒涘缓鏃堕棿锛�<span style="color: #2775b6">{{ item.createTime }}</span>
           </div>
           <div style="margin-top: 10px">
-            瀹屾垚鏃堕棿锛�<span style="color: #2775b6"
-              >{{ item.finishtime }}</span
-            >
+            瀹屾垚鏃堕棿锛�<span style="color: #2775b6">{{ item.finishtime }}</span>
           </div>
           <div style="margin-top: 10px">
             <el-row :gutter="20">
@@ -648,9 +644,10 @@
               >
               <el-col :span="12"
                 >鐥呭尯锛�
-                <span style="color: #2775b6">{{ item.leavehospitaldistrictname }}</span></el-col
+                <span style="color: #2775b6">{{
+                  item.leavehospitaldistrictname
+                }}</span></el-col
               >
-
             </el-row>
           </div>
 
@@ -675,15 +672,15 @@
                 <span style="color: #2775b6">{{ item.drname }}</span></el-col
               >
               <el-col :span="6"
-                >璐d换鎶ゅ+ <span style="color: #2775b6">{{ item.nurseName }}</span></el-col
+                >璐d换鎶ゅ+
+                <span style="color: #2775b6">{{ item.nurseName }}</span></el-col
               >
             </el-row>
           </div>
           <div style="margin-top: 10px">
             缁撴灉鐘舵�侊細
-            <span style="color: #2775b6" v-if="item.excep==0">鏈嶅姟姝e父</span>
-            <span style="color: #B55E54" v-if="item.excep==1">寮傚父</span>
-
+            <span style="color: #2775b6" v-if="item.excep == 0">鏈嶅姟姝e父</span>
+            <span style="color: #b55e54" v-if="item.excep == 1">寮傚父</span>
           </div>
           <!-- <div style="margin-top: 10px">
             澶囨敞锛�
@@ -693,8 +690,8 @@
       </div>
     </div>
     <!-- 鍋ュ悍鐩戞祴 -->
-    <!-- <div class="medical-record" v-show="activeName == 'monitor'">
-      <div v-show="sontwoactiveName == 'blood'" style="display: flex">
+    <div class="medical-record" v-show="activeName == 'monitor'">
+      <!-- <div v-show="sontwoactiveName == 'blood'" style="display: flex">
         <div
           id="xyeCharts"
           class="sontwoactiveName"
@@ -710,8 +707,8 @@
             />
           </el-card>
         </div>
-      </div>
-      <div v-show="sontwoactiveName == 'glucose'" style="display: flex">
+      </div> -->
+      <!-- <div v-show="sontwoactiveName == 'glucose'" style="display: flex">
         <div
           id="xteCharts"
           class="sontwoactiveName"
@@ -727,7 +724,7 @@
             />
           </el-card>
         </div>
-      </div>
+      </div> -->
       <div v-show="sontwoactiveName == 'weight'" style="display: flex">
         <div
           id="tzeCharts"
@@ -736,16 +733,20 @@
         ></div>
         <div style="width: 400px">
           <el-card class="box-card">
+            <el-button @click="borninfoVisible = true" type="success" round
+              >娣诲姞鏁版嵁</el-button
+            >
             <SFtable
-              :currentList="tableDatalist"
+              :currentList="borninfooptions"
               :tableLabel="tableLabeltz"
+              :serialnumber="false"
               :center="false"
               :multiplechoice="false"
             />
           </el-card>
         </div>
       </div>
-      <div v-show="sontwoactiveName == 'heartrate'" style="display: flex">
+      <!-- <div v-show="sontwoactiveName == 'heartrate'" style="display: flex">
         <div
           id="xleCharts"
           class="sontwoactiveName"
@@ -761,8 +762,8 @@
             />
           </el-card>
         </div>
-      </div>
-      <div v-show="sontwoactiveName == 'bloodoxygen'" style="display: flex">
+      </div> -->
+      <!-- <div v-show="sontwoactiveName == 'bloodoxygen'" style="display: flex">
         <div
           id="xueyangeCharts"
           class="sontwoactiveName"
@@ -778,8 +779,8 @@
             />
           </el-card>
         </div>
-      </div>
-      <div v-show="sontwoactiveName == 'animalheat'" style="display: flex">
+      </div> -->
+      <!-- <div v-show="sontwoactiveName == 'animalheat'" style="display: flex">
         <div
           id="tweCharts"
           class="sontwoactiveName"
@@ -795,8 +796,8 @@
             />
           </el-card>
         </div>
-      </div>
-    </div> -->
+      </div> -->
+    </div>
 
     <el-dialog :title="titletb" :visible.sync="AddanumberVisible">
       <el-form :model="numberform" label-width="100px">
@@ -813,6 +814,48 @@
       <div slot="footer" class="dialog-footer">
         <el-button @click="AddanumberVisible = false">鍙� 娑�</el-button>
         <el-button type="primary" @click="archivecontact">纭� 瀹�</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="鏂扮敓鍎挎暟鎹柊澧�" :visible.sync="borninfoVisible">
+      <el-form
+        :rules="borninforules"
+        ref="borninfoform"
+        :model="borninfoform"
+        label-width="120px"
+      >
+        <!-- 韬珮 -->
+        <el-form-item label="韬珮(cm)" prop="height">
+          <el-input
+            v-model.number="borninfoform.height"
+            autocomplete="off"
+            placeholder="璇疯緭鍏ヨ韩楂橈紙30-120cm锛�"
+          >
+          </el-input>
+        </el-form-item>
+
+        <!-- 澶村洿 -->
+        <el-form-item label="澶村洿(cm)" prop="headCir">
+          <el-input
+            v-model.number="borninfoform.headCir"
+            autocomplete="off"
+            placeholder="璇疯緭鍏ュご鍥达紙20-60cm锛�"
+          >
+          </el-input>
+        </el-form-item>
+
+        <!-- 鑳庨緞 -->
+        <el-form-item label="鑳庨緞锛堝懆锛�" prop="age">
+          <el-input
+            v-model.number="borninfoform.age"
+            autocomplete="off"
+            placeholder="璇疯緭鍏ヨ儙榫�"
+          >
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="borninfoVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="newborninfoadd">纭� 瀹�</el-button>
       </div>
     </el-dialog>
   </div>
@@ -839,11 +882,12 @@
   Patientclinic,
 } from "@/api/patient/homepage";
 
+import { getsearchrResults, getTaskservelist } from "@/api/AiCentre/index";
 import {
-  getsearchrResults,
-  getTaskservelist,
-} from "@/api/AiCentre/index";
-import { listPatouthosp } from "@/api/smartor/patouthosp";
+  listPatouthosp,
+  newborninfoadd,
+  newborninfolist,
+} from "@/api/smartor/patouthosp";
 import { listpatient } from "@/api/patient/record";
 
 export default {
@@ -862,45 +906,100 @@
       tjnumber: 12,
       yynumber: 12,
       total: 0, // 鎬绘潯鏁�
+      borninfoVisible: false,
       titletb: "鏂板鑱旂郴鏂瑰紡",
       activeTab: "userinfo",
       id: "",
       loading: false,
       activeName: "health", //涓�绫诲鑸�
       sonactiveName: "inhospital", //鍋ュ悍鐩戞祴瀵艰埅
-      sontwoactiveName: "blood", //鍖荤枟妗f瀵艰埅
+      sontwoactiveName: "weight", //鍖荤枟妗f瀵艰埅
       dynamicTags: [],
+      borninforules: {
+        height: [
+          { required: true, message: "韬珮涓嶈兘涓虹┖", trigger: "blur" },
+          {
+            type: "number",
+            message: "蹇呴』涓烘暟瀛楀��",
+            trigger: "blur",
+          },
+          {
+            validator: (rule, value, callback) => {
+              // 鏂扮敓鍎胯韩楂樹竴鑸寖鍥达細30-120cm
+              if (value < 30 || value > 120) {
+                callback(new Error("璇疯緭鍏�30-120cm涔嬮棿鐨勫悎鐞嗚韩楂樺��"));
+              } else if (!/^[0-9]+(\.[0-9]{1})?$/.test(value)) {
+                callback(new Error("鏈�澶氫繚鐣欎竴浣嶅皬鏁�"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur",
+          },
+        ],
+        headCir: [
+          { required: true, message: "澶村洿涓嶈兘涓虹┖", trigger: "blur" },
+          { type: "number", message: "蹇呴』涓烘暟瀛楀��" },
+          {
+            validator: (rule, value, callback) => {
+              // 鏂扮敓鍎垮ご鍥翠竴鑸寖鍥达細20-60cm
+              if (value < 20 || value > 60) {
+                callback(new Error("璇疯緭鍏�20-60cm涔嬮棿鐨勫悎鐞嗗ご鍥村��"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur",
+          },
+        ],
+        age: [
+          { required: true, message: "鑳庨緞涓嶈兘涓虹┖", trigger: "blur" },
+          { type: "integer", message: "蹇呴』涓烘暣鏁板懆鏁�" },
+          {
+            validator: (rule, value, callback) => {
+              // 妫�鏌ユ槸鍚﹀凡瀛樺湪璇ュ懆鏁版暟鎹�
+              if (this.checkAgeExists(value)) {
+                callback(new Error("璇ュ懆鏁版暟鎹凡瀛樺湪锛岃鍕块噸澶嶆坊鍔�"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur",
+          },
+        ],
+      },
       record: [
         {
           name: "瀹f暀浠诲姟",
-          serviceType:'4',
-          templatename:'绠¢ゲ瀹f暀涓�鏈�',
-          createTime:'2024-11-10',
-          finishtime:'2024-11-12',
-          createBy:'鐜嬫斂',
-          drname:'鍒樻槑',
-          nurseName:'寮犳窇鐞�',
-          excep:'0',
-          deptname:'鍛煎惛绉�',
-          leavehospitaldistrictname:'浜旂梾鍖�',
+          serviceType: "4",
+          templatename: "绠¢ゲ瀹f暀涓�鏈�",
+          createTime: "2024-11-10",
+          finishtime: "2024-11-12",
+          createBy: "鐜嬫斂",
+          drname: "鍒樻槑",
+          nurseName: "寮犳窇鐞�",
+          excep: "0",
+          deptname: "鍛煎惛绉�",
+          leavehospitaldistrictname: "浜旂梾鍖�",
         },
         {
           name: "闅忚浠诲姟",
-          serviceType:'2',
-          templatename:'蹇冭绠¢殢璁夸竴鏈�',
-          createTime:'2024-11-11',
-          finishtime:'2024-11-14',
-          createBy:'绔犵▼',
-          drname:'鍒樻槑',
-          nurseName:'鏉庝附',
-          excep:'0',
-          deptname:'鍛煎惛绉�',
-          leavehospitaldistrictname:'浜旂梾鍖�',
+          serviceType: "2",
+          templatename: "蹇冭绠¢殢璁夸竴鏈�",
+          createTime: "2024-11-11",
+          finishtime: "2024-11-14",
+          createBy: "绔犵▼",
+          drname: "鍒樻槑",
+          nurseName: "鏉庝附",
+          excep: "0",
+          deptname: "鍛煎惛绉�",
+          leavehospitaldistrictname: "浜旂梾鍖�",
         },
         // {
         //   name: "闂嵎璋冩煡",
         // },
       ],
+      borninfoform: {},
       inputVisible: false,
       AddanumberVisible: false,
       inputValue: "",
@@ -958,6 +1057,7 @@
           label: "浣撴",
         },
       ],
+      borninfooptions: [],
       tableLabelxy: [
         { label: "娴嬮噺鏃堕棿", width: "", prop: "name" },
         { label: "鏀剁缉鍘�", width: "", prop: "sex" },
@@ -969,10 +1069,9 @@
         { label: "鑸掑紶鍘�", width: "", prop: "age" },
       ],
       tableLabeltz: [
-        { label: "娴嬮噺鏃堕棿", width: "", prop: "name" },
-        { label: "韬珮", width: "", prop: "sex" },
-        { label: "浣撻噸", width: "", prop: "age" },
-        { label: "BMI鎸囨暟", width: "", prop: "update_by" },
+        { label: "璐d换鍖荤敓", width: "", prop: "doctor" },
+        { label: "韬珮", width: "", prop: "height" },
+        { label: "澶村洿", width: "", prop: "headCir" },
       ],
       tableLabelxl: [
         { label: "娴嬮噺鏃堕棿", width: "", prop: "name" },
@@ -1025,21 +1124,6 @@
     this.id = this.$route.query.id;
     this.getuserinfo();
     this.gettabList();
-    this.$nextTick(function () {
-      this.echartdom = document.getElementById("xyeCharts");
-      this.xtechartdom = document.getElementById("xteCharts");
-      this.tzechartdom = document.getElementById("tzeCharts");
-      this.xlechartdom = document.getElementById("xleCharts");
-      this.xueyangechartdom = document.getElementById("xueyangeCharts");
-      this.twechartdom = document.getElementById("tweCharts");
-
-      this.echartsInit();
-      this.xtechartsInit();
-      this.tzechartsInit();
-      this.xlechartsInit();
-      this.xueyangechartsInit();
-      this.twechartsInit();
-    });
   },
 
   methods: {
@@ -1065,10 +1149,14 @@
           if (response.code == 200) {
             this.serviceDatacy = response.rows;
             console.log(this.serviceDatacy);
-            this.$forceUpdate()
+            this.$forceUpdate();
           }
         });
       }
+    },
+    checkAgeExists(newAge) {
+      // 鍋囪宸叉湁鏁版嵁瀛樺偍鍦� this.existingData 涓�
+      return this.borninfooptions.some((item) => item.age === parseInt(newAge));
     },
     getcontactlist() {
       listcontactinformation({ patid: this.id }).then((response) => {
@@ -1227,8 +1315,10 @@
     handleClick(tab, event) {
       if (tab.index == "1") {
         this.getList(1);
-      }else if (tab.index == "2") {
-this.handleClickfw();
+      } else if (tab.index == "2") {
+        this.newbornList();
+      } else if (tab.index == "3") {
+        this.handleClickfw();
       }
     },
     handleClickson(tab, event) {
@@ -1236,7 +1326,7 @@
       this.getList(tab.index);
     },
     // 鏌ヨ鏈嶅姟璁板綍
-    handleClickfw(){
+    handleClickfw() {
       getTaskservelist({
         patid: this.id,
       }).then((res) => {
@@ -1257,10 +1347,51 @@
       };
       listtag(tagqueryParams).then((response) => {
         this.options = response.rows;
+
         console.log(this.options, "鏍囩");
       });
     },
+    newcharts() {
+      this.$nextTick(function () {
+        // this.echartdom = document.getElementById("xyeCharts");
+        // this.xtechartdom = document.getElementById("xteCharts");
+        this.tzechartdom = document.getElementById("tzeCharts");
+        // this.xlechartdom = document.getElementById("xleCharts");
+        // this.xueyangechartdom = document.getElementById("xueyangeCharts");
+        // this.twechartdom = document.getElementById("tweCharts");
+
+        // this.echartsInit();
+        // this.xtechartsInit();
+        this.tzechartsInit();
+        // this.xlechartsInit();
+        // this.xueyangechartsInit();
+        // this.twechartsInit();
+      });
+    },
+
+    // 淇濆瓨鎸囨爣鏁版嵁
+    newborninfoadd() {
+      this.$refs["borninfoform"].validate((valid) => {
+        if (valid) {
+          this.borninfoform.patId = this.id;
+
+          newborninfoadd(this.borninfoform).then((res) => {
+            if (res.code == 200) {
+              this.$modal.msgSuccess("鏂板鎴愬姛");
+              this.newbornList();
+              this.borninfoVisible = false;
+            } else {
+              this.$modal.msgError("鏂板澶辫触");
+              this.newbornList();
+              this.borninfoVisible = false;
+            }
+          });
+        }
+      });
+    },
     remoteMethod(value) {
+      console.log("瑙﹀彂");
+
       const illnessqueryParams = {
         pageNum: 1,
         pageSize: 100,
@@ -1488,64 +1619,177 @@
       // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆�
       myxyChart.setOption(option);
     },
-    // 浣撻噸鍥捐〃
     tzechartsInit() {
-      // 鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥
+      // 鑾峰彇鏁版嵁闆嗗悎
+      this.newbornList()
+        .then(() => {
+          // 妫�鏌ユ暟鎹湁鏁堟��
+          if (!this.borninfooptions || this.borninfooptions.length === 0) {
+            console.warn("娌℃湁鍙敤鐨勬柊鐢熷効鏁版嵁");
+            return;
+          }
+          // 鎵惧嚭鏈�澶х殑age鍊硷紙纭畾X杞磋寖鍥达級
+          const maxAge = Math.max(
+            ...this.borninfooptions.map((item) => parseInt(item.age) || 0)
+          );
+          if (maxAge <= 0) {
+            console.error("鏃犳晥鐨勫懆鏁版暟鎹�");
+            return;
+          }
 
-      var myxyChart = echarts.init(this.tzechartdom);
-      var option = {
-        title: {
-          text: "浣撻噸鎸囨爣鍥�",
-        },
-        tooltip: {
-          trigger: "axis",
-        },
-        legend: {
-          data: ["韬珮", "浣撻噸", "BMI鎸囨暟"],
-        },
-        grid: {
-          left: "3%",
-          right: "4%",
-          bottom: "3%",
-          containLabel: true,
-        },
-        toolbox: {
-          feature: {
-            saveAsImage: {},
-          },
-        },
-        xAxis: {
-          type: "category",
-          boundaryGap: false,
-          data: ["涓�鏈�", "浜屾湀", "涓夋湀", "鍥涙湀", "浜旀湀", "鍏湀", "涓冩湀"],
-        },
-        yAxis: {
-          type: "value",
-        },
-        series: [
-          {
-            name: "韬珮",
-            type: "line",
-            stack: "Total",
-            data: [120, 132, 101, 134, 90, 230, 210],
-          },
-          {
-            name: "浣撻噸",
-            type: "line",
-            stack: "Total",
-            data: [220, 182, 191, 234, 290, 330, 310],
-          },
+          // 鍔ㄦ�佺敓鎴恱Axis鏁版嵁锛堜粠1鍛ㄥ埌鏈�澶у懆锛�
+          const xAxisData = Array.from(
+            { length: maxAge },
+            (_, i) => `${i + 1}鍛╜
+          );
 
-          {
-            name: "BMI鎸囨暟",
-            type: "line",
-            stack: "Total",
-            data: [320, 332, 301, 334, 390, 330, 320],
-          },
-        ],
-      };
-      // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆�
-      myxyChart.setOption(option);
+          // 鍒濆鍖栨暟鎹暟缁�
+          const heightData = Array(maxAge).fill(null);
+          const headCirData = Array(maxAge).fill(null);
+
+          // 閬嶅巻鎵�鏈夋暟鎹偣锛屽~鍏呭埌瀵瑰簲浣嶇疆
+          this.borninfooptions.forEach((item) => {
+            try {
+              const age = parseInt(item.age);
+              const height = parseFloat(item.height);
+              const headCir = parseFloat(item.headCir);
+
+              // 纭繚鏁版嵁鏈夋晥涓斿懆鏁板湪鑼冨洿鍐�
+              if (age > 0 && age <= maxAge) {
+                const weekIndex = age - 1;
+                if (!isNaN(height)) heightData[weekIndex] = height;
+                if (!isNaN(headCir)) headCirData[weekIndex] = headCir;
+              }
+            } catch (e) {
+              console.error("鏁版嵁澶勭悊閿欒:", e);
+            }
+          });
+
+          // 鑾峰彇鎮h�呭鍚嶏紙浣跨敤绗竴鏉℃湁鏁堟暟鎹級
+          const patientName = this.borninfooptions[0]?.name || "鏈煡";
+
+          // 鍒濆鍖栧浘琛�
+          const myxyChart = echarts.init(this.tzechartdom);
+          const option = {
+            title: {
+              text: `${patientName}鐢熼暱鍙戣偛鎸囨爣鍥綻,
+              left: "center",
+            },
+            tooltip: {
+              trigger: "axis",
+              formatter: function (params) {
+                let result = params[0].axisValue + "<br/>";
+                params.forEach((item) => {
+                  const value = item.value !== null ? item.value : "鏆傛棤鏁版嵁";
+                  result += `${item.marker} ${item.seriesName}: ${value}<br/>`;
+                });
+                return result;
+              },
+            },
+            legend: {
+              data: ["韬珮(cm)", "澶村洿(cm)"],
+              bottom: 10,
+            },
+            grid: {
+              left: "3%",
+              right: "4%",
+              bottom: "15%", // 涓哄浘渚嬬暀鍑虹┖闂�
+              containLabel: true,
+            },
+            toolbox: {
+              feature: {
+                saveAsImage: {
+                  title: "淇濆瓨鍥剧墖",
+                  pixelRatio: 2,
+                },
+                dataView: {
+                  title: "鏁版嵁瑙嗗浘",
+                  readOnly: true,
+                },
+              },
+              right: 20,
+            },
+            xAxis: {
+              type: "category",
+              boundaryGap: false,
+              data: xAxisData,
+              axisLabel: {
+                interval: 0, // 鏄剧ず鎵�鏈夋爣绛�
+                rotate: 30, // 鏍囩鏃嬭浆闃叉閲嶅彔
+              },
+            },
+            yAxis: {
+              type: "value",
+              axisLabel: {
+                formatter: "{value} cm",
+              },
+            },
+            series: [
+              {
+                name: "韬珮",
+                type: "line",
+                data: heightData,
+                symbol: "circle",
+                symbolSize: 8,
+                itemStyle: {
+                  color: "#5470C6",
+                },
+                lineStyle: {
+                  width: 3,
+                },
+                connectNulls: true, // 杩炴帴绌哄��
+              },
+              {
+                name: "澶村洿",
+                type: "line",
+                data: headCirData,
+                symbol: "circle",
+                symbolSize: 8,
+                itemStyle: {
+                  color: "#91CC75",
+                },
+                lineStyle: {
+                  width: 3,
+                },
+                connectNulls: true, // 杩炴帴绌哄��
+              },
+            ],
+            animationDuration: 1000, // 鍔ㄧ敾鏃堕暱
+          };
+
+          // 浣跨敤閰嶇疆椤规樉绀哄浘琛�
+          myxyChart.setOption(option);
+
+          // 绐楀彛澶у皬鍙樺寲鏃堕噸鏂拌皟鏁村浘琛ㄥぇ灏�
+          const resizeHandler = () => myxyChart.resize();
+          window.addEventListener("resize", resizeHandler);
+
+          // 鍦ㄧ粍浠堕攢姣佹椂绉婚櫎浜嬩欢鐩戝惉锛堝鏋滄槸Vue/React缁勪欢锛�
+          this.$once("hook:beforeDestroy", () => {
+            window.removeEventListener("resize", resizeHandler);
+            myxyChart.dispose();
+          });
+        })
+        .catch((error) => {
+          console.error("鍔犺浇鏁版嵁澶辫触:", error);
+        });
+    },
+
+    // 鑾峰彇鏂扮敓鍎挎暟鎹�
+    newbornList() {
+      return newborninfolist({ patId: this.id })
+        .then((response) => {
+          this.borninfooptions = response.rows || [];
+
+          this.newcharts();
+          console.log("鍔犺浇鐨勬柊鐢熷効鏁版嵁:", this.borninfooptions);
+          return Promise.resolve();
+        })
+        .catch((error) => {
+          console.error("璇锋眰鏁版嵁澶辫触:", error);
+          this.borninfooptions = [];
+          return Promise.reject(error);
+        });
     },
     // 蹇冪巼
     xlechartsInit() {

--
Gitblit v1.9.3