// 全局变量,用于保存当前选中的节点数据 let selectedNodeData = null; // 动态加载节点树数据 async function loadNodeTree(task_id) { // 清空选中状态 selectedNodeData = null; //刷新界面内容 update_select_node_data_show("-","-","-","-","-","-",false) try { const res = await fetch("/api/task/gettree", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ task_id }), //task_id:task_id }); if (!res.ok) { const errorData = await res.json(); throw new Error(errorData.error || `HTTP错误 ${res.status}`); } const data = await res.json(); const treeData = data.tree; if (!treeData) { document.getElementById("treeContent").innerHTML = "

无节点数据

"; return; } // 创建一个