From 5c4837cdef21239ab1f192aade5e08b2cb75fcc0 Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期三, 14 五月 2025 17:56:40 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/wyyDatabase --- src/views/home/index.vue | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 158 insertions(+), 5 deletions(-) diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 96480e9..c9a5c9a 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -10,8 +10,14 @@ <SearchBox @search="handleSearch" /> </div> </div> - <div class="menuBox"> - <div class="menuList"> + <div + class="menuBox" + v-loading="loading" + element-loading-text="鍔犺浇涓�" + element-loading-spinner="el-icon-loading" + element-loading-background="rgba(0, 0, 0, 0)" + > + <div class="menuList" v-show="!loading"> <div class="menu" v-for="item in menuList" @@ -22,7 +28,18 @@ <img class="autoImg" :src="item.icon" alt="" /> </div> <div class="menuTitle">{{ item.title }}</div> - <div class="menuSubTitle">{{ item.subTitle }}</div> + <div class="menuSubTitle" v-if="item.title == '骞磋氨'"> + {{ startYear + "-" + endDate }} + </div> + <div class="menuSubTitle" v-else-if="item.title == '瀛︽湳鎴愭灉'"> + {{ achievementsNum > 100 ? "100+" : achievementsNum }} + </div> + <div class="menuSubTitle" v-else-if="item.title == '鑽h獕濂栭」'"> + {{ honorNum > 100 ? "100+" : honorNum }} + </div> + <div class="menuSubTitle" v-else-if="item.title == '瀛︾敓鐩綍'"> + {{ studentNum > 100 ? "100+" : studentNum }} + </div> <div class="menuLine"> <img class="autoImg" :src="arrow" alt="" /> </div> @@ -58,11 +75,20 @@ data() { return { arrow, + loading: false, + resourceList: [ + "journal", + "books", + "audio", + "video", + "newspaper", + "other", + ], menuList: [ { icon: nianpu1, title: "骞磋氨", - subTitle: "1936-2024", + subTitle: "100+", path: "/chronology", }, { @@ -85,17 +111,132 @@ }, ], introduction: "", + startYear: "", + endDate: "", + achievementsNum: "", + honorNum: "", + studentNum: "", }; }, momunted() {}, created() { this.getPersonInfo(); + this.getListData(); + this.getAchievementList(); + this.getHonorList(); + this.getStudentList(); }, methods: { goPage(row) { console.log(row); this.$router.push(row.path); + }, + + getStudentList() { + this.MG.resource + .getItem({ + path: "WYY_student", + fields: { + // 鎬у埆 + gender: "", + //瀛︿範鏃堕棿 + studyTime: [], + // 鍗曚綅 + unit: [], + // 鐜板伐浣滃崟浣嶏紙鍒颁簩绾у崟浣嶅叏绉帮級 + currentEmployer_secondary: "", + //鑱屽姟 + jobTitle: "", + professionalTitle: "", + //瀛︿綅 + academicDegree: "", + // 瀛︾敓绠�浠� + studentProfile: "", + }, + paging: { + size: 99999, + }, + }) + .then((res) => { + console.log(res, "res1111111"); + this.studentNum = res.total; + this.loading = false; + }); + }, + + getHonorList() { + this.MG.resource + .getItem({ + path: "WYY_honor", + fields: { + honor: [], + year: [], + }, + paging: { + start: 0, + size: 999, + }, + }) + .then((res) => { + this.honorNum = res.total; + }); + }, + getAchievementList() { + this.MG.resource + .getItem({ + path: "*", + queryType: "*", + paging: { + start: (this.paginationPage - 1) * 10, + size: 10, + }, + sort: { + year: this.postedSortInfo ? "Desc" : "Asc", + }, + fields: { + cmsType: ["cmsItem"], + "resourceType*": this.resourceList, + source: [], + isbn: [], + year: [], + particularYear: [], + contributor: [], + abstract: [], + keyWords: [], + author: [], + DOI: [], + AIReading: [], + file: [], + IssueNumber: [], + }, + }) + .then((res) => { + console.log(res, "res"); + this.achievementsNum = res.total; + }); + }, + + getListData() { + this.loading = true; + this.MG.resource + .getItem({ + path: "WYY_chronology", + fields: { + year: [], + age: [], + eventOverview: [], + eventPictures: [], + }, + paging: { + start: 0, + size: 999, + }, + }) + .then((res) => { + this.startYear = res.datas[res.datas.length - 1].year.split("/")[0]; + this.endDate = res.datas[0].year.split("/")[0]; + }); }, handleSearch(type) { @@ -128,7 +269,7 @@ }; </script> -<style> +<style lang="less" scoped> .home { width: 100%; height: 100vh; @@ -260,6 +401,18 @@ text-align: center; } +::v-deep .el-loading-spinner { + .el-loading-text { + font-size: 14px; + color: #937950; + } + + .el-icon-loading { + font-size: 14px; + color: #937950; + } +} + /* @media screen and (min-width: 1950px) { .textInfo { font-size: 20px; -- Gitblit v1.9.1