feat(settings): 成员管理新增 Excel 模板批量导入成员

- 新增 POST /tenants/:id/members/import(仅 Owner,5MB/2000 行上限):
  excelize 解析花名册,表头探测容错,逐行校验并回传逐行结果
- 按邮箱 → 工号(users.username)匹配已有账号;未注册员工自动创建本地
  账号(随机密码、tenantless、OIDC-only 标记,首次 Casdoor 登录自动
  收编)并直接加入空间;邮箱缺失时按 OIDC 兜底域合成占位邮箱
- 角色列支持 owner/admin/contributor/viewer 与中英文标签,空默认访客;
  文件内按工号/邮箱去重,已是成员的行单独计数不视为失败
- 前端成员管理新增「批量导入」入口:SheetJS 前端生成模板(含示例行)、
  上传导入、结果汇总与失败明细展示,成功后自动刷新成员列表
- 六语言文案同步(tenantMember.import.*)
This commit is contained in:
runny committed 2026-11-19 22:32:55 +08:00
1 parent 4e25fce9aa
commit 4b899a4647
13 files changed
+1032 -5

No files matched your search

+19
View File
@@ -8535,6 +8535,25 @@ export default {
emailPlaceholder: 'invitee{\'@\'}example.com',
roleLabel: 'Role'
},
import: {
button: 'Bulk Import',
dialogTitle: 'Bulk Import Members',
resultTitle: 'Import Result',
description: 'Add members in bulk from an Excel roster: download the template, fill in employee ID, email, name and role, then upload it back. Members without an existing account are provisioned automatically and join this workspace right away.',
downloadTemplate: 'Download Template',
pickFile: 'Click to choose an Excel file',
fileHint: 'Supports .xlsx / .xls; headers: employee ID, email, name, role',
repick: 'Click to choose a different file',
submit: 'Start Import',
invalidFileType: 'Please choose an .xlsx or .xls Excel file',
summaryAdded: 'Added',
summaryCreated: 'Accounts created',
summaryExists: 'Already members',
summaryFailed: 'Failed',
failedListTitle: 'Failed rows',
rowLabel: 'Row {row}',
reimport: 'Import again'
},
remove: {
button: 'Remove',
confirmBody: 'Are you sure you want to remove {name} from this workspace? They will lose access immediately.',