From cfb911f1a9a16526565d1befbfcb98fbd56852d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Sun, 29 Sep 2024 12:08:20 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E6=B0=94=E6=B3=A1=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E6=94=AF=E6=8C=81=E6=8C=89=E9=92=AE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../popper-toolbar/popper-toolbar.scss | 1 + .../toolbar/popper-toolbar/popper-toolbar.tsx | 28 +++++++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97521a16..3b621ff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - 更新多数据选择视图选择列表的选择样式 - 工具栏新增popper模式 - 支持视图数据看板视图 +- 气泡工具栏支持按钮样式 ## [0.0.21] - 2024-09-25 diff --git a/src/control/toolbar/popper-toolbar/popper-toolbar.scss b/src/control/toolbar/popper-toolbar/popper-toolbar.scss index 8211409c..dfb63292 100644 --- a/src/control/toolbar/popper-toolbar/popper-toolbar.scss +++ b/src/control/toolbar/popper-toolbar/popper-toolbar.scss @@ -8,6 +8,7 @@ right: var(--van-back-top-right); bottom: 130px; height: auto; + z-index: 999; } .van-popover { --van-popup-background: transparent; diff --git a/src/control/toolbar/popper-toolbar/popper-toolbar.tsx b/src/control/toolbar/popper-toolbar/popper-toolbar.tsx index cb17f025..ea02d975 100644 --- a/src/control/toolbar/popper-toolbar/popper-toolbar.tsx +++ b/src/control/toolbar/popper-toolbar/popper-toolbar.tsx @@ -1,6 +1,11 @@ import { useNamespace } from '@ibiz-template/vue3-util'; import { defineComponent, PropType, Ref, ref, VNode } from 'vue'; -import { IDETBGroupItem, IDEToolbar, IDEToolbarItem } from '@ibiz/model-core'; +import { + IDETBGroupItem, + IDETBUIActionItem, + IDEToolbar, + IDEToolbarItem, +} from '@ibiz/model-core'; import { IExtraButton, ToolbarController } from '@ibiz-template/runtime'; import './popper-toolbar.scss'; @@ -29,6 +34,11 @@ export const IBizPopperToolbar = defineComponent({ placement = c.controlParams.placement || 'left'; } + const btnType = (item: IDEToolbarItem) => { + const result = (item as IDETBUIActionItem).buttonStyle || 'default'; + return result.toLowerCase(); + }; + // 点击事件 const handleClick = async ( item: IDEToolbarItem | IExtraButton, @@ -60,11 +70,19 @@ export const IBizPopperToolbar = defineComponent({ }} > {{ - action: ({ action }: { action: IData }): VNode => { - return {action.tooltip}; + action: ({ action }: { action: IDEToolbarItem }): VNode => { + return ( + + {action.tooltip} + + ); }, reference: (): VNode => { - return {item.tooltip}; + return ( + + {item.tooltip} + + ); }, }} @@ -86,7 +104,7 @@ export const IBizPopperToolbar = defineComponent({ > Date: Sun, 29 Sep 2024 19:42:51 +0800 Subject: [PATCH 2/5] =?UTF-8?q?style:=20=E4=BF=AE=E5=A4=8D=E5=88=86?= =?UTF-8?q?=E5=89=B2=E7=BA=BF=E4=B8=AD=E9=97=B4=E7=A9=BA=E7=99=BD=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/rawitem/rawitem.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/common/rawitem/rawitem.tsx b/src/common/rawitem/rawitem.tsx index fea5e0e8..d7dca4a3 100644 --- a/src/common/rawitem/rawitem.tsx +++ b/src/common/rawitem/rawitem.tsx @@ -259,10 +259,17 @@ export const IBizRawItem = defineComponent({ ); } if (this.rawItemType === 'DIVIDER') { + if (this.dividerParams.html) { + return ( + + + + ); + } return ( - - - + ); } if ( -- Gitee From db9ce30bc99841cf9892ce23731909af214ae247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Sun, 29 Sep 2024 19:43:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E8=A1=A8=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E3=80=81=E8=A1=A8=E5=8D=95=E5=88=86=E7=BB=84=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form-detail/form-druipart/form-druipart.tsx | 5 ++++- .../form-group-panel/form-group-panel.tsx | 5 ++++- .../form/form-detail/form-item/form-item.tsx | 15 +++++++++++++++ .../form-detail/form-rawitem/form-rawitem.tsx | 1 + .../form-detail/form-tab-page/form-tab-page.tsx | 1 + 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/control/form/form-detail/form-druipart/form-druipart.tsx b/src/control/form/form-detail/form-druipart/form-druipart.tsx index 1cb25152..d4d52917 100644 --- a/src/control/form/form-detail/form-druipart/form-druipart.tsx +++ b/src/control/form/form-detail/form-druipart/form-druipart.tsx @@ -57,7 +57,10 @@ export const FormDRUIPart = defineComponent({ } const viewShell = resolveComponent('IBizViewShell'); return ( -
+
this.controller.onClick(event)} + > {header}
{h(viewShell, { diff --git a/src/control/form/form-detail/form-group-panel/form-group-panel.tsx b/src/control/form/form-detail/form-group-panel/form-group-panel.tsx index 85ffff35..25c3feef 100644 --- a/src/control/form/form-detail/form-group-panel/form-group-panel.tsx +++ b/src/control/form/form-detail/form-group-panel/form-group-panel.tsx @@ -132,7 +132,10 @@ export const FormGroupPanel = defineComponent({ } return ( -
+
this.controller.onClick(event)} + > {header}
{content}
{footer} diff --git a/src/control/form/form-detail/form-item/form-item.tsx b/src/control/form/form-detail/form-item/form-item.tsx index 953d38be..39343314 100644 --- a/src/control/form/form-detail/form-item/form-item.tsx +++ b/src/control/form/form-detail/form-item/form-item.tsx @@ -15,6 +15,10 @@ export const FormItem = defineComponent({ type: FormItemController, required: true, }, + attrs: { + type: Object as PropType, + required: false, + }, }, setup(props) { const ns = useNamespace('form-item'); @@ -39,6 +43,7 @@ export const FormItem = defineComponent({ // 编辑器内容 let editor = null; + const editMode = this.controller.editor?.model?.editorParams?.editMode; const editorProps = { value: this.controller.value, data: this.controller.data, @@ -46,6 +51,15 @@ export const FormItem = defineComponent({ disabled: this.controller.state.disabled, readonly: this.controller.model.editor!.readOnly, onChange: this.onValueChange, + controlParams: editMode + ? { ...this.controller.form.controlParams, editmode: editMode } + : this.controller.form.controlParams, + onFocus: (event: MouseEvent) => this.c.onFocus(event), + onBlur: (event: MouseEvent) => this.c.onBlur(event), + onEnter: (event: MouseEvent) => this.controller.onEnter(event), + onClick: (event: MouseEvent, params: IParams) => + this.controller.onClick(event, params), + ...this.attrs, }; if (this.c.form.state.isLoaded) { if (this.$slots.default) { @@ -75,6 +89,7 @@ export const FormItem = defineComponent({ label={this.captionText} label-pos={this.c.model.labelPos} label-width={this.c.model.labelWidth} + onClick={(event: MouseEvent) => this.c.onClick(event)} > {editor} 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 955e4666..3145221d 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()} content={content} type={type} + onClick={(event: MouseEvent) => this.controller.onClick(event)} > ); }, diff --git a/src/control/form/form-detail/form-tab-page/form-tab-page.tsx b/src/control/form/form-detail/form-tab-page/form-tab-page.tsx index 8298040e..64bbc636 100644 --- a/src/control/form/form-detail/form-tab-page/form-tab-page.tsx +++ b/src/control/form/form-detail/form-tab-page/form-tab-page.tsx @@ -34,6 +34,7 @@ export const FormTabPage = defineComponent({ ...this.controller.containerClass, ]} layout={this.modelData.layout} + onClick={(event: MouseEvent) => this.controller.onClick(event)} > {defaultSlots.map(slot => { const props = slot.props as IData; -- Gitee From bbf5f889cc09f095ae7dd0f7481263486d7e2ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Sun, 29 Sep 2024 19:44:28 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E9=98=BB=E6=AD=A2=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB=E5=86=92=E6=B3=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/panel-component/panel-button/panel-button.controller.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/panel-component/panel-button/panel-button.controller.ts b/src/panel-component/panel-button/panel-button.controller.ts index f01e4701..43f55b66 100644 --- a/src/panel-component/panel-button/panel-button.controller.ts +++ b/src/panel-component/panel-button/panel-button.controller.ts @@ -124,6 +124,8 @@ export class PanelButtonController extends PanelItemController { * @memberof PanelButtonController */ async onActionClick(event: MouseEvent): Promise { + event.stopPropagation(); + event.preventDefault(); const { uiactionId } = this.model; await UIActionUtil.execAndResolved( uiactionId!, -- Gitee From bdeaa5cc6c2d752ed2e273d56b75bd1d27af1ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=94=BF=E6=9D=83?= <1978141412@qq.com> Date: Sun, 29 Sep 2024 19:45:49 +0800 Subject: [PATCH 5/5] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b621ff9..3a5a6dca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ - 工具栏新增popper模式 - 支持视图数据看板视图 - 气泡工具栏支持按钮样式 +- 表单项、表单分组支持点击事件 + +### Fixed + +- 阻止面板按钮点击冒泡 +- 修复分割线中间空白异常 ## [0.0.21] - 2024-09-25 -- Gitee