diff --git a/.cursor/rules/md_output.mdc b/.cursor/rules/md_output.mdc new file mode 100644 index 00000000..165c616b --- /dev/null +++ b/.cursor/rules/md_output.mdc @@ -0,0 +1,11 @@ +--- +description: 用于规范输出markdown内容 +globs: +--- +Format your response in markdown according to the following requirements: + +- When proposing an edit to a markdown file, first evaluate whether the content will contain code snippets +- If the content contains no code snippets, enclose the entire response in backticks with 'markdown' as the language identifier +- If the content includes code snippets, ensure all code blocks are indented with exactly 2 spaces and specify the correct language for proper rendering +- Only 2-space indentation is allowed for code blocks - level 0 and 4 space indentations are not permitted +- Automatically correct any code block indentation that doesn't follow the 2-space rule diff --git a/.cursor/rules/高级项目审计师.md b/.cursor/rules/高级项目审计师.mdc similarity index 98% rename from .cursor/rules/高级项目审计师.md rename to .cursor/rules/高级项目审计师.mdc index 0b6098f5..7de2d158 100644 --- a/.cursor/rules/高级项目审计师.md +++ b/.cursor/rules/高级项目审计师.mdc @@ -1,3 +1,7 @@ +--- +description: 用于项目进度审计 +globs: +--- # Role:高级项目审计师 ## Background:项目进度文档是项目管理的重要组成部分,它记录了项目的进展情况、时间安排和功能实现等关键信息。然而,由于各种原因,项目进度文档中可能存在虚假项,如不真实的时间估算、未实现的功能等。这些虚假项会严重影响项目决策,导致项目延期、成本超支甚至失败。因此,对项目进度文档进行严格的审计和复核至关重要。 diff --git a/src/App.vue b/src/App.vue index 43100ceb..b70a6d0b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -450,25 +450,34 @@ const handleTest = async () => { } }; -const handleSelectHistory = (item) => { - // 如果是迭代记录,需要找到原始的提示词 - if (item.type === 'iterate') { - // 从历史记录中找到对应的链 - const chain = history.value.find(c => c.chainId === item.chainId); - if (chain) { - prompt.value = chain.rootRecord.originalPrompt; - currentVersions.value = chain.versions; - currentVersionId.value = item.id; - } - } else { - prompt.value = item.originalPrompt; - const chain = history.value.find(c => c.chainId === item.chainId); - if (chain) { - currentVersions.value = chain.versions; - currentVersionId.value = item.id; - } - } - optimizedPrompt.value = item.optimizedPrompt; +const handleSelectHistory = (context) => { + const { record, chainId, rootPrompt } = context; + + // 设置原始提示词 + prompt.value = rootPrompt; + // 设置优化后的提示词 + optimizedPrompt.value = record.optimizedPrompt; + + // 创建新的chain + const newRecord = historyManager.createNewChain({ + id: uuidv4(), + originalPrompt: rootPrompt, + optimizedPrompt: record.optimizedPrompt, + type: 'optimize', + modelKey: record.modelKey, + templateId: record.templateId, + timestamp: Date.now(), + metadata: {} + }); + + // 更新当前chain信息 + currentChainId.value = newRecord.chainId; + currentVersions.value = newRecord.versions; + currentVersionId.value = newRecord.currentRecord.id; + + // 更新历史记录 + history.value = historyManager.getAllChains(); + showHistory.value = false; } diff --git a/src/components/HistoryDrawer.vue b/src/components/HistoryDrawer.vue index 6bd6e404..e953117e 100644 --- a/src/components/HistoryDrawer.vue +++ b/src/components/HistoryDrawer.vue @@ -30,10 +30,10 @@