fix: 注释掉调试日志以清理控制台输出
This commit is contained in:
@@ -153,7 +153,7 @@ async function loadComponentModule(type: string) {
|
||||
[type]: module,
|
||||
};
|
||||
|
||||
console.log(`Loaded module for ${type}:`, module);
|
||||
// console.log(`Loaded module for ${type}:`, module);
|
||||
} catch (error) {
|
||||
console.error(`Failed to load component module ${type}:`, error);
|
||||
return null;
|
||||
@@ -164,7 +164,7 @@ async function loadComponentModule(type: string) {
|
||||
|
||||
// 处理组件模块加载请求
|
||||
async function handleLoadComponentModule(type: string) {
|
||||
console.log("Handling load component module request for:", type);
|
||||
// console.log("Handling load component module request for:", type);
|
||||
await loadComponentModule(type);
|
||||
}
|
||||
|
||||
@@ -267,9 +267,9 @@ async function handleAddComponent(componentData: {
|
||||
) {
|
||||
try {
|
||||
capsPage = componentModule.default.getCapabilities();
|
||||
console.log(`获取到${componentData.type}组件的能力页面`);
|
||||
// console.log(`获取到${componentData.type}组件的能力页面`);
|
||||
} catch (error) {
|
||||
console.error(`获取${componentData.type}组件能力页面失败:`, error);
|
||||
// console.error(`获取${componentData.type}组件能力页面失败:`, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,16 +349,16 @@ async function handleAddTemplate(templateData: {
|
||||
// 计算视口中心点的坐标 (与handleAddComponent函数中的方法相同)
|
||||
viewportCenter.x = (viewportWidth / 2 - position.x) / scale;
|
||||
viewportCenter.y = (viewportHeight / 2 - position.y) / scale;
|
||||
console.log(
|
||||
`=== 计算的视口中心: x=${viewportCenter.x}, y=${viewportCenter.y}, scale=${scale}`,
|
||||
);
|
||||
// console.log(
|
||||
// `=== 计算的视口中心: x=${viewportCenter.x}, y=${viewportCenter.y}, scale=${scale}`,
|
||||
// );
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("获取视口中心位置时出错:", error);
|
||||
}
|
||||
|
||||
console.log("=== 使用视口中心添加模板组件:", viewportCenter);
|
||||
// console.log("=== 使用视口中心添加模板组件:", viewportCenter);
|
||||
|
||||
// 找到模板中的主要组件(假设是第一个组件)
|
||||
const mainPart = templateData.template.parts[0];
|
||||
@@ -398,9 +398,9 @@ async function handleAddTemplate(templateData: {
|
||||
newPart.x = viewportCenter.x + relativeX;
|
||||
newPart.y = viewportCenter.y + relativeY;
|
||||
|
||||
console.log(
|
||||
`=== 组件[${newPart.id}]位置调整: (${oldX},${oldY}) -> (${newPart.x},${newPart.y})`,
|
||||
);
|
||||
// console.log(
|
||||
// `=== 组件[${newPart.id}]位置调整: (${oldX},${oldY}) -> (${newPart.x},${newPart.y})`,
|
||||
// );
|
||||
}
|
||||
|
||||
return newPart;
|
||||
@@ -541,7 +541,6 @@ async function handleComponentSelected(componentData: DiagramPart | null) {
|
||||
// 处理图表数据更新事件
|
||||
function handleDiagramUpdated(data: DiagramData) {
|
||||
diagramData.value = data;
|
||||
console.log("Diagram data updated:", data);
|
||||
}
|
||||
|
||||
// 处理组件移动事件
|
||||
|
||||
Reference in New Issue
Block a user