import { IOption } from './option'; import { ICompilation } from './compilation'; import { EntityType, IUser } from './user'; import { ISystemSetting, ProjectType } from '.'; // 分享类型 export enum ShareType { PROJECT = 'project', // 项目 RATION_LIB = 'rationLib', // 定额库 GLJ_LIB = 'gljLib', // 工料机库 PRICE_TEMPLATE = 'priceTemplate', // 租价模板 } // 分享版本 export enum ShareVersion { // 个人版 PERSON = 'person', // 企业版 ENTERPRISE = 'enterprise', // 成员协作 MEMBER_COOPERATION = 'memberCooperation', } // 分享权限 export interface ISharePermission { allowCopy: boolean; allowCooperate: boolean; } /* export interface IShare { ID: string; version: ShareVersion; ownerID: string; ownerType: EntityType; // 负责人ID managerID: string; receiverID: string; receiverEnterpriseID?: string; recentDate: number; projectList: IShareProject[]; rationLibList: IShareLib[]; gljLibList: IShareLib[]; priceTemplateList: IShareLib[]; } */ export interface IShareBase extends ISharePermission { ID: string; version: ShareVersion; type: ShareType; ownerID: string; ownerType: EntityType; userID: string; enterpriseID: string; receiverID: string; receiverEnterpriseID: string; shareDate: number; updateDate: number; } export interface IShareProject extends IShareBase { projectID: string; // 项目ID constructionID: string; // 项目所属建设项目ID,涉及到一些层级,有这个字段会更方便 compilationID: string; isRead?: boolean; } export interface IShareLib extends IShareBase { compilationID: string; } export type ShareItem = IShareProject | IShareLib; // 分享历史 export interface IShareHistory extends ISharePermission { ID: string; // 分享ID user: Partial; enterpriseID?: string; enterpriseName?: string; shareType: ShareType; projectID?: string; compilationID?: string; } export interface ICreateShareProject extends ISharePermission { ID: string; projectID: string; // 项目ID constructionID: string; // 项目所属建设项目ID,涉及到一些层级,有这个字段会更方便 compilationID: string; } export interface ICreateShareLib extends ISharePermission { ID: string; compilationID: string; } export interface ICreatShare { receiverID: string; receiverEnterpriseID: string; // 一个用户可能有多个企业,需要记住企业ID doc: ICreateShareProject | ICreateShareLib; type: ShareType; } export interface IUpdateShare { receiverID: string; receiverEnterpriseID: string; filter: { ID: string; projectID?: string; compilationID?: string }; update: { updateDate?: number; isRead?: boolean; allowCopy?: boolean; allowCooperate?: boolean; }; type: ShareType; } export interface IDelShare { receiverID: string; receiverEnterpriseID: string; filter: { ID: string; projectID?: string; compilationID?: string }; type: ShareType; } export interface IBulkShare { update?: IUpdateShare[]; create?: ICreatShare[]; remove?: IDelShare[]; } // 分享链接 export interface IShareLink { // 链接ID ID: string; // 是否需要密码 needPassword: boolean; // 密码 password?: string; // 分享的项目ID projectID: string; // 所属建设项目ID constructionID: string; // 项目所属费用定额ID compilationID: string; // 拥有者ID ownerID: string; ownerType: EntityType; // 创建链接的人ID creatorID: string; // 分享时间 shareDate: number; } // 最近分享 条目 export interface IRecentShareItem { userID: string; enterpriseID: string; recentDate: number; } // 最近分享 export interface IRecentShare { userID: string; enterpriseID: string; // 个人版 personVer: IRecentShareItem[]; // 企业版 enterpriseVer: IRecentShareItem[]; // 成员协作 memberCooperation: IRecentShareItem[]; } // 最近分享用户 export interface IRecentShareUser { userID: string; name: string; mobile: string; enterpriseID?: string; enterpriseName?: string; recentDate: number; } // 初始化分享弹窗时需要的数据 export interface IPreparePopup { // 个人版已分享 personHistory: IShareHistory[]; // 企业版已分享 enterpriseHistory: IShareHistory[]; // 成员协作已分享 memberCoHistory: IShareHistory[]; // 个人版最近分享 personRecentUsers: IRecentShareUser[]; // 企业版最近分享 enterpriseRecentUsers: IRecentShareUser[]; // 成员协作最近分享 memberCoRecentUsers: IRecentShareUser[]; // 分享链接 shareLink?: IShareLink; } // 检查分享链接时需要的信息 export interface IShareLinkInfo { // 链接ID ID: string; // 是否需要密码 needPassword: boolean; // 项目所属费用定额ID compilationID: string; // 分享的项目ID projectID: string; // 所属建设项目ID constructionID: string; // 分享的项目名称 projectName: string; // 分享链接的人名 creatorName: string; } // 进入分享链接项目前准备数据 export interface IPrepareShareLinkProject { // 分享链接项目的费用定额数据 compilation: ICompilation; // 选项信息 option: IOption; // 系统设置信息 systemSetting: ISystemSetting; // 报表设置信息(用户) customizeCfg: any; } // 接收到的项目数据 export interface IReceivedShareProject { // 项目ID ID: string; // 项目类型 type: ProjectType; // 建设项目名称 name: string; // 建设项目下分享的工程 children: IReceivedShareProject[]; // 来自用户名 fromUserName: string; // 分享时间 shareDate: number; // 分享项目来自的企业ID enterpriseID?: string; // 分享项目来自的企业名称 enterpriseName?: string; } // 接收到的库数据 export interface IReceivedShareLib { // 类型 type: ShareType; // 库名称 name: string; // 拼接成的库ID(非分享数据ID) ID: string; // 分享时间 shareDate: number; // 来自用户名 fromUserName: string; // 指定用户(名称) toUsers?: string[]; } // 根据手机号搜索出来用户信息 export interface IShareSearchUser { userID: string; userName: string; mobile: string; enterpriseID?: string; enterpriseName?: string; }