mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-16 19:58:12 +00:00
Merge branch 'feat/rax-miniapp' of http://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine into feat/rax-miniapp
This commit is contained in:
commit
17e1624669
@ -12,6 +12,7 @@ import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
|||||||
import { Skeleton, SettingsPrimaryPane } from '@ali/lowcode-editor-skeleton';
|
import { Skeleton, SettingsPrimaryPane } from '@ali/lowcode-editor-skeleton';
|
||||||
import { deepValueParser } from './deep-value-parser';
|
import { deepValueParser } from './deep-value-parser';
|
||||||
import { liveEditingRule, liveEditingSaveHander } from './vc-live-editing';
|
import { liveEditingRule, liveEditingSaveHander } from './vc-live-editing';
|
||||||
|
import { Item } from '@alifd/next/types/breadcrumb';
|
||||||
|
|
||||||
export const editor = new Editor();
|
export const editor = new Editor();
|
||||||
globalContext.register(editor, Editor);
|
globalContext.register(editor, Editor);
|
||||||
@ -306,6 +307,17 @@ designer.addPropsReducer((props: any, node: Node) => {
|
|||||||
if (node.isRoot()) {
|
if (node.isRoot()) {
|
||||||
if (props.dataSource) {
|
if (props.dataSource) {
|
||||||
const { online } = props.dataSource;
|
const { online } = props.dataSource;
|
||||||
|
online.forEach((item: any) => {
|
||||||
|
const newParam: any = {};
|
||||||
|
if (item.options && item.options.params && item.options.params.length) {
|
||||||
|
item.options.params.map((element: any) => {
|
||||||
|
if (element.name) {
|
||||||
|
newParam[element.name] = element.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
item.options.params = newParam;
|
||||||
|
}
|
||||||
|
});
|
||||||
props.dataSource.list = online;
|
props.dataSource.list = online;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,6 +56,7 @@ export default class DataHelper {
|
|||||||
generateDataSourceMap() {
|
generateDataSourceMap() {
|
||||||
const res = {};
|
const res = {};
|
||||||
this.ajaxList.forEach((item) => {
|
this.ajaxList.forEach((item) => {
|
||||||
|
item.id = item.id || item.name;
|
||||||
res[item.id] = {
|
res[item.id] = {
|
||||||
status: DS_STATUS.INIT,
|
status: DS_STATUS.INIT,
|
||||||
load: (...args) => this.getDataSource(item.id, ...args),
|
load: (...args) => this.getDataSource(item.id, ...args),
|
||||||
@ -201,7 +202,6 @@ export default class DataHelper {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// debugger;
|
|
||||||
res[id] = await this.dataHandler(id, dataHandler, data, error);
|
res[id] = await this.dataHandler(id, dataHandler, data, error);
|
||||||
this.updateDataSourceMap(id, res[id], error);
|
this.updateDataSourceMap(id, res[id], error);
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ export default class DataHelper {
|
|||||||
const doFetch = (type, req) => {
|
const doFetch = (type, req) => {
|
||||||
this.fetchOne(type, req)
|
this.fetchOne(type, req)
|
||||||
.then(async (data) => {
|
.then(async (data) => {
|
||||||
console.log(data);
|
console.log(data)
|
||||||
if (afterRequest) {
|
if (afterRequest) {
|
||||||
this.appHelper.utils.afterRequest(item, data, undefined, async (data, error) => {
|
this.appHelper.utils.afterRequest(item, data, undefined, async (data, error) => {
|
||||||
await fetchHandler(data, error);
|
await fetchHandler(data, error);
|
||||||
@ -289,7 +289,7 @@ export default class DataHelper {
|
|||||||
default:
|
default:
|
||||||
method = method.toUpperCase();
|
method = method.toUpperCase();
|
||||||
if (method === 'GET') {
|
if (method === 'GET') {
|
||||||
return get(uri, params, headers, otherProps);
|
return get(uri || otherProps.url, params, headers, otherProps);
|
||||||
}
|
}
|
||||||
if (method === 'POST') {
|
if (method === 'POST') {
|
||||||
return post(uri, params, headers, otherProps);
|
return post(uri, params, headers, otherProps);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user