提交 4edaec0b authored 作者: 钟是志's avatar 钟是志

签章组件修改

上级 eb5b7caf
......@@ -80,27 +80,13 @@ export default function PictureSignature({
...others
}) {
let imageRef = useRef();
const [fileInfo, setFileInfo] = useState({ });
const [fileInfo, setFileInfo] = useState({});
// const [fileInfo, setFileInfo] = useState(fakeFileInfo);
const [openEdit, setOpenEdit] = useState(false);
const [originSignConfig, setOriginConfig] = useState([]);
const [showModal, setShowModal] = useState(false);
const [otherProps, setOtherProps] = useState({});
const [imageInfo, setImageInfo] = useState(null);
useEffect(() => {
let fileInfo = {};
if(others?.fileInfo?.originPath){
setFileInfo({
...others?.fileInfo,
path: others?.fileInfo?.originPath,
})
}else{
setFileInfo({...others?.fileInfo});
}
}, []);
const changeShowModal = () => {
if (!showModal) {
if (!imageInfo && !disabled) {
......@@ -126,6 +112,8 @@ export default function PictureSignature({
};
// console.log(json);
useEffect(() => {
if (otherProps?.signConfig && !imageRef?.current) {
imageRef.current = true;
......@@ -133,6 +121,12 @@ export default function PictureSignature({
}
}, [otherProps]);
useEffect(() => {
setFileInfo({
...others?.fileInfo,
})
}, [others?.fileInfo]);
useEffect(() => {
if (json.otherProps) {
try {
......@@ -287,7 +281,7 @@ export default function PictureSignature({
if (!fileInfo) {
return null;
}
// console.log(imageInfo, fileInfo);
console.log(imageInfo, fileInfo);
return (
<div className={styles.outSideDiv}>
{fileInfo && fileInfo?.path && (
......@@ -298,8 +292,7 @@ export default function PictureSignature({
onClick={changeShowModal}
/>
)}
{showModal &&
(
{showModal && (
<Modal
visible={true}
destroyOnClose={true}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论