Merge pull request #11262 from hsm-lv/fix-eventchain

fix:修复部分动作无法跳转问题
This commit is contained in:
hsm-lv 2024-11-27 11:34:40 +08:00 committed by GitHub
commit 8175a4ca85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 59 additions and 42 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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