From 517ada59580a84035d2373034f7b77c0bdf044c5 Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期一, 11 十一月 2024 15:33:05 +0800
Subject: [PATCH] 错题本分页
---
src/views/wrong-list/index.vue | 27 ++++++++++++++++++++-------
src/api/modules/wrong.js | 4 ++--
src/views/wrong-list/data-list/index.vue | 11 +++++++++--
3 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/src/api/modules/wrong.js b/src/api/modules/wrong.js
index 87cd66c..c28a664 100644
--- a/src/api/modules/wrong.js
+++ b/src/api/modules/wrong.js
@@ -1,5 +1,5 @@
import service from "@/api";
-export const page = (postData = {examName: ''}) => {
- return service.post('/api/student/wrong/page',postData);
+export const page = (data) => {
+ return service.post('/api/student/wrong/page',data);
}
\ No newline at end of file
diff --git a/src/views/wrong-list/data-list/index.vue b/src/views/wrong-list/data-list/index.vue
index c32bc52..f398287 100644
--- a/src/views/wrong-list/data-list/index.vue
+++ b/src/views/wrong-list/data-list/index.vue
@@ -44,10 +44,17 @@
align="center"
fixed="right"
>
- <template slot-scope="scope">
- <el-button type="primary" size="large" @click="checkWrong(scope.row.id)">鏌ョ湅閿欓</el-button>
+ <template #default="{ row }">
+ <el-button
+ type="primary"
+ size="small"
+ @click="checkWrong(row.id)"
+ >
+ 鏌ョ湅閿欓
+ </el-button>
</template>
</el-table-column>
+
</el-table>
</el-scrollbar>
</div>
diff --git a/src/views/wrong-list/index.vue b/src/views/wrong-list/index.vue
index 415a098..67a9632 100644
--- a/src/views/wrong-list/index.vue
+++ b/src/views/wrong-list/index.vue
@@ -9,11 +9,21 @@
<div class="card-wrapper w-full h-full flex flex-col px-8 box-border">
<div class="card-header flex justify-between items-center shrink-0">
<div class="header-search flex items-center">
-<!-- <el-input v-model="searchText" placeholder="璇疯緭鍏ヨ�冭瘯鍚嶇О" :prefix-icon="Search" maxlength="20" @input="searchData"/>-->
+<!-- <el-input v-model="pageParam.title" placeholder="璇疯緭鍏ラ鐩�" maxlength="20"/>-->
+<!-- <el-select v-model="pageParam.questionType" placeholder="璇烽�夋嫨棰樺瀷" @change="searchData">-->
+<!-- <el-option label="鍗曢�夐" value="1"></el-option>-->
+<!-- <el-option label="澶氶�夐" value="2"></el-option>-->
+<!-- <el-option label="鍒ゆ柇棰�" value="3"></el-option>-->
+<!-- <el-option label="濉┖棰�" value="4"></el-option>-->
+<!-- <el-option label="瑙g瓟棰�" value="5"></el-option>-->
+<!-- <el-option label="璇煶棰�" value="6"></el-option>-->
+<!-- <el-option label="璁$畻棰�" value="7"></el-option>-->
+<!-- <el-option label="鍒嗘瀽棰�" value="8"></el-option>-->
+<!-- </el-select>-->
+<!-- <el-input v-model="pageParam.examName" placeholder="璇疯緭鍏ヨ瘯鍗峰悕绉�" maxlength="20"/>-->
<!-- <el-button type="primary" class="ml-4" @click="searchData">鎼滅储</el-button>-->
</div>
</div>
-
<div class="card-main flex-1 my-5 relative">
<div class="main-content absolute top-0 bottom-0 left-0 right-0" v-loading="loading">
<DataList :dataList="dataList"></DataList>
@@ -50,15 +60,19 @@
const pageParam = {
pageIndex: 1,
pageSize: 10,
- total: 0
+ total: 0,
+ title: '',
+ questionType: null,
+ examName: ''
};
const getData = () => {
loading.value = true;
- page().then(res => {
- dataList.value = res.data;
+ page(pageParam).then(res => {
+ dataList.value = res.data.list;
+ pageParam.total = res.data.total;
loading.value = false;
}).catch(err => {
loading.value = false;
@@ -67,8 +81,7 @@
// 椤甸潰鍒囨崲
const handleCurrentChange = (pageIndex) => {
pageParam.pageIndex = pageIndex; // 鏇存柊椤电爜
- const currentData = getPaginatedData(); // 鑾峰彇褰撳墠椤垫暟鎹�
- updateView(currentData); // 鏇存柊瑙嗗浘
+ getData(); // 鑾峰彇鏁版嵁
}
--
Gitblit v1.8.0