v1.0.175: общее сравнение → compareCard, diffBody только для групп
This commit is contained in:
+17
-17
@@ -401,7 +401,7 @@ window.runCompareForGroup = async function(gi) {
|
|||||||
var body = sec.querySelector('.diff-section-body');
|
var body = sec.querySelector('.diff-section-body');
|
||||||
body.style.display = body.style.display === 'none' ? 'block' : 'none';
|
body.style.display = body.style.display === 'none' ? 'block' : 'none';
|
||||||
});
|
});
|
||||||
diffBody.appendChild(sec);
|
compareBody.appendChild(sec);
|
||||||
sections[d.supplement_id] = sec;
|
sections[d.supplement_id] = sec;
|
||||||
}
|
}
|
||||||
else if (d.type === 'llm_done') {
|
else if (d.type === 'llm_done') {
|
||||||
@@ -501,16 +501,16 @@ document.getElementById('llmBtn').addEventListener('click', function() {
|
|||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
btn.innerHTML = '<span class="spinner"></span> Сравнение...';
|
btn.innerHTML = '<span class="spinner"></span> Сравнение...';
|
||||||
|
|
||||||
var diffCard = document.getElementById('diffCard');
|
var compareCard = document.getElementById('compareCard');
|
||||||
var diffBody = document.getElementById('diffBody');
|
var compareBody = document.getElementById('compareBody');
|
||||||
var diffStatus = document.getElementById('diffStatus');
|
var compareStatus = document.getElementById('compareStatus');
|
||||||
diffCard.style.display = 'block';
|
compareCard.style.display = 'block';
|
||||||
diffBody.innerHTML = '';
|
compareBody.innerHTML = '';
|
||||||
diffStatus.textContent = '⏳ 0.0с';
|
compareStatus.textContent = '⏳ 0.0с';
|
||||||
|
|
||||||
var llmStart = Date.now();
|
var llmStart = Date.now();
|
||||||
var timerInterval = setInterval(function() {
|
var timerInterval = setInterval(function() {
|
||||||
diffStatus.textContent = '⏳ ' + ((Date.now() - llmStart) / 1000).toFixed(1) + 'с';
|
compareStatus.textContent = '⏳ ' + ((Date.now() - llmStart) / 1000).toFixed(1) + 'с';
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
var order = fileQueue.map(function(f) { return f.supp_id; }).filter(Boolean).join(',');
|
var order = fileQueue.map(function(f) { return f.supp_id; }).filter(Boolean).join(',');
|
||||||
@@ -528,7 +528,7 @@ document.getElementById('llmBtn').addEventListener('click', function() {
|
|||||||
var body = sec.querySelector('.diff-section-body');
|
var body = sec.querySelector('.diff-section-body');
|
||||||
body.style.display = body.style.display === 'none' ? 'block' : 'none';
|
body.style.display = body.style.display === 'none' ? 'block' : 'none';
|
||||||
});
|
});
|
||||||
diffBody.appendChild(sec);
|
compareBody.appendChild(sec);
|
||||||
sections[d.supplement_id] = sec;
|
sections[d.supplement_id] = sec;
|
||||||
}
|
}
|
||||||
else if (d.type === 'llm_done') {
|
else if (d.type === 'llm_done') {
|
||||||
@@ -562,16 +562,16 @@ document.getElementById('llmBtn').addEventListener('click', function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (d.type === 'extract_error' || d.type === 'apply_error') {
|
else if (d.type === 'extract_error' || d.type === 'apply_error') {
|
||||||
diffBody.innerHTML += '<div style="font-size:12px;color:var(--destructive);">✗ ' + d.filename + ': ' + d.error + '</div>';
|
compareBody.innerHTML += '<div style="font-size:12px;color:var(--destructive);">✗ ' + d.filename + ': ' + d.error + '</div>';
|
||||||
}
|
}
|
||||||
else if (d.type === 'done') {
|
else if (d.type === 'done') {
|
||||||
clearInterval(timerInterval);
|
clearInterval(timerInterval);
|
||||||
es.close();
|
es.close();
|
||||||
diffStatus.textContent = '✓ ' + d.total_time_s + 'с';
|
compareStatus.textContent = '✓ ' + d.total_time_s + 'с';
|
||||||
btn.innerHTML = '<i data-lucide="check" style="width:16px;height:16px;"></i> ✓ Готово';
|
btn.innerHTML = '<i data-lucide="check" style="width:16px;height:16px;"></i> ✓ Готово';
|
||||||
stepDone('stepCompare');
|
stepDone('stepCompare');
|
||||||
if (d.total_unresolved > 0) {
|
if (d.total_unresolved > 0) {
|
||||||
diffBody.innerHTML += '<div style="margin-top:8px;color:#eab308;">⚠ ' + d.total_unresolved + ' неразрешённых строк — <a href="/resolve.cfm?contract_id=' + contractId + '">разобрать</a></div>';
|
compareBody.innerHTML += '<div style="margin-top:8px;color:#eab308;">⚠ ' + d.total_unresolved + ' неразрешённых строк — <a href=\"/resolve.cfm?contract_id=' + contractId + '\">разобрать</a></div>';
|
||||||
}
|
}
|
||||||
document.getElementById('chatCard').style.display = 'block';
|
document.getElementById('chatCard').style.display = 'block';
|
||||||
lucide.createIcons();
|
lucide.createIcons();
|
||||||
@@ -579,8 +579,8 @@ document.getElementById('llmBtn').addEventListener('click', function() {
|
|||||||
else if (d.type === 'error') {
|
else if (d.type === 'error') {
|
||||||
clearInterval(timerInterval);
|
clearInterval(timerInterval);
|
||||||
es.close();
|
es.close();
|
||||||
diffBody.innerHTML += '<div style="color:var(--destructive);margin-top:8px;">✗ ' + d.message + '</div>';
|
compareBody.innerHTML += '<div style=\"color:var(--destructive);margin-top:8px;\">✗ ' + d.message + '</div>';
|
||||||
btn.innerHTML = '<i data-lucide="scale" style="width:16px;height:16px;"></i> Общее сравнение';
|
btn.innerHTML = '<i data-lucide=\"scale\" style=\"width:16px;height:16px;\"></i> Общее сравнение';
|
||||||
btn.disabled = false;
|
btn.disabled = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -588,10 +588,10 @@ document.getElementById('llmBtn').addEventListener('click', function() {
|
|||||||
es.onerror = function() {
|
es.onerror = function() {
|
||||||
clearInterval(timerInterval);
|
clearInterval(timerInterval);
|
||||||
es.close();
|
es.close();
|
||||||
if (diffBody.innerHTML === '') {
|
if (compareBody.innerHTML === '') {
|
||||||
diffBody.innerHTML = '<div style="color:var(--destructive);">✗ Ошибка соединения</div>';
|
compareBody.innerHTML = '<div style=\"color:var(--destructive);\">✗ Ошибка соединения</div>';
|
||||||
}
|
}
|
||||||
btn.innerHTML = '<i data-lucide="scale" style="width:16px;height:16px;"></i> Общее сравнение';
|
btn.innerHTML = '<i data-lucide=\"scale\" style=\"width:16px;height:16px;\"></i> Общее сравнение';
|
||||||
btn.disabled = false;
|
btn.disabled = false;
|
||||||
lucide.createIcons();
|
lucide.createIcons();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user