Skip to content

Commit 31f4d2b

Browse files
author
roymondchen
committed
fix(editor): 数据源方法选择器展示所有数据源并支持字段非叶子节点选择
移除 methodsOptions 中过滤无自定义方法数据源的逻辑,因为所有数据源都有内置"设置数据"方法;字段选择增加 checkStrictly 支持选择非叶子节点 Made-with: Cursor
1 parent b288896 commit 31f4d2b

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

packages/editor/src/fields/DataSourceMethodSelect.vue

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const getParamItemsConfig = ([dataSourceId, methodName]: [Id, string] = ['', '']
101101
text: '字段',
102102
type: 'data-source-field-select',
103103
dataSourceId,
104+
checkStrictly: true,
104105
},
105106
{
106107
name: 'data',
@@ -146,23 +147,21 @@ const paramsConfig = ref<CodeParamStatement[]>(getParamItemsConfig(props.model[p
146147
147148
const methodsOptions = computed(
148149
() =>
149-
dataSources.value
150-
?.filter((ds) => ds.methods?.length || dataSourceService.getFormMethod(ds.type).length)
151-
?.map((ds) => ({
152-
label: ds.title || ds.id,
153-
value: ds.id,
154-
children: [
155-
{
156-
label: '设置数据',
157-
value: DATA_SOURCE_SET_DATA_METHOD_NAME,
158-
},
159-
...(dataSourceService?.getFormMethod(ds.type) || []),
160-
...(ds.methods || []).map((method) => ({
161-
label: method.name,
162-
value: method.name,
163-
})),
164-
],
165-
})) || [],
150+
dataSources.value?.map((ds) => ({
151+
label: ds.title || ds.id,
152+
value: ds.id,
153+
children: [
154+
{
155+
label: '设置数据',
156+
value: DATA_SOURCE_SET_DATA_METHOD_NAME,
157+
},
158+
...(dataSourceService?.getFormMethod(ds.type) || []),
159+
...(ds.methods || []).map((method) => ({
160+
label: method.name,
161+
value: method.name,
162+
})),
163+
],
164+
})) || [],
166165
);
167166
168167
const cascaderConfig = computed<CascaderConfig>(() => ({

0 commit comments

Comments
 (0)