From db5aed78bc305815558e97f9a1110cc2fa993bc9 Mon Sep 17 00:00:00 2001
From: TreeWish <1131093754@qq.com>
Date: 星期二, 28 二月 2023 22:11:57 +0800
Subject: [PATCH] 处理全国项目&单个项目数据

---
 src/components/chart/projectintroduction.vue |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/components/chart/projectintroduction.vue b/src/components/chart/projectintroduction.vue
index 87cf7ba..5e9c81c 100644
--- a/src/components/chart/projectintroduction.vue
+++ b/src/components/chart/projectintroduction.vue
@@ -2,11 +2,11 @@
   <div class="projectintroduction">
     <div class="item">
       <div class="itemName">椤圭洰鍚嶇О:</div>
-      <div class="itemValue" :title="result.projname">
+      <div class="itemValue" :title="projname">
         {{
-          result.projname.length > 15
-            ? result.projname.substring(0, 15)
-            : result.projname
+          projname.length > 15
+            ? projname.substring(0, 15)
+            : projname
         }}
       </div>
     </div>
@@ -30,7 +30,7 @@
       <div class="itemName">宸ョ▼鍐呭:</div>
       <div class="itemValue">
         {{
-          result.contents.length > 15
+          result.contents && result.contents.length > 15
             ? result.contents.substring(0, 15)
             : result.contents
         }}
@@ -69,6 +69,7 @@
         remarks: "娴嬭瘯鐢紝鍐呭铏氭瀯",
         updateuser: 1,
       },
+      projname: "瑗挎皵涓滆緭涓夌嚎锛堜腑鍗�-鏋i槼锛�",
     }
   },
   created() {
@@ -78,12 +79,17 @@
       }
       this.getDataList(params)
     })
+    this.$bus.$on("changeProject", name => {
+      this.projname = name
+    })
   },
   methods: {
     async getDataList(params) {
       const res = await selectProjectInfo(params)
       if (res.code == 200) {
-        this.result = res.result
+        if (res.result.length > 0) {
+          this.result = res.result[0]
+        }
       }
     },
     //鑾峰彇鏃堕棿

--
Gitblit v1.9.3