Add BIM model comments

This commit is contained in:
CODEX
2026-06-20 16:58:24 +03:00
parent c248217976
commit 684f85b382
6 changed files with 1849 additions and 6 deletions
+97 -2
View File
@@ -120,6 +120,12 @@
set("--section-plane-alpha", s.sectionPlaneAlpha);
set("--section-plane-edge", s.sectionPlaneEdge);
set("--section-plane-edge-alpha", s.sectionPlaneEdgeAlpha);
set("--comment-target-active", s.commentTargetActiveColor);
set("--comment-target-active-alpha", s.commentTargetActiveAlpha);
set("--comment-target-active-size", s.commentTargetActiveSize !== undefined ? `${s.commentTargetActiveSize}px` : undefined);
set("--comment-target-passive", s.commentTargetPassiveColor);
set("--comment-target-passive-alpha", s.commentTargetPassiveAlpha);
set("--comment-target-passive-size", s.commentTargetPassiveSize !== undefined ? `${s.commentTargetPassiveSize}px` : undefined);
} catch (e) {
// ignore corrupted settings
}
@@ -128,7 +134,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./dcViewer.css?v=22">
<link rel="stylesheet" href="./dcViewer.css?v=24">
</head>
<body>
<header>
@@ -247,14 +253,98 @@
<div class="inspector-restore-tray" id="inspectorRestoreTray" hidden>
<button class="inspector-restore-button" id="inspectorRestoreButton" type="button">Инспектор</button>
</div>
<aside class="comments-panel hidden" id="commentsPanel">
<div class="comments-panel-header" id="commentsPanelHeader">
<h3>Комментарии</h3>
<button
class="inspector-collapse-btn"
id="commentsCollapseButton"
type="button"
title="Опустить комментарии"
aria-label="Опустить комментарии"
>
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">
<path d="M4 6.25 8 10.25 12 6.25" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</button>
</div>
<div class="comments-panel-body">
<div id="commentsList" class="comments-list"></div>
</div>
</aside>
<div class="comments-restore-tray" id="commentsRestoreTray" hidden>
<button class="inspector-restore-button" id="commentsRestoreButton" type="button">Комментарии</button>
</div>
<div id="commentTargetsLayer" class="comment-targets-layer hidden"></div>
</main>
<div id="templatesPanel" class="templates-panel hidden"></div>
<div id="settingsPanel" class="settings-panel hidden"></div>
<div id="commentContextMenu" class="nodedc-dropdown-surface bim-context-menu hidden" role="menu" aria-label="Действия по модели">
<button class="nodedc-dropdown-option bim-context-menu__item" data-comment-menu-action="create" type="button" role="menuitem">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M6.5 5.5h11a2.5 2.5 0 0 1 2.5 2.5v6.25a2.5 2.5 0 0 1-2.5 2.5H12l-4.3 3.1v-3.1H6.5A2.5 2.5 0 0 1 4 14.25V8a2.5 2.5 0 0 1 2.5-2.5Z"></path>
</svg>
<span>Комментарий</span>
</button>
</div>
<div id="measureModalBackdrop" class="modal-backdrop hidden"></div>
<div id="measureModal" class="templates-panel measurement-modal hidden"></div>
<div id="objectModalBackdrop" class="modal-backdrop hidden"></div>
<div id="objectModal" class="templates-panel measurement-modal hidden"></div>
<div id="commentModalBackdrop" class="modal-backdrop hidden"></div>
<div id="commentModal" class="comment-card-modal hidden" role="dialog" aria-modal="true" aria-label="Комментарий к модели">
<div class="comment-card-modal__header" id="commentModalHeader">
<div class="comment-card-modal__titles">
<div class="comment-card-modal__title">Комментарий к модели</div>
<div class="comment-card-modal__subtitle" id="commentModalSubtitle">Новый таргет</div>
</div>
<button class="modal-close inspector-collapse-btn" id="commentModalClose" type="button" aria-label="Закрыть">
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">
<path d="M4.25 4.25 11.75 11.75M11.75 4.25 4.25 11.75" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>
</svg>
</button>
</div>
<div class="comment-card-modal__body">
<label class="comment-field">
<span>Тема</span>
<input type="text" id="commentTitleInput" autocomplete="off" placeholder="Тема комментария">
</label>
<label class="comment-field">
<span>Описание</span>
<textarea id="commentBodyInput" rows="5" placeholder="Описание комментария"></textarea>
</label>
<div class="comment-attachments">
<div class="comment-attachments__head">
<span>Картинки</span>
<button type="button" class="comment-attach-button" id="commentAttachButton">Добавить</button>
<input type="file" id="commentAttachmentInput" accept="image/*" multiple hidden>
</div>
<div class="comment-attachment-grid" id="commentAttachmentGrid"></div>
</div>
<div class="comment-thread">
<div class="comment-thread__title">Комментарии</div>
<div class="comment-thread__list" id="commentThreadList"></div>
<label class="comment-field comment-field--reply">
<span>Новый комментарий</span>
<textarea id="commentReplyInput" rows="3" placeholder="Оставить комментарий"></textarea>
</label>
<div class="comment-attachments comment-attachments--reply">
<div class="comment-attachments__head">
<span>Картинки к ответу</span>
<button type="button" class="comment-attach-button" id="commentReplyAttachButton">Добавить</button>
<input type="file" id="commentReplyAttachmentInput" accept="image/*" multiple hidden>
</div>
<div class="comment-attachment-grid" id="commentReplyAttachmentGrid"></div>
</div>
</div>
<div class="error-text" id="commentModalError"></div>
</div>
<div class="comment-card-modal__footer">
<button class="secondary-btn" id="commentCancelButton" type="button">Отменить</button>
<button class="primary-btn" id="commentApplyButton" type="button">Применить</button>
</div>
</div>
<div id="saveProjectBackdrop" class="modal-backdrop hidden"></div>
<div id="saveProjectModal" class="save-project-modal hidden">
<div class="modal-header">
@@ -339,6 +429,11 @@
<path d="M6.25 4.5 17.75 19.5"></path>
</svg>
</button>
<button class="tb-btn" data-action="comments" title="Комментарии" aria-label="Комментарии">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path d="M6.5 5.5h11a2.5 2.5 0 0 1 2.5 2.5v6.25a2.5 2.5 0 0 1-2.5 2.5H12l-4.3 3.1v-3.1H6.5A2.5 2.5 0 0 1 4 14.25V8a2.5 2.5 0 0 1 2.5-2.5Z"></path>
</svg>
</button>
<button class="tb-btn" data-action="projection" title="Перспектива / аксонометрия">A</button>
<button class="tb-btn" data-action="share" title="Поделиться моделью" aria-label="Поделиться моделью">
<svg viewBox="0 0 24 24" aria-hidden="true">
@@ -399,6 +494,6 @@
<input id="fileInput" class="hidden" type="file"
accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl">
<script type="module" src="./dcViewer.js?v=26"></script>
<script type="module" src="./dcViewer.js?v=28"></script>
</body>
</html>