fix(回归优化): 修复浏览器回归并优化内存
build.yaml / build (push) Successful in 49s

This commit is contained in:
xiaoqidun committed 2026-10-21 18:28:57 +08:00
1 parent 974b515374
commit 67f4cf9d2c
13 files changed
+401 -44

No files matched your search

+7 -2
View File
@@ -7687,13 +7687,18 @@ function chooseResourceFile(action) {
async function changeManagedResource(action, item, file) {
if (!item || !state.editing) return;
releaseResourcePreview();
const page = Number(resourceElements.Page.value), object = resourceElements.Object.value;
const format = file?.name.includes(".") ? file.name.split(".").at(-1).toUpperCase() : "";
const changed = item.kind === "Attachment" && action !== "bind" && action !== "unbind"
? await changeDocument("ofdgoChangeAttachment", null, action, item.id, file ? [file.name] : [], file ? [file] : [])
: await changeDocument("ofdgoChangeResource", null, action, item.kind, item.id, format, file || null, Number(resourceElements.Page.value), resourceElements.Object.value);
: await changeDocument("ofdgoChangeResource", null, action, item.kind, item.id, format, file || null, page, object);
if (changed) {
await loadManagedResources();
if (action === "bind" || action === "unbind") resourceElements.Status.textContent = action === "bind" ? "已绑定" : "已解绑";
if (action === "bind" || action === "unbind") {
resourceElements.Page.value = String(page);
await loadResourceTargets(object);
resourceElements.Status.textContent = action === "bind" ? "已绑定" : "已解绑";
}
}
}