From a5abb70a428f59894fc9ee4330f0033d6fe93a8b Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期四, 24 四月 2025 18:38:13 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/wyyDatabase --- src/views/achievements/index.vue | 128 +++++++++++++++++++++++++++++++++++++++--- 1 files changed, 117 insertions(+), 11 deletions(-) diff --git a/src/views/achievements/index.vue b/src/views/achievements/index.vue index 71406e4..6f655ea 100644 --- a/src/views/achievements/index.vue +++ b/src/views/achievements/index.vue @@ -10,7 +10,7 @@ <!-- 鎼滅储妗� --> <ul class="page-input"> <li class="input-main"> - <SearchBox /> + <SearchBox @search="handleSearch" /> </li> <li class="input-txt" @click="isDisplay = !isDisplay"> 楂樼骇妫�绱� @@ -131,7 +131,7 @@ <!-- 鍏眡x鏉� --> <ul class="right-number"> <ul class="number-number"> - 鍏辨壘鍒�<span>{{ resultList.length }}</span>鏉$粨鏋� + 鍏辨壘鍒�<span>{{ this.total }}</span>鏉$粨鏋� </ul> <ul class="number-time"> 鍙戣〃鏃堕棿 @@ -148,27 +148,28 @@ </p> </li> <li class="main-sources"> - <span>{{ item.type }}</span> - <span>{{ item.sources }}</span> - <span>{{ item.time }}</span> + <span>{{ item.resourceTypeName }}</span> + <span>{{ item.source }}</span> + <span>{{ item.year }}</span> </li> <li class="main-author"> {{ item.author }} </li> - <li class="main-title" :title="item.title"> - <span>鎽樿: </span>{{ item.title }} + <li class="main-title" :title="item.abstract"> + <span>鎽樿: </span> + <span class="page-main-abstract" v-html="item.abstract"></span> </li> <li class="main-keyword"> <span>鍏抽敭璇嶏細</span> - <span class="keyWord" v-for="(citem, cindex) in item.keyword" :key="cindex"> - {{ citem.name }} + <span class="keyWord" v-for="(citem, cindex) in item.keyWords" :key="cindex"> + {{ citem }} </span> </li> </ul> <!-- 鍒嗛〉 --> <div class="pagination"> - <el-pagination class="msg-pagination-container" :background="isBackground" layout="prev, pager, next" - :total="200"> + <el-pagination @current-change="handleCurrentChange" class="msg-pagination-container" + :background="isBackground" layout="prev, pager, next" :total="total"> </el-pagination> </div> </div> @@ -181,6 +182,8 @@ <script> import MyForm from "@/components/form/form.vue"; import SearchBox from "@/views/home/components/searchBox.vue"; +import MG from "@/assets/js/middleGround/WebMiddleGroundApi.js"; +import moment from "moment"; /* eslint-disable vue/no-unused-components */ export default { name: "achievements", @@ -190,6 +193,8 @@ }, data() { return { + subjectAffiliationRefCode: "subjectAffiliation", + resourceTypeRefCode: "resourceType", errorIcon: require("@/assets/images/achievements/errorIcon.png"), topIcon: require("@/assets/images/achievements/top-Icon.png"), bottomIcon: require("@/assets/images/achievements/bottom-Icon.png"), @@ -571,7 +576,16 @@ ], }, ], + total: 0, + currentPage: 1, + loading: false, }; + }, + mounted() { + this.getSelectContent(); + this.getLeftCheckbox() + this.getSelectData(); + this.getItemList() }, methods: { @@ -582,6 +596,7 @@ }, // 椤甸潰璺宠浆 goPage(key) { + console.log(key,"key"); this.$router.push({ name: "details", params: { key: key } }); }, // 鏀惰捣鍜屽睍绀� @@ -602,6 +617,88 @@ this.activeBox = this.activeBox === "b" ? null : "b"; } }, + // 鑾峰彇宸︿晶checkbox鏁版嵁 + getLeftCheckbox() { + + + }, + + //鑾峰彇涓嬫媺閫夋嫨妗嗙殑鍐呭 + async getSelectData() { + try { + // 鍚屾椂鍙戣捣涓や釜寮傛璇锋眰锛屽苟绛夊緟瀹冧滑鐨勭粨鏋� + const [subjectListResult, resourceListResult] = await Promise.all([ + this.getSelectContent(this.subjectAffiliationRefCode), + this.getSelectContent(this.resourceTypeRefCode), + ]); + this.subject.list = subjectListResult.option + this.category.list = resourceListResult.option; + } catch (error) { + console.error("鑾峰彇涓嬫媺妗嗘暟鎹け璐�:", error); + } + }, + + //鑾峰彇閫夋嫨鍐呭 + getSelectContent(refCode) { + let requestData = { refCodes: [refCode] }; + return MG.store + .getProductTypeField(requestData) + .then((res) => { + const selestList = JSON.parse(res[0].config); + this.getLeftCheckbox() + return selestList; + }) + .catch((error) => { + console.error("鑾峰彇鑽h獕澶辫触:", error); + return null; + }); + }, + + // 鎼滅储 + handleSearch(text, type) { + console.log(1234); + console.log(text, type, "鎼滅储123"); + }, + + // getTtem + getItemList() { + this.loading = true; + MG.resource + .getItem({ + path: "*", + queryType: "*", + paging: { + start: (this.currentPage - 1) * 6, + size: 6 + }, + fields: { + cmsType: ["cmsItem"], + resourceType: [], + source: [], + year: [], + abstract: [], + keyWords: [], + }, + }) + .then((res) => { + console.log(res, "鍏ㄩ儴鏁版嵁"); + res.datas.forEach((item) => { + item.year = moment(item.year).format("YYYY-MM-DD") + item.keyWords = item.keyWords.split(";;") + item.resourceTypeName = this.category.list.find((citem) => citem.value == item.resourceType).name + }) + this.resultList = res.datas + this.total = res.total; + this.loading = false; + }) + }, + + // 澶勭悊椤电爜鍙樺寲 + handleCurrentChange(newPage) { + this.currentPage = newPage; + this.getItemList(); // 閲嶆柊鑾峰彇鏁版嵁 + }, + }, }; </script> @@ -644,6 +741,7 @@ flex: 1; width: 100%; height: 100%; + min-width: 1292px; overflow: auto; padding-top: 1%; padding-bottom: 2%; @@ -1029,6 +1127,14 @@ } } + .page-main-abstract { + font-family: Source Han Sans !important; + font-size: 14px !important; + font-weight: 350 !important; + line-height: 26px !important; + color: #333333 !important; + } + .main-keyword { span:nth-child(1) { font-family: Source Han Sans; -- Gitblit v1.9.1