This commit is contained in:
parent
91281fc6a0
commit
f8de8543ab
|
|
@ -18,6 +18,7 @@
|
||||||
@refresh-change="onLoad"
|
@refresh-change="onLoad"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
|
@search-change="handleSearch"
|
||||||
>
|
>
|
||||||
<!-- 操作列:编辑按钮 -->
|
<!-- 操作列:编辑按钮 -->
|
||||||
<template #menu="{ row, size }">
|
<template #menu="{ row, size }">
|
||||||
|
|
@ -95,6 +96,7 @@ const page = reactive({
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0
|
total: 0
|
||||||
});
|
});
|
||||||
|
const searchParams = ref({}); // 存储搜索参数
|
||||||
|
|
||||||
// 表格配置:保留操作列
|
// 表格配置:保留操作列
|
||||||
const option = reactive({
|
const option = reactive({
|
||||||
|
|
@ -106,11 +108,31 @@ const option = reactive({
|
||||||
delBtn: false,
|
delBtn: false,
|
||||||
viewBtn: false,
|
viewBtn: false,
|
||||||
menu: true, // 启用操作列
|
menu: true, // 启用操作列
|
||||||
|
search: true,
|
||||||
|
searchBtn: true,
|
||||||
|
resetBtn: true,
|
||||||
|
searchShow: true, // 显示搜索区域
|
||||||
|
searchMenuSpan: 6, // 搜索按钮占用的栅格数
|
||||||
|
searchMenuAlign: 'right', // 搜索按钮对齐方式
|
||||||
column: [
|
column: [
|
||||||
{ label: '项目名称', prop: 'proName' },
|
{
|
||||||
{ label: '单项工程名称', prop: 'singleProName' },
|
label: '项目名称',
|
||||||
{ label: '档案名称', prop: 'contentName' },
|
prop: 'proName',
|
||||||
{ label: '整改内容', prop: 'description', sortable: true }
|
},
|
||||||
|
{
|
||||||
|
label: '单项工程名称',
|
||||||
|
prop: 'singleProName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '档案名称',
|
||||||
|
prop: 'contentName',
|
||||||
|
search: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '整改内容',
|
||||||
|
prop: 'description',
|
||||||
|
sortable: true,
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -122,11 +144,14 @@ const onLoad = async (pageParam = page) => {
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await selectRectificationListApi({
|
const params = {
|
||||||
proId: projectId,
|
proId: projectId,
|
||||||
pageNum: pageParam.currentPage,
|
pageNum: pageParam.currentPage,
|
||||||
pageSize: pageParam.pageSize
|
pageSize: pageParam.pageSize,
|
||||||
});
|
...searchParams.value // 添加搜索参数
|
||||||
|
};
|
||||||
|
|
||||||
|
const res = await selectRectificationListApi(params);
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
tableData.value = res.data.rows || [];
|
tableData.value = res.data.rows || [];
|
||||||
page.total = res.data.total || 0;
|
page.total = res.data.total || 0;
|
||||||
|
|
@ -141,6 +166,17 @@ const onLoad = async (pageParam = page) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 查询方法
|
||||||
|
const handleSearch = (params, done) => {
|
||||||
|
// 保存搜索参数
|
||||||
|
searchParams.value = { ...params };
|
||||||
|
console.log('查询参数:', searchParams.value);
|
||||||
|
// 重新加载数据
|
||||||
|
page.currentPage = 1; // 重置到第一页
|
||||||
|
onLoad();
|
||||||
|
done && done(); // 完成查询
|
||||||
|
};
|
||||||
|
|
||||||
// 分页方法
|
// 分页方法
|
||||||
const handleCurrentChange = (val) => {
|
const handleCurrentChange = (val) => {
|
||||||
page.currentPage = val;
|
page.currentPage = val;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue