From 1bb225a8794efad3cdfb40776625e1a1b4b780e0 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期一, 28 四月 2025 12:15:20 +0800 Subject: [PATCH] 优化 --- src/views/honors/index.vue | 6 +- src/views/achievements/index.vue | 22 ++++++++++- src/views/achievements/details.vue | 57 ++++++++++++++++------------ src/views/directory/index.vue | 17 ++++---- 4 files changed, 65 insertions(+), 37 deletions(-) diff --git a/src/views/achievements/details.vue b/src/views/achievements/details.vue index c2b8297..748bcda 100644 --- a/src/views/achievements/details.vue +++ b/src/views/achievements/details.vue @@ -22,14 +22,14 @@ <p> <span v-for="(item, index) in details.author" :key="index">{{ item }}</span> </p> - <p v-if="details.abstract"> - <span>鎽樿锛�</span> - <span class="page-main-abstract" v-html="details.abstract"></span> + <p v-if="details.cleanAbstract"> + <span class="abstract-title">鎽樿锛�</span> + <span class="page-main-abstract-main" v-html="details.cleanAbstract"></span> </p> <p v-if="details.keyWords && details.keyWords.length > 0"> <span>鍏抽敭璇嶏細</span> <span class="page-main-keyword" v-for="(item, index) in details.keyWords" :key="index">{{ item - }}</span> + }}</span> </p> <p v-if="details.cmsItemType != 'video' && details.cmsItemType != 'audio'"> <el-button @click="openPdf(details.name)">鏌ョ湅鍏ㄦ枃</el-button> @@ -63,9 +63,9 @@ <li class="main-author"> {{ item.author }} </li> - <li class="main-title" :title="item.abstract" v-if="item.abstract"> + <li class="main-title" :title="item.abstract" v-if="item.cleanAbstract"> <span>鎽樿: </span> - <span class="page-main-abstract" v-html="item.abstract"></span> + <span class="page-main-abstract" v-html="item.cleanAbstract"></span> </li> <li class="main-keyword" v-if="item.keyWords && item.keyWords.length > 0"> <span>鍏抽敭璇嶏細</span> @@ -227,6 +227,10 @@ if (item.author && item.author.length > 0) { item.author = item.author.split(";"); } + if (item.abstract) { + item.cleanAbstract = item.abstract.replace(/<[^>]+>/g, ""); + } + const foundItem = this.category.list.find((citem) => citem.value == item.cmsItemType); item.resourceTypeName = foundItem ? foundItem.name : ''; }) @@ -447,6 +451,9 @@ // 璁剧疆涓�涓粯璁ゅ�兼垨鑰呰繘琛屽叾浠栭敊璇鐞� item.keyWords = []; } + if (item.abstract) { + item.cleanAbstract = item.abstract.replace(/<[^>]+>/g, ""); + } const foundItem = this.category.list.find((citem) => citem.value == item.cmsItemType); item.resourceTypeName = foundItem ? foundItem.name : ''; console.log(this.details.id, ""); @@ -496,6 +503,9 @@ } else { // 璁剧疆涓�涓粯璁ゅ�兼垨鑰呰繘琛屽叾浠栭敊璇鐞� item.keyWords = []; + } + if (item.abstract) { + item.cleanAbstract = item.abstract.replace(/<[^>]+>/g, ""); } const foundItem = this.category.list.find((citem) => citem.value == item.cmsItemType); item.resourceTypeName = foundItem ? foundItem.name : ''; @@ -582,11 +592,11 @@ font-size: 14px; background-color: transparent; color: #937950; - border: 1px solid #6f5a3a; + border: 1px solid #937950; border-radius: 0; &:hover { - background-color: #6f5a3a; + background-color: #937950; color: #fffdf8; } } @@ -630,11 +640,11 @@ font-size: 14px; background-color: #937950; color: #fff; - border: 1px solid #6f5a3a; + border: 1px solid #937950; border-radius: 0; &:hover { - background-color: #6f5a3a; + background-color: #937950; color: #fffdf8; } } @@ -642,9 +652,9 @@ .page-main-abstract { font-family: Source Han Sans !important; font-size: 14px !important; - font-weight: 350 !important; line-height: 26px !important; color: #333333 !important; + font-weight: 100 !important; } p:nth-child(1) { @@ -670,20 +680,21 @@ margin-bottom: 13px; font-family: Source Han Sans; font-size: 14px; - font-weight: 350; line-height: 26px; color: #333333; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; - -webkit-line-clamp: 3; + .abstract-title{ + font-weight: bold; + } span { font-family: Source Han Sans; font-size: 14px; - font-weight: bold; color: #333333; } + } p:nth-child(3) { @@ -816,16 +827,17 @@ font-size: 16px; font-weight: bold; color: #937950; + margin-bottom: 5px; ::v-deep .el-button { font-size: 14px; background-color: transparent; color: #937950; - border: 1px solid #6f5a3a; + border: 1px solid #937950; border-radius: 0; &:hover { - background-color: #6f5a3a; + background-color: #937950; color: #fffdf8; } } @@ -867,10 +879,7 @@ color: #333; border-left: 1px solid #2c2c2c; } - - - - margin-bottom: 10px; + margin-bottom: 15px; } .main-author { @@ -891,7 +900,7 @@ overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; - -webkit-line-clamp: 4; + -webkit-line-clamp: 3; span { font-family: Source Han Sans; @@ -947,6 +956,7 @@ object-fit: contain; } } + ::v-deep .el-loading-spinner { .el-loading-text { font-size: 14px; @@ -958,8 +968,6 @@ color: #937950; } } - - </style> <style lang="less"> @@ -990,7 +998,8 @@ .el-dialog__title, .el-dialog__headerbtn .el-dialog__close { color: #fff; - font-weight: 900;font-size: 16px; + font-weight: 900; + font-size: 16px; } } } diff --git a/src/views/achievements/index.vue b/src/views/achievements/index.vue index eb71247..5042a2b 100644 --- a/src/views/achievements/index.vue +++ b/src/views/achievements/index.vue @@ -160,7 +160,7 @@ </li> <li class="main-title" :title="item.cleanAbstract" v-if="item.abstract"> <span>鎽樿: </span> - <span class="page-main-abstract" v-html="item.abstract"></span> + <span class="page-main-abstract" v-html="item.cleanAbstract"></span> </li> <li class="main-keyword" v-if="item.keyWords && item.keyWords.length > 0"> <span>鍏抽敭璇嶏細</span> @@ -669,7 +669,21 @@ this.resultList = res.datas this.total = res.total; this.loading = false; + }).catch((error) => { + // 鎵撳嵃閿欒淇℃伅 + console.error("鑾峰彇鏁版嵁澶辫触:", error); }); + + // 婊氬姩鍒伴〉闈㈤《閮� + this.$nextTick(() => { + const pageMain = document.querySelector('.page-main-father'); + if (pageMain) { + pageMain.scrollTo({ + top: 0, + behavior: 'smooth' + }); + } + }); }, // 澶勭悊椤电爜鍙樺寲 handleCurrentChange(newPage) { @@ -1096,6 +1110,10 @@ color: #937950; margin-bottom: 5px; + p { + overflow: hidden; + } + ::v-deep .el-button { font-size: 14px; background-color: transparent; @@ -1145,7 +1163,7 @@ border-left: 1px solid #2c2c2c; } - margin-bottom: 10px; + margin-bottom: 15px; } .main-author { diff --git a/src/views/directory/index.vue b/src/views/directory/index.vue index 2d7af1d..cf9d3bd 100644 --- a/src/views/directory/index.vue +++ b/src/views/directory/index.vue @@ -313,7 +313,7 @@ methods: { changeTab(key) { this.activeTabs = key; - console.log(this.activeTabs, "activeTabs"); + // console.log(this.activeTabs, "activeTabs"); if (key == "chart") { this.initChart(); } @@ -328,7 +328,7 @@ formatter: (params) => { const data = params.data; this.currentNodeInfo = data; - console.log(data, "data"); + // console.log(data, "data"); if (data.cmsItemType == "student") { return ` <div style=" @@ -450,7 +450,7 @@ this.chart.setOption(option); this.chart.on("click", (params) => { - console.log("鐐瑰嚮鏃剁殑鍥炶皟", params); + // console.log("鐐瑰嚮鏃剁殑鍥炶皟", params); this.tooltipShow = true; }); }, @@ -474,7 +474,6 @@ }; }); this.academicDegreeList = academicDegreeListResult.option; - console.log(this.academicDegreeList, "this.academicDegreeList"); } catch (error) { console.error("鑾峰彇涓嬫媺妗嗘暟鎹け璐�:", error); } @@ -486,7 +485,6 @@ return MG.store .getProductTypeField(requestData) .then((res) => { - console.log(res, "涓嬫媺妗嗘暟鎹�"); const selestList = JSON.parse(res[0].config); return selestList; }) @@ -547,6 +545,7 @@ }); this.loading = false; console.log(res, "res"); + console.log(arrList, "arrList"); if (res.datas && res.datas.length) { res.datas.forEach((item) => { arrList.forEach((citem) => { @@ -563,16 +562,18 @@ }); }); arrList = arrList.filter((item) => item.studentList.length); - console.log(arrList, "arrList"); + + // console.log(arrList, "arrList"); + this.universityList = arrList; - // this.chartData.children = arrList; + this.chartData.children = arrList; const temp_chartData = { name: "鐜嬫案鐐�", children: arrList, }; this.chartData = temp_chartData; - console.log(this.chartData, "this.chartData"); + // console.log(this.chartData, "this.chartData"); this.initChart(); } }) diff --git a/src/views/honors/index.vue b/src/views/honors/index.vue index 4e91e52..b942876 100644 --- a/src/views/honors/index.vue +++ b/src/views/honors/index.vue @@ -74,9 +74,9 @@ start: (this.currentPage - 1) * 10, size: 10, }, - // coverSize: { - // height: 70 - // } + coverSize: { + height: 70 + } }).then((res) => { console.log(res, "res"); if (res.datas && res.datas.length) { -- Gitblit v1.9.1