feat(reports): stabilize on-demand generation, live presence and 1C fallback

This commit is contained in:
2026-09-25 13:00:11 +03:00
parent 2f8cc1bffd
commit 90656944c5
42 changed files with 13410 additions and 6778 deletions
+25 -6
View File
@@ -28,7 +28,9 @@ async function loadModals() {
'exception_modal.html',
'auth_modal.html',
'profile_modal.html',
'admin_modal.html'
'admin_modal.html',
'snapshot_inspector_modal.html',
'presence_modal.html'
];
const container = document.getElementById('modals-container');
@@ -36,7 +38,7 @@ async function loadModals() {
for (const file of modalFiles) {
try {
const res = await fetch(`/static/modals/${file}?v=2.5.8`);
const res = await fetch(`/static/modals/${file}?v=2.6.0`);
if (res.ok) {
const html = await res.text();
container.insertAdjacentHTML('beforeend', html);
@@ -99,7 +101,7 @@ async function handleLoginSubmit(e) {
AuthManager.setSession(data.token, data.username, data.full_name, data.is_admin, data.user_id);
hideAuthModal();
updateUIState();
if (window.SidebarManager) SidebarManager.setHub('TASKS');
if (window.SidebarManager) SidebarManager.switchTab('tasks');
} else {
const err = await res.json();
if (errEl) {
@@ -272,9 +274,14 @@ function openRemoteWorkerModal(mode = 'ADD', fio = '', dept = 'Все', dateFrom
const fromInput = document.getElementById("rw-date-from");
const toInput = document.getElementById("rw-date-to");
const errEl = document.getElementById("rw-error");
const suggBox = document.getElementById("rw-fio-suggestions");
if (!modal) return;
if (errEl) errEl.classList.add("hidden");
if (suggBox) {
suggBox.classList.add("hidden");
suggBox.innerHTML = "";
}
if (modeInput) modeInput.value = mode;
if (mode === 'EDIT') {
@@ -340,7 +347,7 @@ async function handleRemoteWorkerSubmit(e) {
if (res.ok) {
closeRemoteWorkerModal();
if (window.SidebarManager) SidebarManager.renderContent();
if (window.SidebarManager) SidebarManager.switchRegistrySubTab('remote');
} else {
const err = await res.json();
if (errEl) {
@@ -370,7 +377,19 @@ document.addEventListener("DOMContentLoaded", async () => {
setupStaffAutocomplete(excInput, "exception-suggestions");
}
// 3. Авто-высота поля ввода команд
// 3. Инициализация автокомплита для модалки удаленщиков
const rwFioInput = document.getElementById("rw-fio");
if (rwFioInput && typeof setupStaffAutocomplete === "function") {
setupStaffAutocomplete(rwFioInput, "rw-fio-suggestions");
}
//3.1 Автокомплит для местных командировок и иного
const maFioInput = document.getElementById("manual-absence-fio-input");
if (maFioInput && typeof setupStaffAutocomplete === "function") {
setupStaffAutocomplete(maFioInput, "manual-absence-suggestions");
}
// 4. Авто-высота поля ввода команд
const userInputEl = document.getElementById("user-input");
if (userInputEl) {
userInputEl.addEventListener("input", function() {
@@ -380,7 +399,7 @@ document.addEventListener("DOMContentLoaded", async () => {
});
}
// 4. Проверка сессии пользователя
// 5. Проверка сессии пользователя
if (IS_GUEST) {
hideAuthModal();
updateUIState();