spring
2026-07-03 081f242ea3c019f4eddd0fe342c5cf6189da1468
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
import type { MesPdArchiveApi } from '#/api/mes/pd/archive';
import type { MesPdBomApi } from '#/api/mes/pd/bom';
import type { MesPdDocumentApi } from '#/api/mes/pd/document';
import type { MesPdDrawingReviewApi } from '#/api/mes/pd/drawing-review';
import type { MesPdProjectApi } from '#/api/mes/pd/project';
import type { MesPdVersionChangeApi } from '#/api/mes/pd/version-change';
import type { MesPdWorkflowApi } from '#/api/mes/pd/workflow';
 
import {
  MesPdDocumentTypeEnum,
  MesPdDrawingReviewStatusEnum,
  MesPdProjectStatusEnum,
  MesPdVersionChangeTypeEnum,
} from '#/packages/constants/src';
 
const DAY = 86_400_000;
const now = Date.now();
 
function ts(daysAgo = 0): number {
  return now - daysAgo * DAY;
}
 
/** 设计任务:同一产品可多次发起,每次对应一个版本 */
export const pdMockProjects: MesPdProjectApi.Project[] = [
  {
    id: 1,
    code: 'DT-2026-0001',
    name: '智能温控模组 V1.0 设计',
    productCode: 'PRD-TC-100',
    productName: '智能温控模组',
    version: 'V1.0',
    status: MesPdProjectStatusEnum.DESIGNING,
    designerName: '张工',
    reviewerName: '李主管',
    planStartDate: ts(30),
    planEndDate: ts(-15),
    remark: '首次设计,主控板 + 传感器一体化',
    createTime: ts(35),
  },
  {
    id: 2,
    code: 'DT-2026-0002',
    name: '工业网关 V2.1 设计',
    productCode: 'PRD-GW-200',
    productName: '工业物联网网关',
    version: 'V2.1',
    status: MesPdProjectStatusEnum.REVIEWING,
    designerName: '王工',
    reviewerName: '赵经理',
    planStartDate: ts(20),
    planEndDate: ts(-5),
    remark: '通信协议升级,外壳结构调整',
    createTime: ts(25),
  },
  {
    id: 3,
    code: 'DT-2025-0012',
    name: '多通道采集板 V1.2 设计',
    productCode: 'PRD-SC-050',
    productName: '多通道采集板',
    version: 'V1.2',
    status: MesPdProjectStatusEnum.ARCHIVED,
    designerName: '陈工',
    reviewerName: '李主管',
    planStartDate: ts(90),
    planEndDate: ts(45),
    actualFinishDate: ts(40),
    remark: '已量产归档',
    createTime: ts(95),
  },
  {
    id: 4,
    code: 'DT-2026-0004',
    name: '伺服电机驱动器 V0.9 设计',
    productCode: 'PRD-MD-300',
    productName: '伺服电机驱动器',
    version: 'V0.9',
    status: MesPdProjectStatusEnum.DRAFT,
    designerName: '刘工',
    reviewerName: '赵经理',
    planStartDate: ts(5),
    planEndDate: ts(-30),
    createTime: ts(3),
  },
  {
    id: 5,
    code: 'DT-2024-0008',
    name: '多通道采集板 V1.0 设计',
    productCode: 'PRD-SC-050',
    productName: '多通道采集板',
    version: 'V1.0',
    status: MesPdProjectStatusEnum.ARCHIVED,
    designerName: '陈工',
    reviewerName: '李主管',
    planStartDate: ts(200),
    planEndDate: ts(170),
    actualFinishDate: ts(165),
    remark: '初代版本归档',
    createTime: ts(205),
  },
  {
    id: 6,
    code: 'DT-2026-0006',
    name: '智能温控模组 V1.1 设计',
    productCode: 'PRD-TC-100',
    productName: '智能温控模组',
    version: 'V1.1',
    status: MesPdProjectStatusEnum.APPROVED,
    designerName: '张工',
    reviewerName: '李主管',
    planStartDate: ts(10),
    planEndDate: ts(-20),
    remark: '散热优化改版,待归档',
    createTime: ts(12),
  },
];
 
export const pdMockArchives: MesPdArchiveApi.Archive[] = [
  {
    id: 1,
    code: 'AR-2025-0012',
    projectId: 3,
    projectCode: 'DT-2025-0012',
    projectName: '多通道采集板 V1.2 设计',
    productCode: 'PRD-SC-050',
    productName: '多通道采集板',
    version: 'V1.2',
    archiveStatus: 1,
    archiveTime: ts(38),
    archiverName: '陈工',
    documentCount: 3,
    bomCount: 1,
    storagePath: '/archive/2026/PRD-SC-050/V1.2',
    remark: 'V1.2 量产版本完整归档',
    createTime: ts(38),
  },
  {
    id: 2,
    code: 'AR-2024-0008',
    projectId: 5,
    projectCode: 'DT-2024-0008',
    projectName: '多通道采集板 V1.0 设计',
    productCode: 'PRD-SC-050',
    productName: '多通道采集板',
    version: 'V1.0',
    archiveStatus: 1,
    archiveTime: ts(165),
    archiverName: '陈工',
    documentCount: 4,
    bomCount: 8,
    storagePath: '/archive/2024/PRD-SC-050/V1.0',
    remark: '初代版本归档',
    createTime: ts(165),
  },
];
 
export const pdMockDocuments: MesPdDocumentApi.Document[] = [
  {
    id: 1,
    projectId: 1,
    documentType: MesPdDocumentTypeEnum.SCHEME,
    name: '温控方案说明',
    version: 'V1.0',
    fileName: 'scheme-v1.pdf',
    fileUrl: 'https://example.com/scheme-v1.pdf',
    uploaderName: '张工',
    createTime: ts(25),
  },
  {
    id: 2,
    projectId: 1,
    documentType: MesPdDocumentTypeEnum.DRAWING,
    name: '主控板原理图',
    version: 'V1.0',
    fileName: 'main-sch.pdf',
    fileUrl: 'https://example.com/main-sch.pdf',
    uploaderName: '张工',
    createTime: ts(22),
  },
  {
    id: 3,
    projectId: 2,
    documentType: MesPdDocumentTypeEnum.DRAWING,
    name: '网关外壳工程图',
    version: 'V2.1',
    fileName: 'gw-enclosure.dwg',
    fileUrl: 'https://example.com/gw-enclosure.dwg',
    uploaderName: '王工',
    createTime: ts(12),
  },
  {
    id: 4,
    projectId: 3,
    documentType: MesPdDocumentTypeEnum.OTHER,
    name: '归档检查清单',
    version: 'V1.2',
    fileName: 'archive-checklist.xlsx',
    uploaderName: '陈工',
    createTime: ts(39),
  },
  {
    id: 5,
    projectId: 6,
    documentType: MesPdDocumentTypeEnum.DRAWING,
    name: '散热优化 PCB 图',
    version: 'V1.1',
    fileName: 'thermal-pcb-v1.1.pdf',
    fileUrl: 'https://example.com/thermal-pcb.pdf',
    uploaderName: '张工',
    createTime: ts(8),
  },
  {
    id: 6,
    projectId: 1,
    documentType: MesPdDocumentTypeEnum.BOM,
    name: 'BOM 清单',
    version: 'V1.0',
    fileName: 'bom-v1.0.xlsx',
    fileUrl: 'https://example.com/bom-v1.0.xlsx',
    uploaderName: '张工',
    createTime: ts(20),
  },
  {
    id: 7,
    projectId: 3,
    documentType: MesPdDocumentTypeEnum.BOM,
    name: 'BOM 清单',
    version: 'V1.2',
    fileName: 'bom-v1.2.xlsx',
    fileUrl: 'https://example.com/bom-v1.2.xlsx',
    uploaderName: '陈工',
    createTime: ts(48),
  },
];
 
export const pdMockBomLines: MesPdBomApi.BomLine[] = [
  {
    id: 1,
    projectId: 1,
    itemCode: 'MAT-001',
    itemName: 'STM32 主控芯片',
    specification: 'LQFP-64',
    unitMeasureName: 'PCS',
    quantity: 1,
    createTime: ts(20),
  },
  {
    id: 2,
    projectId: 1,
    itemCode: 'MAT-018',
    itemName: 'NTC 热敏电阻',
    specification: '10K B3950',
    unitMeasureName: 'PCS',
    quantity: 2,
    createTime: ts(20),
  },
  {
    id: 3,
    projectId: 3,
    itemCode: 'MAT-102',
    itemName: '运算放大器',
    specification: 'SOP-8',
    unitMeasureName: 'PCS',
    quantity: 4,
    createTime: ts(50),
  },
];
 
export const pdMockDrawingReviews: MesPdDrawingReviewApi.DrawingReview[] = [
  {
    id: 1,
    code: 'DR-2026-0001',
    projectId: 2,
    projectCode: 'DT-2026-0002',
    projectName: '工业网关 V2.1 设计',
    documentId: 3,
    documentName: '网关外壳工程图',
    documentVersion: 'V2.1',
    reviewerName: '赵经理',
    status: MesPdDrawingReviewStatusEnum.PENDING,
    createTime: ts(10),
  },
  {
    id: 2,
    code: 'DR-2026-0002',
    projectId: 6,
    projectCode: 'DT-2026-0006',
    projectName: '智能温控模组 V1.1 设计',
    documentId: 5,
    documentName: '散热优化 PCB 图',
    documentVersion: 'V1.1',
    reviewerName: '李主管',
    status: MesPdDrawingReviewStatusEnum.APPROVED,
    reviewTime: ts(6),
    createTime: ts(7),
  },
];
 
export const pdMockVersionChanges: MesPdVersionChangeApi.VersionChange[] = [
  {
    id: 1,
    code: 'VC-2025-0001',
    projectId: 3,
    projectCode: 'DT-2025-0012',
    projectName: '多通道采集板 V1.2 设计',
    changeType: MesPdVersionChangeTypeEnum.MINOR,
    fromVersion: 'V1.0',
    toVersion: 'V1.2',
    applicantName: '陈工',
    changeReason: '通道数扩展与精度提升',
    changeContent: '由 4 通道升级为 8 通道,更换高精度 ADC',
    createTime: ts(92),
  },
  {
    id: 2,
    code: 'VC-2026-0001',
    projectId: 6,
    projectCode: 'DT-2026-0006',
    projectName: '智能温控模组 V1.1 设计',
    changeType: MesPdVersionChangeTypeEnum.PATCH,
    fromVersion: 'V1.0',
    toVersion: 'V1.1',
    applicantName: '张工',
    changeReason: '优化散热布局',
    changeContent: '调整 NTC 摆放位置,更新 PCB 丝印',
    createTime: ts(8),
  },
];
 
export const pdMockWorkflows: Record<number, MesPdWorkflowApi.WorkflowNode[]> = {
  1: [
    { id: 11, projectId: 1, nodeName: '发起任务', operatorName: '张工', status: 1, operateTime: ts(35) },
    { id: 12, projectId: 1, nodeName: '发布任务', operatorName: '张工', status: 1, operateTime: ts(34) },
    { id: 13, projectId: 1, nodeName: '上传资料', operatorName: '张工', status: 2, remark: '进行中' },
    { id: 14, projectId: 1, nodeName: '资料审核', status: 0 },
    { id: 15, projectId: 1, nodeName: '归档', status: 0 },
  ],
  2: [
    { id: 21, projectId: 2, nodeName: '发起任务', operatorName: '王工', status: 1, operateTime: ts(25) },
    { id: 22, projectId: 2, nodeName: '发布任务', operatorName: '王工', status: 1, operateTime: ts(24) },
    { id: 23, projectId: 2, nodeName: '上传资料', operatorName: '王工', status: 1, operateTime: ts(12) },
    { id: 24, projectId: 2, nodeName: '资料审核', operatorName: '赵经理', status: 2, remark: '待审核' },
    { id: 25, projectId: 2, nodeName: '归档', status: 0 },
  ],
  3: [
    { id: 31, projectId: 3, nodeName: '发起任务', operatorName: '陈工', status: 1, operateTime: ts(95) },
    { id: 32, projectId: 3, nodeName: '发布任务', operatorName: '陈工', status: 1, operateTime: ts(94) },
    { id: 33, projectId: 3, nodeName: '上传资料', operatorName: '陈工', status: 1, operateTime: ts(50) },
    { id: 34, projectId: 3, nodeName: '资料审核', operatorName: '李主管', status: 1, operateTime: ts(42) },
    { id: 35, projectId: 3, nodeName: '归档', operatorName: '陈工', status: 1, operateTime: ts(38) },
  ],
  4: [
    { id: 41, projectId: 4, nodeName: '发起任务', operatorName: '刘工', status: 1, operateTime: ts(3) },
    { id: 42, projectId: 4, nodeName: '发布任务', status: 0 },
    { id: 43, projectId: 4, nodeName: '上传资料', status: 0 },
    { id: 44, projectId: 4, nodeName: '资料审核', status: 0 },
    { id: 45, projectId: 4, nodeName: '归档', status: 0 },
  ],
  5: [
    { id: 51, projectId: 5, nodeName: '发起任务', operatorName: '陈工', status: 1, operateTime: ts(205) },
    { id: 52, projectId: 5, nodeName: '发布任务', operatorName: '陈工', status: 1, operateTime: ts(200) },
    { id: 53, projectId: 5, nodeName: '上传资料', operatorName: '陈工', status: 1, operateTime: ts(170) },
    { id: 54, projectId: 5, nodeName: '资料审核', operatorName: '李主管', status: 1, operateTime: ts(168) },
    { id: 55, projectId: 5, nodeName: '归档', operatorName: '陈工', status: 1, operateTime: ts(165) },
  ],
  6: [
    { id: 61, projectId: 6, nodeName: '发起任务', operatorName: '张工', status: 1, operateTime: ts(12) },
    { id: 62, projectId: 6, nodeName: '发布任务', operatorName: '张工', status: 1, operateTime: ts(11) },
    { id: 63, projectId: 6, nodeName: '上传资料', operatorName: '张工', status: 1, operateTime: ts(8) },
    { id: 64, projectId: 6, nodeName: '资料审核', operatorName: '李主管', status: 1, operateTime: ts(6) },
    { id: 65, projectId: 6, nodeName: '归档', status: 2, remark: '待归档' },
  ],
};
 
export const pdMockSeq = {
  project: 7,
  archive: 3,
  task: 4,
  document: 8,
  bom: 4,
  drawingReview: 3,
  versionChange: 3,
};
 
/** @deprecated 设计任务即项目,子任务分发已废弃 */
export const pdMockTasks = [];