From 5c4fe533c1c6151f78a86d7a9b6faf65d426dd68 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Wed, 2 Jul 2025 15:30:38 +0800 Subject: [PATCH] 'commit' --- dsRag/static/tree.html | 81 +++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/dsRag/static/tree.html b/dsRag/static/tree.html index 078bf987..0d48a86d 100644 --- a/dsRag/static/tree.html +++ b/dsRag/static/tree.html @@ -48,7 +48,21 @@ margin-right: 5px; } - + #treeTable th:nth-child(4), #treeTable td:nth-child(4) { + width: 220px; + min-width: 220px; + max-width: 220px; + text-align: center; + border-right: 1px solid #ddd; /* 确保右侧边框闭合 */ + } + + #treeTable td:nth-child(4) { + display: flex; + justify-content: center; + gap: 5px; + min-height: 36px; /* 确保空单元格也有高度 */ + } +
知识点 | 先修知识 | 相关知识 | +维护 | @@ -112,17 +127,19 @@ // 修改后的维护按钮显示逻辑 const isThirdLevel = node.parent_id && allNodes.find(n => n.id === node.parent_id)?.parent_id; - html += '' + (node.prerequisite && node.prerequisite.length > 0 ? - node.prerequisite.map(p => p.title).join(', ') : '') + - (isThirdLevel ? '' : '') + ' | '; - html += '' + (node.related || '') + - (isThirdLevel ? '' : '') + ' | '; + html += '' + (node.prerequisite && node.prerequisite.length > 0 ? + node.prerequisite.map(p => p.title).join(', ') : '') + ' | '; + html += '' + (node.related || '') + ' | '; + html += '' + (isThirdLevel ? + ' ' + + '' : '') + ' | '; html += ''; if (node.open && node.children && node.children.length > 0) { buildRows(node.children, level + 1); } } } + buildRows(treeData); $("#treeBody").html(html); } @@ -158,35 +175,35 @@ // 修改prerequisiteUpdate和relatedUpdate函数 // 修改prerequisiteUpdate函数使用LayUI function prerequisiteUpdate(nodeId) { - layui.use(['layer', 'form'], function(){ + layui.use(['layer', 'form'], function () { var layer = layui.layer; var form = layui.form; - + // 获取当前节点 const currentNode = findNodeById(treeData, nodeId); - + // 构建HTML内容 let html = '
---|