Преглед изворни кода

feat(types): 角色相关定义

qinlaiqiao пре 4 година
родитељ
комит
ba264fa77f
2 измењених фајлова са 19 додато и 5 уклоњено
  1. 18 5
      types/src/interface/process.ts
  2. 1 0
      types/src/interface/user.ts

+ 18 - 5
types/src/interface/process.ts

@@ -24,6 +24,19 @@ export enum ApprovalWay {
   PREACCOUNT = 'prevAccount', // 上一审批人设置
 }
 
+// 角色权限
+export enum Permission {
+  REPORT = 'report',
+  VIEW_ALL_PROJECTS = 'viewAllProjects',
+}
+
+// 角色
+export interface IRole {
+  ID: string;
+  name: string;
+  frontPermission: Permission[];
+}
+
 // 参与者模式
 export enum ParticipantMode {
   ACCOUNT = 'account', // 用户模式
@@ -144,10 +157,10 @@ export interface IApprovalTodoData {
   lastName?: string; // 上环节名称(暂定为上环节用户名称,之后可能为上环节名称)
   reportTime?: number; // 上报时间
   lastStatus?: SimpleProcessStatus; // 上一环节的状态
-  processMoveDesc?: string; // 环节流转描述
-  processMoveTime?: number; // 环节流转时间
   approveTime?: number; // 当前环节审批时间
   approvalStatus?: ApprovalStatus; // 审批流程的状态
+  moveFrom?: string; // 环节流转来自谁
+  moveTo?: string[]; // 环节流转给谁
   type: ApprovalType; // 审批待办类型
 }
 
@@ -162,9 +175,9 @@ export enum TodoStatus {
 
 export interface ITodo {
   ID: string; // 待办 ID
-  userID: string;
-  createdTime: number; // 创建时间
-  completedTime: number; // 完成时间
+  userID: string; // 用户 ID
+  createdTime: number; // 创建时间(相当于环节流转时间)
+  completedTime: number; // 完成时间(相当于审批办结时间)
   todoType: TodoType;
   data: any;
   status: TodoStatus;

+ 1 - 0
types/src/interface/user.ts

@@ -98,6 +98,7 @@ export interface IAPUser {
   created: string;
   createdID: string; // 创建人ID
   isCreated?: boolean; // 是否可创建,字段由后台定义
+  roleIDS?: string[]; // 角色ID列表
 }
 
 // 最近联系人