From 2d9cfe5e6286b9948410b2befde7d2e821034cef Mon Sep 17 00:00:00 2001 From: fzh <1399952343@qq.com> Date: Tue, 2 Jan 2024 21:08:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8Ddrtab=E9=83=A8?= =?UTF-8?q?=E4=BB=B6=E9=85=8D=E7=BD=AE=E4=BA=86=E4=B8=8D=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=BC=96=E8=BE=91=E9=A1=B9=EF=BC=8C=E4=BB=8D?= =?UTF-8?q?=E7=84=B6=E4=BC=9A=E5=B1=95=E7=A4=BA=E9=BB=98=E8=AE=A4=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ src/control/drtab/drtab.controller.ts | 31 ++++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8e6f45b..7b5ecf615 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## [Unreleased] +### Fixed + +- 修复drtab部件配置了不输出默认编辑项,仍然会展示默认编辑项 + ## [0.5.0-beta.5] - 2024-01-02 ### Added diff --git a/src/control/drtab/drtab.controller.ts b/src/control/drtab/drtab.controller.ts index 0be0167a4..fa730f887 100644 --- a/src/control/drtab/drtab.controller.ts +++ b/src/control/drtab/drtab.controller.ts @@ -175,18 +175,19 @@ export class DRTabController if (editItemCapLanguageRes) { caption = ibiz.i18n.t(editItemCapLanguageRes.lanResTag!, editItemCaption); } - - // 首项 - drTabPages.push({ - tag: uniqueTag!, - caption, - hidden: !!hideEditItem, - disabled: false, - sysImage: editItemSysImage, - fullPath: this.routeDepth - ? getNestedRoutePath(this.router.currentRoute.value, this.routeDepth!) - : '', - }); + if (!hideEditItem) { + // 首项 + drTabPages.push({ + tag: uniqueTag!, + caption, + hidden: !!hideEditItem, + disabled: false, + sysImage: editItemSysImage, + fullPath: this.routeDepth + ? getNestedRoutePath(this.router.currentRoute.value, this.routeDepth!) + : '', + }); + } // 关系项 dedrtabPages?.forEach((item: IDEDRCtrlItem) => { let itemCaption = item.caption; @@ -204,12 +205,12 @@ export class DRTabController this.state.drTabPages = drTabPages; if ((this.view.state as IData).srfnav) { this.state.activeName = (this.view.state as IData).srfnav!; - // 路由模式下,且有子路由的时候不需要navpos跳转路由,只要做呈现 - const isRoutePushed = !!this.routeDepth && hasSubRoute(this.routeDepth); - this.handleTabChange(isRoutePushed); } else { this.state.activeName = drTabPages[0].tag; } + // 路由模式下,且有子路由的时候不需要navpos跳转路由,只要做呈现 + const isRoutePushed = !!this.routeDepth && hasSubRoute(this.routeDepth); + this.handleTabChange(isRoutePushed); } /** -- Gitee