From 4cd5943b7040e853fe8ba2881594d7c894a61d49 Mon Sep 17 00:00:00 2001
From: ShineKOT <1917095344@qq.com>
Date: Wed, 30 Oct 2024 16:01:49 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E5=85=B7?=
=?UTF-8?q?=E6=A0=8F=E5=88=86=E7=BB=84=E9=A1=B9=E6=98=BE=E7=A4=BA=E5=BC=82?=
=?UTF-8?q?=E5=B8=B8=EF=BC=8C=E6=9B=B4=E6=96=B0=E5=88=86=E9=A1=B5=E5=AF=BC?=
=?UTF-8?q?=E8=88=AA=E8=A7=86=E5=9B=BE=E8=AE=A1=E7=AE=97=E5=B7=A5=E5=85=B7?=
=?UTF-8?q?=E6=A0=8F=E6=9D=83=E9=99=90=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 5 +
src/control/toolbar/toolbar.tsx | 2 +-
src/view-engine/mob-tab-exp-view.engine.ts | 101 +++------------------
3 files changed, 18 insertions(+), 90 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f92f0fe5b..64ae6163d7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,11 @@
### Fixed
- 修复默认登录页密码框是明文的问题
+- 修复工具栏分组项显示异常
+
+### Change
+
+- 分页导航视图加载实体数据后计算工具栏权限状态逻辑迁移到runtime包
### Added
diff --git a/src/control/toolbar/toolbar.tsx b/src/control/toolbar/toolbar.tsx
index b95247e080..083dce7dae 100644
--- a/src/control/toolbar/toolbar.tsx
+++ b/src/control/toolbar/toolbar.tsx
@@ -130,7 +130,7 @@ export const ToolbarControl = defineComponent({
);
return null;
}
- if (item.itemType === 'ITEMS') {
+ if (item.itemType === 'ITEMS' && c.state.buttonsState[itemId]?.visible) {
const placement = position === 'right' ? 'bottom-end' : 'bottom';
return (
}
+ * @memberof MobTabExpViewEngine
+ */
async onMounted(): Promise {
await super.onMounted();
-
- const { evt } = this.view;
- evt.on(
- 'onDataChange',
- ({ actionType, data }: { actionType: string; data: IData[] }) => {
- if (actionType !== 'LOAD') {
- return;
- }
- const viewDeId = this.view.model.appDataEntityId;
- this.updateToolbarState(data[0], viewDeId);
- },
- );
await this.loadEntityData();
}
+ /**
+ * 加载实体数据
+ *
+ * @return {*} {Promise}
+ * @memberof MobTabExpViewEngine
+ */
async loadEntityData(): Promise {
// 分页导航没有主键不加载
const deName = calcDeCodeNameById(this.view.model.appDataEntityId!);
@@ -141,43 +101,6 @@ export class MobTabExpViewEngine extends ViewEngineBase {
return super.loadEntityData();
}
- /**
- * 获取所有的工具栏控制器
- *
- * @author ljx
- * @date 2024-10-28 15:36:45
- * @protected
- * @return {*} {IToolbarController[]}
- */
- protected getAllToolbars(): IToolbarController[] {
- const toolbars: IToolbarController[] = [];
- if (this.leftToolbar) {
- toolbars.push(this.leftToolbar);
- }
- if (this.rightToolbar) {
- toolbars.push(this.rightToolbar);
- }
- if (this.footerToolbar) {
- toolbars.push(this.footerToolbar);
- }
- return toolbars;
- }
-
- /**
- * 更新工具栏状态
- *
- * @author ljx
- * @date 2024-10-28 15:36:45
- * @protected
- * @param {IData} data
- * @param {string} appDeId
- */
- protected updateToolbarState(data: IData, appDeId?: string): void {
- this.getAllToolbars().forEach(toolbar => {
- toolbar?.calcButtonState(data, appDeId);
- });
- }
-
/**
* @description 检测实体数据变更
* @protected
--
Gitee