fix: Componnent will reset when select of drag

This commit is contained in:
SikongJueluo 2025-05-17 15:49:54 +08:00
parent 3fb59af2dd
commit c7907b4253
No known key found for this signature in database
3 changed files with 18 additions and 13 deletions

View File

@ -564,14 +564,14 @@ function onComponentDrag(e: MouseEvent) {
); );
// //
// for (const groupComp of groupComponents) { for (const groupComp of groupComponents) {
// diagramData.value = updatePartPosition( diagramData.value = updatePartPosition(
// diagramData.value, diagramData.value,
// groupComp.id, groupComp.id,
// groupComp.x + deltaX, groupComp.x + deltaX,
// groupComp.y + deltaY, groupComp.y + deltaY,
// ); );
// } }
} }
// //

View File

@ -209,7 +209,7 @@ function updateDDSProperties(newProperties: any) {
} }
// //
const capabilityComponent = shallowRef(null); const capabilityComponent = shallowRef<JSX.Element>();
// //
async function getExposedCapabilities(componentType: string) { async function getExposedCapabilities(componentType: string) {
@ -275,12 +275,17 @@ watch(
if (newComponentData && newComponentData.type) { if (newComponentData && newComponentData.type) {
try { try {
// //
const capsComponent = await getExposedCapabilities( let capsComponent = null;
newComponentData.type, if (!isUndefined( newComponentData.capsPage ) && !isNull(newComponentData.capsPage)) {
); capsComponent = newComponentData.capsPage;
capabilityComponent.value = markRaw(capsComponent);
}
else
capsComponent = await getExposedCapabilities(newComponentData.type);
if (capsComponent) { if (capsComponent) {
capabilityComponent.value = markRaw(capsComponent); capabilityComponent.value = markRaw(capsComponent);
newComponentData.capsPage = capsComponent;
console.log(`已从实例加载${newComponentData.type}组件的能力页面`); console.log(`已从实例加载${newComponentData.type}组件的能力页面`);
return; return;
} }

View File

@ -34,7 +34,7 @@ const eqps = useEquipments();
const bitstreamFile = ref<File | null>(); const bitstreamFile = ref<File | null>();
watchEffect(() => { watchEffect(() => {
console.log( console.trace(
`board监听改动: ${props.size} ${props.boardAddr}:${props.boardPort}`, `board监听改动: ${props.size} ${props.boardAddr}:${props.boardPort}`,
); );
eqps.setAddr(props.boardAddr); eqps.setAddr(props.boardAddr);