fix:修复部分动作无法跳转问题

This commit is contained in:
lvxiaojiao 2024-11-27 11:29:36 +08:00
parent 212acc3564
commit a3d1092797
8 changed files with 59 additions and 42 deletions

View File

@ -31,7 +31,8 @@ import {
import {
getEventControlConfig,
getArgsWrapper,
getActionCommonProps
getActionCommonProps,
buildLinkActionDesc
} from '../../renderer/event-control/helper';
import {CRUD2Schema} from 'amis';
import {deepRemove, findObj, findSchema} from './utils';
@ -117,8 +118,9 @@ export class BaseCRUDPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.__rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
},
@ -138,8 +140,9 @@ export class BaseCRUDPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.__rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
}

View File

@ -10,7 +10,10 @@ import {
defaultValue,
getSchemaTpl
} from 'amis-editor-core';
import {getEventControlConfig} from '../renderer/event-control/helper';
import {
buildLinkActionDesc,
getEventControlConfig
} from '../renderer/event-control/helper';
import {getActionCommonProps} from '../renderer/event-control/helper';
export class CollapsePlugin extends BasePlugin {
@ -123,8 +126,8 @@ export class CollapsePlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
}

View File

@ -14,6 +14,7 @@ import {
} from 'amis-editor-core';
import type {Schema} from 'amis';
import {
buildLinkActionDesc,
getArgsWrapper,
getEventControlConfig
} from '../../renderer/event-control/helper';
@ -200,8 +201,9 @@ export class TreeControlPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.__rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
<span className="variable-left variable-right">
{info?.args?.openLevel}
</span>
@ -226,17 +228,18 @@ export class TreeControlPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
{info?.args?.closeLevel ? (
<>
<span className="variable-left variable-right">
{info?.args?.closeLevel}
</span>
</>
) : (
'收起'
''
)}
</div>
);
@ -289,17 +292,17 @@ export class TreeControlPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
{info?.args?.keyword ? (
<>
<span className="variable-left variable-right">
{info?.args?.keyword}
</span>
</>
) : (
'搜索'
''
)}
</div>
);

View File

@ -12,7 +12,8 @@ import {
} from 'amis-editor-core';
import {
getEventControlConfig,
getActionCommonProps
getActionCommonProps,
buildLinkActionDesc
} from '../../renderer/event-control/helper';
import {resolveOptionEventDataSchame, resolveOptionType} from '../../util';
@ -216,8 +217,9 @@ export class TabsTransferPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.__rendererLabel}</span>
tab
{buildLinkActionDesc(props.manager, info)}
tab
</div>
);
}

View File

@ -18,6 +18,7 @@ import {RegionWrapper as Region} from 'amis-editor-core';
import {Tab} from 'amis';
import {tipedLabel} from 'amis-editor-core';
import {
buildLinkActionDesc,
getArgsWrapper,
getEventControlConfig
} from '../renderer/event-control/helper';
@ -122,7 +123,8 @@ export class TabsPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
{buildLinkActionDesc(props.manager, info)}
<span className="variable-left variable-right">
{info?.args?.activeKey}
</span>
@ -147,10 +149,12 @@ export class TabsPlugin extends BasePlugin {
actionType: 'deleteTab',
actionLabel: '删除指定选项卡',
description: '删除指定hash的tab项',
descDetail: (info: any) => {
descDetail: (info: any, context: any, props: any) => {
return (
<div>
hash为
{buildLinkActionDesc(props.manager, info)}
hash为
<span className="variable-left variable-right">
{info?.args?.deleteHash}
</span>

View File

@ -19,7 +19,8 @@ import {
import {
getArgsWrapper,
getEventControlConfig,
getActionCommonProps
getActionCommonProps,
buildLinkActionDesc
} from '../renderer/event-control/helper';
export class WizardPlugin extends BasePlugin {
@ -261,8 +262,9 @@ export class WizardPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.__rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
}
@ -274,9 +276,11 @@ export class WizardPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{info?.__rendererName === 'carousel' ? '滚动至上一张' : null}
{info?.__rendererName === 'wizard' ? '返回前一步' : null}
{info?.__rendererName === 'carousel' ? '滚动' : null}
{info?.__rendererName === 'wizard' ? '返回' : null}
{buildLinkActionDesc(props.manager, info)}
{info?.__rendererName === 'carousel' ? '至上一张' : null}
{info?.__rendererName === 'wizard' ? '前一步' : null}
</div>
);
}
@ -288,9 +292,11 @@ export class WizardPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{info?.__rendererName === 'carousel' ? '滚动至下一张' : null}
{info?.__rendererName === 'wizard' ? '提交当前步骤数据' : null}
{info?.__rendererName === 'carousel' ? '滚动' : null}
{info?.__rendererName === 'wizard' ? '提交' : null}
{buildLinkActionDesc(props.manager, info)}
{info?.__rendererName === 'carousel' ? '至下一张' : null}
{info?.__rendererName === 'wizard' ? '当前步骤数据' : null}
</div>
);
}
@ -303,8 +309,9 @@ export class WizardPlugin extends BasePlugin {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.__rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
<span className="variable-left variable-right">
{info?.args?.step}
</span>

View File

@ -3,6 +3,7 @@ import {defaultValue} from 'amis-editor-core';
import without from 'lodash/without';
import {registerActionPanel} from '../../actionsPanelManager';
import {renderCmptSelect, renderCmptIdInput} from './helper';
import {buildLinkActionDesc} from '../../helper';
registerActionPanel('staticStatus', {
label: '组件展示态',
@ -14,10 +15,7 @@ registerActionPanel('staticStatus', {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">
{info?.rendererLabel || info.componentId}
</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
}

View File

@ -536,8 +536,7 @@ export const COMMON_ACTION_SCHEMA_MAP: {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
}
@ -546,8 +545,7 @@ export const COMMON_ACTION_SCHEMA_MAP: {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
}
@ -556,8 +554,7 @@ export const COMMON_ACTION_SCHEMA_MAP: {
descDetail: (info: any, context: any, props: any) => {
return (
<div className="action-desc">
<span className="variable-right">{info?.rendererLabel}</span>
{buildLinkActionDesc(props.manager, info)}
</div>
);
}