mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复模型保存无法回显问题
This commit is contained in:
parent
41a5771aa7
commit
2a2c3c9af3
|
|
@ -694,7 +694,7 @@ class ApplicationSerializer(serializers.Serializer):
|
|||
|
||||
update_keys = ['name', 'desc', 'model_id', 'multiple_rounds_dialogue', 'prologue', 'status',
|
||||
'dataset_setting', 'model_setting', 'problem_optimization',
|
||||
'api_key_is_active', 'icon', 'work_flow']
|
||||
'api_key_is_active', 'icon', 'work_flow', 'model_params_setting']
|
||||
for update_key in update_keys:
|
||||
if update_key in instance and instance.get(update_key) is not None:
|
||||
if update_key == 'multiple_rounds_dialogue':
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
<span>AI 模型<span class="danger">*</span></span>
|
||||
</div>
|
||||
<el-button
|
||||
:disabled="!chat_data.model_id"
|
||||
type="primary"
|
||||
link
|
||||
@click="openAIParamSettingDialog(chat_data.model_id)"
|
||||
|
|
@ -313,7 +314,7 @@ const openCreateModel = (provider?: Provider) => {
|
|||
|
||||
const openAIParamSettingDialog = (modelId: string) => {
|
||||
if (modelId) {
|
||||
AIModeParamSettingDialogRef.value?.open(modelId)
|
||||
AIModeParamSettingDialogRef.value?.open(modelId,chat_data.value.model_params_setting)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,9 @@
|
|||
class="mb-24"
|
||||
label-width="auto"
|
||||
ref="questionNodeFormRef"
|
||||
hide-required-asterisk
|
||||
>
|
||||
<el-form-item
|
||||
<el-form-item
|
||||
label="AI 模型"
|
||||
prop="model_id"
|
||||
:rules="{
|
||||
|
|
@ -24,6 +25,22 @@
|
|||
trigger: 'change'
|
||||
}"
|
||||
>
|
||||
<template #label>
|
||||
<div class="flex-between">
|
||||
<div>
|
||||
<span>AI 模型<span class="danger">*</span></span>
|
||||
</div>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="!form_data.model_id"
|
||||
@click="openAIParamSettingDialog(form_data.model_id)"
|
||||
@refreshForm="refreshParam"
|
||||
>
|
||||
{{ $t('views.application.applicationForm.form.paramSetting') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-select
|
||||
@wheel="wheel"
|
||||
@keydown="isKeyDown = true"
|
||||
|
|
@ -195,6 +212,7 @@ import useStore from '@/stores'
|
|||
import { relatedObject } from '@/utils/utils'
|
||||
import type { Provider } from '@/api/type/model'
|
||||
import { isLastNode } from '@/workflow/common/data'
|
||||
const AIModeParamSettingDialogRef = ref<InstanceType<typeof AIModeParamSettingDialog>>()
|
||||
|
||||
const { model } = useStore()
|
||||
const isKeyDown = ref(false)
|
||||
|
|
@ -235,6 +253,11 @@ function refreshParam(data: any) {
|
|||
set(props.nodeModel.properties.node_data, 'model_params_setting', data)
|
||||
}
|
||||
|
||||
const openAIParamSettingDialog = (modelId: string) => {
|
||||
if (modelId) {
|
||||
AIModeParamSettingDialogRef.value?.open(modelId,form_data.value.model_params_setting)
|
||||
}
|
||||
}
|
||||
const form_data = computed({
|
||||
get: () => {
|
||||
if (props.nodeModel.properties.node_data) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue