更新了网页查看products.db时的界面

This commit is contained in:
2025-12-01 21:07:30 +08:00
parent 9026aa8f4b
commit c2836428ca
7 changed files with 169 additions and 23 deletions

View File

@@ -848,10 +848,10 @@ def create_html_template():
analyzeBtn.disabled = false;
analyzeBtn.textContent = '📊 分析缺失分数';
}
}
document.getElementById('searchField').addEventListener('change', loadData);
document.getElementById('searchValue').addEventListener('input', debounce(loadData, 500));
});
// 防抖函数
function debounce(func, wait) {
@@ -972,11 +972,15 @@ def create_html_template():
// 数据行
data.rows.forEach(row => {
html += '<tr>';
row.forEach(cell => {
row.forEach((cell, index) => {
const colName = data.columns[index];
if (cell.type === 'multiline') {
html += `<td><div class="multiline-cell">${escapeHtml(cell.value)}</div></td>`;
} else if (cell.type === 'empty') {
html += '<td><div class="empty-cell">空</div></td>';
} else if (colName === 'product_link' && cell.value) {
// 渲染为链接
html += `<td><div class="normal-cell"><a href="${escapeHtml(cell.value)}" target="_blank" rel="noopener noreferrer">${escapeHtml(cell.value)}</a></div></td>`;
} else {
html += `<td><div class="normal-cell">${escapeHtml(cell.value)}</div></td>`;
}