Skip to content

Commit

Permalink
Merge pull request #11262 from hsm-lv/fix-eventchain
Browse files Browse the repository at this point in the history
fix:修复部分动作无法跳转问题
  • Loading branch information
hsm-lv authored Nov 27, 2024
2 parents d34d06c + a3d1092 commit 8175a4c
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 42 deletions.
13 changes: 8 additions & 5 deletions packages/amis-editor/src/plugin/CRUD2/BaseCRUD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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>
);
},
Expand All @@ -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>
);
}
Expand Down
7 changes: 5 additions & 2 deletions packages/amis-editor/src/plugin/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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>
);
}
Expand Down
19 changes: 11 additions & 8 deletions packages/amis-editor/src/plugin/Form/InputTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from 'amis-editor-core';
import type {Schema} from 'amis';
import {
buildLinkActionDesc,
getArgsWrapper,
getEventControlConfig
} from '../../renderer/event-control/helper';
Expand Down Expand Up @@ -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>
Expand All @@ -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>
);
Expand Down Expand Up @@ -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>
);
Expand Down
8 changes: 5 additions & 3 deletions packages/amis-editor/src/plugin/Form/TabsTransfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
} from 'amis-editor-core';
import {
getEventControlConfig,
getActionCommonProps
getActionCommonProps,
buildLinkActionDesc
} from '../../renderer/event-control/helper';
import {resolveOptionEventDataSchame, resolveOptionType} from '../../util';

Expand Down Expand Up @@ -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>
);
}
Expand Down
10 changes: 7 additions & 3 deletions packages/amis-editor/src/plugin/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down
29 changes: 18 additions & 11 deletions packages/amis-editor/src/plugin/Wizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
import {
getArgsWrapper,
getEventControlConfig,
getActionCommonProps
getActionCommonProps,
buildLinkActionDesc
} from '../renderer/event-control/helper';

export class WizardPlugin extends BasePlugin {
Expand Down Expand Up @@ -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>
);
}
Expand All @@ -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>
);
}
Expand All @@ -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>
);
}
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: '组件展示态',
Expand All @@ -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>
);
}
Expand Down
9 changes: 3 additions & 6 deletions packages/amis-editor/src/renderer/event-control/helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
}
Expand All @@ -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>
);
}
Expand All @@ -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>
);
}
Expand Down

0 comments on commit 8175a4c

Please sign in to comment.