mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-15 05:36:39 +00:00
Merge remote-tracking branch 'origin/develop' into release/1.3.0-beta
This commit is contained in:
commit
072492228f
@ -36,6 +36,10 @@ class Clipboard implements IClipboard {
|
|||||||
|
|
||||||
private waitFn?: (data: any, e: ClipboardEvent) => void;
|
private waitFn?: (data: any, e: ClipboardEvent) => void;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.injectCopyPaster(document);
|
||||||
|
}
|
||||||
|
|
||||||
isCopyPasteEvent(e: Event) {
|
isCopyPasteEvent(e: Event) {
|
||||||
this.isCopyPaster(e.target);
|
this.isCopyPaster(e.target);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import BuiltinDragGhostComponent from './drag-ghost';
|
|||||||
import { Designer, DesignerProps } from './designer';
|
import { Designer, DesignerProps } from './designer';
|
||||||
import { ProjectView } from '../project';
|
import { ProjectView } from '../project';
|
||||||
import './designer.less';
|
import './designer.less';
|
||||||
import { clipboard } from './clipboard';
|
|
||||||
|
|
||||||
type IProps = DesignerProps & {
|
type IProps = DesignerProps & {
|
||||||
designer?: Designer;
|
designer?: Designer;
|
||||||
@ -44,7 +43,6 @@ export class DesignerView extends Component<IProps> {
|
|||||||
if (onMount) {
|
if (onMount) {
|
||||||
onMount(this.designer);
|
onMount(this.designer);
|
||||||
}
|
}
|
||||||
clipboard.injectCopyPaster(document);
|
|
||||||
this.designer.postEvent('mount', this.designer);
|
this.designer.postEvent('mount', this.designer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import {
|
|||||||
IPublicTypeNodeSchema,
|
IPublicTypeNodeSchema,
|
||||||
} from '@alilc/lowcode-types';
|
} from '@alilc/lowcode-types';
|
||||||
import { isProjectSchema } from '@alilc/lowcode-utils';
|
import { isProjectSchema } from '@alilc/lowcode-utils';
|
||||||
import { Notification } from '@alifd/next';
|
import { Message } from '@alifd/next';
|
||||||
import { intl } from '../locale';
|
import { intl } from '../locale';
|
||||||
|
|
||||||
function getNodesSchema(nodes: IPublicModelNode[]) {
|
function getNodesSchema(nodes: IPublicModelNode[]) {
|
||||||
@ -27,19 +27,13 @@ async function getClipboardText(): Promise<IPublicTypeNodeSchema[]> {
|
|||||||
if (isProjectSchema(data)) {
|
if (isProjectSchema(data)) {
|
||||||
resolve(data.componentsTree);
|
resolve(data.componentsTree);
|
||||||
} else {
|
} else {
|
||||||
Notification.open({
|
Message.error(intl('NotValidNodeData'));
|
||||||
content: intl('NotValidNodeData'),
|
|
||||||
type: 'error',
|
|
||||||
});
|
|
||||||
reject(
|
reject(
|
||||||
new Error(intl('NotValidNodeData')),
|
new Error(intl('NotValidNodeData')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Notification.open({
|
Message.error(intl('NotValidNodeData'));
|
||||||
content: intl('NotValidNodeData'),
|
|
||||||
type: 'error',
|
|
||||||
});
|
|
||||||
reject(error);
|
reject(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -143,10 +137,7 @@ export const defaultContextMenu = (ctx: IPublicModelPluginContext) => {
|
|||||||
return doc?.checkNesting(parent, dragNodeObject);
|
return doc?.checkNesting(parent, dragNodeObject);
|
||||||
});
|
});
|
||||||
if (canAddNodes.length === 0) {
|
if (canAddNodes.length === 0) {
|
||||||
Notification.open({
|
Message.error(`${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(parent.title || parent.componentName as any)}内`);
|
||||||
content: `${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(parent.title || parent.componentName as any)}内`,
|
|
||||||
type: 'error',
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const nodes: IPublicModelNode[] = [];
|
const nodes: IPublicModelNode[] = [];
|
||||||
@ -194,10 +185,7 @@ export const defaultContextMenu = (ctx: IPublicModelPluginContext) => {
|
|||||||
return doc?.checkNesting(node, dragNodeObject);
|
return doc?.checkNesting(node, dragNodeObject);
|
||||||
});
|
});
|
||||||
if (canAddNodes.length === 0) {
|
if (canAddNodes.length === 0) {
|
||||||
Notification.open({
|
Message.error(`${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(node.title || node.componentName as any)}内`);
|
||||||
content: `${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(node.title || node.componentName as any)}内`,
|
|
||||||
type: 'error',
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user