diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f92f0fe5b9a718691afaf35d1befdf5fc80cc6b..64ae6163d702a73e3ec66e9fece3ee745f8a3e98 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 b95247e080807e1c26ad22ab943d3369d4053536..083dce7daef324a677f5c50c39b85a856ce59866 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