Explorar o código

feat(types): share

vian %!s(int64=5) %!d(string=hai) anos
pai
achega
1aa40d18a1

+ 6 - 0
types/src/interface/User.ts

@@ -16,6 +16,10 @@ export enum UserType {
   PROFESSIONAL = 'professional',
 }
 
+export interface IContact {
+  userID: string;
+}
+
 export interface IUserResult {
   _id?: string;
   ssoId?: number;
@@ -34,6 +38,7 @@ export interface IUserResult {
   latest_login?: number;
   // 最近使用编办
   latest_used?: string;
+  contacts?: IContact[];
   [key: string]: any;
 }
 
@@ -52,5 +57,6 @@ export interface IUser {
   isSmsLogin?: number;
   latestLogin?: number;
   latestUsed?: string;
+  contacts?: IContact[];
   [key: string]: any;
 }

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

@@ -8,3 +8,4 @@ export * from './increaseFee';
 export * from './labourCoe';
 export * from './unitPrice';
 export * from './feeRate';
+export * from './share';

+ 5 - 0
types/src/interface/project.ts

@@ -232,3 +232,8 @@ export interface IProject extends ITreeScm {
   deleteDate?: number;
   deleteBy?: string;
 }
+
+export interface IProjectBulkRst {
+  create: IProject[];
+  remove: string[];
+}

+ 55 - 6
types/src/interface/share.ts

@@ -1,8 +1,57 @@
-enum ShareType {
-  PROJECT = 1,
-  RATION_LIB, // 补充定额库
-  GLJ_LIB, // 单项工程
-  BLOCK_LIB, // 单位工程
+export enum ShareType {
+  PROJECT = 1, // 项目
+  RATION_LIB, // 定额库
+  GLJ_LIB, // 工料机库
+  PRICE_TEMPLATE, // 租价模板
 }
 
-export default ShareType;
+export interface IShareProject {
+  shareDate?: number;
+  updateDate?: number;
+  projectID: string; // 项目ID
+  isRead?: boolean;
+  allowCopy: boolean;
+  allowCooperate: boolean;
+}
+
+export interface IShareLib {
+  shareDate?: number;
+  updateDate?: number;
+  compilationID: string;
+  allowCopy: boolean;
+  allowCooperate: boolean;
+}
+
+export interface IShare {
+  ID: string;
+  owner: string;
+  receiver: string;
+  recentDate: number;
+  projectList: IShareProject[];
+  rationLibList: IShareLib[];
+  gljLibList: IShareLib[];
+  priceTemplateList: IShareLib[];
+}
+
+export type ShareItem = IShareProject | IShareLib;
+
+export interface ICreatShare {
+  doc: ShareItem;
+  type: ShareType;
+}
+
+export interface IUpdateShare {
+  filter: { projectID?: string; compilationID?: string };
+  update: {
+    updateDate?: number;
+    isRead?: boolean;
+    allowCopy?: boolean;
+    allowCooperate?: boolean;
+  };
+  type: ShareType;
+}
+
+export interface IDelShare {
+  filter: { projectID?: string; compilationID?: string };
+  type: ShareType;
+}