diff --git a/static/app.js b/static/app.js index b42f66d..0a7bacf 100644 --- a/static/app.js +++ b/static/app.js @@ -466,7 +466,7 @@ function openDrawer(resource, id) { const multilineFields = ["customer_need", "current_deliverable", "risks", "next_action", "version_goal", "feature_list", "notes"]; const followupTarget = resource === "sales" ? "sales" : resource === "proposals" ? "proposal" : resource === "operations" ? "operation" : resource === "products" ? "product" : ""; const title = item.target_customer || item.project_name || item.customer_or_project_name || item.product_name; - drawer.innerHTML = `

Detail Drawer

${title}

+ drawer.innerHTML = `

Detail Drawer

${title}

属性

@@ -568,6 +568,16 @@ function bindDrawerAutosave(resource, id, item) { window.openDrawer = openDrawer; +window.deleteOperation = async (id) => { + if (!confirm("确认删除该项目?此操作不可撤销。")) return; + try { + await api(`/api/operations/${id}`, { method: "DELETE" }); + closeDrawer(); + await load(); + } catch (error) { + alert("删除失败:" + error.message); + } +}; window.closeDrawer = () => document.querySelector("#drawer").classList.remove("open"); window.squireInstances = {}; window.squireCmd = (cmd) => {