fix: 文件数量变化时仅重新生成问题(如果配置了),不再自动生成思维导图

This commit is contained in:
Wenjie Zhang 2025-12-13 15:59:00 +08:00
parent 1b0bbeb5f3
commit c196aaca03

View File

@ -242,30 +242,10 @@ watch(
return;
}
//
//
if (newFileCount !== oldFileCount) {
const changeType = newFileCount > oldFileCount ? '增加' : '减少';
console.log(`文件数量从 ${oldFileCount} ${changeType}${newFileCount},准备重新生成问题和思维导图`);
//
if (newFileCount > 0) {
setTimeout(() => {
if (mindmapSectionRef.value) {
if (oldFileCount === 0) {
//
console.log('首次添加文件,生成思维导图');
mindmapSectionRef.value.generateMindmap();
} else {
//
console.log(`文件数量变化,重新生成思维导图`);
mindmapSectionRef.value.refreshMindmap();
}
}
}, 2000); // 2
} else {
// 0
console.log('文件数量为0思维导图将自动清空');
}
console.log(`文件数量从 ${oldFileCount} ${changeType}${newFileCount},准备重新生成问题`);
//
if (newFileCount > 0) {