mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-03 07:47:18 +00:00
feat: 自动埋点
This commit is contained in:
parent
2787a12d83
commit
fecf34d0d7
@ -12,6 +12,7 @@ import InlineTip from './inlinetip';
|
||||
|
||||
export interface FieldProps {
|
||||
className?: string;
|
||||
meta?: { package: string; componentName: string } | string;
|
||||
title?: TitleContent | null;
|
||||
defaultDisplay?: 'accordion' | 'inline' | 'block';
|
||||
collapsed?: boolean;
|
||||
@ -115,15 +116,23 @@ export class Field extends Component<FieldProps> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { className, children, title, valueState, onClear, name: propName, tip } = this.props;
|
||||
const { className, children, meta, title, valueState, onClear, name: propName, tip } = this.props;
|
||||
const { display, collapsed } = this.state;
|
||||
const isAccordion = display === 'accordion';
|
||||
let hostName = '';
|
||||
if (typeof meta === 'object') {
|
||||
hostName = `${meta?.package || ''}-${meta.componentName || ''}`;
|
||||
} else if (typeof meta === 'string') {
|
||||
hostName = meta;
|
||||
}
|
||||
const id = `${hostName}-${propName || (title as any)['en-US'] || (title as any)['zh-CN']}`;
|
||||
const tipContent = this.getTipContent(propName!, tip);
|
||||
return (
|
||||
<div
|
||||
className={classNames(`lc-field lc-${display}-field`, className, {
|
||||
'lc-field-is-collapsed': isAccordion && collapsed,
|
||||
})}
|
||||
id={id}
|
||||
>
|
||||
<div className="lc-field-head" onClick={isAccordion ? this.toggleExpand : undefined}>
|
||||
<div className="lc-field-title">
|
||||
|
||||
@ -63,6 +63,7 @@ class SettingFieldView extends Component<{ field: SettingField }> {
|
||||
|
||||
return createField(
|
||||
{
|
||||
meta: field?.componentMeta?.npm || field?.componentMeta?.componentName || '',
|
||||
title: field.title,
|
||||
collapsed: !field.expanded,
|
||||
valueState: field.isRequired ? 10 : field.valueState,
|
||||
@ -121,6 +122,7 @@ class SettingGroupView extends Component<{ field: SettingField }> {
|
||||
return (
|
||||
<Field
|
||||
defaultDisplay="accordion"
|
||||
meta={field?.componentMeta?.npm || field?.componentMeta?.componentName || ''}
|
||||
title={field.title}
|
||||
collapsed={!field.expanded}
|
||||
onExpandChange={(expandState) => {
|
||||
|
||||
@ -24,11 +24,12 @@ class Contents extends Component<{ area: Area }> {
|
||||
const { area } = this.props;
|
||||
const top: any[] = [];
|
||||
const bottom: any[] = [];
|
||||
area.container.items.forEach(item => {
|
||||
area.container.items.forEach((item) => {
|
||||
const content = <div id={`left-area-${item.name}`}>{item.content}</div>;
|
||||
if (item.align === 'bottom') {
|
||||
bottom.push(item.content);
|
||||
bottom.push(content);
|
||||
} else {
|
||||
top.push(item.content);
|
||||
top.push(content);
|
||||
}
|
||||
});
|
||||
return (
|
||||
|
||||
@ -30,7 +30,7 @@ class Contents extends Component<{ area: Area, itemClassName?: string }> {
|
||||
return index1 === index2 ? 0 : (index1 > index2 ? 1 : -1);
|
||||
}).forEach(item => {
|
||||
const content = (
|
||||
<div className={itemClassName || ''}>
|
||||
<div className={itemClassName || ''} id={`top-area-${item.name}`}>
|
||||
{item.content}
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user