{
- this.controller.onClick();
- }}
+ onClick={event => this.controller.onClick(event)}
>
{this.controller.model.cssStyle ? (
diff --git a/src/panel-component/panel-app-login-view/panel-app-login-view.tsx b/src/panel-component/panel-app-login-view/panel-app-login-view.tsx
index 0c353951189d70bce548d3295bcb693fa64aa230..7f45a02d649b92776908f8f854bb7621fcfb14da 100644
--- a/src/panel-component/panel-app-login-view/panel-app-login-view.tsx
+++ b/src/panel-component/panel-app-login-view/panel-app-login-view.tsx
@@ -86,9 +86,7 @@ export const PanelAppLoginView = defineComponent({
{
- this.controller.onClick();
- }}
+ onClick={event => this.controller.onClick(event)}
>
{this.controller.model.cssStyle ? (
diff --git a/src/panel-component/panel-app-title/panel-app-title.tsx b/src/panel-component/panel-app-title/panel-app-title.tsx
index 98c36aa80cdda40f4c53d7b6973446ab7272e7a7..6d9a31f7d54fc449e3fa6a1e5d9320b6816c2615 100644
--- a/src/panel-component/panel-app-title/panel-app-title.tsx
+++ b/src/panel-component/panel-app-title/panel-app-title.tsx
@@ -52,7 +52,7 @@ export const PanelAppTitle = defineComponent({
return 'LEFT';
});
- const handleClick = async () => {
+ const handleClick = async (event: MouseEvent) => {
// 适配登录页系统标题不提供点击链接能力
if (c.panel.view.model.viewType === 'APPLOGINVIEW') return;
// 跳转首页
@@ -66,7 +66,7 @@ export const PanelAppTitle = defineComponent({
});
}
- props.controller.onClick();
+ props.controller.onClick(event);
};
const showImgOnly = computed(() => {
diff --git a/src/panel-component/panel-button-list/panel-button-list.controller.ts b/src/panel-component/panel-button-list/panel-button-list.controller.ts
index 3ce5dab2f2741deaa370d40007bb207f9917261b..4dee841df08785b36ccfddcc6e068f29684eba84 100644
--- a/src/panel-component/panel-button-list/panel-button-list.controller.ts
+++ b/src/panel-component/panel-button-list/panel-button-list.controller.ts
@@ -1,11 +1,12 @@
/* eslint-disable object-shorthand */
import {
- ButtonContainerState,
+ UIActionUtil,
PanelController,
- PanelItemController,
PanelNotifyState,
+ PanelItemController,
UIActionButtonState,
- UIActionUtil,
+ getAllUIActionItems,
+ ButtonContainerState,
} from '@ibiz-template/runtime';
import {
IPanelButton,
@@ -75,17 +76,20 @@ export class PanelButtonListController extends PanelItemController {
const { buttonListType, uiactionGroup, panelButtons } = this.model;
if (buttonListType === 'UIACTIONGROUP') {
- uiactionGroup?.uiactionGroupDetails?.forEach(detail => {
- if (detail.uiactionId) {
- const buttonState = new UIActionButtonState(
- detail.id!,
- detail.appId,
- detail.uiactionId,
- detail,
- );
- this.state.buttonsState.addState(detail.id!, buttonState);
- }
- });
+ if (uiactionGroup?.uiactionGroupDetails) {
+ const actions = getAllUIActionItems(uiactionGroup.uiactionGroupDetails);
+ actions.forEach(detail => {
+ if (detail.uiactionId) {
+ const buttonState = new UIActionButtonState(
+ detail.id!,
+ detail.appId,
+ detail.uiactionId,
+ detail,
+ );
+ this.state.buttonsState.addState(detail.id!, buttonState);
+ }
+ });
+ }
} else {
panelButtons?.forEach(button => {
if (button.uiactionId) {
@@ -143,10 +147,10 @@ export class PanelButtonListController extends PanelItemController detail.id === id,
- );
+ if (buttonListType === 'UIACTIONGROUP') {
+ const actions = getAllUIActionItems(uiactionGroup?.uiactionGroupDetails);
+ return actions.find(detail => detail.id === id);
+ }
return panelButtons?.find(button => button.id === id);
}
diff --git a/src/panel-component/panel-button-list/panel-button-list.tsx b/src/panel-component/panel-button-list/panel-button-list.tsx
index a279e6e486715b56c80966b533f93bd50e3bb064..d1753c2286bf58ff16586565606f8a82714df722 100644
--- a/src/panel-component/panel-button-list/panel-button-list.tsx
+++ b/src/panel-component/panel-button-list/panel-button-list.tsx
@@ -47,7 +47,7 @@ export const PanelButtonList = defineComponent({
},
render() {
const { state } = this.controller;
- if (state.visible) {
+ if (state.visible)
return (
);
- }
return null;
},
});
diff --git a/src/panel-component/panel-button/panel-button.controller.ts b/src/panel-component/panel-button/panel-button.controller.ts
index bbc11c5c069eccca38eb2f28e6df73469903055e..e541dd36c9d64de4758e2157a7898a9aab15e180 100644
--- a/src/panel-component/panel-button/panel-button.controller.ts
+++ b/src/panel-component/panel-button/panel-button.controller.ts
@@ -128,9 +128,7 @@ export class PanelButtonController extends PanelItemController {
*/
async onActionClick(event: MouseEvent): Promise {
const { uiactionId, actionType } = this.model;
- if (actionType === 'NONE') {
- return;
- }
+ if (actionType === 'NONE') return;
event.stopPropagation();
event.preventDefault();
await UIActionUtil.execAndResolved(
diff --git a/src/panel-component/panel-button/panel-button.scss b/src/panel-component/panel-button/panel-button.scss
index 7c60a6e6658811d16b76d64149a507d6ec8e88ba..ab471f639985c5ac26ecfd2b1101df4fc1938587 100644
--- a/src/panel-component/panel-button/panel-button.scss
+++ b/src/panel-component/panel-button/panel-button.scss
@@ -13,7 +13,11 @@ $panel-button: (
.el-button{
width: 100%;
-
+
+ > span {
+ // 禁用点击事件,保证event.target是button元素
+ pointer-events: none;
+ }
@include b(panel-button-content){
@include flex(row, flex-start, center);