@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
package/src/utils.ts
ADDED
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActiveRecord,
|
|
3
|
+
getRealTtype,
|
|
4
|
+
isNeedAppendQueryCondition,
|
|
5
|
+
resolveDynamicDomain,
|
|
6
|
+
RuntimeModel,
|
|
7
|
+
RuntimeModelField,
|
|
8
|
+
RuntimeSearchField,
|
|
9
|
+
translateValueByKey
|
|
10
|
+
} from '@oinone/kunlun-engine';
|
|
11
|
+
import { ExpressionKeyword } from '@oinone/kunlun-expression';
|
|
12
|
+
import {
|
|
13
|
+
deepClone,
|
|
14
|
+
Entity,
|
|
15
|
+
IDslNode,
|
|
16
|
+
IModel,
|
|
17
|
+
isEmptyKeObject,
|
|
18
|
+
isEmptyValue,
|
|
19
|
+
isPromise,
|
|
20
|
+
ModelFieldType
|
|
21
|
+
} from '@oinone/kunlun-meta';
|
|
22
|
+
import { Condition, ConditionBuilder } from '@oinone/kunlun-request';
|
|
23
|
+
import { DEFAULT_TRUE_CONDITION } from '@oinone/kunlun-service';
|
|
24
|
+
import {
|
|
25
|
+
BooleanHelper,
|
|
26
|
+
CastHelper,
|
|
27
|
+
RSQLComparisonOperator,
|
|
28
|
+
RSQLHelper,
|
|
29
|
+
RSQLNodeInfo,
|
|
30
|
+
RSQLNodeInfoType,
|
|
31
|
+
RSQLOperators,
|
|
32
|
+
TreeNode
|
|
33
|
+
} from '@oinone/kunlun-shared';
|
|
34
|
+
import { isBoolean, toString } from 'lodash-es';
|
|
35
|
+
|
|
36
|
+
const conditionBuilder = ConditionBuilder.getInstance();
|
|
37
|
+
|
|
38
|
+
const filterRsql = (searchValue: string) => {
|
|
39
|
+
if (searchValue && searchValue.includes("'")) {
|
|
40
|
+
// FIXME 解决中文输入法双拼的时候2个拼音间自动拼接单引号的问题,但是这里会导致字段如果真的有含单引号的情况下无法正常匹配的情况
|
|
41
|
+
searchValue = searchValue.split("'").join('');
|
|
42
|
+
}
|
|
43
|
+
return searchValue;
|
|
44
|
+
};
|
|
45
|
+
// 搜索条件构造
|
|
46
|
+
const getCondition = (
|
|
47
|
+
model: IModel | null,
|
|
48
|
+
content: Record<string, unknown>,
|
|
49
|
+
extraContent = {},
|
|
50
|
+
extraConditions: { leftValue: string[]; operator: string; right: unknown }[] = []
|
|
51
|
+
) => {
|
|
52
|
+
const condition = new Condition('1==1');
|
|
53
|
+
const mixedContent = { ...content, ...extraContent };
|
|
54
|
+
Object.keys(mixedContent).forEach((c) => {
|
|
55
|
+
if (mixedContent[c] !== null && mixedContent[c] !== undefined && mixedContent[c] !== '') {
|
|
56
|
+
const val = mixedContent[c];
|
|
57
|
+
const field = model!.modelFields.find((mf) => mf.name === c)!;
|
|
58
|
+
if (typeof val === 'string') {
|
|
59
|
+
if (
|
|
60
|
+
field.ttype === ModelFieldType.String ||
|
|
61
|
+
field.ttype === ModelFieldType.Text ||
|
|
62
|
+
field.ttype === ModelFieldType.Phone ||
|
|
63
|
+
field.ttype === ModelFieldType.Email
|
|
64
|
+
) {
|
|
65
|
+
condition.and(new Condition(c).like(`%${mixedContent[c] as string}%`));
|
|
66
|
+
} else {
|
|
67
|
+
condition.and(new Condition(c).equal(mixedContent[c] as string));
|
|
68
|
+
}
|
|
69
|
+
} else if (typeof val === 'boolean') {
|
|
70
|
+
condition.and(new Condition(c).equal(mixedContent[c] as string));
|
|
71
|
+
} else if (val instanceof Array) {
|
|
72
|
+
if (val[0] && typeof val[0] === 'object') {
|
|
73
|
+
const m2mOrO2MCD: Condition[] = [];
|
|
74
|
+
|
|
75
|
+
if (field.referenceFields) {
|
|
76
|
+
val.forEach((value) => {
|
|
77
|
+
field.referenceFields!.forEach((f) => {
|
|
78
|
+
m2mOrO2MCD.push(new Condition(`${field.name}.${f}`).equal(value[f]));
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const cd = m2mOrO2MCD.map((cond) => cond.toString()).join(' or ');
|
|
83
|
+
|
|
84
|
+
condition.and(new Condition(cd));
|
|
85
|
+
}
|
|
86
|
+
} else if (val.length >= 2) {
|
|
87
|
+
// 只有时间日期组件才会进入
|
|
88
|
+
condition.and(new Condition(`${c} >= '${val[0]}' and ${c} <= '${val[1]}'`));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
extraConditions
|
|
94
|
+
.map((c) => {
|
|
95
|
+
if (c.operator === '=like=' || c.operator === '=notlike=') {
|
|
96
|
+
return { ...c, right: `%${c.right}%` };
|
|
97
|
+
}
|
|
98
|
+
return c;
|
|
99
|
+
})
|
|
100
|
+
.forEach((con) => {
|
|
101
|
+
const left = con.leftValue[con.leftValue.length - 1];
|
|
102
|
+
if (con.operator !== 'between') {
|
|
103
|
+
condition.and(new Condition(left).append(con.operator).append(new Condition(`'${con.right}'`).toString()));
|
|
104
|
+
} else {
|
|
105
|
+
condition.and(
|
|
106
|
+
new Condition(left)
|
|
107
|
+
.greaterThanOrEuqalTo((<string[]>con.right)[0])
|
|
108
|
+
.and(new Condition(left).lessThanOrEqualTo((<string[]>con.right)[1]))
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return condition;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 构造下拉框的搜索条件
|
|
117
|
+
* @param model 关联模型
|
|
118
|
+
* @param searchFieldName 搜索的字段名,可以是逗号分隔的多个字段
|
|
119
|
+
* @param searchValue 搜索的值
|
|
120
|
+
* @param domain 限定条件
|
|
121
|
+
*/
|
|
122
|
+
const buildSelectSearchCondition = (
|
|
123
|
+
model: RuntimeModel | undefined,
|
|
124
|
+
searchFieldName: string,
|
|
125
|
+
searchValue: string,
|
|
126
|
+
domain?: string
|
|
127
|
+
): Condition => {
|
|
128
|
+
const realSearchValue = deepClone(filterRsql(searchValue));
|
|
129
|
+
let condition: Condition | undefined;
|
|
130
|
+
const queryData: Entity = {};
|
|
131
|
+
if (realSearchValue) {
|
|
132
|
+
const modelFieldsMap: Record<string, RuntimeModelField> = {};
|
|
133
|
+
model?.modelFields?.forEach((v) => {
|
|
134
|
+
modelFieldsMap[v.data] = v;
|
|
135
|
+
});
|
|
136
|
+
for (const searchField of searchFieldName.split(',')) {
|
|
137
|
+
const modelField = modelFieldsMap[searchField.trim()];
|
|
138
|
+
if (!modelField) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const { data } = modelField;
|
|
142
|
+
if (isNeedAppendQueryCondition(modelField)) {
|
|
143
|
+
const nextCondition = new Condition(data).like(realSearchValue);
|
|
144
|
+
if (condition) {
|
|
145
|
+
condition.or(nextCondition);
|
|
146
|
+
} else {
|
|
147
|
+
condition = nextCondition;
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
queryData[data] = realSearchValue;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (!condition) {
|
|
155
|
+
condition = new Condition(DEFAULT_TRUE_CONDITION);
|
|
156
|
+
}
|
|
157
|
+
condition.setConditionBodyData(queryData);
|
|
158
|
+
if (domain) {
|
|
159
|
+
condition.and(new Condition(domain));
|
|
160
|
+
}
|
|
161
|
+
return condition;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 构造下拉框的搜索条件
|
|
166
|
+
* @param searchFieldName 搜索的字段名,可以是逗号分隔的多个字段
|
|
167
|
+
* @param searchValue 搜索的值
|
|
168
|
+
* @param domain 限定条件
|
|
169
|
+
* @deprecated please using buildSelectSearchCondition
|
|
170
|
+
*/
|
|
171
|
+
const builderSelectSearchCondition = (searchFieldName: string, searchValue: string, domain?: string): string => {
|
|
172
|
+
const realSearchValue = deepClone(filterRsql(searchValue));
|
|
173
|
+
const searchStr = !realSearchValue
|
|
174
|
+
? '1==1'
|
|
175
|
+
: searchFieldName
|
|
176
|
+
.split(',')
|
|
177
|
+
.map((item) => {
|
|
178
|
+
const condition = conditionBuilder.condition(item).like(`%${realSearchValue}%`);
|
|
179
|
+
return condition.toString();
|
|
180
|
+
})
|
|
181
|
+
.join(' or ');
|
|
182
|
+
const condition = domain
|
|
183
|
+
? conditionBuilder.condition(searchStr).and(conditionBuilder.condition(domain)).toString()
|
|
184
|
+
: searchStr;
|
|
185
|
+
return condition;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 自动填充已选中的值到选项列表的头部,非表达式
|
|
190
|
+
* @param relationFieldKey
|
|
191
|
+
* @param selectedValue
|
|
192
|
+
* @param dataList
|
|
193
|
+
* @param labelFields
|
|
194
|
+
* @param separator labelFields的展示时的分隔符
|
|
195
|
+
*/
|
|
196
|
+
const autoFillSelectedValueToOptions = (
|
|
197
|
+
relationFieldKey: string,
|
|
198
|
+
selectedValue: any,
|
|
199
|
+
dataList: Entity[],
|
|
200
|
+
labelFields: string[],
|
|
201
|
+
separator = ' '
|
|
202
|
+
): Entity[] => {
|
|
203
|
+
const newDataList = !dataList ? [] : [...dataList];
|
|
204
|
+
if (!labelFields || !labelFields.length) {
|
|
205
|
+
labelFields = ['name'];
|
|
206
|
+
}
|
|
207
|
+
return shiftSelectValue(newDataList, selectedValue, relationFieldKey).map((d) => {
|
|
208
|
+
return autoFillByLabelFields(relationFieldKey, d, labelFields, separator);
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const shiftSelectValue = (newDataList: Entity[], selectedValue: any, relationFieldKey: string) => {
|
|
213
|
+
if (!selectedValue) {
|
|
214
|
+
return newDataList;
|
|
215
|
+
}
|
|
216
|
+
let pendingValue;
|
|
217
|
+
if (Array.isArray(selectedValue)) {
|
|
218
|
+
pendingValue = [...selectedValue];
|
|
219
|
+
} else {
|
|
220
|
+
pendingValue = [selectedValue];
|
|
221
|
+
}
|
|
222
|
+
for (const selectedValueElement of pendingValue) {
|
|
223
|
+
if (
|
|
224
|
+
selectedValueElement &&
|
|
225
|
+
Object.keys(selectedValueElement).length > 0 &&
|
|
226
|
+
newDataList.findIndex((a) => a[relationFieldKey] === (selectedValueElement as any)[relationFieldKey]) === -1
|
|
227
|
+
) {
|
|
228
|
+
// newDataList.unshift(selectedValueElement);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return newDataList;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 根据label变量表达式自动填充已选中的值到选项列表的头部
|
|
236
|
+
* @param relationFieldKey
|
|
237
|
+
* @param selectedValue
|
|
238
|
+
* @param dataList 可选项数据
|
|
239
|
+
* @param xmlOptionLabel xml配的label表达式
|
|
240
|
+
* @param modelLabel 元数据上的label表达式
|
|
241
|
+
* @param optionLabelContextArgs 表达式运行的数据源参数
|
|
242
|
+
*/
|
|
243
|
+
const autoFillSelectedValueToOptionsByLabel = (
|
|
244
|
+
relationFieldKey: string,
|
|
245
|
+
selectedValues: Entity | Entity[],
|
|
246
|
+
dataList: Entity[] = [],
|
|
247
|
+
xmlOptionLabel?: string,
|
|
248
|
+
modelLabel?: string,
|
|
249
|
+
optionLabelContextArgs?: string
|
|
250
|
+
): Entity[] => {
|
|
251
|
+
const newDataList = [...dataList];
|
|
252
|
+
const realOptionLabel = xmlOptionLabel || modelLabel;
|
|
253
|
+
const selectedValueList = Array.isArray(selectedValues) ? selectedValues : [selectedValues];
|
|
254
|
+
selectedValueList?.forEach((selectedValue) => {
|
|
255
|
+
if (
|
|
256
|
+
selectedValue &&
|
|
257
|
+
Object.keys(selectedValue).length > 0 &&
|
|
258
|
+
newDataList.findIndex((a) => {
|
|
259
|
+
if (!a || !selectedValue) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
return a[relationFieldKey] === (selectedValue as any)[relationFieldKey];
|
|
263
|
+
}) === -1
|
|
264
|
+
) {
|
|
265
|
+
// newDataList.unshift(selectedValue);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
return newDataList.map((optionData) => {
|
|
270
|
+
return autoFillByLabel(relationFieldKey, optionData, realOptionLabel, optionLabelContextArgs);
|
|
271
|
+
});
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* 根据labelFields组装展示数据
|
|
276
|
+
* @param relationFieldKey
|
|
277
|
+
* @param optionData
|
|
278
|
+
* @param labelFields
|
|
279
|
+
* @param separator
|
|
280
|
+
*/
|
|
281
|
+
export const autoFillByLabelFields = (
|
|
282
|
+
relationFieldKey: string,
|
|
283
|
+
optionData: Entity,
|
|
284
|
+
labelFields: string[],
|
|
285
|
+
separator?: string
|
|
286
|
+
): Entity => {
|
|
287
|
+
if (isEmptyValue(optionData)) {
|
|
288
|
+
return {};
|
|
289
|
+
}
|
|
290
|
+
if (!labelFields || !labelFields.length) {
|
|
291
|
+
labelFields = ['name'];
|
|
292
|
+
}
|
|
293
|
+
let realLabel = labelFields
|
|
294
|
+
.map((labelField) => {
|
|
295
|
+
return optionData[labelField] || '-';
|
|
296
|
+
})
|
|
297
|
+
.join(!separator ? ' ' : separator);
|
|
298
|
+
if (isEmptyValue(realLabel) || isEmptyValue(realLabel.replaceAll(' ', ''))) {
|
|
299
|
+
realLabel = '-';
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
value: optionData[relationFieldKey],
|
|
303
|
+
label: toString(realLabel)
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* 根据label组装展示数据
|
|
309
|
+
* @param relationFieldKey
|
|
310
|
+
* @param optionData
|
|
311
|
+
* @param realOptionLabel
|
|
312
|
+
* @param optionLabelContextArgs
|
|
313
|
+
*/
|
|
314
|
+
export const autoFillByLabel = (
|
|
315
|
+
relationFieldKey: string,
|
|
316
|
+
optionData: Entity,
|
|
317
|
+
realOptionLabel?: string,
|
|
318
|
+
optionLabelContextArgs?: string
|
|
319
|
+
): Entity => {
|
|
320
|
+
if (isEmptyValue(optionData)) {
|
|
321
|
+
return {};
|
|
322
|
+
}
|
|
323
|
+
const expData = {};
|
|
324
|
+
const keys = Object.keys(optionData) as string[];
|
|
325
|
+
for (const key of keys) {
|
|
326
|
+
expData[key] = toString(optionData[key]);
|
|
327
|
+
}
|
|
328
|
+
const realOptionLabelContextArgStr = optionLabelContextArgs || ExpressionKeyword.activeRecord;
|
|
329
|
+
const realOptionLabelContextArgList = realOptionLabelContextArgStr.split(',') as [];
|
|
330
|
+
let realLabel = ''; // 表达式运行后的数据标题
|
|
331
|
+
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
332
|
+
const fun = new Function(...realOptionLabelContextArgList, `return ${realOptionLabel}`);
|
|
333
|
+
// fixme argList需要枚举提供,例如activeRecord,rootRecord,contextVariable
|
|
334
|
+
try {
|
|
335
|
+
realLabel = fun(expData);
|
|
336
|
+
// js进行"+"运算时, 连续有undefined, 例如undefined+undefined+undefined,结果是NaN
|
|
337
|
+
if (BooleanHelper.isStringBoolean(realLabel)) {
|
|
338
|
+
const labelVal = fun(optionData);
|
|
339
|
+
if (isBoolean(labelVal)) {
|
|
340
|
+
realLabel = labelVal ? translateValueByKey('是') : translateValueByKey('否');
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (realLabel) {
|
|
344
|
+
realLabel = toString(realLabel).replaceAll('undefined', '');
|
|
345
|
+
realLabel = toString(realLabel).replaceAll('NaN', '');
|
|
346
|
+
}
|
|
347
|
+
if (Number.isNaN(realLabel) || isEmptyValue(realLabel) || isEmptyValue(realLabel.replaceAll(' ', ''))) {
|
|
348
|
+
realLabel = '-';
|
|
349
|
+
}
|
|
350
|
+
} catch (error) {
|
|
351
|
+
console.error(error);
|
|
352
|
+
}
|
|
353
|
+
// 执行表达式后的数据标题为空 ,则按照显示名称, 名称, id依次取值作为展示
|
|
354
|
+
return {
|
|
355
|
+
value: optionData[relationFieldKey],
|
|
356
|
+
label: toString(realLabel)
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* 获取xml中配置的labelFields
|
|
362
|
+
* @param dslConfig xml配置
|
|
363
|
+
* @param labelFields 元数据上的labelFields
|
|
364
|
+
*/
|
|
365
|
+
const fetchLabelFieldsFromXmlConfig = (dslConfig: Entity, labelFields: string[]): string[] => {
|
|
366
|
+
const xmlConfig = dslConfig as IDslNode;
|
|
367
|
+
const children = xmlConfig.children as IDslNode[];
|
|
368
|
+
const xmlLabelFields = [] as string[];
|
|
369
|
+
if (!children || children.length <= 0) {
|
|
370
|
+
return labelFields;
|
|
371
|
+
}
|
|
372
|
+
for (const configChild of children) {
|
|
373
|
+
if (configChild.tagName === 'LABELFIELDS' && configChild.name) {
|
|
374
|
+
xmlLabelFields.push(configChild.name);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (xmlLabelFields.length > 0) {
|
|
378
|
+
labelFields = xmlLabelFields;
|
|
379
|
+
}
|
|
380
|
+
dslConfig.labelField = labelFields.join(',');
|
|
381
|
+
return labelFields;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* 判断对象是否为空
|
|
386
|
+
* @param obj
|
|
387
|
+
*/
|
|
388
|
+
const isEmptyObject = (obj: any): boolean => {
|
|
389
|
+
return isEmptyKeObject(obj);
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
interface QueryExpression {
|
|
393
|
+
leftValue: string[];
|
|
394
|
+
operator: string;
|
|
395
|
+
right: unknown;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const parseActionDomain = (model: IModel, domain: string) => {
|
|
399
|
+
const root = RSQLHelper.parse(
|
|
400
|
+
{
|
|
401
|
+
model: model.model,
|
|
402
|
+
fields: CastHelper.cast(model.modelFields)
|
|
403
|
+
},
|
|
404
|
+
domain
|
|
405
|
+
);
|
|
406
|
+
const searchBody = {};
|
|
407
|
+
const searchConditions: QueryExpression[] = [];
|
|
408
|
+
if (root) {
|
|
409
|
+
const stack: TreeNode<RSQLNodeInfo>[] = [];
|
|
410
|
+
traversalRSQLNode(root, searchBody, searchConditions, stack);
|
|
411
|
+
stack.forEach((node) => {
|
|
412
|
+
const nodeInfo = node.value;
|
|
413
|
+
if (nodeInfo) {
|
|
414
|
+
const { operator, selector, args } = nodeInfo;
|
|
415
|
+
searchConditions.push({
|
|
416
|
+
leftValue: [selector!],
|
|
417
|
+
operator: operator!.symbol,
|
|
418
|
+
right: args![0]
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
return {
|
|
424
|
+
searchBody,
|
|
425
|
+
searchConditions
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
const traversalRSQLNode = (
|
|
430
|
+
node: TreeNode<RSQLNodeInfo>,
|
|
431
|
+
searchBody: ActiveRecord,
|
|
432
|
+
searchCondition: QueryExpression[],
|
|
433
|
+
stack: TreeNode<RSQLNodeInfo>[]
|
|
434
|
+
): void => {
|
|
435
|
+
const type = node.value?.type;
|
|
436
|
+
if (type == null) {
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
switch (type) {
|
|
440
|
+
case RSQLNodeInfoType.AND:
|
|
441
|
+
for (const child of node.children) {
|
|
442
|
+
traversalRSQLNode(child, searchBody, searchCondition, stack);
|
|
443
|
+
}
|
|
444
|
+
break;
|
|
445
|
+
case RSQLNodeInfoType.OR:
|
|
446
|
+
// 不支持 or
|
|
447
|
+
return;
|
|
448
|
+
case RSQLNodeInfoType.COMPARISON: {
|
|
449
|
+
const nodeInfo = node.value;
|
|
450
|
+
if (nodeInfo) {
|
|
451
|
+
const modelField = CastHelper.cast<RuntimeSearchField>(nodeInfo.field);
|
|
452
|
+
if (!modelField) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const { operator: fieldOperator } = modelField;
|
|
456
|
+
const realTtype = getRealTtype(modelField);
|
|
457
|
+
if (!realTtype) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
const { selector, operator, args } = nodeInfo;
|
|
461
|
+
if (!selector || !operator || !args) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (fieldOperator) {
|
|
465
|
+
if (operator.isSymbolEquals(fieldOperator)) {
|
|
466
|
+
[searchBody[selector]] = args;
|
|
467
|
+
} else {
|
|
468
|
+
searchCondition.push({
|
|
469
|
+
leftValue: [selector],
|
|
470
|
+
operator: operator.symbol,
|
|
471
|
+
right: args[0]
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
switch (realTtype) {
|
|
477
|
+
case ModelFieldType.Integer:
|
|
478
|
+
case ModelFieldType.Long:
|
|
479
|
+
case ModelFieldType.Float:
|
|
480
|
+
case ModelFieldType.Boolean:
|
|
481
|
+
case ModelFieldType.Currency:
|
|
482
|
+
numberRSQLParameterProcess(node, searchBody, searchCondition, stack);
|
|
483
|
+
break;
|
|
484
|
+
case ModelFieldType.String:
|
|
485
|
+
case ModelFieldType.Text:
|
|
486
|
+
case ModelFieldType.HTML:
|
|
487
|
+
case ModelFieldType.Phone:
|
|
488
|
+
case ModelFieldType.Email:
|
|
489
|
+
stringRSQLParameterProcess(node, searchBody, searchCondition);
|
|
490
|
+
break;
|
|
491
|
+
case ModelFieldType.DateTime:
|
|
492
|
+
case ModelFieldType.Date:
|
|
493
|
+
case ModelFieldType.Time:
|
|
494
|
+
case ModelFieldType.Year:
|
|
495
|
+
datetimeRSQLParameterProcess(node, searchBody, searchCondition, stack);
|
|
496
|
+
break;
|
|
497
|
+
case ModelFieldType.Enum:
|
|
498
|
+
case ModelFieldType.MultiEnum:
|
|
499
|
+
enumerationRSQLParameterProcess(node, searchBody, searchCondition);
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
const numberRSQLParameterProcess = (
|
|
509
|
+
node: TreeNode<RSQLNodeInfo>,
|
|
510
|
+
searchBody: ActiveRecord,
|
|
511
|
+
searchCondition: QueryExpression[],
|
|
512
|
+
stack: TreeNode<RSQLNodeInfo>[]
|
|
513
|
+
) => {
|
|
514
|
+
const { selector, operator, args } = node.value!;
|
|
515
|
+
switch (operator!) {
|
|
516
|
+
case RSQLOperators.EQUAL:
|
|
517
|
+
case RSQLOperators.COLUMN_EQUAL:
|
|
518
|
+
[searchBody[selector!]] = args!;
|
|
519
|
+
break;
|
|
520
|
+
case RSQLOperators.IN:
|
|
521
|
+
searchBody[selector!] = args!;
|
|
522
|
+
break;
|
|
523
|
+
case RSQLOperators.NOT_IN:
|
|
524
|
+
searchCondition.push({
|
|
525
|
+
leftValue: [selector!],
|
|
526
|
+
operator: operator!.symbol,
|
|
527
|
+
right: args
|
|
528
|
+
});
|
|
529
|
+
break;
|
|
530
|
+
case RSQLOperators.GREATER_THAN_OR_EQUAL:
|
|
531
|
+
case RSQLOperators.LESS_THAN_OR_EQUAL:
|
|
532
|
+
case RSQLOperators.NOT_EQUAL:
|
|
533
|
+
case RSQLOperators.COLUMN_NOT_EQUAL:
|
|
534
|
+
case RSQLOperators.GREATER_THAN:
|
|
535
|
+
case RSQLOperators.LESS_THAN:
|
|
536
|
+
searchCondition.push({
|
|
537
|
+
leftValue: [selector!],
|
|
538
|
+
operator: operator!.symbol,
|
|
539
|
+
right: args![0]
|
|
540
|
+
});
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
const stringRSQLParameterProcess = (
|
|
546
|
+
node: TreeNode<RSQLNodeInfo>,
|
|
547
|
+
searchBody: ActiveRecord,
|
|
548
|
+
searchCondition: QueryExpression[]
|
|
549
|
+
) => {
|
|
550
|
+
const { selector, operator, args } = node.value!;
|
|
551
|
+
switch (operator!) {
|
|
552
|
+
case RSQLOperators.LIKE:
|
|
553
|
+
[searchBody[selector!]] = args!;
|
|
554
|
+
break;
|
|
555
|
+
case RSQLOperators.EQUAL:
|
|
556
|
+
case RSQLOperators.NOT_EQUAL:
|
|
557
|
+
case RSQLOperators.COLUMN_EQUAL:
|
|
558
|
+
case RSQLOperators.COLUMN_NOT_EQUAL:
|
|
559
|
+
case RSQLOperators.LIKE_RIGHT:
|
|
560
|
+
case RSQLOperators.LIKE_LEFT:
|
|
561
|
+
case RSQLOperators.NOT_LIKE:
|
|
562
|
+
case RSQLOperators.NOT_LIKE_RIGHT:
|
|
563
|
+
case RSQLOperators.NOT_LIKE_LEFT:
|
|
564
|
+
searchCondition.push({
|
|
565
|
+
leftValue: [selector!],
|
|
566
|
+
operator: operator!.symbol,
|
|
567
|
+
right: args![0]
|
|
568
|
+
});
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
const datetimeRSQLParameterProcess = (
|
|
574
|
+
node: TreeNode<RSQLNodeInfo>,
|
|
575
|
+
searchBody: ActiveRecord,
|
|
576
|
+
searchCondition: QueryExpression[],
|
|
577
|
+
stack: TreeNode<RSQLNodeInfo>[]
|
|
578
|
+
) => {
|
|
579
|
+
const { selector, operator, args } = node.value!;
|
|
580
|
+
switch (operator!) {
|
|
581
|
+
case RSQLOperators.EQUAL:
|
|
582
|
+
case RSQLOperators.COLUMN_EQUAL:
|
|
583
|
+
[searchBody[selector!]] = args!;
|
|
584
|
+
break;
|
|
585
|
+
case RSQLOperators.GREATER_THAN_OR_EQUAL:
|
|
586
|
+
case RSQLOperators.LESS_THAN:
|
|
587
|
+
rangeRSQLParameterProcess(node, searchBody, searchCondition, stack);
|
|
588
|
+
break;
|
|
589
|
+
case RSQLOperators.GREATER_THAN:
|
|
590
|
+
case RSQLOperators.LESS_THAN_OR_EQUAL:
|
|
591
|
+
case RSQLOperators.NOT_EQUAL:
|
|
592
|
+
case RSQLOperators.COLUMN_NOT_EQUAL:
|
|
593
|
+
searchCondition.push({
|
|
594
|
+
leftValue: [selector!],
|
|
595
|
+
operator: operator.symbol,
|
|
596
|
+
right: args![0]
|
|
597
|
+
});
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
const enumerationRSQLParameterProcess = (
|
|
603
|
+
node: TreeNode<RSQLNodeInfo>,
|
|
604
|
+
searchBody: ActiveRecord,
|
|
605
|
+
searchCondition: QueryExpression[]
|
|
606
|
+
) => {
|
|
607
|
+
const { selector, operator, args } = node.value!;
|
|
608
|
+
switch (operator!) {
|
|
609
|
+
case RSQLOperators.EQUAL:
|
|
610
|
+
case RSQLOperators.COLUMN_EQUAL:
|
|
611
|
+
[searchBody[selector!]] = args!;
|
|
612
|
+
break;
|
|
613
|
+
case RSQLOperators.IN:
|
|
614
|
+
case RSQLOperators.HAS:
|
|
615
|
+
searchBody[selector!] = args!;
|
|
616
|
+
break;
|
|
617
|
+
case RSQLOperators.BIT:
|
|
618
|
+
case RSQLOperators.NOT_IN:
|
|
619
|
+
case RSQLOperators.NOT_HAS:
|
|
620
|
+
case RSQLOperators.NOT_BIT:
|
|
621
|
+
searchCondition.push({
|
|
622
|
+
leftValue: [selector!],
|
|
623
|
+
operator: operator!.symbol,
|
|
624
|
+
right: args
|
|
625
|
+
});
|
|
626
|
+
break;
|
|
627
|
+
case RSQLOperators.NOT_EQUAL:
|
|
628
|
+
searchCondition.push({
|
|
629
|
+
leftValue: [selector!],
|
|
630
|
+
operator: operator.symbol,
|
|
631
|
+
right: args![0]
|
|
632
|
+
});
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
const rangeRSQLParameterProcess = (
|
|
638
|
+
node: TreeNode<RSQLNodeInfo>,
|
|
639
|
+
searchBody: ActiveRecord,
|
|
640
|
+
searchCondition: QueryExpression[],
|
|
641
|
+
stack: TreeNode<RSQLNodeInfo>[]
|
|
642
|
+
) => {
|
|
643
|
+
const { selector, operator, args } = node.value!;
|
|
644
|
+
switch (operator!) {
|
|
645
|
+
case RSQLOperators.GREATER_THAN_OR_EQUAL: {
|
|
646
|
+
const res = findRangeRSQLParameter(stack, selector!, RSQLOperators.LESS_THAN);
|
|
647
|
+
if (res) {
|
|
648
|
+
const { node: leNode, index } = res;
|
|
649
|
+
searchBody[selector!] = [args?.[0], leNode.value?.args?.[0]];
|
|
650
|
+
stack.splice(index, 1);
|
|
651
|
+
} else {
|
|
652
|
+
stack.push(node);
|
|
653
|
+
}
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
case RSQLOperators.LESS_THAN: {
|
|
657
|
+
const res = findRangeRSQLParameter(stack, selector!, RSQLOperators.GREATER_THAN_OR_EQUAL);
|
|
658
|
+
if (res) {
|
|
659
|
+
const { node: geNode, index } = res;
|
|
660
|
+
searchBody[selector!] = [geNode.value?.args?.[0], args?.[0]];
|
|
661
|
+
stack.splice(index, 1);
|
|
662
|
+
} else {
|
|
663
|
+
stack.push(node);
|
|
664
|
+
}
|
|
665
|
+
break;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
const findRangeRSQLParameter = (
|
|
671
|
+
stack: TreeNode<RSQLNodeInfo>[],
|
|
672
|
+
selector: string,
|
|
673
|
+
operator: RSQLComparisonOperator
|
|
674
|
+
): { node: TreeNode<RSQLNodeInfo>; index: number } | undefined => {
|
|
675
|
+
const len = stack.length;
|
|
676
|
+
for (let i = 0; i < len; i++) {
|
|
677
|
+
const item = stack[i];
|
|
678
|
+
const nodeInfo = item.value;
|
|
679
|
+
if (nodeInfo!.selector === selector && operator.equals(nodeInfo!.operator)) {
|
|
680
|
+
return {
|
|
681
|
+
node: item,
|
|
682
|
+
index: i
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* 解析action上的domain到默认搜索条件
|
|
690
|
+
* @param model
|
|
691
|
+
* @param domain
|
|
692
|
+
*/
|
|
693
|
+
const parseActionDomain4search = (model: IModel, domain: string) => {
|
|
694
|
+
let searchBody = {};
|
|
695
|
+
let searchConditions: QueryExpression[] = [];
|
|
696
|
+
if (domain) {
|
|
697
|
+
domain = resolveDynamicDomain(domain, {}, {}, {});
|
|
698
|
+
const { searchBody: rs, searchConditions: rsc } = parseActionDomain(model, domain);
|
|
699
|
+
searchBody = rs;
|
|
700
|
+
searchConditions = rsc;
|
|
701
|
+
}
|
|
702
|
+
return { searchBody, searchConditions };
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
export {
|
|
706
|
+
isPromise,
|
|
707
|
+
filterRsql,
|
|
708
|
+
getCondition,
|
|
709
|
+
buildSelectSearchCondition,
|
|
710
|
+
builderSelectSearchCondition,
|
|
711
|
+
autoFillSelectedValueToOptions,
|
|
712
|
+
autoFillSelectedValueToOptionsByLabel,
|
|
713
|
+
fetchLabelFieldsFromXmlConfig,
|
|
714
|
+
isEmptyObject,
|
|
715
|
+
parseActionDomain4search
|
|
716
|
+
};
|