合并
This commit is contained in:
@ -88,20 +88,7 @@
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="flex items-center justify-between p-4 border-t" v-if="total > 0">
|
||||
<div class="text-gray-500 text-sm">
|
||||
共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条
|
||||
</div>
|
||||
<el-pagination
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:total="total"
|
||||
layout="prev, pager, next, jumper, sizes"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
></el-pagination>
|
||||
</div>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="fetchData" />
|
||||
</div>
|
||||
<!-- 新增/编辑对话框 -->
|
||||
<el-dialog
|
||||
@ -264,6 +251,13 @@ const formRules = reactive({
|
||||
findType: [{ required: true, message: '请选择类型', trigger: 'change' }]
|
||||
});
|
||||
|
||||
const queryParams = reactive({
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
findType: 1,
|
||||
projectId: currentProject.value?.id
|
||||
});
|
||||
|
||||
// 格式化日期
|
||||
const formatDate = (dateString) => {
|
||||
if (!dateString) return '-';
|
||||
@ -289,10 +283,7 @@ const tableRowClassName = ({ row, rowIndex }) => {
|
||||
const fetchData = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await useMaterialsQueryList({
|
||||
projectId: currentProject.value?.id,
|
||||
findType: 1
|
||||
});
|
||||
const res = await useMaterialsQueryList(queryParams);
|
||||
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total;
|
||||
|
Reference in New Issue
Block a user