fix(editor): 数据源配置面板默认激活「数据定义」tab

未指定编辑方法或字段路径时,将 tab 容器默认激活到 fields,避免无 active 状态。
This commit is contained in:
roymondchen 2026-06-16 16:32:42 +08:00
parent 8933c46b73
commit 95769d6ae0

View File

@ -83,16 +83,17 @@ watchEffect(() => {
const config = dataSourceService.getFormConfig(initValues.value.type);
// / tab tabstatus: methods / fields
let activeTab = '';
// tabfields
let activeTab = 'fields';
if (props.editMethodName) {
activeTab = 'methods';
} else if (props.editFieldPath?.length) {
activeTab = 'fields';
}
dataSourceConfig.value = activeTab
? config.map((item) => ((item as { type?: string }).type === 'tab' ? { ...item, active: activeTab } : item))
: config;
dataSourceConfig.value = config.map((item) =>
(item as { type?: string }).type === 'tab' ? { ...item, active: activeTab } : item,
);
});
const submitHandler = (values: any, data: ContainerChangeEventData) => {