@oinone/kunlun-vue-admin-layout 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/oinone-kunlun-vue-admin-layout.css +1 -0
- package/dist/oinone-kunlun-vue-admin-layout.esm.js +12049 -0
- package/dist/oinone-kunlun-vue-admin-layout.scss +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/src/basic/MaskWidget.d.ts +17 -0
- package/dist/types/src/basic/index.d.ts +2 -0
- package/dist/types/src/basic/register/index.d.ts +1 -0
- package/dist/types/src/basic/register/manager.d.ts +7 -0
- package/dist/types/src/basic/token/BaseMaskWidget.d.ts +55 -0
- package/dist/types/src/basic/token/index.d.ts +1 -0
- package/dist/types/src/component/app-switcher/AppSwitcher.vue.d.ts +84 -0
- package/dist/types/src/component/app-switcher/AppSwitcherMask.vue.d.ts +61 -0
- package/dist/types/src/component/app-switcher/AppSwitcherWidget.d.ts +33 -0
- package/dist/types/src/component/app-switcher/index.d.ts +3 -0
- package/dist/types/src/component/breadcrumb/BreadcrumbWidget.d.ts +33 -0
- package/dist/types/src/component/breadcrumb/DefaultBreadcrumb.vue.d.ts +58 -0
- package/dist/types/src/component/breadcrumb/index.d.ts +2 -0
- package/dist/types/src/component/debug/Debug.vue.d.ts +11 -0
- package/dist/types/src/component/debug/DebugWidget.d.ts +8 -0
- package/dist/types/src/component/debug/constants.d.ts +2 -0
- package/dist/types/src/component/debug/index.d.ts +6 -0
- package/dist/types/src/component/debug/spi/DebugMaskEditor.d.ts +6 -0
- package/dist/types/src/component/debug/spi/DebugRouterInitializeService.d.ts +4 -0
- package/dist/types/src/component/debug/spi/index.d.ts +1 -0
- package/dist/types/src/component/debug/typing.d.ts +159 -0
- package/dist/types/src/component/debug/view/DebugMainView.vue.d.ts +28 -0
- package/dist/types/src/component/debug/view/DebugMainViewWidget.d.ts +9 -0
- package/dist/types/src/component/debug/view/components/DebugDefaultInfo.vue.d.ts +22 -0
- package/dist/types/src/component/debug/view/components/DebugJsonView.vue.d.ts +26 -0
- package/dist/types/src/component/debug/view/components/DebugRequestInfoPanel.vue.d.ts +22 -0
- package/dist/types/src/component/debug/view/components/DebugResponsePanel.vue.d.ts +12 -0
- package/dist/types/src/component/debug/view/debug-api/DebugApi.vue.d.ts +52 -0
- package/dist/types/src/component/debug/view/debug-api/DebugApiWidget.d.ts +32 -0
- package/dist/types/src/component/debug/view/debug-utils.d.ts +44 -0
- package/dist/types/src/component/debug/view/debug-view/DebugView.vue.d.ts +78 -0
- package/dist/types/src/component/debug/view/debug-view/DebugViewWidget.d.ts +26 -0
- package/dist/types/src/component/debug/view/index.d.ts +5 -0
- package/dist/types/src/component/debug/view/service/DebugRuntimeContextService.d.ts +18 -0
- package/dist/types/src/component/debug/view/service/DebugStackInfoService.d.ts +27 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugDefaultRuntimeContextService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeActionService.d.ts +7 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeDslService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeFieldService.d.ts +7 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeLayoutService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeMaskService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeTemplateService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/runtime-context/DebugRuntimeViewService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugBizStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugConfigureService.d.ts +4 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugDefaultStackInfoService.d.ts +8 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugExceptionStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugFunctionService.d.ts +4 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugHalfBizStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugModelService.d.ts +4 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugPureBizStackService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugStacktraceGqlRequestContextService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugStacktraceSceneAnalysisService.d.ts +7 -0
- package/dist/types/src/component/debug/view/service/impl/stack-info/DebugStacktraceSessionService.d.ts +6 -0
- package/dist/types/src/component/debug/view/service/index.d.ts +20 -0
- package/dist/types/src/component/debug/view/storage.d.ts +19 -0
- package/dist/types/src/component/debug/view/useDebugRequestInfo.d.ts +7 -0
- package/dist/types/src/component/divider/Divider.vue.d.ts +2 -0
- package/dist/types/src/component/divider/DividerWidget.d.ts +4 -0
- package/dist/types/src/component/divider/index.d.ts +1 -0
- package/dist/types/src/component/index.d.ts +14 -0
- package/dist/types/src/component/language/DefaultLanguage.vue.d.ts +34 -0
- package/dist/types/src/component/language/LanguageWidget.d.ts +16 -0
- package/dist/types/src/component/language/index.d.ts +1 -0
- package/dist/types/src/component/layout/BaseMaskLayoutWidget.d.ts +4 -0
- package/dist/types/src/component/layout/MaskBlock.vue.d.ts +24 -0
- package/dist/types/src/component/layout/block/MaskBlockWidget.d.ts +4 -0
- package/dist/types/src/component/layout/block/index.d.ts +1 -0
- package/dist/types/src/component/layout/container/MaskContainerWidget.d.ts +4 -0
- package/dist/types/src/component/layout/container/index.d.ts +1 -0
- package/dist/types/src/component/layout/content/MaskContentWidget.d.ts +7 -0
- package/dist/types/src/component/layout/content/index.d.ts +1 -0
- package/dist/types/src/component/layout/grid/Grid.vue.d.ts +2 -0
- package/dist/types/src/component/layout/grid/GridWidget.d.ts +9 -0
- package/dist/types/src/component/layout/grid/index.d.ts +1 -0
- package/dist/types/src/component/layout/header/MaskHeaderWidget.d.ts +4 -0
- package/dist/types/src/component/layout/header/index.d.ts +1 -0
- package/dist/types/src/component/layout/index.d.ts +9 -0
- package/dist/types/src/component/layout/mask/MaskRootWidget.d.ts +4 -0
- package/dist/types/src/component/layout/mask/index.d.ts +1 -0
- package/dist/types/src/component/layout/sidebar/MaskSidebarWidget.d.ts +10 -0
- package/dist/types/src/component/layout/sidebar/index.d.ts +1 -0
- package/dist/types/src/component/layout/widget/MaskCommonWidget.d.ts +14 -0
- package/dist/types/src/component/layout/widget/index.d.ts +1 -0
- package/dist/types/src/component/menu/DefaultMenu.vue.d.ts +115 -0
- package/dist/types/src/component/menu/DefaultSubMenu.vue.d.ts +17 -0
- package/dist/types/src/component/menu/MenuWidget.d.ts +71 -0
- package/dist/types/src/component/menu/index.d.ts +3 -0
- package/dist/types/src/component/multi-tabs/MultiTabs.vue.d.ts +151 -0
- package/dist/types/src/component/multi-tabs/MultiTabsWidget.d.ts +60 -0
- package/dist/types/src/component/multi-tabs/index.d.ts +2 -0
- package/dist/types/src/component/multi-tabs/typing.d.ts +6 -0
- package/dist/types/src/component/notification/DefaultNotification.vue.d.ts +61 -0
- package/dist/types/src/component/notification/NotificationWidget.d.ts +139 -0
- package/dist/types/src/component/notification/index.d.ts +2 -0
- package/dist/types/src/component/order-statistic/OrderStatistic.vue.d.ts +8 -0
- package/dist/types/src/component/order-statistic/index.d.ts +14 -0
- package/dist/types/src/component/partner-switcher/PartnerSwitcher.vue.d.ts +28 -0
- package/dist/types/src/component/partner-switcher/PartnerSwitcherWidget.d.ts +15 -0
- package/dist/types/src/component/partner-switcher/index.d.ts +6 -0
- package/dist/types/src/component/partner-switcher/service/PartnerSwitcherService.d.ts +17 -0
- package/dist/types/src/component/partner-switcher/service/impl/PartnerSwitcherServiceImpl.d.ts +17 -0
- package/dist/types/src/component/partner-switcher/service/index.d.ts +2 -0
- package/dist/types/src/component/partner-switcher/session/PartnerInfoSession.d.ts +26 -0
- package/dist/types/src/component/partner-switcher/session/impl/DefaultPartnerInfoSession.d.ts +15 -0
- package/dist/types/src/component/partner-switcher/session/index.d.ts +2 -0
- package/dist/types/src/component/partner-switcher/spi/PartnerSwitcherMaskEditor.d.ts +6 -0
- package/dist/types/src/component/partner-switcher/spi/index.d.ts +1 -0
- package/dist/types/src/component/partner-switcher/typing/index.d.ts +1 -0
- package/dist/types/src/component/partner-switcher/typing/partner.d.ts +20 -0
- package/dist/types/src/component/quick-search/QuickSearch.vue.d.ts +29 -0
- package/dist/types/src/component/quick-search/index.d.ts +24 -0
- package/dist/types/src/component/user/DefaultUser.vue.d.ts +39 -0
- package/dist/types/src/component/user/UserWidget.d.ts +16 -0
- package/dist/types/src/component/user/index.d.ts +1 -0
- package/dist/types/src/config/DebugConfig.d.ts +16 -0
- package/dist/types/src/config/PartnerSwitcherConfig.d.ts +16 -0
- package/dist/types/src/config/index.d.ts +2 -0
- package/dist/types/src/index.d.ts +10 -0
- package/dist/types/src/service/index.d.ts +5 -0
- package/dist/types/src/service/menu-service.d.ts +12 -0
- package/dist/types/src/service/message-service.d.ts +16 -0
- package/dist/types/src/service/module-service.d.ts +7 -0
- package/dist/types/src/service/top-bar-service.d.ts +10 -0
- package/dist/types/src/service/user-service.d.ts +4 -0
- package/dist/types/src/spi/index.d.ts +1 -0
- package/dist/types/src/spi/mask-editor.d.ts +54 -0
- package/dist/types/src/tags/Block.vue.d.ts +5 -0
- package/dist/types/src/tags/Breadcrumb.vue.d.ts +5 -0
- package/dist/types/src/tags/Container.vue.d.ts +5 -0
- package/dist/types/src/tags/Content.vue.d.ts +5 -0
- package/dist/types/src/tags/Header.vue.d.ts +5 -0
- package/dist/types/src/tags/Mask.vue.d.ts +5 -0
- package/dist/types/src/tags/MultiTabs.vue.d.ts +5 -0
- package/dist/types/src/tags/Sidebar.vue.d.ts +5 -0
- package/dist/types/src/tags/Widget.vue.d.ts +5 -0
- package/dist/types/src/tags/context/context.d.ts +8 -0
- package/dist/types/src/tags/context/index.d.ts +1 -0
- package/dist/types/src/tags/index.d.ts +6 -0
- package/dist/types/src/tags/mixin/MaskWidgetTagMixin.d.ts +2 -0
- package/dist/types/src/tags/mixin/index.d.ts +3 -0
- package/dist/types/src/tags/mixin/typing.d.ts +6 -0
- package/dist/types/src/tags/mixin/use-mask-widget-tag.d.ts +38 -0
- package/dist/types/src/tags/register/index.d.ts +1 -0
- package/dist/types/src/tags/register/manager.d.ts +9 -0
- package/dist/types/src/tags/resolve/index.d.ts +2 -0
- package/dist/types/src/tags/resolve/internal/index.d.ts +2 -0
- package/dist/types/src/tags/resolve/internal/typing.d.ts +5 -0
- package/dist/types/src/tags/resolve/internal/widget-resolve.d.ts +3 -0
- package/dist/types/src/tags/resolve/typing.d.ts +26 -0
- package/dist/types/src/tags/resolve/widget-resolve.d.ts +5 -0
- package/dist/types/src/template/default-mask.d.ts +2 -0
- package/dist/types/src/template/index.d.ts +6 -0
- package/dist/types/src/theme/index.d.ts +1 -0
- package/dist/types/src/typing/constant.d.ts +1 -0
- package/dist/types/src/typing/index.d.ts +3 -0
- package/dist/types/src/typing/menu.d.ts +12 -0
- package/dist/types/src/typing/stream-symble.d.ts +12 -0
- package/dist/types/src/util/HomepageUtils.d.ts +3 -0
- package/dist/types/src/util/MenuUtil.d.ts +5 -0
- package/dist/types/src/util/index.d.ts +3 -0
- package/dist/types/src/util/unauthorized-action.d.ts +14 -0
- package/dist/types/src/utils.d.ts +86 -0
- package/index.ts +1 -0
- package/package.json +47 -0
- package/rollup.config.js +33 -0
- package/src/basic/MaskWidget.ts +74 -0
- package/src/basic/index.ts +2 -0
- package/src/basic/register/index.ts +1 -0
- package/src/basic/register/manager.ts +17 -0
- package/src/basic/token/BaseMaskWidget.ts +187 -0
- package/src/basic/token/index.ts +1 -0
- package/src/component/app-switcher/AppSwitcher.vue +133 -0
- package/src/component/app-switcher/AppSwitcherMask.vue +237 -0
- package/src/component/app-switcher/AppSwitcherWidget.ts +152 -0
- package/src/component/app-switcher/index.ts +3 -0
- package/src/component/breadcrumb/BreadcrumbWidget.ts +167 -0
- package/src/component/breadcrumb/DefaultBreadcrumb.vue +95 -0
- package/src/component/breadcrumb/index.ts +2 -0
- package/src/component/debug/Debug.vue +28 -0
- package/src/component/debug/DebugWidget.ts +38 -0
- package/src/component/debug/constants.ts +3 -0
- package/src/component/debug/index.ts +6 -0
- package/src/component/debug/spi/DebugMaskEditor.ts +19 -0
- package/src/component/debug/spi/DebugRouterInitializeService.ts +21 -0
- package/src/component/debug/spi/index.ts +1 -0
- package/src/component/debug/typing.ts +191 -0
- package/src/component/debug/view/DebugMainView.vue +206 -0
- package/src/component/debug/view/DebugMainViewWidget.ts +42 -0
- package/src/component/debug/view/components/DebugDefaultInfo.vue +31 -0
- package/src/component/debug/view/components/DebugJsonView.vue +107 -0
- package/src/component/debug/view/components/DebugRequestInfoPanel.vue +129 -0
- package/src/component/debug/view/components/DebugResponsePanel.vue +66 -0
- package/src/component/debug/view/components/runtime-context/DebugRuntimeFieldComponent.vue +29 -0
- package/src/component/debug/view/debug-api/DebugApi.vue +225 -0
- package/src/component/debug/view/debug-api/DebugApiWidget.ts +400 -0
- package/src/component/debug/view/debug-utils.ts +114 -0
- package/src/component/debug/view/debug-view/DebugView.vue +331 -0
- package/src/component/debug/view/debug-view/DebugViewWidget.ts +181 -0
- package/src/component/debug/view/index.ts +6 -0
- package/src/component/debug/view/service/DebugRuntimeContextService.ts +21 -0
- package/src/component/debug/view/service/DebugStackInfoService.ts +33 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugDefaultRuntimeContextService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeActionService.ts +28 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeDslService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeFieldService.ts +33 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeLayoutService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeMaskService.ts +30 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeTemplateService.ts +16 -0
- package/src/component/debug/view/service/impl/runtime-context/DebugRuntimeViewService.ts +16 -0
- package/src/component/debug/view/service/impl/stack-info/DebugBizStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugConfigureService.ts +6 -0
- package/src/component/debug/view/service/impl/stack-info/DebugDefaultStackInfoService.ts +62 -0
- package/src/component/debug/view/service/impl/stack-info/DebugExceptionStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugFunctionService.ts +6 -0
- package/src/component/debug/view/service/impl/stack-info/DebugHalfBizStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugModelService.ts +6 -0
- package/src/component/debug/view/service/impl/stack-info/DebugPureBizStackService.ts +19 -0
- package/src/component/debug/view/service/impl/stack-info/DebugStacktraceGqlRequestContextService.ts +22 -0
- package/src/component/debug/view/service/impl/stack-info/DebugStacktraceSceneAnalysisService.ts +35 -0
- package/src/component/debug/view/service/impl/stack-info/DebugStacktraceSessionService.ts +19 -0
- package/src/component/debug/view/service/index.ts +22 -0
- package/src/component/debug/view/storage.ts +35 -0
- package/src/component/debug/view/useDebugRequestInfo.ts +17 -0
- package/src/component/divider/Divider.vue +15 -0
- package/src/component/divider/DividerWidget.ts +12 -0
- package/src/component/divider/index.ts +1 -0
- package/src/component/index.ts +15 -0
- package/src/component/language/DefaultLanguage.vue +111 -0
- package/src/component/language/LanguageWidget.ts +72 -0
- package/src/component/language/index.ts +1 -0
- package/src/component/layout/BaseMaskLayoutWidget.ts +12 -0
- package/src/component/layout/MaskBlock.vue +31 -0
- package/src/component/layout/block/MaskBlockWidget.ts +17 -0
- package/src/component/layout/block/index.ts +1 -0
- package/src/component/layout/container/MaskContainerWidget.ts +13 -0
- package/src/component/layout/container/index.ts +1 -0
- package/src/component/layout/content/MaskContentWidget.ts +41 -0
- package/src/component/layout/content/index.ts +1 -0
- package/src/component/layout/grid/Grid.vue +10 -0
- package/src/component/layout/grid/GridWidget.ts +62 -0
- package/src/component/layout/grid/index.ts +1 -0
- package/src/component/layout/header/MaskHeaderWidget.ts +13 -0
- package/src/component/layout/header/index.ts +1 -0
- package/src/component/layout/index.ts +9 -0
- package/src/component/layout/mask/MaskRootWidget.ts +13 -0
- package/src/component/layout/mask/index.ts +1 -0
- package/src/component/layout/sidebar/MaskSidebarWidget.ts +31 -0
- package/src/component/layout/sidebar/index.ts +1 -0
- package/src/component/layout/widget/MaskCommonWidget.ts +95 -0
- package/src/component/layout/widget/index.ts +1 -0
- package/src/component/menu/DefaultMenu.vue +252 -0
- package/src/component/menu/DefaultSubMenu.vue +68 -0
- package/src/component/menu/MenuWidget.ts +349 -0
- package/src/component/menu/index.ts +3 -0
- package/src/component/menu/style/common.scss +411 -0
- package/src/component/menu/style/index.scss +2 -0
- package/src/component/menu/style/menu-theme/index.scss +5 -0
- package/src/component/menu/style/menu-theme/theme2.scss +37 -0
- package/src/component/menu/style/menu-theme/theme3.scss +59 -0
- package/src/component/menu/style/menu-theme/theme4.scss +56 -0
- package/src/component/menu/style/menu-theme/theme5.scss +45 -0
- package/src/component/menu/style/menu-theme/theme6.scss +45 -0
- package/src/component/menu/style/mixin.scss +23 -0
- package/src/component/multi-tabs/MultiTabs.vue +475 -0
- package/src/component/multi-tabs/MultiTabsWidget.ts +450 -0
- package/src/component/multi-tabs/index.ts +2 -0
- package/src/component/multi-tabs/style/index.scss +217 -0
- package/src/component/multi-tabs/style/mixin.scss +13 -0
- package/src/component/multi-tabs/style/parameters.scss +2 -0
- package/src/component/multi-tabs/style/theme1.scss +92 -0
- package/src/component/multi-tabs/style/theme2.scss +89 -0
- package/src/component/multi-tabs/style/theme3.scss +60 -0
- package/src/component/multi-tabs/style/theme4.scss +85 -0
- package/src/component/multi-tabs/typing.ts +7 -0
- package/src/component/notification/DefaultNotification.vue +455 -0
- package/src/component/notification/NotificationWidget.ts +332 -0
- package/src/component/notification/index.ts +2 -0
- package/src/component/order-statistic/OrderStatistic.vue +12 -0
- package/src/component/order-statistic/index.ts +146 -0
- package/src/component/partner-switcher/PartnerSwitcher.vue +75 -0
- package/src/component/partner-switcher/PartnerSwitcherWidget.ts +70 -0
- package/src/component/partner-switcher/index.ts +6 -0
- package/src/component/partner-switcher/service/PartnerSwitcherService.ts +20 -0
- package/src/component/partner-switcher/service/impl/PartnerSwitcherServiceImpl.ts +48 -0
- package/src/component/partner-switcher/service/index.ts +2 -0
- package/src/component/partner-switcher/session/PartnerInfoSession.ts +32 -0
- package/src/component/partner-switcher/session/impl/DefaultPartnerInfoSession.ts +46 -0
- package/src/component/partner-switcher/session/index.ts +2 -0
- package/src/component/partner-switcher/spi/PartnerSwitcherMaskEditor.ts +24 -0
- package/src/component/partner-switcher/spi/index.ts +1 -0
- package/src/component/partner-switcher/typing/index.ts +1 -0
- package/src/component/partner-switcher/typing/partner.ts +22 -0
- package/src/component/quick-search/QuickSearch.vue +34 -0
- package/src/component/quick-search/index.ts +237 -0
- package/src/component/style/index.scss +4 -0
- package/src/component/style/layout.scss +229 -0
- package/src/component/user/DefaultUser.vue +92 -0
- package/src/component/user/UserWidget.ts +129 -0
- package/src/component/user/index.ts +1 -0
- package/src/config/DebugConfig.ts +30 -0
- package/src/config/PartnerSwitcherConfig.ts +30 -0
- package/src/config/index.ts +2 -0
- package/src/index.ts +11 -0
- package/src/service/index.ts +5 -0
- package/src/service/menu-service.ts +105 -0
- package/src/service/message-service.ts +65 -0
- package/src/service/module-service.ts +69 -0
- package/src/service/top-bar-service.ts +144 -0
- package/src/service/user-service.ts +10 -0
- package/src/shim-translate.d.ts +7 -0
- package/src/shim-vue.d.ts +6 -0
- package/src/spi/index.ts +1 -0
- package/src/spi/mask-editor.ts +102 -0
- package/src/tags/Block.vue +16 -0
- package/src/tags/Breadcrumb.vue +16 -0
- package/src/tags/Container.vue +16 -0
- package/src/tags/Content.vue +16 -0
- package/src/tags/Header.vue +16 -0
- package/src/tags/Mask.vue +16 -0
- package/src/tags/MultiTabs.vue +16 -0
- package/src/tags/Sidebar.vue +16 -0
- package/src/tags/Widget.vue +16 -0
- package/src/tags/context/context.ts +24 -0
- package/src/tags/context/index.ts +1 -0
- package/src/tags/index.ts +48 -0
- package/src/tags/mixin/MaskWidgetTagMixin.ts +79 -0
- package/src/tags/mixin/index.ts +3 -0
- package/src/tags/mixin/typing.ts +8 -0
- package/src/tags/mixin/use-mask-widget-tag.ts +172 -0
- package/src/tags/register/index.ts +1 -0
- package/src/tags/register/manager.ts +43 -0
- package/src/tags/resolve/index.ts +2 -0
- package/src/tags/resolve/internal/index.ts +2 -0
- package/src/tags/resolve/internal/typing.ts +6 -0
- package/src/tags/resolve/internal/widget-resolve.ts +57 -0
- package/src/tags/resolve/typing.ts +39 -0
- package/src/tags/resolve/widget-resolve.ts +64 -0
- package/src/template/default-mask.ts +51 -0
- package/src/template/index.ts +26 -0
- package/src/theme/index.ts +1 -0
- package/src/typing/constant.ts +3 -0
- package/src/typing/index.ts +3 -0
- package/src/typing/menu.ts +15 -0
- package/src/typing/stream-symble.ts +14 -0
- package/src/util/HomepageUtils.ts +41 -0
- package/src/util/MenuUtil.ts +18 -0
- package/src/util/index.ts +3 -0
- package/src/util/unauthorized-action.ts +98 -0
- package/src/utils.ts +716 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CSSStyle } from '@oinone/kunlun-shared';
|
|
3
|
+
import { createVNode, defineComponent, PropType } from 'vue';
|
|
4
|
+
|
|
5
|
+
export default defineComponent({
|
|
6
|
+
name: 'MaskBlock',
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
props: {
|
|
9
|
+
id: {
|
|
10
|
+
type: String
|
|
11
|
+
},
|
|
12
|
+
classNames: {
|
|
13
|
+
type: [String, Array] as PropType<string | string[]>
|
|
14
|
+
},
|
|
15
|
+
style: {
|
|
16
|
+
type: [String, Object] as PropType<string | CSSStyle>
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
render() {
|
|
20
|
+
return createVNode(
|
|
21
|
+
'div',
|
|
22
|
+
{
|
|
23
|
+
id: this.id,
|
|
24
|
+
class: this.classNames,
|
|
25
|
+
style: this.style
|
|
26
|
+
},
|
|
27
|
+
this.$slots.default?.()
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StringHelper } from '@oinone/kunlun-shared';
|
|
2
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
3
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
4
|
+
import { MaskWidget } from '../../../basic';
|
|
5
|
+
import { BaseMaskLayoutWidget } from '../BaseMaskLayoutWidget';
|
|
6
|
+
|
|
7
|
+
@SPI.ClassFactory(
|
|
8
|
+
MaskWidget.Token({
|
|
9
|
+
dslNodeType: 'block'
|
|
10
|
+
})
|
|
11
|
+
)
|
|
12
|
+
export class MaskBlockWidget extends BaseMaskLayoutWidget {
|
|
13
|
+
@Widget.Reactive()
|
|
14
|
+
public get classNames(): string[] | undefined {
|
|
15
|
+
return StringHelper.append(['k-layout-block'], super.classNames);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaskBlockWidget';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StringHelper } from '@oinone/kunlun-shared';
|
|
2
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
3
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
4
|
+
import { MaskWidget } from '../../../basic';
|
|
5
|
+
import { BaseMaskLayoutWidget } from '../BaseMaskLayoutWidget';
|
|
6
|
+
|
|
7
|
+
@SPI.ClassFactory(MaskWidget.Token({ dslNodeType: 'container' }))
|
|
8
|
+
export class MaskContainerWidget extends BaseMaskLayoutWidget {
|
|
9
|
+
@Widget.Reactive()
|
|
10
|
+
public get classNames(): string[] | undefined {
|
|
11
|
+
return StringHelper.append(['k-layout-container', 'oio-scrollbar'], super.classNames);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaskContainerWidget';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useGlobalEnv } from '@oinone/kunlun-environment';
|
|
2
|
+
import { useMatched } from '@oinone/kunlun-router';
|
|
3
|
+
import { StringHelper, uniqueKeyGenerator } from '@oinone/kunlun-shared';
|
|
4
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
5
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
6
|
+
import { MaskWidget } from '../../../basic';
|
|
7
|
+
import { DEFAULT_PREFIX } from '../../../theme';
|
|
8
|
+
import { BaseMaskLayoutWidget } from '../BaseMaskLayoutWidget';
|
|
9
|
+
|
|
10
|
+
@SPI.ClassFactory(MaskWidget.Token({ dslNodeType: 'content' }))
|
|
11
|
+
export class MaskContentWidget extends BaseMaskLayoutWidget {
|
|
12
|
+
private static readonly id = `${DEFAULT_PREFIX}-content-${uniqueKeyGenerator()}`;
|
|
13
|
+
|
|
14
|
+
@Widget.Reactive()
|
|
15
|
+
public get id(): string {
|
|
16
|
+
return MaskContentWidget.id;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Widget.Reactive()
|
|
20
|
+
public get classNames(): string[] | undefined {
|
|
21
|
+
return StringHelper.append(['k-layout-content oio-scrollbar'], super.classNames);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected mounted() {
|
|
25
|
+
useGlobalEnv().contentSelector = `#${this.id}`;
|
|
26
|
+
|
|
27
|
+
const { getMatched$ } = useMatched();
|
|
28
|
+
getMatched$().subscribe(() => {
|
|
29
|
+
/**
|
|
30
|
+
* 当视图滚动到右侧的时候,再切换到其他页面,会导致其他页面也滚动到的右侧
|
|
31
|
+
*/
|
|
32
|
+
const node = document.querySelector('.k-layout-content.oio-scrollbar') as HTMLElement;
|
|
33
|
+
|
|
34
|
+
if (node) {
|
|
35
|
+
if (node.scrollLeft > 0) {
|
|
36
|
+
node.scrollLeft = 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaskContentWidget';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { IGridWidgetProps } from '@oinone/kunlun-engine';
|
|
2
|
+
import { CSSStyle } from '@oinone/kunlun-shared';
|
|
3
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
4
|
+
import { MaskWidget } from '../../../basic';
|
|
5
|
+
import Grid from './Grid.vue';
|
|
6
|
+
|
|
7
|
+
export class GridWidget extends MaskWidget {
|
|
8
|
+
@Widget.Reactive()
|
|
9
|
+
private itemInvisible = false;
|
|
10
|
+
|
|
11
|
+
@Widget.Inject('cols')
|
|
12
|
+
@Widget.Reactive()
|
|
13
|
+
private cols!: number;
|
|
14
|
+
|
|
15
|
+
@Widget.Reactive()
|
|
16
|
+
protected internalStyle: CSSStyle | undefined;
|
|
17
|
+
|
|
18
|
+
@Widget.Reactive()
|
|
19
|
+
public get style(): CSSStyle | undefined {
|
|
20
|
+
return { ...(super.style || {}), ...(this.internalStyle || {}) } as CSSStyle;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public initialize(props) {
|
|
24
|
+
super.initialize(props);
|
|
25
|
+
this.setComponent(Grid);
|
|
26
|
+
|
|
27
|
+
const dsl = this.getDsl();
|
|
28
|
+
|
|
29
|
+
const { span = 12, rowIndex = 'auto', columnIndex = 'auto' } = dsl as unknown as IGridWidgetProps;
|
|
30
|
+
|
|
31
|
+
let _rowIndex: string | number = rowIndex;
|
|
32
|
+
let _columnIndex: string | number = columnIndex;
|
|
33
|
+
|
|
34
|
+
// 行的位置要 + 1,才是正确的
|
|
35
|
+
if (!Number.isNaN(Number(rowIndex))) {
|
|
36
|
+
_rowIndex = Number(rowIndex) + 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 比如网络一共12列,当前grid占据3列,那么就是 3 + 2,这样在网格中的位置才是对的
|
|
40
|
+
if (!Number.isNaN(Number(this.cols)) && !Number.isNaN(Number(_columnIndex))) {
|
|
41
|
+
// 比如网络一共12列,当前grid占据12列,那么是 12 + 1,这样在网格中的位置才是对的
|
|
42
|
+
|
|
43
|
+
if (_columnIndex >= this.cols || Number(span) + 2 >= this.cols) {
|
|
44
|
+
_columnIndex = Number(this.cols) + 1;
|
|
45
|
+
} else {
|
|
46
|
+
_columnIndex = Number(span) + 2;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const internalStyle = {} as CSSStyle;
|
|
51
|
+
|
|
52
|
+
internalStyle.gridArea = `span 1 / span ${span} / ${_rowIndex} / ${_columnIndex}`;
|
|
53
|
+
|
|
54
|
+
if (dsl.type && dsl.type === 'flex') {
|
|
55
|
+
internalStyle.display = 'flex';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
this.internalStyle = internalStyle;
|
|
59
|
+
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './GridWidget';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StringHelper } from '@oinone/kunlun-shared';
|
|
2
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
3
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
4
|
+
import { MaskWidget } from '../../../basic';
|
|
5
|
+
import { BaseMaskLayoutWidget } from '../BaseMaskLayoutWidget';
|
|
6
|
+
|
|
7
|
+
@SPI.ClassFactory(MaskWidget.Token({ dslNodeType: 'header' }))
|
|
8
|
+
export class MaskHeaderWidget extends BaseMaskLayoutWidget {
|
|
9
|
+
@Widget.Reactive()
|
|
10
|
+
public get classNames(): string[] | undefined {
|
|
11
|
+
return StringHelper.append(['k-layout-header'], super.classNames);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaskHeaderWidget';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StringHelper } from '@oinone/kunlun-shared';
|
|
2
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
3
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
4
|
+
import { MaskWidget } from '../../../basic';
|
|
5
|
+
import { BaseMaskLayoutWidget } from '../BaseMaskLayoutWidget';
|
|
6
|
+
|
|
7
|
+
@SPI.ClassFactory(MaskWidget.Token({ dslNodeType: 'mask' }))
|
|
8
|
+
export class MaskRootWidget extends BaseMaskLayoutWidget {
|
|
9
|
+
@Widget.Reactive()
|
|
10
|
+
public get classNames(): string[] | undefined {
|
|
11
|
+
return StringHelper.append(['k-layout-mask'], super.classNames);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaskRootWidget';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StringHelper } from '@oinone/kunlun-shared';
|
|
2
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
3
|
+
import { Widget } from '@oinone/kunlun-vue-widget';
|
|
4
|
+
import { MaskWidget } from '../../../basic';
|
|
5
|
+
import { BaseMaskLayoutWidget } from '../BaseMaskLayoutWidget';
|
|
6
|
+
|
|
7
|
+
enum Mode {
|
|
8
|
+
horizontal = 'horizontal',
|
|
9
|
+
inline = 'inline'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@SPI.ClassFactory(MaskWidget.Token({ dslNodeType: 'sidebar' }))
|
|
13
|
+
export class MaskSidebarWidget extends BaseMaskLayoutWidget {
|
|
14
|
+
@Widget.Reactive()
|
|
15
|
+
public get classNames(): string[] | undefined {
|
|
16
|
+
const classNames = ['k-layout-sidebar'];
|
|
17
|
+
if (this.mode === Mode.horizontal) {
|
|
18
|
+
classNames.push('k-layout-sidebar-horizontal');
|
|
19
|
+
}
|
|
20
|
+
return StringHelper.append(classNames, super.classNames);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Widget.Reactive()
|
|
24
|
+
public get mode(): Mode {
|
|
25
|
+
const { mode } = this.getDsl();
|
|
26
|
+
if (Object.keys(Mode).includes(mode)) {
|
|
27
|
+
return mode;
|
|
28
|
+
}
|
|
29
|
+
return Mode.inline;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaskSidebarWidget';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { DslDefinition } from '@oinone/kunlun-dsl';
|
|
2
|
+
import { Constructor, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import { SPI } from '@oinone/kunlun-spi';
|
|
4
|
+
import { ViewWidget, Widget } from '@oinone/kunlun-vue-widget';
|
|
5
|
+
import { Slots, VNode } from 'vue';
|
|
6
|
+
import { BaseMaskWidget, BaseMaskWidgetProps, MaskWidget } from '../../../basic';
|
|
7
|
+
import { BaseMaskLayoutWidget } from '../BaseMaskLayoutWidget';
|
|
8
|
+
|
|
9
|
+
export interface MaskCommonWidgetProps extends BaseMaskWidgetProps {
|
|
10
|
+
widget: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@SPI.ClassFactory(MaskWidget.Token({ dslNodeType: 'widget' }))
|
|
14
|
+
export class MaskCommonWidget extends BaseMaskLayoutWidget<MaskCommonWidgetProps> {
|
|
15
|
+
private widget: string | undefined;
|
|
16
|
+
|
|
17
|
+
private currentWidget: { name: string; widgetInstance: BaseMaskWidget | ViewWidget } | null | undefined;
|
|
18
|
+
|
|
19
|
+
public initialize(props: MaskCommonWidgetProps) {
|
|
20
|
+
if (props.slotNames == null) {
|
|
21
|
+
props.slotNames = [];
|
|
22
|
+
}
|
|
23
|
+
super.initialize(props);
|
|
24
|
+
this.widget = props.widget;
|
|
25
|
+
this.createOrUpdateWidget(props);
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Widget.Reactive()
|
|
30
|
+
public get classNames(): string[] | undefined {
|
|
31
|
+
return StringHelper.append(['k-layout-widget'], super.classNames);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
protected createOrUpdateWidget(props: Record<string, unknown>) {
|
|
35
|
+
const { widget, currentWidget } = this;
|
|
36
|
+
if (!widget) {
|
|
37
|
+
console.error('Invalid widget property', this);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (widget === currentWidget?.name || currentWidget === null) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
currentWidget?.widgetInstance.dispose();
|
|
45
|
+
this.currentWidget = undefined;
|
|
46
|
+
|
|
47
|
+
let usingViewWidget = false;
|
|
48
|
+
let constructor: Constructor<BaseMaskWidget> | Constructor<ViewWidget> | undefined = BaseMaskWidget.Selector({
|
|
49
|
+
widget
|
|
50
|
+
});
|
|
51
|
+
if (!constructor) {
|
|
52
|
+
constructor = ViewWidget.Selector({ widget });
|
|
53
|
+
if (constructor) {
|
|
54
|
+
usingViewWidget = true;
|
|
55
|
+
} else {
|
|
56
|
+
this.currentWidget = null;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (usingViewWidget) {
|
|
61
|
+
this.currentWidget = {
|
|
62
|
+
name: widget,
|
|
63
|
+
widgetInstance: this.createWidget(constructor as Constructor<ViewWidget>, undefined, {
|
|
64
|
+
dslNode: props
|
|
65
|
+
})
|
|
66
|
+
};
|
|
67
|
+
} else {
|
|
68
|
+
this.currentWidget = {
|
|
69
|
+
name: widget,
|
|
70
|
+
widgetInstance: this.createWidget(constructor as Constructor<BaseMaskWidget>, undefined, props)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public render(ctx?: Record<string, unknown>, slots?: Slots): VNode | VNode[] {
|
|
76
|
+
this.widget = (ctx?.dslDefinition as DslDefinition)?.widget;
|
|
77
|
+
this.createOrUpdateWidget(ctx || {});
|
|
78
|
+
if (this.currentWidget) {
|
|
79
|
+
const finalSlots = slots;
|
|
80
|
+
slots = {
|
|
81
|
+
default: () => {
|
|
82
|
+
const children = this.currentWidget?.widgetInstance.render(ctx, finalSlots);
|
|
83
|
+
if (children) {
|
|
84
|
+
if (Array.isArray(children)) {
|
|
85
|
+
return children;
|
|
86
|
+
}
|
|
87
|
+
return [children];
|
|
88
|
+
}
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
return super.render(ctx, slots);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaskCommonWidget';
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="k-oinone-menu-wrapper">
|
|
3
|
+
<div class="menu-search" v-if="showSearch">
|
|
4
|
+
<a-select
|
|
5
|
+
ref="menuSelectSearch"
|
|
6
|
+
class="oio-select"
|
|
7
|
+
dropdownClassName="default-menu-select-dropdown"
|
|
8
|
+
option-filter-prop="label"
|
|
9
|
+
allowClear
|
|
10
|
+
:placeholder="translateValueByKey('搜索菜单')"
|
|
11
|
+
:show-search="true"
|
|
12
|
+
v-model:value="searchSelectValue"
|
|
13
|
+
:search-value="searchValue"
|
|
14
|
+
@search="onSearchValueChange"
|
|
15
|
+
@change="innerSearchSelect"
|
|
16
|
+
>
|
|
17
|
+
<a-select-option v-for="item in searchMenus" :key="item.name" :value="item.name" :label="item.displayName">
|
|
18
|
+
{{ item.displayName }}
|
|
19
|
+
</a-select-option>
|
|
20
|
+
<template #suffixIcon>
|
|
21
|
+
<oio-icon icon="oinone-sousuo" size="12px" color="var(--oio-menu-default-icon-color)" />
|
|
22
|
+
</template>
|
|
23
|
+
</a-select>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="menu-area oio-scrollbar">
|
|
26
|
+
<div class="menu-content" :class="collapsed && 'collapsed'">
|
|
27
|
+
<oio-spin :loading="loading">
|
|
28
|
+
<!--
|
|
29
|
+
oinone-menu-theme1: 菜单1 连接线,
|
|
30
|
+
oinone-menu-theme2: 菜单二 不含背景颜色, 菜单左侧是圆点 + 竖线,
|
|
31
|
+
oinone-menu-theme3: 含背景颜色, 菜单左侧是圆点 ,
|
|
32
|
+
oinone-menu-theme4: 含背景颜色, 箭头在左侧
|
|
33
|
+
oinone-menu-theme5: 不含背景颜色,菜单左侧是空心圆
|
|
34
|
+
-->
|
|
35
|
+
<a-menu
|
|
36
|
+
:class="['oinone-menu', menuThemeClass]"
|
|
37
|
+
mode="inline"
|
|
38
|
+
:inlineIndent="0"
|
|
39
|
+
:inline-collapsed="collapsed"
|
|
40
|
+
:selectedKeys="selectedKeys"
|
|
41
|
+
:openKeys="currentOpenKeys"
|
|
42
|
+
@click="onMenuSelected"
|
|
43
|
+
@open-change="onOpenChange"
|
|
44
|
+
>
|
|
45
|
+
<template v-for="item in treeNodes" :key="item.key">
|
|
46
|
+
<a-menu-item
|
|
47
|
+
v-if="item.isLeaf"
|
|
48
|
+
:key="item.key"
|
|
49
|
+
:title="item.value.title"
|
|
50
|
+
class="root-menu root-menu-item"
|
|
51
|
+
>
|
|
52
|
+
<oio-icon
|
|
53
|
+
size="14px"
|
|
54
|
+
:icon="item.value.icon || DEFAULT_MENU_ICON"
|
|
55
|
+
color="var(--oio-menu-default-icon-color)"
|
|
56
|
+
/>
|
|
57
|
+
<span>{{ item.value.title }}</span>
|
|
58
|
+
</a-menu-item>
|
|
59
|
+
<default-sub-menu v-else :tree-node="item" :key="item.key" />
|
|
60
|
+
</template>
|
|
61
|
+
</a-menu>
|
|
62
|
+
</oio-spin>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="menu-footer" :class="collapsed && 'collapsed'">
|
|
66
|
+
<div class="menu-toggle-collapsed" @click="onCollapsedChange(!collapsed)">
|
|
67
|
+
<span class="collapsed-icon">
|
|
68
|
+
<oio-icon
|
|
69
|
+
:icon="collapsed ? 'oinone-menu-caidanzhankai' : 'oinone-menu-caidanshouqi'"
|
|
70
|
+
size="16px"
|
|
71
|
+
color="var(--oio-menu-default-icon-color)"
|
|
72
|
+
/>
|
|
73
|
+
</span>
|
|
74
|
+
<span v-show="!collapsed" class="collapsed-text">{{ translateValueByKey('点击收起菜单') }}</span>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
<script lang="ts">
|
|
80
|
+
import { translateValueByKey } from '@oinone/kunlun-engine';
|
|
81
|
+
import { OioIcon, OioSpin, TreeNode } from '@oinone/kunlun-vue-ui-antd';
|
|
82
|
+
import { Menu as AMenu, MenuItem as AMenuItem, Select as ASelect, SelectOption as ASelectOption } from 'ant-design-vue';
|
|
83
|
+
import { computed, defineComponent, nextTick, onMounted, PropType, ref, watch } from 'vue';
|
|
84
|
+
import { RuntimeMenu } from '../../typing';
|
|
85
|
+
import DefaultSubMenu from './DefaultSubMenu.vue';
|
|
86
|
+
|
|
87
|
+
interface SelectMenuItemEvent {
|
|
88
|
+
keyPath: string[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default defineComponent({
|
|
92
|
+
name: 'DefaultMenu',
|
|
93
|
+
components: {
|
|
94
|
+
DefaultSubMenu,
|
|
95
|
+
OioIcon,
|
|
96
|
+
OioSpin,
|
|
97
|
+
AMenu,
|
|
98
|
+
AMenuItem,
|
|
99
|
+
ASelect,
|
|
100
|
+
ASelectOption
|
|
101
|
+
},
|
|
102
|
+
inheritAttrs: false,
|
|
103
|
+
props: {
|
|
104
|
+
loading: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false
|
|
107
|
+
},
|
|
108
|
+
mode: {
|
|
109
|
+
type: String as PropType<'horizontal' | 'inline'>
|
|
110
|
+
},
|
|
111
|
+
collapsed: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: undefined
|
|
114
|
+
},
|
|
115
|
+
menus: {
|
|
116
|
+
type: Array as PropType<RuntimeMenu[]>,
|
|
117
|
+
required: true
|
|
118
|
+
},
|
|
119
|
+
treeNodes: {
|
|
120
|
+
type: Array as PropType<TreeNode<RuntimeMenu>[]>,
|
|
121
|
+
required: true
|
|
122
|
+
},
|
|
123
|
+
selectedKeys: {
|
|
124
|
+
type: Array as PropType<string[]>
|
|
125
|
+
},
|
|
126
|
+
openKeys: {
|
|
127
|
+
type: Array as PropType<string[]>
|
|
128
|
+
},
|
|
129
|
+
translate: {
|
|
130
|
+
type: Function
|
|
131
|
+
},
|
|
132
|
+
onOpenChange: {
|
|
133
|
+
type: Function
|
|
134
|
+
},
|
|
135
|
+
onCollapsedChange: {
|
|
136
|
+
type: Function
|
|
137
|
+
},
|
|
138
|
+
onSelect: {
|
|
139
|
+
type: Function
|
|
140
|
+
},
|
|
141
|
+
onClick: {
|
|
142
|
+
type: Function
|
|
143
|
+
},
|
|
144
|
+
menuThemeClass: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: ''
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
setup(props) {
|
|
150
|
+
const DEFAULT_MENU_ICON = 'oinone-yijicaidan';
|
|
151
|
+
|
|
152
|
+
const showSearch = computed(() => {
|
|
153
|
+
return props.menus.length && props.mode === 'inline' && !props.collapsed;
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const searchMenus = computed(() => {
|
|
157
|
+
return props.menus.filter((v) => !!v.viewAction) || [];
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// 菜单折叠时,不需要展开的 SubMenu,否则会导致切换多tab的会导致打开SubMenu气泡区域
|
|
161
|
+
const currentOpenKeys = computed(() => {
|
|
162
|
+
return props.collapsed ? [] : props.openKeys;
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const onMenuSelected = ({ keyPath }: SelectMenuItemEvent) => {
|
|
166
|
+
let targetNode: TreeNode<RuntimeMenu> | undefined;
|
|
167
|
+
let currentNodes = props.treeNodes;
|
|
168
|
+
let currentNode: TreeNode<RuntimeMenu> | undefined;
|
|
169
|
+
for (let i = 0; i < keyPath.length; i++) {
|
|
170
|
+
const key = keyPath[i];
|
|
171
|
+
currentNode = currentNodes.find((v) => v.key === key);
|
|
172
|
+
if (!currentNode) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (i === keyPath.length - 1) {
|
|
176
|
+
targetNode = currentNode;
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
currentNodes = currentNode.children;
|
|
180
|
+
}
|
|
181
|
+
if (targetNode) {
|
|
182
|
+
props.onClick?.(targetNode);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const onCollapsedChange = (val: boolean) => {
|
|
187
|
+
props.onCollapsedChange?.(val);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const menuSelectSearch = ref();
|
|
191
|
+
|
|
192
|
+
const searchSelectValue = ref();
|
|
193
|
+
const searchValue = ref('');
|
|
194
|
+
|
|
195
|
+
const onSearchValueChange = (val: string) => {
|
|
196
|
+
searchValue.value = val;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const innerSearchSelect = (key: string) => {
|
|
200
|
+
const targetNode = findTreeNode(props.treeNodes, key);
|
|
201
|
+
if (targetNode) {
|
|
202
|
+
props.onSelect?.(targetNode);
|
|
203
|
+
}
|
|
204
|
+
menuSelectSearch.value.blur?.();
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const findTreeNode = (nodes: TreeNode<RuntimeMenu>[], key: string): TreeNode<RuntimeMenu> | undefined => {
|
|
208
|
+
for (const node of nodes) {
|
|
209
|
+
if (node.key === key) {
|
|
210
|
+
return node;
|
|
211
|
+
}
|
|
212
|
+
if (node.children.length) {
|
|
213
|
+
const target = findTreeNode(node.children, key);
|
|
214
|
+
if (target) {
|
|
215
|
+
return target;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
onMounted(() => {
|
|
222
|
+
nextTick(() => {
|
|
223
|
+
onCollapsedChange(false);
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
watch(
|
|
228
|
+
() => props.menus,
|
|
229
|
+
() => {
|
|
230
|
+
searchSelectValue.value = undefined;
|
|
231
|
+
searchValue.value = '';
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
DEFAULT_MENU_ICON,
|
|
237
|
+
onCollapsedChange,
|
|
238
|
+
currentOpenKeys,
|
|
239
|
+
showSearch,
|
|
240
|
+
searchMenus,
|
|
241
|
+
menuSelectSearch,
|
|
242
|
+
searchSelectValue,
|
|
243
|
+
searchValue,
|
|
244
|
+
onSearchValueChange,
|
|
245
|
+
innerSearchSelect,
|
|
246
|
+
|
|
247
|
+
onMenuSelected,
|
|
248
|
+
translateValueByKey
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
</script>
|