Spaces:
Running
Running
File size: 32,792 Bytes
d514a39 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | <!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Конструктор ИТС - Веб-онтология транспортных систем России</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.ontology-node {
transition: all 0.3s ease;
}
.ontology-node:hover {
transform: translateY(-3px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.equipment-card {
transition: all 0.2s ease;
}
.equipment-card:hover {
transform: scale(1.02);
}
#ontology-visualization {
height: 600px;
background-color: #f8fafc;
border-radius: 0.5rem;
overflow: hidden;
}
.connection-line {
stroke: #94a3b8;
stroke-width: 2;
stroke-dasharray: 5, 5;
}
.drag-handle {
cursor: move;
}
.selected-equipment {
border-left: 4px solid #3b82f6;
}
[data-tooltip] {
position: relative;
}
[data-tooltip]:hover:after {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: #1e293b;
color: white;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
white-space: nowrap;
z-index: 100;
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<header class="bg-blue-800 text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div>
<h1 class="text-3xl font-bold">Конструктор ИТС</h1>
<p class="text-blue-200">Веб-онтология транспортных систем России</p>
</div>
<div class="flex space-x-4">
<button class="bg-blue-700 hover:bg-blue-600 px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-save mr-2"></i> Сохранить проект
</button>
<button class="bg-blue-600 hover:bg-blue-500 px-4 py-2 rounded-lg flex items-center">
<i class="fas fa-share-alt mr-2"></i> Экспорт
</button>
</div>
</div>
</div>
</header>
<main class="container mx-auto px-4 py-8">
<div class="grid grid-cols-1 lg:grid-cols-4 gap-8">
<!-- Боковая панель с оборудованием -->
<div class="lg:col-span-1 bg-white p-6 rounded-xl shadow-md">
<h2 class="text-xl font-semibold mb-4 text-gray-800 border-b pb-2">Оборудование ИТС</h2>
<!-- Фильтры -->
<div class="mb-6">
<div class="relative mb-4">
<input type="text" placeholder="Поиск оборудования..." class="w-full pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<div class="space-y-2">
<div class="flex items-center">
<input type="checkbox" id="filter-1" class="mr-2" checked>
<label for="filter-1">Дорожное оборудование</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="filter-2" class="mr-2" checked>
<label for="filter-2">Транспортные средства</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="filter-3" class="mr-2" checked>
<label for="filter-3">Центры управления</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="filter-4" class="mr-2" checked>
<label for="filter-4">Коммуникации</label>
</div>
</div>
</div>
<!-- Категории оборудования -->
<div class="space-y-4">
<div class="equipment-category">
<h3 class="font-medium text-gray-700 mb-2 flex items-center justify-between">
<span>Детекторы транспорта</span>
<i class="fas fa-chevron-down text-sm"></i>
</h3>
<div class="space-y-2 pl-4">
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="detector" data-id="induction-loop">
<div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-magnet text-blue-600"></i>
</div>
<div>
<p class="font-medium">Индукционная петля</p>
<p class="text-xs text-gray-500">ИП-12, ИП-24</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="detector" data-id="radar">
<div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-broadcast-tower text-blue-600"></i>
</div>
<div>
<p class="font-medium">Радарный детектор</p>
<p class="text-xs text-gray-500">РД-5, РД-10</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="detector" data-id="video">
<div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-video text-blue-600"></i>
</div>
<div>
<p class="font-medium">Видеодетектор</p>
<p class="text-xs text-gray-500">ВД-4К, ВД-8К</p>
</div>
</div>
</div>
</div>
<div class="equipment-category">
<h3 class="font-medium text-gray-700 mb-2 flex items-center justify-between">
<span>Средства управления</span>
<i class="fas fa-chevron-down text-sm"></i>
</h3>
<div class="space-y-2 pl-4">
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="controller" data-id="traffic-light">
<div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-traffic-light text-green-600"></i>
</div>
<div>
<p class="font-medium">Светофорный контроллер</p>
<p class="text-xs text-gray-500">СК-1, СК-2М</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="controller" data-id="ramp-metering">
<div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-signal text-green-600"></i>
</div>
<div>
<p class="font-medium">Рампа-метер</p>
<p class="text-xs text-gray-500">РМ-4</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="controller" data-id="vms">
<div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-sign text-green-600"></i>
</div>
<div>
<p class="font-medium">Дорожное табло</p>
<p class="text-xs text-gray-500">ДТ-3, ДТ-5</p>
</div>
</div>
</div>
</div>
<div class="equipment-category">
<h3 class="font-medium text-gray-700 mb-2 flex items-center justify-between">
<span>Коммуникации</span>
<i class="fas fa-chevron-down text-sm"></i>
</h3>
<div class="space-y-2 pl-4">
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="communication" data-id="fiber">
<div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-network-wired text-purple-600"></i>
</div>
<div>
<p class="font-medium">Волоконно-оптическая линия</p>
<p class="text-xs text-gray-500">ВОЛС-12, ВОЛС-24</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="communication" data-id="radio">
<div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-wifi text-purple-600"></i>
</div>
<div>
<p class="font-medium">Радиоканал</p>
<p class="text-xs text-gray-500">РК-900, РК-2400</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="communication" data-id="cellular">
<div class="w-8 h-8 bg-purple-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-sim-card text-purple-600"></i>
</div>
<div>
<p class="font-medium">Сотовая связь</p>
<p class="text-xs text-gray-500">4G, 5G</p>
</div>
</div>
</div>
</div>
<div class="equipment-category">
<h3 class="font-medium text-gray-700 mb-2 flex items-center justify-between">
<span>Центры управления</span>
<i class="fas fa-chevron-down text-sm"></i>
</h3>
<div class="space-y-2 pl-4">
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="center" data-id="tcc">
<div class="w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-city text-yellow-600"></i>
</div>
<div>
<p class="font-medium">Транспортный центр</p>
<p class="text-xs text-gray-500">ТЦ-1, ТЦ-2</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="center" data-id="regional">
<div class="w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-globe-americas text-yellow-600"></i>
</div>
<div>
<p class="font-medium">Региональный центр</p>
<p class="text-xs text-gray-500">РЦ-1</p>
</div>
</div>
<div class="equipment-card bg-gray-50 p-3 rounded-lg border cursor-pointer flex items-center" data-type="center" data-id="cloud">
<div class="w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center mr-3">
<i class="fas fa-cloud text-yellow-600"></i>
</div>
<div>
<p class="font-medium">Облачная платформа</p>
<p class="text-xs text-gray-500">ИТС-Облако</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Основная область конструктора -->
<div class="lg:col-span-3 space-y-6">
<!-- Панель инструментов -->
<div class="bg-white p-4 rounded-xl shadow-md flex flex-wrap gap-3">
<button class="bg-blue-100 text-blue-800 px-3 py-1 rounded-lg flex items-center" id="btn-add-node">
<i class="fas fa-plus mr-2"></i> Добавить узел
</button>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg flex items-center" id="btn-add-connection">
<i class="fas fa-link mr-2"></i> Соединить
</button>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg flex items-center" id="btn-delete">
<i class="fas fa-trash-alt mr-2"></i> Удалить
</button>
<div class="border-l border-gray-300 h-8 mx-2"></div>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg flex items-center" id="btn-zoom-in">
<i class="fas fa-search-plus mr-2"></i>
</button>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg flex items-center" id="btn-zoom-out">
<i class="fas fa-search-minus mr-2"></i>
</button>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg flex items-center" id="btn-reset-view">
<i class="fas fa-expand mr-2"></i> Сброс
</button>
<div class="border-l border-gray-300 h-8 mx-2"></div>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg flex items-center" id="btn-simulate">
<i class="fas fa-play-circle mr-2"></i> Симуляция
</button>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg flex items-center" id="btn-validate">
<i class="fas fa-check-circle mr-2"></i> Проверить
</button>
</div>
<!-- Визуализация онтологии -->
<div class="bg-white p-4 rounded-xl shadow-md">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-semibold text-gray-800">Визуализация онтологии ИТС</h2>
<div class="flex space-x-2">
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg text-sm" id="btn-hierarchical">
<i class="fas fa-project-diagram mr-1"></i> Иерархия
</button>
<button class="bg-gray-100 text-gray-800 px-3 py-1 rounded-lg text-sm" id="btn-network">
<i class="fas fa-network-wired mr-1"></i> Сеть
</button>
<button class="bg-blue-100 text-blue-800 px-3 py-1 rounded-lg text-sm" id="btn-ontology">
<i class="fas fa-sitemap mr-1"></i> Онтология
</button>
</div>
</div>
<div id="ontology-visualization" class="relative">
<!-- Здесь будет SVG-визуализация -->
<svg id="ontology-svg" width="100%" height="100%">
<!-- Соединения будут добавляться здесь -->
<g id="connections-layer"></g>
<!-- Узлы будут добавляться здесь -->
<g id="nodes-layer">
<!-- Пример узла -->
<g class="ontology-node drag-handle" transform="translate(300, 200)" data-node-id="1">
<rect x="-50" y="-30" width="100" height="60" rx="10" ry="10" fill="#3b82f6" stroke="#1d4ed8" stroke-width="2"></rect>
<text x="0" y="5" text-anchor="middle" fill="white" font-weight="bold" font-size="14">ЦУ ИТС</text>
<text x="0" y="20" text-anchor="middle" fill="#bfdbfe" font-size="10">Центр управления</text>
</g>
<!-- Пример узла -->
<g class="ontology-node drag-handle" transform="translate(150, 350)" data-node-id="2">
<rect x="-50" y="-30" width="100" height="60" rx="10" ry="10" fill="#10b981" stroke="#047857" stroke-width="2"></rect>
<text x="0" y="5" text-anchor="middle" fill="white" font-weight="bold" font-size="14">Светофор</text>
<text x="0" y="20" text-anchor="middle" fill="#a7f3d0" font-size="10">СК-2М</text>
</g>
<!-- Пример узла -->
<g class="ontology-node drag-handle" transform="translate(450, 350)" data-node-id="3">
<rect x="-50" y="-30" width="100" height="60" rx="10" ry="10" fill="#8b5cf6" stroke="#6d28d9" stroke-width="2"></rect>
<text x="0" y="5" text-anchor="middle" fill="white" font-weight="bold" font-size="14">Детектор</text>
<text x="0" y="20" text-anchor="middle" fill="#ddd6fe" font-size="10">ИП-12</text>
</g>
</g>
</svg>
</div>
</div>
<!-- Панель свойств -->
<div class="bg-white p-4 rounded-xl shadow-md">
<h2 class="text-xl font-semibold text-gray-800 mb-4">Свойства элемента</h2>
<div id="properties-panel" class="space-y-4">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Тип оборудования</label>
<select class="w-full border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>Детектор транспорта</option>
<option>Средство управления</option>
<option>Коммуникационное оборудование</option>
<option>Центр управления</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Модель</label>
<select class="w-full border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>ИП-12 (Индукционная петля)</option>
<option>ИП-24 (Индукционная петля)</option>
<option>РД-5 (Радарный детектор)</option>
<option>СК-1 (Светофорный контроллер)</option>
</select>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Наименование</label>
<input type="text" class="w-full border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Введите название узла">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Описание</label>
<textarea class="w-full border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" rows="2" placeholder="Дополнительная информация"></textarea>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Производитель</label>
<select class="w-full border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>Российские системы</option>
<option>Технологии транспорта</option>
<option>Смарт Дороги</option>
<option>Иностранный производитель</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Год установки</label>
<input type="number" min="2010" max="2023" class="w-full border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" value="2023">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Срок службы</label>
<div class="flex items-center">
<input type="number" min="1" max="20" class="w-full border rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" value="5">
<span class="ml-2 text-sm">лет</span>
</div>
</div>
</div>
<div class="pt-4 border-t">
<h3 class="font-medium text-gray-700 mb-2">Технические параметры</h3>
<div class="space-y-3">
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">Напряжение питания</span>
<span class="font-medium">220V AC</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">Диапазон температур</span>
<span class="font-medium">-40°C до +60°C</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">Степень защиты</span>
<span class="font-medium">IP67</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-gray-600">Сертификация</span>
<span class="font-medium">ГОСТ Р, ТР ТС</span>
</div>
</div>
</div>
<div class="pt-4 border-t">
<h3 class="font-medium text-gray-700 mb-2">Совместимость</h3>
<div class="flex flex-wrap gap-2">
<span class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs">СК-1</span>
<span class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs">СК-2М</span>
<span class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs">РД-5</span>
<span class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs">ВД-4К</span>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="bg-gray-100 border-t mt-12">
<div class="container mx-auto px-4 py-6">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<h3 class="font-semibold text-gray-800">Конструктор ИТС</h3>
<p class="text-sm text-gray-600">Веб-онтология транспортных систем России</p>
</div>
<div class="flex space-x-6">
<a href="#" class="text-gray-600 hover:text-blue-600">Документация</a>
<a href="#" class="text-gray-600 hover:text-blue-600">Оборудование</a>
<a href="#" class="text-gray-600 hover:text-blue-600">Стандарты</a>
<a href="#" class="text-gray-600 hover:text-blue-600">Контакты</a>
</div>
</div>
<div class="mt-6 pt-6 border-t border-gray-200 text-center text-sm text-gray-500">
<p>© 2023 Министерство транспорта РФ. Все права защищены.</p>
</div>
</div>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Инициализация перетаскивания узлов
const nodes = document.querySelectorAll('.ontology-node');
let selectedNode = null;
nodes.forEach(node => {
// Обработка выбора узла
node.addEventListener('click', function(e) {
// Снимаем выделение со всех узлов
nodes.forEach(n => {
n.querySelector('rect').classList.remove('stroke-4', 'stroke-yellow-400');
});
// Выделяем текущий узел
const rect = this.querySelector('rect');
rect.classList.add('stroke-4', 'stroke-yellow-400');
selectedNode = this;
updatePropertiesPanel(this);
e.stopPropagation();
});
// Инициализация перетаскивания
const dragHandle = node.querySelector('.drag-handle');
if (dragHandle) {
dragHandle.addEventListener('mousedown', startDrag);
}
});
// Обработка клика вне узлов
document.addEventListener('click', function() {
if (selectedNode) {
selectedNode.querySelector('rect').classList.remove('stroke-4', 'stroke-yellow-400');
selectedNode = null;
}
});
// Обработка выбора оборудования
const equipmentCards = document.querySelectorAll('.equipment-card');
equipmentCards.forEach(card => {
card.addEventListener('click', function() {
equipmentCards.forEach(c => c.classList.remove('selected-equipment'));
this.classList.add('selected-equipment');
// Здесь можно добавить логику для предпросмотра оборудования
});
});
// Обновление панели свойств
function updatePropertiesPanel(node) {
const nodeId = node.getAttribute('data-node-id');
const panel = document.getElementById('properties-panel');
// В реальном приложении здесь будет запрос данных об узле
console.log(`Selected node: ${nodeId}`);
}
// Функции для перетаскивания узлов
let selectedElement = null;
let offset = { x: 0, y: 0 };
function startDrag(e) {
if (e.target.classList.contains('drag-handle') || e.target.parentElement
</html> |