diff --git a/packages/editor-core/src/utils/monitor.ts b/packages/editor-core/src/utils/monitor.ts index 0c616c3ce..f11dc61df 100644 --- a/packages/editor-core/src/utils/monitor.ts +++ b/packages/editor-core/src/utils/monitor.ts @@ -2,7 +2,7 @@ class Monitor { fn = (params: any) => { const { AES } = window as any; if (typeof AES.log === 'function') { - const { p1, p2, p3, p4 = 'OTHER', ...rest } = params || {}; + const { p1 = '', p2 = '', p3 = '', p4 = 'OTHER', ...rest } = params || {}; AES.log('event', { p1, p2, @@ -42,5 +42,4 @@ class Monitor { } } -const monitor = new Monitor(); -export { monitor }; +export { Monitor }; diff --git a/packages/editor-preset-vision/src/index.ts b/packages/editor-preset-vision/src/index.ts index 556fa050d..78778a199 100644 --- a/packages/editor-preset-vision/src/index.ts +++ b/packages/editor-preset-vision/src/index.ts @@ -4,7 +4,7 @@ import Icons from '@ali/ve-icons'; import logger from '@ali/vu-logger'; import { render } from 'react-dom'; import I18nUtil from './i18n-util'; -import { hotkey as Hotkey } from '@ali/lowcode-editor-core'; +import { hotkey as Hotkey, Monitor } from '@ali/lowcode-editor-core'; import { createElement } from 'react'; import { VE_EVENTS as EVENTS, VE_HOOKS as HOOKS, VERSION as Version } from './base/const'; import Bus from './bus'; @@ -84,6 +84,7 @@ const VisualEngine = { I18nUtil, Hotkey, Env, + Monitor, /* pub/sub 集线器 */ Bus, /* 事件 */ @@ -132,6 +133,7 @@ export { I18nUtil, Hotkey, Env, + Monitor, /* pub/sub 集线器 */ Bus, /* 事件 */