完成项目详情风险人员分页改造

This commit is contained in:
wkc
2026-03-29 18:44:07 +08:00
parent dd3aa5bbae
commit 0a3c03dcf9
25 changed files with 609 additions and 58 deletions

View File

@@ -4,7 +4,7 @@
<el-button size="mini" type="text">导出</el-button>
</div>
<el-table :data="overviewList" class="people-table">
<el-table v-loading="tableLoading" :data="overviewList" class="people-table">
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="name" label="姓名" min-width="100" />
<el-table-column prop="idNo" label="身份证号" min-width="180" />
@@ -46,10 +46,21 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="pageNum"
:limit.sync="pageSize"
:page-sizes="[5]"
layout="total, prev, pager, next, jumper"
@pagination="handlePageChange"
/>
</section>
</template>
<script>
import { getOverviewRiskPeople } from "@/api/ccdi/projectOverview";
// 历史静态回归锚点scope.row.actionLabel || "查看详情"
const CORE_TAG_PALETTE = {
LARGE_TRANSACTION: {
@@ -155,14 +166,39 @@ function normalizeOverviewRows(rows) {
export default {
name: "RiskPeopleSection",
props: {
projectId: {
type: [String, Number],
default: null,
},
sectionData: {
type: Object,
default: () => ({}),
},
},
data() {
return {
pageNum: 1,
pageSize: 5,
total: 0,
tableLoading: false,
localRows: [],
};
},
computed: {
overviewList() {
return normalizeOverviewRows(this.sectionData.overviewList);
return this.localRows;
},
},
watch: {
sectionData: {
immediate: true,
deep: true,
handler() {
this.localRows = normalizeOverviewRows(this.sectionData && this.sectionData.rows);
this.total = (this.sectionData && this.sectionData.total) || 0;
this.pageNum = (this.sectionData && this.sectionData.pageNum) || 1;
this.pageSize = (this.sectionData && this.sectionData.pageSize) || 5;
},
},
},
methods: {
@@ -172,6 +208,29 @@ export default {
handleViewProject(row) {
this.$emit("view-project-analysis", row);
},
handlePageChange({ page }) {
this.loadRiskPeoplePage(page);
},
async loadRiskPeoplePage(pageNum) {
if (!this.projectId) {
return;
}
this.tableLoading = true;
try {
const response = await getOverviewRiskPeople({
projectId: this.projectId,
pageNum,
pageSize: 5,
});
const data = (response && response.data) || {};
this.localRows = normalizeOverviewRows(data.rows);
this.total = data.total || 0;
this.pageNum = data.pageNum || pageNum;
this.pageSize = data.pageSize || 5;
} finally {
this.tableLoading = false;
}
},
},
};
</script>