Разделение app.js на модули
- core.js: API wrapper и утилиты (~150 строк) - user.js: авторизация и localStorage (~240 строк) - table.js: дерево и Tabulator (~770 строк) - operations.js: CRUD операции (~740 строк) - io.js: импорт/экспорт CSV и бэкап (~600 строк) - app.js: точка входа (~30 строк) Старый файл сохранён как app.js.bak Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
27
public/js/app.js
Normal file
27
public/js/app.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// ===== APP.JS - Точка входа =====
|
||||
console.log('🚀 TurboRFQ загружается...');
|
||||
|
||||
// Глобальные переменные
|
||||
let currentSchema = null;
|
||||
let currentTable = null;
|
||||
let currentMeta = null;
|
||||
let table = null;
|
||||
let enterHandler = null;
|
||||
let selectedRowsDataGlobal = new Map();
|
||||
|
||||
// Перехватываем все ошибки
|
||||
window.addEventListener('error', function(e) {
|
||||
console.error('❌ ГЛОБАЛЬНАЯ ОШИБКА:', e.message, e.filename, e.lineno);
|
||||
});
|
||||
|
||||
// Инициализация приложения при загрузке DOM
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('📦 DOM загружен, инициализация модулей...');
|
||||
|
||||
// Инициализируем обработчики
|
||||
initUserHandlers(); // user.js
|
||||
initOperationsHandlers(); // operations.js
|
||||
initIOHandlers(); // io.js
|
||||
|
||||
console.log('✅ TurboRFQ готов к работе');
|
||||
});
|
||||
Reference in New Issue
Block a user