@spacecorexdev/core 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/package.json +2 -36
  2. package/src/api/_base.ts +243 -0
  3. package/src/api/index.ts +17 -0
  4. package/src/api/project.ts +1345 -0
  5. package/src/api/user.ts +1174 -0
  6. package/src/contract.ts +50 -0
  7. package/src/hooks/index.ts +2 -0
  8. package/{dist/hooks/index.js → src/hooks/useLongPress.ts} +53 -49
  9. package/src/hooks/useOnlineStatus.ts +22 -0
  10. package/src/index.ts +14 -0
  11. package/src/types/id.ts +2 -0
  12. package/src/types/index.ts +5 -0
  13. package/src/types/project/base.ts +63 -0
  14. package/src/types/project/contract.ts +79 -0
  15. package/src/types/project/contractStatus.tsx +15 -0
  16. package/src/types/project/index.ts +5 -0
  17. package/src/types/project/member.ts +46 -0
  18. package/src/types/project/progress.ts +43 -0
  19. package/src/types/projectRole.ts +17 -0
  20. package/src/types/theme.ts +1 -0
  21. package/src/types/user/index.ts +1 -0
  22. package/src/types/user/role.ts +7 -0
  23. package/src/ui/CommentTimeline/index.tsx +330 -0
  24. package/src/ui/FileManager/FileContextMenu.tsx +628 -0
  25. package/src/ui/FileManager/FileGridView.tsx +529 -0
  26. package/src/ui/FileManager/FileTableView.tsx +405 -0
  27. package/src/ui/FileManager/FileToolbar.tsx +119 -0
  28. package/src/ui/FileManager/FileVersionHistoryModal.tsx +175 -0
  29. package/src/ui/FileManager/MoveCopyToProjectModal.tsx +119 -0
  30. package/src/ui/FileManager/ShareToWechatModal.tsx +419 -0
  31. package/src/ui/FileManager/hooks/useFileManagerActions.ts +2532 -0
  32. package/src/ui/FileManager/hooks/useFileManagerState.ts +419 -0
  33. package/src/ui/FileManager/index.tsx +580 -0
  34. package/src/ui/FileManager/projectFileManagerApi.ts +57 -0
  35. package/src/ui/FileManager/types.ts +184 -0
  36. package/src/ui/FileManager/utils/fileDeltaWorker.ts +193 -0
  37. package/src/ui/FileManager/utils/fileTree.ts +178 -0
  38. package/src/ui/FileManager/utils/fileUpload.ts +714 -0
  39. package/src/ui/FileManager/utils/fileUtils.ts +65 -0
  40. package/src/ui/InvoiceRecordsList/index.tsx +813 -0
  41. package/src/ui/MyFileSelectorModal.tsx +261 -0
  42. package/src/ui/ProjectSelector/index.tsx +472 -0
  43. package/src/ui/ProjectSelector/projectCache.ts +40 -0
  44. package/src/ui/RoleSelector/index.tsx +473 -0
  45. package/src/ui/RoleSelector/roleCache.ts +40 -0
  46. package/src/ui/UIAlert.tsx +399 -0
  47. package/src/ui/UIAlertExample.tsx +129 -0
  48. package/src/ui/UIConfirm.tsx +335 -0
  49. package/src/ui/UIConfirmExample.tsx +165 -0
  50. package/src/ui/UIDatePicker.tsx +146 -0
  51. package/src/ui/UIDateRangePicker.tsx +38 -0
  52. package/src/ui/UIFilePreview/ExcelEditor/index.tsx +617 -0
  53. package/src/ui/UIFilePreview/ExcelEditor/types.ts +24 -0
  54. package/src/ui/UIFilePreview/ExportDropdown.css +85 -0
  55. package/src/ui/UIFilePreview/ExportDropdown.tsx +109 -0
  56. package/src/ui/UIFilePreview/IndexedDBUtils.ts +564 -0
  57. package/src/ui/UIFilePreview/MarkdownEditor/exportMarkdownPdf.ts +576 -0
  58. package/src/ui/UIFilePreview/MarkdownEditor/index.tsx +677 -0
  59. package/src/ui/UIFilePreview/MarkdownEditor/markdownEditor.css +1005 -0
  60. package/src/ui/UIFilePreview/MarkdownEditor/types.ts +15 -0
  61. package/src/ui/UIFilePreview/PPTXEditor/index.tsx +602 -0
  62. package/src/ui/UIFilePreview/RichDocEditor/exportRDocMarkdown.ts +77 -0
  63. package/src/ui/UIFilePreview/RichDocEditor/exportRDocPdf.ts +374 -0
  64. package/src/ui/UIFilePreview/RichDocEditor/index.tsx +730 -0
  65. package/src/ui/UIFilePreview/RichDocEditor/richdoc-editor.css +59 -0
  66. package/src/ui/UIFilePreview/UIFilePreview.tsx +611 -0
  67. package/src/ui/UIFilePreview/WordEditor/index.tsx +3933 -0
  68. package/src/ui/UIFilePreview/WordEditor/style.ts +1213 -0
  69. package/src/ui/UIFilePreview/WordEditor/word-editor.css +999 -0
  70. package/src/ui/UIFilePreview/filePreview.css +193 -0
  71. package/src/ui/UIFilePreview/filetypes/archive.tsx +66 -0
  72. package/src/ui/UIFilePreview/filetypes/cad.tsx +287 -0
  73. package/src/ui/UIFilePreview/filetypes/excel.tsx +355 -0
  74. package/src/ui/UIFilePreview/filetypes/image.tsx +20 -0
  75. package/src/ui/UIFilePreview/filetypes/imageLoader.ts +63 -0
  76. package/src/ui/UIFilePreview/filetypes/pdf.tsx +156 -0
  77. package/src/ui/UIFilePreview/filetypes/ppt.tsx +535 -0
  78. package/src/ui/UIFilePreview/filetypes/pptExportPdf.ts +523 -0
  79. package/src/ui/UIFilePreview/filetypes/video.tsx +482 -0
  80. package/src/ui/UIFilePreview/filetypes/word.tsx +245 -0
  81. package/src/ui/UIFilePreview/filetypes/wordExportMarkdown.ts +86 -0
  82. package/src/ui/UIFilePreview/filetypes/wordExportPdf.tsx +427 -0
  83. package/src/ui/UIFilePreview/index.ts +35 -0
  84. package/src/ui/UIFilePreview/pdfPagination.ts +143 -0
  85. package/src/ui/UIFilePreview/previewUtils.tsx +531 -0
  86. package/src/ui/UIFileUpload.tsx +382 -0
  87. package/src/ui/UIImageUpload.tsx +195 -0
  88. package/src/ui/UILoading.tsx +255 -0
  89. package/src/ui/UILoadingExample.tsx +139 -0
  90. package/src/ui/UISelect.tsx +105 -0
  91. package/src/ui/UIToast.tsx +381 -0
  92. package/src/ui/UIToastExample.tsx +69 -0
  93. package/src/ui/UIToastSingle.tsx +279 -0
  94. package/src/ui/UIViewToggle.tsx +64 -0
  95. package/src/ui/UserSelector/index.tsx +583 -0
  96. package/src/ui/index.ts +84 -0
  97. package/src/ui/upload/image.ts +135 -0
  98. package/src/ui/upload/index.ts +73 -0
  99. package/src/ui/upload/submitFile.ts +106 -0
  100. package/src/ui/upload/submitForm.ts +124 -0
  101. package/src/ui/upload/upload.err.ts +15 -0
  102. package/src/ui/upload/upload.ts +250 -0
  103. package/src/utils/CacheDepartmentInfo.ts +372 -0
  104. package/src/utils/CacheFileContent.ts +315 -0
  105. package/src/utils/CachePermissionInfo.ts +235 -0
  106. package/src/utils/CacheRoleInfo.ts +303 -0
  107. package/src/utils/CacheUserInfo.ts +818 -0
  108. package/src/utils/CacheViewToggleInfo.ts +182 -0
  109. package/src/utils/MessageContentUtils.ts +268 -0
  110. package/src/utils/clipboard.ts +70 -0
  111. package/src/utils/companyEmail.ts +19 -0
  112. package/src/utils/forbidDebugger.ts +59 -0
  113. package/src/utils/formatters.ts +94 -0
  114. package/src/utils/htmlUtils.tsx +59 -0
  115. package/src/utils/index.ts +18 -0
  116. package/src/utils/keyboard.ts +114 -0
  117. package/src/utils/mammothApi.ts +16 -0
  118. package/src/utils/polyfills.ts +928 -0
  119. package/src/utils/regex.ts +14 -0
  120. package/src/utils/storage.ts +95 -0
  121. package/src/utils/workerBootstrap.ts +87 -0
  122. package/dist/api/index.js +0 -1553
  123. package/dist/contract.js +0 -5
  124. package/dist/index.js +0 -4492
  125. package/dist/types/index.js +0 -49
  126. package/dist/ui/index.css +0 -1876
  127. package/dist/ui/index.js +0 -22245
  128. package/dist/utils/index.js +0 -4296
  129. /package/{dist → src}/styles/ant-modal.css +0 -0
  130. /package/{dist → src}/styles/ant-spin.css +0 -0
  131. /package/{dist → src}/styles/ant-table.css +0 -0
  132. /package/{dist → src}/styles/index.css +0 -0
@@ -0,0 +1,1345 @@
1
+ 'use strict';
2
+ /**
3
+ * Copyright (c) 2025 SPACECORE Co.,Ltd. All Rights Reserved.
4
+ * Author: brian.li
5
+ * Desc:
6
+ */
7
+
8
+ import { HttpRequest, ResponseCode } from './_base';
9
+ import type { ProjectRole } from '../types/projectRole';
10
+ import type { ContractStatus } from '../types/project/contract';
11
+
12
+
13
+ /*
14
+ * Contract
15
+ */
16
+ export const contract = {
17
+ /*
18
+ * /api/project/contract/create
19
+ */
20
+ createContract: (
21
+ data: {
22
+ projectId: string,
23
+ name: string,
24
+ tag: string,
25
+ code: string,
26
+ partyA: string,
27
+ partyB: string,
28
+ amount: number,
29
+ startDate: Date,
30
+ endDate: Date,
31
+ descs: string
32
+ }
33
+ ): Promise<{
34
+ code: ResponseCode,
35
+ message?: string,
36
+ data?: string
37
+ }> => {
38
+ return HttpRequest.post('/api/project/contract/create', null, { projectId:data.projectId, name:data.name, tag:data.tag, code:data.code, partyA:data.partyA, partyB:data.partyB, amount:data.amount, startDate:data.startDate, endDate:data.endDate, descs:data.descs}).then((res:any) => {
39
+ return res as any;
40
+ });
41
+ },
42
+
43
+ /*
44
+ * /api/project/contract/delete
45
+ */
46
+ deleteContract: (
47
+ params:{
48
+ id: string
49
+ }
50
+ ): Promise<{
51
+ code: ResponseCode,
52
+ message?: string,
53
+ data?: boolean
54
+ }> => {
55
+ return HttpRequest.delete('/api/project/contract/delete', { id:params.id}, null).then((res:any) => {
56
+ return res as any;
57
+ });
58
+ },
59
+
60
+ /*
61
+ * /api/project/contract/update
62
+ */
63
+ updateContract: (
64
+ data: {
65
+ id: string,
66
+ name?: string,
67
+ code?: string,
68
+ tag?: string,
69
+ partyA?: string,
70
+ partyB?: string,
71
+ amount?: number,
72
+ startDate?: Date,
73
+ endDate?: Date,
74
+ descs?: string,
75
+ markdown?: string
76
+ }
77
+ ): Promise<{
78
+ code: ResponseCode,
79
+ message?: string
80
+ }> => {
81
+ return HttpRequest.post('/api/project/contract/update', null, { id:data.id, name:data.name, code:data.code, tag:data.tag, partyA:data.partyA, partyB:data.partyB, amount:data.amount, startDate:data.startDate, endDate:data.endDate, descs:data.descs, markdown:data.markdown}).then((res:any) => {
82
+ return res as any;
83
+ });
84
+ },
85
+
86
+ /*
87
+ * /api/project/contract/detail
88
+ */
89
+ getContractDetail: (
90
+ params:{
91
+ id: string
92
+ }
93
+ ): Promise<{
94
+ code: ResponseCode,
95
+ message?: string,
96
+ data?: {
97
+ id: string,
98
+ projectId: string,
99
+ name: string,
100
+ tag: string,
101
+ code: string,
102
+ partyA: string,
103
+ partyB: string,
104
+ status: ContractStatus,
105
+ amount: number,
106
+ startDate: Date,
107
+ endDate: Date,
108
+ descs: string,
109
+ markdown: string,
110
+ currentVersion: number,
111
+ createTime: Date,
112
+ updateTime: Date,
113
+ createBy: string,
114
+ updateBy: string,
115
+ approvalId: string,
116
+ fileResourcePaths: string
117
+ }|null
118
+ }> => {
119
+ return HttpRequest.get('/api/project/contract/detail', { id:params.id}, null).then((res:any) => {
120
+ return res as any;
121
+ });
122
+ },
123
+
124
+ /*
125
+ * /api/project/contract/list
126
+ */
127
+ getContractList: (
128
+ params:{
129
+ projectId: string,
130
+ pageNum?: number,
131
+ pageSize?: number
132
+ }
133
+ ): Promise<{
134
+ code: ResponseCode,
135
+ message?: string,
136
+ data?: {
137
+ total:number;
138
+ list:{
139
+ id: string,
140
+ projectId: string,
141
+ name: string,
142
+ tag: string,
143
+ code: string,
144
+ partyA: string,
145
+ partyB: string,
146
+ status: ContractStatus,
147
+ amount: number,
148
+ startDate: Date,
149
+ endDate: Date,
150
+ descs: string,
151
+ markdown: string,
152
+ currentVersion: number,
153
+ createTime: Date,
154
+ updateTime: Date,
155
+ createBy: string,
156
+ updateBy: string,
157
+ approvalId: string,
158
+ fileResourcePaths: string
159
+ }[];
160
+ }
161
+ }> => {
162
+ return HttpRequest.get('/api/project/contract/list', { projectId:params.projectId, pageNum:params.pageNum, pageSize:params.pageSize}, null).then((res:any) => {
163
+ return res as any;
164
+ });
165
+ },
166
+
167
+ /*
168
+ * 提交合同版本进行用印审批(提交后将变为PENDING状态).
169
+ * 提交合同版本进行用印审批(提交后将变为PENDING状态).
170
+ */
171
+ submitApproval: (
172
+ params:{
173
+ id: string,
174
+ sealType: string
175
+ }
176
+ ): Promise<{
177
+ code: ResponseCode,
178
+ message?: string,
179
+ data?: boolean
180
+ }> => {
181
+ return HttpRequest.post('/api/project/contract/submit', { id:params.id, sealType:params.sealType}, null).then((res:any) => {
182
+ return res as any;
183
+ });
184
+ },
185
+
186
+ /*
187
+ * 撤销合同版本审批.
188
+ * 撤销合同版本审批.
189
+ */
190
+ cancelApproval: (
191
+ params:{
192
+ id: string
193
+ }
194
+ ): Promise<{
195
+ code: ResponseCode,
196
+ message?: string,
197
+ data?: boolean
198
+ }> => {
199
+ return HttpRequest.post('/api/project/contract/cancelApproval', { id:params.id}, null).then((res:any) => {
200
+ return res as any;
201
+ });
202
+ },
203
+
204
+ /*
205
+ * /api/project/contract/version/upload
206
+ */
207
+ uploadVersion: (
208
+ data: {
209
+ contractId: string,
210
+ fileName: string,
211
+ fileType: string,
212
+ fileSize: number,
213
+ changeLog?: string
214
+ }
215
+ ): Promise<{
216
+ code: ResponseCode,
217
+ message?: string,
218
+ data?: {
219
+ newVersion:number;
220
+ }
221
+ }> => {
222
+ return HttpRequest.post('/api/project/contract/version/upload', null, { contractId:data.contractId, fileName:data.fileName, fileType:data.fileType, fileSize:data.fileSize, changeLog:data.changeLog}).then((res:any) => {
223
+ return res as any;
224
+ });
225
+ },
226
+
227
+ /*
228
+ * /api/project/contract/version/list
229
+ */
230
+ getVersionList: (
231
+ params:{
232
+ contractId: string
233
+ }
234
+ ): Promise<{
235
+ code: ResponseCode,
236
+ message?: string,
237
+ data?: {
238
+ id: string,
239
+ contractId: string,
240
+ versionNumber: number,
241
+ layerOpinion: string,
242
+ fileName: string,
243
+ fileResourcePath: string,
244
+ fileType: string,
245
+ fileSize: number,
246
+ changeLog: string,
247
+ createTime: Date,
248
+ createBy: string,
249
+ }[]
250
+ }> => {
251
+ return HttpRequest.get('/api/project/contract/version/list', { contractId:params.contractId}, null).then((res:any) => {
252
+ return res as any;
253
+ });
254
+ },
255
+
256
+ /*
257
+ * 删除合同版本(仅草稿状态合同允许删除).
258
+ * /api/project/contract/version/delete
259
+ */
260
+ deleteVersion: (
261
+ params:{
262
+ id: string
263
+ }
264
+ ): Promise<{
265
+ code: ResponseCode,
266
+ message?: string,
267
+ data?: boolean
268
+ }> => {
269
+ return HttpRequest.delete('/api/project/contract/version/delete', { id:params.id}, null).then((res:any) => {
270
+ return res as any;
271
+ });
272
+ },
273
+
274
+ /*
275
+ * /api/project/contract/version/detail
276
+ */
277
+ getVersionDetail: (
278
+ params:{
279
+ id: string
280
+ }
281
+ ): Promise<{
282
+ code: ResponseCode,
283
+ message?: string,
284
+ data?: {
285
+ id: string,
286
+ contractId: string,
287
+ versionNumber: number,
288
+ layerOpinion: string,
289
+ fileName: string,
290
+ fileResourcePath: string,
291
+ fileType: string,
292
+ fileSize: number,
293
+ changeLog: string,
294
+ createTime: Date,
295
+ createBy: string
296
+ }|null
297
+ }> => {
298
+ return HttpRequest.get('/api/project/contract/version/detail', { id:params.id}, null).then((res:any) => {
299
+ return res as any;
300
+ });
301
+ },
302
+
303
+ /*
304
+ * /api/project/contract/version/layerOpinion
305
+ */
306
+ setVersionLayerOpinion: (
307
+ data: {
308
+ contractId: string,
309
+ version: number,
310
+ opinion: string
311
+ }
312
+ ): Promise<{
313
+ code: ResponseCode,
314
+ message?: string,
315
+ data?: boolean
316
+ }> => {
317
+ return HttpRequest.post('/api/project/contract/version/layerOpinion', null, { contractId:data.contractId, version:data.version, opinion:data.opinion}).then((res:any) => {
318
+ return res as any;
319
+ });
320
+ },
321
+
322
+ /*
323
+ * 获取新的合同编号.
324
+ * 获取新的合同编号.
325
+ */
326
+ getNewContractCode: (
327
+ params:{
328
+ contractCode: string,
329
+ sequenceLength: number
330
+ }
331
+ ): Promise<{
332
+ code: ResponseCode,
333
+ message?: string,
334
+ data?: string
335
+ }> => {
336
+ return HttpRequest.get('/api/project/contract/newCode', { contractCode:params.contractCode, sequenceLength:params.sequenceLength}, null).then((res:any) => {
337
+ return res as any;
338
+ });
339
+ },
340
+
341
+ /*
342
+ * 获取合同历史参与方.
343
+ * 获取合同历史参与方.
344
+ */
345
+ getContractHistoryParties: (
346
+
347
+ ): Promise<{
348
+ code: ResponseCode,
349
+ message?: string,
350
+ data?: string[]
351
+ }> => {
352
+ return HttpRequest.get('/api/project/contract/historyParties', null, null).then((res:any) => {
353
+ return res as any;
354
+ });
355
+ },
356
+
357
+ }
358
+ /*
359
+ * File
360
+ */
361
+ export const file = {
362
+ /*
363
+ * /api/project/files/detail
364
+ */
365
+ getDetail: (
366
+ params:{
367
+ fileId: string
368
+ }
369
+ ): Promise<{
370
+ code: ResponseCode,
371
+ message?: string,
372
+ data?: {
373
+ id: string,
374
+ projectId: string,
375
+ isSecure: boolean,
376
+ fileName: string,
377
+ filePath: string,
378
+ fileType: string,
379
+ fileSize: number,
380
+ crc32: number,
381
+ fileResourcePath: string,
382
+ descs: string,
383
+ uploaderName: string,
384
+ uploadTime: Date,
385
+ createTime: Date,
386
+ updateTime: Date,
387
+ createBy: string,
388
+ updateBy: string,
389
+ isDeleted: boolean,
390
+ }
391
+ }> => {
392
+ return HttpRequest.get('/api/project/files/detail', { fileId:params.fileId}, null).then((res:any) => {
393
+ return res as any;
394
+ });
395
+ },
396
+
397
+ /*
398
+ * /api/project/files/list
399
+ */
400
+ listFiles: (
401
+ params:{
402
+ projectId: string
403
+ }
404
+ ): Promise<{
405
+ code: ResponseCode,
406
+ message?: string,
407
+ data?: {
408
+ id: string,
409
+ projectId: string,
410
+ isSecure: boolean,
411
+ fileName: string,
412
+ filePath: string,
413
+ fileType: string,
414
+ fileSize: number,
415
+ crc32: number,
416
+ fileResourcePath: string,
417
+ descs: string,
418
+ uploaderName: string,
419
+ uploadTime: Date,
420
+ createTime: Date,
421
+ updateTime: Date,
422
+ createBy: string,
423
+ updateBy: string,
424
+ isDeleted: boolean,
425
+ }[]
426
+ }> => {
427
+ return HttpRequest.get('/api/project/files/list', { projectId:params.projectId}, null).then((res:any) => {
428
+ return res as any;
429
+ });
430
+ },
431
+
432
+ /*
433
+ * 跨项目搜索当前用户有权限查看的项目文件.
434
+ * 跨项目搜索当前用户有权限查看的项目文件.
435
+ */
436
+ searchFiles: (
437
+ params:{
438
+ keyword: string,
439
+ pageNum?: number,
440
+ pageSize?: number
441
+ }
442
+ ): Promise<{
443
+ code: ResponseCode,
444
+ message?: string,
445
+ data?: {
446
+ total:number;
447
+ list:{
448
+ id: string,
449
+ projectId: string,
450
+ projectName: string,
451
+ category: string,
452
+ isSecure: boolean,
453
+ fileName: string,
454
+ filePath: string,
455
+ fileType: string,
456
+ fileSize: number,
457
+ descs: string,
458
+ uploaderName: string,
459
+ uploadTime: Date,
460
+ fileResourcePath: string,
461
+ contractName: string,
462
+ code: string,
463
+ partyA: string,
464
+ partyB: string,
465
+ status: string,
466
+ amount: number,
467
+ contractId: string,
468
+ versionNumber: number,
469
+ changeLog: string
470
+ }[];
471
+ }
472
+ }> => {
473
+ return HttpRequest.get('/api/project/files/search', { keyword:params.keyword, pageNum:params.pageNum, pageSize:params.pageSize}, null).then((res:any) => {
474
+ return res as any;
475
+ });
476
+ },
477
+
478
+ /*
479
+ * /api/project/files/add
480
+ */
481
+ addFile: (
482
+ params:{
483
+ projectId: string
484
+ } ,
485
+ data: {
486
+ fileName: string,
487
+ filePath: string,
488
+ isSecure?: boolean,
489
+ descs?: string,
490
+ fileType?: string,
491
+ fileSize?: number,
492
+ crc32?: number,
493
+ fileResourcePath: string
494
+ }
495
+ ): Promise<{
496
+ code: ResponseCode,
497
+ message?: string,
498
+ data?: {
499
+ fileId: string,
500
+ fileName: string,
501
+ }
502
+ }> => {
503
+ return HttpRequest.post('/api/project/files/add', { projectId:params.projectId}, { fileName:data.fileName, filePath:data.filePath, isSecure:data.isSecure, descs:data.descs, fileType:data.fileType, fileSize:data.fileSize, crc32:data.crc32, fileResourcePath:data.fileResourcePath}).then((res:any) => {
504
+ return res as any;
505
+ });
506
+ },
507
+
508
+ /*
509
+ * /api/project/files/remove
510
+ */
511
+ removeFile: (
512
+ params:{
513
+ fileId: string
514
+ }
515
+ ): Promise<{
516
+ code: ResponseCode,
517
+ message?: string,
518
+ data?: boolean
519
+ }> => {
520
+ return HttpRequest.post('/api/project/files/remove', { fileId:params.fileId}, null).then((res:any) => {
521
+ return res as any;
522
+ });
523
+ },
524
+
525
+ /*
526
+ * /api/project/files/move
527
+ */
528
+ moveFile: (
529
+ params:{
530
+ projectId: string
531
+ } ,
532
+ data: {
533
+ oldFileName: string,
534
+ oldFilePath: string,
535
+ newFileName: string,
536
+ newFilePath: string
537
+ }
538
+ ): Promise<{
539
+ code: ResponseCode,
540
+ message?: string,
541
+ data?: string
542
+ }> => {
543
+ return HttpRequest.post('/api/project/files/move', { projectId:params.projectId}, { oldFileName:data.oldFileName, oldFilePath:data.oldFilePath, newFileName:data.newFileName, newFilePath:data.newFilePath}).then((res:any) => {
544
+ return res as any;
545
+ });
546
+ },
547
+
548
+ /*
549
+ * /api/project/files/updateDescs
550
+ */
551
+ updateFileDescs: (
552
+ data: {
553
+ fileId: string,
554
+ descs?: string
555
+ }
556
+ ): Promise<{
557
+ code: ResponseCode,
558
+ message?: string,
559
+ data?: boolean
560
+ }> => {
561
+ return HttpRequest.post('/api/project/files/updateDescs', null, { fileId:data.fileId, descs:data.descs}).then((res:any) => {
562
+ return res as any;
563
+ });
564
+ },
565
+
566
+ /*
567
+ * /api/project/files/copyToProject
568
+ */
569
+ copyFileToProject: (
570
+ params:{
571
+ projectId: string,
572
+ fileId: string
573
+ }
574
+ ): Promise<{
575
+ code: ResponseCode,
576
+ message?: string,
577
+ data?: string
578
+ }> => {
579
+ return HttpRequest.post('/api/project/files/copyToProject', { projectId:params.projectId, fileId:params.fileId}, null).then((res:any) => {
580
+ return res as any;
581
+ });
582
+ },
583
+
584
+ /*
585
+ * /api/project/files/moveToProject
586
+ */
587
+ moveFileToProject: (
588
+ params:{
589
+ projectId: string,
590
+ fileId: string
591
+ }
592
+ ): Promise<{
593
+ code: ResponseCode,
594
+ message?: string,
595
+ data?: string
596
+ }> => {
597
+ return HttpRequest.post('/api/project/files/moveToProject', { projectId:params.projectId, fileId:params.fileId}, null).then((res:any) => {
598
+ return res as any;
599
+ });
600
+ },
601
+
602
+ /*
603
+ * 增量更新文件 通过上传差异数据(BSDiff补丁)来更新文件,减少上传数据量
604
+ * 增量更新文件 通过上传差异数据(BSDiff补丁)来更新文件,减少上传数据量
605
+ */
606
+ updateFileDelta: (
607
+ data: {
608
+ fileId: string,
609
+ deltaData: string,
610
+ deltaSize: number,
611
+ newFileSize: number,
612
+ crc32?: number,
613
+ recordVersion?: boolean,
614
+ rotateResourcePath?: boolean
615
+ }
616
+ ): Promise<{
617
+ code: ResponseCode,
618
+ message?: string,
619
+ data?: string
620
+ }> => {
621
+ return HttpRequest.post('/api/project/files/updateDelta', null, { fileId:data.fileId, deltaData:data.deltaData, deltaSize:data.deltaSize, newFileSize:data.newFileSize, crc32:data.crc32, recordVersion:data.recordVersion, rotateResourcePath:data.rotateResourcePath}).then((res:any) => {
622
+ return res as any;
623
+ });
624
+ },
625
+
626
+ /*
627
+ * 全量文件更新 通过上传完整文件数据来更新文件
628
+ * 全量文件更新 通过上传完整文件数据来更新文件
629
+ */
630
+ updateFile: (
631
+ data: {
632
+ fileId: string,
633
+ fileSize?: number,
634
+ crc32?: number,
635
+ fileName: string,
636
+ fileResourcePath: string,
637
+ recordVersion?: boolean,
638
+ rotateResourcePath?: boolean
639
+ }
640
+ ): Promise<{
641
+ code: ResponseCode,
642
+ message?: string,
643
+ data?: string
644
+ }> => {
645
+ return HttpRequest.post('/api/project/files/updateData', null, { fileId:data.fileId, fileSize:data.fileSize, crc32:data.crc32, fileName:data.fileName, fileResourcePath:data.fileResourcePath, recordVersion:data.recordVersion, rotateResourcePath:data.rotateResourcePath}).then((res:any) => {
646
+ return res as any;
647
+ });
648
+ },
649
+
650
+ /*
651
+ * 生成临时访问令牌 用于文件下载或上传
652
+ * 生成临时访问令牌 用于文件下载或上传
653
+ */
654
+ generateTempAccessToken: (
655
+ params:{
656
+ fileId: string,
657
+ expireSeconds: number
658
+ }
659
+ ): Promise<{
660
+ code: ResponseCode,
661
+ message?: string,
662
+ data?: string
663
+ }> => {
664
+ return HttpRequest.post('/api/project/files/generateTempAccessToken', { fileId:params.fileId, expireSeconds:params.expireSeconds}, null).then((res:any) => {
665
+ return res as any;
666
+ });
667
+ },
668
+
669
+ /*
670
+ * 发起文件夹异步打包下载(仅项目负责人/管理员)
671
+ */
672
+ folderDownload: (
673
+ params:{
674
+ projectId: string
675
+ },
676
+ data:{
677
+ folderPath: string,
678
+ folderName: string
679
+ }
680
+ ): Promise<{
681
+ code: ResponseCode,
682
+ message?: string,
683
+ data?: {
684
+ jobId: string
685
+ }
686
+ }> => {
687
+ return HttpRequest.post('/api/project/files/folderDownload', { projectId:params.projectId}, { folderPath:data.folderPath, folderName:data.folderName}).then((res:any) => {
688
+ return res as any;
689
+ });
690
+ },
691
+
692
+ /*
693
+ * 查询文件夹打包下载任务状态
694
+ */
695
+ folderDownloadStatus: (
696
+ params:{
697
+ jobId: string
698
+ }
699
+ ): Promise<{
700
+ code: ResponseCode,
701
+ message?: string,
702
+ data?: {
703
+ jobId: string,
704
+ status: 'pending' | 'success' | 'failed',
705
+ url?: string,
706
+ fileName?: string,
707
+ message?: string,
708
+ expireAt?: number
709
+ }
710
+ }> => {
711
+ return HttpRequest.get('/api/project/files/folderDownloadStatus', { jobId:params.jobId}, null).then((res:any) => {
712
+ return res as any;
713
+ });
714
+ },
715
+
716
+ /*
717
+ * /api/project/files/listByTempAccessToken
718
+ */
719
+ listFilesByTempAccessToken: (
720
+ params:{
721
+ tempToken: string
722
+ }
723
+ ): Promise<{
724
+ code: ResponseCode,
725
+ message?: string,
726
+ data?: {
727
+ id: string,
728
+ projectId: string,
729
+ isSecure: boolean,
730
+ fileName: string,
731
+ filePath: string,
732
+ fileType: string,
733
+ fileSize: number,
734
+ crc32: number,
735
+ fileResourcePath: string,
736
+ descs: string,
737
+ uploaderName: string,
738
+ uploadTime: Date,
739
+ createTime: Date,
740
+ updateTime: Date,
741
+ createBy: string,
742
+ updateBy: string,
743
+ isDeleted: boolean,
744
+ }[]
745
+ }> => {
746
+ return HttpRequest.get('/api/project/files/listByTempAccessToken', { tempToken:params.tempToken}, null).then((res:any) => {
747
+ return res as any;
748
+ });
749
+ },
750
+
751
+ }
752
+ /*
753
+ * FileVersion
754
+ */
755
+ export const fileversion = {
756
+ /*
757
+ * 获取文件版本列表
758
+ * 获取文件版本列表
759
+ */
760
+ listVersions: (
761
+ params:{
762
+ fileId: string
763
+ }
764
+ ): Promise<{
765
+ code: ResponseCode,
766
+ message?: string,
767
+ data?: {
768
+ id: string,
769
+ fileId: string,
770
+ fileSize: number,
771
+ crc32: number,
772
+ fileResourcePath: string,
773
+ uploadTime: Date,
774
+ uploaderName: string,
775
+ uploadBy: string,
776
+ }[]
777
+ }> => {
778
+ return HttpRequest.get('/api/project/files/version/list', { fileId:params.fileId}, null).then((res:any) => {
779
+ return res as any;
780
+ });
781
+ },
782
+
783
+ /*
784
+ * 获取版本详情
785
+ * 获取版本详情
786
+ */
787
+ getVersionDetail: (
788
+ params:{
789
+ versionId: string
790
+ }
791
+ ): Promise<{
792
+ code: ResponseCode,
793
+ message?: string,
794
+ data?: {
795
+ id: string,
796
+ fileId: string,
797
+ fileSize: number,
798
+ crc32: number,
799
+ fileResourcePath: string,
800
+ uploadTime: Date,
801
+ uploaderName: string,
802
+ uploadBy: string,
803
+ }
804
+ }> => {
805
+ return HttpRequest.get('/api/project/files/version/detail', { versionId:params.versionId}, null).then((res:any) => {
806
+ return res as any;
807
+ });
808
+ },
809
+
810
+ }
811
+ /*
812
+ * Project
813
+ */
814
+ export const project = {
815
+ /*
816
+ * /api/project/enablePrivateProject
817
+ */
818
+ enableUserPrivateProject: (
819
+
820
+ ): Promise<{
821
+ code: ResponseCode,
822
+ message?: string,
823
+ data?: string
824
+ }> => {
825
+ return HttpRequest.post('/api/project/enablePrivateProject', null, null).then((res:any) => {
826
+ return res as any;
827
+ });
828
+ },
829
+
830
+ /*
831
+ * /api/project/create
832
+ */
833
+ createProject: (
834
+ data: {
835
+ name: string,
836
+ descs: string,
837
+ companyId: string,
838
+ markdown: string,
839
+ startTime: Date,
840
+ plannedEndTime: Date,
841
+ endTime: Date,
842
+ leaderId: string,
843
+ customerId: string,
844
+ order: number,
845
+ isUserPrivate: boolean
846
+ }
847
+ ): Promise<{
848
+ code: ResponseCode,
849
+ message?: string,
850
+ data?: string
851
+ }> => {
852
+ return HttpRequest.post('/api/project/create', null, { name:data.name, descs:data.descs, companyId:data.companyId, markdown:data.markdown, startTime:data.startTime, plannedEndTime:data.plannedEndTime, endTime:data.endTime, leaderId:data.leaderId, customerId:data.customerId, order:data.order, isUserPrivate:data.isUserPrivate}).then((res:any) => {
853
+ return res as any;
854
+ });
855
+ },
856
+
857
+ /*
858
+ * /api/project/update
859
+ */
860
+ updateProject: (
861
+ data: {
862
+ id: string,
863
+ name?: string,
864
+ descs?: string,
865
+ companyId?: string,
866
+ markdown?: string,
867
+ status?: number,
868
+ startTime?: Date,
869
+ plannedEndTime?: Date,
870
+ endTime?: Date,
871
+ leaderId?: string,
872
+ customerId?: string,
873
+ order?: number,
874
+ isUserPrivate?: boolean,
875
+ createTime?: Date,
876
+ updateTime?: Date,
877
+ createBy?: string,
878
+ updateBy?: string
879
+ }
880
+ ): Promise<{
881
+ code: ResponseCode,
882
+ message?: string,
883
+ data?: boolean
884
+ }> => {
885
+ return HttpRequest.post('/api/project/update', null, { id:data.id, name:data.name, descs:data.descs, companyId:data.companyId, markdown:data.markdown, status:data.status, startTime:data.startTime, plannedEndTime:data.plannedEndTime, endTime:data.endTime, leaderId:data.leaderId, customerId:data.customerId, order:data.order, isUserPrivate:data.isUserPrivate, createTime:data.createTime, updateTime:data.updateTime, createBy:data.createBy, updateBy:data.updateBy}).then((res:any) => {
886
+ return res as any;
887
+ });
888
+ },
889
+
890
+ /*
891
+ * /api/project/updateUserdataOrder
892
+ */
893
+ updateUserdataOrder: (
894
+ data: {
895
+ projectIds: string[]
896
+ }
897
+ ): Promise<{
898
+ code: ResponseCode,
899
+ message?: string
900
+ }> => {
901
+ return HttpRequest.post('/api/project/updateUserdataOrder', null, { projectIds:data.projectIds}).then((res:any) => {
902
+ return res as any;
903
+ });
904
+ },
905
+
906
+ /*
907
+ * 获取用户的项目排序数据. [{pid,order}]
908
+ * 获取用户的项目排序数据. [{pid,order}]
909
+ */
910
+ getUserdataOrder: (
911
+
912
+ ): Promise<{
913
+ code: ResponseCode,
914
+ message?: string,
915
+ data?: {
916
+ projectIds: string[],
917
+ }
918
+ }> => {
919
+ return HttpRequest.get('/api/project/userdataOrder', null, null).then((res:any) => {
920
+ return res as any;
921
+ });
922
+ },
923
+
924
+ /*
925
+ * /api/project/detail
926
+ */
927
+ getProjectDetail: (
928
+ params:{
929
+ id: string
930
+ }
931
+ ): Promise<{
932
+ code: ResponseCode,
933
+ message?: string,
934
+ data?: {
935
+ id: string,
936
+ name: string,
937
+ descs: string,
938
+ companyId: string,
939
+ markdown: string,
940
+ status: number,
941
+ startTime: Date,
942
+ plannedEndTime: Date,
943
+ endTime: Date,
944
+ leaderId: string,
945
+ customerId: string,
946
+ order: number,
947
+ isUserPrivate: boolean,
948
+ createTime: Date,
949
+ updateTime: Date,
950
+ createBy: string,
951
+ updateBy: string
952
+ }|null
953
+ }> => {
954
+ return HttpRequest.get('/api/project/detail', { id:params.id}, null).then((res:any) => {
955
+ return res as any;
956
+ });
957
+ },
958
+
959
+ /*
960
+ * 获取项目名称.
961
+ * 获取项目名称.
962
+ */
963
+ getProjectName: (
964
+ params:{
965
+ projectId: string
966
+ }
967
+ ): Promise<{
968
+ code: ResponseCode,
969
+ message?: string,
970
+ data?: string|null
971
+ }> => {
972
+ return HttpRequest.get('/api/project/name', { projectId:params.projectId}, null).then((res:any) => {
973
+ return res as any;
974
+ });
975
+ },
976
+
977
+ /*
978
+ * 仅查看当前用户参与的项目
979
+ * 仅查看当前用户参与的项目
980
+ */
981
+ listProjects: (
982
+ params:{
983
+ pageNum?: number,
984
+ pageSize?: number,
985
+ status?: "progress" | "completed" | "temp",
986
+ companyId?: string,
987
+ customerId?: string
988
+ }
989
+ ): Promise<{
990
+ code: ResponseCode,
991
+ message?: string,
992
+ data?: {
993
+ total:number;
994
+ list:{
995
+ id: string,
996
+ name: string,
997
+ descs: string,
998
+ companyId: string,
999
+ markdown: string,
1000
+ status: number,
1001
+ startTime: Date,
1002
+ plannedEndTime: Date,
1003
+ endTime: Date,
1004
+ leaderId: string,
1005
+ customerId: string,
1006
+ order: number,
1007
+ isUserPrivate: boolean,
1008
+ createTime: Date,
1009
+ updateTime: Date,
1010
+ createBy: string,
1011
+ updateBy: string
1012
+ }[];
1013
+ }
1014
+ }> => {
1015
+ return HttpRequest.get('/api/project/list', { pageNum:params.pageNum, pageSize:params.pageSize, status:params.status, companyId:params.companyId, customerId:params.customerId}, null).then((res:any) => {
1016
+ return res as any;
1017
+ });
1018
+ },
1019
+
1020
+ /*
1021
+ * 仅查看当前用户为管理员及以上的项目
1022
+ * 仅查看当前用户为管理员及以上的项目
1023
+ */
1024
+ listProjectsByManager: (
1025
+ params:{
1026
+ pageNum?: number,
1027
+ pageSize?: number
1028
+ }
1029
+ ): Promise<{
1030
+ code: ResponseCode,
1031
+ message?: string,
1032
+ data?: {
1033
+ total:number;
1034
+ list:{
1035
+ id: string,
1036
+ name: string,
1037
+ descs: string,
1038
+ companyId: string,
1039
+ markdown: string,
1040
+ status: number,
1041
+ startTime: Date,
1042
+ plannedEndTime: Date,
1043
+ endTime: Date,
1044
+ leaderId: string,
1045
+ customerId: string,
1046
+ order: number,
1047
+ isUserPrivate: boolean,
1048
+ createTime: Date,
1049
+ updateTime: Date,
1050
+ createBy: string,
1051
+ updateBy: string
1052
+ }[];
1053
+ }
1054
+ }> => {
1055
+ return HttpRequest.get('/api/project/listByManager', { pageNum:params.pageNum, pageSize:params.pageSize}, null).then((res:any) => {
1056
+ return res as any;
1057
+ });
1058
+ },
1059
+
1060
+ /*
1061
+ * /api/project/status
1062
+ */
1063
+ changeStatus: (
1064
+ params:{
1065
+ id: string,
1066
+ status: number
1067
+ }
1068
+ ): Promise<{
1069
+ code: ResponseCode,
1070
+ message?: string,
1071
+ data?: boolean
1072
+ }> => {
1073
+ return HttpRequest.put('/api/project/status', { id:params.id, status:params.status}, null).then((res:any) => {
1074
+ return res as any;
1075
+ });
1076
+ },
1077
+
1078
+ /*
1079
+ * /api/project/members
1080
+ */
1081
+ getProjectMembers: (
1082
+ params:{
1083
+ projectId: string
1084
+ }
1085
+ ): Promise<{
1086
+ code: ResponseCode,
1087
+ message?: string,
1088
+ data?: {
1089
+ id: string,
1090
+ projectId: string,
1091
+ userId: string,
1092
+ role: ProjectRole,
1093
+ permission: number,
1094
+ createTime: Date,
1095
+ updateTime: Date,
1096
+ createBy: string,
1097
+ updateBy: string,
1098
+ nickname: string,
1099
+ username: string,
1100
+ phone: string,
1101
+ email: string,
1102
+ title: string,
1103
+ }[]
1104
+ }> => {
1105
+ return HttpRequest.get('/api/project/members', { projectId:params.projectId}, null).then((res:any) => {
1106
+ return res as any;
1107
+ });
1108
+ },
1109
+
1110
+ /*
1111
+ * 获取用户在项目中的角色.
1112
+ * 获取用户在项目中的角色.
1113
+ */
1114
+ getMemberRole: (
1115
+ params:{
1116
+ projectId: string,
1117
+ userId?: string
1118
+ }
1119
+ ): Promise<{
1120
+ code: ResponseCode,
1121
+ message?: string,
1122
+ data?: ProjectRole|null
1123
+ }> => {
1124
+ return HttpRequest.get('/api/project/member/role', { projectId:params.projectId, userId:params.userId}, null).then((res:any) => {
1125
+ return res as any;
1126
+ });
1127
+ },
1128
+
1129
+ /*
1130
+ * /api/project/members/assign
1131
+ */
1132
+ assignMember: (
1133
+ data: {
1134
+ userId: string,
1135
+ role?: string,
1136
+ projectId: string
1137
+ }
1138
+ ): Promise<{
1139
+ code: ResponseCode,
1140
+ message?: string,
1141
+ data?: boolean
1142
+ }> => {
1143
+ return HttpRequest.post('/api/project/members/assign', null, { userId:data.userId, role:data.role, projectId:data.projectId}).then((res:any) => {
1144
+ return res as any;
1145
+ });
1146
+ },
1147
+
1148
+ /*
1149
+ * /api/project/members/remove
1150
+ */
1151
+ removeMember: (
1152
+ data: {
1153
+ userId: string,
1154
+ role?: string,
1155
+ projectId: string
1156
+ }
1157
+ ): Promise<{
1158
+ code: ResponseCode,
1159
+ message?: string,
1160
+ data?: boolean
1161
+ }> => {
1162
+ return HttpRequest.post('/api/project/members/remove', null, { userId:data.userId, role:data.role, projectId:data.projectId}).then((res:any) => {
1163
+ return res as any;
1164
+ });
1165
+ },
1166
+
1167
+ }
1168
+ /*
1169
+ * ProjectProgress
1170
+ */
1171
+ export const projectprogress = {
1172
+ /*
1173
+ * 创建项目进展记录 POST /api/project/progress/create
1174
+ * 创建项目进展记录 POST /api/project/progress/create
1175
+ */
1176
+ createProgress: (
1177
+ data: {
1178
+ projectId: string,
1179
+ descs: string,
1180
+ commentCount: number,
1181
+ progressTime: Date
1182
+ }
1183
+ ): Promise<{
1184
+ code: ResponseCode,
1185
+ message?: string,
1186
+ data?: string
1187
+ }> => {
1188
+ return HttpRequest.post('/api/project/progress/create', null, { projectId:data.projectId, descs:data.descs, commentCount:data.commentCount, progressTime:data.progressTime}).then((res:any) => {
1189
+ return res as any;
1190
+ });
1191
+ },
1192
+
1193
+ /*
1194
+ * 更新项目进展记录 PUT /api/project/progress/update/:id
1195
+ * 更新项目进展记录 PUT /api/project/progress/update/:id
1196
+ */
1197
+ updateProgress: (
1198
+ data: {
1199
+ id: string,
1200
+ descs?: string,
1201
+ progressTime?: Date
1202
+ }
1203
+ ): Promise<{
1204
+ code: ResponseCode,
1205
+ message?: string
1206
+ }> => {
1207
+ return HttpRequest.put('/api/project/progress/update', null, { id:data.id, descs:data.descs, progressTime:data.progressTime}).then((res:any) => {
1208
+ return res as any;
1209
+ });
1210
+ },
1211
+
1212
+ /*
1213
+ * 删除项目进展记录 DELETE /api/project/progress/delete/:id
1214
+ * 删除项目进展记录 DELETE /api/project/progress/delete/:id
1215
+ */
1216
+ deleteProgress: (
1217
+ params:{
1218
+ id: string
1219
+ }
1220
+ ): Promise<{
1221
+ code: ResponseCode,
1222
+ message?: string
1223
+ }> => {
1224
+ return HttpRequest.delete('/api/project/progress/delete', { id:params.id}, null).then((res:any) => {
1225
+ return res as any;
1226
+ });
1227
+ },
1228
+
1229
+ /*
1230
+ * 获取项目进展列表 GET /api/project/progress/list/:projectId
1231
+ * 获取项目进展列表 GET /api/project/progress/list/:projectId
1232
+ */
1233
+ getProgressList: (
1234
+ params:{
1235
+ projectId: string
1236
+ }
1237
+ ): Promise<{
1238
+ code: ResponseCode,
1239
+ message?: string,
1240
+ data?: {
1241
+ total:number;
1242
+ list:{
1243
+ id: string,
1244
+ projectId: string,
1245
+ descs: string,
1246
+ isDeleted: boolean,
1247
+ commentCount: number,
1248
+ progressTime: Date,
1249
+ createTime: Date,
1250
+ updateTime: Date,
1251
+ createBy: string,
1252
+ updateBy: string
1253
+ }[];
1254
+ }
1255
+ }> => {
1256
+ return HttpRequest.get('/api/project/progress/list', { projectId:params.projectId}, null).then((res:any) => {
1257
+ return res as any;
1258
+ });
1259
+ },
1260
+
1261
+ /*
1262
+ * 添加进展评论 POST /api/project/progress/comment/add
1263
+ * 添加进展评论 POST /api/project/progress/comment/add
1264
+ */
1265
+ addComment: (
1266
+ data: {
1267
+ progressId: string,
1268
+ comment: string
1269
+ }
1270
+ ): Promise<{
1271
+ code: ResponseCode,
1272
+ message?: string,
1273
+ data?: string
1274
+ }> => {
1275
+ return HttpRequest.post('/api/project/progress/comment/add', null, { progressId:data.progressId, comment:data.comment}).then((res:any) => {
1276
+ return res as any;
1277
+ });
1278
+ },
1279
+
1280
+ /*
1281
+ * 删除进展评论 DELETE /api/project/progress/comment/delete/:id
1282
+ * 删除进展评论 DELETE /api/project/progress/comment/delete/:id
1283
+ */
1284
+ deleteComment: (
1285
+ params:{
1286
+ id: string
1287
+ }
1288
+ ): Promise<{
1289
+ code: ResponseCode,
1290
+ message?: string
1291
+ }> => {
1292
+ return HttpRequest.delete('/api/project/progress/comment/delete', { id:params.id}, null).then((res:any) => {
1293
+ return res as any;
1294
+ });
1295
+ },
1296
+
1297
+ /*
1298
+ * 更新进展评论 PUT /api/project/progress/comment/update/:id
1299
+ * 更新进展评论 PUT /api/project/progress/comment/update/:id
1300
+ */
1301
+ updateComment: (
1302
+ params:{
1303
+ id: string
1304
+ }
1305
+ ): Promise<{
1306
+ code: ResponseCode,
1307
+ message?: string
1308
+ }> => {
1309
+ return HttpRequest.put('/api/project/progress/comment/update', { id:params.id}, {}).then((res:any) => {
1310
+ return res as any;
1311
+ });
1312
+ },
1313
+
1314
+ /*
1315
+ * 获取进展评论列表 GET /api/project/progress/comment/list/:progressId
1316
+ * 获取进展评论列表 GET /api/project/progress/comment/list/:progressId
1317
+ */
1318
+ getCommentList: (
1319
+ params:{
1320
+ progressId: string,
1321
+ pageNum?: number,
1322
+ pageSize?: number
1323
+ }
1324
+ ): Promise<{
1325
+ code: ResponseCode,
1326
+ message?: string,
1327
+ data?: {
1328
+ total:number;
1329
+ list:{
1330
+ id: string,
1331
+ progressId: string,
1332
+ comment: string,
1333
+ createTime: Date,
1334
+ updateTime: Date,
1335
+ createBy: string,
1336
+ updateBy: string
1337
+ }[];
1338
+ }
1339
+ }> => {
1340
+ return HttpRequest.get('/api/project/progress/comment/list', { progressId:params.progressId, pageNum:params.pageNum, pageSize:params.pageSize}, null).then((res:any) => {
1341
+ return res as any;
1342
+ });
1343
+ },
1344
+
1345
+ }