Files
ccdi/docs/plans/frontend/2026-04-17-base-staff-party-member-frontend-implementation.md
2026-04-17 11:04:52 +08:00

54 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 员工基础信息新增是否党员字段前端实施计划
> **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:** 在员工信息维护页面新增“是否党员”基础字段,并打通列表展示、详情回显、编辑录入与导入失败记录展示。
**Architecture:** 保持 `ruoyi-ui/src/views/ccdiBaseStaff/index.vue` 的现有页面结构不变,仅在已有“基本信息”区域与员工列表中插入一个新字段。字段值与后端保持一致,前端统一使用 `0/1` 数值口径,并通过页面内格式化方法展示为“是/否”。
**Tech Stack:** Vue 2, Element UI, JavaScript, npm, nvm, Markdown
---
## 文件结构与职责
**前端源码**
- `ruoyi-ui/src/views/ccdiBaseStaff/index.vue`
新增列表列、编辑表单、详情弹窗、失败记录弹窗和格式化方法。
**依赖接口**
- `ruoyi-ui/src/api/ccdiBaseStaff.js`
本次接口路径不变,继续复用现有新增/编辑/详情 API只承接新增字段。
## 实施步骤
- [ ] 在员工列表中增加“是否党员”列,统一显示“是/否”。
- [ ] 在新增/编辑弹窗的基本信息区域增加“是否党员”单选项,默认值设为“否”。
- [ ] 在详情弹窗中增加“是否党员”展示,保证历史员工查看时能回显。
- [ ] 在导入失败记录弹窗中增加“是否党员”列,便于排查模板数据问题。
- [ ] 在页面 methods 中新增 `formatPartyMember`,统一处理 `0/1/null` 的展示。
- [ ] 使用 `nvm` 选择当前机器可用的 Node 版本后执行前端构建验证。
## 验证记录
- 已尝试执行:
```bash
source ~/.nvm/nvm.sh && nvm use
source ~/.nvm/nvm.sh && nvm use 14.21.3 && npm run build:prod
```
- 当前结果:
- 仓库内未提供 `.nvmrc`,直接执行 `nvm use` 无法自动切到项目版本。
- 当前机器存在 `v14.21.3``v25.9.0``system(v24.14.0)`,后续前端验证建议优先使用 `v14.21.3`
- 已使用 `v14.21.3` 成功执行 `npm run build:prod`,构建通过,仅保留项目原有的包体积告警。
## 完成标准
- 员工列表、详情、编辑弹窗可见“是否党员”
- 提交新增/编辑时会带上 `partyMember`
- 导入失败记录能展示该字段
- 已明确前端构建使用 `nvm` 的版本前提与当前环境限制