fix: 修复应用设置页面清空 AI 模型报错

This commit is contained in:
shaohuzhang1 2024-08-27 11:58:26 +08:00 committed by shaohuzhang1
parent b40b4e5305
commit 9febff2200
3 changed files with 18 additions and 6 deletions

View File

@ -451,8 +451,12 @@ const submit = async (formEl: FormInstance | undefined) => {
}
})
}
const model_change = (model_id: string) => {
AIModeParamSettingDialogRef.value?.reset_default(model_id)
const model_change = (model_id?: string) => {
if (model_id) {
AIModeParamSettingDialogRef.value?.reset_default(model_id)
} else {
refreshForm({})
}
}
const openAIParamSettingDialog = () => {
const model_id = applicationForm.value.model_id

View File

@ -239,8 +239,12 @@ function submitDialog() {
set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value)
dialogVisible.value = false
}
const model_change = (model_id: string) => {
AIModeParamSettingDialogRef.value?.reset_default(model_id)
const model_change = (model_id?: string) => {
if (model_id) {
AIModeParamSettingDialogRef.value?.reset_default(model_id)
} else {
refreshParam({})
}
}
const {
params: { id }

View File

@ -232,8 +232,12 @@ function openDialog() {
cloneContent.value = form_data.value.prompt
dialogVisible.value = true
}
const model_change = (model_id: string) => {
AIModeParamSettingDialogRef.value?.reset_default(model_id)
const model_change = (model_id?: string) => {
if (model_id) {
AIModeParamSettingDialogRef.value?.reset_default(model_id)
} else {
refreshParam({})
}
}
function submitDialog() {
set(props.nodeModel.properties.node_data, 'prompt', cloneContent.value)