Fix Bug #461: 系统管理-执行科室配置:保存项目配置后,项目名称回显为ID码
保存成功后刷新页面时,el-select 的 filteredOptions 仅包含前100个项目, 导致已保存项目若不在前100中则无法匹配到 label,只能回显 ID。 修复:保存成功后将该选中项确保加入 filteredOptions 再刷新列表。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -393,12 +393,24 @@ function openSaveImplementDepartment(row) {
|
|||||||
editImplementDepartment(params).then((res) => {
|
editImplementDepartment(params).then((res) => {
|
||||||
data.isAdding = false; // 允许新增下一行
|
data.isAdding = false; // 允许新增下一行
|
||||||
proxy.$modal.msgSuccess('保存成功!');
|
proxy.$modal.msgSuccess('保存成功!');
|
||||||
|
// 确保选中项在 filteredOptions 中,使 el-select 能正确显示名称
|
||||||
|
const savedItem = allImplementDepartmentList.value.find(i => i.value === row.activityDefinitionId);
|
||||||
|
if (savedItem && !row.filteredOptions.some(o => o.value === row.activityDefinitionId)) {
|
||||||
|
row.filteredOptions.push(savedItem);
|
||||||
|
}
|
||||||
|
getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
delete params.id;
|
delete params.id;
|
||||||
addImplementDepartment(params).then((res) => {
|
addImplementDepartment(params).then((res) => {
|
||||||
data.isAdding = false; // 允许新增下一行
|
data.isAdding = false; // 允许新增下一行
|
||||||
proxy.$modal.msgSuccess('保存成功!');
|
proxy.$modal.msgSuccess('保存成功!');
|
||||||
|
// 确保选中项在 filteredOptions 中,使 el-select 能正确显示名称
|
||||||
|
const savedItem = allImplementDepartmentList.value.find(i => i.value === row.activityDefinitionId);
|
||||||
|
if (savedItem && !row.filteredOptions.some(o => o.value === row.activityDefinitionId)) {
|
||||||
|
row.filteredOptions.push(savedItem);
|
||||||
|
}
|
||||||
|
getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user