fix: 修复创建模型,不显示参数的缺陷

--bug=1045668 --user=王孝刚 【系统管理】模型设置,添加模型时先输入基础模型再选择模型类型,不限时apikey等输入框 https://www.tapd.cn/57709429/s/1569266
This commit is contained in:
wxg0103 2024-08-26 15:22:37 +08:00 committed by wxg0103
parent b4bcb4299e
commit 4f58081f6c

View File

@ -160,7 +160,7 @@ import ModelApi from '@/api/model'
import type { FormField } from '@/components/dynamics-form/type'
import DynamicsForm from '@/components/dynamics-form/index.vue'
import type { FormRules } from 'element-plus'
import { MsgSuccess } from '@/utils/message'
import { MsgSuccess, MsgWarning } from '@/utils/message'
import { PermissionType, PermissionDesc } from '@/enums/model'
const providerValue = ref<Provider>()
@ -207,6 +207,11 @@ const form_data = computed({
})
const getModelForm = (model_name: string) => {
if (!form_data.value.model_type) {
MsgWarning('请先选择模型类型')
base_form_data.value.model_name = ''
return
}
if (providerValue.value) {
ModelApi.getModelCreateForm(
providerValue.value.provider,