From e33eb0eb98aa0a88d2b3a7163abf92e4e028fb31 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期五, 17 五月 2024 21:09:39 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TCM_CharacterLibrary

---
 src/pages/inherit/index.vue |   42 ++++++++++++++++++++++++------------------
 1 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/src/pages/inherit/index.vue b/src/pages/inherit/index.vue
index 88a8415..2da7bd0 100644
--- a/src/pages/inherit/index.vue
+++ b/src/pages/inherit/index.vue
@@ -71,7 +71,10 @@
     </div>
     <div class="contentBox">
       <!-- echarts鍥� -->
-      <div class="barChart" ref="barChart"></div>
+      <div v-if="nodeData.length > 0" class="barChart" ref="barChart"></div>
+      <div v-else>
+        <el-empty description="鏆傛棤鏁版嵁"></el-empty>
+      </div>
       <div
         class="toolBox"
         v-if="showTool"
@@ -88,7 +91,7 @@
 import * as echarts from "echarts";
 import {
   inheritMedicalSataStatistics,
-  inheritMedicalList
+  inheritMedicalList,
 } from "@/api/index.js";
 export default {
   data() {
@@ -96,7 +99,7 @@
       // 鏍囬椤堕儴鏍忛渶瑕佺殑涓滆タ
       keyword: "",
       idIndex: 0,
-      activeId: "",
+      activeId: 28,
       conditionId: "",
       searchType: "KEYWORD",
       dynasty: [],
@@ -104,33 +107,36 @@
       showTool: false,
       toolTop: 0,
       toolLeft: 0,
-      toolInfo: {}
+      toolInfo: {},
     };
   },
   onLoad(options) {
     this.idIndex = options.id;
     console.log("optionsoptionsoptions", options.id);
-    getDynasty()
+    // getDynasty();
   },
   mounted() {
     this.getStatistics();
-    this.getData();
-    this.getDynasty()
-
+    // this.getDynasty();
   },
   methods: {
     getStatistics() {
       inheritMedicalSataStatistics().then((res) => {
         this.dynasty = res.object;
+        const defaultDynasty = this.dynasty.find((f) => f.dynasty == "瀹�");
+        this.activeId = defaultDynasty.dynastyId;
+        this.searchType = "DYNASTY";
+        this.getData();
       });
     },
     getData() {
       this.nodeData = [];
+
       inheritMedicalList({
         keywords: this.keyword,
         dynastyId: this.activeId,
         searchType: this.searchType,
-        path: this.conditionId
+        path: this.conditionId,
       }).then((res) => {
         console.log(res);
         for (let i = 0; i < res.object.nodeList.length; i++) {
@@ -143,12 +149,12 @@
               itemStyle: {
                 color: "#F8E2D7",
                 borderColor: "#F3AA78",
-                borderWidth: "3"
-              }
+                borderWidth: "3",
+              },
             });
           }
         }
-        console.log(this.nodeData);
+        console.log(this.nodeData, "nodeData");
         // 鍒濆鍖� echarts
         this.initBarChart();
       });
@@ -254,7 +260,7 @@
           this.toolLeft = params.event.offsetX + "px";
           this.toolInfo = {
             id: params.data.identifier,
-            name: encodeURIComponent(params.data.name)
+            name: encodeURIComponent(params.data.name),
           };
         } else {
           this.showTool = false;
@@ -265,7 +271,7 @@
       switch (type) {
         case 1:
           uni.navigateTo({
-            url: "/pages/character/detail?id=" + this.toolInfo.id
+            url: "/pages/character/detail?id=" + this.toolInfo.id,
           });
           break;
         case 2:
@@ -276,7 +282,7 @@
               "&id=" +
               this.toolInfo.id +
               "&name=" +
-              this.toolInfo.name
+              this.toolInfo.name,
           });
           break;
         case 3:
@@ -287,7 +293,7 @@
               "&id=" +
               this.toolInfo.id +
               "&name=" +
-              this.toolInfo.name
+              this.toolInfo.name,
           });
           break;
       }
@@ -327,8 +333,8 @@
         this.keyword = "";
       }
       this.getData();
-    }
-  }
+    },
+  },
 };
 </script>
 <style scoped>

--
Gitblit v1.9.1