mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 21:11:57 +00:00
feat: 🎸 数据源的类型默认是 fetch
This commit is contained in:
parent
4baf0b4e00
commit
ec8a191ef8
@ -41,16 +41,17 @@ const pluginFactory: BuilderComponentPluginFactory<PluginConfig> = (config?) =>
|
||||
const requestHandlersMap = {} as Record<string, JSExpression>;
|
||||
|
||||
dataSourceItems.forEach((ds) => {
|
||||
if (!(ds.type in requestHandlersMap) && ds.type !== 'custom') {
|
||||
const handlerFactoryName = '__$$create' + changeCase.pascal(ds.type) + 'RequestHandler';
|
||||
const dsType = ds.type || 'fetch';
|
||||
if (!(dsType in requestHandlersMap) && dsType !== 'custom') {
|
||||
const handlerFactoryName = '__$$create' + changeCase.pascal(dsType) + 'RequestHandler';
|
||||
|
||||
requestHandlersMap[ds.type] = {
|
||||
requestHandlersMap[dsType] = {
|
||||
type: 'JSExpression',
|
||||
value: handlerFactoryName + (ds.type === 'urlParams' ? '(this.props.location.search)' : '()'),
|
||||
value: handlerFactoryName + (dsType === 'urlParams' ? '(this.props.location.search)' : '()'),
|
||||
};
|
||||
|
||||
const handlerFactoryExportName = `create${changeCase.pascal(ds.type)}Handler`;
|
||||
const handlerPkgName = `@ali/lowcode-datasource-${changeCase.kebab(ds.type)}-handler`;
|
||||
const handlerFactoryExportName = `create${changeCase.pascal(dsType)}Handler`;
|
||||
const handlerPkgName = `@ali/lowcode-datasource-${changeCase.kebab(dsType)}-handler`;
|
||||
|
||||
next.chunks.push({
|
||||
type: ChunkType.STRING,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user