zy-react-library 1.0.99 → 1.0.101
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,6 +1,6 @@
|
|
|
1
1
|
import { Button, Image, message, Modal } from "antd";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
|
-
import { useRef, useState } from "react";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import SignatureCanvas from "react-signature-canvas";
|
|
5
5
|
import { base642File } from "../../utils";
|
|
6
6
|
|
|
@@ -12,12 +12,16 @@ function Signature(props) {
|
|
|
12
12
|
onConfirm,
|
|
13
13
|
width = 752,
|
|
14
14
|
height = 300,
|
|
15
|
+
url = "",
|
|
15
16
|
...restProps
|
|
16
17
|
} = props;
|
|
17
18
|
|
|
18
19
|
const [signatureModalOpen, setSignatureModalOpen] = useState(false);
|
|
19
20
|
const signatureCanvas = useRef(null);
|
|
20
21
|
const [base64, setBase64] = useState("");
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setBase64(url);
|
|
24
|
+
}, [url]);
|
|
21
25
|
|
|
22
26
|
const onOk = () => {
|
|
23
27
|
if (signatureCanvas.current.isEmpty()) {
|
|
@@ -49,7 +53,7 @@ function Signature(props) {
|
|
|
49
53
|
</div>
|
|
50
54
|
{base64 && (
|
|
51
55
|
<div style={{ border: "1px dashed #d9d9d9", width, height, marginTop: 16 }}>
|
|
52
|
-
<Image src={base64} />
|
|
56
|
+
<Image src={base64} style={{ width, height, objectFit: "contain" }} />
|
|
53
57
|
</div>
|
|
54
58
|
)}
|
|
55
59
|
<Modal
|
|
@@ -65,6 +65,8 @@ export const UPLOAD_FILE_TYPE_ENUM = {
|
|
|
65
65
|
136: 136,
|
|
66
66
|
137: 137,
|
|
67
67
|
138: 138,
|
|
68
|
+
139: 139,
|
|
69
|
+
140: 140,
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
/**
|
|
@@ -134,4 +136,6 @@ export const UPLOAD_FILE_PATH_ENUM = {
|
|
|
134
136
|
136: "accident_incident",
|
|
135
137
|
137: "accident_incident",
|
|
136
138
|
138: "hidden_disposal_plan",
|
|
139
|
+
139: "safety_environmental_inspection_inspection_signature",
|
|
140
|
+
140: "safety_environmental_inspection_inspection_situation",
|
|
137
141
|
};
|