- Включено множественное выделение строк (selectableRows: true) - Исправлен размер шрифта в ячейках при редактировании (добавлены CSS стили для tabulator-cell input) - Улучшено визуальное отображение редактируемых ячеек - Обновлена логика удаления для работы с множественным выбором
161 lines
4.2 KiB
HTML
161 lines
4.2 KiB
HTML
<!doctype html>
|
|
<html lang="ru">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Turbo RFQ</title>
|
|
|
|
<!-- Tabulator CSS/JS (CDN) -->
|
|
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet">
|
|
<script src="https://unpkg.com/tabulator-tables@6.3.0/dist/js/tabulator.min.js"></script>
|
|
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
font-family: sans-serif;
|
|
display: flex;
|
|
height: 100vh;
|
|
overflow: hidden;
|
|
}
|
|
#sidebar {
|
|
width: 250px;
|
|
border-right: 1px solid #ccc;
|
|
padding: 8px;
|
|
box-sizing: border-box;
|
|
overflow-y: auto;
|
|
flex-shrink: 0;
|
|
}
|
|
#main {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
}
|
|
#toolbar {
|
|
padding: 8px;
|
|
border-bottom: 1px solid #ccc;
|
|
flex-shrink: 0;
|
|
}
|
|
#table {
|
|
flex: 1;
|
|
position: relative;
|
|
overflow: auto;
|
|
min-height: 0;
|
|
}
|
|
.schema { font-weight: bold; margin-top: 8px; cursor: pointer; }
|
|
.table { margin-left: 12px; cursor: pointer; }
|
|
#loginPanel {
|
|
padding: 8px;
|
|
border-bottom: 1px solid #ccc;
|
|
background: #f7f7f7;
|
|
flex-shrink: 0;
|
|
}
|
|
#csvFileInput { display: none; }
|
|
|
|
/* ✅ Стили для Tabulator */
|
|
.tabulator {
|
|
border: none;
|
|
background-color: white;
|
|
}
|
|
|
|
.tabulator .tabulator-header {
|
|
background-color: #f5f5f5;
|
|
border-bottom: 2px solid #ddd;
|
|
}
|
|
|
|
.tabulator .tabulator-tableholder {
|
|
overflow-x: auto !important;
|
|
}
|
|
|
|
/* ✅ ИСПРАВЛЕНИЕ: Размер шрифта при редактировании ячеек */
|
|
.tabulator-cell input,
|
|
.tabulator-cell select,
|
|
.tabulator-cell textarea {
|
|
font-size: 14px !important;
|
|
font-family: sans-serif !important;
|
|
padding: 4px !important;
|
|
border: 1px solid #4CAF50 !important;
|
|
box-sizing: border-box !important;
|
|
width: 100% !important;
|
|
min-height: 24px !important;
|
|
}
|
|
|
|
.tabulator-cell input:focus,
|
|
.tabulator-cell select:focus,
|
|
.tabulator-cell textarea:focus {
|
|
outline: none !important;
|
|
border-color: #45a049 !important;
|
|
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2) !important;
|
|
}
|
|
|
|
/* ✅ Стили для выделенных строк */
|
|
.tabulator-row.tabulator-selected {
|
|
background-color: #d4e9ff !important;
|
|
}
|
|
|
|
.tabulator-row.tabulator-selected:hover {
|
|
background-color: #c0dcf5 !important;
|
|
}
|
|
|
|
/* ✅ Стили для модальных окон FK */
|
|
.fk-modal {
|
|
font-family: sans-serif;
|
|
}
|
|
|
|
.fk-modal select,
|
|
.fk-modal input {
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.fk-modal select:focus,
|
|
.fk-modal input:focus {
|
|
outline: none;
|
|
border-color: #4CAF50;
|
|
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
|
|
}
|
|
|
|
.fk-modal button:hover {
|
|
opacity: 0.9;
|
|
}
|
|
|
|
/* ✅ Подсказка для множественного выбора */
|
|
#toolbar::after {
|
|
content: "💡 Используйте Ctrl+Click для выбора нескольких строк";
|
|
display: inline-block;
|
|
margin-left: 20px;
|
|
font-size: 12px;
|
|
color: #666;
|
|
font-style: italic;
|
|
}
|
|
</style>
|
|
|
|
|
|
</head>
|
|
<body>
|
|
<div id="sidebar">
|
|
<h3>Базы / таблицы</h3>
|
|
<div id="tree"></div>
|
|
</div>
|
|
<div id="main">
|
|
<div id="loginPanel">
|
|
<label>Login: <input id="loginUser" type="text"></label>
|
|
<label>Password: <input id="loginPass" type="password"></label>
|
|
<button id="loginBtn">Войти</button>
|
|
<span id="loginStatus"></span>
|
|
</div>
|
|
<div id="toolbar">
|
|
<button id="btnInsert">Вставить</button>
|
|
<button id="btnUpdate">Сохранить строку</button>
|
|
<button id="btnDelete">Удалить</button>
|
|
<button id="btnDeselectAll">Снять выделение</button> <!-- ✅ Новая кнопка -->
|
|
<button id="btnImportCSV">Импорт CSV</button>
|
|
<input type="file" id="csvFileInput" accept=".csv">
|
|
<button id="btnExportCSV">Экспорт CSV</button>
|
|
</div>
|
|
<div id="table"></div>
|
|
</div>
|
|
|
|
<script src="app.js"></script>
|
|
</body>
|
|
</html> |