From a3d1092797c266c3e504b77027e4ab63ba6bdfe2 Mon Sep 17 00:00:00 2001 From: lvxiaojiao Date: Wed, 27 Nov 2024 11:29:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8A=A8=E4=BD=9C=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../amis-editor/src/plugin/CRUD2/BaseCRUD.tsx | 13 +++++---- packages/amis-editor/src/plugin/Collapse.tsx | 7 +++-- .../amis-editor/src/plugin/Form/InputTree.tsx | 19 +++++++----- .../src/plugin/Form/TabsTransfer.tsx | 8 +++-- packages/amis-editor/src/plugin/Tabs.tsx | 10 +++++-- packages/amis-editor/src/plugin/Wizard.tsx | 29 ++++++++++++------- .../componentActionsPanel/staticStatus.tsx | 6 ++-- .../src/renderer/event-control/helper.tsx | 9 ++---- 8 files changed, 59 insertions(+), 42 deletions(-) diff --git a/packages/amis-editor/src/plugin/CRUD2/BaseCRUD.tsx b/packages/amis-editor/src/plugin/CRUD2/BaseCRUD.tsx index 17a6c2540..0a705b8d3 100644 --- a/packages/amis-editor/src/plugin/CRUD2/BaseCRUD.tsx +++ b/packages/amis-editor/src/plugin/CRUD2/BaseCRUD.tsx @@ -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 (
- {info?.__rendererLabel} - 触发数据查询 + 触发 + {buildLinkActionDesc(props.manager, info)} + 数据查询
); }, @@ -138,8 +140,9 @@ export class BaseCRUDPlugin extends BasePlugin { descDetail: (info: any, context: any, props: any) => { return (
- {info?.__rendererLabel} - 加载更多数据 + 加载 + {buildLinkActionDesc(props.manager, info)} + 更多数据
); } diff --git a/packages/amis-editor/src/plugin/Collapse.tsx b/packages/amis-editor/src/plugin/Collapse.tsx index 47997d609..8a5e6c5e7 100644 --- a/packages/amis-editor/src/plugin/Collapse.tsx +++ b/packages/amis-editor/src/plugin/Collapse.tsx @@ -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 (
- {info?.rendererLabel} 展开 + {buildLinkActionDesc(props.manager, info)}
); } diff --git a/packages/amis-editor/src/plugin/Form/InputTree.tsx b/packages/amis-editor/src/plugin/Form/InputTree.tsx index 0166d52de..6087f428a 100644 --- a/packages/amis-editor/src/plugin/Form/InputTree.tsx +++ b/packages/amis-editor/src/plugin/Form/InputTree.tsx @@ -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 (
- {info?.__rendererLabel} - 展开到第 + 展开 + {buildLinkActionDesc(props.manager, info)} + 到第 {info?.args?.openLevel} @@ -226,17 +228,18 @@ export class TreeControlPlugin extends BasePlugin { descDetail: (info: any, context: any, props: any) => { return (
- {info?.rendererLabel} + 收起 + {buildLinkActionDesc(props.manager, info)} {info?.args?.closeLevel ? ( <> - 收起到第 + 到第 {info?.args?.closeLevel} 层 ) : ( - '收起' + '' )}
); @@ -289,17 +292,17 @@ export class TreeControlPlugin extends BasePlugin { descDetail: (info: any, context: any, props: any) => { return (
- {info?.rendererLabel} + 搜索 + {buildLinkActionDesc(props.manager, info)} {info?.args?.keyword ? ( <> - 搜索 {info?.args?.keyword} 的选项 ) : ( - '搜索' + '' )}
); diff --git a/packages/amis-editor/src/plugin/Form/TabsTransfer.tsx b/packages/amis-editor/src/plugin/Form/TabsTransfer.tsx index 02c3b2e3f..c715de13d 100644 --- a/packages/amis-editor/src/plugin/Form/TabsTransfer.tsx +++ b/packages/amis-editor/src/plugin/Form/TabsTransfer.tsx @@ -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 (
- {info?.__rendererLabel} - 修改选中tab + 修改 + {buildLinkActionDesc(props.manager, info)} + 选中tab
); } diff --git a/packages/amis-editor/src/plugin/Tabs.tsx b/packages/amis-editor/src/plugin/Tabs.tsx index 76609d7f6..f7d43fec1 100644 --- a/packages/amis-editor/src/plugin/Tabs.tsx +++ b/packages/amis-editor/src/plugin/Tabs.tsx @@ -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 (
- 激活第 + 激活 + {buildLinkActionDesc(props.manager, info)}第 {info?.args?.activeKey} @@ -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 (
- 删除hash为 + 删除 + {buildLinkActionDesc(props.manager, info)} + hash为 {info?.args?.deleteHash} diff --git a/packages/amis-editor/src/plugin/Wizard.tsx b/packages/amis-editor/src/plugin/Wizard.tsx index 076ee447f..74f272837 100644 --- a/packages/amis-editor/src/plugin/Wizard.tsx +++ b/packages/amis-editor/src/plugin/Wizard.tsx @@ -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 (
- {info?.__rendererLabel} - 提交当前步骤数据 + 提交 + {buildLinkActionDesc(props.manager, info)} + 当前步骤数据
); } @@ -274,9 +276,11 @@ export class WizardPlugin extends BasePlugin { descDetail: (info: any, context: any, props: any) => { return (
- {info?.rendererLabel} - {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}
); } @@ -288,9 +292,11 @@ export class WizardPlugin extends BasePlugin { descDetail: (info: any, context: any, props: any) => { return (
- {info?.rendererLabel} - {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}
); } @@ -303,8 +309,9 @@ export class WizardPlugin extends BasePlugin { descDetail: (info: any, context: any, props: any) => { return (
- {info?.__rendererLabel} - 切换到第 + 切换 + {buildLinkActionDesc(props.manager, info)} + 到第 {info?.args?.step} diff --git a/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/componentActionsPanel/staticStatus.tsx b/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/componentActionsPanel/staticStatus.tsx index 2c8cc9b92..3089b4a6c 100644 --- a/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/componentActionsPanel/staticStatus.tsx +++ b/packages/amis-editor/src/renderer/event-control/actionsPanelPlugins/componentActionsPanel/staticStatus.tsx @@ -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 (
- - {info?.rendererLabel || info.componentId} - - 组件切换为静态 + {buildLinkActionDesc(props.manager, info)}切换为静态展示
); } diff --git a/packages/amis-editor/src/renderer/event-control/helper.tsx b/packages/amis-editor/src/renderer/event-control/helper.tsx index a1324b647..cb8c7eea7 100644 --- a/packages/amis-editor/src/renderer/event-control/helper.tsx +++ b/packages/amis-editor/src/renderer/event-control/helper.tsx @@ -536,8 +536,7 @@ export const COMMON_ACTION_SCHEMA_MAP: { descDetail: (info: any, context: any, props: any) => { return (
- {info?.rendererLabel} - 收起 + 收起{buildLinkActionDesc(props.manager, info)}
); } @@ -546,8 +545,7 @@ export const COMMON_ACTION_SCHEMA_MAP: { descDetail: (info: any, context: any, props: any) => { return (
- {info?.rendererLabel} - 选中所有选项 + 选中{buildLinkActionDesc(props.manager, info)}所有选项
); } @@ -556,8 +554,7 @@ export const COMMON_ACTION_SCHEMA_MAP: { descDetail: (info: any, context: any, props: any) => { return (
- {info?.rendererLabel} - 获取焦点 + 获取{buildLinkActionDesc(props.manager, info)}焦点
); }