# Risk People Core Tag Fixed Palette Frontend Implementation Plan

> **For agentic workers:** REQUIRED: Use superpowers:subagent-driven-development (if subagents available) or superpowers:executing-plans to implement this plan. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** 将项目总览页“风险人员总览”中的“核心异常点”改为按当前 10 个固定模型编码绑定颜色展示。

**Architecture:** 仅修改 `RiskPeopleSection.vue` 的核心异常点标签渲染逻辑，不改风险模型区、项目详情页或后端接口。前端基于后端已有的 `riskPointTagList[].modelCode` 维护一份固定的 10 模型色板映射；未映射到颜色的模型回退为无色，避免错绑。

**Tech Stack:** Vue 2, Element UI, Node.js

---

### Task 1: 先锁定固定 10 模型色板测试

**Files:**
- Modify: `ruoyi-ui/tests/unit/preliminary-check-risk-people-hit-tags.test.js`

- [ ] **Step 1: Write the failing test**

补充静态断言，锁定以下预期：

- `RiskPeopleSection.vue` 内存在固定模型颜色映射常量
- 色板至少覆盖当前 10 个固定模型编码
- 核心异常点标签按 `modelCode` 读取固定颜色，不再依赖 `selectedModelCodes`

- [ ] **Step 2: Run test to verify it fails**

Run:

```bash
cd ruoyi-ui
node tests/unit/preliminary-check-risk-people-hit-tags.test.js
```

Expected:

- `FAIL`
- 原因是当前实现仍依赖 `selectedModelCodes` 做颜色判断

- [ ] **Step 3: Commit the failing test**

```bash
git add ruoyi-ui/tests/unit/preliminary-check-risk-people-hit-tags.test.js
git commit -m "锁定风险人员核心异常点固定色板测试"
```

### Task 2: 实现风险人员总览固定模型色板

**Files:**
- Modify: `ruoyi-ui/src/views/ccdiProject/components/detail/RiskPeopleSection.vue`
- Modify: `ruoyi-ui/src/views/ccdiProject/components/detail/preliminaryCheck.mock.js`

- [ ] **Step 1: Add fixed palette mapping**

在 `RiskPeopleSection.vue` 中新增固定 `modelCode -> color` 映射，覆盖以下 10 个模型编码：

- `LARGE_TRANSACTION`
- `ABNORMAL_TRANSACTION`
- `SUSPICIOUS_GAMBLING`
- `SUSPICIOUS_RELATION`
- `SUSPICIOUS_PART_TIME`
- `SUSPICIOUS_PROPERTY`
- `SUSPICIOUS_FOREIGN_EXCHANGE`
- `SUSPICIOUS_INTEREST_PAYMENT`
- `SUSPICIOUS_PURCHASE`
- `ABNORMAL_BEHAVIOR`

- [ ] **Step 2: Render tags by fixed palette**

核心异常点标签改为根据 `tag.modelCode` 直接命中固定色板，移除对 `selectedModelCodes` 的依赖。优先使用 Element 内置 `type`，必要时用样式类补足 10 色。

- [ ] **Step 3: Align mock data**

更新 `preliminaryCheck.mock.js` 中的示例 `modelCode`，与真实固定模型编码保持一致，避免 mock 和生产映射脱节。

- [ ] **Step 4: Run focused frontend tests**

Run:

```bash
cd ruoyi-ui
node tests/unit/preliminary-check-risk-people-hit-tags.test.js
node tests/unit/preliminary-check-risk-people-binding.test.js
node tests/unit/preliminary-check-summary-and-people.test.js
```

Expected:

- `PASS`

- [ ] **Step 5: Commit**

```bash
git add ruoyi-ui/src/views/ccdiProject/components/detail/RiskPeopleSection.vue ruoyi-ui/src/views/ccdiProject/components/detail/preliminaryCheck.mock.js
git commit -m "调整风险人员核心异常点固定模型色板"
```

### Task 3: 做结果总览相关前端回归并补文档

**Files:**
- Create: `docs/reports/implementation/2026-03-23-risk-people-core-tag-fixed-palette-implementation.md`
- Verify: `ruoyi-ui/tests/unit/project-overview-api.test.js`
- Verify: `ruoyi-ui/tests/unit/preliminary-check-api-integration.test.js`

- [ ] **Step 1: Run final regression checks**

Run:

```bash
cd ruoyi-ui
node tests/unit/project-overview-api.test.js
node tests/unit/preliminary-check-api-integration.test.js
node tests/unit/preliminary-check-states.test.js
node tests/unit/preliminary-check-summary-and-people.test.js
node tests/unit/preliminary-check-risk-people-binding.test.js
node tests/unit/preliminary-check-risk-people-hit-tags.test.js
```

Expected:

- `PASS`
- 证明结果总览入口和风险人员总览展示边界仍稳定

- [ ] **Step 2: Write implementation record**

记录：

- 仅改风险人员总览核心异常点
- 10 模型固定色板写死在前端
- 风险模型区和详情页不在本次范围

- [ ] **Step 3: Commit**

```bash
git add docs/reports/implementation/2026-03-23-risk-people-core-tag-fixed-palette-implementation.md
git commit -m "补充风险人员核心异常点固定色板实施记录"
```
