From 659273f3ab37349391a4e915808b9cb4abcab53e Mon Sep 17 00:00:00 2001 From: Cano1997 <1978141412@qq.com> Date: Wed, 29 Oct 2025 20:31:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=A0=87=E7=AD=BE=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E6=94=AF=E6=8C=81=E8=BD=AC=E5=8C=96=E4=B8=BA?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=A1=B9=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/editor/span/span/span.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3293a1de8..bcb2f3833ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - 向导面板支持向导表单启用逻辑 - 向导面板支持向导步骤图标 - 新增树部件加载更多和节点绘制器 +- 标签编辑器支持转化为代码项文本 ### Change diff --git a/src/editor/span/span/span.tsx b/src/editor/span/span/span.tsx index 2984bc7e8cc..4a2eeda4b5e 100644 --- a/src/editor/span/span/span.tsx +++ b/src/editor/span/span/span.tsx @@ -180,6 +180,7 @@ export const IBizSpan = defineComponent({ this.c.editorParams?.SHOWMODE || this.c.editorParams?.showmode } value={this.text} + convertToCodeItemText={this.c.convertToCodeItemText} > ); } else if (this.text) { -- Gitee From da12abfbf3bc2748c46c00c23ffcb7be6061f390 Mon Sep 17 00:00:00 2001 From: Cano1997 <1978141412@qq.com> Date: Wed, 29 Oct 2025 20:34:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E8=A1=A8=E5=8D=95=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E6=B6=88=E6=81=AF=E6=94=AF=E6=8C=81=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=B1=95=E7=A4=BA=EF=BC=8C=E6=97=A0=E6=95=88?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=BA=E5=AF=B9=E8=B1=A1=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/common/rawitem/rawitem.tsx | 28 +++++++++++-------- .../form-detail/form-rawitem/form-rawitem.tsx | 1 + 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcb2f3833ee..e544e50ab66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ - 向导面板支持向导步骤图标 - 新增树部件加载更多和节点绘制器 - 标签编辑器支持转化为代码项文本 +- 表单视图消息支持直接内容展示,无效配置为对象格式 ### Change diff --git a/src/common/rawitem/rawitem.tsx b/src/common/rawitem/rawitem.tsx index eaf4af68db5..acd8f52d6ce 100644 --- a/src/common/rawitem/rawitem.tsx +++ b/src/common/rawitem/rawitem.tsx @@ -80,14 +80,19 @@ export const IBizRawItem = defineComponent({ html: '', }); + const messageTypeIcon: IData = { + WARNING: 'warning-o', + ERROR: 'close', + INFO: 'info-o', + }; + // 类型参数 const alertParams = ref({ - type: 'info', title: '', - closeabled: true, - showIcon: false, + closeabled: false, + showIcon: true, class: '', - wrapable: false, // 是否多行展示 + wrapable: true, // 是否多行展示 'left-icon': '', }); @@ -161,6 +166,13 @@ export const IBizRawItem = defineComponent({ let rawConfig = {}; try { if (typeof rawItemContent.value === 'string') { + // 消息提示支持直接内容展示 + if (['INFO', 'WARNING', 'ERROR'].includes(rawItemType.value)) { + alertParams.value.class = rawItemType.value.toLocaleLowerCase(); + alertParams.value.title = rawItemContent.value; + alertParams.value['left-icon'] = + messageTypeIcon[rawItemType.value]; + } // eslint-disable-next-line no-new-func const func = new Function(`return (${rawItemContent.value});`); rawConfig = func(); @@ -190,14 +202,6 @@ export const IBizRawItem = defineComponent({ case 'INFO': case 'WARNING': case 'ERROR': - alertParams.value.class = - rawItemType.value.toLocaleLowerCase(); - if (rawItemType.value === 'ERROR') { - alertParams.value['left-icon'] = 'close'; - } else { - alertParams.value['left-icon'] = - rawItemType.value.toLocaleLowerCase(); - } Object.assign(alertParams.value, rawConfig); break; default: diff --git a/src/control/form/form-detail/form-rawitem/form-rawitem.tsx b/src/control/form/form-detail/form-rawitem/form-rawitem.tsx index 629e4b0855e..31d4b1b9c75 100644 --- a/src/control/form/form-detail/form-rawitem/form-rawitem.tsx +++ b/src/control/form/form-detail/form-rawitem/form-rawitem.tsx @@ -57,6 +57,7 @@ export const FormRawItem = defineComponent({ class={[this.ns.b(), ...this.controller.containerClass]} content={content} type={type} + rawItem={this.modelData} onClick={(event: MouseEvent) => this.controller.onClick(event)} > ); -- Gitee From 3a32474401e0510f1862e7ea0fd6d6dd95db15bb Mon Sep 17 00:00:00 2001 From: Cano1997 <1978141412@qq.com> Date: Wed, 29 Oct 2025 20:37:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=95=8C=E9=9D=A2=E8=A1=8C=E4=B8=BA=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=B1=BB=E5=9E=8B=E3=80=81=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E7=BA=A7=E5=88=AB=E3=80=81=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/common/action-group/action-group.tsx | 4 +-- src/common/action-toolbar/action-toolbar.tsx | 2 +- src/common/button-list/button-list.scss | 10 ------ src/common/button-list/button-list.tsx | 4 +-- .../form-detail/form-button/form-button.tsx | 2 +- src/control/list/md-ctrl/md-ctrl.tsx | 2 +- src/control/toolbar/toolbar.tsx | 3 +- .../panel-button/panel-button.tsx | 3 +- src/util/button-util/button-util.ts | 33 +++++++++++++++---- 10 files changed, 37 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e544e50ab66..d4eb7703eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ - 工具栏项的绘制逻辑调整为统一方法绘制 - 优化工具栏组件样式,不直接使用基础css变量,组件定义专属变量 - 优化搜索栏组件样式,不直接使用基础css变量,组件定义专属变量 +- 统一处理界面行为按钮按钮类型、按钮行为级别、按钮样式 ### Fixed diff --git a/src/common/action-group/action-group.tsx b/src/common/action-group/action-group.tsx index 9cdaec4037b..f3b9da0525f 100644 --- a/src/common/action-group/action-group.tsx +++ b/src/common/action-group/action-group.tsx @@ -158,7 +158,7 @@ export const IBizActionGroup = defineComponent({ renderSeparator(detail.addSeparator), handleClick(detail, e, true)} disabled={props.actionsState[detail.id!].disabled} @@ -210,7 +210,7 @@ export const IBizActionGroup = defineComponent({ size='small' ref='buttonRef' class={this.ns.e('button')} - type={convertBtnType(this.actionDetail.buttonStyle)} + type={convertBtnType(this.actionDetail)} > {{ icon: () => { diff --git a/src/common/action-toolbar/action-toolbar.tsx b/src/common/action-toolbar/action-toolbar.tsx index c6ea347c6e3..6eceb5e19c9 100644 --- a/src/common/action-toolbar/action-toolbar.tsx +++ b/src/common/action-toolbar/action-toolbar.tsx @@ -65,7 +65,7 @@ export const IBizActionToolbar = defineComponent({ this.handleClick(detail, e)} disabled={this.actionsState[detail.id!].disabled} class={[ diff --git a/src/common/button-list/button-list.scss b/src/common/button-list/button-list.scss index 7a9683c7659..8bc157f8a6e 100644 --- a/src/common/button-list/button-list.scss +++ b/src/common/button-list/button-list.scss @@ -12,16 +12,6 @@ width: 100%; height: 100%; - .van-button { - border: none; - .van-button__text { - display: flex; - align-items: center; - gap: getCssVar(spacing, extra, tight); - @include button-list-icon-style; - } - } - @include e(content) { display: flex; flex-wrap: wrap; diff --git a/src/common/button-list/button-list.tsx b/src/common/button-list/button-list.tsx index cedb0a2ac76..9a1251f1ee7 100644 --- a/src/common/button-list/button-list.tsx +++ b/src/common/button-list/button-list.tsx @@ -155,7 +155,7 @@ export const IBizButtonList = defineComponent({ ns.em('item', `${item.id?.toLowerCase()}`), item.sysCss?.cssName, ]} - type={convertBtnType(item.buttonStyle)} + type={convertBtnType(item)} disabled={ props.buttonsState[item.id!]?.disabled || props.disabled } @@ -196,7 +196,7 @@ export const IBizButtonList = defineComponent({ class={ns.e('button')} disabled={props.disabled} onClick={onChangePopover} - type={convertBtnType(buttonListStyle.value)} + type={buttonListStyle.value.toLowerCase()} > {sysImage && ( diff --git a/src/control/form/form-detail/form-button/form-button.tsx b/src/control/form/form-detail/form-button/form-button.tsx index 0916aa267fa..d61f4feb343 100644 --- a/src/control/form/form-detail/form-button/form-button.tsx +++ b/src/control/form/form-detail/form-button/form-button.tsx @@ -49,7 +49,7 @@ export const FormButton = defineComponent({ > { - const _type = convertBtnType(item.buttonStyle); + const _type = convertBtnType(item); return _type === 'default' ? 'primary' : _type; }; diff --git a/src/control/toolbar/toolbar.tsx b/src/control/toolbar/toolbar.tsx index da6cf23adee..b02097e16c4 100644 --- a/src/control/toolbar/toolbar.tsx +++ b/src/control/toolbar/toolbar.tsx @@ -111,8 +111,7 @@ export const ToolbarControl = defineComponent({ }); const btnType = (item: IDETBUIActionItem) => { - if (item.actionLevel && item.actionLevel > 100) return 'primary'; - return convertBtnType(item.buttonStyle); + return convertBtnType(item); }; const getChildrenActions = (item: IDETBGroupItem) => { diff --git a/src/panel-component/panel-button/panel-button.tsx b/src/panel-component/panel-button/panel-button.tsx index 0c155a98b94..2de315df388 100644 --- a/src/panel-component/panel-button/panel-button.tsx +++ b/src/panel-component/panel-button/panel-button.tsx @@ -35,7 +35,6 @@ export const PanelButton = defineComponent({ caption, captionItemName, renderMode, - buttonStyle, showCaption, sysImage, codeName, @@ -52,7 +51,7 @@ export const PanelButton = defineComponent({ const buttonType = computed(() => { if (Object.is(renderMode, 'LINK')) return 'text'; - return convertBtnType(buttonStyle); + return convertBtnType(props.modelData); }); const handleButtonClick = (event: MouseEvent) => { diff --git a/src/util/button-util/button-util.ts b/src/util/button-util/button-util.ts index 7ffb48f86e5..8360e48f2de 100644 --- a/src/util/button-util/button-util.ts +++ b/src/util/button-util/button-util.ts @@ -5,12 +5,33 @@ * @param {string} [buttonStyle] * @return {*} {string} */ -export function convertBtnType(buttonStyle?: string): string { +export function convertBtnType(detail: IData): string { + const { buttonStyle, actionLevel } = detail; let buttonType = 'default'; - if ( - buttonStyle && - ['PRIMARY', 'SUCCESS', 'WARNING', 'DANGER'].includes(buttonStyle) - ) - buttonType = buttonStyle.toLowerCase(); + if (buttonStyle) buttonType = buttonStyle.toLowerCase(); + // 样式2为主要色 + if (buttonStyle === 'STYLE2') { + buttonType = 'primary'; + } + // 样式3为反向色 + if (buttonStyle === 'STYLE3') { + buttonType = 'inverse'; + } + // 样式4为危险色 + if (buttonStyle === 'STYLE4') { + buttonType = 'danger'; + } + // 关键操作 + if (actionLevel === 250) { + buttonType = 'danger'; + } + // 常用操作 + if (actionLevel === 200) { + buttonType = 'primary'; + } + // 不常用操作 + if (actionLevel === 50) { + buttonType = 'inverse'; + } return buttonType; } -- Gitee