|
37 | 37 | v-model="selectedIds" |
38 | 38 | :placeholder="$t('dynamicsForm.ModelConstructor.modelPlaceholder')" |
39 | 39 | :options="groupedModelOptions" |
40 | | - @change="handleProviderListChange" |
41 | 40 | :model-type="formValue.model_type" |
42 | 41 | > |
43 | 42 | </ModelSelect> |
@@ -148,6 +147,12 @@ const selectedIds = computed({ |
148 | 147 | return existing || { model_id: id, model_params_setting: {} } |
149 | 148 | }) |
150 | 149 | 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 | +
|
151 | 156 | // find new model then get it default value |
152 | 157 | const oldIds = oldList.map((p: any) => p.model_id) |
153 | 158 | const addedIds = newIds.filter((id: string) => !oldIds.includes(id)) |
@@ -242,15 +247,6 @@ const getProviderItem = (modelId: string) => { |
242 | 247 | return { model_id: modelId, model_params_setting: {} } |
243 | 248 | } |
244 | 249 |
|
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 | | -
|
254 | 250 | const getData = () => { |
255 | 251 | const providerList = (formValue.value.provider_list || []).map((p: any) => { |
256 | 252 | const modelInfo = getModelInfo(p.model_id) |
|
0 commit comments