Skip to content

Commit 1132a30

Browse files
liujupingJackLian
authored andcommitted
feat: update context-menu message
1 parent 34a5a11 commit 1132a30

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

packages/engine/src/inner-plugins/default-context-menu.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
IPublicTypeNodeSchema,
99
} from '@alilc/lowcode-types';
1010
import { isProjectSchema } from '@alilc/lowcode-utils';
11-
import { Notification } from '@alifd/next';
11+
import { Message } from '@alifd/next';
1212
import { intl } from '../locale';
1313

1414
function getNodesSchema(nodes: IPublicModelNode[]) {
@@ -27,19 +27,13 @@ async function getClipboardText(): Promise<IPublicTypeNodeSchema[]> {
2727
if (isProjectSchema(data)) {
2828
resolve(data.componentsTree);
2929
} else {
30-
Notification.open({
31-
content: intl('NotValidNodeData'),
32-
type: 'error',
33-
});
30+
Message.error(intl('NotValidNodeData'));
3431
reject(
3532
new Error(intl('NotValidNodeData')),
3633
);
3734
}
3835
} catch (error) {
39-
Notification.open({
40-
content: intl('NotValidNodeData'),
41-
type: 'error',
42-
});
36+
Message.error(intl('NotValidNodeData'));
4337
reject(error);
4438
}
4539
},
@@ -143,10 +137,7 @@ export const defaultContextMenu = (ctx: IPublicModelPluginContext) => {
143137
return doc?.checkNesting(parent, dragNodeObject);
144138
});
145139
if (canAddNodes.length === 0) {
146-
Notification.open({
147-
content: `${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(parent.title || parent.componentName as any)}内`,
148-
type: 'error',
149-
});
140+
Message.error(`${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(parent.title || parent.componentName as any)}内`);
150141
return;
151142
}
152143
const nodes: IPublicModelNode[] = [];
@@ -194,10 +185,7 @@ export const defaultContextMenu = (ctx: IPublicModelPluginContext) => {
194185
return doc?.checkNesting(node, dragNodeObject);
195186
});
196187
if (canAddNodes.length === 0) {
197-
Notification.open({
198-
content: `${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(node.title || node.componentName as any)}内`,
199-
type: 'error',
200-
});
188+
Message.error(`${nodeSchema.map(d => utilsIntl(d.title || d.componentName)).join(',')}等组件无法放置到${utilsIntl(node.title || node.componentName as any)}内`);
201189
return;
202190
}
203191

0 commit comments

Comments
 (0)