chore: 埋点相关优化

This commit is contained in:
wuyue.xht 2020-06-17 12:12:30 +08:00
parent 32f0264e45
commit 46951ca4f9
8 changed files with 13 additions and 13 deletions

View File

@ -184,7 +184,7 @@ export class BoxResizingInstance extends Component<{
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || [npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
node?.componentMeta?.componentName || node?.componentMeta?.componentName ||
''; '';
editor.emit('designer.border.resize', { editor?.emit('designer.border.resize', {
selected, selected,
layout: node?.parent?.getPropValue('layout') || '', layout: node?.parent?.getPropValue('layout') || '',
}); });

View File

@ -130,7 +130,7 @@ function createAction(content: ReactNode | ComponentType<any> | ActionContentObj
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || [npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
node?.componentMeta?.componentName || node?.componentMeta?.componentName ||
''; '';
editor?.emit('designer.borders.action', { editor?.emit('designer.border.action', {
name: key, name: key,
target, target,
}); });

View File

@ -272,7 +272,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || [npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
node?.componentMeta?.componentName || node?.componentMeta?.componentName ||
''; '';
editor.emit('designer.builtinSimulator.select', { editor?.emit('designer.builtinSimulator.select', {
selected, selected,
}); });
} }
@ -434,12 +434,12 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
} }
const editor = globalContext.get(Editor); const editor = globalContext.get(Editor);
const npm = node?.componentMeta?.npm; const npm = node?.componentMeta?.npm;
const target = const selected =
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || [npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
node?.componentMeta?.componentName || node?.componentMeta?.componentName ||
''; '';
editor?.emit('desiger.builtinSimulator.contextmenu', { editor?.emit('desiger.builtinSimulator.contextmenu', {
target: target, selected,
}); });
}); });
} }

View File

@ -44,10 +44,10 @@ export class LiveEditing {
const editor = globalContext.get(Editor); const editor = globalContext.get(Editor);
const npm = node?.componentMeta?.npm; const npm = node?.componentMeta?.npm;
const targetInfo = const selected =
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || node?.componentMeta?.componentName || ''; [npm?.package, npm?.componentName].filter((item) => !!item).join('-') || node?.componentMeta?.componentName || '';
editor?.emit('designer.builinSimulator.LiveEditing', { editor?.emit('designer.builinSimulator.LiveEditing', {
target: targetInfo, selected,
}); });
let setterPropElement = getSetterPropElement(targetElement, rootElement); let setterPropElement = getSetterPropElement(targetElement, rootElement);

View File

@ -52,8 +52,8 @@ export default class InstanceNodeSelector extends React.Component<IProps, IState
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || [npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
node?.componentMeta?.componentName || node?.componentMeta?.componentName ||
''; '';
editor.emit('designer.border.action', { editor?.emit('designer.border.action', {
name: 'select-node', name: 'select',
selected, selected,
}); });
} }

View File

@ -129,7 +129,7 @@ export class Designer {
''; '';
this.editor?.emit('designer.drag', { this.editor?.emit('designer.drag', {
time: (endTime - startTime).toFixed(2), time: (endTime - startTime).toFixed(2),
target: nodes selected: nodes
?.map((n) => { ?.map((n) => {
if (!n) { if (!n) {
return; return;

View File

@ -58,7 +58,7 @@ export class SettingsPrimaryPane extends Component<{ editor: Editor }> {
}; };
const selected = getName(current); const selected = getName(current);
const target = getName(node); const target = getName(node);
editor.emit('skeleton.settingsPane.Breadcrumb', { editor?.emit('skeleton.settingsPane.Breadcrumb', {
selected, selected,
target, target,
}); });

View File

@ -110,7 +110,7 @@ export class TitledPanelView extends Component<{ panel: Panel; area?: string }>
} }
const editor = globalContext.get(Editor); const editor = globalContext.get(Editor);
const panelName = area ? `${area}-${panel.name}` : panel.name; const panelName = area ? `${area}-${panel.name}` : panel.name;
editor.emit('skeleton.panel.toggle', { editor?.emit('skeleton.panel.toggle', {
name: panelName || '', name: panelName || '',
status: panel.visible ? 'show' : 'hide', status: panel.visible ? 'show' : 'hide',
}); });
@ -163,7 +163,7 @@ export class PanelView extends Component<{ panel: Panel; area?: string }> {
} }
const editor = globalContext.get(Editor); const editor = globalContext.get(Editor);
const panelName = area ? `${area}-${panel.name}` : panel.name; const panelName = area ? `${area}-${panel.name}` : panel.name;
editor.emit('skeleton.panel.toggle', { editor?.emit('skeleton.panel.toggle', {
name: panelName || '', name: panelName || '',
status: panel.visible ? 'show' : 'hide', status: panel.visible ? 'show' : 'hide',
}); });