zy-react-library 1.0.110 → 1.0.112

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.
@@ -1,5 +1,5 @@
1
1
  import { request } from "@cqsjjb/jjb-common-lib/http";
2
- import {Button, Descriptions, Divider, Space, Spin} from "antd";
2
+ import { Button, Descriptions, Divider, Space, Spin } from "antd";
3
3
  import dayjs from "dayjs";
4
4
  import { useEffect, useState } from "react";
5
5
  import { HIDDEN_SOURCE_ENUM, HIDDEN_STATE_ENUM } from "../../../enum/hidden/gwj";
@@ -52,26 +52,36 @@ function HiddenInfo(props) {
52
52
  setLoading(false);
53
53
  onGetData?.(res.data);
54
54
  });
55
+
55
56
  const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["3"], eqForeignKey: hiddenId || query[hiddenIdKey] });
56
57
  setHiddenImageFiles(hiddenImageFiles);
57
58
  const hiddenVideoFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["102"], eqForeignKey: hiddenId || query[hiddenIdKey] });
58
59
  setHiddenVideoFiles(hiddenVideoFiles);
59
- const afterRectificationImageFiles = await getFile({
60
- eqType: UPLOAD_FILE_TYPE_ENUM["4"],
61
- eqForeignKey: hiddenId || query[hiddenIdKey],
62
- });
63
- setAfterRectificationImageFiles(afterRectificationImageFiles);
64
- const rectificationPlanImageFiles = await getFile({
65
- eqType: UPLOAD_FILE_TYPE_ENUM["8"],
66
- eqForeignKey: hiddenId || query[hiddenIdKey],
67
- });
68
- setRectificationPlanImageFiles(rectificationPlanImageFiles);
69
- const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || query[hiddenIdKey] });
70
- setAcceptImageFiles(acceptImageFiles);
60
+
61
+ if (info.hiddenRectifyUserCO && Object.keys(info.hiddenRectifyUserCO).length > 0) {
62
+ const afterRectificationImageFiles = await getFile({
63
+ eqType: UPLOAD_FILE_TYPE_ENUM["4"],
64
+ eqForeignKey: hiddenId || query[hiddenIdKey],
65
+ });
66
+ setAfterRectificationImageFiles(afterRectificationImageFiles);
67
+
68
+ if ((info.hiddenRectifyUserCO.isRectificationScheme === 1 && info.hiddenRectifyUserCO.hiddenSchemeCO && Object.keys(info.hiddenRectifyUserCO.hiddenSchemeCO).length > 0)) {
69
+ const rectificationPlanImageFiles = await getFile({
70
+ eqType: UPLOAD_FILE_TYPE_ENUM["8"],
71
+ eqForeignKey: hiddenId || query[hiddenIdKey],
72
+ });
73
+ setRectificationPlanImageFiles(rectificationPlanImageFiles);
74
+ }
75
+ }
76
+
77
+ if (info.isQualified === 1 && (info.hiddenAcceptUserCO && Object.keys(info.hiddenAcceptUserCO).length > 0)) {
78
+ const acceptImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["5"], eqForeignKey: hiddenId || query[hiddenIdKey] });
79
+ setAcceptImageFiles(acceptImageFiles);
80
+ }
71
81
  };
72
82
  useEffect(() => {
73
83
  getData();
74
- }, []);
84
+ }, [props.id, props.hiddenId]);
75
85
 
76
86
  return (
77
87
  <div>
@@ -89,18 +99,18 @@ function HiddenInfo(props) {
89
99
  { label: "隐患级别", children: info.hiddenLevelName },
90
100
  { label: "隐患状态", children: getLabelName({ list: HIDDEN_STATE_ENUM, status: info.state }) },
91
101
  { label: "隐患描述", children: info.hiddenDesc },
92
- { label: "隐患部位", children: info.hiddenPart },
102
+ { label: "隐患部位", children: info.hiddenPartName },
93
103
  ...(
94
104
  (info.source === 2 || info.source === 3) && (info.hiddenCheckListCO && Object.keys(info.hiddenCheckListCO).length > 0)
95
- ? [
96
- { label: "风险点(单元)", children: info.hiddenCheckListCO.listRiskPoints },
97
- { label: "辨识部位", children: info.hiddenCheckListCO.identifiedLocations },
98
- { label: "存在风险", children: info.hiddenCheckListCO.existingRisks },
99
- { label: "风险分级", children: info.hiddenCheckListCO.riskLevel },
100
- { label: "隐患清单", children: info.hiddenCheckListCO.listName },
101
- { label: "检查内容", children: info.hiddenCheckListCO.inspectionContent },
102
- ]
103
- : []
105
+ ? [
106
+ { label: "风险点(单元)", children: info.hiddenCheckListCO.listRiskPoints },
107
+ { label: "辨识部位", children: info.hiddenCheckListCO.identifiedLocations },
108
+ { label: "存在风险", children: info.hiddenCheckListCO.existingRisks },
109
+ { label: "风险分级", children: info.hiddenCheckListCO.riskLevel },
110
+ { label: "隐患清单", children: info.hiddenCheckListCO.listName },
111
+ { label: "检查内容", children: info.hiddenCheckListCO.inspectionContent },
112
+ ]
113
+ : []
104
114
  ),
105
115
  {
106
116
  label: "隐患上报位置(经纬度)",
@@ -1,11 +1,8 @@
1
- /**
2
- * useIsExistenceDuplicateSelection 钩子的选项参数
3
- */
4
- interface UseIsExistenceDuplicateSelectionOptions<T> {
1
+ interface IsExistenceDuplicateSelectionOptions<T> {
5
2
  /** 需要检查重复项的目标数组 */
6
3
  data: T[];
7
4
  /** 用于去重判断的对象属性名 */
8
- key: keyof T;
5
+ key: keyof T | string;
9
6
  /** 可选的错误提示信息 */
10
7
  message?: string;
11
8
  }
@@ -14,12 +11,12 @@ interface UseIsExistenceDuplicateSelectionOptions<T> {
14
11
  * 检查数组中是否存在重复项的函数
15
12
  */
16
13
  interface IsExistenceDuplicateSelectionFunction {
17
- <T>(options: UseIsExistenceDuplicateSelectionOptions<T>): Promise<void>;
14
+ <T>(options: IsExistenceDuplicateSelectionOptions<T>): Promise<void>;
18
15
  }
19
16
 
20
17
  /**
21
18
  * 检查数组中是否存在重复项
22
19
  */
23
- export default function useIsExistenceDuplicateSelection(): {
24
- isExistenceDuplicateSelection: IsExistenceDuplicateSelectionFunction
20
+ export default function useIsExistenceDuplicateSelection(): {
21
+ isExistenceDuplicateSelection: IsExistenceDuplicateSelectionFunction;
25
22
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zy-react-library",
3
3
  "private": false,
4
- "version": "1.0.110",
4
+ "version": "1.0.112",
5
5
  "type": "module",
6
6
  "description": "",
7
7
  "author": "LiuJiaNan",