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
@@ -692,6 +692,25 @@ export default {
emailPlaceholder: 'invitee{\'@\'}example.com',
roleLabel: '角色'
},
import: {
button: '批次匯入',
dialogTitle: '批次匯入成員',
resultTitle: '匯入結果',
description: '依 Excel 範本批次加入成員:先下載範本填寫工號、電子信箱、姓名與角色,再上傳匯入。尚未註冊的員工會自動建立帳號並加入目前空間,首次登入後自動關聯。',
downloadTemplate: '下載範本',
pickFile: '點擊選擇 Excel 檔案',
fileHint: '支援 .xlsx / .xls,表頭:工號、電子信箱、姓名、角色',
repick: '點擊可重新選擇檔案',
submit: '開始匯入',
invalidFileType: '請選擇 .xlsx 或 .xls 格式的 Excel 檔案',
summaryAdded: '成功加入',
summaryCreated: '新建帳號',
summaryExists: '已是成員',
summaryFailed: '失敗',
failedListTitle: '失敗明細',
rowLabel: '第 {row} 列',
reimport: '重新匯入'
},
role: {
owner: '所有者',
admin: '管理員',