fix: 打开语音参数配置时刷新最新的模型参数设置

This commit is contained in:
CaptainB 2024-10-30 13:54:25 +08:00 committed by 刘瑞斌
parent 9c144b526a
commit f89b98d255

View File

@ -78,6 +78,14 @@ const open = (model_id: string, application_id?: string, model_setting_data?: an
const resp = ok.data
.map((item: any) => ({ [item.field]: item.default_value }))
.reduce((x, y) => ({ ...x, ...y }), {})
//
if (model_setting_data) {
Object.keys(model_setting_data).forEach(key => {
if (!(key in resp)) {
delete model_setting_data[key];
}
});
}
model_setting_data = { ...resp, ...model_setting_data }
//
dynamicsFormRef.value?.render(model_form_field.value, model_setting_data)