From 83b2f9856324fe5c996c0d4d2fadbb8e9f084982 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 16 三月 2026 10:26:58 +0800
Subject: [PATCH] 参数加分页
---
src/views/productionManagement/productionProcess/index.vue | 62 ++++++++++++++++++++++---------
src/views/basicData/parameterMaintenance/index.vue | 14 ++++--
2 files changed, 53 insertions(+), 23 deletions(-)
diff --git a/src/views/basicData/parameterMaintenance/index.vue b/src/views/basicData/parameterMaintenance/index.vue
index 95a5741..4b2669e 100644
--- a/src/views/basicData/parameterMaintenance/index.vue
+++ b/src/views/basicData/parameterMaintenance/index.vue
@@ -31,10 +31,10 @@
:column="tableColumn"
:tableData="tableData"
:page="page"
- height="calc(100vh - 280px)"
+ height="calc(100vh - 320px)"
:tableLoading="tableLoading"
:isSelection="false"
- :isShowPagination="false"
+ :isShowPagination="true"
@pagination="pagination">
</PIMTable>
</div>
@@ -442,12 +442,16 @@
const getList = () => {
tableLoading.value = true;
// 璋冪敤鏂版帴鍙� /baseParam/list
- getBaseParamList({ paramName: searchForm.paramName })
+ getBaseParamList({
+ paramName: searchForm.paramName,
+ current: page.current,
+ size: page.size,
+ })
.then(res => {
tableLoading.value = false;
if (res.code === 200) {
- tableData.value = res.data || [];
- page.total = res.data?.length || 0;
+ tableData.value = res.data?.records || [];
+ page.total = res.data?.total || 0;
} else {
ElMessage.error(res.msg || "鏌ヨ澶辫触");
}
diff --git a/src/views/productionManagement/productionProcess/index.vue b/src/views/productionManagement/productionProcess/index.vue
index bef5379..37bb89c 100644
--- a/src/views/productionManagement/productionProcess/index.vue
+++ b/src/views/productionManagement/productionProcess/index.vue
@@ -167,7 +167,7 @@
</el-input>
</div>
<el-table :data="filteredParamList"
- height="360"
+ height="300"
border
highlight-current-row
@current-change="handleParamSelect">
@@ -183,6 +183,18 @@
</template>
</el-table-column>
</el-table>
+ <!-- 鍒嗛〉鎺т欢 -->
+ <div class="pagination-container"
+ style="margin-top: 10px;">
+ <el-pagination v-model:current-page="paramPage.current"
+ v-model:page-size="paramPage.size"
+ :page-sizes="[10, 20, 50, 100]"
+ layout="total, sizes, prev, pager, next, jumper"
+ :total="paramPage.total"
+ @size-change="handleParamSizeChange"
+ @current-change="handleParamCurrentChange"
+ size="small" />
+ </div>
</div>
<!-- 鍙充晶鍙傛暟璇︽儏 -->
<div class="param-detail-area">
@@ -343,11 +355,6 @@
// 鍙傛暟鍒楄〃鏁版嵁
const paramList = ref([]);
const paramLoading = ref(false);
- const paramPage = reactive({
- current: 1,
- size: 10,
- total: 0,
- });
// 鏁版嵁瀛楀吀
const dictTypes = ref([]);
@@ -392,6 +399,13 @@
const filteredParamList = ref([]);
const selectedParam = ref(null);
const paramSearchKeyword = ref("");
+
+ // 鍙�夊弬鏁板垎椤�
+ const paramPage = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+ });
// 缂栬緫鍙傛暟瀵硅瘽妗�
const editParamDialogVisible = ref(false);
@@ -677,10 +691,14 @@
return;
}
// 鑾峰彇鍙�夊弬鏁板垪琛�
- getBaseParamList({ paramName: paramSearchKeyword.value }).then(res => {
+ getBaseParamList({
+ paramName: paramSearchKeyword.value,
+ current: paramPage.current,
+ size: paramPage.size,
+ }).then(res => {
if (res.code === 200) {
- filteredParamList.value = res.data || [];
- page.total = res.data?.length || 0;
+ filteredParamList.value = res.data?.records || [];
+ paramPage.total = res.data?.total || 0;
} else {
ElMessage.error(res.msg || "鏌ヨ澶辫触");
}
@@ -695,14 +713,22 @@
};
const handleParamSearch = () => {
- const keyword = paramSearchKeyword.value.trim().toLowerCase();
- if (!keyword) {
- filteredParamList.value = availableParamList.value;
- } else {
- filteredParamList.value = availableParamList.value.filter(item =>
- item.paramName.toLowerCase().includes(keyword)
- );
- }
+ // 閲嶇疆鍒嗛〉
+ paramPage.current = 1;
+ // 閲嶆柊鍔犺浇鏁版嵁
+ handleSelectParam();
+ };
+
+ // 澶勭悊鍒嗛〉澶у皬鍙樺寲
+ const handleParamSizeChange = size => {
+ paramPage.size = size;
+ handleSelectParam();
+ };
+
+ // 澶勭悊褰撳墠椤电爜鍙樺寲
+ const handleParamCurrentChange = current => {
+ paramPage.current = current;
+ handleSelectParam();
};
const getParamTypeText = type => {
const typeMap = {
@@ -975,7 +1001,7 @@
th {
background: transparent;
font-weight: 600;
- color: #ffffff;
+ // color: #ffffff;
border-bottom: none;
padding: 16px 0;
}
--
Gitblit v1.9.3