Pārlūkot izejas kodu

refactor(types): 重构projects相关结构,适应企业版

vian 5 gadi atpakaļ
vecāks
revīzija
b11e206e84

+ 14 - 2
types/src/interface/User.ts

@@ -4,13 +4,21 @@ export enum ELockInfo {
   BUY = 2, // 销售
 }
 
-export interface IupgradeInfo {
+export interface IUpgradeInfo {
   compilationID: string;
   isUpgrade: boolean;
   lock?: ELockInfo;
   [key: string]: any;
 }
 
+// 实体类型
+export enum EntityType {
+  // 个人
+  PERSON = 1,
+  // 企业
+  ENTERPRISE,
+}
+
 export enum UserType {
   NORMAL = 'normal',
   PROFESSIONAL = 'professional',
@@ -27,7 +35,7 @@ export interface IUserResult {
   email?: string;
   mobile?: string;
   qq?: string;
-  upgrade_list?: IupgradeInfo[]; // 升级购买信息
+  upgrade_list?: IUpgradeInfo[]; // 升级购买信息
   // eslint-disable-next-line camelcase
   real_name?: string;
   company?: string;
@@ -61,6 +69,10 @@ export interface IUser {
   [key: string]: any;
 }
 
+export interface IUserSession extends IUser {
+  enterpriseID: string; // 企业ID
+}
+
 // 最近联系人
 export interface IRecentUser extends IUser {
   recentDate: number;

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

@@ -33,7 +33,6 @@ export interface IFeeRate extends ITreeScm {
 export interface IFeeRateFile {
   ID: string;
   projectID: string;
-  userID: string;
   name: string;
   libID: string;
   libName: string;

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

@@ -1,9 +1,11 @@
+import { EntityType } from './User';
 import { ValuationType } from './compilation';
 import { IIncreaseSetting } from './increaseFee';
 import { ITreeScm, DeleteEnum, INumFileRef, IColumnMeta } from './base';
 import { ICalcOption, ITenderSetting } from './calculation';
 import { ISharePermission } from './share';
 
+// 项目类型
 export enum ProjectType {
   FOLDER = 1,
   CONSTRUCTION, // 建设项目
@@ -213,7 +215,9 @@ export enum ImportType {
 export interface IProject extends ITreeScm {
   type: ProjectType;
   compilationID: string;
-  userID: string;
+  ownerID: string;
+  ownerType: EntityType;
+  creator: string;
   name: string;
   code?: string;
   createDate: number;