From 6182cfa388f258c6e076aa46e3849ca909985d8d Mon Sep 17 00:00:00 2001
From: zhongshujie <2862698242@qq.com>
Date: 星期一, 21 四月 2025 09:37:58 +0800
Subject: [PATCH] 荣誉,学生列表接口

---
 src/views/honors/index.vue         |  209 +++++++++++++++++++++++------------------
 src/assets/js/config.js            |    3 
 src/assets/js/middleGround/tool.js |    3 
 src/views/directory/index.vue      |   51 ++++++++++
 4 files changed, 174 insertions(+), 92 deletions(-)

diff --git a/src/assets/js/config.js b/src/assets/js/config.js
index 9cb9ff7..f076bdf 100644
--- a/src/assets/js/config.js
+++ b/src/assets/js/config.js
@@ -1,5 +1,5 @@
 export const requestCtx = "http://182.92.203.7:3001"; // 璇锋眰鍦板潃
-export const appId = 12;
+export const appId = 40;
 // export const requestCtx = "https://www.tepcb.com"; // 璇锋眰鍦板潃
 // export const appId = 2;
 export const requestTimeOut = 300000; // 璇锋眰瓒呮椂鏃堕棿
@@ -10,6 +10,7 @@
 export const publicStore = `defaultPublicStore${appId}`; // 榛樿璧勬簮寮�鏀句粨鍌�
 export const publicRepository = `defaultPublicRepository${appId}`; // 榛樿璧勬簮寮�鏀惧簱
 
+
 const config = {
   requestCtx,
   requestTimeOut,
diff --git a/src/assets/js/middleGround/tool.js b/src/assets/js/middleGround/tool.js
index be95c5c..2b08cc2 100644
--- a/src/assets/js/middleGround/tool.js
+++ b/src/assets/js/middleGround/tool.js
@@ -422,7 +422,8 @@
   if (md5) {
     src = requestCtx + `/file/GetPreViewImage?md5=${md5}`;
   } else {
-    return require("@/assets/images/homeBg.png");
+    return ""
+    // return require("@/assets/images/homeBg.png");
   }
   if (width) src += `&width=${width}`;
   if (height) src += `&height=${height}`;
diff --git a/src/views/directory/index.vue b/src/views/directory/index.vue
index ac083af..a9d3cf1 100644
--- a/src/views/directory/index.vue
+++ b/src/views/directory/index.vue
@@ -182,6 +182,7 @@
 import axios from "axios";
 import debounce from "lodash/debounce";
 import treeData from "./treeData.json";
+import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js'
 export default {
   data() {
     return {
@@ -393,6 +394,7 @@
 
   mounted() {
     this.initChart();
+    this.getStudentList()
     window.addEventListener("resize", this.handleResize);
   },
   beforeDestroy() {
@@ -513,6 +515,55 @@
         this.chart.resize();
       }
     },
+    // 鑾峰彇鍒楄〃鏄剧ず
+    getStudentList() {
+      this.loading = true;
+      MG.resource.getItem({
+        path: "WYY_student",
+        fields: {
+          // 鎬у埆
+          gender:"",
+          //瀛︿範鏃堕棿
+          studyTime: [],
+          // 鍗曚綅
+          unit:[],
+          // 鐜板伐浣滃崟浣嶏紙鍒颁簩绾у崟浣嶅叏绉帮級
+          currentEmployer_secondary:"",
+          //鑱屽姟
+          jobTitle:"",
+          //瀛︿綅
+          academicDegree:"",
+          // 瀛︾敓绠�浠�
+          studentProfile:"",
+        },
+        paging: {
+          // start: (this.currentPage - 1) * 10,
+          size: 99999,
+        },
+        // coverSize: {
+        //   height: 70
+        // }
+      }).then((res) => {
+        console.log(res, "res");
+        if (res.datas && res.datas.length) {
+          this.honorList = res.datas.map(item => {
+            // 灏� year 瀛楁鏍煎紡鍖栦负 "2017骞�9鏈�" 杩欑鏍煎紡
+            const date = new Date(item.year);
+            const year = date.getFullYear();
+            const month = date.getMonth() + 1; // 鏈堜唤浠�0寮�濮嬶紝闇�瑕佸姞1
+            return {
+              ...item,
+              year: `${year}骞�${month}鏈坄
+            };
+          });
+          this.total = res.total;
+          this.loading = false;
+        }
+      }).catch((error) => {
+        console.error('鑾峰彇鑽h獕澶辫触:', error);
+      });
+    },
+
   },
 };
 </script>
diff --git a/src/views/honors/index.vue b/src/views/honors/index.vue
index b3e4ee0..26111e0 100644
--- a/src/views/honors/index.vue
+++ b/src/views/honors/index.vue
@@ -1,40 +1,35 @@
 <template>
   <div class="honors">
     <div class="honors-title">
-      <p>鐜嬫案鐐庨櫌澹崳瑾夊椤�</p>
+      <p>
+        <span>鐜嬫案鐐庨櫌澹崳瑾夊椤�</span>
+      </p>
     </div>
     <div class="page-main-father">
       <div class="honors-main">
         <div class="honors-main-box">
+          <!-- 宸﹁竟鏍囬 -->
           <div class="honors-main-title">鑽�<br />瑾�<br />濂�<br />椤�</div>
+          <!-- 鍙宠竟鍐呭 -->
           <div class="honors-text">
-            <ul>
+            <ul v-loading="loading">
               <li v-for="(item, index) in honorList" :key="index">
-                <img
-                  class="main-img"
-                  :src="item.imgSrc ? item.imgSrc : defaultImg"
-                  alt=""
-                />
+                <img class="main-img" :src="item.icon ? item.icon : defaultImg" alt="" />
                 <div>
-                  <p class="main-time">{{ item.time }}</p>
-                  <p class="main-text" :title="item.txt">{{ item.txt }}</p>
+                  <p class="main-time">{{ item.year }}</p>
+                  <p class="main-text" :title="item.txt">{{ item.honor }}</p>
                 </div>
               </li>
             </ul>
-            <img
-              class="honor-Bg"
-              src="../../assets/images/honors/honor-Bg.png"
-              alt=""
-            />
-            <!-- 鍒嗛〉 -->
-            <div class="pagination">
-              <el-pagination
-                class="msg-pagination-container"
-                :background="isBackground"
-                layout="prev, pager, next"
-                :total="200"
-              >
-              </el-pagination>
+            <div>
+              <!-- 鍒嗛〉 -->
+              <div class="pagination">
+                <el-pagination @current-change="handleCurrentChange" class="msg-pagination-container"
+                  :background="isBackground" layout="prev, pager, next" :total="total">
+                </el-pagination>
+              </div>
+              <!-- 鈥滃北鈥濆浘鐗� -->
+              <img class="honor-Bg" src="../../assets/images/honors/honor-Bg.png" alt="" />
             </div>
           </div>
         </div>
@@ -44,55 +39,66 @@
 </template>
 
 <script>
+import MG from '@/assets/js/middleGround/WebMiddleGroundApi.js'
 export default {
   data() {
     return {
       defaultImg: require("@/assets/images/honors/honorImg.png"),
       isBackground: true,
-      honorList: [
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-        {
-          imgSrc: "",
-          time: "1986骞�11鏈�",
-          txt: "1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊,1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊,1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊,1991骞�11鏈�'娓呭紑鐏垫敞灏勬恫娌荤枟涓鐥呯棸鐑瘉鐨勪复搴婁笌瀹為獙鐮旂┒'鑾�1991骞村害鍥藉绉戞妧杩涙濂栦笁绛夊",
-        },
-      ],
+      honorList: [],
+      total: 0,
+      currentPage: 1,
+      loading: false,
     };
   },
+  mounted() {
+    this.initChart();
+  },
+  methods: {
+    // 鑾峰彇鏁版嵁
+    initChart() {
+      this.loading = true;
+      MG.resource.getItem({
+        path: "WYY_honor",
+        fields: {
+          Link: "",
+          honor: "",
+          'year': '',
+        },
+        paging: {
+          start: (this.currentPage - 1) * 10,
+          size: 10,
+        },
+        // coverSize: {
+        //   height: 70
+        // }
+      }).then((res) => {
+        console.log(res, "res");
+        if (res.datas && res.datas.length) {
+          this.honorList = res.datas.map(item => {
+            // 灏� year 瀛楁鏍煎紡鍖栦负 "2017骞�9鏈�" 杩欑鏍煎紡
+            const date = new Date(item.year);
+            const year = date.getFullYear();
+            const month = date.getMonth() + 1; // 鏈堜唤浠�0寮�濮嬶紝闇�瑕佸姞1
+            return {
+              ...item,
+              year: `${year}骞�${month}鏈坄
+            };
+          });
+          this.total = res.total;
+          this.loading = false;
+        }
+      }).catch((error) => {
+        console.error('鑾峰彇鑽h獕澶辫触:', error);
+      });
+    },
+    // 澶勭悊椤电爜鍙樺寲
+    handleCurrentChange(newPage) {
+      this.currentPage = newPage;
+      this.initChart(); // 閲嶆柊鑾峰彇鏁版嵁
+    },
+  },
+
 };
 </script>
 
@@ -104,9 +110,12 @@
   background-color: #e9e1d4;
   position: relative;
   overflow: hidden;
+  display: flex;
+  flex-direction: column;
 }
 
 .honors-title {
+  padding: 8px 0;
   height: 9.4%;
   width: 100%;
   text-align: left;
@@ -115,32 +124,39 @@
   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%);
+  flex: 1;
   width: 100%;
+  height: 100%;
   overflow: auto;
+  padding-top: 2%;
+  padding-bottom: 2%;
 }
 
 .honors-main {
   width: 77.3%;
-  height: auto;
+  height: 100%;
   margin: 0 auto;
-  margin-top: 2%;
+
 }
 
 .honors-main-box {
+  height: 100%;
   display: flex;
   justify-content: center;
-  padding: 3.2% 6% 14%  4%;
+  padding: 3.2% 6% 0% 4%;
   border: 1px solid #e4dace;
   background: rgba(255, 253, 248, 0.9);
 }
@@ -153,18 +169,22 @@
 }
 
 .honors-text {
+  height: 100%;
   width: 100%;
   position: relative;
   padding: 0 0 0 5.8%;
+  display: flex;
+  flex-direction: column;
 
   ul {
+    flex: 1;
     display: flex;
     flex-wrap: wrap;
     justify-content: space-between;
   }
 
   li {
-    height: 25%;
+    height: calc(20% - 20px);
     width: 45%;
     display: flex;
     margin-right: 0.9%;
@@ -197,19 +217,42 @@
   }
 
   .honor-Bg {
-    position: absolute;
     width: 70.5%;
     height: auto;
-    bottom: -36%;
-    left: -295px;
+    margin-left: -33%;
   }
 
   .pagination {
+    // position: absolute;
+    // bottom: 0;
+    // right: 0;
     padding-right: 47px;
     padding-top: 30px;
     text-align: end;
   }
 }
+
+@font-face {
+  font-family: "Alimama DongFangDaKai";
+  src: url("../../assets/font/闃块噷濡堝涓滄柟澶фシ.ttf");
+}
+
+// @media screen and (min-width: 1920px) {
+//   .honors-main-box {
+//     display: flex;
+//     justify-content: center;
+//     padding: 3.2% 6% 11% 4%;
+//     border: 1px solid #e4dace;
+//     background: rgba(255, 253, 248, 0.9);
+//   }
+//   .honor-Bg {
+//     position: absolute;
+//     width: 70.5%;
+//     height: auto;
+//     bottom: -20%;
+//     left: -26.5%;
+//   }
+// }
 
 @media screen and (min-width: 2560px) {
   .honors-main {
@@ -237,21 +280,9 @@
       }
     }
   }
-
-  .honor-Bg {
-    position: absolute;
-    width: 70.5%;
-    height: auto;
-    bottom: -39%;
-    left: -295px;
-  }
-
 }
 
-@font-face {
-  font-family: "Alimama DongFangDaKai";
-  src: url("../../assets/font/闃块噷濡堝涓滄柟澶фシ.ttf");
-}
+
 
 :deep .msg-pagination-container.is-background .el-pager li {
   /*瀵归〉鏁扮殑鏍峰紡杩涜淇敼*/
@@ -277,9 +308,7 @@
   border: 1px solid #cccccc;
 }
 
-:deep.msg-pagination-container.is-background
-  .el-pager
-  li:not(.disabled).active {
+:deep.msg-pagination-container.is-background .el-pager li:not(.disabled).active {
   /*褰撳墠閫変腑椤垫暟鐨勬牱寮忚繘琛屼慨鏀�*/
   background-color: #937950;
   color: #fff;

--
Gitblit v1.9.1