完善外部人员预警与项目分析上线内容
This commit is contained in:
@@ -30,18 +30,21 @@
|
||||
导出报告
|
||||
</el-button>
|
||||
</div>
|
||||
<overview-stats :summary="currentData.summary" />
|
||||
<overview-stats :summary="visibleSummary" />
|
||||
<risk-people-section
|
||||
:project-id="projectId"
|
||||
:section-data="currentData.riskPeople"
|
||||
:selected-model-codes="selectedModelCodes"
|
||||
@view-project-analysis="handleRiskPeopleProjectAnalysis"
|
||||
@view-external-detail="handleExternalDetail"
|
||||
@scope-summary-change="handleRiskPeopleScopeSummaryChange"
|
||||
/>
|
||||
</section>
|
||||
<risk-model-section
|
||||
:section-data="currentData.riskModels"
|
||||
@selection-change="handleRiskModelSelectionChange"
|
||||
@view-project-analysis="handleRiskModelProjectAnalysis"
|
||||
@view-external-detail="handleExternalDetail"
|
||||
/>
|
||||
<risk-detail-section
|
||||
:section-data="currentData.riskDetails"
|
||||
@@ -58,6 +61,13 @@
|
||||
@close="handleProjectAnalysisDialogClose"
|
||||
@evidence-confirm="$emit('evidence-confirm', $event)"
|
||||
/>
|
||||
<external-person-detail-dialog
|
||||
:visible.sync="externalDetailVisible"
|
||||
:person="currentExternalPerson"
|
||||
:project-id="projectId"
|
||||
:project-name="projectInfo.projectName"
|
||||
@evidence-confirm="$emit('evidence-confirm', $event)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -70,6 +80,7 @@ import {
|
||||
import {
|
||||
getOverviewDashboard,
|
||||
getOverviewEmployeeCreditNegative,
|
||||
getOverviewExternalRiskSummary,
|
||||
getOverviewRiskPeople,
|
||||
getOverviewRiskModelCards,
|
||||
getOverviewSuspiciousTransactions,
|
||||
@@ -79,6 +90,7 @@ import RiskPeopleSection from "./RiskPeopleSection";
|
||||
import RiskModelSection from "./RiskModelSection";
|
||||
import RiskDetailSection from "./RiskDetailSection";
|
||||
import ProjectAnalysisDialog from "./ProjectAnalysisDialog";
|
||||
import ExternalPersonDetailDialog from "./ExternalPersonDetailDialog";
|
||||
|
||||
export default {
|
||||
name: "PreliminaryCheck",
|
||||
@@ -88,6 +100,7 @@ export default {
|
||||
RiskModelSection,
|
||||
RiskDetailSection,
|
||||
ProjectAnalysisDialog,
|
||||
ExternalPersonDetailDialog,
|
||||
},
|
||||
props: {
|
||||
projectId: {
|
||||
@@ -118,6 +131,15 @@ export default {
|
||||
currentModel: "-",
|
||||
riskTags: [],
|
||||
},
|
||||
riskPeopleScopeSummary: {
|
||||
activeTab: "employee",
|
||||
external: {
|
||||
total: 0,
|
||||
rows: [],
|
||||
},
|
||||
},
|
||||
currentExternalPerson: null,
|
||||
externalDetailVisible: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -127,6 +149,12 @@ export default {
|
||||
}
|
||||
return this.stateDataMap[this.pageState] || this.realData;
|
||||
},
|
||||
visibleSummary() {
|
||||
return {
|
||||
...this.currentData.summary,
|
||||
stats: this.buildCombinedSummaryStats(),
|
||||
};
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
projectId(newVal) {
|
||||
@@ -138,6 +166,7 @@ export default {
|
||||
this.pageState = "empty";
|
||||
this.selectedModelCodes = [];
|
||||
this.resetProjectAnalysisDialog();
|
||||
this.resetExternalDetailDialog();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -148,17 +177,90 @@ export default {
|
||||
this.realData = this.stateDataMap.empty;
|
||||
this.pageState = "empty";
|
||||
this.resetProjectAnalysisDialog();
|
||||
this.resetExternalDetailDialog();
|
||||
},
|
||||
methods: {
|
||||
handleRiskModelSelectionChange(modelCodes) {
|
||||
this.selectedModelCodes = Array.isArray(modelCodes) ? [...modelCodes] : [];
|
||||
},
|
||||
handleRiskPeopleScopeSummaryChange(summary) {
|
||||
this.riskPeopleScopeSummary = {
|
||||
activeTab: summary && summary.activeTab ? summary.activeTab : "employee",
|
||||
external: {
|
||||
total: summary && summary.external ? summary.external.total || 0 : 0,
|
||||
rows: summary && summary.external && Array.isArray(summary.external.rows)
|
||||
? summary.external.rows
|
||||
: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
buildCombinedSummaryStats() {
|
||||
const external = (this.currentData.summary && this.currentData.summary.externalRiskSummary) || {};
|
||||
const employeeStats = ((this.currentData.summary && this.currentData.summary.stats) || []);
|
||||
const statMap = employeeStats.reduce((result, item) => {
|
||||
result[item.key] = item;
|
||||
return result;
|
||||
}, {});
|
||||
const high = Number((statMap.riskPeople && statMap.riskPeople.value) || 0);
|
||||
const medium = Number((statMap.medium && statMap.medium.value) || 0);
|
||||
const low = Number((statMap.low && statMap.low.value) || 0);
|
||||
const noRisk = Number((statMap.count && statMap.count.value) || 0);
|
||||
const externalTotal = Number(external.total || 0);
|
||||
const externalHigh = Number(external.high || 0);
|
||||
const externalMedium = Number(external.medium || 0);
|
||||
const externalLow = Number(external.low || 0);
|
||||
const externalNoRisk = Number(external.noRisk || 0);
|
||||
const buildSplit = (employeeValue, externalValue) => (externalTotal > 0
|
||||
? `员工 ${employeeValue} / 外部 ${externalValue}`
|
||||
: "");
|
||||
return [
|
||||
{
|
||||
...(statMap.people || {}),
|
||||
key: "people",
|
||||
label: "总人数",
|
||||
value: Number((statMap.people && statMap.people.value) || 0) + externalTotal,
|
||||
desc: buildSplit(Number((statMap.people && statMap.people.value) || 0), externalTotal),
|
||||
},
|
||||
{
|
||||
...(statMap.riskPeople || {}),
|
||||
key: "riskPeople",
|
||||
label: "高风险",
|
||||
value: high + externalHigh,
|
||||
desc: buildSplit(high, externalHigh),
|
||||
},
|
||||
{
|
||||
...(statMap.medium || {}),
|
||||
key: "medium",
|
||||
label: "中风险",
|
||||
value: medium + externalMedium,
|
||||
desc: buildSplit(medium, externalMedium),
|
||||
},
|
||||
{
|
||||
...(statMap.low || {}),
|
||||
key: "low",
|
||||
label: "低风险",
|
||||
value: low + externalLow,
|
||||
desc: buildSplit(low, externalLow),
|
||||
},
|
||||
{
|
||||
...(statMap.count || {}),
|
||||
key: "count",
|
||||
label: "无风险",
|
||||
value: noRisk + externalNoRisk,
|
||||
desc: buildSplit(noRisk, externalNoRisk),
|
||||
},
|
||||
];
|
||||
},
|
||||
handleRiskPeopleProjectAnalysis(row) {
|
||||
this.openProjectAnalysisDialog("riskPeople", row);
|
||||
},
|
||||
handleRiskModelProjectAnalysis(row) {
|
||||
this.openProjectAnalysisDialog("riskModelPeople", row);
|
||||
},
|
||||
handleExternalDetail(row) {
|
||||
this.currentExternalPerson = row || null;
|
||||
this.externalDetailVisible = true;
|
||||
},
|
||||
openProjectAnalysisDialog(source, person) {
|
||||
this.projectAnalysisSource = source || "riskPeople";
|
||||
this.currentProjectAnalysisPerson = person || null;
|
||||
@@ -201,6 +303,10 @@ export default {
|
||||
riskTags,
|
||||
};
|
||||
},
|
||||
resetExternalDetailDialog() {
|
||||
this.externalDetailVisible = false;
|
||||
this.currentExternalPerson = null;
|
||||
},
|
||||
handleOverviewReportExport() {
|
||||
if (!this.projectId) {
|
||||
return;
|
||||
@@ -219,14 +325,30 @@ export default {
|
||||
this.pageState = "empty";
|
||||
this.selectedModelCodes = [];
|
||||
this.resetProjectAnalysisDialog();
|
||||
this.resetExternalDetailDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
this.pageState = "loading";
|
||||
this.selectedModelCodes = [];
|
||||
this.riskPeopleScopeSummary = {
|
||||
activeTab: "employee",
|
||||
external: {
|
||||
total: 0,
|
||||
rows: [],
|
||||
},
|
||||
};
|
||||
this.resetProjectAnalysisDialog();
|
||||
this.resetExternalDetailDialog();
|
||||
try {
|
||||
const [dashboardRes, riskPeopleRes, riskModelCardsRes, suspiciousRes, creditNegativeRes] = await Promise.all([
|
||||
const [
|
||||
dashboardRes,
|
||||
riskPeopleRes,
|
||||
riskModelCardsRes,
|
||||
suspiciousRes,
|
||||
creditNegativeRes,
|
||||
externalSummaryRes,
|
||||
] = await Promise.all([
|
||||
getOverviewDashboard(this.projectId),
|
||||
getOverviewRiskPeople({
|
||||
projectId: this.projectId,
|
||||
@@ -245,12 +367,14 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
}),
|
||||
getOverviewExternalRiskSummary(this.projectId),
|
||||
]);
|
||||
const dashboardData = (dashboardRes && dashboardRes.data) || {};
|
||||
const riskPeopleData = (riskPeopleRes && riskPeopleRes.data) || {};
|
||||
const riskModelCardsData = (riskModelCardsRes && riskModelCardsRes.data) || {};
|
||||
const suspiciousData = (suspiciousRes && suspiciousRes.data) || {};
|
||||
const creditNegativeData = (creditNegativeRes && creditNegativeRes.data) || {};
|
||||
const externalRiskSummary = (externalSummaryRes && externalSummaryRes.data) || {};
|
||||
|
||||
this.realData = createOverviewLoadedData({
|
||||
projectId: this.projectId,
|
||||
@@ -259,6 +383,7 @@ export default {
|
||||
riskModelCardsData,
|
||||
suspiciousData,
|
||||
creditNegativeData,
|
||||
externalRiskSummary,
|
||||
});
|
||||
|
||||
const hasOverviewData = Boolean(
|
||||
@@ -273,6 +398,7 @@ export default {
|
||||
this.pageState = "empty";
|
||||
this.selectedModelCodes = [];
|
||||
this.resetProjectAnalysisDialog();
|
||||
this.resetExternalDetailDialog();
|
||||
console.error("加载结果总览失败", error);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user