接入结果总览模型卡片真实数据
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
import {
|
||||
getOverviewDashboard,
|
||||
getOverviewRiskPeople,
|
||||
getOverviewRiskModelCards,
|
||||
} from "@/api/ccdi/projectOverview";
|
||||
import OverviewStats from "./OverviewStats";
|
||||
import RiskPeopleSection from "./RiskPeopleSection";
|
||||
@@ -102,21 +103,26 @@ export default {
|
||||
|
||||
this.pageState = "loading";
|
||||
try {
|
||||
const [dashboardRes, riskPeopleRes] = await Promise.all([
|
||||
const [dashboardRes, riskPeopleRes, riskModelCardsRes] = await Promise.all([
|
||||
getOverviewDashboard(this.projectId),
|
||||
getOverviewRiskPeople(this.projectId),
|
||||
getOverviewRiskModelCards(this.projectId),
|
||||
]);
|
||||
const dashboardData = (dashboardRes && dashboardRes.data) || {};
|
||||
const riskPeopleData = (riskPeopleRes && riskPeopleRes.data) || {};
|
||||
const riskModelCardsData = (riskModelCardsRes && riskModelCardsRes.data) || {};
|
||||
|
||||
this.realData = createOverviewLoadedData({
|
||||
projectId: this.projectId,
|
||||
dashboardData,
|
||||
riskPeopleData,
|
||||
riskModelCardsData,
|
||||
});
|
||||
|
||||
const hasOverviewData = Boolean(
|
||||
(Array.isArray(dashboardData.stats) && dashboardData.stats.length) ||
|
||||
(Array.isArray(riskPeopleData.overviewList) && riskPeopleData.overviewList.length)
|
||||
(Array.isArray(riskPeopleData.overviewList) && riskPeopleData.overviewList.length) ||
|
||||
(Array.isArray(riskModelCardsData.cardList) && riskModelCardsData.cardList.length)
|
||||
);
|
||||
|
||||
this.pageState = hasOverviewData ? "loaded" : "empty";
|
||||
|
||||
Reference in New Issue
Block a user