feat(sponsor/people): 主账号同步建 biz_person (admin/总负责人), 列表可见 + 操作列对本人隐藏 + 新建下拉不包含 admin

后端:
- BizAuthController.registerSponsor step 6: 为主账号同步建 biz_person
  (走 BizPersonMapper 直插, 绕过 BizPersonServiceImpl 创 SUB 子账号的逻辑;
   SnowflakeId 注入 personId; department=管理部, position=总负责人, role=admin,
   unit_type=sponsor, user_id=主账号自己)
- BizPersonMapper.java + xml 新增 countAdminByOrgId: 校验某 org 下是否已有 admin
  (注册场景下天然返回 0, 是给未来 bug 兜底, registerSponsor 暂不调用)
- BizPersonMapper.xml selectSponsorList: WHERE 加 OR u.user_id=#{sponsorOwnerUid},
  让主账号自己的 biz_person (parent_user_id=NULL) 也能被自身 list 看到

前端:
- utils/roleMap.js: PERSON_ROLE_LABEL 加 admin:'管理员'
- sponsor/SponsorPeople.vue: 角色列改用 translatePersonRole, tag type 按 role 动态
  (admin=warning, supervisor=primary); 操作列本人隐藏 禁用/恢复 + 删除
  (v-if=row.userId !== store.user?.userId, 防主账号把自己禁用/误删)
- sponsor/NewPerson.vue: 编辑模式 role=admin 显示静态 el-tag, 新建下拉仍只含 supervisor
- sponsor/PersonDetail.vue: 角色展示同步用 translatePersonRole
- auth/Login.vue + portal/Home.vue: 文案 监察员 → 管理员 (注册即管理员, 可建监察员子账号)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
郭庆泰
2026-08-18 20:46:42 +08:00
co-authored by Claude
parent 50c2678ec6
commit 76dd4d7306
9 changed files with 71 additions and 16 deletions
+2 -1
View File
@@ -9,7 +9,8 @@
*/
export const PERSON_ROLE_LABEL = {
meetingExecutor: '会议执行',
supervisor: '监察员'
supervisor: '监察员',
admin: '管理员'
}
/**