diff --git a/packages/editor/package.json b/packages/editor/package.json index 9a5add364..6afb24b63 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -4,7 +4,7 @@ "description": "低代码编辑器", "dependencies": { "@ali/iceluna-addon-2": "^1.0.3", - "@ali/iceluna-addon-component-list": "^1.0.10", + "@ali/iceluna-addon-component-list": "^1.0.11", "@ali/iceluna-sdk": "^1.0.5-beta.26", "@alifd/next": "^1.x", "@alife/dpl-iceluna": "^2.3.2", diff --git a/packages/editor/src/config/assets.js b/packages/editor/src/config/assets.js index 73c513fae..7e7c40fef 100644 --- a/packages/editor/src/config/assets.js +++ b/packages/editor/src/config/assets.js @@ -1434,10 +1434,11 @@ export default { title: '按钮', icon: '', package: '@alife/next', + libraryId: 2, snippets: [ { title: 'private', - screenshort: '', + screenshot: 'https://img.alicdn.com/tfs/TB16gZhi.H1gK0jSZSyXXXtlpXa-192-144.png', schema: { componentName: 'Button', props: { @@ -1448,7 +1449,7 @@ export default { }, { title: 'secondary', - screenshort: '', + screenshot: 'https://img.alicdn.com/tfs/TB11Hkji1H2gK0jSZFEXXcqMpXa-192-144.png', schema: { componentName: 'Button', props: { @@ -1459,7 +1460,7 @@ export default { }, { title: 'normal', - screenshort: '', + screenshot: '', schema: { componentName: 'Button', props: { @@ -1478,21 +1479,74 @@ export default { children: [ { componentName: 'Input', + libraryId: 2, title: '输入框', icon: '', package: '@alife/next', snippets: [ { title: '普通', - screenshort: '', + screenshot: '', schema: { componentName: 'Input', props: {} } } ] + }, { + componentName: 'Select', + libraryId: 2, + title: '选择框', + icon: '', + package: '@alife/next', + snippets: [ + { + title: '默认', + screenshot: '', + schema: { + componentName: 'Select', + props: {} + } + } + ] + }, { + componentName: 'NumberPicker', + libraryId: 2, + title: '数字', + icon: '', + package: '@alife/next', + snippets: [ + { + title: '默认', + screenshot: '', + schema: { + componentName: 'NumberPicker', + props: {} + } + } + ] } ] + }, { + title: '其他', + icon: '', + children: [{ + componentName: 'Div', + libraryId: 3, + title: '容器', + icon: '', + snippets: [ + { + title: '默认', + screenshot: '', + schema: { + componentName: 'Div', + props: { + } + } + } + ] + }] } ] }; diff --git a/packages/editor/src/config/skeleton.js b/packages/editor/src/config/skeleton.js index e9accff99..6fc68aa2a 100644 --- a/packages/editor/src/config/skeleton.js +++ b/packages/editor/src/config/skeleton.js @@ -315,11 +315,10 @@ export default { return { ...comp, name: comp.componentName, - libraryId: 1, snippets: comp.snippets.map(snippet => { return { name: snippet.title, - screenshort: snippet.screenshort, + screenshot: snippet.screenshot, code: JSON.stringify(snippet.schema) }; }) @@ -330,13 +329,17 @@ export default { }; const list = transformMaterial(assets.componentList); + console.log('++++', list); editor.set({ componentsMap: assets.components, componentMaterial: { library: [ { name: 'Fusion组件库', - id: 1 + id: '2' + }, { + name: '其他', + id: '3' } ], list diff --git a/packages/editor/src/plugins/designer/index.tsx b/packages/editor/src/plugins/designer/index.tsx index 3658f07fb..7c559c311 100644 --- a/packages/editor/src/plugins/designer/index.tsx +++ b/packages/editor/src/plugins/designer/index.tsx @@ -23,20 +23,7 @@ const SCHEMA = { componentName: 'Page', fileName: 'test', dataSource: { - list: [ - { - id: 'getComponentsMap', - isInit: true, - type: 'doServer', - options: { - method: 'POST', - params: { - libVersionIds: '1' - }, - uri: 'getComponentsMap' - } - } - ] + list: [] }, state: { text: 'outter'