This commit is contained in:
Vanessa 2024-12-12 11:12:44 +08:00
parent 923d4b8c1f
commit 6598230112

View file

@ -197,8 +197,11 @@ export const initAnno = (element: HTMLElement, pdf: any) => {
} else if (type === "remove") {
const urlPath = pdf.appConfig.file.replace(location.origin, "").substr(1);
const config = getConfig(pdf);
delete config[rectElement.getAttribute("data-node-id")];
rectElement.remove();
const id = rectElement.getAttribute("data-node-id")
delete config[id];
element.querySelectorAll(`[data-node-id="${id}"]`).forEach(item => {
item.remove();
});
fetchPost("/api/asset/setFileAnnotation", {
path: urlPath + ".sya",
data: JSON.stringify(config),