zy-react-library 1.0.138 → 1.0.140

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.
@@ -14,6 +14,8 @@ export interface HiddenInfoProps {
14
14
  hiddenIdKey?: string;
15
15
  /** 是否显示头部的返回,默认 true */
16
16
  isShowHeaderBack?: boolean;
17
+ /** 是否是过往记录,后端会返回详细的步骤信息,默认 false */
18
+ history?: boolean;
17
19
  /** 获取数据 */
18
20
  onGetData?: (data: Record<string, any>) => void;
19
21
  }
@@ -24,14 +24,15 @@ function HiddenInfo(props) {
24
24
  hiddenId = "",
25
25
  hiddenIdKey = "hiddenId",
26
26
  isShowHeaderBack = true,
27
+ history = false,
27
28
  onGetData,
28
29
  } = props;
29
30
 
30
31
  const [info, setInfo] = useState({
31
32
  hiddenUserPresetsCO: {},
32
- hiddenRectifyUserCO: {},
33
- hiddenConfirmUserCO: {},
34
- hiddenAcceptUserCO: {},
33
+ hiddenRectifyUserCO: [],
34
+ hiddenConfirmUserCO: [],
35
+ hiddenAcceptUserCO: [],
35
36
  hiddenInspecCO: {},
36
37
  hiddenSpecialList: [],
37
38
  hiddenExtensionList: [],
@@ -50,30 +51,43 @@ function HiddenInfo(props) {
50
51
  const { loading: downloadFileLoading, downloadFile } = useDownloadFile();
51
52
 
52
53
  const getFileData = async (info) => {
53
- const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: hiddenId || query[hiddenIdKey] });
54
+ const hiddenImageFiles = await getFile({
55
+ eqType: UPLOAD_FILE_TYPE_ENUM["3"],
56
+ eqForeignKey: hiddenId || query[hiddenIdKey],
57
+ });
54
58
  setHiddenImageFiles(hiddenImageFiles);
55
- const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: hiddenId || query[hiddenIdKey] });
59
+ const hiddenVideoFiles = await getFile({
60
+ eqType: UPLOAD_FILE_TYPE_ENUM["102"],
61
+ eqForeignKey: hiddenId || query[hiddenIdKey],
62
+ });
56
63
  setHiddenVideoFiles(hiddenVideoFiles);
57
64
 
58
- if (info.hiddenRectifyUserCO && Object.keys(info.hiddenRectifyUserCO).length > 0) {
65
+ if (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) {
59
66
  const afterRectificationImageFiles = await getFile({
60
67
  eqType: UPLOAD_FILE_TYPE_ENUM["4"],
61
68
  eqForeignKey: hiddenId || query[hiddenIdKey],
62
69
  });
63
70
  setAfterRectificationImageFiles(afterRectificationImageFiles);
64
71
 
65
- if ((info.hiddenRectifyUserCO.isRectificationScheme === 1 && info.hiddenRectifyUserCO.hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO.hiddenSchemeCO).length > 0)) {
66
- const rectificationPlanImageFiles = await getFile({
67
- eqType: UPLOAD_FILE_TYPE_ENUM["8"],
68
- eqForeignKey: hiddenId || query[hiddenIdKey],
69
- });
70
- setRectificationPlanImageFiles(rectificationPlanImageFiles);
72
+ for (let i = 0; i < info.hiddenRectifyUserCO.length; i++) {
73
+ if ((info.hiddenRectifyUserCO[i].isRectificationScheme === 1 && info.hiddenRectifyUserCO[i].hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO[i].hiddenSchemeCO).length > 0)) {
74
+ const rectificationPlanImageFiles = await getFile({
75
+ eqType: UPLOAD_FILE_TYPE_ENUM["8"],
76
+ eqForeignKey: hiddenId || query[hiddenIdKey],
77
+ });
78
+ setRectificationPlanImageFiles(prevState => [...prevState, ...rectificationPlanImageFiles]);
79
+ }
71
80
  }
72
81
  }
73
82
 
74
- if (info.isQualified === 1 && (info.hiddenAcceptUserCO && Object.keys(info.hiddenAcceptUserCO).length > 0)) {
75
- const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || query[hiddenIdKey] });
76
- setAcceptImageFiles(acceptImageFiles);
83
+ if (info.isQualified === 1 && (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0)) {
84
+ for (let i = 0; i < info.hiddenAcceptUserCO.length; i++) {
85
+ const acceptImageFiles = await getFile({
86
+ eqType: UPLOAD_FILE_TYPE_ENUM["5"],
87
+ eqForeignKey: hiddenId || query[hiddenIdKey],
88
+ });
89
+ setAcceptImageFiles(prevState => [...prevState, ...acceptImageFiles]);
90
+ }
77
91
  }
78
92
 
79
93
  if (info.hiddenInspecCO && Object.keys(info.hiddenInspecCO).length > 0) {
@@ -86,7 +100,7 @@ function HiddenInfo(props) {
86
100
  };
87
101
 
88
102
  const getData = async () => {
89
- request(`/hidden/hidden/${id || query[idKey]}`, "get").then((res) => {
103
+ request(!history ? `/hidden/hidden/${id || query[idKey]}` : `/hidden/hidden/history/${id || query[idKey]}`, "get").then((res) => {
90
104
  setInfo(res.data);
91
105
  getFileData(res.data);
92
106
  setLoading(false);
@@ -106,7 +120,7 @@ function HiddenInfo(props) {
106
120
  <Descriptions
107
121
  bordered
108
122
  column={1}
109
- labelStyle={{ width: 200 }}
123
+ styles={{ label: { width: 200 } }}
110
124
  items={[
111
125
  { label: "隐患来源", children: getLabelName({ list: HIDDEN_SOURCE_ENUM, status: info.source }) },
112
126
  { label: "隐患类型", children: info.hiddenTypeName },
@@ -149,12 +163,15 @@ function HiddenInfo(props) {
149
163
  },
150
164
  { label: "隐患图片", children: <PreviewImg files={hiddenImageFiles} /> },
151
165
  ...(hiddenVideoFiles.length > 0
152
- ? [{ label: "隐患视频", children: (
153
- <VideoIcon onClick={() => {
154
- setVideoModalOpen(true);
155
- }}
156
- />
157
- ) }]
166
+ ? [{
167
+ label: "隐患视频",
168
+ children: (
169
+ <VideoIcon onClick={() => {
170
+ setVideoModalOpen(true);
171
+ }}
172
+ />
173
+ ),
174
+ }]
158
175
  : []),
159
176
  ]}
160
177
  />
@@ -165,13 +182,16 @@ function HiddenInfo(props) {
165
182
  <Descriptions
166
183
  bordered
167
184
  column={1}
168
- labelStyle={{ width: 200 }}
185
+ styles={{ label: { width: 200 } }}
169
186
  items={[
170
187
  { label: "整改部门", children: info.hiddenUserPresetsCO.rectifyDeptName },
171
188
  { label: "整改人", children: info.hiddenUserPresetsCO.rectifyUserName },
172
189
  ...(info.rectificationType === 2
173
190
  ? [
174
- { label: "整改期限", children: dayjs(info.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD") },
191
+ {
192
+ label: "整改期限",
193
+ children: dayjs(info.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD"),
194
+ },
175
195
  ]
176
196
  : []),
177
197
  ...(info.rectificationType === 1
@@ -186,30 +206,35 @@ function HiddenInfo(props) {
186
206
  )
187
207
  }
188
208
  {
189
- (info.isConfirm === 1 && info.hiddenConfirmUserCO && Object.keys(info.hiddenConfirmUserCO).length > 0) && (
209
+ (info.isConfirm === 1 && (info.hiddenConfirmUserCO && info.hiddenConfirmUserCO.length > 0)) && (
190
210
  <>
191
211
  <Divider orientation="left">隐患确认</Divider>
192
- <Descriptions
193
- bordered
194
- column={1}
195
- labelStyle={{ width: 200 }}
196
- items={[
197
- { label: "隐患级别", children: info.hiddenConfirmUserCO.hiddenLevelName },
198
- { label: "隐患确认人", children: info.hiddenConfirmUserCO.userName },
199
- { label: "隐患确认时间", children: info.hiddenConfirmUserCO.rectificationTime },
200
- { label: "整改负责人部门", children: info.hiddenConfirmUserCO.rectifyDeptName },
201
- { label: "整改负责人", children: info.hiddenConfirmUserCO.rectifyUserName },
202
- { label: "整改完成期限", children: info.hiddenConfirmUserCO.rectificationDeadline },
203
- { label: "验收部门", children: info.hiddenConfirmUserCO.checkDeptName },
204
- { label: "验收人", children: info.hiddenConfirmUserCO.checkUserName },
205
- ...(info.hiddenConfirmUserCO.repulseCause
206
- ? [
207
- { label: "打回意见", children: info.hiddenConfirmUserCO.repulseCause },
208
- { label: "打回时间", children: info.hiddenConfirmUserCO.rectificationTime },
209
- ]
210
- : []),
211
- ]}
212
- />
212
+ {
213
+ info.hiddenConfirmUserCO.map(item => (
214
+ <Descriptions
215
+ key={item.id}
216
+ bordered
217
+ column={1}
218
+ styles={{ label: { width: 200 } }}
219
+ items={[
220
+ { label: "隐患级别", children: item.hiddenLevelName },
221
+ { label: "隐患确认人", children: item.userName },
222
+ { label: "隐患确认时间", children: item.rectificationTime },
223
+ { label: "整改负责人部门", children: item.rectifyDeptName },
224
+ { label: "整改负责人", children: item.rectifyUserName },
225
+ { label: "整改完成期限", children: item.rectificationDeadline },
226
+ { label: "验收部门", children: item.checkDeptName },
227
+ { label: "验收人", children: item.checkUserName },
228
+ ...(item.repulseCause
229
+ ? [
230
+ { label: "打回意见", children: item.repulseCause },
231
+ { label: "打回时间", children: item.rectificationTime },
232
+ ]
233
+ : []),
234
+ ]}
235
+ />
236
+ ))
237
+ }
213
238
  </>
214
239
  )
215
240
  }
@@ -223,7 +248,7 @@ function HiddenInfo(props) {
223
248
  key={item.id}
224
249
  bordered
225
250
  column={1}
226
- labelStyle={{ width: 200 }}
251
+ styles={{ label: { width: 200 } }}
227
252
  items={[
228
253
  { label: "申请延期日期", children: item.createTime },
229
254
  { label: "延期日期", children: item.delayTime },
@@ -239,7 +264,13 @@ function HiddenInfo(props) {
239
264
  : (
240
265
  <Space>
241
266
  <span>{getFileName(item.disposalFile)}</span>
242
- <Button type="primary" size="small" onClick={() => downloadFile(item.disposalFile)}>预览</Button>
267
+ <Button
268
+ type="primary"
269
+ size="small"
270
+ onClick={() => downloadFile(item.disposalFile)}
271
+ >
272
+ 预览
273
+ </Button>
243
274
  </Space>
244
275
  )
245
276
  ),
@@ -258,7 +289,12 @@ function HiddenInfo(props) {
258
289
  </>
259
290
  ),
260
291
  },
261
- ...((item.state === 3 || item.state === 4) ? [{ label: "延期审核时间", children: item.updateTime }] : []),
292
+ ...((item.state === 3 || item.state === 4)
293
+ ? [{
294
+ label: "延期审核时间",
295
+ children: item.updateTime,
296
+ }]
297
+ : []),
262
298
  ]}
263
299
  />
264
300
  ),
@@ -277,7 +313,7 @@ function HiddenInfo(props) {
277
313
  key={item.id}
278
314
  bordered
279
315
  column={1}
280
- labelStyle={{ width: 200 }}
316
+ styles={{ label: { width: 200 } }}
281
317
  items={[
282
318
  ...((item.state === 3 || item.state === 4)
283
319
  ? [
@@ -297,12 +333,21 @@ function HiddenInfo(props) {
297
333
  : (
298
334
  <Space>
299
335
  <span>{getFileName(item.disposalFile)}</span>
300
- <Button type="primary" size="small" onClick={() => downloadFile(item.disposalFile)}>预览</Button>
336
+ <Button
337
+ type="primary"
338
+ size="small"
339
+ onClick={() => downloadFile(item.disposalFile)}
340
+ >
341
+ 预览
342
+ </Button>
301
343
  </Space>
302
344
  )
303
345
  ),
304
346
  },
305
- { label: "是否更换整改负责人", children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否" },
347
+ {
348
+ label: "是否更换整改负责人",
349
+ children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否",
350
+ },
306
351
  ...(
307
352
  item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0
308
353
  ? [{ label: "整改负责人", children: item.rectifyUserCO.userName }]
@@ -330,77 +375,92 @@ function HiddenInfo(props) {
330
375
  )
331
376
  }
332
377
  {
333
- (info.hiddenRectifyUserCO && Object.keys(info.hiddenRectifyUserCO).length > 0) && (
378
+ (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) && (
334
379
  <>
335
380
  <Divider orientation="left">整改信息</Divider>
336
- <Descriptions
337
- bordered
338
- column={1}
339
- labelStyle={{ width: 200 }}
340
- items={[
341
- { label: "整改部门", children: info.hiddenRectifyUserCO.deptName },
342
- { label: "整改人", children: info.hiddenRectifyUserCO.userName },
343
- { label: "整改时间", children: info.hiddenRectifyUserCO.rectificationTime },
344
- { label: "整改描述", children: info.hiddenRectifyUserCO.descr },
345
- { label: "投入资金", children: info.hiddenRectifyUserCO.investmentFunds },
346
- { label: "临时安全措施", children: info.tempSafeMeasure },
347
- { label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles} /> },
348
- { label: "整改方案", children: info.hiddenRectifyUserCO.isRectificationScheme === 0 ? "无" : "有" },
349
- ...((info.hiddenRectifyUserCO.isRectificationScheme === 1 && info.hiddenRectifyUserCO.hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO.hiddenSchemeCO).length > 0)
350
- ? [
351
- { label: "治理标准", children: info.hiddenRectifyUserCO.hiddenSchemeCO.governStanDards },
352
- { label: "治理方法", children: info.hiddenRectifyUserCO.hiddenSchemeCO.governMethod },
353
- { label: "经费落实", children: info.hiddenRectifyUserCO.hiddenSchemeCO.expenditure },
354
- { label: "负责人员", children: info.hiddenRectifyUserCO.hiddenSchemeCO.principal },
355
- { label: "工时安排", children: info.hiddenRectifyUserCO.hiddenSchemeCO.programming },
356
- { label: "时限要求", children: info.hiddenRectifyUserCO.hiddenSchemeCO.timeLimitFor },
357
- { label: "工作要求", children: info.hiddenRectifyUserCO.hiddenSchemeCO.jobRequireMent },
358
- { label: "其他事项", children: info.hiddenRectifyUserCO.hiddenSchemeCO.otherBusiness },
359
- { label: "方案图片", children: <PreviewImg files={rectificationPlanImageFiles} /> },
360
- ]
361
- : []),
362
- ]}
363
- />
381
+ {
382
+ info.hiddenSpecialList.map((item, index) => (
383
+ <Descriptions
384
+ key={item.id}
385
+ bordered
386
+ column={1}
387
+ styles={{ label: { width: 200 } }}
388
+ items={[
389
+ { label: "整改部门", children: item.deptName },
390
+ { label: "整改人", children: item.userName },
391
+ { label: "整改时间", children: item.rectificationTime },
392
+ { label: "整改描述", children: item.descr },
393
+ { label: "投入资金", children: item.investmentFunds },
394
+ { label: "临时安全措施", children: info.tempSafeMeasure },
395
+ { label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles} /> },
396
+ { label: "整改方案", children: item.isRectificationScheme === 0 ? "无" : "有" },
397
+ ...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0)
398
+ ? [
399
+ { label: "治理标准", children: item.hiddenSchemeCO.governStanDards },
400
+ { label: "治理方法", children: item.hiddenSchemeCO.governMethod },
401
+ { label: "经费落实", children: item.hiddenSchemeCO.expenditure },
402
+ { label: "负责人员", children: item.hiddenSchemeCO.principal },
403
+ { label: "工时安排", children: item.hiddenSchemeCO.programming },
404
+ { label: "时限要求", children: item.hiddenSchemeCO.timeLimitFor },
405
+ { label: "工作要求", children: item.hiddenSchemeCO.jobRequireMent },
406
+ { label: "其他事项", children: item.hiddenSchemeCO.otherBusiness },
407
+ { label: "方案图片", children: <PreviewImg files={rectificationPlanImageFiles[index]} /> },
408
+ ]
409
+ : []),
410
+ ]}
411
+ />
412
+ ))
413
+ }
364
414
  </>
365
415
  )
366
416
  }
367
417
  {
368
- (info.hiddenAcceptUserCO && Object.keys(info.hiddenAcceptUserCO).length > 0)
418
+ (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0)
369
419
  ? (
370
420
  info.isQualified === 1
371
421
  ? (
372
422
  <>
373
423
  <Divider orientation="left">验收信息</Divider>
374
- <Descriptions
375
- bordered
376
- column={1}
377
- labelStyle={{ width: 200 }}
378
- items={[
379
- { label: "验收部门", children: info.hiddenAcceptUserCO.deptName },
380
- { label: "验收人", children: info.hiddenAcceptUserCO.userName },
381
- { label: "验收时间", children: info.hiddenAcceptUserCO.rectificationTime },
382
- { label: "验收打回意见", children: info.hiddenAcceptUserCO.repulseCause },
383
- { label: "是否合格", children: "合格" },
384
- { label: "验收描述", children: info.hiddenAcceptUserCO.descr },
385
- { label: "验收图片", children: <PreviewImg files={acceptImageFiles} /> },
386
- ]}
387
- />
424
+ {
425
+ info.hiddenSpecialList.map((item, index) => (
426
+ <Descriptions
427
+ key={item.id}
428
+ bordered
429
+ column={1}
430
+ styles={{ label: { width: 200 } }}
431
+ items={[
432
+ { label: "验收部门", children: item.deptName },
433
+ { label: "验收人", children: item.userName },
434
+ { label: "验收时间", children: item.rectificationTime },
435
+ { label: "验收打回意见", children: item.repulseCause },
436
+ { label: "是否合格", children: "合格" },
437
+ { label: "验收描述", children: item.descr },
438
+ { label: "验收图片", children: <PreviewImg files={acceptImageFiles[index]} /> },
439
+ ]}
440
+ />
441
+ ))
442
+ }
388
443
  </>
389
444
  )
390
445
  : (
391
446
  <>
392
447
  <Divider orientation="left">验收打回信息</Divider>
393
- <Descriptions
394
- bordered
395
- column={1}
396
- labelStyle={{ width: 200 }}
397
- items={[
398
- { label: "验收部门", children: info.hiddenAcceptUserCO.deptName },
399
- { label: "验收人", children: info.hiddenAcceptUserCO.userName },
400
- { label: "验收时间", children: info.hiddenAcceptUserCO.rectificationTime },
401
- { label: "验收打回意见", children: info.hiddenAcceptUserCO.repulseCause },
402
- ]}
403
- />
448
+ {
449
+ info.hiddenSpecialList.map(item => (
450
+ <Descriptions
451
+ key={item.id}
452
+ bordered
453
+ column={1}
454
+ styles={{ label: { width: 200 } }}
455
+ items={[
456
+ { label: "验收部门", children: item.deptName },
457
+ { label: "验收人", children: item.userName },
458
+ { label: "验收时间", children: item.rectificationTime },
459
+ { label: "验收打回意见", children: item.repulseCause },
460
+ ]}
461
+ />
462
+ ))
463
+ }
404
464
  </>
405
465
  )
406
466
  )
@@ -414,7 +474,7 @@ function HiddenInfo(props) {
414
474
  <Descriptions
415
475
  bordered
416
476
  column={1}
417
- labelStyle={{ width: 200 }}
477
+ styles={{ label: { width: 200 } }}
418
478
  items={[
419
479
  { label: "验收人", children: info.hiddenInspecCO.finalCheckOr },
420
480
  { label: "验收时间", children: info.hiddenInspecCO.finalCheckTime },
@@ -51,6 +51,7 @@ const ImportFile = (props) => {
51
51
  open={visible}
52
52
  onCancel={handleClose}
53
53
  width={600}
54
+ maskClosable={false}
54
55
  footer={[
55
56
  templateUrl && (
56
57
  <Button key="export" onClick={handleExportTemplate}>
@@ -154,6 +154,7 @@ const MapSelector = (props) => {
154
154
  onCancel={handleClose}
155
155
  width={1000}
156
156
  destroyOnHidden={false}
157
+ maskClosable={false}
157
158
  afterClose={handleAfterClose}
158
159
  footer={[
159
160
  <Button key="back" onClick={handleClose}>
@@ -91,6 +91,7 @@ function Pdf(props) {
91
91
  return (
92
92
  <Modal
93
93
  open={visible}
94
+ maskClosable={false}
94
95
  width={pdfWidth + 100}
95
96
  title="PDF预览"
96
97
  onCancel={onCancel}
@@ -60,6 +60,7 @@ function Signature(props) {
60
60
  title="签字"
61
61
  width={800}
62
62
  open={signatureModalOpen}
63
+ maskClosable={false}
63
64
  onCancel={() => setSignatureModalOpen(false)}
64
65
  footer={[
65
66
  <Button key="clear" onClick={() => signatureCanvas.current.clear()}>重签</Button>,
@@ -17,7 +17,7 @@ export const HIDDEN_STATE_ENUM = [
17
17
  { bianma: "301", name: "已验收" },
18
18
  { bianma: "302", name: "验收打回" },
19
19
  { bianma: "400", name: "归档" },
20
- { bianma: "99", name: "用户暂存" },
20
+ { bianma: "99", name: "关闭" },
21
21
  { bianma: "98", name: "安全环保检查/清单排查暂存" },
22
22
  { bianma: "102", name: "安全环保检查,隐患带指派" },
23
23
  { bianma: "97", name: "已过期" },
@@ -78,7 +78,7 @@ export const UPLOAD_FILE_TYPE_ENUM = {
78
78
  145: 145, // qualified_list_inspection - 清单检查合格
79
79
  147: 147, // hidden_qualified_listInspection_signature - 隐患清单排查签字
80
80
  148: 148, // special_qualification - 相关方-专项资质
81
- 149: 149, // safety_qualification - 相关方-安全资质
81
+ 149: 149, // safety_qualification - 相关方-安全资质(弃用,全部改成使用148)
82
82
  150: 150, // promise_bookmark_photo - 安全承诺签字
83
83
  151: 151, // project_related_materials - 相关方-项目相关资料
84
84
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.138",
4
+ "version": "1.0.140",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",