@ibiz-template/vue3-util 0.7.41-alpha.13 → 0.7.41-alpha.131
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/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/badge/badge.css +1 -1
- package/es/common/badge/badge.d.ts +6 -8
- package/es/common/badge/badge.d.ts.map +1 -1
- package/es/common/badge/badge.mjs +13 -7
- package/es/common/code-list/code-list.d.ts +10 -10
- package/es/common/code-list/code-list.d.ts.map +1 -1
- package/es/common/code-list/code-list.mjs +1 -1
- package/es/common/control-base/control-base.d.ts.map +1 -1
- package/es/common/control-base/control-base.mjs +9 -15
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts +4 -4
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts.map +1 -1
- package/es/common/control-shell/control-shell.d.ts +7 -7
- package/es/common/control-shell/control-shell.d.ts.map +1 -1
- package/es/common/control-shell/control-shell.mjs +1 -1
- package/es/common/custom-render/custom-render.d.ts +4 -4
- package/es/common/custom-render/custom-render.d.ts.map +1 -1
- package/es/common/icon/icon.d.ts +4 -4
- package/es/common/icon/icon.d.ts.map +1 -1
- package/es/common/icon/icon.mjs +12 -0
- package/es/common/index.d.ts +1 -0
- package/es/common/index.d.ts.map +1 -1
- package/es/common/index.mjs +1 -0
- package/es/common/router-view/router-view.d.ts +7 -8
- package/es/common/router-view/router-view.d.ts.map +1 -1
- package/es/common/router-view/router-view.mjs +1 -1
- package/es/common/signature-pad/signature-pad.css +1 -0
- package/es/common/signature-pad/signature-pad.d.ts +19 -0
- package/es/common/signature-pad/signature-pad.d.ts.map +1 -0
- package/es/common/signature-pad/signature-pad.mjs +165 -0
- package/es/common/signature-pad/util/bezier.d.ts +58 -0
- package/es/common/signature-pad/util/bezier.d.ts.map +1 -0
- package/es/common/signature-pad/util/bezier.mjs +109 -0
- package/es/common/signature-pad/util/point.d.ts +55 -0
- package/es/common/signature-pad/util/point.d.ts.map +1 -0
- package/es/common/signature-pad/util/point.mjs +51 -0
- package/es/common/signature-pad/util/signature_pad.d.ts +593 -0
- package/es/common/signature-pad/util/signature_pad.d.ts.map +1 -0
- package/es/common/signature-pad/util/signature_pad.mjs +1018 -0
- package/es/common/view-shell/view-shell.d.ts +19 -12
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +42 -23
- package/es/control/panel/panel/index.d.ts +5 -5
- package/es/control/panel/panel/index.d.ts.map +1 -1
- package/es/control/panel/panel/panel.d.ts +6 -6
- package/es/control/panel/panel/panel.d.ts.map +1 -1
- package/es/control/panel/panel/panel.mjs +13 -5
- package/es/control/panel/view-layout-panel/index.d.ts +5 -5
- package/es/control/panel/view-layout-panel/index.d.ts.map +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +7 -7
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +6 -6
- package/es/index.mjs +9 -11
- package/es/locale/en/index.d.ts +1 -0
- package/es/locale/en/index.d.ts.map +1 -1
- package/es/locale/en/index.mjs +2 -1
- package/es/locale/zh-CN/index.d.ts +1 -0
- package/es/locale/zh-CN/index.d.ts.map +1 -1
- package/es/locale/zh-CN/index.mjs +2 -1
- package/es/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.mjs +2 -2
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.d.ts.map +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.mjs +3 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts +6 -4
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.d.ts.map +1 -1
- package/es/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.mjs +17 -6
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts +6 -4
- package/es/panel-component/auth-wxmp-qrcode/index.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.controller.d.ts +3 -3
- package/es/panel-component/grid-container/grid-container.controller.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.controller.mjs +2 -2
- package/es/panel-component/grid-container/grid-container.d.ts +8 -6
- package/es/panel-component/grid-container/grid-container.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.mjs +17 -6
- package/es/panel-component/grid-container/grid-container.state.d.ts +3 -3
- package/es/panel-component/grid-container/grid-container.state.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.state.mjs +2 -2
- package/es/panel-component/grid-container/index.d.ts +8 -6
- package/es/panel-component/grid-container/index.d.ts.map +1 -1
- package/es/panel-component/index.d.ts +0 -1
- package/es/panel-component/index.d.ts.map +1 -1
- package/es/panel-component/index.mjs +1 -5
- package/es/panel-component/multi-data-container/index.d.ts +6 -4
- package/es/panel-component/multi-data-container/index.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts +4 -4
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.mjs +88 -69
- package/es/panel-component/multi-data-container/multi-data-container.d.ts +7 -5
- package/es/panel-component/multi-data-container/multi-data-container.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.mjs +20 -6
- package/es/panel-component/multi-data-container/multi-data-container.state.d.ts +3 -3
- package/es/panel-component/multi-data-container/multi-data-container.state.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.state.mjs +2 -2
- package/es/panel-component/multi-data-container-raw/index.d.ts +6 -4
- package/es/panel-component/multi-data-container-raw/index.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts +4 -4
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.mjs +88 -69
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts +7 -5
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.mjs +23 -7
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts +3 -3
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.mjs +2 -2
- package/es/panel-component/nav-pos/index.d.ts +7 -5
- package/es/panel-component/nav-pos/index.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.d.ts +1 -1
- package/es/panel-component/nav-pos/nav-pos.d.ts +8 -6
- package/es/panel-component/nav-pos/nav-pos.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.mjs +20 -5
- package/es/panel-component/panel-container/index.d.ts +7 -6
- package/es/panel-component/panel-container/index.d.ts.map +1 -1
- package/es/panel-component/panel-container/index.mjs +1 -2
- package/es/panel-component/panel-container/panel-container.d.ts +7 -5
- package/es/panel-component/panel-container/panel-container.d.ts.map +1 -1
- package/es/panel-component/panel-container/panel-container.mjs +36 -15
- package/es/panel-component/panel-container/panel-container.provider.d.ts +2 -2
- package/es/panel-component/panel-container/panel-container.provider.d.ts.map +1 -1
- package/es/panel-component/panel-container/panel-container.provider.mjs +1 -1
- package/es/panel-component/panel-container-image/index.d.ts +6 -4
- package/es/panel-component/panel-container-image/index.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.controller.d.ts +3 -3
- package/es/panel-component/panel-container-image/panel-container-image.controller.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.controller.mjs +2 -2
- package/es/panel-component/panel-container-image/panel-container-image.css +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.d.ts +6 -4
- package/es/panel-component/panel-container-image/panel-container-image.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.mjs +24 -10
- package/es/panel-component/panel-container-image/panel-container-image.state.d.ts +3 -3
- package/es/panel-component/panel-container-image/panel-container-image.state.d.ts.map +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.state.mjs +2 -2
- package/es/panel-component/panel-container-tabs/index.d.ts +6 -6
- package/es/panel-component/panel-container-tabs/index.d.ts.map +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts +5 -5
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts.map +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.mjs +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.d.ts +2 -2
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.d.ts.map +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.provider.mjs +1 -1
- package/es/panel-component/panel-ctrl-pos/index.d.ts +6 -4
- package/es/panel-component/panel-ctrl-pos/index.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts +6 -4
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.mjs +12 -4
- package/es/panel-component/panel-ctrl-view-page-caption/index.d.ts +6 -4
- package/es/panel-component/panel-ctrl-view-page-caption/index.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.css +1 -0
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.d.ts +7 -4
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.mjs +16 -8
- package/es/panel-component/panel-field/index.d.ts +7 -4
- package/es/panel-component/panel-field/index.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.controller.d.ts +12 -0
- package/es/panel-component/panel-field/panel-field.controller.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.controller.mjs +37 -3
- package/es/panel-component/panel-field/panel-field.css +1 -1
- package/es/panel-component/panel-field/panel-field.d.ts +7 -4
- package/es/panel-component/panel-field/panel-field.d.ts.map +1 -1
- package/es/panel-component/panel-field/panel-field.mjs +29 -12
- package/es/panel-component/panel-item-render/index.d.ts +6 -4
- package/es/panel-component/panel-item-render/index.d.ts.map +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.controller.d.ts.map +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.controller.mjs +7 -5
- package/es/panel-component/panel-item-render/panel-item-render.d.ts +6 -4
- package/es/panel-component/panel-item-render/panel-item-render.d.ts.map +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.mjs +13 -4
- package/es/panel-component/panel-rawitem/index.d.ts +8 -6
- package/es/panel-component/panel-rawitem/index.d.ts.map +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts +8 -6
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts.map +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.mjs +15 -10
- package/es/panel-component/panel-tab-page/index.d.ts +8 -6
- package/es/panel-component/panel-tab-page/index.d.ts.map +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +10 -8
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts.map +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.mjs +23 -8
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.d.ts +2 -2
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.d.ts.map +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.provider.mjs +2 -2
- package/es/panel-component/scroll-container/index.d.ts +6 -4
- package/es/panel-component/scroll-container/index.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.controller.d.ts +3 -3
- package/es/panel-component/scroll-container/scroll-container/scroll-container.controller.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.controller.mjs +2 -2
- package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts +6 -4
- package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.mjs +26 -15
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.d.ts +3 -3
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.mjs +2 -2
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts +6 -4
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.mjs +21 -6
- package/es/panel-component/single-data-container/index.d.ts +6 -4
- package/es/panel-component/single-data-container/index.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts +4 -4
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.mjs +98 -73
- package/es/panel-component/single-data-container/single-data-container.d.ts +7 -5
- package/es/panel-component/single-data-container/single-data-container.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.mjs +22 -6
- package/es/panel-component/single-data-container/single-data-container.state.d.ts +3 -3
- package/es/panel-component/single-data-container/single-data-container.state.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.state.mjs +2 -2
- package/es/panel-component/teleport-placeholder/index.d.ts +7 -5
- package/es/panel-component/teleport-placeholder/index.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +7 -5
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.mjs +11 -4
- package/es/plugin/plugin-factory/plugin-factory.d.ts +15 -0
- package/es/plugin/plugin-factory/plugin-factory.d.ts.map +1 -1
- package/es/plugin/plugin-factory/plugin-factory.mjs +34 -6
- package/es/props/editor/autocomplete.d.ts +2 -2
- package/es/props/editor/check-box-list.d.ts +2 -2
- package/es/props/editor/check-box.d.ts +2 -2
- package/es/props/editor/code.d.ts +17 -0
- package/es/props/editor/code.d.ts.map +1 -1
- package/es/props/editor/code.mjs +7 -2
- package/es/props/editor/common.d.ts +7 -0
- package/es/props/editor/common.d.ts.map +1 -1
- package/es/props/editor/common.mjs +5 -1
- package/es/props/editor/data-picker.d.ts +2 -2
- package/es/props/editor/date-picker.d.ts +2 -2
- package/es/props/editor/date-range-select.d.ts +4 -0
- package/es/props/editor/date-range-select.d.ts.map +1 -1
- package/es/props/editor/date-range.d.ts +2 -2
- package/es/props/editor/dropdown-list.d.ts +2 -2
- package/es/props/editor/html.d.ts +17 -0
- package/es/props/editor/html.d.ts.map +1 -1
- package/es/props/editor/html.mjs +7 -2
- package/es/props/editor/index.mjs +3 -3
- package/es/props/editor/list-box.d.ts +2 -2
- package/es/props/editor/markdown.d.ts +89 -0
- package/es/props/editor/markdown.d.ts.map +1 -1
- package/es/props/editor/markdown.mjs +28 -3
- package/es/props/editor/number-range.d.ts +2 -2
- package/es/props/editor/radio-button-list.d.ts +2 -2
- package/es/props/editor/rate.d.ts +2 -2
- package/es/props/editor/raw.d.ts +2 -2
- package/es/props/editor/slider.d.ts +2 -2
- package/es/props/editor/span.d.ts +18 -2
- package/es/props/editor/span.d.ts.map +1 -1
- package/es/props/editor/span.mjs +6 -1
- package/es/props/editor/stepper.d.ts +2 -2
- package/es/props/editor/switch.d.ts +2 -2
- package/es/props/editor/text-box.d.ts +2 -2
- package/es/props/index.mjs +3 -3
- package/es/use/index.d.ts +2 -0
- package/es/use/index.d.ts.map +1 -1
- package/es/use/index.mjs +4 -2
- package/es/use/popover/popover.d.ts +7 -0
- package/es/use/popover/popover.d.ts.map +1 -1
- package/es/use/popover/popover.mjs +9 -2
- package/es/use/storage/index.d.ts +4 -6
- package/es/use/storage/index.d.ts.map +1 -1
- package/es/use/storage/index.mjs +16 -11
- package/es/use/tooltip/tooltip.d.ts +103 -0
- package/es/use/tooltip/tooltip.d.ts.map +1 -0
- package/es/use/tooltip/tooltip.mjs +68 -0
- package/es/use/use-semantic-node/use-semantic-node.d.ts +15 -0
- package/es/use/use-semantic-node/use-semantic-node.d.ts.map +1 -0
- package/es/use/use-semantic-node/use-semantic-node.mjs +100 -0
- package/es/use/vue/vue.d.ts +9 -0
- package/es/use/vue/vue.d.ts.map +1 -1
- package/es/use/vue/vue.mjs +15 -2
- package/es/util/index.d.ts +0 -1
- package/es/util/index.d.ts.map +1 -1
- package/es/util/index.mjs +0 -1
- package/es/util/install.d.ts.map +1 -1
- package/es/util/overlay-container/overlay-container.d.ts +1 -1
- package/es/util/overlay-container/overlay-container.d.ts.map +1 -1
- package/es/util/overlay-container/overlay-container.mjs +7 -2
- package/es/util/overlay-view-util/overlay-view-util.d.ts +2 -2
- package/es/util/overlay-view-util/overlay-view-util.d.ts.map +1 -1
- package/es/util/overlay-view-util/overlay-view-util.mjs +2 -1
- package/es/util/route/route.d.ts.map +1 -1
- package/es/util/route/route.mjs +13 -3
- package/es/util/store/app-store/app-store.d.ts +2 -2
- package/es/util/store/ui-store/ui-store.d.ts +2 -2
- package/es/view/app-redirect-view/app-redirect-view.d.ts +1 -1
- package/es/view/app-redirect-view/app-redirect-view.d.ts.map +1 -1
- package/es/view/app-redirect-view/app-redirect-view.mjs +1 -1
- package/es/view/common/index.d.ts +5 -5
- package/es/view/common/index.d.ts.map +1 -1
- package/es/view/common/view.d.ts +5 -5
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +17 -3
- package/es/view/de-redirect-view/de-redirect-view.d.ts +8 -8
- package/es/view/de-redirect-view/de-redirect-view.d.ts.map +1 -1
- package/es/view/de-redirect-view/de-redirect-view.mjs +1 -1
- package/es/view/de-redirect-view/index.d.ts +8 -8
- package/es/view/de-redirect-view/index.d.ts.map +1 -1
- package/es/view/html-view/html-view.d.ts +8 -9
- package/es/view/html-view/html-view.d.ts.map +1 -1
- package/es/view/html-view/html-view.mjs +10 -17
- package/es/view/html-view/index.d.ts +7 -8
- package/es/view/html-view/index.d.ts.map +1 -1
- package/es/view/portal-view/index.d.ts +5 -5
- package/es/view/portal-view/index.d.ts.map +1 -1
- package/es/view/portal-view/portal-view.d.ts +5 -5
- package/es/view/portal-view/portal-view.d.ts.map +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts.map +1 -1
- package/lib/common/badge/badge.cjs +12 -6
- package/lib/common/badge/badge.css +1 -1
- package/lib/common/control-base/control-base.cjs +8 -14
- package/lib/common/icon/icon.cjs +12 -0
- package/lib/common/index.cjs +2 -0
- package/lib/common/signature-pad/signature-pad.cjs +167 -0
- package/lib/common/signature-pad/signature-pad.css +1 -0
- package/lib/common/signature-pad/util/bezier.cjs +111 -0
- package/lib/common/signature-pad/util/point.cjs +53 -0
- package/lib/common/signature-pad/util/signature_pad.cjs +1022 -0
- package/lib/common/view-shell/view-shell.cjs +40 -21
- package/lib/control/panel/panel/panel.cjs +11 -3
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +4 -4
- package/lib/index.cjs +57 -47
- package/lib/locale/en/index.cjs +2 -1
- package/lib/locale/zh-CN/index.cjs +2 -1
- package/lib/node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.cjs +2 -2
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.cjs +16 -5
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.cjs +3 -1
- package/lib/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.css +1 -1
- package/lib/panel-component/grid-container/grid-container.cjs +16 -5
- package/lib/panel-component/grid-container/grid-container.controller.cjs +1 -1
- package/lib/panel-component/grid-container/grid-container.state.cjs +1 -1
- package/lib/panel-component/index.cjs +21 -22
- package/lib/panel-component/multi-data-container/multi-data-container.cjs +19 -5
- package/lib/panel-component/multi-data-container/multi-data-container.controller.cjs +87 -68
- package/lib/panel-component/multi-data-container/multi-data-container.state.cjs +1 -1
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.cjs +22 -6
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.controller.cjs +87 -68
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.state.cjs +1 -1
- package/lib/panel-component/nav-pos/nav-pos.cjs +18 -3
- package/lib/panel-component/panel-container/index.cjs +8 -4
- package/lib/panel-component/panel-container/panel-container.cjs +36 -15
- package/lib/panel-component/panel-container/panel-container.provider.cjs +2 -2
- package/lib/panel-component/panel-container-image/panel-container-image.cjs +23 -9
- package/lib/panel-component/panel-container-image/panel-container-image.controller.cjs +1 -1
- package/lib/panel-component/panel-container-image/panel-container-image.css +1 -1
- package/lib/panel-component/panel-container-image/panel-container-image.state.cjs +1 -1
- package/lib/panel-component/panel-container-tabs/panel-container-tabs.cjs +2 -2
- package/lib/panel-component/panel-container-tabs/panel-container-tabs.provider.cjs +2 -2
- package/lib/panel-component/panel-ctrl-pos/panel-ctrl-pos.cjs +11 -3
- package/lib/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.cjs +15 -7
- package/lib/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.css +1 -0
- package/lib/panel-component/panel-field/panel-field.cjs +28 -11
- package/lib/panel-component/panel-field/panel-field.controller.cjs +37 -3
- package/lib/panel-component/panel-field/panel-field.css +1 -1
- package/lib/panel-component/panel-item-render/panel-item-render.cjs +12 -3
- package/lib/panel-component/panel-item-render/panel-item-render.controller.cjs +7 -5
- package/lib/panel-component/panel-rawitem/panel-rawitem.cjs +14 -9
- package/lib/panel-component/panel-tab-page/panel-tab-page.cjs +21 -6
- package/lib/panel-component/panel-tab-page/panel-tab-page.provider.cjs +1 -1
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.cjs +25 -14
- package/lib/panel-component/scroll-container/scroll-container/scroll-container.controller.cjs +1 -1
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.cjs +20 -5
- package/lib/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.cjs +1 -1
- package/lib/panel-component/single-data-container/single-data-container.cjs +21 -5
- package/lib/panel-component/single-data-container/single-data-container.controller.cjs +97 -72
- package/lib/panel-component/single-data-container/single-data-container.state.cjs +1 -1
- package/lib/panel-component/teleport-placeholder/teleport-placeholder.cjs +10 -3
- package/lib/plugin/plugin-factory/plugin-factory.cjs +33 -5
- package/lib/props/editor/code.cjs +6 -0
- package/lib/props/editor/common.cjs +5 -1
- package/lib/props/editor/html.cjs +6 -0
- package/lib/props/editor/index.cjs +3 -0
- package/lib/props/editor/markdown.cjs +27 -1
- package/lib/props/editor/span.cjs +6 -1
- package/lib/props/index.cjs +3 -0
- package/lib/use/index.cjs +8 -0
- package/lib/use/popover/popover.cjs +8 -0
- package/lib/use/storage/index.cjs +16 -11
- package/lib/use/tooltip/tooltip.cjs +72 -0
- package/lib/use/use-semantic-node/use-semantic-node.cjs +102 -0
- package/lib/use/vue/vue.cjs +14 -0
- package/lib/util/index.cjs +0 -2
- package/lib/util/overlay-container/overlay-container.cjs +7 -2
- package/lib/util/overlay-view-util/overlay-view-util.cjs +2 -1
- package/lib/util/route/route.cjs +13 -3
- package/lib/view/common/view.cjs +15 -1
- package/lib/view/html-view/html-view.cjs +8 -15
- package/package.json +8 -7
- package/src/common/badge/badge.scss +49 -0
- package/src/common/badge/badge.tsx +55 -0
- package/src/common/code-list/code-list.scss +15 -0
- package/src/common/code-list/code-list.tsx +184 -0
- package/src/common/control-base/control-base.scss +42 -0
- package/src/common/control-base/control-base.tsx +308 -0
- package/src/common/control-loading-placeholder/control-loading-placeholder.tsx +22 -0
- package/src/common/control-shell/control-shell.scss +5 -0
- package/src/common/control-shell/control-shell.tsx +90 -0
- package/src/common/custom-render/custom-render.scss +4 -0
- package/src/common/custom-render/custom-render.tsx +111 -0
- package/src/common/icon/icon.scss +13 -0
- package/src/common/icon/icon.tsx +105 -0
- package/src/common/index.ts +10 -0
- package/src/common/router-view/router-view.tsx +74 -0
- package/src/common/signature-pad/signature-pad.scss +10 -0
- package/src/common/signature-pad/signature-pad.tsx +174 -0
- package/src/common/signature-pad/util/bezier.ts +164 -0
- package/src/common/signature-pad/util/point.ts +96 -0
- package/src/common/signature-pad/util/signature_pad.ts +1543 -0
- package/src/common/view-shell/view-shell.scss +5 -0
- package/src/common/view-shell/view-shell.tsx +337 -0
- package/src/control/index.ts +1 -0
- package/src/control/panel/index.ts +2 -0
- package/src/control/panel/panel/index.ts +12 -0
- package/src/control/panel/panel/panel.provider.ts +14 -0
- package/src/control/panel/panel/panel.scss +9 -0
- package/src/control/panel/panel/panel.tsx +273 -0
- package/src/control/panel/view-layout-panel/index.ts +18 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.provider.ts +14 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.scss +9 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.tsx +266 -0
- package/src/hooks/app/app.hooks.ts +63 -0
- package/src/hooks/index.ts +1 -0
- package/src/index.ts +19 -0
- package/src/interface/index.ts +1 -0
- package/src/interface/util/index.ts +1 -0
- package/src/interface/util/route/route.ts +116 -0
- package/src/locale/en/index.ts +74 -0
- package/src/locale/index.ts +2 -0
- package/src/locale/zh-CN/index.ts +66 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.controller.ts +248 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.provider.ts +28 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.scss +51 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.state.ts +58 -0
- package/src/panel-component/auth-wxmp-qrcode/auth-wxmp-qrcode.tsx +109 -0
- package/src/panel-component/auth-wxmp-qrcode/index.ts +18 -0
- package/src/panel-component/grid-container/grid-container.controller.ts +24 -0
- package/src/panel-component/grid-container/grid-container.provider.ts +30 -0
- package/src/panel-component/grid-container/grid-container.scss +17 -0
- package/src/panel-component/grid-container/grid-container.state.ts +12 -0
- package/src/panel-component/grid-container/grid-container.tsx +141 -0
- package/src/panel-component/grid-container/index.ts +19 -0
- package/src/panel-component/index.ts +17 -0
- package/src/panel-component/multi-data-container/index.ts +22 -0
- package/src/panel-component/multi-data-container/multi-data-container-item.controller.ts +179 -0
- package/src/panel-component/multi-data-container/multi-data-container-itm.state.ts +20 -0
- package/src/panel-component/multi-data-container/multi-data-container.controller.ts +456 -0
- package/src/panel-component/multi-data-container/multi-data-container.provider.ts +30 -0
- package/src/panel-component/multi-data-container/multi-data-container.scss +10 -0
- package/src/panel-component/multi-data-container/multi-data-container.state.ts +19 -0
- package/src/panel-component/multi-data-container/multi-data-container.tsx +137 -0
- package/src/panel-component/multi-data-container-raw/index.ts +22 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.controller.ts +448 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.provider.ts +30 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.scss +12 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.state.ts +19 -0
- package/src/panel-component/multi-data-container-raw/multi-data-container-raw.tsx +129 -0
- package/src/panel-component/nav-pos/index.ts +16 -0
- package/src/panel-component/nav-pos/nav-pos.controller.ts +438 -0
- package/src/panel-component/nav-pos/nav-pos.provider.ts +38 -0
- package/src/panel-component/nav-pos/nav-pos.scss +4 -0
- package/src/panel-component/nav-pos/nav-pos.state.ts +55 -0
- package/src/panel-component/nav-pos/nav-pos.tsx +166 -0
- package/src/panel-component/panel-container/index.ts +30 -0
- package/src/panel-component/panel-container/panel-container.provider.ts +30 -0
- package/src/panel-component/panel-container/panel-container.scss +21 -0
- package/src/panel-component/panel-container/panel-container.tsx +138 -0
- package/src/panel-component/panel-container-image/index.ts +22 -0
- package/src/panel-component/panel-container-image/panel-container-image.controller.ts +24 -0
- package/src/panel-component/panel-container-image/panel-container-image.provider.ts +30 -0
- package/src/panel-component/panel-container-image/panel-container-image.scss +17 -0
- package/src/panel-component/panel-container-image/panel-container-image.state.ts +12 -0
- package/src/panel-component/panel-container-image/panel-container-image.tsx +116 -0
- package/src/panel-component/panel-container-tabs/index.ts +18 -0
- package/src/panel-component/panel-container-tabs/panel-container-tabs.provider.ts +30 -0
- package/src/panel-component/panel-container-tabs/panel-container-tabs.scss +25 -0
- package/src/panel-component/panel-container-tabs/panel-container-tabs.tsx +47 -0
- package/src/panel-component/panel-ctrl-pos/index.ts +14 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.controller.ts +50 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.provider.ts +30 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.scss +8 -0
- package/src/panel-component/panel-ctrl-pos/panel-ctrl-pos.tsx +72 -0
- package/src/panel-component/panel-ctrl-view-page-caption/index.ts +18 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.controller.ts +32 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.provider.ts +30 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.scss +13 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.state.ts +17 -0
- package/src/panel-component/panel-ctrl-view-page-caption/panel-ctrl-view-page-caption.tsx +77 -0
- package/src/panel-component/panel-field/index.ts +14 -0
- package/src/panel-component/panel-field/panel-field.controller.ts +272 -0
- package/src/panel-component/panel-field/panel-field.provider.ts +28 -0
- package/src/panel-component/panel-field/panel-field.scss +79 -0
- package/src/panel-component/panel-field/panel-field.state.ts +17 -0
- package/src/panel-component/panel-field/panel-field.tsx +138 -0
- package/src/panel-component/panel-item-render/index.ts +18 -0
- package/src/panel-component/panel-item-render/panel-item-render.controller.ts +53 -0
- package/src/panel-component/panel-item-render/panel-item-render.provider.ts +30 -0
- package/src/panel-component/panel-item-render/panel-item-render.tsx +69 -0
- package/src/panel-component/panel-rawitem/index.ts +26 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.controller.ts +54 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.provider.ts +28 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.scss +8 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.tsx +126 -0
- package/src/panel-component/panel-tab-page/index.ts +12 -0
- package/src/panel-component/panel-tab-page/panel-tab-page.provider.ts +28 -0
- package/src/panel-component/panel-tab-page/panel-tab-page.tsx +83 -0
- package/src/panel-component/scroll-container/index.ts +44 -0
- package/src/panel-component/scroll-container/scroll-container/index.ts +2 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.controller.ts +29 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.provider.ts +30 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.scss +40 -0
- package/src/panel-component/scroll-container/scroll-container/scroll-container.tsx +155 -0
- package/src/panel-component/scroll-container/scroll-container-item/index.ts +2 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.controller.ts +21 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.provider.ts +30 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.scss +9 -0
- package/src/panel-component/scroll-container/scroll-container-item/scroll-container-item.tsx +80 -0
- package/src/panel-component/single-data-container/index.ts +22 -0
- package/src/panel-component/single-data-container/single-data-container.controller.ts +507 -0
- package/src/panel-component/single-data-container/single-data-container.provider.ts +30 -0
- package/src/panel-component/single-data-container/single-data-container.scss +10 -0
- package/src/panel-component/single-data-container/single-data-container.state.ts +17 -0
- package/src/panel-component/single-data-container/single-data-container.tsx +124 -0
- package/src/panel-component/teleport-placeholder/index.ts +20 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.controller.ts +54 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.provider.ts +30 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.scss +8 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.state.ts +17 -0
- package/src/panel-component/teleport-placeholder/teleport-placeholder.tsx +65 -0
- package/src/plugin/index.ts +1 -0
- package/src/plugin/plugin-factory/plugin-factory.ts +519 -0
- package/src/props/common.ts +30 -0
- package/src/props/editor/array.ts +28 -0
- package/src/props/editor/autocomplete.ts +28 -0
- package/src/props/editor/cascader.ts +28 -0
- package/src/props/editor/check-box-list.ts +28 -0
- package/src/props/editor/check-box.ts +28 -0
- package/src/props/editor/code.ts +56 -0
- package/src/props/editor/color-picker.ts +28 -0
- package/src/props/editor/common.ts +120 -0
- package/src/props/editor/data-picker.ts +28 -0
- package/src/props/editor/date-picker.ts +29 -0
- package/src/props/editor/date-range-select.ts +52 -0
- package/src/props/editor/date-range.ts +29 -0
- package/src/props/editor/dropdown-list.ts +28 -0
- package/src/props/editor/html.ts +44 -0
- package/src/props/editor/index.ts +29 -0
- package/src/props/editor/input-ip.ts +28 -0
- package/src/props/editor/input-number.ts +28 -0
- package/src/props/editor/list-box.ts +28 -0
- package/src/props/editor/map-picker.ts +28 -0
- package/src/props/editor/markdown.ts +74 -0
- package/src/props/editor/number-range.ts +28 -0
- package/src/props/editor/radio-button-list.ts +28 -0
- package/src/props/editor/rate.ts +28 -0
- package/src/props/editor/raw.ts +28 -0
- package/src/props/editor/slider.ts +28 -0
- package/src/props/editor/span.ts +33 -0
- package/src/props/editor/stepper.ts +28 -0
- package/src/props/editor/switch.ts +28 -0
- package/src/props/editor/text-box.ts +28 -0
- package/src/props/editor/upload.ts +28 -0
- package/src/props/index.ts +2 -0
- package/src/types/index.d.ts +8 -0
- package/src/use/autofocus-blur/autofocus-blur.ts +31 -0
- package/src/use/click-outside/click-outside.ts +72 -0
- package/src/use/codeList-listen/codelist-listen.ts +28 -0
- package/src/use/control/index.ts +1 -0
- package/src/use/control/use-control-controller/use-control-controller.ts +186 -0
- package/src/use/event/event.ts +57 -0
- package/src/use/focus-blur/focus-blur.ts +83 -0
- package/src/use/index.ts +16 -0
- package/src/use/namespace/namespace.ts +14 -0
- package/src/use/popover/popover.ts +157 -0
- package/src/use/route/route.ts +47 -0
- package/src/use/storage/index.ts +46 -0
- package/src/use/tooltip/tooltip.ts +153 -0
- package/src/use/use-semantic-node/use-semantic-node.ts +154 -0
- package/src/use/util/index.ts +26 -0
- package/src/use/view/index.ts +2 -0
- package/src/use/view/use-view-controller/use-view-controller.ts +163 -0
- package/src/use/view/use-view-operation/use-view-operation.ts +44 -0
- package/src/use/vue/vue.ts +168 -0
- package/src/use/vue-use/computed-async.ts +151 -0
- package/src/use/vue-use/index.ts +1 -0
- package/src/util/index.ts +9 -0
- package/src/util/install.ts +14 -0
- package/src/util/overlay-container/overlay-container.ts +162 -0
- package/src/util/overlay-popover-container/overlay-popover-container.ts +30 -0
- package/src/util/overlay-view-util/overlay-view-util.ts +93 -0
- package/src/util/render/render.ts +54 -0
- package/src/util/route/route-listener.ts +91 -0
- package/src/util/route/route.ts +606 -0
- package/src/util/router-callback/router-callback-item.ts +98 -0
- package/src/util/router-callback/router-callback.ts +110 -0
- package/src/util/store/app-store/app-store.ts +10 -0
- package/src/util/store/index.ts +6 -0
- package/src/util/store/ui-store/ui-store.ts +37 -0
- package/src/util/store/ui-store/z-index.ts +53 -0
- package/src/view/app-data-upload-view/app-data-upload-view.provider.ts +31 -0
- package/src/view/app-redirect-view/app-redirect-view.tsx +26 -0
- package/src/view/common/index.ts +19 -0
- package/src/view/common/view.provider.ts +14 -0
- package/src/view/common/view.scss +39 -0
- package/src/view/common/view.tsx +285 -0
- package/src/view/de-redirect-view/de-redirect-view.provider.ts +14 -0
- package/src/view/de-redirect-view/de-redirect-view.tsx +86 -0
- package/src/view/de-redirect-view/index.ts +17 -0
- package/src/view/html-view/html-view.provider.ts +14 -0
- package/src/view/html-view/html-view.scss +7 -0
- package/src/view/html-view/html-view.tsx +86 -0
- package/src/view/html-view/index.ts +10 -0
- package/src/view/index.ts +6 -0
- package/src/view/md-custom-view/md-custom-view.provider.ts +30 -0
- package/src/view/portal-view/index.ts +18 -0
- package/src/view/portal-view/portal-view.provider.ts +14 -0
- package/src/view/portal-view/portal-view.tsx +83 -0
- package/src/view/todo-redirect/todo-redirect.tsx +51 -0
- package/es/panel-component/panel-container/panel-container.controller.d.ts +0 -21
- package/es/panel-component/panel-container/panel-container.controller.d.ts.map +0 -1
- package/es/panel-component/panel-container/panel-container.controller.mjs +0 -12
- package/es/panel-component/panel-container/panel-container.state.d.ts +0 -10
- package/es/panel-component/panel-container/panel-container.state.d.ts.map +0 -1
- package/es/panel-component/panel-container/panel-container.state.mjs +0 -7
- package/es/panel-component/panel-container-group/index.d.ts +0 -29
- package/es/panel-component/panel-container-group/index.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/index.mjs +0 -21
- package/es/panel-component/panel-container-group/panel-container-group.controller.d.ts +0 -34
- package/es/panel-component/panel-container-group/panel-container-group.controller.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.controller.mjs +0 -31
- package/es/panel-component/panel-container-group/panel-container-group.css +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.d.ts +0 -46
- package/es/panel-component/panel-container-group/panel-container-group.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.mjs +0 -119
- package/es/panel-component/panel-container-group/panel-container-group.provider.d.ts +0 -16
- package/es/panel-component/panel-container-group/panel-container-group.provider.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.provider.mjs +0 -15
- package/es/panel-component/panel-container-group/panel-container-group.state.d.ts +0 -13
- package/es/panel-component/panel-container-group/panel-container-group.state.d.ts.map +0 -1
- package/es/panel-component/panel-container-group/panel-container-group.state.mjs +0 -7
- package/es/util/control/prepare-control.d.ts +0 -15
- package/es/util/control/prepare-control.d.ts.map +0 -1
- package/es/util/control/prepare-control.mjs +0 -22
- package/lib/panel-component/panel-container/panel-container.controller.cjs +0 -14
- package/lib/panel-component/panel-container/panel-container.state.cjs +0 -9
- package/lib/panel-component/panel-container-group/index.cjs +0 -28
- package/lib/panel-component/panel-container-group/panel-container-group.cjs +0 -121
- package/lib/panel-component/panel-container-group/panel-container-group.controller.cjs +0 -33
- package/lib/panel-component/panel-container-group/panel-container-group.css +0 -1
- package/lib/panel-component/panel-container-group/panel-container-group.provider.cjs +0 -17
- package/lib/panel-component/panel-container-group/panel-container-group.state.cjs +0 -9
- package/lib/util/control/prepare-control.cjs +0 -24
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
import { notNilEmpty } from 'qx-util';
|
|
2
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
3
|
+
import qs from 'qs';
|
|
4
|
+
import { RouteLocationNormalizedLoaded as Route, useRoute } from 'vue-router';
|
|
5
|
+
import { watch } from 'vue';
|
|
6
|
+
import {
|
|
7
|
+
calcDeCodeNameById,
|
|
8
|
+
getMatchResPath,
|
|
9
|
+
IViewConfig,
|
|
10
|
+
RouteConst,
|
|
11
|
+
ViewType,
|
|
12
|
+
} from '@ibiz-template/runtime';
|
|
13
|
+
import { isNil, isNotNil } from 'ramda';
|
|
14
|
+
import { IRoutePath, IRoutePathNode, IRouteViewData } from '../../interface';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 路径字符串转换成路由路径对象
|
|
18
|
+
*
|
|
19
|
+
* @author lxm
|
|
20
|
+
* @date 2022-08-18 11:08:08
|
|
21
|
+
* @export
|
|
22
|
+
* @param {string} pathStr 以/开头的路径,即router的path
|
|
23
|
+
* @param {boolean} [isRouteModal=false]
|
|
24
|
+
* @returns {*} {IRoutePath}
|
|
25
|
+
*/
|
|
26
|
+
export function route2routePath(
|
|
27
|
+
route: Route,
|
|
28
|
+
isRouteModal: boolean = false,
|
|
29
|
+
): IRoutePath {
|
|
30
|
+
// 一共匹配了几级路由
|
|
31
|
+
const depth = route.matched.length;
|
|
32
|
+
|
|
33
|
+
let path = route.path;
|
|
34
|
+
if (isRouteModal) {
|
|
35
|
+
path = path.replace(new RegExp(`/${RouteConst.ROUTE_MODAL_TAG}`, 'g'), '');
|
|
36
|
+
}
|
|
37
|
+
const items = path.split('/');
|
|
38
|
+
|
|
39
|
+
// 解析路径节点
|
|
40
|
+
const pathNodes: IRoutePathNode[] = [];
|
|
41
|
+
for (let index = 1; index <= depth; index++) {
|
|
42
|
+
const viewName = items[index * 2];
|
|
43
|
+
const paramsStr = route.params[`params${index}`] as string;
|
|
44
|
+
|
|
45
|
+
/** 路由参数,默认是视图参数 */
|
|
46
|
+
let params: IParams | undefined;
|
|
47
|
+
|
|
48
|
+
/** 上下文参数 */
|
|
49
|
+
let context: IParams | undefined;
|
|
50
|
+
let srfnav: string | undefined;
|
|
51
|
+
// params为占位符时置空
|
|
52
|
+
if (!paramsStr || paramsStr === ibiz.env.routePlaceholder) {
|
|
53
|
+
params = undefined;
|
|
54
|
+
} else {
|
|
55
|
+
// 首页上下文要解析
|
|
56
|
+
params = qs.parse(paramsStr, {
|
|
57
|
+
strictNullHandling: true,
|
|
58
|
+
delimiter: ';',
|
|
59
|
+
depth: 8,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 路由参数存在的时候,解析里面的上下文。
|
|
64
|
+
if (params) {
|
|
65
|
+
if (index === 1) {
|
|
66
|
+
// 首页的时候,路由上的参数是资源路径,属于上下文
|
|
67
|
+
context = params;
|
|
68
|
+
params = undefined;
|
|
69
|
+
} else {
|
|
70
|
+
if (params.srfnavctx) {
|
|
71
|
+
// 解析额外上下文,这儿不需要使用decodeURIComponent解码,因为前面调用qs.parse时,内部已经做过解码处理,如果再次执行decodeURIComponent解码,数据里面有中文字符可能会报错
|
|
72
|
+
context = JSON.parse(params.srfnavctx);
|
|
73
|
+
delete params.srfnavctx;
|
|
74
|
+
}
|
|
75
|
+
if (params.srfnav) {
|
|
76
|
+
// 解析额外自身视图导航参数
|
|
77
|
+
srfnav = params.srfnav;
|
|
78
|
+
delete params.srfnav;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
pathNodes.push({ viewName, context, params, srfnav });
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 解析应用上下文
|
|
87
|
+
let appContext;
|
|
88
|
+
if (
|
|
89
|
+
route.params.appContext &&
|
|
90
|
+
route.params.appContext !== ibiz.env.routePlaceholder
|
|
91
|
+
) {
|
|
92
|
+
appContext = qs.parse(route.params.appContext as string, {
|
|
93
|
+
strictNullHandling: true,
|
|
94
|
+
delimiter: ';',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return { appContext, pathNodes };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 路由路径对象转路径字符串
|
|
103
|
+
*
|
|
104
|
+
* @author lxm
|
|
105
|
+
* @date 2022-08-18 13:08:57
|
|
106
|
+
* @export
|
|
107
|
+
* @param {IRoutePath} routePath 路由路径对象
|
|
108
|
+
* @returns {*} {string}
|
|
109
|
+
*/
|
|
110
|
+
export function routePath2string(routePath: IRoutePath): string {
|
|
111
|
+
let pathStr = '';
|
|
112
|
+
// 应用上下文
|
|
113
|
+
if (routePath.appContext) {
|
|
114
|
+
pathStr += `/${qs.stringify(routePath.appContext, {
|
|
115
|
+
delimiter: ';',
|
|
116
|
+
strictNullHandling: true,
|
|
117
|
+
})}`;
|
|
118
|
+
} else {
|
|
119
|
+
pathStr += `/${ibiz.env.routePlaceholder}`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 每一层级的视图路由的拼装
|
|
123
|
+
routePath.pathNodes.forEach((pathNode: IRoutePathNode, index: number) => {
|
|
124
|
+
pathStr += `/${pathNode.viewName}/`;
|
|
125
|
+
let routeParams: IParams = {};
|
|
126
|
+
// 首页路由
|
|
127
|
+
if (index === 0) {
|
|
128
|
+
if (notNilEmpty(pathNode.context)) {
|
|
129
|
+
// 对象转成a=11;b=222的格式,字符串直接附加在后面
|
|
130
|
+
routeParams = pathNode.context!;
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
// 非首页路由,视图参数直接放到路由参数上,上下文转换后放到路由参数的srfnavctx上
|
|
134
|
+
routeParams = notNilEmpty(pathNode.params) ? pathNode.params! : {};
|
|
135
|
+
|
|
136
|
+
// 合并视图上下文
|
|
137
|
+
if (notNilEmpty(pathNode.context)) {
|
|
138
|
+
const objStr = JSON.stringify(pathNode.context);
|
|
139
|
+
// undefined 的vlaue会被JSON.stringify删除,可能会转成{}
|
|
140
|
+
if (objStr !== '{}') {
|
|
141
|
+
routeParams!.srfnavctx = encodeURIComponent(objStr);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// 合并视图导航参数
|
|
146
|
+
if (pathNode.srfnav) {
|
|
147
|
+
routeParams.srfnav = pathNode.srfnav;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const paramsStr = qs.stringify(routeParams, {
|
|
152
|
+
delimiter: ';',
|
|
153
|
+
strictNullHandling: true,
|
|
154
|
+
skipNulls: true,
|
|
155
|
+
});
|
|
156
|
+
// 把路由参数转换到路由路径上去
|
|
157
|
+
if (notNilEmpty(paramsStr)) {
|
|
158
|
+
pathStr += paramsStr;
|
|
159
|
+
} else {
|
|
160
|
+
pathStr += ibiz.env.routePlaceholder;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
return pathStr;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 获取自身的路由上下文,排除了部分不需要路由携带的参数
|
|
169
|
+
*
|
|
170
|
+
* @author lxm
|
|
171
|
+
* @date 2023-03-14 02:07:41
|
|
172
|
+
* @export
|
|
173
|
+
* @param {IContext} context
|
|
174
|
+
* @returns {*} {IParams}
|
|
175
|
+
*/
|
|
176
|
+
export function getOwnRouteContext(context: IContext): IParams {
|
|
177
|
+
const ownContext = context.getOwnContext();
|
|
178
|
+
const excludeKeys = [
|
|
179
|
+
'srfsessionid',
|
|
180
|
+
'srfappid',
|
|
181
|
+
'currentSrfNav',
|
|
182
|
+
'toRouteDepth',
|
|
183
|
+
];
|
|
184
|
+
// 附加路由透传参数(显示声明在路由上),与导航占位自定义参数映射,多个值用|分隔
|
|
185
|
+
if (ownContext.attributekeys) {
|
|
186
|
+
const attributeKeys = ownContext.attributekeys.split('|');
|
|
187
|
+
if (attributeKeys && attributeKeys.length > 0) {
|
|
188
|
+
attributeKeys.forEach((key: string) => {
|
|
189
|
+
if (isNotNil(context[key])) {
|
|
190
|
+
ownContext[key] = context[key];
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
delete ownContext.attributekeys;
|
|
195
|
+
}
|
|
196
|
+
// 附加路由保留空值参数,目前全局通知有使用
|
|
197
|
+
let srfKeepNull: boolean = false;
|
|
198
|
+
if (Object.prototype.hasOwnProperty.call(ownContext, 'srfkeepnull')) {
|
|
199
|
+
srfKeepNull =
|
|
200
|
+
ownContext.srfkeepnull === true || ownContext.srfkeepnull === 'true';
|
|
201
|
+
delete ownContext.srfkeepnull;
|
|
202
|
+
}
|
|
203
|
+
Object.keys(ownContext).forEach(key => {
|
|
204
|
+
if (excludeKeys.includes(key) || (!srfKeepNull && isNil(ownContext[key]))) {
|
|
205
|
+
delete ownContext[key];
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
return ownContext;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* 附加预置参数
|
|
213
|
+
*
|
|
214
|
+
* @author tony001
|
|
215
|
+
* @date 2024-05-19 16:05:02
|
|
216
|
+
* @param {IContext} context
|
|
217
|
+
* @param {IRoutePathNode[]} pathNodes
|
|
218
|
+
*/
|
|
219
|
+
function attachPresetParams(
|
|
220
|
+
context: IContext,
|
|
221
|
+
pathNodes: IRoutePathNode[],
|
|
222
|
+
): void {
|
|
223
|
+
// 处理预置参数srfreadonly,设置上下文srfreadonly参数
|
|
224
|
+
// 祖先存在srfreadonly=true则不需处理;如果都没有,当前父环境srfreadonly=true,则需给当前环境设置srfreadonly=true
|
|
225
|
+
let index = -1;
|
|
226
|
+
if (pathNodes && pathNodes.length > 0) {
|
|
227
|
+
index = pathNodes.findIndex(pathNode => {
|
|
228
|
+
return pathNode.context?.srfreadonly === true;
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (
|
|
232
|
+
context.srfreadonly &&
|
|
233
|
+
!context.getOwnContext().srfreadonly &&
|
|
234
|
+
index === -1
|
|
235
|
+
) {
|
|
236
|
+
context.srfreadonly = true;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* 计算资源上下文时,需要排除自身实体codeName的视图(导航类视图和多数据视图)
|
|
242
|
+
* @return {*}
|
|
243
|
+
* @author: zhujiamin
|
|
244
|
+
* @Date: 2023-02-20 15:45:46
|
|
245
|
+
*/
|
|
246
|
+
export const excludeViewTypes: string[] = [
|
|
247
|
+
ViewType.DE_GRID_VIEW,
|
|
248
|
+
ViewType.DE_GRID_EXP_VIEW,
|
|
249
|
+
ViewType.DE_LIST_VIEW,
|
|
250
|
+
ViewType.DE_LIST_EXP_VIEW,
|
|
251
|
+
ViewType.DE_DATA_VIEW,
|
|
252
|
+
ViewType.DE_DATAVIEW_EXP_VIEW,
|
|
253
|
+
ViewType.DE_CALENDAR_VIEW,
|
|
254
|
+
ViewType.DE_CALENDAR_EXP_VIEW,
|
|
255
|
+
ViewType.DE_CHART_VIEW,
|
|
256
|
+
ViewType.DE_CHART_EXP_VIEW,
|
|
257
|
+
ViewType.DE_KANBAN_VIEW,
|
|
258
|
+
];
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* 计算资源路径,把首页后面的资源路径上下文算出来,并把第二层中对应的上下文删掉。
|
|
262
|
+
* @author lxm
|
|
263
|
+
* @date 2023-07-13 06:37:10
|
|
264
|
+
* @export
|
|
265
|
+
* @param {IRoutePath} routePath
|
|
266
|
+
* @param {IContext} context
|
|
267
|
+
* @param {string} appDataEntityId
|
|
268
|
+
* @return {*} {Promise<void>}
|
|
269
|
+
*/
|
|
270
|
+
export async function calcResRoutePath(
|
|
271
|
+
routePath: IRoutePath,
|
|
272
|
+
context: IContext,
|
|
273
|
+
appDataEntityId?: string,
|
|
274
|
+
appId?: string,
|
|
275
|
+
): Promise<void> {
|
|
276
|
+
if (!appDataEntityId) {
|
|
277
|
+
// 无实体的视图清空资源上下文
|
|
278
|
+
routePath.pathNodes[0].context = undefined;
|
|
279
|
+
} else {
|
|
280
|
+
const entity = await ibiz.hub.getAppDataEntity(appDataEntityId, appId);
|
|
281
|
+
let match = getMatchResPath(context, entity);
|
|
282
|
+
// 有实体有没有匹配到的,补一个包含自身实体主键的match
|
|
283
|
+
if (!match) {
|
|
284
|
+
match = { path: '', keys: [entity.codeName!.toLowerCase()] };
|
|
285
|
+
}
|
|
286
|
+
if (match) {
|
|
287
|
+
const currentContext = routePath.pathNodes[1].context;
|
|
288
|
+
const resContext: IParams = {};
|
|
289
|
+
// 资源路径不为空,二级视图的上下文删掉多余的资源上下文
|
|
290
|
+
match.keys.forEach(key => {
|
|
291
|
+
if (context && Object.prototype.hasOwnProperty.call(context, key)) {
|
|
292
|
+
resContext[key] = context[key];
|
|
293
|
+
if (currentContext) {
|
|
294
|
+
delete currentContext[key];
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
// 把资源路径填充到一级路由上
|
|
299
|
+
routePath.pathNodes[0].context = resContext;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* 生成route路径
|
|
306
|
+
*
|
|
307
|
+
* @author lxm
|
|
308
|
+
* @date 2022-08-17 21:08:00
|
|
309
|
+
* @export
|
|
310
|
+
* @param {IAppView} appView 视图模型
|
|
311
|
+
* @param {Route} route 路由对象
|
|
312
|
+
* @param {IContext} [context] 上下文对象
|
|
313
|
+
* @param {(IParams | undefined)} [params] 视图参数
|
|
314
|
+
* @returns {*} {string}
|
|
315
|
+
*/
|
|
316
|
+
export async function generateRoutePath(
|
|
317
|
+
appView: IViewConfig,
|
|
318
|
+
route: Route,
|
|
319
|
+
context: IContext,
|
|
320
|
+
params?: IParams,
|
|
321
|
+
): Promise<{ path: string }> {
|
|
322
|
+
const routePath = route2routePath(route);
|
|
323
|
+
// 如果上下文存在toRouteDepth时,使用上下文的层级,否则使用默认层级
|
|
324
|
+
let depth = Number(context.srfdefaulttoroutedepth || 2); // 默认层级看上下文的srfdefaulttoroutedepth,如果没有就是2
|
|
325
|
+
if (context.toRouteDepth) {
|
|
326
|
+
depth = context.toRouteDepth;
|
|
327
|
+
// 使用完后转为undefined,避免添加到上下文里
|
|
328
|
+
context.toRouteDepth = undefined;
|
|
329
|
+
} else if (ibiz.env.isMob) {
|
|
330
|
+
// 移动端默认补充home层级
|
|
331
|
+
if (ibiz.env.mobMenuShowMode === 'DEFAULT') {
|
|
332
|
+
routePath.pathNodes[0] = {
|
|
333
|
+
viewName: 'home',
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
let srfmenuitem = params?.srfmenuitem;
|
|
339
|
+
if (!srfmenuitem && routePath.pathNodes.length > 1) {
|
|
340
|
+
srfmenuitem = routePath.pathNodes[1].params?.srfmenuitem;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// 删除目标层级和之后的路由,保留之前层级的路由
|
|
344
|
+
routePath.pathNodes.splice(depth - 1, routePath.pathNodes.length - depth + 1);
|
|
345
|
+
|
|
346
|
+
// 导航视图的导航参数,加在目标层级之前的一个层级的视图参数里
|
|
347
|
+
if (context.currentSrfNav) {
|
|
348
|
+
const currentNode = routePath.pathNodes[routePath.pathNodes.length - 1];
|
|
349
|
+
currentNode.params = currentNode.params || {};
|
|
350
|
+
currentNode.srfnav = context.currentSrfNav;
|
|
351
|
+
// 使用完后转为undefined,避免添加到上下文里
|
|
352
|
+
context.currentSrfNav = undefined;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// 附加当前环境上下文的srfreadonly
|
|
356
|
+
attachPresetParams(context, routePath.pathNodes);
|
|
357
|
+
|
|
358
|
+
// 重定向视图跳转的一级首页路由
|
|
359
|
+
if (route.fullPath.startsWith('/appredirectview')) {
|
|
360
|
+
if (params?.srfindexname) {
|
|
361
|
+
routePath.pathNodes[0].viewName = params.srfindexname;
|
|
362
|
+
delete params.srfindexname;
|
|
363
|
+
} else {
|
|
364
|
+
routePath.pathNodes[0].viewName = 'index';
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// 计算目标视图path路径
|
|
369
|
+
routePath.pathNodes.push({
|
|
370
|
+
viewName: appView.codeName!.toLowerCase(),
|
|
371
|
+
context: getOwnRouteContext(context),
|
|
372
|
+
params,
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
// 计算二级视图的资源路径加到index后面
|
|
376
|
+
if (depth === 2) {
|
|
377
|
+
await calcResRoutePath(
|
|
378
|
+
routePath,
|
|
379
|
+
context,
|
|
380
|
+
appView.appDataEntityId,
|
|
381
|
+
appView.appId,
|
|
382
|
+
);
|
|
383
|
+
|
|
384
|
+
// 多数据和导航视图,删除自身的主键上下文
|
|
385
|
+
if (excludeViewTypes.includes(appView.viewType)) {
|
|
386
|
+
const deName = calcDeCodeNameById(appView.appDataEntityId!);
|
|
387
|
+
delete routePath.pathNodes[0].context![deName];
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (srfmenuitem && routePath.pathNodes.length > 1) {
|
|
392
|
+
const tempParams = routePath.pathNodes[1].params || {};
|
|
393
|
+
routePath.pathNodes[1].params = { ...tempParams, srfmenuitem };
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return { path: routePath2string(routePath) };
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* 生成route路径
|
|
401
|
+
*
|
|
402
|
+
* @author lxm
|
|
403
|
+
* @date 2022-08-17 21:08:00
|
|
404
|
+
* @export
|
|
405
|
+
* @param {IAppView} appView 视图模型
|
|
406
|
+
* @param {Route} route 路由对象
|
|
407
|
+
* @param {IContext} [context] 上下文对象
|
|
408
|
+
* @param {(IParams | undefined)} [params] 视图参数
|
|
409
|
+
* @returns {*} {string}
|
|
410
|
+
*/
|
|
411
|
+
export async function generateRoutePathByModal(
|
|
412
|
+
appView: IViewConfig,
|
|
413
|
+
route: Route,
|
|
414
|
+
context: IContext,
|
|
415
|
+
params?: IParams,
|
|
416
|
+
): Promise<{ path: string }> {
|
|
417
|
+
const routePath = route2routePath(route);
|
|
418
|
+
|
|
419
|
+
// 特殊处理 RouteConst.ROUTE_MODAL_TAG,因为只能有一级避免多次或重复点击,导致路由计算错误。再次点击时把之前的modal路由删除
|
|
420
|
+
const findIndex = routePath.pathNodes.findIndex(
|
|
421
|
+
item => item.viewName === RouteConst.ROUTE_MODAL_TAG,
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
if (findIndex !== -1) {
|
|
425
|
+
routePath.pathNodes = routePath.pathNodes.slice(0, findIndex);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// 导航视图的导航参数,加在目标层级之前的一个层级的视图参数里
|
|
429
|
+
if (context.currentSrfNav) {
|
|
430
|
+
const currentNode = routePath.pathNodes[routePath.pathNodes.length - 1];
|
|
431
|
+
currentNode.params = currentNode.params || {};
|
|
432
|
+
currentNode.srfnav = context.currentSrfNav;
|
|
433
|
+
// 使用完后转为undefined,避免添加到上下文里
|
|
434
|
+
context.currentSrfNav = undefined;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// 附加当前环境上下文的srfreadonly
|
|
438
|
+
attachPresetParams(context, routePath.pathNodes);
|
|
439
|
+
|
|
440
|
+
// 计算目标视图path路径
|
|
441
|
+
routePath.pathNodes.push({
|
|
442
|
+
viewName: `${
|
|
443
|
+
RouteConst.ROUTE_MODAL_TAG
|
|
444
|
+
}/${appView.codeName!.toLowerCase()}`,
|
|
445
|
+
context: getOwnRouteContext(context),
|
|
446
|
+
params,
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
return { path: routePath2string(routePath) };
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* 解析路由获取对应视图数据
|
|
454
|
+
*
|
|
455
|
+
* @author lxm
|
|
456
|
+
* @date 2022-08-17 22:08:51
|
|
457
|
+
* @export
|
|
458
|
+
* @param {Route} route 路由对象
|
|
459
|
+
* @param {number} depth 层级
|
|
460
|
+
* @param {boolean} [isRouteModal=false]
|
|
461
|
+
* @returns {*} {IRouteViewData}
|
|
462
|
+
*/
|
|
463
|
+
export async function parseRouteViewData(
|
|
464
|
+
route: Route,
|
|
465
|
+
depth: number,
|
|
466
|
+
isRouteModal: boolean = false,
|
|
467
|
+
): Promise<IRouteViewData> {
|
|
468
|
+
// 解析路由的视图参数
|
|
469
|
+
const routePath = route2routePath(route, isRouteModal);
|
|
470
|
+
|
|
471
|
+
// 获取对应层级的视图名称参数
|
|
472
|
+
let viewCodeName = routePath.pathNodes[depth - 1].viewName;
|
|
473
|
+
if (!viewCodeName) {
|
|
474
|
+
throw new RuntimeError(
|
|
475
|
+
ibiz.i18n.t('vue3Util.util.viewIdentifiers', { depth }),
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
if (viewCodeName === RouteConst.ROUTE_MODAL_TAG) {
|
|
479
|
+
viewCodeName = routePath.pathNodes[depth].viewName;
|
|
480
|
+
}
|
|
481
|
+
if (viewCodeName === 'index') {
|
|
482
|
+
viewCodeName = ibiz.hub.defaultAppIndexViewName;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// 根据路由视图名称参数查询视图模型
|
|
486
|
+
const viewConfig = await ibiz.hub.config.view.get(viewCodeName);
|
|
487
|
+
|
|
488
|
+
// 找不到视图模型的返回空对象
|
|
489
|
+
if (!viewConfig) {
|
|
490
|
+
throw new RuntimeError(
|
|
491
|
+
ibiz.i18n.t('vue3Util.util.noFoundView', { viewCodeName }),
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// !解析上下文参数,整合当前层级之前所有的上下文参数
|
|
496
|
+
const context: IParams = {};
|
|
497
|
+
// 合并appData里的应用上下文
|
|
498
|
+
if (ibiz.appData?.context) {
|
|
499
|
+
Object.assign(context, ibiz.appData.context);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// 合并路由上下文
|
|
503
|
+
// 合并路由应用上下文
|
|
504
|
+
if (routePath.appContext) {
|
|
505
|
+
Object.assign(context, routePath.appContext);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// 逐层合并视图上下文,第一层首页不合,它的上下文是资源路径属于子视图。
|
|
509
|
+
if (depth !== 1) {
|
|
510
|
+
for (let index = 0; index < depth; index++) {
|
|
511
|
+
const pathNode = routePath.pathNodes[index];
|
|
512
|
+
if (notNilEmpty(pathNode.context)) {
|
|
513
|
+
Object.assign(context, pathNode.context);
|
|
514
|
+
}
|
|
515
|
+
// 预置处理srfnavctrlid参数防止上一条,下一条数据异常
|
|
516
|
+
// 自身路由节点上没有srfnavctrlid,则当前路由上下文就不应有
|
|
517
|
+
if (
|
|
518
|
+
index === depth - 1 &&
|
|
519
|
+
(!pathNode.context || isNil(pathNode.context.srfnavctrlid))
|
|
520
|
+
) {
|
|
521
|
+
delete context.srfnavctrlid;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// 最后一级路由对应的视图才会解析视图参数
|
|
527
|
+
const { params, srfnav } = routePath.pathNodes[depth - 1];
|
|
528
|
+
|
|
529
|
+
return {
|
|
530
|
+
viewConfig,
|
|
531
|
+
context,
|
|
532
|
+
params,
|
|
533
|
+
srfnav,
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* 获取指定层级的路由路径
|
|
539
|
+
* @author lxm
|
|
540
|
+
* @date 2023-06-21 06:08:32
|
|
541
|
+
* @export
|
|
542
|
+
* @param {Route} route
|
|
543
|
+
* @param {number} depth
|
|
544
|
+
* @return {*} {string}
|
|
545
|
+
*/
|
|
546
|
+
export function getNestedRoutePath(
|
|
547
|
+
route: Route,
|
|
548
|
+
depth: number,
|
|
549
|
+
noSrfNav: boolean = true,
|
|
550
|
+
): string {
|
|
551
|
+
// 当前路由层级低于指定层级的返回空
|
|
552
|
+
if (route.matched.length < depth) {
|
|
553
|
+
return '';
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// 只有当前层级的路由的代名称的路由如login,404等直接返回path
|
|
557
|
+
if (route.matched.length === depth && route.name) {
|
|
558
|
+
return route.path;
|
|
559
|
+
}
|
|
560
|
+
const routePath = route2routePath(route);
|
|
561
|
+
if (routePath.pathNodes.length < depth) {
|
|
562
|
+
// 当前路由层级比指定层级少时,直接返回空字符串
|
|
563
|
+
return route.path;
|
|
564
|
+
}
|
|
565
|
+
if (routePath.pathNodes.length > depth) {
|
|
566
|
+
// 删除depth后面的节点
|
|
567
|
+
routePath.pathNodes = routePath.pathNodes.slice(0, depth);
|
|
568
|
+
}
|
|
569
|
+
const pathNode = routePath.pathNodes[depth - 1];
|
|
570
|
+
if (noSrfNav) {
|
|
571
|
+
// 删除至nav
|
|
572
|
+
delete pathNode.srfnav;
|
|
573
|
+
}
|
|
574
|
+
// 移动端不删除srfnavctrlid,修复工作流回退异常
|
|
575
|
+
if (!ibiz.env.isMob && pathNode.context) {
|
|
576
|
+
delete pathNode.context.srfnavctrlid;
|
|
577
|
+
}
|
|
578
|
+
return routePath2string(routePath);
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* 监听路由的变更,每次变更后都会触发回调
|
|
583
|
+
* 回调函数提供根据视图层级计算好的唯一标识currentKey,只有变了视图才需要刷新
|
|
584
|
+
* @author lxm
|
|
585
|
+
* @date 2023-05-09 12:52:36
|
|
586
|
+
* @param {(args: { currentKey: string; fullPath: string }) => void} callback
|
|
587
|
+
* @param {number} depth
|
|
588
|
+
*/
|
|
589
|
+
export function onRouteChange(
|
|
590
|
+
callback: (args: { currentKey: string; fullPath: string }) => void,
|
|
591
|
+
depth: number,
|
|
592
|
+
): void {
|
|
593
|
+
const route = useRoute();
|
|
594
|
+
if (!route) {
|
|
595
|
+
throw new RuntimeError(ibiz.i18n.t('vue3Util.util.routeCorrectly'));
|
|
596
|
+
}
|
|
597
|
+
watch(
|
|
598
|
+
// fix: odoo脚本触发路径query变更未触发路由变更事件
|
|
599
|
+
() => route?.fullPath,
|
|
600
|
+
() => {
|
|
601
|
+
const currentKey = getNestedRoutePath(route, depth);
|
|
602
|
+
callback({ currentKey, fullPath: route.fullPath });
|
|
603
|
+
},
|
|
604
|
+
{ immediate: true },
|
|
605
|
+
);
|
|
606
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { IModalData } from '@ibiz-template/runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 路由视图关闭回调
|
|
5
|
+
*
|
|
6
|
+
* @author chitanda
|
|
7
|
+
* @date 2023-07-13 21:07:51
|
|
8
|
+
* @export
|
|
9
|
+
* @class RouterCallbackItem
|
|
10
|
+
*/
|
|
11
|
+
export class RouterCallbackItem {
|
|
12
|
+
protected resolve?: (modal: IModalData) => void;
|
|
13
|
+
|
|
14
|
+
protected promise?: Promise<IModalData>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 销毁定时器
|
|
18
|
+
*
|
|
19
|
+
* @author chitanda
|
|
20
|
+
* @date 2023-07-13 21:07:51
|
|
21
|
+
* @type {number}
|
|
22
|
+
*/
|
|
23
|
+
timeout?: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 是否已经有打开的视图认领此回调,如果在一定时间内没有被认领,则会被清除
|
|
27
|
+
*
|
|
28
|
+
* @author chitanda
|
|
29
|
+
* @date 2023-07-13 21:07:35
|
|
30
|
+
*/
|
|
31
|
+
isActivated = false;
|
|
32
|
+
|
|
33
|
+
constructor(
|
|
34
|
+
public from: string,
|
|
35
|
+
public to: string,
|
|
36
|
+
) {
|
|
37
|
+
ibiz.log.debug('openRouter: ', from, to);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 等待视图关闭
|
|
42
|
+
*
|
|
43
|
+
* @author chitanda
|
|
44
|
+
* @date 2023-07-13 21:07:34
|
|
45
|
+
* @return {*} {Promise<IModalData>}
|
|
46
|
+
*/
|
|
47
|
+
onWillDismiss(): Promise<IModalData> {
|
|
48
|
+
if (!this.promise) {
|
|
49
|
+
this.promise = new Promise(resolve => {
|
|
50
|
+
this.resolve = resolve;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return this.promise.then(modal => {
|
|
54
|
+
ibiz.log.debug('onWillDismiss: ', this.from, this.to, modal);
|
|
55
|
+
return modal;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* 关闭视图
|
|
61
|
+
*
|
|
62
|
+
* @author chitanda
|
|
63
|
+
* @date 2023-07-13 21:07:06
|
|
64
|
+
* @param {IModalData} modal
|
|
65
|
+
*/
|
|
66
|
+
close(modal: IModalData): void {
|
|
67
|
+
ibiz.log.debug('closeRouter: ', this.from, this.to, modal);
|
|
68
|
+
if (this.resolve) {
|
|
69
|
+
this.resolve(modal);
|
|
70
|
+
this.resolve = undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 激活回调
|
|
76
|
+
*
|
|
77
|
+
* @author chitanda
|
|
78
|
+
* @date 2023-07-13 21:07:29
|
|
79
|
+
*/
|
|
80
|
+
active(): void {
|
|
81
|
+
ibiz.log.debug('activeRouter: ', this.from, this.to);
|
|
82
|
+
this.isActivated = true;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 销毁回调
|
|
87
|
+
*
|
|
88
|
+
* @author chitanda
|
|
89
|
+
* @date 2023-07-13 21:07:21
|
|
90
|
+
*/
|
|
91
|
+
destroy(): void {
|
|
92
|
+
ibiz.log.debug('destroyRouter: ', this.from, this.to);
|
|
93
|
+
if (this.resolve) {
|
|
94
|
+
this.resolve({ ok: false });
|
|
95
|
+
this.resolve = undefined;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|