From 6829deb1f6e3ddee58c1523ed9cfbda6ad1c07bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E7=94=B1=E7=9A=84=E4=B8=96=E7=95=8C=E4=BA=BA?= <3196812536@qq.com> Date: Sat, 17 Aug 2024 21:27:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=AE=A1=E7=90=86=E7=AB=AF?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.cache/.Apifox_Helper/.api.cache.v1.1.db | Bin 0 -> 32768 bytes .idea/.cache/.Apifox_Helper/.api.call.v1.0.db | Bin 0 -> 24576 bytes .../.cache/.Apifox_Helper/.http_content_cache | 1 + admin/package.json | 2 +- admin/src/api/student.js | 16 +++ admin/src/views/student/Student.vue | 116 +++++++++++++++++- .../yiming1234/dto/StudentPageQueryDTO.java | 3 - .../main/resources/mapper/StudentMapper.xml | 6 - uniapp/.idea/workspace.xml | 7 +- 9 files changed, 133 insertions(+), 18 deletions(-) create mode 100644 .idea/.cache/.Apifox_Helper/.api.cache.v1.1.db create mode 100644 .idea/.cache/.Apifox_Helper/.api.call.v1.0.db create mode 100644 .idea/.cache/.Apifox_Helper/.http_content_cache create mode 100644 admin/src/api/student.js diff --git a/.idea/.cache/.Apifox_Helper/.api.cache.v1.1.db b/.idea/.cache/.Apifox_Helper/.api.cache.v1.1.db new file mode 100644 index 0000000000000000000000000000000000000000..0bf269619d8fc998bddf4a58fe6bb167bdf16891 GIT binary patch literal 32768 zcmeHQ$#UyRcGY`b;VGgcY;St!=B6X+1=}tX5~#K_)Uem?c2&O^`0J=Trf!*I}*6tvT+D}&$Wa;=Ac3pZZeg%6a6PCb_!)OEBIwuQ6m zgFM8D(q})=@8;kAA)=)#!cdz!hCM4fqNSnl?&#QAbP5>j-u8MYTR3j%J%-lX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mY;|fB*y_009U<00Izz00bZa z0SG_<0uX=z1Rwwb2)tK;Uo!Er@aWwKzuG^4k^Jb%FPp^8>%djYg+*`8sd5#{iWC*2 zZKyk~QD|A{=8ch?QtYxkEZOP(emb0NeA&MKhdf!Vzi#Xy8~D1@#99~Uu-J9l#AdeD zW?y^qs5XjR^7!1I%wwiX#bY-{IoZZ;T!pEU1+KOY<)~S%C)HBs=PIi_cfa#nw({57 zz+an^U1-CVs}y0oe?^NrPge9RT9}Pd=2f?L|5j}mx66jl*Tl2=F4XsVlqwrvA9QnA z@yyA5SCN)S{pOA5#`&54_dNcL?e2LjyEuF8l8ST{muBHHlrebW6+0Cf2`C&r`bdT*mLg%UyKmH60!1Kjd;9DbPn5y}C}B00Sq(tgh8<@dr0)>VFC*{Ly| z7vXST+q%|z?%uynTJ^d|L+QFbuSSQW`y%D*RBx28k8 ztx55Wrsst+;LfAN{{K_{Y(AdMf3Lq{B!d71AOHafKmY;|fB*y_009U<00Izz00bZa d0SG_<0uX=z1Rwwb2>fpXpNc2_kB { + console.log('Fetching student list'); // 添加日志 + // 发送 GET 请求,包含分页参数 + return request.get('/admin/student/page', {params}).then(response => { + console.log('Student list response received', response); // 添加日志 + return response; + }).catch(error => { + console.error('Fetching student list failed', error); // 添加日志 + throw error; + }); +}; diff --git a/admin/src/views/student/Student.vue b/admin/src/views/student/Student.vue index 394a8ccf..5f58183d 100644 --- a/admin/src/views/student/Student.vue +++ b/admin/src/views/student/Student.vue @@ -1,10 +1,120 @@ + + +// 定义响应式变量 +const username = ref(''); +const page = ref(1); +const pageSize = ref(5); +const total = ref(0); +const records = ref([]); +// 分页查询函数 +const pageQuery = async () => { + const params = { + username: username.value, + page: page.value, + pageSize: pageSize.value + }; + try { + const res = await getStudentList(params); + if (res.code === 1) { + records.value = res.data.records.sort((a, b) => { + return a.id - b.id; + }); + total.value = res.data.total; // 处理 total + } else { + ElMessage.error('获取学生列表失败'); + } + } catch (err) { + ElMessage.error('请求失败: ' + err.message); + } +}; - +// 处理 pageSize 改变 +const handleSizeChange = async (newSize) => { + pageSize.value = newSize; + await pageQuery(); +}; + +// 处理 page 改变 +const handleCurrentChange = async (newPage) => { + page.value = newPage; + await pageQuery(); +}; + +// 在组件挂载时进行数据查询 +onMounted(() => { + pageQuery(); +}); + diff --git a/backend/wall-pojo/src/main/java/cn/yiming1234/dto/StudentPageQueryDTO.java b/backend/wall-pojo/src/main/java/cn/yiming1234/dto/StudentPageQueryDTO.java index 3112bd58..7ec5dcb3 100644 --- a/backend/wall-pojo/src/main/java/cn/yiming1234/dto/StudentPageQueryDTO.java +++ b/backend/wall-pojo/src/main/java/cn/yiming1234/dto/StudentPageQueryDTO.java @@ -10,9 +10,6 @@ public class StudentPageQueryDTO implements Serializable { //用户姓名 private String username; - //用户学号 - private String studentId; - //页码 private int page; diff --git a/backend/wall-server/src/main/resources/mapper/StudentMapper.xml b/backend/wall-server/src/main/resources/mapper/StudentMapper.xml index 63d9efc1..eae061c9 100644 --- a/backend/wall-server/src/main/resources/mapper/StudentMapper.xml +++ b/backend/wall-server/src/main/resources/mapper/StudentMapper.xml @@ -5,15 +5,9 @@ diff --git a/uniapp/.idea/workspace.xml b/uniapp/.idea/workspace.xml index b535db2a..ae5bdbff 100644 --- a/uniapp/.idea/workspace.xml +++ b/uniapp/.idea/workspace.xml @@ -4,11 +4,7 @@