share.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { IUser } from './user';
  2. export enum ShareType {
  3. PROJECT = 1, // 项目
  4. RATION_LIB, // 定额库
  5. GLJ_LIB, // 工料机库
  6. PRICE_TEMPLATE, // 租价模板
  7. }
  8. // 分享权限
  9. export interface ISharePermission {
  10. allowCopy: boolean;
  11. allowCooperate: boolean;
  12. }
  13. export interface IShareProject extends ISharePermission {
  14. shareDate?: number;
  15. updateDate?: number;
  16. projectID: string; // 项目ID
  17. compilationID: string;
  18. isRead?: boolean;
  19. }
  20. export interface IShareLib extends ISharePermission {
  21. shareDate?: number;
  22. updateDate?: number;
  23. compilationID: string;
  24. }
  25. export interface IShare {
  26. ID: string;
  27. owner: string;
  28. receiver: string;
  29. recentDate: number;
  30. projectList: IShareProject[];
  31. rationLibList: IShareLib[];
  32. gljLibList: IShareLib[];
  33. priceTemplateList: IShareLib[];
  34. }
  35. export type ShareItem = IShareProject | IShareLib;
  36. // 分享历史
  37. export interface IShareHistory extends ISharePermission {
  38. ID: string; // 分享ID
  39. user: IUser;
  40. shareType: ShareType;
  41. projectID?: string;
  42. compilationID?: string;
  43. }
  44. export interface ICreatShare {
  45. receiver: string;
  46. doc: ShareItem;
  47. type: ShareType;
  48. }
  49. export interface IUpdateShare {
  50. filter: { ID: string; projectID?: string; compilationID?: string };
  51. update: {
  52. updateDate?: number;
  53. isRead?: boolean;
  54. allowCopy?: boolean;
  55. allowCooperate?: boolean;
  56. };
  57. type: ShareType;
  58. }
  59. export interface IDelShare {
  60. filter: { ID: string; projectID?: string; compilationID?: string };
  61. type: ShareType;
  62. }
  63. export interface IBulkShare {
  64. update?: IUpdateShare[];
  65. create?: ICreatShare[];
  66. remove?: IDelShare[];
  67. }