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

签章组件完善

上级 b9e5cd34
...@@ -20,7 +20,8 @@ export default function PictureSignature({ ...@@ -20,7 +20,8 @@ export default function PictureSignature({
...others ...others
}) { }) {
let imageRef = useRef(); let imageRef = useRef();
const [fileInfo, setFileInfo] = useState(others?.fileInfo); // const [fileInfo, setFileInfo] = useState(others?.fileInfo);
const [fileInfo, setFileInfo] = useState(fakeFileInfo);
const [openEdit, setOpenEdit] = useState(false); const [openEdit, setOpenEdit] = useState(false);
const [showModal, setShowModal] = useState(false); const [showModal, setShowModal] = useState(false);
const [otherProps, setOtherProps] = useState({}); const [otherProps, setOtherProps] = useState({});
...@@ -71,7 +72,12 @@ export default function PictureSignature({ ...@@ -71,7 +72,12 @@ export default function PictureSignature({
apiRequest('/ImageLibApi/merge', { apiRequest('/ImageLibApi/merge', {
background: fileInfo?.path, background: fileInfo?.path,
content: JSON.stringify({ content: JSON.stringify({
objs: otherProps.signConfig, objs: otherProps.signConfig.map((g) => {
if(g.type === 'text'){
g.y = g.y + g.fontSize;
}
return g;
}),
}), }),
}).then((res) => { }).then((res) => {
if (res && res.path) { if (res && res.path) {
......
...@@ -13,6 +13,7 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => { ...@@ -13,6 +13,7 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => {
cursor: 'pointer', cursor: 'pointer',
width: otherInfo.w, width: otherInfo.w,
height: otherInfo.h, height: otherInfo.h,
zIndex: otherInfo.index || 1,
}} }}
/> />
); );
...@@ -28,6 +29,7 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => { ...@@ -28,6 +29,7 @@ const ShowItem = ({ basicUrl, type, x, y, ...otherInfo }) => {
fontFamily: otherInfo?.fontFamily ? otherInfo.fontFamily : undefined, fontFamily: otherInfo?.fontFamily ? otherInfo.fontFamily : undefined,
fontWeight: otherInfo?.fontStyle ? otherInfo.fontStyle : undefined, fontWeight: otherInfo?.fontStyle ? otherInfo.fontStyle : undefined,
color: otherInfo?.color ? otherInfo.color : undefined, color: otherInfo?.color ? otherInfo.color : undefined,
zIndex: otherInfo.index || 1,
}} }}
> >
{otherInfo.word} {otherInfo.word}
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
border: 1px solid red; border: 1px solid red;
p{ p{
margin-bottom: 0; margin-bottom: 0;
user-select: none;
} }
} }
.modalParentDiv{ .modalParentDiv{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论