8768b31e by lihua

解决翻页栏和展开收起问题

1 parent 60266f4b
......@@ -72,7 +72,9 @@ const getBlockTableData = () => {
processTableInfo.value.loading = false
processTableInfo.value.data = data.records || []
processTableInfo.value.page.limit = data.pageSize
blockPage.value.limit = data.pageSize;
processTableInfo.value.page.curr = data.pageIndex
blockPage.value.curr = data.pageIndex;
processTableInfo.value.page.rows = data.totalRows
} else {
res?.msg && proxy.$ElMessage.error(res?.msg)
......@@ -95,7 +97,7 @@ onBeforeMount(() => {
toBlockTableSearch({});
})
const activities: any = ref([]);
const activities: any = ref({});
const detailLoading = ref(false);
......@@ -114,9 +116,9 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => {
detailLoading.value = false;
if (res?.code == proxy.$passCode) {
const data = res.data?.records || []
activities.value = [];
activities.value[row.code] = [];
for (const d of data) {
activities.value.push({
activities.value[row.code].push({
timestamp: d.labelName + ' ' + d.updateTime,
type: 'primary',
hollow: true,
......@@ -124,7 +126,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => {
})
}
} else {
activities.value = [];
activities.value[row.code] = [];
res?.msg && proxy.$ElMessage.error(res?.msg)
}
})
......@@ -146,7 +148,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => {
<el-table-column type="expand">
<template #default="scope">
<el-timeline style="width: 100%;min-height: 150px;" v-loading="detailLoading">
<el-timeline-item v-for="(activity, index) in activities" :key="index" :timestamp="activity.timestamp"
<el-timeline-item v-for="(activity, index) in (activities[scope.row.code] || [])" :key="index" :timestamp="activity.timestamp"
:hollow="activity.hollow" :type="activity.type" placement="top">
<div class="list_panel">
<template v-if="activity.info?.bizType == '合约'">
......@@ -242,7 +244,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => {
</template>
</el-table-column>
</el-table>
<PageNav :pageInfo="blockPage" @pageChange="processTablePageChange" />
<PageNav :pageInfo="processTableInfo.page" @pageChange="processTablePageChange" />
</div>
</div>
</template>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!