fix(权限完善):1.权限优化以下模块按钮查看权限全部归属超级管理员,只有职称角色未超级管理员用户才可以查看进入操作
deploy-hxtesting / build-and-deploy (push) Successful in 1m17s
deploy-hxtesting / build-and-deploy (push) Successful in 1m17s
1)如图一所示点击左下角个人信息弹出框中的“空间设置”、“成员管理“、”模型管理“、”全部设置“、”系统管理“ 2)点击进入”设置“页面中”空间“、”模型“、”发布集成“、”数据与扩展“、”系统管理“这几个大模块相关内容入口 2.成员管理页面增加一个字段”状态“:1-5 在职状态(试用/试用延期/正式/临时/实习)、6离职/7退休(顺便对数据进行清洗,工号首位带字母的都标记为离职其他都标记为正式) 3.检查各业务需求里所有选择员工相关都只能拉取选择正式员工!
This commit is contained in:
1 parent
b762deaf15
commit
7034d93256
49 files changed
+809
-130
No files matched your search
@@ -6,6 +6,31 @@ export type TenantRole = 'owner' | 'admin' | 'contributor' | 'viewer'
|
||||
|
||||
export type TenantMemberStatus = 'active' | 'invited' | 'suspended'
|
||||
|
||||
/**
|
||||
* 在职状态(users.employment_status,000167):1-5 在职、6 离职、7 退休。
|
||||
* 存量/新开户按工号规则落库(首位字母→离职,否则→正式),成员管理页可改;
|
||||
* 业务选人接口按 =3 正式过滤。
|
||||
*/
|
||||
export type EmploymentStatus = 1 | 2 | 3 | 4 | 5 | 6 | 7
|
||||
|
||||
export const EMPLOYMENT_STATUS_OPTIONS: { value: EmploymentStatus; labelKey: string }[] = [
|
||||
{ value: 1, labelKey: 'tenantMember.employmentStatus.probation' },
|
||||
{ value: 2, labelKey: 'tenantMember.employmentStatus.probationExtended' },
|
||||
{ value: 3, labelKey: 'tenantMember.employmentStatus.formal' },
|
||||
{ value: 4, labelKey: 'tenantMember.employmentStatus.temporary' },
|
||||
{ value: 5, labelKey: 'tenantMember.employmentStatus.intern' },
|
||||
{ value: 6, labelKey: 'tenantMember.employmentStatus.resigned' },
|
||||
{ value: 7, labelKey: 'tenantMember.employmentStatus.retired' },
|
||||
]
|
||||
|
||||
/** 在职状态展示主题:在职类正向/中性,离职/退休置灰 */
|
||||
export function employmentStatusTagTheme(status: number): 'success' | 'warning' | 'primary' | 'default' {
|
||||
if (status === 3) return 'success'
|
||||
if (status === 1 || status === 2 || status === 4 || status === 5) return 'warning'
|
||||
if (status === 6 || status === 7) return 'default'
|
||||
return 'primary'
|
||||
}
|
||||
|
||||
// TenantMember is the API projection of a (user, tenant) membership row,
|
||||
// already joined with the user's email/username/avatar by the backend.
|
||||
export interface TenantMember {
|
||||
@@ -16,6 +41,8 @@ export interface TenantMember {
|
||||
display_name?: string
|
||||
/** 所属部门:Casdoor 同步回写 users.dept_name(000156 同步态字段),未同步为空 */
|
||||
dept_name?: string
|
||||
/** 在职状态(000167):1试用/2试用延期/3正式/4临时/5实习/6离职/7退休 */
|
||||
employment_status: number
|
||||
avatar?: string
|
||||
role: TenantRole
|
||||
status: TenantMemberStatus
|
||||
@@ -39,6 +66,8 @@ export interface ListMembersParams {
|
||||
page_size?: number
|
||||
/** 按邮箱/用户名筛选(服务端模糊匹配) */
|
||||
q?: string
|
||||
/** 在职状态过滤(000167):1-7,缺省不过滤 */
|
||||
employment_status?: number
|
||||
}
|
||||
|
||||
function buildMembersQuery(params: ListMembersParams | undefined): string {
|
||||
@@ -48,6 +77,9 @@ function buildMembersQuery(params: ListMembersParams | undefined): string {
|
||||
if (params.page_size != null && params.page_size > 0) u.set('page_size', String(params.page_size))
|
||||
const q = params.q?.trim()
|
||||
if (q) u.set('q', q)
|
||||
if (params.employment_status != null && params.employment_status > 0) {
|
||||
u.set('employment_status', String(params.employment_status))
|
||||
}
|
||||
const qs = u.toString()
|
||||
return qs ? `?${qs}` : ''
|
||||
}
|
||||
@@ -198,6 +230,22 @@ export async function updateMemberRole(
|
||||
return (await put(`/api/v1/tenants/${tenantId}/members/${userId}`, { role })) as unknown as SimpleResponse
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成员在职状态(000167):1试用/2试用延期/3正式/4临时/5实习/6离职/7退休。
|
||||
* 状态为 users 表的人员属性,跨空间一致。
|
||||
* Backend: PUT /api/v1/tenants/:id/members/:user_id/employment-status (Owner+)。
|
||||
*/
|
||||
export async function updateMemberEmploymentStatus(
|
||||
tenantId: number,
|
||||
userId: string,
|
||||
employmentStatus: EmploymentStatus | number,
|
||||
): Promise<SimpleResponse> {
|
||||
return (await put(
|
||||
`/api/v1/tenants/${tenantId}/members/${userId}/employment-status`,
|
||||
{ employment_status: employmentStatus },
|
||||
)) as unknown as SimpleResponse
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a member from the tenant.
|
||||
* Backend: DELETE /api/v1/tenants/:id/members/:user_id (Owner+).
|
||||
|
||||
Reference in new issue
Block a user