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 undoRedo from '@ali/lowcode-plugin-undo-redo';
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 eventBindDialog from '@ali/lowcode-plugin-event-bind-dialog';
import variableBindDialog from '@ali/lowcode-plugin-variable-bind-dialog';
@ -12,6 +13,7 @@ export default {
samplePreview,
//undoRedo,
componentsPane,
outline,
zhEn,
eventBindDialog,
variableBindDialog,

View File

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

View File

@ -69,11 +69,12 @@ export default class ComponentListPlugin extends PureComponent<PluginProps, ISta
};
initComponentList = (): void => {
debugger;
const { editor } = this.props;
const assets = editor.get('assets') || {};
const list: string[] = [];
const libs: LibrayInfo[] = [];
Object.values(assets.packages).forEach((item: any): void => {
assets.packages.forEach((item: any): void => {
list.push(item.library);
libs.push({
label: item.title,
@ -96,8 +97,12 @@ export default class ComponentListPlugin extends PureComponent<PluginProps, ISta
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) {
debugger
const designer = editor.get(Designer);
if (designer) {
designer.dragon.boost(
@ -109,7 +114,7 @@ export default class ComponentListPlugin extends PureComponent<PluginProps, ISta
);
}
},
});
};
};
searchAction = (value: string): void => {