From ce7cf2f67ec29aef55a889574942c58c8d7737bd Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期日, 27 四月 2025 17:10:30 +0800 Subject: [PATCH] 学术成果详情 --- src/views/achievements/index.vue | 79 +++++++++++++++++++++------------------ 1 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/views/achievements/index.vue b/src/views/achievements/index.vue index d4cab66..ff1d65c 100644 --- a/src/views/achievements/index.vue +++ b/src/views/achievements/index.vue @@ -144,7 +144,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> @@ -157,11 +157,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" v-for="(citem, cindex) in item.keyWords" :key="cindex"> {{ citem }} @@ -175,6 +175,7 @@ </el-pagination> </div> </div> + </div> </div> </div> @@ -195,6 +196,7 @@ }, data() { return { + relatedList: [], // 杈撳叆妗嗙殑鍐呭 inputValue: "", // 閫夋嫨鐨勭被鍨� @@ -446,8 +448,6 @@ }; }, mounted() { - this.getSelectContent(); - this.getLeftCheckbox() this.getSelectData(); }, @@ -458,9 +458,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) { @@ -479,11 +478,6 @@ this.professionIndex = 4; this.activeBox = this.activeBox === "b" ? null : "b"; } - }, - // 鑾峰彇宸︿晶checkbox鏁版嵁 - getLeftCheckbox() { - - }, //鑾峰彇涓嬫媺閫夋嫨妗嗙殑鍐呭 @@ -515,7 +509,6 @@ .getProductTypeField(requestData) .then((res) => { const selestList = JSON.parse(res[0].config); - console.log(selestList, "涓嬫媺妗嗘暟鎹�"); return selestList; }) .catch((error) => { @@ -530,13 +523,13 @@ (item) => item.content !== value ); this.inputValue = ""; + // 閫氱煡鐖剁粍浠舵暟鎹凡鏀瑰彉 this.getItemList() }, // 鎼滅储 handleSearch(isText) { - console.log(1234); - console.log(isText, "鎼滅储123"); + this.associationList = [] if (isText.text != "") { this.inputValue = isText.text this.inputType = isText.type @@ -548,29 +541,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) { - searchData[item.value + "*"] = this.inputValue - } else { - searchData["||" + item.value + "*"] = this.inputValue + const item = this.inputOptions[index]; // 鑾峰彇褰撳墠閫夐」 + if (item.value !== "all") { // 濡傛灉褰撳墠閫夐」鐨勫�间笉鏄�"all" + if (!Object.keys(searchData).length) { // 濡傛灉searchData鏄┖鐨� + // 灏嗙涓�涓�夐」鐨勫�间笌杈撳叆鍊煎叧鑱旓紝骞舵坊鍔犱竴涓槦鍙�(*)浣滀负鍚庣紑 + searchData[item.value + "*"] = this.inputValue; + } else { // 濡傛灉searchData涓嶆槸绌虹殑 + // 浣跨敤"||"浣滀负鍓嶇紑锛屽皢鍚庣画閫夐」鐨勫�间笌杈撳叆鍊煎叧鑱旓紝骞舵坊鍔犱竴涓槦鍙�(*)浣滀负鍚庣紑 + // 杩欓�氬父鐢ㄤ簬鏋勫缓涓�涓�昏緫鎴栵紙OR锛夋煡璇� + searchData["||" + item.value + "*"] = this.inputValue; } } } } - - console.log(searchData, "鎼滅储鏁版嵁123"); } - debugger MG.resource .getItem({ path: "*", @@ -595,7 +589,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') { @@ -604,18 +599,29 @@ // 璁剧疆涓�涓粯璁ゅ�兼垨鑰呰繘琛屽叾浠栭敊璇鐞� item.keyWords = []; } - item.resourceTypeName = this.category.list.find((citem) => citem.value == item.cmsItemType).name + // 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' + }); + } + }); }, }, @@ -660,7 +666,7 @@ flex: 1; width: 100%; height: 100%; - min-width: 1292px; + min-width: 1250px; overflow: auto; padding-top: 1%; padding-bottom: 2%; @@ -741,6 +747,7 @@ background-color: transparent; color: #937950; border: 1px solid #6f5a3a; + cursor: pointer; &:hover { background-color: #6f5a3a; @@ -1132,4 +1139,4 @@ border-radius: 5px; border: 1px solid #cccccc; } -</style> +</style> \ No newline at end of file -- Gitblit v1.9.1