Files
ccdi/ruoyi-ui/src/views/ccdiProject/components/detail/ProjectAnalysisSidebar.vue

196 lines
4.3 KiB
Vue
Raw Normal View History

<template>
<aside class="project-analysis-sidebar">
2026-05-06 17:03:55 +08:00
<section class="sidebar-profile">
<div class="sidebar-profile__name-row">
<div>
<div class="sidebar-section__eyebrow">人物档案</div>
<div class="sidebar-profile__name">{{ sidebarData.basicInfo.name || "-" }}</div>
</div>
2026-05-06 17:03:55 +08:00
<div class="sidebar-risk-badge">{{ sidebarData.basicInfo.riskLevel || "-" }}</div>
</div>
2026-05-06 17:03:55 +08:00
<div class="sidebar-profile__meta">
<div class="sidebar-profile__item">
<span class="sidebar-profile__label">工号</span>
<span class="sidebar-profile__value">{{ sidebarData.basicInfo.staffCode || "-" }}</span>
</div>
<div class="sidebar-profile__item">
<span class="sidebar-profile__label">部门</span>
<span class="sidebar-profile__value">{{ sidebarData.basicInfo.department || "-" }}</span>
</div>
2026-05-06 17:03:55 +08:00
<div class="sidebar-profile__item">
<span class="sidebar-profile__label">所属项目</span>
<span class="sidebar-profile__value">{{ sidebarData.basicInfo.projectName || "-" }}</span>
</div>
2026-05-06 17:03:55 +08:00
</div>
</section>
<section class="sidebar-summary">
<div class="sidebar-section__eyebrow">命中模型摘要</div>
<div class="sidebar-summary__count">
<span class="sidebar-summary__count-label">命中模型数</span>
<span class="sidebar-summary__count-value">{{ sidebarData.modelSummary.modelCount || "-" }}</span>
</div>
<div class="sidebar-summary__tags">
<span class="sidebar-profile__label">核心异常标签</span>
<div v-if="sidebarData.modelSummary.riskTags.length" class="sidebar-tag-list">
<el-tag
v-for="(tag, index) in sidebarData.modelSummary.riskTags"
:key="`${formatRiskTag(tag)}-${index}`"
size="mini"
effect="plain"
>
{{ formatRiskTag(tag) }}
</el-tag>
</div>
<span v-else class="sidebar-profile__value">暂无异常标签</span>
</div>
</section>
</aside>
</template>
<script>
export default {
name: "ProjectAnalysisSidebar",
props: {
sidebarData: {
type: Object,
default: () => ({
basicInfo: {},
modelSummary: {
riskTags: [],
},
}),
},
},
methods: {
formatRiskTag(tag) {
if (typeof tag === "string") {
return tag;
}
if (tag && typeof tag === "object") {
return tag.ruleName || tag.label || tag.name || "";
}
return "";
},
},
};
</script>
<style lang="scss" scoped>
.project-analysis-sidebar {
2026-03-25 18:32:53 +08:00
width: 100%;
align-self: flex-start;
2026-05-06 17:03:55 +08:00
border: 1px solid #dbe4ef;
border-radius: 6px;
background: #ffffff;
overflow: hidden;
}
2026-05-06 17:03:55 +08:00
.sidebar-profile,
.sidebar-summary {
padding: 22px 24px;
background: #ffffff;
}
.sidebar-profile {
border-bottom: 1px solid #edf1f5;
}
.sidebar-summary {
2026-05-06 17:03:55 +08:00
margin-top: 0;
background: #fbfcfe;
}
2026-05-06 17:03:55 +08:00
.sidebar-section__eyebrow {
font-size: 12px;
font-weight: 600;
2026-05-06 17:03:55 +08:00
letter-spacing: 0;
color: #64748b;
}
.sidebar-profile__name-row {
2026-03-25 19:28:54 +08:00
display: flex;
2026-05-06 17:03:55 +08:00
align-items: flex-start;
gap: 12px;
}
.sidebar-profile__name {
2026-05-06 17:03:55 +08:00
margin-top: 8px;
font-size: 24px;
font-weight: 600;
line-height: 1.2;
2026-05-06 17:03:55 +08:00
color: #0f172a;
}
.sidebar-risk-badge {
display: inline-flex;
align-items: center;
2026-05-06 17:03:55 +08:00
min-height: 26px;
padding: 0 10px;
border: 1px solid #edcaca;
2026-05-06 17:03:55 +08:00
border-radius: 6px;
background: #fbefef;
2026-05-06 17:03:55 +08:00
font-size: 12px;
font-weight: 600;
2026-05-06 17:03:55 +08:00
line-height: 24px;
color: #ad2f2f;
2026-03-25 18:47:27 +08:00
}
.sidebar-profile__meta {
display: grid;
2026-05-06 17:03:55 +08:00
gap: 14px;
margin-top: 20px;
2026-03-25 19:28:54 +08:00
}
.sidebar-profile__item {
display: grid;
2026-05-06 17:03:55 +08:00
gap: 6px;
}
.sidebar-profile__label,
.sidebar-summary__count-label {
2026-05-06 17:03:55 +08:00
font-size: 12px;
color: #64748b;
}
.sidebar-profile__value,
.sidebar-summary__count-value {
2026-05-06 17:03:55 +08:00
font-size: 13px;
line-height: 1.6;
color: #0f172a;
word-break: break-all;
}
.sidebar-summary__count {
2026-05-06 17:03:55 +08:00
display: grid;
gap: 6px;
margin-top: 16px;
}
.sidebar-summary__tags {
display: grid;
gap: 10px;
2026-05-06 17:03:55 +08:00
margin-top: 18px;
}
.sidebar-tag-list {
display: flex;
2026-03-25 19:28:54 +08:00
width: 100%;
flex-wrap: wrap;
gap: 8px;
}
.sidebar-tag-list ::v-deep(.el-tag) {
2026-05-06 17:03:55 +08:00
height: 26px;
padding: 0 9px;
border: 1px solid #bfd0e2;
2026-05-06 17:03:55 +08:00
border-radius: 6px;
background: #ffffff;
color: #245b8f;
2026-05-06 17:03:55 +08:00
font-size: 12px;
font-weight: 600;
2026-05-06 17:03:55 +08:00
line-height: 24px;
}
</style>