feat: frontend MVP — детальная схема связей устройств (AntV X6)
- React 18 + TypeScript strict + AntV X6 2.x + AntD 5 + Zustand - Custom nodes: SiteNode, CrossDeviceNode, SpliceNode, DeviceNode, CardNode - 8-слойный автолейаут, порты (left/right), линии с цветами по статусу - Toolbar, дерево навигации, карточка объекта, таблица соединений - Контекстные меню, легенда, drag линий/нод, создание линий из портов - Моковые данные: 3 сайта, 10 устройств, 15 линий Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
14
frontend/src/utils/index.ts
Normal file
14
frontend/src/utils/index.ts
Normal file
@ -0,0 +1,14 @@
|
||||
let counter = 0;
|
||||
|
||||
export function generateId(prefix = 'id'): string {
|
||||
counter += 1;
|
||||
return `${prefix}-${Date.now()}-${counter}`;
|
||||
}
|
||||
|
||||
export function isCrossDevice(category: string): boolean {
|
||||
return category === 'cross_optical' || category === 'cross_copper';
|
||||
}
|
||||
|
||||
export function isSpliceDevice(category: string): boolean {
|
||||
return category === 'splice';
|
||||
}
|
||||
Reference in New Issue
Block a user