解决翻页栏和展开收起问题
Showing
1 changed file
with
8 additions
and
6 deletions
| ... | @@ -72,7 +72,9 @@ const getBlockTableData = () => { | ... | @@ -72,7 +72,9 @@ const getBlockTableData = () => { |
| 72 | processTableInfo.value.loading = false | 72 | processTableInfo.value.loading = false |
| 73 | processTableInfo.value.data = data.records || [] | 73 | processTableInfo.value.data = data.records || [] |
| 74 | processTableInfo.value.page.limit = data.pageSize | 74 | processTableInfo.value.page.limit = data.pageSize |
| 75 | blockPage.value.limit = data.pageSize; | ||
| 75 | processTableInfo.value.page.curr = data.pageIndex | 76 | processTableInfo.value.page.curr = data.pageIndex |
| 77 | blockPage.value.curr = data.pageIndex; | ||
| 76 | processTableInfo.value.page.rows = data.totalRows | 78 | processTableInfo.value.page.rows = data.totalRows |
| 77 | } else { | 79 | } else { |
| 78 | res?.msg && proxy.$ElMessage.error(res?.msg) | 80 | res?.msg && proxy.$ElMessage.error(res?.msg) |
| ... | @@ -95,7 +97,7 @@ onBeforeMount(() => { | ... | @@ -95,7 +97,7 @@ onBeforeMount(() => { |
| 95 | toBlockTableSearch({}); | 97 | toBlockTableSearch({}); |
| 96 | }) | 98 | }) |
| 97 | 99 | ||
| 98 | const activities: any = ref([]); | 100 | const activities: any = ref({}); |
| 99 | 101 | ||
| 100 | const detailLoading = ref(false); | 102 | const detailLoading = ref(false); |
| 101 | 103 | ||
| ... | @@ -114,9 +116,9 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { | ... | @@ -114,9 +116,9 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { |
| 114 | detailLoading.value = false; | 116 | detailLoading.value = false; |
| 115 | if (res?.code == proxy.$passCode) { | 117 | if (res?.code == proxy.$passCode) { |
| 116 | const data = res.data?.records || [] | 118 | const data = res.data?.records || [] |
| 117 | activities.value = []; | 119 | activities.value[row.code] = []; |
| 118 | for (const d of data) { | 120 | for (const d of data) { |
| 119 | activities.value.push({ | 121 | activities.value[row.code].push({ |
| 120 | timestamp: d.labelName + ' ' + d.updateTime, | 122 | timestamp: d.labelName + ' ' + d.updateTime, |
| 121 | type: 'primary', | 123 | type: 'primary', |
| 122 | hollow: true, | 124 | hollow: true, |
| ... | @@ -124,7 +126,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { | ... | @@ -124,7 +126,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { |
| 124 | }) | 126 | }) |
| 125 | } | 127 | } |
| 126 | } else { | 128 | } else { |
| 127 | activities.value = []; | 129 | activities.value[row.code] = []; |
| 128 | res?.msg && proxy.$ElMessage.error(res?.msg) | 130 | res?.msg && proxy.$ElMessage.error(res?.msg) |
| 129 | } | 131 | } |
| 130 | }) | 132 | }) |
| ... | @@ -146,7 +148,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { | ... | @@ -146,7 +148,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { |
| 146 | <el-table-column type="expand"> | 148 | <el-table-column type="expand"> |
| 147 | <template #default="scope"> | 149 | <template #default="scope"> |
| 148 | <el-timeline style="width: 100%;min-height: 150px;" v-loading="detailLoading"> | 150 | <el-timeline style="width: 100%;min-height: 150px;" v-loading="detailLoading"> |
| 149 | <el-timeline-item v-for="(activity, index) in activities" :key="index" :timestamp="activity.timestamp" | 151 | <el-timeline-item v-for="(activity, index) in (activities[scope.row.code] || [])" :key="index" :timestamp="activity.timestamp" |
| 150 | :hollow="activity.hollow" :type="activity.type" placement="top"> | 152 | :hollow="activity.hollow" :type="activity.type" placement="top"> |
| 151 | <div class="list_panel"> | 153 | <div class="list_panel"> |
| 152 | <template v-if="activity.info?.bizType == '合约'"> | 154 | <template v-if="activity.info?.bizType == '合约'"> |
| ... | @@ -242,7 +244,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { | ... | @@ -242,7 +244,7 @@ const handleTableExpandChange = (row: any, expandedRows: any[]) => { |
| 242 | </template> | 244 | </template> |
| 243 | </el-table-column> | 245 | </el-table-column> |
| 244 | </el-table> | 246 | </el-table> |
| 245 | <PageNav :pageInfo="blockPage" @pageChange="processTablePageChange" /> | 247 | <PageNav :pageInfo="processTableInfo.page" @pageChange="processTablePageChange" /> |
| 246 | </div> | 248 | </div> |
| 247 | </div> | 249 | </div> |
| 248 | </template> | 250 | </template> | ... | ... |
-
Please register or sign in to post a comment