@mx-sose-front/mx-sose-graph 1.1.8 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/edgeWorker-b57ca007.js +2 -0
- package/dist/assets/edgeWorker-b57ca007.js.map +1 -0
- package/dist/index.d.ts +994 -31
- package/dist/index.esm.js +9541 -5145
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Common/Tree.vue +451 -0
- package/src/components/Common/index.ts +2 -0
- package/src/components/DiagramListTooltip/DiagramListTooltip.vue +1 -2
- package/src/components/Edge/Edge.vue +172 -169
- package/src/components/Gantt/Gantt.vue +1544 -0
- package/src/components/GanttContextMenu/GanttContextMenu.vue +304 -0
- package/src/components/InteractionLayer.vue +343 -147
- package/src/components/Matrix/Matrix.vue +808 -0
- package/src/components/Matrix/index.ts +168 -0
- package/src/components/Shape/ConceptualRole.vue +2 -34
- package/src/components/Table/Table.vue +1193 -0
- package/src/constants/edgeShapeKeys.ts +8 -5
- package/src/constants/index.ts +279 -51
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useChartRowSelection.ts +456 -0
- package/src/hooks/useResize.ts +2 -2
- package/src/hooks/useVirtualScroll.ts +258 -0
- package/src/index.ts +1 -1
- package/src/render/shape-renderer.ts +62 -2
- package/src/statics/icons/childIcons/AV-1/346/246/202/350/277/260/344/270/216/346/221/230/350/246/201/344/277/241/346/201/257/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/AV-1/346/246/202/350/277/260/346/221/230/350/246/201/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/AV-2/351/233/206/346/210/220/345/255/227/345/205/270/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/AV-2/351/233/206/346/210/220/345/255/227/345/205/270/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-1/346/204/277/346/231/257/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-1/346/204/277/346/231/257/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-2/350/203/275/345/212/233/345/210/206/347/261/273/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-2/350/203/275/345/212/233/345/210/206/347/261/273/345/233/276@3x-2.png +0 -0
- package/src/statics/icons/childIcons/CV-2/350/203/275/345/212/233/345/210/206/347/261/273/345/233/276@3x-3.png +0 -0
- package/src/statics/icons/childIcons/CV-2/350/203/275/345/212/233/345/210/206/347/261/273/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-3/350/203/275/345/212/233/345/210/206/346/256/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-3/350/203/275/345/212/233/351/230/266/346/256/265/347/224/230/347/211/271/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-4/350/203/275/345/212/233/344/276/235/350/265/226/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-4/350/203/275/345/212/233/344/276/235/350/265/226/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-5/350/203/275/345/212/233/345/210/260/347/273/204/347/273/207/347/232/204/345/274/200/345/217/221/346/230/240/345/260/204/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-5/350/203/275/345/212/233/345/210/260/347/273/204/347/273/207/347/232/204/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-6/350/203/275/345/212/233/345/210/260/344/270/232/345/212/241/346/264/273/345/212/250/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-6/350/203/275/345/212/233/345/210/260/344/275/234/346/210/230/346/264/273/345/212/250/347/232/204/346/230/240/345/260/204/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-7/350/203/275/345/212/233/345/210/260/346/234/215/345/212/241/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/CV-7/350/203/275/345/212/233/345/210/260/346/234/215/345/212/241/347/232/204/346/230/240/345/260/204/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/DIV-1/346/246/202/345/277/265/346/225/260/346/215/256/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/DIV-1/346/246/202/345/277/265/346/225/260/346/215/256/346/250/241/345/236/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/DIV-2/351/200/273/350/276/221/346/225/260/346/215/256/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/DIV-2/351/200/273/350/276/221/346/225/260/346/215/256/346/250/241/345/236/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/DIV-3/347/211/251/347/220/206/346/225/260/346/215/256/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-1/350/207/252/347/224/261/345/210/206/347/261/273/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-1/351/253/230/347/272/247/344/275/234/346/210/230/346/246/202/345/277/265/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-1/351/253/230/347/272/247/344/275/234/346/210/230/346/246/202/345/277/265/345/233/276/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-2/344/275/234/346/210/230/350/265/204/346/272/220/346/265/201/345/206/205/351/203/250/346/217/217/350/277/260/345/233/276@3x-2.png +0 -0
- package/src/statics/icons/childIcons/OV-2/344/275/234/346/210/230/350/265/204/346/272/220/346/265/201/345/206/205/351/203/250/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-2/344/275/234/346/210/230/350/265/204/346/272/220/346/265/201/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-2/344/275/234/346/210/230/350/265/204/346/272/220/346/265/201/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-3/344/275/234/346/210/230/350/265/204/346/272/220/346/265/201/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-3/344/275/234/346/210/230/350/265/204/346/272/220/346/265/201/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-3/345/237/272/347/241/200/350/247/222/350/211/262/344/275/234/346/210/230/350/265/204/346/272/220/346/265/201/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-4/347/273/204/347/273/207/345/205/263/347/263/273/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-4/347/273/204/347/273/207/345/205/263/347/263/273/345/233/276/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-5a/344/275/234/346/210/230/346/264/273/345/212/250/345/210/206/350/247/243/346/240/221/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-5a/344/275/234/346/210/230/346/264/273/345/212/250/345/210/206/350/247/243/346/240/221/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-5b/344/275/234/346/210/230/346/264/273/345/212/250/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-5b/344/275/234/346/210/230/346/264/273/345/212/250/346/250/241/345/236/213/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-6a/344/275/234/346/210/230/350/247/204/345/210/231/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-6a/344/275/234/346/210/230/350/265/204/346/272/220/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-6b/347/212/266/346/200/201/350/275/254/346/215/242/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-6b/347/212/266/346/200/201/350/275/254/346/215/242/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-6c/344/272/213/344/273/266/350/277/275/350/270/252/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/OV-6c/344/275/234/346/210/230/344/272/213/344/273/266/350/267/237/350/270/252/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/PV-1/351/241/271/347/233/256/347/273/204/345/220/210/345/205/263/347/263/273/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/PV-1/351/241/271/347/233/256/347/273/204/345/220/210/345/205/263/347/263/273/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/PV-2/351/241/271/347/233/256/346/227/266/351/227/264/350/277/233/345/272/246/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/PV-2/351/241/271/347/233/256/346/227/266/351/227/264/350/277/233/345/272/246/347/224/230/347/211/271/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/PV-3/351/241/271/347/233/256/344/270/216/350/203/275/345/212/233/346/230/240/345/260/204/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/PV-3/351/241/271/347/233/256/344/270/216/350/203/275/345/212/233/347/232/204/346/230/240/345/260/204/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-1 /347/263/273/347/273/237/346/216/245/345/217/243/345/206/205/351/203/250/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-1 /347/263/273/347/273/237/346/216/245/345/217/243/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-10a /347/263/273/347/273/237/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-10a /347/263/273/347/273/237/350/247/204/345/210/231/346/250/241/345/236/213/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-10a/347/263/273/347/273/237/350/247/204/345/210/231/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-10b /347/263/273/347/273/237/347/212/266/346/200/201/350/275/254/346/215/242/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-10b/347/263/273/347/273/237/347/212/266/346/200/201/350/275/254/346/215/242/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-10c /347/263/273/347/273/237/344/272/213/344/273/266/350/267/237/350/270/252/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-10c/347/263/273/347/273/237/344/272/213/344/273/266-/350/277/275/350/270/252/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-1/347/263/273/347/273/237/346/216/245/345/217/243/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-2 /347/263/273/347/273/237/345/206/205/351/203/250/350/265/204/346/272/220/346/265/201/345/212/250/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-2 /347/263/273/347/273/237/350/265/204/346/272/220/346/265/201/345/212/250/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-2/347/263/273/347/273/237/350/265/204/346/272/220/346/265/201/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-3 /347/263/273/347/273/237 - /347/263/273/347/273/237/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-3/347/263/273/347/273/237-/347/263/273/347/273/237/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-4 /347/263/273/347/273/237/345/212/237/350/203/275/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-4 /347/263/273/347/273/237/345/212/237/350/203/275/346/265/201/347/250/213/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-4/347/263/273/347/273/237/345/212/237/350/203/275/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-5a /344/270/232/345/212/241/346/264/273/345/212/250/345/210/260/347/263/273/347/273/237/345/212/237/350/203/275/347/232/204/345/217/257/350/277/275/346/272/257/346/200/247/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-5a/344/275/234/346/210/230/346/264/273/345/212/250/345/210/260/347/263/273/347/273/237/345/212/237/350/203/275/345/217/257/350/277/275/350/270/252/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-5b /344/270/232/345/212/241/346/264/273/345/212/250/345/210/260/347/263/273/347/273/237/347/232/204/345/217/257/350/277/275/346/272/257/346/200/247/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-5b/344/275/234/346/210/230/346/264/273/345/212/250/345/210/260/347/263/273/347/273/237/345/217/257/350/277/275/350/270/252/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-6 /347/263/273/347/273/237/350/265/204/346/272/220/346/265/201/345/212/250/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-6/347/263/273/347/273/237/350/265/204/346/272/220/346/265/201/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-7 /347/263/273/347/273/237/345/256/236/351/231/205/345/272/246/351/207/217/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-7/347/263/273/347/273/237/345/272/246/351/207/217/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-8 /347/263/273/347/273/237/346/274/224/350/277/233/346/217/217/350/277/260/347/224/230/347/211/271/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-8/347/263/273/347/273/237/346/274/224/350/277/233/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-9 /347/263/273/347/273/237/346/212/200/346/234/257/344/270/216/346/212/200/350/203/275/351/242/204/346/265/213/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons/SV-9/347/263/273/347/273/237/346/212/200/346/234/257/344/270/216/346/212/200/350/203/275/351/242/204/346/265/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/StdV-1 /346/240/207/345/207/206/351/205/215/347/275/256/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons/StdV-1/346/240/207/345/207/206/351/205/215/347/275/256/346/226/207/344/273/266/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/StdV-2 /346/240/207/345/207/206/351/242/204/346/265/213/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons/StdV-2/346/240/207/345/207/206/351/242/204/346/265/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-10a /346/234/215/345/212/241/345/217/202/346/225/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-10a/346/234/215/345/212/241/350/247/204/345/210/231/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-10b /346/234/215/345/212/241/347/212/266/346/200/201/350/275/254/346/215/242/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-10b/346/234/215/345/212/241/347/212/266/346/200/201/350/275/254/346/215/242/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-10c /346/234/215/345/212/241/344/272/213/344/273/266/350/267/237/350/270/252/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-10c/346/234/215/345/212/241/344/272/213/344/273/266-/350/277/275/350/270/252/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-1/346/234/215/345/212/241/344/270/212/344/270/213/346/226/207/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-1/346/234/215/345/212/241/350/203/214/346/231/257/346/250/241/345/236/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-2 /346/234/215/345/212/241/350/265/204/346/272/220/346/265/201/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-2/346/234/215/345/212/241/350/265/204/346/272/220/346/265/201/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-3a /347/263/273/347/273/237 -/346/234/215/345/212/241/347/237/251/351/230/265@3x-2.png +0 -0
- package/src/statics/icons/childIcons/SvcV-3a /347/263/273/347/273/237 -/346/234/215/345/212/241/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-3a/347/263/273/347/273/237-/346/234/215/345/212/241/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-3b/346/234/215/345/212/241-/346/234/215/345/212/241/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-4 /346/234/215/345/212/241/345/212/237/350/203/275/346/217/217/350/277/260/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-4 /346/234/215/345/212/241/345/212/237/350/203/275/346/265/201/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-4/346/234/215/345/212/241/345/212/237/350/203/275/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-5/344/275/234/346/210/230/346/264/273/345/212/250/345/210/260/346/234/215/345/212/241/345/217/257/350/277/275/350/270/252/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-6 /346/234/215/345/212/241/350/265/204/346/272/220/346/265/201/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-6/346/234/215/345/212/241/350/265/204/346/272/220/346/265/201/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-7 /346/234/215/345/212/241/345/205/270/345/236/213/345/272/246/351/207/217/347/237/251/351/230/265@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-7/346/234/215/345/212/241/345/272/246/351/207/217/347/237/251/351/230/265/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-8 /346/234/215/345/212/241/346/274/224/350/277/233/347/224/230/347/211/271/345/233/276@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-8/346/234/215/345/212/241/346/274/224/350/277/233/346/217/217/350/277/260/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-9 /346/234/215/345/212/241/346/212/200/346/234/257/344/270/216/346/212/200/350/203/275/351/242/204/346/265/213/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons/SvcV-9/346/234/215/345/212/241/346/212/200/346/234/257/344/270/216/346/212/200/350/203/275/351/242/204/346/265/213/345/214/205@3x.png +0 -0
- package/src/statics/icons/childIcons//344/275/223/347/263/273/346/236/266/346/236/204@3x.png +0 -0
- package/src/statics/icons/childIcons//344/275/234/346/210/230/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/childIcons//345/205/250/346/231/257/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/childIcons//345/205/254/345/217/270@3x.png +0 -0
- package/src/statics/icons/childIcons//345/215/217/350/256/256@3x.png +0 -0
- package/src/statics/icons/childIcons//345/215/217/350/256/256/345/261/202@3x.png +0 -0
- package/src/statics/icons/childIcons//345/215/217/350/256/256/346/240/210@3x.png +0 -0
- package/src/statics/icons/childIcons//345/221/275/344/273/244@3x.png +0 -0
- package/src/statics/icons/childIcons//346/210/230/347/225/245/346/246/202/345/277/265/350/241/250@3x.png +0 -0
- package/src/statics/icons/childIcons//346/216/247/345/210/266@3x.png +0 -0
- package/src/statics/icons/childIcons//346/224/257/346/214/201@3x.png +0 -0
- package/src/statics/icons/childIcons//346/225/260/346/215/256/344/277/241/346/201/257/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/childIcons//346/234/215/345/212/241/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/childIcons//346/240/207/345/207/206@3x.png +0 -0
- package/src/statics/icons/childIcons//346/240/207/345/207/206/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/childIcons//347/263/273/347/273/237/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/childIcons//350/203/275/345/212/233/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/childIcons//351/241/271/347/233/256/350/247/206/350/247/222@3x.png +0 -0
- package/src/statics/icons/createMenu/down.png +0 -0
- package/src/statics/icons/createMenu/remove.png +0 -0
- package/src/statics/icons/createMenu/up.png +0 -0
- package/src/store/graphStore.ts +238 -45
- package/src/types/index.ts +87 -4
- package/src/utils/batchAutoExpand.ts +9 -10
- package/src/utils/containers.ts +72 -17
- package/src/utils/contextMenuUtils.ts +7 -7
- package/src/utils/dateUtils.ts +160 -0
- package/src/utils/diagram.ts +10 -8
- package/src/utils/drag.ts +6 -5
- package/src/utils/edgeUtils.ts +344 -427
- package/src/utils/edgeWorker.ts +471 -0
- package/src/utils/hittest.ts +37 -38
- package/src/utils/index.ts +3 -0
- package/src/utils/keyboardUtils.ts +5 -5
- package/src/utils/packageOutline.ts +96 -0
- package/src/utils/rafThrottle.ts +162 -0
- package/src/utils/workerManager.ts +335 -0
- package/src/view/graph.vue +47 -33
- /package/src/statics/icons/childIcons//346/210/230/347/225/{245@3x.png" → 245/345/261/202@3x.png"} +0 -0
package/src/store/graphStore.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineStore } from 'pinia'
|
|
2
2
|
import { ref, computed, shallowReactive, nextTick, type Ref } from 'vue'
|
|
3
|
-
import type { Shape, OwnerPayload, ShapeSizeUpdatePayload } from '../types'
|
|
3
|
+
import type { Shape, OwnerPayload, ShapeSizeUpdatePayload, Matrix } from '../types'
|
|
4
|
+
|
|
4
5
|
import { eventBus } from './eventBus'
|
|
5
6
|
import { getPolicy, checkNestViaFront, } from '../utils/policy'
|
|
6
7
|
import _ from "lodash";
|
|
@@ -20,13 +21,57 @@ import {
|
|
|
20
21
|
syncShowComparentsByReparent,
|
|
21
22
|
} from '../utils/compartment'
|
|
22
23
|
import { EdgeUtils } from '../utils/edgeUtils'
|
|
24
|
+
import { snapPinToParentEdge } from '../utils/pinUtils'
|
|
23
25
|
import { expandParentByChild } from '../utils/autoExpandParent'
|
|
24
26
|
import { batchAutoExpandParents } from '../utils/batchAutoExpand'
|
|
25
27
|
import { adjustCanvasToFitAllShapes } from '../utils/diagram'
|
|
26
28
|
import { applyReparentAndClone, autoExpandMovedCompartmentsAfterDrag, buildDragEndPayloads, buildPrevParentMap, collectAffectedShapeIds, createOnNestDoneCallback } from '../utils/graphDragService'
|
|
27
29
|
import { createShapeOperator, type ShapeOp, type ShapeId } from "../utils/shapeOps/shapeOps"
|
|
28
30
|
type Rect = { x: number; y: number; width: number; height: number };
|
|
31
|
+
|
|
32
|
+
const GRAPH_SELECTION_STORAGE_KEY = 'mx-sose-graph:selected-state'
|
|
33
|
+
|
|
34
|
+
interface PersistedSelectionState {
|
|
35
|
+
diagramId: string | null
|
|
36
|
+
selectedIds: string[]
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function loadPersistedSelectionState(): PersistedSelectionState {
|
|
40
|
+
if (typeof window === 'undefined') {
|
|
41
|
+
return { diagramId: null, selectedIds: [] }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const raw = window.sessionStorage.getItem(GRAPH_SELECTION_STORAGE_KEY)
|
|
46
|
+
if (!raw) {
|
|
47
|
+
return { diagramId: null, selectedIds: [] }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const parsed = JSON.parse(raw) as Partial<PersistedSelectionState>
|
|
51
|
+
return {
|
|
52
|
+
diagramId: typeof parsed.diagramId === 'string' ? parsed.diagramId : null,
|
|
53
|
+
selectedIds: Array.isArray(parsed.selectedIds)
|
|
54
|
+
? parsed.selectedIds.filter((id): id is string => typeof id === 'string')
|
|
55
|
+
: [],
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
return { diagramId: null, selectedIds: [] }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function savePersistedSelectionState(state: PersistedSelectionState) {
|
|
63
|
+
if (typeof window === 'undefined') return
|
|
64
|
+
|
|
65
|
+
window.sessionStorage.setItem(GRAPH_SELECTION_STORAGE_KEY, JSON.stringify(state))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function clearPersistedSelectionState() {
|
|
69
|
+
if (typeof window === 'undefined') return
|
|
70
|
+
|
|
71
|
+
window.sessionStorage.removeItem(GRAPH_SELECTION_STORAGE_KEY)
|
|
72
|
+
}
|
|
29
73
|
export const useGraphStore = defineStore('graph', () => {
|
|
74
|
+
const persistedSelectionState = loadPersistedSelectionState()
|
|
30
75
|
// 状态
|
|
31
76
|
const shapes = ref<Shape[]>([])
|
|
32
77
|
// 在 store 初始化时创建一次
|
|
@@ -67,13 +112,31 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
67
112
|
//当前激活的画布id
|
|
68
113
|
const activeDiagramId = ref<string | null>(null);
|
|
69
114
|
// 当前被选中的多个 id
|
|
70
|
-
const selectedIds = ref<string[]>(
|
|
115
|
+
const selectedIds = ref<string[]>(persistedSelectionState.selectedIds)
|
|
116
|
+
const selectionDiagramId = ref<string | null>(persistedSelectionState.diagramId)
|
|
71
117
|
// 外部拖拽创建中的形状 id(用于隐藏实际形状,只显示 ghost)
|
|
72
118
|
const externalCreatingId = ref<string | null>(null)
|
|
73
119
|
// 剪切状态的图元 ID 集合(用于 SVG 遮盖层渲染)
|
|
74
120
|
const cutShapeIds = ref<Set<string>>(new Set())
|
|
75
121
|
// 剪贴板中图元的数量(用于工具栏按钮状态同步)
|
|
76
122
|
const copiedShapesCount = ref<number>(0)
|
|
123
|
+
/** 矩阵视图缓存:与 Matrix 组件收到的 matrix-data-change 同步 */
|
|
124
|
+
const matrixData = ref<Matrix>({
|
|
125
|
+
rowTree: [],
|
|
126
|
+
columnTree: [],
|
|
127
|
+
crossData: [],
|
|
128
|
+
relationModelIcon: '',
|
|
129
|
+
relationModelName: '',
|
|
130
|
+
})
|
|
131
|
+
const setMatrixData = (payload: Matrix) => {
|
|
132
|
+
matrixData.value = {
|
|
133
|
+
rowTree: payload.rowTree,
|
|
134
|
+
columnTree: payload.columnTree,
|
|
135
|
+
crossData: payload.crossData,
|
|
136
|
+
relationModelIcon: payload.relationModelIcon,
|
|
137
|
+
relationModelName: payload.relationModelName,
|
|
138
|
+
}
|
|
139
|
+
}
|
|
77
140
|
// 计算属性
|
|
78
141
|
const shapeCount = computed(() => shapes.value.length)
|
|
79
142
|
const hasSelectedShape = computed(() => selectedShape.value !== null)
|
|
@@ -112,6 +175,29 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
112
175
|
return map;
|
|
113
176
|
})
|
|
114
177
|
|
|
178
|
+
/**
|
|
179
|
+
* 连线索引映射
|
|
180
|
+
* 用于快速查找某个节点关联的所有连线
|
|
181
|
+
* key: 节点 ID (sourceId 或 targetId), value: 关联的 edge 数组
|
|
182
|
+
* 性能优化: 避免 updateRelatedEdges / initializeAllEdgeEndpoints 中的全量 filter + find
|
|
183
|
+
*/
|
|
184
|
+
const edgesByNodeId = computed(() => {
|
|
185
|
+
const map = new Map<string, Shape[]>()
|
|
186
|
+
shapes.value.forEach(s => {
|
|
187
|
+
if (s.shapeType === 'edge') {
|
|
188
|
+
if (s.sourceId) {
|
|
189
|
+
if (!map.has(s.sourceId)) map.set(s.sourceId, [])
|
|
190
|
+
map.get(s.sourceId)!.push(s)
|
|
191
|
+
}
|
|
192
|
+
if (s.targetId) {
|
|
193
|
+
if (!map.has(s.targetId)) map.set(s.targetId, [])
|
|
194
|
+
map.get(s.targetId)!.push(s)
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
return map
|
|
199
|
+
})
|
|
200
|
+
|
|
115
201
|
//图元shapeKey
|
|
116
202
|
const taggedValueLabels = ref<string[]>([]) // 隔间组件的图元类型
|
|
117
203
|
const packagesTypes = ref<string[]>([]) // 需要展示线的隔间组件的图元类型
|
|
@@ -150,6 +236,9 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
150
236
|
// 通过事件总线发送事件
|
|
151
237
|
// eventBus.emit('shape-added', shape)
|
|
152
238
|
|
|
239
|
+
// 图元新增后调整画布大小
|
|
240
|
+
nextTick(adjustCanvasToFitAllShapes)
|
|
241
|
+
|
|
153
242
|
// 自动扩父逻辑:如果图元有父元素且需要自动扩父,触发扩父逻辑
|
|
154
243
|
const shouldAutoExpand = options?.autoExpandParent !== false // 默认为 true
|
|
155
244
|
if (shouldAutoExpand && shape.parenShapeId && shape.bounds) {
|
|
@@ -163,9 +252,19 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
163
252
|
const removeShape = (shapeId: string) => {
|
|
164
253
|
const index = shapes.value.findIndex(s => s.id == shapeId)
|
|
165
254
|
if (index > -1) {
|
|
255
|
+
const wasPrimarySelected = selectedShape.value?.id === shapeId
|
|
256
|
+
shapes.value.splice(index, 1)
|
|
257
|
+
diagrams.value = diagrams.value.filter(diagram => diagram.id !== shapeId)
|
|
258
|
+
selectedIds.value = selectedIds.value.filter(id => id !== shapeId)
|
|
259
|
+
pendingNestedIds.value = pendingNestedIds.value.filter(id => id !== shapeId)
|
|
260
|
+
if (cutShapeIds.value.has(shapeId)) {
|
|
261
|
+
const nextCutShapeIds = new Set(cutShapeIds.value)
|
|
262
|
+
nextCutShapeIds.delete(shapeId)
|
|
263
|
+
cutShapeIds.value = nextCutShapeIds
|
|
264
|
+
}
|
|
166
265
|
// 如果删除的是当前选中的形状,清除选中状态
|
|
167
|
-
|
|
168
|
-
|
|
266
|
+
syncSelectedState(wasPrimarySelected)
|
|
267
|
+
if (wasPrimarySelected && !selectedShape.value) {
|
|
169
268
|
eventBus.emit('shape-deselected')
|
|
170
269
|
}
|
|
171
270
|
}
|
|
@@ -195,7 +294,9 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
195
294
|
})
|
|
196
295
|
// 更新单个图元(不处理父子关系 / comparents,同步由外层 updateShape 负责)
|
|
197
296
|
const updateShapeRaw = (shapeId: string, updates: Partial<Shape>, id: 'id' | 'modelId' = 'id') => {
|
|
198
|
-
const shape =
|
|
297
|
+
const shape = id === 'id'
|
|
298
|
+
? shapeMap.value.get(shapeId) ?? null
|
|
299
|
+
: shapes.value.find(s => s[id] === shapeId)
|
|
199
300
|
if (shape) {
|
|
200
301
|
// 对 Pin 做强保护:永不允许把 parenShapeId 置空/undefined
|
|
201
302
|
if (shape.shapeType === 'pin' && 'parenShapeId' in updates) {
|
|
@@ -218,18 +319,23 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
218
319
|
}
|
|
219
320
|
// 更新图元数据
|
|
220
321
|
const updateShape = (shapeId: string, updates: Partial<Shape>, id: 'id' | 'modelId' = 'id') => {
|
|
221
|
-
const before =
|
|
322
|
+
const before = id === 'id'
|
|
323
|
+
? shapeMap.value.get(shapeId) ?? null
|
|
324
|
+
: shapes.value.find(s => s[id] === shapeId) ?? null
|
|
222
325
|
const oldPid = before?.parenShapeId ?? null
|
|
223
326
|
// 先真正写入
|
|
224
327
|
updateShapeRaw(shapeId, updates, id)
|
|
225
|
-
|
|
328
|
+
// updateShapeRaw 是就地修改,before 和 after 是同一个引用(id 未变时)
|
|
329
|
+
const after = before
|
|
226
330
|
if (!after) return
|
|
227
331
|
|
|
228
332
|
// 如果更新了bounds,需要重新计算相关连线的位置
|
|
333
|
+
// 在高频场景(如拖拽)中使用同步版本保证即时性,
|
|
334
|
+
// 异步版本留给 endDragShape / endResizeShape 等"结束"时刻
|
|
229
335
|
if (updates.bounds) {
|
|
230
336
|
EdgeUtils.updateRelatedEdges(shapes.value, [after.id], (shape) => {
|
|
231
337
|
updateShape(shape.id, shape);
|
|
232
|
-
});
|
|
338
|
+
}, edgesByNodeId.value, shapeMap.value);
|
|
233
339
|
}
|
|
234
340
|
|
|
235
341
|
const newPid = after.parenShapeId ?? null
|
|
@@ -259,23 +365,71 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
259
365
|
}
|
|
260
366
|
const sameId = (a?: string | null, b?: string | null) =>
|
|
261
367
|
(a ?? null) === (b ?? null)
|
|
368
|
+
const getLoadedDiagramId = () => shapes.value[0]?.diagramId ?? null
|
|
369
|
+
const persistSelectionState = () => {
|
|
370
|
+
if (!selectedIds.value.length) {
|
|
371
|
+
selectionDiagramId.value = null
|
|
372
|
+
clearPersistedSelectionState()
|
|
373
|
+
return
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
const selected = selectedIds.value
|
|
377
|
+
.map(id => shapeMap.value.get(id))
|
|
378
|
+
.find((shape): shape is Shape => !!shape)
|
|
379
|
+
|
|
380
|
+
selectionDiagramId.value = selected?.diagramId ?? selectionDiagramId.value ?? getLoadedDiagramId()
|
|
381
|
+
savePersistedSelectionState({
|
|
382
|
+
diagramId: selectionDiagramId.value,
|
|
383
|
+
selectedIds: [...selectedIds.value],
|
|
384
|
+
})
|
|
385
|
+
}
|
|
386
|
+
const syncSelectedState = (emit = false) => {
|
|
387
|
+
const loadedDiagramId = getLoadedDiagramId()
|
|
388
|
+
const ids = selectionDiagramId.value && loadedDiagramId && selectionDiagramId.value !== loadedDiagramId
|
|
389
|
+
? []
|
|
390
|
+
: selectedIds.value.filter(id => shapeMap.value.has(id))
|
|
391
|
+
const nextSelectedShape = ids.length
|
|
392
|
+
? (shapeMap.value.get(ids[0]) ?? null)
|
|
393
|
+
: null
|
|
394
|
+
|
|
395
|
+
selectedIds.value = ids
|
|
396
|
+
selectedShape.value = nextSelectedShape
|
|
397
|
+
|
|
398
|
+
if (nextSelectedShape) {
|
|
399
|
+
selectionDiagramId.value = nextSelectedShape.diagramId ?? loadedDiagramId
|
|
400
|
+
persistSelectionState()
|
|
401
|
+
} else {
|
|
402
|
+
selectionDiagramId.value = null
|
|
403
|
+
clearPersistedSelectionState()
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if (emit) {
|
|
407
|
+
eventBus.emit('shape-selected', nextSelectedShape)
|
|
408
|
+
}
|
|
409
|
+
}
|
|
262
410
|
//选中图元
|
|
263
411
|
const selectShape = (shape: Shape | null) => {
|
|
264
412
|
const prevId = selectedShape.value?.id ?? null
|
|
265
413
|
const nextId = shape?.id ?? null
|
|
266
|
-
|
|
414
|
+
const nextSelectedIds = shape ? [shape.id] : []
|
|
415
|
+
const hasSameSelection =
|
|
416
|
+
selectedIds.value.length === nextSelectedIds.length &&
|
|
417
|
+
selectedIds.value.every((id, index) => id === nextSelectedIds[index])
|
|
418
|
+
if (sameId(prevId, nextId) && hasSameSelection) return
|
|
267
419
|
selectedShape.value = shape
|
|
268
|
-
selectedIds.value =
|
|
420
|
+
selectedIds.value = nextSelectedIds
|
|
421
|
+
selectionDiagramId.value = shape?.diagramId ?? null
|
|
422
|
+
persistSelectionState()
|
|
269
423
|
// 通过事件总线发送事件
|
|
270
424
|
eventBus.emit('shape-selected', shape)
|
|
271
425
|
}
|
|
272
426
|
// 被框选中的多个 shape/映射 selectedIds.value中的数据
|
|
273
427
|
const marqueeShapes = computed(() => {
|
|
274
|
-
const
|
|
428
|
+
const map = shapeMap.value
|
|
275
429
|
const isShape = (x: Shape | undefined): x is Shape => !!x
|
|
276
430
|
const pending = new Set(pendingNestedIds.value)
|
|
277
431
|
return selectedIds.value
|
|
278
|
-
.map(
|
|
432
|
+
.map(id => map.get(id))
|
|
279
433
|
.filter(isShape)
|
|
280
434
|
.filter(s => !pending.has(s.id))
|
|
281
435
|
})
|
|
@@ -304,18 +458,24 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
304
458
|
})
|
|
305
459
|
// 选择一组(用于框选/Shift 叠加)
|
|
306
460
|
const selectMany = (ids: string[]) => {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
461
|
+
const nextIds = Array.from(new Set(ids))
|
|
462
|
+
selectedIds.value = nextIds
|
|
463
|
+
selectedShape.value = nextIds.length
|
|
464
|
+
? (shapeMap.value.get(nextIds[0]) ?? null)
|
|
310
465
|
: null
|
|
466
|
+
selectionDiagramId.value = selectedShape.value?.diagramId ?? getLoadedDiagramId()
|
|
467
|
+
persistSelectionState()
|
|
311
468
|
}
|
|
312
469
|
// 清空选择
|
|
313
470
|
const clearSelection = () => selectShape(null)
|
|
314
471
|
// 全选图元
|
|
315
472
|
const selectAll = () => {
|
|
316
|
-
// 获取所有非diagram类型的图元
|
|
473
|
+
// 获取所有非diagram、非edge类型的图元
|
|
317
474
|
const allShapeIds = shapes.value
|
|
318
|
-
.filter(shape =>
|
|
475
|
+
.filter(shape => {
|
|
476
|
+
const t = shape.shapeType?.toLowerCase()
|
|
477
|
+
return t !== 'diagram' && t !== 'edge'
|
|
478
|
+
})
|
|
319
479
|
.map(shape => shape.id)
|
|
320
480
|
selectMany(allShapeIds)
|
|
321
481
|
}
|
|
@@ -346,6 +506,7 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
346
506
|
op,
|
|
347
507
|
})
|
|
348
508
|
pendingNestedIds.value = []
|
|
509
|
+
syncSelectedState(op === 'replace' || op === 'delete')
|
|
349
510
|
// eventBus.emit('shapes-updated', newShapes)
|
|
350
511
|
// hydrateAllComparents()
|
|
351
512
|
|
|
@@ -356,6 +517,9 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
356
517
|
batchAutoExpandParents(changedShapes, updateShape)
|
|
357
518
|
})
|
|
358
519
|
}
|
|
520
|
+
|
|
521
|
+
// 图元增删后调整画布大小(用 nextTick 合并同一 tick 内的多次调用)
|
|
522
|
+
nextTick(adjustCanvasToFitAllShapes)
|
|
359
523
|
}
|
|
360
524
|
// 获取当前图元数据
|
|
361
525
|
const getShapes = () => {
|
|
@@ -366,12 +530,15 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
366
530
|
shapes.value = []
|
|
367
531
|
diagrams.value = []
|
|
368
532
|
selectedShape.value = null
|
|
533
|
+
selectedIds.value = []
|
|
534
|
+
selectionDiagramId.value = null
|
|
369
535
|
pendingNestedIds.value = []
|
|
536
|
+
clearPersistedSelectionState()
|
|
370
537
|
eventBus.emit('shapes-cleared')
|
|
371
538
|
}
|
|
372
539
|
//拖动元素相关操作
|
|
373
540
|
// 开始拖动已有元素(仅对 shape 生效)
|
|
374
|
-
const byId = (id: string) =>
|
|
541
|
+
const byId = (id: string) => shapeMap.value.get(id) ?? null
|
|
375
542
|
const startDragShape = (shapeId: string, pointer: { x: number; y: number }) => {
|
|
376
543
|
startDrag([shapeId], pointer)
|
|
377
544
|
}
|
|
@@ -621,7 +788,7 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
621
788
|
}
|
|
622
789
|
// —— Pin 终极兜底:不允许在本次拖拽后变成“无父” ——
|
|
623
790
|
for (const id of changedIds) {
|
|
624
|
-
const node =
|
|
791
|
+
const node = shapeMap.value.get(id) ?? null
|
|
625
792
|
if (node?.shapeType === 'pin') {
|
|
626
793
|
const prevPid = prevParentById[id]
|
|
627
794
|
const nowPid = node.parenShapeId ?? null
|
|
@@ -632,9 +799,9 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
632
799
|
}
|
|
633
800
|
|
|
634
801
|
// 更新相关 edge 的 waypoints
|
|
635
|
-
EdgeUtils.
|
|
802
|
+
await EdgeUtils.updateRelatedEdgesAsync(shapes.value, changedIds, (shape) => {
|
|
636
803
|
updateShape(shape.id, shape)
|
|
637
|
-
})
|
|
804
|
+
}, edgesByNodeId.value, shapeMap.value)
|
|
638
805
|
//对“本次直接拖动的隔间”做一次自动扩容检查
|
|
639
806
|
autoExpandMovedCompartmentsAfterDrag(shapes.value, changedIds, updateShape)
|
|
640
807
|
// 把 clone 也并入“需要同步 comparents 的变更集合”
|
|
@@ -655,7 +822,7 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
655
822
|
// 在生成 payloads 之前,把父扩容先做掉
|
|
656
823
|
const shapeId = ownerPayload?.shapeId
|
|
657
824
|
if (shapeId != null) {
|
|
658
|
-
const child =
|
|
825
|
+
const child = shapeMap.value.get(shapeId) ?? null
|
|
659
826
|
if (child) {
|
|
660
827
|
expandParentByChild({
|
|
661
828
|
shapes: shapes.value,
|
|
@@ -696,16 +863,45 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
696
863
|
cleanupAfterDrag()
|
|
697
864
|
}
|
|
698
865
|
// 处理缩放结束后的事件发射
|
|
699
|
-
const endResizeShape = (id: string) => {
|
|
866
|
+
const endResizeShape = async (id: string) => {
|
|
700
867
|
// 更新相关edge的waypoints
|
|
701
|
-
EdgeUtils.
|
|
868
|
+
await EdgeUtils.updateRelatedEdgesAsync(shapes.value, [id], (shape) => {
|
|
702
869
|
updateShape(shape.id, shape);
|
|
703
|
-
});
|
|
870
|
+
}, edgesByNodeId.value, shapeMap.value);
|
|
871
|
+
|
|
872
|
+
// 重新计算子栓/端口的位置(父图元缩放后,栓需要贴合新的边缘)
|
|
873
|
+
const parentShape = shapeMap.value.get(id);
|
|
874
|
+
if (parentShape) {
|
|
875
|
+
const childIds = parentChildMap.value.get(id) ?? [];
|
|
876
|
+
for (const childId of childIds) {
|
|
877
|
+
const childShape = shapeMap.value.get(childId);
|
|
878
|
+
if (!childShape) continue;
|
|
879
|
+
if (
|
|
880
|
+
pinsTypes.value.includes(childShape.shapeKey) ||
|
|
881
|
+
portsTypes.value.includes(childShape.shapeKey)
|
|
882
|
+
) {
|
|
883
|
+
// 用栓的中心点作为参考点,重新吸附到父图元最近的边
|
|
884
|
+
const pb = childShape.bounds ?? {};
|
|
885
|
+
const pinCenterX = (pb.x ?? 0) + (pb.width ?? 0) / 2;
|
|
886
|
+
const pinCenterY = (pb.y ?? 0) + (pb.height ?? 0) / 2;
|
|
887
|
+
const newPos = snapPinToParentEdge(
|
|
888
|
+
{ x: pinCenterX, y: pinCenterY },
|
|
889
|
+
parentShape,
|
|
890
|
+
childShape
|
|
891
|
+
);
|
|
892
|
+
updateShape(childId, {
|
|
893
|
+
bounds: { ...childShape.bounds, x: newPos.x, y: newPos.y },
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
704
898
|
|
|
705
899
|
// 收集受影响的元素
|
|
706
900
|
const affected = new Set<string>();
|
|
707
901
|
affected.add(id);
|
|
708
|
-
|
|
902
|
+
// 将缩放图元的所有子孙(包括栓/端口)加入受影响集合
|
|
903
|
+
collectDescendantIds(shapes.value, id).forEach(cid => affected.add(cid));
|
|
904
|
+
const parentId = shapeMap.value.get(id)?.parenShapeId ?? null;
|
|
709
905
|
if (parentId) {
|
|
710
906
|
affected.add(parentId);
|
|
711
907
|
collectDescendantIds(shapes.value, parentId).forEach(cid => affected.add(cid));
|
|
@@ -716,8 +912,8 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
716
912
|
let cur: string | null = affectedId;
|
|
717
913
|
let guard = 0;
|
|
718
914
|
while (cur && guard++ < 1000) {
|
|
719
|
-
const s =
|
|
720
|
-
const p = s ? (s as any).parenShapeId ?? null : null;
|
|
915
|
+
const s: Shape | null = shapeMap.value.get(cur!) ?? null;
|
|
916
|
+
const p: string | null = s ? (s as any).parenShapeId ?? null : null;
|
|
721
917
|
if (!p) break;
|
|
722
918
|
affected.add(p);
|
|
723
919
|
cur = p;
|
|
@@ -726,9 +922,10 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
726
922
|
|
|
727
923
|
// 组装并派发shape-drag-end事件
|
|
728
924
|
const payloads = Array.from(affected)
|
|
729
|
-
.map(affectedId =>
|
|
925
|
+
.map(affectedId => shapeMap.value.get(affectedId))
|
|
730
926
|
.filter(Boolean)
|
|
731
927
|
.map(s => _.cloneDeep(s!)) as Shape[];
|
|
928
|
+
adjustCanvasToFitAllShapes()
|
|
732
929
|
eventBus.emit('shape-drag-end', payloads,);
|
|
733
930
|
};
|
|
734
931
|
|
|
@@ -793,10 +990,10 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
793
990
|
* 初始化所有连线的端点
|
|
794
991
|
* 用于在初始加载后端数据后,自动计算所有连线的合适端点,避免线横跨图元
|
|
795
992
|
*/
|
|
796
|
-
const initializeAllEdgeEndpoints = () => {
|
|
797
|
-
EdgeUtils.
|
|
993
|
+
const initializeAllEdgeEndpoints = async () => {
|
|
994
|
+
await EdgeUtils.initializeAllEdgeEndpointsAsync(shapes.value, (shape) => {
|
|
798
995
|
updateShape(shape.id, shape);
|
|
799
|
-
});
|
|
996
|
+
}, shapeMap.value);
|
|
800
997
|
}
|
|
801
998
|
/**
|
|
802
999
|
* 由“子元素数据”触发的扩父入口:
|
|
@@ -806,12 +1003,13 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
806
1003
|
*/
|
|
807
1004
|
const collectAncestors = (shapes: Shape[], id: string) => {
|
|
808
1005
|
const out: string[] = []
|
|
809
|
-
|
|
1006
|
+
const map = shapeMap.value
|
|
1007
|
+
let cur = map.get(id)
|
|
810
1008
|
while (cur) {
|
|
811
1009
|
out.push(cur.id)
|
|
812
1010
|
const pid = cur.parenShapeId
|
|
813
1011
|
if (!pid) break
|
|
814
|
-
cur =
|
|
1012
|
+
cur = map.get(pid)
|
|
815
1013
|
}
|
|
816
1014
|
return out
|
|
817
1015
|
}
|
|
@@ -827,7 +1025,7 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
827
1025
|
const before = new Map(
|
|
828
1026
|
chainIds.map(id => [
|
|
829
1027
|
id,
|
|
830
|
-
JSON.stringify(
|
|
1028
|
+
JSON.stringify(shapeMap.value.get(id)?.bounds ?? {}),
|
|
831
1029
|
]),
|
|
832
1030
|
)
|
|
833
1031
|
|
|
@@ -840,7 +1038,7 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
840
1038
|
|
|
841
1039
|
const payload: ShapeSizeUpdatePayload[] = chainIds
|
|
842
1040
|
.filter(id => id !== child.id)
|
|
843
|
-
.map(id =>
|
|
1041
|
+
.map(id => shapeMap.value.get(id))
|
|
844
1042
|
.filter((s): s is Shape => !!s)
|
|
845
1043
|
.filter(s => before.get(s.id) !== JSON.stringify(s.bounds ?? {})) // diff
|
|
846
1044
|
.map(s => ({ id: s.id, bounds: JSON.stringify(s.bounds ?? {}) }))
|
|
@@ -893,6 +1091,7 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
893
1091
|
canOperate,
|
|
894
1092
|
cutShapeIds, // 剪切状态的图元 ID 集合
|
|
895
1093
|
copiedShapesCount, // 剪贴板中图元的数量
|
|
1094
|
+
matrixData,
|
|
896
1095
|
//图元shapeKey
|
|
897
1096
|
taggedValueLabels,
|
|
898
1097
|
packagesTypes,
|
|
@@ -905,6 +1104,7 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
905
1104
|
hasSelectedShape,
|
|
906
1105
|
parentChildMap, // 父子关系索引映射
|
|
907
1106
|
shapeMap, // 图元ID索引映射 (性能优化)
|
|
1107
|
+
edgesByNodeId, // 连线索引映射 (性能优化)
|
|
908
1108
|
marqueeShapes,
|
|
909
1109
|
ghostShadow,
|
|
910
1110
|
scales,
|
|
@@ -949,13 +1149,6 @@ export const useGraphStore = defineStore('graph', () => {
|
|
|
949
1149
|
setCutShapeIds,
|
|
950
1150
|
clearCutShapeIds,
|
|
951
1151
|
setCopiedShapesCount,
|
|
1152
|
+
setMatrixData,
|
|
952
1153
|
}
|
|
953
|
-
}
|
|
954
|
-
//配置持久化
|
|
955
|
-
{
|
|
956
|
-
//@ts-ignore
|
|
957
|
-
persist: {
|
|
958
|
-
paths: ['shapes', 'selectedShape']
|
|
959
|
-
} as any,
|
|
960
|
-
}
|
|
961
|
-
)
|
|
1154
|
+
})
|
package/src/types/index.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface Shape {
|
|
|
77
77
|
diagramId: string // 画布ID
|
|
78
78
|
parenShapeId: string // 父图元ID(图元嵌套)
|
|
79
79
|
shapeKey: string // 具体图元类型(即模型类型)
|
|
80
|
-
shapeType: 'shape' | 'edge' | 'pin' | 'diagram' // 图形大类
|
|
80
|
+
shapeType: 'shape' | 'edge' | 'pin' | 'diagram' | 'gantt' | 'table' | 'matrix' // 图形大类
|
|
81
81
|
bounds: Bounds // 整体图元位置大小
|
|
82
82
|
style?: Style // 图元样式,JSON字符串
|
|
83
83
|
keywords: string // 关键字
|
|
@@ -112,6 +112,44 @@ export interface Shape {
|
|
|
112
112
|
targetCreateModel?: string // 允许的目标图元字符串
|
|
113
113
|
sourceModelId?: string // 允许的源图元字符串
|
|
114
114
|
isMovableComparents: boolean//是否能拖出隔间
|
|
115
|
+
ganttData?: GanttData[]
|
|
116
|
+
attributeColumns?: GanttColumn[] // 列配置
|
|
117
|
+
ganttContainsModels?: GanttContainsModel[] // 甘特图可新增的模型列表
|
|
118
|
+
}
|
|
119
|
+
export interface GanttColumn {
|
|
120
|
+
id?: number // 列ID(后端返回)
|
|
121
|
+
propertyId?: number // 属性ID(后端返回)
|
|
122
|
+
projectId?: string // 项目ID(后端返回)
|
|
123
|
+
modelId?: string // 模型ID(后端返回)
|
|
124
|
+
configId: string // 列配置标识(如 "NamedElement.name")
|
|
125
|
+
name: string // 列显示名称
|
|
126
|
+
isShow: boolean // 是否显示
|
|
127
|
+
isReadonly: boolean // 是否只读
|
|
128
|
+
}
|
|
129
|
+
export interface GanttContainsModel {
|
|
130
|
+
projectId: string // 项目id
|
|
131
|
+
ownerId: string // 所属者id
|
|
132
|
+
type: string // 模型类型
|
|
133
|
+
name: string // 模型名称
|
|
134
|
+
isChart: boolean // 是否为图表
|
|
135
|
+
icon: string // 模型图标
|
|
136
|
+
}
|
|
137
|
+
export interface GanttData {
|
|
138
|
+
id: string // 行唯一标识
|
|
139
|
+
modelId: string // 模型ID
|
|
140
|
+
ganttOrTableModelId: string // 甘特图/表格模型ID
|
|
141
|
+
projectId: string // 项目ID
|
|
142
|
+
type: string // 模型类型
|
|
143
|
+
sort: string // 排序
|
|
144
|
+
// 动态字段:字段名为 configId,值为对应的数据
|
|
145
|
+
// 例如:'NamedElement.name': '企业全生命周期'
|
|
146
|
+
// 'ActualState.startDate': '2026-01-15'
|
|
147
|
+
// 'Element.owner': { id: '...', nodeName: '...', icon: '...', modelTypeName: null }
|
|
148
|
+
[key: string]: any
|
|
149
|
+
}
|
|
150
|
+
export interface ModelProperty {
|
|
151
|
+
id: string // 属性id
|
|
152
|
+
name: string // 属性名称
|
|
115
153
|
}
|
|
116
154
|
export interface CompartmentRecord {
|
|
117
155
|
bounds: Bounds // 整个父隔间的大小位置
|
|
@@ -210,6 +248,51 @@ export interface locationChart {
|
|
|
210
248
|
modelIcon: string //图表图标
|
|
211
249
|
}
|
|
212
250
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
251
|
+
export interface TreeNode {
|
|
252
|
+
id: string;
|
|
253
|
+
nodeName: string;
|
|
254
|
+
modelName: string;
|
|
255
|
+
nodeType: string;
|
|
256
|
+
modelTypeName?: null;
|
|
257
|
+
elementId?: string | null;
|
|
258
|
+
parentId?: null | string;
|
|
259
|
+
isChildren?: boolean;
|
|
260
|
+
isLeaf?: boolean; // 标识是否为叶子节点
|
|
261
|
+
children?: TreeNode[];
|
|
262
|
+
expanded?: boolean; // 节点是否展开
|
|
263
|
+
isReName?: boolean;
|
|
264
|
+
isChart: boolean;
|
|
265
|
+
isCreate?: boolean; //是否可以创建图表
|
|
266
|
+
isCanvas?: string; //是否可以拖拽到画布
|
|
267
|
+
icon?: string; // 图标文件名,用于 getIcon 加载
|
|
268
|
+
modelRelationld?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface Matrix {
|
|
272
|
+
rowTree: TreeNode[];
|
|
273
|
+
columnTree: TreeNode[];
|
|
274
|
+
crossData: ColumnHeaderCell[];
|
|
275
|
+
relationModelIcon: string;
|
|
276
|
+
relationModelName: string;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface MatrixNode {
|
|
280
|
+
rowNodeld: string;
|
|
281
|
+
columnNodeld: string; // 列节点ID
|
|
282
|
+
value: string;
|
|
283
|
+
relationld: string;//关系ID(如果有连线)
|
|
284
|
+
relationType: string;//关系类型(箭头类型)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface ColumnHeaderCell {
|
|
288
|
+
columnNodeId: string;
|
|
289
|
+
rowNodeId: string;
|
|
290
|
+
value: string;
|
|
291
|
+
relations: Relation[];
|
|
292
|
+
operable: boolean;
|
|
293
|
+
}
|
|
294
|
+
export interface Relation {
|
|
295
|
+
relationId: string;
|
|
296
|
+
relationType: string;
|
|
297
|
+
type: string;
|
|
298
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Shape } from '@/types'
|
|
2
2
|
import { ensureParentFitsChildren } from './containers'
|
|
3
|
+
import { useGraphStore } from '../store/graphStore'
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* 批量自动扩展所有父容器以适应其子元素
|
|
@@ -23,12 +24,14 @@ export function batchAutoExpandParents(
|
|
|
23
24
|
|
|
24
25
|
if (parentIds.size === 0) return
|
|
25
26
|
|
|
27
|
+
const _sm = useGraphStore().shapeMap
|
|
28
|
+
|
|
26
29
|
// 2. 按深度排序(深度大的先处理,从内到外)
|
|
27
30
|
const parentsWithDepth = Array.from(parentIds)
|
|
28
31
|
.map(id => ({
|
|
29
32
|
id,
|
|
30
|
-
depth: getDepth(
|
|
31
|
-
shape:
|
|
33
|
+
depth: getDepth(_sm, id),
|
|
34
|
+
shape: _sm.get(id)
|
|
32
35
|
}))
|
|
33
36
|
.filter(p => p.shape)
|
|
34
37
|
.sort((a, b) => b.depth - a.depth) // 深度大的在前
|
|
@@ -42,19 +45,15 @@ export function batchAutoExpandParents(
|
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @param shapes - 所有图元数据
|
|
47
|
-
* @param id - 要计算深度的图元 ID
|
|
48
|
-
* @returns 嵌套深度(0 表示顶层)
|
|
48
|
+
* 计算图元的嵌套深度(使用 shapeMap O(1) 查找)
|
|
49
49
|
*/
|
|
50
|
-
function getDepth(
|
|
50
|
+
function getDepth(shapeMap: Map<string, Shape>, id: string): number {
|
|
51
51
|
let depth = 0
|
|
52
|
-
let current =
|
|
52
|
+
let current = shapeMap.get(id)
|
|
53
53
|
|
|
54
54
|
while (current?.parenShapeId) {
|
|
55
55
|
depth++
|
|
56
|
-
current =
|
|
57
|
-
// 防止循环引用导致无限循环
|
|
56
|
+
current = shapeMap.get(current.parenShapeId)
|
|
58
57
|
if (depth > 100) {
|
|
59
58
|
console.warn(`检测到可能的循环引用,图元 ID: ${id}`)
|
|
60
59
|
break
|