Skip to content

Commit 780016f

Browse files
committed
fix: No default model value display id
1 parent 45f895a commit 780016f

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

ui/src/components/dynamics-form/constructor/items/ModelConstructor.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
v-model="selectedIds"
3838
:placeholder="$t('dynamicsForm.ModelConstructor.modelPlaceholder')"
3939
:options="groupedModelOptions"
40-
@change="handleProviderListChange"
4140
:model-type="formValue.model_type"
4241
>
4342
</ModelSelect>
@@ -148,6 +147,12 @@ const selectedIds = computed({
148147
return existing || { model_id: id, model_params_setting: {} }
149148
})
150149
formValue.value.provider_list = newList
150+
151+
const currentId = formValue.value.default_value?.model_id
152+
if (currentId && !newIds.includes(currentId)) {
153+
formValue.value.default_value = {}
154+
}
155+
151156
// find new model then get it default value
152157
const oldIds = oldList.map((p: any) => p.model_id)
153158
const addedIds = newIds.filter((id: string) => !oldIds.includes(id))
@@ -242,15 +247,6 @@ const getProviderItem = (modelId: string) => {
242247
return { model_id: modelId, model_params_setting: {} }
243248
}
244249
245-
function handleProviderListChange() {
246-
const ids = (formValue.value.provider_list || []).map((p: any) => p.model_id)
247-
const currentId = formValue.value.default_value?.model_id
248-
249-
if (currentId && !ids.includes(currentId)) {
250-
formValue.value.default_value = {}
251-
}
252-
}
253-
254250
const getData = () => {
255251
const providerList = (formValue.value.provider_list || []).map((p: any) => {
256252
const modelInfo = getModelInfo(p.model_id)

0 commit comments

Comments
 (0)