feat: 更换模型时,重置所有选项
This commit is contained in:
parent
2706a0c732
commit
18cedb5d14
|
|
@ -173,6 +173,8 @@ import AttachmentPreview from "./AttachmentPreview.vue";
|
|||
import { generateId } from "@/utils/helpers";
|
||||
import type { Attachment } from "@/types/chat";
|
||||
import { chatApi } from "@/services/api";
|
||||
import { useAuthStore } from "@/stores/auth";
|
||||
import { useSettingsStore } from "@/stores/settings";
|
||||
|
||||
interface AttachmentWithProgress extends Attachment {
|
||||
uploading?: boolean;
|
||||
|
|
@ -216,6 +218,9 @@ const emit = defineEmits<{
|
|||
}>();
|
||||
|
||||
// 响应式状态
|
||||
const authStore = useAuthStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
|
||||
const inputText = ref("");
|
||||
const attachments = ref<AttachmentWithProgress[]>([]);
|
||||
const isFocused = ref(false);
|
||||
|
|
@ -467,6 +472,15 @@ watch(inputText, () => {
|
|||
autoResize();
|
||||
});
|
||||
});
|
||||
// 监听模型变化,重置选项功能
|
||||
watch(
|
||||
() => settingsStore.settings.defaultModel,
|
||||
() => {
|
||||
isDeepSearch.value = false;
|
||||
isDeepThinking.value = false;
|
||||
isWebSearch.value = false;
|
||||
},
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
autoResize();
|
||||
|
|
|
|||
|
|
@ -212,6 +212,11 @@ function selectModel(modelId: string, modelName: string) {
|
|||
localStorage.setItem("modelSelect", modelName);
|
||||
settingsStore.setSelectedModelId(modelId); // 更新选中的模型 ID
|
||||
showModelMenu.value = false;
|
||||
|
||||
// 切换模型时重置搜索和思考参数
|
||||
localStorage.setItem("isDeepSearch", "false");
|
||||
localStorage.setItem("isDeepThinking", "false");
|
||||
localStorage.setItem("isWebSearch", "false");
|
||||
}
|
||||
|
||||
// 方法
|
||||
|
|
|
|||
Loading…
Reference in New Issue