fix: 前端优化记忆模型切换体验 - 切换无记忆模型时暂存记忆、切换恢复、保存配置后才真正清除

This commit is contained in:
rainv123
2026-04-01 14:32:30 +08:00
parent 2aee1bf567
commit 3c2024d00d
2 changed files with 18 additions and 0 deletions
@@ -385,6 +385,7 @@ export default {
speed: 0,
pitch: 0
},
tempSummaryMemory: "",
form: {
agentCode: "",
agentName: "",
@@ -596,6 +597,7 @@ export default {
fetchAgentConfig(agentId) {
Api.agent.getDeviceConfig(agentId, ({ data }) => {
if (data.code === 0) {
this.tempSummaryMemory = "";
this.form = {
...this.form,
...data.data,
@@ -818,6 +820,13 @@ export default {
// 有记忆功能的模型,默认记录文本和语音
this.form.chatHistoryConf = 2;
}
if (value === "Memory_nomem" || value === "Memory_mem_report_only") {
this.tempSummaryMemory = this.form.summaryMemory;
this.form.summaryMemory = "";
} else if (this.tempSummaryMemory !== "" && this.form.summaryMemory === "") {
this.form.summaryMemory = this.tempSummaryMemory;
this.tempSummaryMemory = "";
}
}
if (type === "LLM") {
// 当LLM类型改变时,更新意图识别选项的可见性