This commit is contained in:
kangwei 2020-05-18 12:30:51 +08:00
parent dd598eb9e6
commit d7463ea858
3 changed files with 13 additions and 8 deletions

View File

@ -2,6 +2,7 @@ import logo from '@ali/lowcode-plugin-sample-logo';
import samplePreview from '@ali/lowcode-plugin-sample-preview'; import samplePreview from '@ali/lowcode-plugin-sample-preview';
//import undoRedo from '@ali/lowcode-plugin-undo-redo'; //import undoRedo from '@ali/lowcode-plugin-undo-redo';
import componentsPane from '@ali/lowcode-plugin-components-pane'; import componentsPane from '@ali/lowcode-plugin-components-pane';
import outline, { OutlinePane } from '@ali/lowcode-plugin-outline-pane';
import zhEn from '@ali/lowcode-plugin-zh-en'; import zhEn from '@ali/lowcode-plugin-zh-en';
import eventBindDialog from '@ali/lowcode-plugin-event-bind-dialog'; import eventBindDialog from '@ali/lowcode-plugin-event-bind-dialog';
import variableBindDialog from '@ali/lowcode-plugin-variable-bind-dialog'; import variableBindDialog from '@ali/lowcode-plugin-variable-bind-dialog';
@ -12,6 +13,7 @@ export default {
samplePreview, samplePreview,
//undoRedo, //undoRedo,
componentsPane, componentsPane,
outline,
zhEn, zhEn,
eventBindDialog, eventBindDialog,
variableBindDialog, variableBindDialog,

View File

@ -45,28 +45,26 @@ export default {
props: { props: {
align: 'top', align: 'top',
icon: 'zujianku', icon: 'zujianku',
title: '组件库', description: '组件库',
}, },
pluginProps: {}, pluginProps: {},
}, },
{ {
pluginKey: 'outlinePane', pluginKey: 'outline',
type: 'PanelIcon', type: 'PanelIcon',
props: { props: {
align: 'top', align: 'top',
icon: 'shuxingkongjian', icon: 'shuxingkongjian',
title: '大纲树', description: '大纲树',
}, },
pluginProps: {}, pluginProps: {},
}, },
{ {
pluginKey: 'sourceEditor', pluginKey: 'sourceEditor',
type: 'PanelIcon', type: 'PanelIcon',
props: { props: {
align: 'top', align: 'top',
icon: 'zujianku', icon: 'zujianku',
title: '组件库',
panelProps: { panelProps: {
floatable: true, floatable: true,
defaultWidth: 500, defaultWidth: 500,

View File

@ -69,11 +69,12 @@ export default class ComponentListPlugin extends PureComponent<PluginProps, ISta
}; };
initComponentList = (): void => { initComponentList = (): void => {
debugger;
const { editor } = this.props; const { editor } = this.props;
const assets = editor.get('assets') || {}; const assets = editor.get('assets') || {};
const list: string[] = []; const list: string[] = [];
const libs: LibrayInfo[] = []; const libs: LibrayInfo[] = [];
Object.values(assets.packages).forEach((item: any): void => { assets.packages.forEach((item: any): void => {
list.push(item.library); list.push(item.library);
libs.push({ libs.push({
label: item.title, label: item.title,
@ -96,8 +97,12 @@ export default class ComponentListPlugin extends PureComponent<PluginProps, ISta
currentLib: libs[0] && libs[0].value, currentLib: libs[0] && libs[0].value,
}); });
editor.set('dndHelper', { (window as any).__ctx = {
appHelper: editor,
};
(editor as any).dndHelper = {
handleResourceDragStart: function(ev: any, tagName: any, schema: any) { handleResourceDragStart: function(ev: any, tagName: any, schema: any) {
debugger
const designer = editor.get(Designer); const designer = editor.get(Designer);
if (designer) { if (designer) {
designer.dragon.boost( designer.dragon.boost(
@ -109,7 +114,7 @@ export default class ComponentListPlugin extends PureComponent<PluginProps, ISta
); );
} }
}, },
}); };
}; };
searchAction = (value: string): void => { searchAction = (value: string): void => {