spring
2026-07-03 f10cf167372f2d8c4c0e14f42f361d7ab96d8347
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import type { PageParam, PageResult } from '#/packages/effects/request/src';
 
import { requestClient } from '#/api/request';
 
import { isPdMockEnabled } from '../mock/enabled';
import { pdMockStore } from '../mock/store';
 
export namespace MesPdArchiveApi {
  /** 数字化设计归档台账 */
  export interface Archive {
    id?: number;
    code?: string;
    projectId?: number;
    projectCode?: string;
    projectName?: string;
    productCode?: string;
    productName?: string;
    version?: string;
    archiveStatus?: number;
    archiveTime?: number;
    archiverId?: number;
    archiverName?: string;
    documentCount?: number;
    bomCount?: number;
    storagePath?: string;
    remark?: string;
    createTime?: number;
  }
 
  export interface PageParams extends PageParam {
    code?: string;
    projectCode?: string;
    productCode?: string;
    archiveStatus?: number;
  }
}
 
export function getPdArchivePage(params: MesPdArchiveApi.PageParams) {
  if (isPdMockEnabled()) {
    return pdMockStore.getArchivePage(params);
  }
  return requestClient.get<PageResult<MesPdArchiveApi.Archive>>(
    '/mes/pd/archive/page',
    { params },
  );
}
 
export function getPdArchive(id: number) {
  if (isPdMockEnabled()) {
    return pdMockStore.getArchive(id);
  }
  return requestClient.get<MesPdArchiveApi.Archive>(
    `/mes/pd/archive/get?id=${id}`,
  );
}
 
export function exportPdArchive(params: MesPdArchiveApi.PageParams) {
  if (isPdMockEnabled()) {
    return Promise.resolve(new Blob());
  }
  return requestClient.download('/mes/pd/archive/export-excel', { params });
}