1) 成员不再一人一行
原先用 antd Table:成员一多就要滚很久,右侧还大片留白。
改为标签云(flex-wrap),一行能放好几个。
交互一并简化:
· 点标签正文 → 切换组长(悬停有提示)
· 点 × → 移出分组
· 无权限时两者都不出现,退化成纯展示
组长用金色标签 + 皇冠图标,一眼可辨。
2) 添加成员支持多选
Select 加 mode="multiple" + maxTagCount="responsive",可搜可多选、批量提交。
后端 POST /groups/{id}/members 由单个 user_id 改为 user_ids 数组,
返回 {added, skipped, skipped_names}:
· 已在组内的**静默跳过**而非整批 409 —— 多选时难免选中已在组里的人,
为此让整批失败体验很差;前端会把跳过的名单说清楚,
否则用户会疑惑「明明选了 5 个,怎么只多了 3 个」
· 批量里混入超管则**整批拒绝并指名道姓**,不制造「部分成功」这种
难以解释的中间状态
实测(后端):
批量加 3 人 → added 3
重复提交(2 旧 1 新) → added 1 / skipped 2,整批仍成功
混入超管 → 400「以下账号是超级管理员,业务分组对其不生效:sunxia」
空列表 → 422
测试成员已清理
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the Oxlint configuration
If you are developing a production application, we recommend enabling type-aware lint rules by installing oxlint-tsgolint and editing .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "oxc"],
"options": {
"typeAware": true
},
"rules": {
"react/rules-of-hooks": "error",
"react/only-export-components": ["warn", { "allowConstantExport": true }]
}
}
See the Oxlint rules documentation for the full list of rules and categories.