实现结果总览排除可疑预警

This commit is contained in:
wjj
2026-07-09 14:49:02 +08:00
parent 9c02812675
commit 3f3e9268f2
22 changed files with 1549 additions and 32 deletions

View File

@@ -8,6 +8,14 @@ export function getOverviewDashboard(projectId) {
})
}
export function excludeOverviewRisk(data) {
return request({
url: '/ccdi/project/overview/risk-exclusions',
method: 'post',
data
})
}
export function getOverviewRiskPeople(params) {
return request({
url: '/ccdi/project/overview/risk-people',

View File

@@ -51,7 +51,9 @@
:detail-data="abnormalDetailData"
:person="normalizedPerson"
:project-id="projectId"
:can-operate="canOperate"
@evidence-confirm="$emit('evidence-confirm', $event)"
@risk-excluded="handleRiskExcluded"
/>
</div>
</el-tab-pane>
@@ -102,6 +104,10 @@ export default {
type: String,
default: "",
},
canOperate: {
type: Boolean,
default: true,
},
},
data() {
return {
@@ -314,6 +320,7 @@ export default {
const statementReason = this.buildStatementReasonDetail(ruleName, matchedRows);
return {
modelCode: safeTag.modelCode || `EXTERNAL_MODEL_${index}`,
ruleCode: safeTag.ruleCode || "",
title: ruleName,
subtitle: modelName,
riskTags: [modelName, this.formatRiskLevel(safeTag.riskLevel)].filter(Boolean),
@@ -417,6 +424,10 @@ export default {
}
return "";
},
async handleRiskExcluded(payload) {
await this.loadStatementRows();
this.$emit("risk-excluded", payload);
},
closeDialog() {
this.visibleProxy = false;
},

View File

@@ -32,6 +32,7 @@
</div>
<overview-stats :summary="visibleSummary" />
<risk-people-section
ref="riskPeopleSection"
:project-id="projectId"
:section-data="currentData.riskPeople"
:selected-model-codes="selectedModelCodes"
@@ -41,12 +42,14 @@
/>
</section>
<risk-model-section
ref="riskModelSection"
:section-data="currentData.riskModels"
@selection-change="handleRiskModelSelectionChange"
@view-project-analysis="handleRiskModelProjectAnalysis"
@view-external-detail="handleExternalDetail"
/>
<risk-detail-section
ref="riskDetailSection"
:section-data="currentData.riskDetails"
@evidence-confirm="$emit('evidence-confirm', $event)"
/>
@@ -61,13 +64,16 @@
:can-operate="canOperate"
@close="handleProjectAnalysisDialogClose"
@evidence-confirm="$emit('evidence-confirm', $event)"
@risk-excluded="handleRiskExcluded"
/>
<external-person-detail-dialog
:visible.sync="externalDetailVisible"
:person="currentExternalPerson"
:project-id="projectId"
:project-name="projectInfo.projectName"
:can-operate="canOperate"
@evidence-confirm="$emit('evidence-confirm', $event)"
@risk-excluded="handleRiskExcluded"
/>
</div>
</template>
@@ -266,6 +272,61 @@ export default {
this.currentExternalPerson = row || null;
this.externalDetailVisible = true;
},
async handleRiskExcluded() {
await this.loadOverviewData({ silent: true });
this.syncCurrentProjectAnalysisPerson();
this.$nextTick(() => {
const riskModelSection = this.$refs.riskModelSection;
if (riskModelSection) {
if (riskModelSection.loadExternalCards) {
riskModelSection.loadExternalCards();
}
if (riskModelSection.fetchPeopleList) {
riskModelSection.fetchPeopleList({ syncCardLoading: true });
}
}
const riskDetailSection = this.$refs.riskDetailSection;
if (riskDetailSection && riskDetailSection.refreshAfterRiskExcluded) {
riskDetailSection.refreshAfterRiskExcluded();
}
});
},
syncCurrentProjectAnalysisPerson() {
if (!this.projectAnalysisDialogVisible || !this.currentProjectAnalysisPerson) {
return;
}
const currentStaffIdCard = this.currentProjectAnalysisPerson.idNo
|| this.currentProjectAnalysisPerson.staffIdCard
|| "";
if (!currentStaffIdCard) {
return;
}
const latestPerson = this.findOverviewPersonByIdCard(currentStaffIdCard);
if (!latestPerson) {
return;
}
this.currentProjectAnalysisPerson = {
...this.currentProjectAnalysisPerson,
...latestPerson,
};
this.projectAnalysisModelSummary = this.buildProjectAnalysisModelSummary(
this.projectAnalysisSource,
this.currentProjectAnalysisPerson
);
},
findOverviewPersonByIdCard(staffIdCard) {
const employeeRows = Array.isArray(this.realData && this.realData.riskPeople && this.realData.riskPeople.rows)
? this.realData.riskPeople.rows
: [];
const externalRows = this.riskPeopleScopeSummary
&& this.riskPeopleScopeSummary.external
&& Array.isArray(this.riskPeopleScopeSummary.external.rows)
? this.riskPeopleScopeSummary.external.rows
: [];
return [...employeeRows, ...externalRows].find((item) => (
item && (item.idNo === staffIdCard || item.staffIdCard === staffIdCard)
));
},
openProjectAnalysisDialog(source, person) {
this.projectAnalysisSource = source || "riskPeople";
this.currentProjectAnalysisPerson = person || null;
@@ -324,7 +385,8 @@ export default {
`初核结果报告_${this.projectId}_${new Date().getTime()}.pdf`
);
},
async loadOverviewData() {
async loadOverviewData(options = {}) {
const silent = Boolean(options && options.silent);
if (!this.projectId) {
this.realData = this.stateDataMap.empty;
this.pageState = "empty";
@@ -334,17 +396,19 @@ export default {
return;
}
this.pageState = "loading";
this.selectedModelCodes = [];
this.riskPeopleScopeSummary = {
activeTab: "employee",
external: {
total: 0,
rows: [],
},
};
this.resetProjectAnalysisDialog();
this.resetExternalDetailDialog();
if (!silent) {
this.pageState = "loading";
this.selectedModelCodes = [];
this.riskPeopleScopeSummary = {
activeTab: "employee",
external: {
total: 0,
rows: [],
},
};
this.resetProjectAnalysisDialog();
this.resetExternalDetailDialog();
}
try {
const [
dashboardRes,
@@ -399,11 +463,13 @@ export default {
this.pageState = hasOverviewData ? "loaded" : "empty";
} catch (error) {
this.realData = this.stateDataMap.empty;
this.pageState = "empty";
this.selectedModelCodes = [];
this.resetProjectAnalysisDialog();
this.resetExternalDetailDialog();
if (!silent) {
this.realData = this.stateDataMap.empty;
this.pageState = "empty";
this.selectedModelCodes = [];
this.resetProjectAnalysisDialog();
this.resetExternalDetailDialog();
}
console.error("加载结果总览失败", error);
}
},

View File

@@ -54,14 +54,26 @@
<el-table-column label="异常标签" min-width="220">
<template slot-scope="scope">
<div v-if="scope.row.hitTags && scope.row.hitTags.length" class="tag-list">
<el-tag
<span
v-for="(tag, index) in scope.row.hitTags"
:key="`${scope.row.bankStatementId || index}-tag-${index}`"
size="mini"
effect="plain"
class="tag-with-action"
>
{{ tag.ruleName }}
</el-tag>
<el-tag size="mini" effect="plain">
{{ tag.ruleName }}
</el-tag>
<el-button
v-if="canOperate"
class="exclude-risk-btn"
type="text"
size="mini"
:loading="isExcluding(buildStatementExcludeKey(scope.row, tag))"
:disabled="!tag.ruleCode"
@click="handleExcludeStatementRisk(scope.row, tag)"
>
排除可疑
</el-button>
</span>
</div>
<span v-else class="summary-row__label">-</span>
</template>
@@ -93,15 +105,28 @@
<div class="object-card__title">{{ item.title || "-" }}</div>
<div class="object-card__subtitle">{{ item.subtitle || "-" }}</div>
</div>
<el-button
class="evidence-corner-btn"
size="mini"
plain
:disabled="!buildModelEvidenceFingerprint(resolvePersonIdCard(), item.modelCode)"
@click="handleAddModelEvidence(item, group)"
>
加入证据库
</el-button>
<div class="object-card__actions">
<el-button
v-if="canOperate"
class="evidence-corner-btn"
size="mini"
plain
:loading="isExcluding(buildObjectExcludeKey(item))"
:disabled="!item.ruleCode"
@click="handleExcludeObjectRisk(item)"
>
排除可疑
</el-button>
<el-button
class="evidence-corner-btn"
size="mini"
plain
:disabled="!buildModelEvidenceFingerprint(resolvePersonIdCard(), item.modelCode)"
@click="handleAddModelEvidence(item, group)"
>
加入证据库
</el-button>
</div>
</div>
<div v-if="item.riskTags && item.riskTags.length" class="tag-list">
<el-tag
@@ -137,6 +162,7 @@
<script>
import { saveAs } from "file-saver";
import { excludeOverviewRisk } from "@/api/ccdi/projectOverview";
import { buildModelEvidenceFingerprint, MODEL_EVIDENCE_FINGERPRINT_RULE } from "@/utils/ccdiEvidence";
export default {
@@ -156,11 +182,16 @@ export default {
type: [String, Number],
default: null,
},
canOperate: {
type: Boolean,
default: true,
},
},
data() {
return {
statementPageSize: 5,
statementPageMap: {},
excludingKey: "",
};
},
watch: {
@@ -205,6 +236,95 @@ export default {
const groupKey = this.resolveGroupKey(group);
this.$set(this.statementPageMap, groupKey, page);
},
buildStatementExcludeKey(row, tag) {
return `STATEMENT:${row && row.bankStatementId}:${tag && tag.ruleCode}`;
},
buildObjectExcludeKey(item) {
return `OBJECT:${this.resolvePersonIdCard()}:${item && item.ruleCode}`;
},
isExcluding(key) {
return Boolean(key && this.excludingKey === key);
},
async handleExcludeStatementRisk(row, tag) {
if (!this.canOperate) {
this.$message.warning("当前项目仅可查看,不能排除可疑");
return;
}
if (!this.projectId || !row || !row.bankStatementId || !tag || !tag.ruleCode) {
this.$message.warning("缺少流水或规则信息,暂不能排除可疑");
return;
}
const ruleName = tag.ruleName || "当前规则";
await this.submitRiskExclusion({
key: this.buildStatementExcludeKey(row, tag),
message: `确认将当前流水的“${ruleName}”标记为排除可疑吗?该操作只影响当前流水上的这一个规则标签。`,
payload: {
projectId: this.projectId,
exclusionType: "STATEMENT",
ruleCode: tag.ruleCode,
bankStatementId: row.bankStatementId,
staffIdCard: this.resolvePersonIdCard(),
},
});
},
async handleExcludeObjectRisk(item) {
if (!this.canOperate) {
this.$message.warning("当前项目仅可查看,不能排除可疑");
return;
}
const staffIdCard = this.resolvePersonIdCard();
if (!this.projectId || !staffIdCard || !item || !item.ruleCode) {
this.$message.warning("缺少人员或规则信息,暂不能排除可疑");
return;
}
const ruleName = item.summary || item.title || "当前规则";
await this.submitRiskExclusion({
key: this.buildObjectExcludeKey(item),
message: `确认将“${this.resolvePersonName()}”的“${ruleName}”标记为排除可疑吗?该操作只影响当前人员的这一个规则预警。`,
payload: {
projectId: this.projectId,
exclusionType: "OBJECT",
ruleCode: item.ruleCode,
staffIdCard,
},
});
},
async submitRiskExclusion({ key, message, payload }) {
if (this.excludingKey) {
return;
}
try {
const { value } = await this.$prompt(message, "排除可疑", {
confirmButtonText: "确认排除",
cancelButtonText: "取消",
inputType: "textarea",
inputPlaceholder: "请输入排除原因",
inputValidator: (value) => {
if (!value || !value.trim()) {
return "排除原因不能为空";
}
if (value.trim().length > 1000) {
return "排除原因不能超过1000个字符";
}
return true;
},
});
this.excludingKey = key;
await excludeOverviewRisk({
...payload,
excludeReason: value.trim(),
});
this.$message.success("排除成功");
this.$emit("risk-excluded", payload);
} catch (error) {
if (error !== "cancel" && error !== "close") {
const message = error && error.msg ? error.msg : "排除失败,请稍后重试";
this.$message.error(message);
}
} finally {
this.excludingKey = "";
}
},
shouldShowExportButton(group) {
return group && group.groupType === "BANK_STATEMENT";
},
@@ -403,6 +523,17 @@ export default {
gap: 10px;
}
.tag-with-action {
display: inline-flex;
align-items: center;
gap: 4px;
}
.exclude-risk-btn {
padding: 0;
font-size: 12px;
}
.object-card-grid {
display: grid;
grid-template-columns: minmax(0, 1fr);
@@ -424,6 +555,12 @@ export default {
margin-bottom: 8px;
}
.object-card__actions {
display: inline-flex;
flex: 0 0 auto;
gap: 6px;
}
.object-card__title {
font-size: 15px;
font-weight: 600;

View File

@@ -60,7 +60,9 @@
:detail-data="dialogData.abnormalDetail"
:person="person"
:project-id="projectId"
:can-operate="canOperate"
@evidence-confirm="$emit('evidence-confirm', $event)"
@risk-excluded="handleRiskExcluded"
/>
</el-tab-pane>
<el-tab-pane label="资产分析" name="assetAnalysis">
@@ -222,7 +224,7 @@ export default {
...(this.modelSummary || {}),
},
},
abnormalDetail: (this.detailData && this.detailData.abnormalDetail) || mockData.abnormalDetail,
abnormalDetail: (this.detailData && this.detailData.abnormalDetail) || { groups: [] },
};
},
visibleProxy: {
@@ -301,6 +303,10 @@ export default {
handleRetryDetail() {
this.fetchDetailData();
},
async handleRiskExcluded(payload) {
await this.fetchDetailData();
this.$emit("risk-excluded", payload);
},
async fetchAssetDetailData() {
if (this.assetLoaded || this.assetLoading) {
return;

View File

@@ -579,6 +579,21 @@ export default {
this.suspiciousPageNum = 1;
await this.loadSuspiciousTransactions();
},
async refreshAfterRiskExcluded() {
this.statementDetailCache = {};
await this.loadSuspiciousTransactions();
if (this.detailVisible && this.detailData && this.detailData.bankStatementId) {
try {
this.detailLoading = true;
this.detailData = await this.fetchStatementDetail(this.detailData.bankStatementId, false);
} catch (error) {
this.$message.error("刷新流水详情失败");
console.error("刷新流水详情失败", error);
} finally {
this.detailLoading = false;
}
}
},
async handlePageChange(pageInfo) {
if (typeof pageInfo === "number") {
this.suspiciousPageNum = pageInfo;