From daa13602cd5c0c272bb303bdf4ca01709a2bb4aa Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期日, 27 四月 2025 18:12:39 +0800
Subject: [PATCH] bug修改

---
 src/views/achievements/details.vue |   35 ++++++++++++++---------------------
 1 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/src/views/achievements/details.vue b/src/views/achievements/details.vue
index e12fdfa..68570c7 100644
--- a/src/views/achievements/details.vue
+++ b/src/views/achievements/details.vue
@@ -78,14 +78,17 @@
         </li>
       </ul>
     </div>
-    <el-dialog v-model="dialogVisible" :title="pdfName" width="60vw" top="2vh" bottom="2vh"
+    <el-empty v-if="!loading && details == ''"></el-empty>
+    <el-dialog v-model="dialogVisible" :title="pdfName" width="60vw" top="3vh" bottom="2vh"
       :visible.sync="dialogVisible" class="custom-dialog">
-      <div class="pdfInfoBox">
+      <div class="pdfInfoBox" v-loading="pdfLoading" element-loading-text="鍥剧墖鍔犺浇涓�"
+        element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0)">
         <div v-for="(item, index) in pdfList" :key="index" class="pdfItem" :page="index + 1">
           <img :src="item.showSrc" alt="" style="min-height: 550px" loading="lazy" />
           <el-divider content-position="center"> 绗� {{ index + 1 }} 椤� </el-divider>
         </div>
       </div>
+      <el-empty v-if="!pdfLoading && !pdfList.length"></el-empty>
     </el-dialog>
   </div>
 </template>
@@ -152,13 +155,12 @@
       // 鏌ヨ缁撴灉
       resultList: [],
       loading: false,
+      pdfLoading: false,
     };
   },
   async mounted() {
     await this.getContent(this.$route.query.id);
     await this.getSelectData();
-    console.log(this.details, "璇锋眰鍑烘潵鐨勬暟鎹�");
-
     // 鏌ユ壘鍏抽敭璇嶇浉鍖归厤鐨勬枃绔�
     if (this.details.keyWords && this.details.keyWords.length) {
       for (let i = 0; i < this.details.keyWords.length; i++) {
@@ -167,6 +169,7 @@
         this.inputType = "keyWords"
         await this.getItemListOne()
       }
+      this.loading = false;
       console.log(this.resultList, "澶勭悊濂界殑");
     } else {
       this.getItemList()
@@ -174,6 +177,7 @@
     if (this.resultList.length == 0) {
       this.getItemList()
     }
+
     //澶勭悊鏂囦欢
     if (this.details.cmsItemType == "video" || this.details.cmsItemType == "audio") {
       if (this.details.file != "") {
@@ -193,6 +197,7 @@
   methods: {
     // 鏍规嵁id璇锋眰璇ラ〉闈㈡暟鎹�
     async getContent(id) {
+      this.loading = true;
       const res = await MG.resource
         .getItem({
           path: "*",
@@ -219,14 +224,13 @@
           // 璁剧疆涓�涓粯璁ゅ�兼垨鑰呰繘琛屽叾浠栭敊璇鐞�
           item.keyWords = [];
         }
-        if(item.author && item.author.length>0){
+        if (item.author && item.author.length > 0) {
           item.author = item.author.split(";");
         }
         const foundItem = this.category.list.find((citem) => citem.value == item.cmsItemType);
         item.resourceTypeName = foundItem ? foundItem.name : '';
       })
       this.details = res.datas[0]
-      this.loading = false;
     },
 
     // 鍦ㄦ鐐瑰嚮璇︽儏
@@ -248,6 +252,7 @@
       if (this.resultList.length == 0) {
         this.getItemList()
       }
+
       //澶勭悊鏂囦欢
       if (this.details.cmsItemType == "video" || this.details.cmsItemType == "audio") {
         if (this.details.file != "") {
@@ -308,6 +313,7 @@
           showSrc: ''
         })
       }
+      this.pdfLoading = false;
       // 鍚姩椤电爜瑙傚療
       setTimeout(() => {
         this.initObservation()
@@ -355,7 +361,6 @@
 
     //鑾峰彇涓嬫媺閫夋嫨妗嗙殑鍐呭
     async getSelectData() {
-      this.loading = true;
       try {
         // 鍚屾椂鍙戣捣涓や釜寮傛璇锋眰锛屽苟绛夊緟瀹冧滑鐨勭粨鏋�
         const [resourceListResult] = await Promise.all([
@@ -450,22 +455,10 @@
           this.resultList.push(item);
         }
       });
-      // 鎺掗櫎鑷韩涓斿幓閲�
-
-      // const relatedList = res.datas.filter((item) => {
-      //   return item.id !== this.details.id;
-      // });
-      // this.resultList.push(...relatedList)
-      // // 鏍规嵁id鍘婚噸
-      // this.resultList = this.uniqueById(this.resultList);
-      // //鏈�澶氭樉绀�10鏉�
-      // if (this.resultList.length > 10) {
-      //   this.resultList = this.resultList.slice(0, 10);
-      // }
-      this.loading = false;
     },
 
     async openPdf(name) {
+      this.pdfLoading = true;
       this.pdfList = []
       this.pdfName = name;
       this.dialogVisible = true;
@@ -923,7 +916,7 @@
           }
 
           .keyWord {
-            cursor: pointer;
+
             padding: 5px 10px;
             color: #937950;
             border: 1px solid #937950;

--
Gitblit v1.9.1