All checks were successful
continuous-integration/drone/push Build is passing
Полная миграция фронтенда на Angular 19 + PrimeNG + NgRx SignalStore. - React 18 + AntD 5 + Zustand + Vite → Angular 19 + PrimeNG 19 + NgRx SignalStore + Angular CLI - Ноды X6: React-компоненты → чистые DOM-функции через Shape.HTML.register с effect: ['data'] - Все 5 типов нод (site, device, cross-device, splice, card) переписаны как рендереры - Zustand store → NgRx signalStore (schema.store.ts) - AntD компоненты → PrimeNG (p-tree, p-table, p-menu, p-toggleSwitch, p-slider, p-button) - 13 файлов чистого TypeScript переиспользованы as-is (типы, константы, утилиты, мок, layout, ports, edges) - Структура файлов переименована в kebab-case Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import type { Cell } from '@antv/x6';
|
|
import { STATUS_COLORS } from '../../../constants/status-colors';
|
|
import { SPLICE_BORDER_RADIUS } from '../../../constants/sizes';
|
|
import type { EntityStatus } from '../../../types/index';
|
|
|
|
interface SpliceNodeData {
|
|
name: string;
|
|
marking: string;
|
|
id1: string;
|
|
id2: string;
|
|
status: EntityStatus;
|
|
}
|
|
|
|
export function renderSpliceNode(cell: Cell): HTMLElement {
|
|
const data = cell.getData() as SpliceNodeData;
|
|
const colors = STATUS_COLORS[data.status];
|
|
const size = (cell as any).getSize() as { width: number; height: number };
|
|
|
|
const container = document.createElement('div');
|
|
Object.assign(container.style, {
|
|
width: `${size.width}px`,
|
|
height: `${size.height}px`,
|
|
border: `1px solid ${colors.border}`,
|
|
borderRadius: `${SPLICE_BORDER_RADIUS}px`,
|
|
background: colors.fill,
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
boxSizing: 'border-box',
|
|
textAlign: 'center',
|
|
padding: '4px',
|
|
fontSize: '10px',
|
|
lineHeight: '14px',
|
|
});
|
|
|
|
const nameEl = document.createElement('div');
|
|
Object.assign(nameEl.style, {
|
|
fontWeight: '700',
|
|
fontSize: '11px',
|
|
marginBottom: '2px',
|
|
wordBreak: 'break-word',
|
|
});
|
|
nameEl.textContent = data.name;
|
|
container.appendChild(nameEl);
|
|
|
|
if (data.marking) {
|
|
const markingEl = document.createElement('div');
|
|
Object.assign(markingEl.style, { color: '#595959', fontSize: '9px' });
|
|
markingEl.textContent = data.marking;
|
|
container.appendChild(markingEl);
|
|
}
|
|
|
|
return container;
|
|
}
|