From 2b223db62940c58c9f2686558972a476869bb59d Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期四, 24 四月 2025 18:36:49 +0800 Subject: [PATCH] 学术成果接口 --- src/views/achievements/index.vue | 128 +++++++++++++++++++++++-- src/views/achievements/details.vue | 90 ++++++++--------- src/views/home/components/searchBox.vue | 24 +++- 3 files changed, 175 insertions(+), 67 deletions(-) diff --git a/src/views/achievements/details.vue b/src/views/achievements/details.vue index 4fab097..1e76411 100644 --- a/src/views/achievements/details.vue +++ b/src/views/achievements/details.vue @@ -1,73 +1,50 @@ <template> <div class="page"> <div class="page-header"> - <p>鐜嬫案鐐庨櫌澹鏈垚鏋�</p> + <p><span>鐜嬫案鐐庨櫌澹鏈垚鏋�</span></p> </div> <div class="page-main-father"> <ul class="page-main"> <li class="page-main-name"> <p> - <el-button icon="el-icon-arrow-left" @click="goBack()" - >杩斿洖</el-button - > + <el-button icon="el-icon-arrow-left" @click="goBack()">杩斿洖</el-button> </p> <p>{{ detailsList.name }}</p> </li> <li class="page-main-time"> <p> - <span>{{ detailsList.sources }}</span> - <span>{{ detailsList.time }}</span> + <span>{{ detailsList.source }}</span> + <span>{{ detailsList.year }}</span> </p> </li> <li class="page-main-title"> <p> - <span - v-for="(item, index) in detailsList.characterList" - :key="index" - >{{ item.name }}</span - > + <span v-for="(item, index) in detailsList.characterList" :key="index">{{ item.name }}</span> </p> - <p><span>鎽樿锛�</span>{{ detailsList.title }}</p> + <p> + <span>鎽樿锛�</span> + <span class="page-main-abstract" v-html="detailsList.abstract"></span> + </p> <p> <span>鍏抽敭璇嶏細</span> - <span - class="page-main-keyword" - v-for="(item, index) in detailsList.keyword" - :key="index" - >{{ item.name }}</span - > + <span class="page-main-keyword" v-for="(item, index) in detailsList.keyWords" :key="index">{{ item + }}</span> </p> <p v-if="!isDisplay"> <el-button @click="isDisplay = !isDisplay">鏌ョ湅鍏ㄦ枃</el-button> </p> <p class="page-main-video" v-if="isDisplay"> - <video - :src="detailsList.videoUrl" - controls - autoplay - class="video" - width="70%" - ></video> + <video :src="detailsList.videoUrl" controls autoplay class="video" width="70%"></video> </p> <p class="page-main-audio" v-if="isDisplay"> - <audio - :src="detailsList.videoUrl" - controls - autoplay - class="video" - width="100%" - ></audio> + <audio :src="detailsList.videoUrl" controls autoplay class="video" width="100%"></audio> </p> </li> <li class="page-main-literature"> <p class="literature-header">鐩稿叧鏂囩尞</p> <div class="content-right"> <!-- 缁撴灉灞曠ず --> - <ul - class="right-main" - v-for="(item, index) in resultList" - :key="index" - > + <ul class="right-main" v-for="(item, index) in resultList" :key="index"> <li class="main-name"> <p>{{ item.name }}</p> <p> @@ -88,11 +65,7 @@ </li> <li class="main-keyword"> <span>鍏抽敭璇嶏細</span> - <span - class="keyWord" - v-for="(citem, cindex) in item.keyword" - :key="cindex" - > + <span class="keyWord" v-for="(citem, cindex) in item.keyword" :key="cindex"> {{ citem.name }} </span> </li> @@ -266,8 +239,12 @@ ], }; }, + mounted() { + console.log(this.$route.params.key, "key001"); + this.detailsList = this.$route.params.key; + }, methods: { - goPage(key) {}, + goPage(key) { }, goBack() { this.$router.go(-1); @@ -284,9 +261,12 @@ background-color: #e9e1d4; position: relative; overflow: hidden; + display: flex; + flex-direction: column; } .page-header { + padding: 8px 0; height: 9.4%; width: 100%; text-align: left; @@ -295,18 +275,25 @@ position: sticky; top: 0; z-index: 100; + p { - padding: 1.6% 0 1.55% 0; + height: 100%; font-family: Alimama DongFangDaKai; font-size: 30px; text-indent: 1em; border-bottom: 1px solid #937950; + display: flex; + align-items: center; } } -.page-main-father{ - height: calc(100% - 9.4%); + +.page-main-father { + flex: 1; width: 100%; + height: 100%; overflow: auto; + padding-top: 2%; + padding-bottom: 2%; } @@ -381,6 +368,14 @@ background-color: #6f5a3a; color: #fffdf8; } + } + + .page-main-abstract { + font-family: Source Han Sans !important; + font-size: 14px !important; + font-weight: 350 !important; + line-height: 26px !important; + color: #333333 !important; } p:nth-child(1) { @@ -464,8 +459,7 @@ display: flex; justify-content: center; - audio { - } + audio {} } .page-main-literature { 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; diff --git a/src/views/home/components/searchBox.vue b/src/views/home/components/searchBox.vue index b549c26..6737ac3 100644 --- a/src/views/home/components/searchBox.vue +++ b/src/views/home/components/searchBox.vue @@ -15,7 +15,7 @@ </el-select> <div class="inputBox"> <input type="text" v-model="searchText" class="search-input" /> - <div class="searchBtn">鎼滅储</div> + <div class="searchBtn" @click="handleSearch()">鎼滅储</div> </div> </div> </template> @@ -23,17 +23,25 @@ <script> export default { name: "SearchBox", + props: { + // 鎺ユ敹澶栭儴浼犲叆鐨勯�夐」 + options: { + type: Array, + default: () => [ + { value: "all", label: "鍏ㄩ儴" }, + { value: "name", label: "鏍囬" }, + { value: "author", label: "浣滆��" }, + { value: "year", label: "骞翠唤" }, + { value: "keyWords", label: "鍏抽敭璇�" }, + { value: "abstract", label: "鎽樿" }, + { value: "source", label: "鏉ユ簮" }, + ], + }, + }, data() { return { searchText: "", // 杈撳叆妗嗗唴瀹� selectedType: "", // 涓嬫媺妗嗛�変腑鍊� - options: [ - // 涓嬫媺閫夐」 - { value: "all", label: "鍏ㄩ儴" }, - { value: "name", label: "鍚嶇О" }, - { value: "id", label: "ID" }, - { value: "code", label: "缂栫爜" }, - ], }; }, methods: { -- Gitblit v1.9.1