打通结果总览项目分析弹窗入口
This commit is contained in:
@@ -17,13 +17,21 @@
|
||||
<risk-people-section
|
||||
:section-data="currentData.riskPeople"
|
||||
:selected-model-codes="selectedModelCodes"
|
||||
@view-project-analysis="handleRiskPeopleProjectAnalysis"
|
||||
/>
|
||||
<risk-model-section
|
||||
:section-data="currentData.riskModels"
|
||||
@selection-change="handleRiskModelSelectionChange"
|
||||
@view-project-analysis="handleRiskModelProjectAnalysis"
|
||||
/>
|
||||
<risk-detail-section :section-data="currentData.riskDetails" />
|
||||
</div>
|
||||
<project-analysis-dialog
|
||||
:visible.sync="projectAnalysisDialogVisible"
|
||||
:person="currentProjectAnalysisPerson"
|
||||
:source="projectAnalysisSource"
|
||||
@close="handleProjectAnalysisDialogClose"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -42,6 +50,7 @@ import OverviewStats from "./OverviewStats";
|
||||
import RiskPeopleSection from "./RiskPeopleSection";
|
||||
import RiskModelSection from "./RiskModelSection";
|
||||
import RiskDetailSection from "./RiskDetailSection";
|
||||
import ProjectAnalysisDialog from "./ProjectAnalysisDialog";
|
||||
|
||||
export default {
|
||||
name: "PreliminaryCheck",
|
||||
@@ -50,6 +59,7 @@ export default {
|
||||
RiskPeopleSection,
|
||||
RiskModelSection,
|
||||
RiskDetailSection,
|
||||
ProjectAnalysisDialog,
|
||||
},
|
||||
props: {
|
||||
projectId: {
|
||||
@@ -72,6 +82,9 @@ export default {
|
||||
mockData: mockOverviewData,
|
||||
stateDataMap: mockOverviewStateData,
|
||||
realData: mockOverviewData,
|
||||
projectAnalysisDialogVisible: false,
|
||||
currentProjectAnalysisPerson: null,
|
||||
projectAnalysisSource: "riskPeople",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -91,6 +104,7 @@ export default {
|
||||
this.realData = this.stateDataMap.empty;
|
||||
this.pageState = "empty";
|
||||
this.selectedModelCodes = [];
|
||||
this.resetProjectAnalysisDialog();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -100,21 +114,44 @@ export default {
|
||||
}
|
||||
this.realData = this.stateDataMap.empty;
|
||||
this.pageState = "empty";
|
||||
this.resetProjectAnalysisDialog();
|
||||
},
|
||||
methods: {
|
||||
handleRiskModelSelectionChange(modelCodes) {
|
||||
this.selectedModelCodes = Array.isArray(modelCodes) ? [...modelCodes] : [];
|
||||
},
|
||||
handleRiskPeopleProjectAnalysis(row) {
|
||||
this.openProjectAnalysisDialog("riskPeople", row);
|
||||
},
|
||||
handleRiskModelProjectAnalysis(row) {
|
||||
this.openProjectAnalysisDialog("riskModelPeople", row);
|
||||
},
|
||||
openProjectAnalysisDialog(source, person) {
|
||||
this.projectAnalysisSource = source || "riskPeople";
|
||||
this.currentProjectAnalysisPerson = person || null;
|
||||
this.projectAnalysisDialogVisible = true;
|
||||
},
|
||||
handleProjectAnalysisDialogClose() {
|
||||
this.projectAnalysisDialogVisible = false;
|
||||
this.resetProjectAnalysisDialog();
|
||||
},
|
||||
resetProjectAnalysisDialog() {
|
||||
this.projectAnalysisDialogVisible = false;
|
||||
this.currentProjectAnalysisPerson = null;
|
||||
this.projectAnalysisSource = "riskPeople";
|
||||
},
|
||||
async loadOverviewData() {
|
||||
if (!this.projectId) {
|
||||
this.realData = this.stateDataMap.empty;
|
||||
this.pageState = "empty";
|
||||
this.selectedModelCodes = [];
|
||||
this.resetProjectAnalysisDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
this.pageState = "loading";
|
||||
this.selectedModelCodes = [];
|
||||
this.resetProjectAnalysisDialog();
|
||||
try {
|
||||
const [dashboardRes, riskPeopleRes, riskModelCardsRes] = await Promise.all([
|
||||
getOverviewDashboard(this.projectId),
|
||||
@@ -143,6 +180,7 @@ export default {
|
||||
this.realData = this.stateDataMap.empty;
|
||||
this.pageState = "empty";
|
||||
this.selectedModelCodes = [];
|
||||
this.resetProjectAnalysisDialog();
|
||||
console.error("加载结果总览失败", error);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="项目分析"
|
||||
:visible.sync="visibleProxy"
|
||||
width="1280px"
|
||||
append-to-body
|
||||
@close="handleClose"
|
||||
>
|
||||
<div class="project-analysis-dialog-placeholder">
|
||||
<div class="placeholder-title">{{ person && person.name ? person.name : "项目分析" }}</div>
|
||||
<div class="placeholder-subtitle">
|
||||
当前来源:{{ source === "riskModelPeople" ? "命中模型涉及人员" : "风险人员总览" }}
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ProjectAnalysisDialog",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
person: {
|
||||
type: Object,
|
||||
default: () => null,
|
||||
},
|
||||
source: {
|
||||
type: String,
|
||||
default: "riskPeople",
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
visibleProxy: {
|
||||
get() {
|
||||
return this.visible;
|
||||
},
|
||||
set(value) {
|
||||
this.$emit("update:visible", value);
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleClose() {
|
||||
this.$emit("close");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.project-analysis-dialog-placeholder {
|
||||
min-height: 160px;
|
||||
padding: 24px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.placeholder-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: #0f172a;
|
||||
}
|
||||
|
||||
.placeholder-subtitle {
|
||||
margin-top: 8px;
|
||||
font-size: 13px;
|
||||
color: #64748b;
|
||||
}
|
||||
</style>
|
||||
@@ -123,8 +123,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini">{{
|
||||
scope.row.actionLabel || "查看详情"
|
||||
<el-button type="text" size="mini" @click="handleViewProject(scope.row)">{{
|
||||
scope.row.actionLabel || "查看项目"
|
||||
}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -294,6 +294,9 @@ export default {
|
||||
}
|
||||
return modelNames.join("、");
|
||||
},
|
||||
handleViewProject(row) {
|
||||
this.$emit("view-project-analysis", row);
|
||||
},
|
||||
resolveModelTagType(tag) {
|
||||
if (!this.selectedModelCodes.length) {
|
||||
return "";
|
||||
|
||||
@@ -46,7 +46,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="mini">{{ scope.row.actionLabel || "查看详情" }}</el-button>
|
||||
<el-button type="text" size="mini" @click="handleViewProject(scope.row)">{{
|
||||
scope.row.actionLabel || "查看项目"
|
||||
}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -174,6 +176,9 @@ export default {
|
||||
resolveModelTagStyle(tag) {
|
||||
return CORE_TAG_PALETTE[tag.modelCode] || {};
|
||||
},
|
||||
handleViewProject(row) {
|
||||
this.$emit("view-project-analysis", row);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const entry = fs.readFileSync(
|
||||
path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiProject/components/detail/PreliminaryCheck.vue"
|
||||
),
|
||||
"utf8"
|
||||
);
|
||||
const people = fs.readFileSync(
|
||||
path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiProject/components/detail/RiskPeopleSection.vue"
|
||||
),
|
||||
"utf8"
|
||||
);
|
||||
const model = fs.readFileSync(
|
||||
path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiProject/components/detail/RiskModelSection.vue"
|
||||
),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
[
|
||||
'import ProjectAnalysisDialog from "./ProjectAnalysisDialog";',
|
||||
"ProjectAnalysisDialog",
|
||||
"projectAnalysisDialogVisible",
|
||||
"<project-analysis-dialog",
|
||||
':visible.sync="projectAnalysisDialogVisible"',
|
||||
].forEach((token) => assert(entry.includes(token), token));
|
||||
|
||||
[
|
||||
'@view-project-analysis="handleRiskPeopleProjectAnalysis"',
|
||||
'@view-project-analysis="handleRiskModelProjectAnalysis"',
|
||||
].forEach((token) => assert(entry.includes(token), token));
|
||||
|
||||
[
|
||||
'@click="handleViewProject(scope.row)"',
|
||||
'$emit("view-project-analysis", row)',
|
||||
'scope.row.actionLabel || "查看项目"',
|
||||
].forEach((token) => assert(people.includes(token), token));
|
||||
|
||||
[
|
||||
'@click="handleViewProject(scope.row)"',
|
||||
'$emit("view-project-analysis", row)',
|
||||
'scope.row.actionLabel || "查看项目"',
|
||||
].forEach((token) => assert(model.includes(token), token));
|
||||
@@ -0,0 +1,29 @@
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const entry = fs.readFileSync(
|
||||
path.resolve(
|
||||
__dirname,
|
||||
"../../src/views/ccdiProject/components/detail/PreliminaryCheck.vue"
|
||||
),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
[
|
||||
"currentProjectAnalysisPerson",
|
||||
"projectAnalysisSource",
|
||||
"openProjectAnalysisDialog(source, person)",
|
||||
'this.projectAnalysisSource = source || "riskPeople"',
|
||||
"this.currentProjectAnalysisPerson = person || null",
|
||||
"this.projectAnalysisDialogVisible = true",
|
||||
'this.openProjectAnalysisDialog("riskPeople", row)',
|
||||
'this.openProjectAnalysisDialog("riskModelPeople", row)',
|
||||
'projectAnalysisSource: "riskPeople"',
|
||||
].forEach((token) => assert(entry.includes(token), token));
|
||||
|
||||
[
|
||||
':person="currentProjectAnalysisPerson"',
|
||||
':source="projectAnalysisSource"',
|
||||
"@close=\"handleProjectAnalysisDialogClose\"",
|
||||
].forEach((token) => assert(entry.includes(token), token));
|
||||
Reference in New Issue
Block a user