From 231de87426edb19d38e62a669034108e3a74069d Mon Sep 17 00:00:00 2001
From: 杨磊 <505174330@qq.com>
Date: 星期日, 27 四月 2025 18:10:48 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/wyyDatabase

---
 src/views/achievements/index.vue |   83 ++++++++++++++++++++++-------------------
 1 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/src/views/achievements/index.vue b/src/views/achievements/index.vue
index 4faf930..0d9ce7f 100644
--- a/src/views/achievements/index.vue
+++ b/src/views/achievements/index.vue
@@ -238,7 +238,7 @@
               <li class="main-name">
                 <p>{{ item.name }}</p>
                 <p>
-                  <el-button @click="goPage(item)">璇︽儏</el-button>
+                  <el-button @click="goPage(item.id)">璇︽儏</el-button>
                   <el-button>AI鏅鸿兘闃呰</el-button>
                 </p>
               </li>
@@ -251,11 +251,11 @@
               <li class="main-author">
                 {{ item.author }}
               </li>
-              <li class="main-title" :title="item.abstract">
+              <li class="main-title" :title="item.cleanAbstract" v-if="item.abstract">
                 <span>鎽樿: </span>
                 <span class="page-main-abstract" v-html="item.abstract"></span>
               </li>
-              <li class="main-keyword">
+              <li class="main-keyword" v-if="item.keyWords && item.keyWords.length > 0">
                 <span>鍏抽敭璇嶏細</span>
                 <span
                   class="keyWord"
@@ -279,6 +279,7 @@
               </el-pagination>
             </div>
           </div>
+
         </div>
       </div>
     </div>
@@ -299,6 +300,7 @@
   },
   data() {
     return {
+      relatedList: [],
       // 杈撳叆妗嗙殑鍐呭
       inputValue: "",
       // 閫夋嫨鐨勭被鍨�
@@ -562,8 +564,6 @@
     };
   },
   mounted() {
-    this.getSelectContent();
-    this.getLeftCheckbox();
     this.getSelectData();
   },
 
@@ -612,9 +612,8 @@
       // this.onSearch("");
     },
     // 椤甸潰璺宠浆
-    goPage(key) {
-      console.log(key, "key");
-      this.$router.push({ name: "details", params: { key: key } });
+    goPage(id) {
+      this.$router.push({ name: "details", query: { id } });
     },
     // 鏀惰捣鍜屽睍绀�
     shrinkClick(key, name) {
@@ -634,8 +633,6 @@
         this.activeBox = this.activeBox === "b" ? null : "b";
       }
     },
-    // 鑾峰彇宸︿晶checkbox鏁版嵁
-    getLeftCheckbox() {},
 
     //鑾峰彇涓嬫媺閫夋嫨妗嗙殑鍐呭
     async getSelectData() {
@@ -667,7 +664,6 @@
         .getProductTypeField(requestData)
         .then((res) => {
           const selestList = JSON.parse(res[0].config);
-          console.log(selestList, "涓嬫媺妗嗘暟鎹�");
           return selestList;
         })
         .catch((error) => {
@@ -682,13 +678,13 @@
         (item) => item.content !== value
       );
       this.inputValue = "";
-      this.getItemList();
+      // 閫氱煡鐖剁粍浠舵暟鎹凡鏀瑰彉
+      this.getItemList()
     },
 
     // 鎼滅储
     handleSearch(isText) {
-      console.log(1234);
-      console.log(isText, "鎼滅储123");
+      this.associationList = []
       if (isText.text != "") {
         this.inputValue = isText.text;
         this.inputType = isText.type;
@@ -700,32 +696,30 @@
       }
     },
 
-    // getTtem
+    // 璇锋眰鏁版嵁
     getItemList() {
-      let searchData = {};
-      if (this.inputValue) {
-        if (this.inputType != "all") {
+      let searchData = {}; // 鍒濆鍖栦竴涓┖瀵硅薄鏉ュ瓨鍌ㄦ悳绱㈡暟鎹�
+      if (this.inputValue) { // 濡傛灉杈撳叆鍊煎瓨鍦�
+        if (this.inputType != "all") { // 濡傛灉杈撳叆绫诲瀷涓嶆槸"all"
+          // 灏嗚緭鍏ュ�间笌杈撳叆绫诲瀷鍏宠仈锛屽苟娣诲姞涓�涓槦鍙�(*)浣滀负鍚庣紑
           searchData[this.inputType + "*"] = this.inputValue;
-        } else {
+        } else { // 濡傛灉杈撳叆绫诲瀷鏄�"all"
+          // 閬嶅巻杈撳叆閫夐」
           for (let index = 0; index < this.inputOptions.length; index++) {
-            const item = this.inputOptions[index];
-            if (item.value !== "all") {
-              console.log(item.value, "987");
-              if (!Object.keys(searchData).length) {
+            const item = this.inputOptions[index]; // 鑾峰彇褰撳墠閫夐」
+            if (item.value !== "all") { // 濡傛灉褰撳墠閫夐」鐨勫�间笉鏄�"all"
+              if (!Object.keys(searchData).length) { // 濡傛灉searchData鏄┖鐨�
+                // 灏嗙涓�涓�夐」鐨勫�间笌杈撳叆鍊煎叧鑱旓紝骞舵坊鍔犱竴涓槦鍙�(*)浣滀负鍚庣紑
                 searchData[item.value + "*"] = this.inputValue;
-              } else {
+              } else { // 濡傛灉searchData涓嶆槸绌虹殑
+                // 浣跨敤"||"浣滀负鍓嶇紑锛屽皢鍚庣画閫夐」鐨勫�间笌杈撳叆鍊煎叧鑱旓紝骞舵坊鍔犱竴涓槦鍙�(*)浣滀负鍚庣紑
+                // 杩欓�氬父鐢ㄤ簬鏋勫缓涓�涓�昏緫鎴栵紙OR锛夋煡璇�
                 searchData["||" + item.value + "*"] = this.inputValue;
               }
             }
           }
         }
       }
-      if (this.associationList && this.associationList.length) {
-        this.associationList.forEach((item) => {
-          searchData[item.value + "*"] = item.content;
-        });
-      }
-      console.log(searchData, "searchData");
       MG.resource
         .getItem({
           path: "*",
@@ -757,7 +751,8 @@
           },
         })
         .then((res) => {
-          console.log(res, "鍏ㄩ儴鏁版嵁");
+          console.log(res, "鍏ㄩ儴鍐呭");
+
           res.datas.forEach((item) => {
             item.year = moment(item.year).format("YYYY-MM-DD");
             if (typeof item.keyWords === "string") {
@@ -766,20 +761,29 @@
               // 璁剧疆涓�涓粯璁ゅ�兼垨鑰呰繘琛屽叾浠栭敊璇鐞�
               item.keyWords = [];
             }
-            item.resourceTypeName = this.category.list.find(
-              (citem) => citem.value == item.cmsItemType
-            ).name;
-          });
-          this.resultList = res.datas;
+            // item.cleanAbstract = item.abstract.replace(/<[^>]+>/g, "");
+            const foundItem = this.category.list.find((citem) => citem.value == item.cmsItemType);
+            item.resourceTypeName = foundItem ? foundItem.name : '';
+          })
+          this.resultList = res.datas
           this.total = res.total;
           this.loading = false;
         });
     },
-
     // 澶勭悊椤电爜鍙樺寲
     handleCurrentChange(newPage) {
       this.paginationPage = newPage;
       this.getItemList(); // 閲嶆柊鑾峰彇鏁版嵁
+      // 婊氬姩鍒伴〉闈㈤《閮�
+      this.$nextTick(() => {
+        const pageMain = document.querySelector('.page-main-father');
+        if (pageMain) {
+          pageMain.scrollTo({
+            top: 0,
+            behavior: 'smooth'
+          });
+        }
+      });
     },
     sortChange() {
       this.postedSortInfo = !this.postedSortInfo;
@@ -827,7 +831,7 @@
   flex: 1;
   width: 100%;
   height: 100%;
-  min-width: 1292px;
+  min-width: 1250px;
   overflow: auto;
   padding-top: 1%;
   padding-bottom: 2%;
@@ -908,6 +912,7 @@
         background-color: transparent;
         color: #937950;
         border: 1px solid #6f5a3a;
+        cursor: pointer;
 
         &:hover {
           background-color: #6f5a3a;
@@ -1300,4 +1305,4 @@
   border-radius: 5px;
   border: 1px solid #cccccc;
 }
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.1