fix: Componnent will reset when select of drag
This commit is contained in:
parent
3fb59af2dd
commit
c7907b4253
|
@ -564,14 +564,14 @@ function onComponentDrag(e: MouseEvent) {
|
|||
);
|
||||
|
||||
// 更新这些组件的位置
|
||||
// for (const groupComp of groupComponents) {
|
||||
// diagramData.value = updatePartPosition(
|
||||
// diagramData.value,
|
||||
// groupComp.id,
|
||||
// groupComp.x + deltaX,
|
||||
// groupComp.y + deltaY,
|
||||
// );
|
||||
// }
|
||||
for (const groupComp of groupComponents) {
|
||||
diagramData.value = updatePartPosition(
|
||||
diagramData.value,
|
||||
groupComp.id,
|
||||
groupComp.x + deltaX,
|
||||
groupComp.y + deltaY,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 通知父组件位置已更新
|
||||
|
|
|
@ -209,7 +209,7 @@ function updateDDSProperties(newProperties: any) {
|
|||
}
|
||||
|
||||
// 存储当前选中组件的能力组件
|
||||
const capabilityComponent = shallowRef(null);
|
||||
const capabilityComponent = shallowRef<JSX.Element>();
|
||||
|
||||
// 获取组件实例上暴露的方法
|
||||
async function getExposedCapabilities(componentType: string) {
|
||||
|
@ -275,12 +275,17 @@ watch(
|
|||
if (newComponentData && newComponentData.type) {
|
||||
try {
|
||||
// 首先尝试从实例中获取暴露的方法
|
||||
const capsComponent = await getExposedCapabilities(
|
||||
newComponentData.type,
|
||||
);
|
||||
let capsComponent = null;
|
||||
if (!isUndefined( newComponentData.capsPage ) && !isNull(newComponentData.capsPage)) {
|
||||
capsComponent = newComponentData.capsPage;
|
||||
capabilityComponent.value = markRaw(capsComponent);
|
||||
}
|
||||
else
|
||||
capsComponent = await getExposedCapabilities(newComponentData.type);
|
||||
|
||||
if (capsComponent) {
|
||||
capabilityComponent.value = markRaw(capsComponent);
|
||||
newComponentData.capsPage = capsComponent;
|
||||
console.log(`已从实例加载${newComponentData.type}组件的能力页面`);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ const eqps = useEquipments();
|
|||
const bitstreamFile = ref<File | null>();
|
||||
|
||||
watchEffect(() => {
|
||||
console.log(
|
||||
console.trace(
|
||||
`board监听改动: ${props.size} ${props.boardAddr}:${props.boardPort}`,
|
||||
);
|
||||
eqps.setAddr(props.boardAddr);
|
||||
|
|
Loading…
Reference in New Issue