From 96851395307cd77fa9d671a7ded74d3ad7aeaaf7 Mon Sep 17 00:00:00 2001 From: zhangkang <1752553776@qq.com> Date: Tue, 11 Jul 2023 22:12:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=B7=A6=E5=8F=B3=E5=85=B3=E7=B3=BB=20?= =?UTF-8?q?=E5=A4=9A=E5=87=BA=E5=88=86=E7=BB=84=E5=B1=82=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/control/drbar/drbar.controller.ts | 26 ++++++-------------------- src/control/drbar/drbar.tsx | 23 +++++++++++------------ 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/control/drbar/drbar.controller.ts b/src/control/drbar/drbar.controller.ts index 9de8fca18..7136c49d2 100644 --- a/src/control/drbar/drbar.controller.ts +++ b/src/control/drbar/drbar.controller.ts @@ -177,7 +177,6 @@ export class DRBarController hideEditItem, editItemSysImage, uniqueTag, - dedrbarGroups, dedrctrlItems, } = this.model; const drBarItems: IDRBarItemsState[] = []; @@ -191,27 +190,14 @@ export class DRBarController fullPath: this.router.currentRoute.value.fullPath, }); // 关系项 - dedrbarGroups?.forEach(group => { - const drBarItem: IDRBarItemsState = { - tag: group.id!, - caption: group.caption, - hidden: !!group.hidden, - sysImage: group.sysImage, + dedrctrlItems?.forEach((item: IDEDRBarItem) => { + drBarItems.push({ + tag: item.id!, + caption: item.caption, + sysImage: item.sysImage, + hidden: false, disabled: false, - children: [], - }; - dedrctrlItems?.forEach((item: IDEDRBarItem) => { - if (item.dedrbarGroupId === group.id) { - drBarItem.children!.push({ - tag: item.id!, - caption: item.caption, - sysImage: item.sysImage, - hidden: false, - disabled: false, - }); - } }); - drBarItems.push(drBarItem); }); this.state.drBarItems = drBarItems; } diff --git a/src/control/drbar/drbar.tsx b/src/control/drbar/drbar.tsx index 6c6082933..ad339c634 100644 --- a/src/control/drbar/drbar.tsx +++ b/src/control/drbar/drbar.tsx @@ -2,8 +2,8 @@ import { useControlController, useNamespace } from '@ibiz-template/vue3-util'; import { defineComponent, PropType } from 'vue'; import { IDEDRBar } from '@ibiz/model-core'; import { useRouter } from 'vue-router'; -import { DRBarController } from './drbar.controller'; import { IDRBarItemsState } from '@ibiz-template/runtime'; +import { DRBarController } from './drbar.controller'; export const DRBarControl = defineComponent({ name: 'IBizDrBarControl', @@ -42,18 +42,17 @@ export const DRBarControl = defineComponent({ }} ); - } else { - return ( - - - {item.caption} - - ); } + return ( + + + {item.caption} + + ); } }; -- Gitee From c24d6d8a959750e52fc9aa49a22bed349fb4be3c Mon Sep 17 00:00:00 2001 From: zhangkang <1752553776@qq.com> Date: Tue, 11 Jul 2023 22:13:16 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=9C=AA=E5=8D=A0=E6=BB=A1=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/control/app-menu/app-menu.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/app-menu/app-menu.scss b/src/control/app-menu/app-menu.scss index e36868639..87bf6e27a 100644 --- a/src/control/app-menu/app-menu.scss +++ b/src/control/app-menu/app-menu.scss @@ -93,6 +93,8 @@ $control-appmenu-item: ( @include b(control-appmenu) { position: static; + height: 100%; + overflow-y: auto; @include set-component-css-var('control-appmenu', $control-appmenu); @include set-component-css-var('control-appmenu-item', $control-appmenu-item); @@ -133,8 +135,6 @@ $control-appmenu-item: ( } } - overflow-y: auto; - // 图标样式 @include e(icon) { margin: getCssVar('control-appmenu', 'icon-margin'); -- Gitee From aae7ffbe218f01124a7b1c295b54587d2c50555f Mon Sep 17 00:00:00 2001 From: zhangkang <1752553776@qq.com> Date: Tue, 11 Jul 2023 22:14:53 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E8=8F=9C=E5=8D=95=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=20&=20=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/control/app-menu/app-menu.tsx | 76 ++++++------------------------- 1 file changed, 13 insertions(+), 63 deletions(-) diff --git a/src/control/app-menu/app-menu.tsx b/src/control/app-menu/app-menu.tsx index 865ac2574..a8035f6ed 100644 --- a/src/control/app-menu/app-menu.tsx +++ b/src/control/app-menu/app-menu.tsx @@ -4,7 +4,6 @@ import { IAppMenuItem, IAppMenu } from '@ibiz/model-core'; import { computed, defineComponent, - getCurrentInstance, onMounted, onUnmounted, PropType, @@ -144,7 +143,6 @@ export const AppMenuControl = defineComponent({ }, }, setup(props) { - const { proxy } = getCurrentInstance()!; const c = useControlController((...args) => new AppMenuController(...args)); const ns = useNamespace(`control-${c.model.controlType!.toLowerCase()}`); const menus = ref(getMenus(c.model.appMenuItems!)); @@ -164,69 +162,19 @@ export const AppMenuControl = defineComponent({ const key = ref(createUUID()); - // 手动更新iView菜单 - const updateMenu = () => { - setTimeout(() => { - if (proxy!.$refs.menu) { - key.value = createUUID(); + // 计算当前路由匹配菜单 + const calcCurMenu = (): IAppMenuItem | undefined => { + const allItems = c.getAllItems(); + const app = ibiz.hub.getApp(c.context.srfappid); + return allItems.find(item => { + if (item.itemType === 'MENUITEM' && item.appFuncId) { + const func = app.getAppFunc(item.appFuncId!); + return func?.appViewId?.split('.')?.[1] === route.params.view2; } - }, 500); + return false; + }); }; - // 菜单选中回显,监听视图传进来的currentPath - // watch( - // () => props.currentPath, - // (newVal, oldVal) => { - // // 新旧值不一样,且新值不为空时变更 - // if (newVal !== oldVal && newVal) { - // const findItem = c.model.allItems.find(item => { - // return item.viewModelPath === newVal; - // }); - // if (findItem) { - // defaultActive.value = findItem.source.id; - // updateMenu(); - // } - // } - // }, - // { deep: true, immediate: true }, - // ); - - // 处理默认展开父菜单 - // const handleDefaultOpen = (_parent: IAppMenuItem) => { - // todo - // if (parent && parent.itemType === 'MENUITEM') { - // const findIndex = defaultOpens.value.findIndex(open => { - // return open === parent.id; - // }); - // if (findIndex === -1) { - // defaultOpens.value.push(parent.id!); - // } - // const gParent = parent.getParentPSModelObject() as IAppMenuItem; - // if (gParent) { - // handleDefaultOpen(gParent); - // } - // } - // }; - - // 回显完成后,遍历展开父菜单 - // watch( - // () => defaultActive.value, - // newVal => { - // const findItem = c.model.allItems.find(item => { - // return newVal === item.id; - // }); - // if (findItem) { - // const parent = - // findItem.source.getParentPSModelObject() as IPSAppMenuItem; - // // 遍历取父菜单项 - // if (props.mode === 'LEFT') { - // handleDefaultOpen(parent); - // } - // updateMenu(); - // } - // }, - // ); - onMounted(async () => { const allItems = c.getAllItems(); // 默认激活的菜单项 @@ -240,6 +188,9 @@ export const AppMenuControl = defineComponent({ ) { defaultActive.value = defaultActiveMenuItem.id!; onClick(defaultActive.value); + } else { + const activeMenu = calcCurMenu(); + defaultActive.value = activeMenu ? activeMenu.id! : ''; } // 默认展开的菜单项数组 const defaultOpensArr = allItems.filter(item => { @@ -252,7 +203,6 @@ export const AppMenuControl = defineComponent({ }); } } - updateMenu(); // 计数器相关 const counterRefId = c.model.appCounterRefId; if (counterRefId) { -- Gitee From c071763de0dc5367e024876325237c4aef9d58e7 Mon Sep 17 00:00:00 2001 From: zhangkang <1752553776@qq.com> Date: Tue, 11 Jul 2023 22:15:22 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=A1=B9=E5=AE=B9=E5=99=A8=E5=AE=BD=E5=BA=A6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form-item-container.scss | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss b/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss index 87feb1d88..28a464d7d 100644 --- a/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss +++ b/src/control/form/form-detail/form-item/form-item-container/form-item-container.scss @@ -8,29 +8,29 @@ $form-item-container: ( } @include b(form-item-container) { + box-sizing: border-box; width: 100%; height: 100%; + padding-right: getCssVar('padding-right'); + padding-bottom: getCssVar('padding-bottom'); @include e(label) { @include utils-ellipsis; padding-top: calc( ( - getCssVar('form-item-container', 'line-height') - - getCssVar('form-item', 'font-size') - ) / 2 + getCssVar('form-item-container', 'line-height') - + getCssVar('form-item', 'font-size') + ) / 2 ); padding-bottom: calc( ( - getCssVar('form-item-container', 'line-height') - - getCssVar('form-item', 'font-size') - ) / 2 + getCssVar('form-item-container', 'line-height') - + getCssVar('form-item', 'font-size') + ) / 2 ); line-height: getCssVar('form-item', 'font-size'); } - padding-right: getCssVar('padding-right'); - padding-bottom: getCssVar('padding-bottom'); - @include m((left, right)) { min-height: getCssVar('form-item-container', 'line-height'); line-height: getCssVar('form-item-container', 'line-height'); -- Gitee