@ibiz-template/vue3-components 0.5.7-alpha.6 → 0.6.0-alpha.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/dist/index-V5mBTTSl.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-TVsJdNUI.js → xlsx-util-GpIzYBZB.js} +1 -1
- package/es/_virtual/nprogress.mjs +3 -0
- package/es/common/action-toolbar/action-toolbar.d.ts +9 -0
- package/es/common/action-toolbar/action-toolbar.mjs +8 -1
- package/es/control/context-menu/context-menu.css +1 -1
- package/es/control/context-menu/context-menu.mjs +8 -2
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +26 -0
- package/es/control/dashboard/portlet/chart-portlet/chart-portlet.mjs +1 -1
- package/es/control/dashboard/portlet/list-portlet/list-portlet.mjs +1 -1
- package/es/control/form/form-detail/form-item/form-item.css +1 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.css +1 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +220 -0
- package/es/control/form/form-detail/form-rawitem/form-rawitem.css +1 -1
- package/es/control/form/form-detail/form-rawitem/form-rawitem.d.ts +1 -0
- package/es/control/form/form-detail/form-rawitem/form-rawitem.mjs +11 -4
- package/es/control/form/form-detail/form-rawitem/index.d.ts +1 -0
- package/es/control/grid/grid/grid.css +1 -1
- package/es/control/grid/grid/grid.mjs +10 -6
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +1 -0
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +5 -2
- package/es/control/grid/grid-column/grid-field-column/index.d.ts +1 -0
- package/es/control/grid/grid-column/grid-field-edit-column/grid-edit-item/grid-edit-item.css +1 -1
- package/es/control/search-bar/filter-mode-select/filter-mode-select.d.ts +5 -1
- package/es/control/search-bar/filter-mode-select/filter-mode-select.mjs +3 -1
- package/es/control/search-bar/filter-tree/filter-tree.mjs +14 -4
- package/es/control/search-bar/search-bar.mjs +1 -1
- package/es/editor/array/ibiz-array/ibiz-array.d.ts +1 -0
- package/es/editor/array/ibiz-array/ibiz-array.mjs +10 -3
- package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.css +1 -1
- package/es/editor/cascader/ibiz-cascader/ibiz-cascader.css +1 -1
- package/es/editor/check-box/ibiz-checkbox/ibiz-checkbox.css +1 -0
- package/es/editor/check-box/ibiz-checkbox/ibiz-checkbox.d.ts +2 -0
- package/es/editor/check-box/ibiz-checkbox/ibiz-checkbox.mjs +10 -2
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +1 -0
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +10 -3
- package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.css +1 -1
- package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.d.ts +1 -0
- package/es/editor/color-picker/ibiz-color-picker/ibiz-color-picker.mjs +10 -3
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.css +1 -1
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.css +1 -1
- package/es/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.css +1 -1
- package/es/editor/data-picker/ibiz-picker-link/ibiz-picker-link.css +1 -1
- package/es/editor/data-picker/ibiz-picker-link/ibiz-picker-link.d.ts +1 -0
- package/es/editor/data-picker/ibiz-picker-link/ibiz-picker-link.mjs +10 -3
- package/es/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/es/editor/date-picker/ibiz-date-picker/ibiz-date-picker.css +1 -1
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.css +1 -1
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +1 -1
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.css +1 -1
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.d.ts +1 -0
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +10 -3
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.d.ts +1 -0
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +9 -2
- package/es/editor/rate/ibiz-rate/ibiz-rate.css +1 -0
- package/es/editor/rate/ibiz-rate/ibiz-rate.d.ts +2 -0
- package/es/editor/rate/ibiz-rate/ibiz-rate.mjs +11 -3
- package/es/editor/raw/ibiz-raw/ibiz-raw.css +1 -1
- package/es/editor/raw/ibiz-raw/ibiz-raw.d.ts +1 -0
- package/es/editor/raw/ibiz-raw/ibiz-raw.mjs +10 -3
- package/es/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
- package/es/editor/slider/ibiz-slider/ibiz-slider.d.ts +1 -0
- package/es/editor/slider/ibiz-slider/ibiz-slider.mjs +10 -3
- package/es/editor/span/span/span.css +1 -1
- package/es/editor/span/span/span.d.ts +1 -0
- package/es/editor/span/span/span.mjs +10 -3
- package/es/editor/span/span-link/span-link.css +1 -1
- package/es/editor/span/span-link/span-link.d.ts +1 -0
- package/es/editor/span/span-link/span-link.mjs +10 -3
- package/es/editor/stepper/ibiz-stepper/ibiz-stepper.css +1 -0
- package/es/editor/stepper/ibiz-stepper/ibiz-stepper.d.ts +2 -0
- package/es/editor/stepper/ibiz-stepper/ibiz-stepper.mjs +11 -3
- package/es/editor/switch/ibiz-switch/ibiz-switch.css +1 -0
- package/es/editor/switch/ibiz-switch/ibiz-switch.d.ts +2 -0
- package/es/editor/switch/ibiz-switch/ibiz-switch.mjs +11 -3
- package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.css +1 -1
- package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.d.ts +1 -0
- package/es/editor/text-box/ibiz-input-ip/ibiz-input-ip.mjs +10 -3
- package/es/editor/text-box/ibiz-input-number/ibiz-input-number.css +1 -1
- package/es/editor/text-box/input/input.css +1 -1
- package/es/editor/text-box/input/input.mjs +1 -1
- package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
- package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.d.ts +1 -0
- package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.mjs +9 -2
- package/es/editor/upload/ibiz-image-preview/ibiz-image-preview.css +1 -1
- package/es/editor/upload/ibiz-image-preview/ibiz-image-preview.d.ts +1 -0
- package/es/editor/upload/ibiz-image-preview/ibiz-image-preview.mjs +10 -3
- package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.css +1 -1
- package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.d.ts +1 -0
- package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.mjs +9 -2
- package/es/ibiz-vue3.d.ts +5 -0
- package/es/ibiz-vue3.mjs +99 -0
- package/es/index.d.ts +1 -5
- package/es/index.mjs +43 -96
- package/es/node_modules/.pnpm/element-plus@2.4.2_vue@3.3.8/node_modules/element-plus/dist/locale/zh-cn.mjs +131 -0
- package/es/node_modules/.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.mjs +486 -0
- package/es/panel-component/panel-app-login-view/index.d.ts +1 -0
- package/es/panel-component/panel-app-login-view/panel-app-login-view.css +1 -1
- package/es/panel-component/panel-app-login-view/panel-app-login-view.d.ts +1 -0
- package/es/panel-component/panel-app-login-view/panel-app-login-view.mjs +18 -1
- package/es/panel-component/panel-button/index.d.ts +2 -0
- package/es/panel-component/panel-button/panel-button.d.ts +2 -0
- package/es/panel-component/panel-button/panel-button.mjs +12 -4
- package/es/panel-component/user-message/index.mjs +3 -16
- package/es/panel-component/user-message/internal-message/common/index.d.ts +3 -0
- package/es/panel-component/user-message/internal-message/common/index.mjs +5 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.css +1 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.d.ts +104 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.mjs +99 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.css +1 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.d.ts +29 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.mjs +81 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.d.ts +19 -0
- package/es/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.mjs +66 -0
- package/es/panel-component/user-message/internal-message/index.d.ts +2 -4
- package/es/panel-component/user-message/internal-message/index.mjs +35 -4
- package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.css +1 -0
- package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.d.ts +29 -0
- package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.mjs +42 -0
- package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.provider.d.ts +30 -0
- package/es/panel-component/user-message/internal-message/internal-message-html/internal-message-html.provider.mjs +30 -0
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -1
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.d.ts +10 -5
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.mjs +38 -28
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.d.ts +12 -11
- package/es/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.mjs +10 -35
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.css +1 -1
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.d.ts +4 -0
- package/es/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.mjs +41 -6
- package/es/panel-component/user-message/internal-message/internal-message-text/internal-message-text.css +1 -0
- package/es/panel-component/user-message/internal-message/internal-message-text/internal-message-text.d.ts +29 -0
- package/es/panel-component/user-message/internal-message/internal-message-text/internal-message-text.mjs +50 -0
- package/es/panel-component/user-message/internal-message/internal-message-text/internal-message-text.provider.d.ts +28 -0
- package/es/panel-component/user-message/internal-message/internal-message-text/internal-message-text.provider.mjs +19 -0
- package/es/panel-component/user-message/user-message.css +1 -1
- package/es/panel-component/user-message/user-message.mjs +10 -2
- package/es/util/app-drawer/app-drawer-component.mjs +14 -16
- package/es/util/app-modal/app-modal-component.mjs +12 -15
- package/es/util/notification-util/notification-util.mjs +1 -0
- package/es/util/open-view-util/open-view-util.mjs +10 -5
- package/es/view/404-view/404-view.css +1 -1
- package/es/view/404-view/404-view.d.ts +1 -1
- package/es/view/404-view/404-view.mjs +6 -5
- package/es/view/login-view/login-view.css +1 -1
- package/es/view/login-view/login-view.mjs +9 -1
- package/es/view-engine/edit-view.engine.d.ts +14 -0
- package/es/view-engine/edit-view.engine.mjs +90 -0
- package/es/web-app/App.css +1 -0
- package/es/web-app/App.d.ts +6 -0
- package/es/web-app/App.mjs +34 -0
- package/es/web-app/attach-environment-config.d.ts +1 -0
- package/es/web-app/attach-environment-config.mjs +51 -0
- package/es/web-app/components/index.d.ts +2 -0
- package/es/web-app/components/index.mjs +4 -0
- package/es/web-app/components/modal-router-shell/modal-router-shell.d.ts +13 -0
- package/es/web-app/components/modal-router-shell/modal-router-shell.mjs +119 -0
- package/es/web-app/components/router-shell/router-shell.d.ts +3864 -0
- package/es/web-app/components/router-shell/router-shell.mjs +106 -0
- package/es/web-app/create-vue-app.d.ts +13 -0
- package/es/web-app/create-vue-app.mjs +37 -0
- package/es/web-app/guard/auth-guard/auth-guard.d.ts +9 -0
- package/es/web-app/guard/auth-guard/auth-guard.mjs +169 -0
- package/es/web-app/guard/index.d.ts +1 -0
- package/es/web-app/guard/index.mjs +3 -0
- package/es/web-app/index.d.ts +1 -0
- package/es/web-app/index.mjs +3 -0
- package/es/web-app/main.d.ts +2 -0
- package/es/web-app/main.mjs +63 -0
- package/es/web-app/router/index.d.ts +6 -0
- package/es/web-app/router/index.mjs +200 -0
- package/es/web-app/util/index.d.ts +1 -0
- package/es/web-app/util/index.mjs +3 -0
- package/es/web-app/util/unauthorized-handler/unauthorized-handler.d.ts +46 -0
- package/es/web-app/util/unauthorized-handler/unauthorized-handler.mjs +107 -0
- package/lib/_virtual/nprogress.cjs +5 -0
- package/lib/common/action-toolbar/action-toolbar.cjs +8 -1
- package/lib/control/context-menu/context-menu.cjs +8 -2
- package/lib/control/context-menu/context-menu.css +1 -1
- package/lib/control/dashboard/portlet/chart-portlet/chart-portlet.cjs +1 -1
- package/lib/control/dashboard/portlet/list-portlet/list-portlet.cjs +1 -1
- package/lib/control/form/form-detail/form-item/form-item.css +1 -1
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.css +1 -1
- package/lib/control/form/form-detail/form-rawitem/form-rawitem.cjs +10 -3
- package/lib/control/form/form-detail/form-rawitem/form-rawitem.css +1 -1
- package/lib/control/grid/grid/grid.cjs +8 -4
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +5 -2
- package/lib/control/grid/grid-column/grid-field-edit-column/grid-edit-item/grid-edit-item.css +1 -1
- package/lib/control/search-bar/filter-mode-select/filter-mode-select.cjs +3 -1
- package/lib/control/search-bar/filter-tree/filter-tree.cjs +14 -4
- package/lib/control/search-bar/search-bar.cjs +1 -1
- package/lib/control/search-bar/search-groups/search-groups.cjs +2 -2
- package/lib/editor/array/ibiz-array/ibiz-array.cjs +9 -2
- package/lib/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.css +1 -1
- package/lib/editor/cascader/ibiz-cascader/ibiz-cascader.css +1 -1
- package/lib/editor/check-box/ibiz-checkbox/ibiz-checkbox.cjs +10 -2
- package/lib/editor/check-box/ibiz-checkbox/ibiz-checkbox.css +1 -0
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +9 -2
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.css +1 -1
- package/lib/editor/color-picker/ibiz-color-picker/ibiz-color-picker.cjs +9 -2
- package/lib/editor/color-picker/ibiz-color-picker/ibiz-color-picker.css +1 -1
- package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.css +1 -1
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.css +1 -1
- package/lib/editor/data-picker/ibiz-picker-dropdown/ibiz-picker-dropdown.css +1 -1
- package/lib/editor/data-picker/ibiz-picker-link/ibiz-picker-link.cjs +9 -2
- package/lib/editor/data-picker/ibiz-picker-link/ibiz-picker-link.css +1 -1
- package/lib/editor/data-picker/ibiz-picker-select-view/ibiz-picker-select-view.css +1 -1
- package/lib/editor/date-picker/ibiz-date-picker/ibiz-date-picker.css +1 -1
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +1 -1
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.css +1 -1
- package/lib/editor/html/wang-editor/wang-editor.cjs +2 -2
- package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +9 -2
- package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.css +1 -1
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +9 -2
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
- package/lib/editor/rate/ibiz-rate/ibiz-rate.cjs +10 -2
- package/lib/editor/rate/ibiz-rate/ibiz-rate.css +1 -0
- package/lib/editor/raw/ibiz-raw/ibiz-raw.cjs +9 -2
- package/lib/editor/raw/ibiz-raw/ibiz-raw.css +1 -1
- package/lib/editor/slider/ibiz-slider/ibiz-slider.cjs +9 -2
- package/lib/editor/slider/ibiz-slider/ibiz-slider.css +1 -1
- package/lib/editor/span/span/span.cjs +9 -2
- package/lib/editor/span/span/span.css +1 -1
- package/lib/editor/span/span-link/span-link.cjs +9 -2
- package/lib/editor/span/span-link/span-link.css +1 -1
- package/lib/editor/stepper/ibiz-stepper/ibiz-stepper.cjs +10 -2
- package/lib/editor/stepper/ibiz-stepper/ibiz-stepper.css +1 -0
- package/lib/editor/switch/ibiz-switch/ibiz-switch.cjs +10 -2
- package/lib/editor/switch/ibiz-switch/ibiz-switch.css +1 -0
- package/lib/editor/text-box/ibiz-input-ip/ibiz-input-ip.cjs +9 -2
- package/lib/editor/text-box/ibiz-input-ip/ibiz-input-ip.css +1 -1
- package/lib/editor/text-box/ibiz-input-number/ibiz-input-number.css +1 -1
- package/lib/editor/text-box/input/input.cjs +1 -1
- package/lib/editor/text-box/input/input.css +1 -1
- package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.cjs +9 -2
- package/lib/editor/upload/ibiz-file-upload/ibiz-file-upload.css +1 -1
- package/lib/editor/upload/ibiz-image-preview/ibiz-image-preview.cjs +9 -2
- package/lib/editor/upload/ibiz-image-preview/ibiz-image-preview.css +1 -1
- package/lib/editor/upload/ibiz-image-upload/ibiz-image-upload.cjs +9 -2
- package/lib/editor/upload/ibiz-image-upload/ibiz-image-upload.css +1 -1
- package/lib/ibiz-vue3.cjs +103 -0
- package/lib/index.cjs +143 -195
- package/lib/node_modules/.pnpm/element-plus@2.4.2_vue@3.3.8/node_modules/element-plus/dist/locale/zh-cn.cjs +135 -0
- package/lib/node_modules/.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.cjs +490 -0
- package/lib/panel-component/panel-app-login-view/panel-app-login-view.cjs +18 -1
- package/lib/panel-component/panel-app-login-view/panel-app-login-view.css +1 -1
- package/lib/panel-component/panel-button/panel-button.cjs +11 -3
- package/lib/panel-component/searchform-buttons/searchform-buttons.cjs +2 -2
- package/lib/panel-component/user-message/index.cjs +2 -15
- package/lib/panel-component/user-message/internal-message/common/index.cjs +11 -0
- package/lib/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.cjs +101 -0
- package/lib/panel-component/user-message/internal-message/common/internal-message-container/internal-message-container.css +1 -0
- package/lib/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.cjs +83 -0
- package/lib/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.css +1 -0
- package/lib/panel-component/user-message/internal-message/common/internal-message-default/internal-message-default.provider.cjs +68 -0
- package/lib/panel-component/user-message/internal-message/index.cjs +33 -7
- package/lib/panel-component/user-message/internal-message/internal-message-html/internal-message-html.cjs +44 -0
- package/lib/panel-component/user-message/internal-message/internal-message-html/internal-message-html.css +1 -0
- package/lib/panel-component/user-message/internal-message/internal-message-html/internal-message-html.provider.cjs +32 -0
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.cjs +37 -27
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.css +1 -1
- package/lib/panel-component/user-message/internal-message/internal-message-json/internal-message-json.provider.cjs +10 -35
- package/lib/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.cjs +40 -5
- package/lib/panel-component/user-message/internal-message/internal-message-tab/internal-message-tab.css +1 -1
- package/lib/panel-component/user-message/internal-message/internal-message-text/internal-message-text.cjs +52 -0
- package/lib/panel-component/user-message/internal-message/internal-message-text/internal-message-text.css +1 -0
- package/lib/panel-component/user-message/internal-message/internal-message-text/internal-message-text.provider.cjs +21 -0
- package/lib/panel-component/user-message/user-message.cjs +9 -1
- package/lib/panel-component/user-message/user-message.css +1 -1
- package/lib/util/app-drawer/app-drawer-component.cjs +13 -15
- package/lib/util/app-modal/app-modal-component.cjs +11 -14
- package/lib/util/confirm-util/confirm-util.cjs +5 -5
- package/lib/util/loading-util/loading-util.cjs +2 -2
- package/lib/util/message-util/message-util.cjs +5 -5
- package/lib/util/modal-util/modal-util.cjs +6 -6
- package/lib/util/notice-util/notice-util.cjs +3 -3
- package/lib/util/notification-util/notification-util.cjs +3 -2
- package/lib/util/open-view-util/open-view-util.cjs +10 -5
- package/lib/view/404-view/404-view.cjs +6 -5
- package/lib/view/404-view/404-view.css +1 -1
- package/lib/view/login-view/login-view.cjs +9 -1
- package/lib/view/login-view/login-view.css +1 -1
- package/lib/view-engine/edit-view.engine.cjs +90 -0
- package/lib/web-app/App.cjs +38 -0
- package/lib/web-app/App.css +1 -0
- package/lib/web-app/attach-environment-config.cjs +53 -0
- package/lib/web-app/components/index.cjs +9 -0
- package/lib/web-app/components/modal-router-shell/modal-router-shell.cjs +121 -0
- package/lib/web-app/components/router-shell/router-shell.cjs +108 -0
- package/lib/web-app/create-vue-app.cjs +39 -0
- package/lib/web-app/guard/auth-guard/auth-guard.cjs +171 -0
- package/lib/web-app/guard/index.cjs +7 -0
- package/lib/web-app/index.cjs +7 -0
- package/lib/web-app/main.cjs +65 -0
- package/lib/web-app/router/index.cjs +202 -0
- package/lib/web-app/util/index.cjs +7 -0
- package/lib/web-app/util/unauthorized-handler/unauthorized-handler.cjs +109 -0
- package/package.json +10 -6
- package/dist/index-CzVC8rhd.js +0 -1
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +0 -1
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.d.ts +0 -17
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.mjs +0 -83
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.d.ts +0 -22
- package/es/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.mjs +0 -23
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.cjs +0 -85
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.css +0 -1
- package/lib/panel-component/user-message/internal-message/internal-message-default/internal-message-default.provider.cjs +0 -25
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ref, toRaw, onUnmounted, watch, onActivated, onDeactivated, Fragment, resolveComponent, h, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { parseRouteViewData } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { useRoute, useRouter } from 'vue-router';
|
|
4
|
+
import { ViewMode, Modal, RouteConst } from '@ibiz-template/runtime';
|
|
5
|
+
import { IBizContext } from '@ibiz-template/core';
|
|
6
|
+
import { mergeDeepLeft } from 'ramda';
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
const RouterShell = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "RouterShell",
|
|
11
|
+
props: {
|
|
12
|
+
modal: {
|
|
13
|
+
type: Object,
|
|
14
|
+
required: true
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(props) {
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const router = useRouter();
|
|
20
|
+
const viewData = ref({});
|
|
21
|
+
const isLoaded = ref(false);
|
|
22
|
+
const isActivated = ref(true);
|
|
23
|
+
const destroyContext = () => {
|
|
24
|
+
if (viewData.value.context) {
|
|
25
|
+
const {
|
|
26
|
+
context
|
|
27
|
+
} = toRaw(viewData.value);
|
|
28
|
+
if (context)
|
|
29
|
+
context.destroy();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const routeDepth = props.modal.routeDepth;
|
|
33
|
+
onUnmounted(() => {
|
|
34
|
+
destroyContext();
|
|
35
|
+
});
|
|
36
|
+
const calcViewData = async () => {
|
|
37
|
+
try {
|
|
38
|
+
const _viewData = await parseRouteViewData(route, routeDepth);
|
|
39
|
+
const _context = IBizContext.create(_viewData.context);
|
|
40
|
+
viewData.value = {
|
|
41
|
+
..._viewData,
|
|
42
|
+
context: _context
|
|
43
|
+
};
|
|
44
|
+
isLoaded.value = true;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
router.push({
|
|
47
|
+
name: "404View".concat(routeDepth)
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
calcViewData();
|
|
52
|
+
watch(() => route.params.view1, () => {
|
|
53
|
+
if (routeDepth === 1) {
|
|
54
|
+
destroyContext();
|
|
55
|
+
calcViewData();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const routeModal = new Modal({
|
|
59
|
+
mode: ViewMode.ROUTE,
|
|
60
|
+
routeDepth: routeDepth + 1
|
|
61
|
+
});
|
|
62
|
+
onActivated(() => {
|
|
63
|
+
isActivated.value = true;
|
|
64
|
+
});
|
|
65
|
+
onDeactivated(() => {
|
|
66
|
+
isActivated.value = false;
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
routeModal,
|
|
70
|
+
route,
|
|
71
|
+
viewData,
|
|
72
|
+
isLoaded,
|
|
73
|
+
isActivated
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
render() {
|
|
77
|
+
if (!this.isLoaded) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const {
|
|
81
|
+
context,
|
|
82
|
+
params,
|
|
83
|
+
srfnav,
|
|
84
|
+
viewModel
|
|
85
|
+
} = this.viewData;
|
|
86
|
+
const props = mergeDeepLeft({
|
|
87
|
+
...this.$props,
|
|
88
|
+
...this.$attrs,
|
|
89
|
+
context,
|
|
90
|
+
params,
|
|
91
|
+
modelData: viewModel,
|
|
92
|
+
key: viewModel.codeName
|
|
93
|
+
}, {
|
|
94
|
+
state: {
|
|
95
|
+
srfnav
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return createVNode(Fragment, null, [h(resolveComponent("IBizViewShell"), props, this.$slots), this.isActivated && createVNode(resolveComponent("router-view"), {
|
|
99
|
+
"key": viewModel.codeName,
|
|
100
|
+
"name": RouteConst.ROUTE_MODAL_TAG,
|
|
101
|
+
"modal": this.routeModal
|
|
102
|
+
}, null)]);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export { RouterShell };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { App, Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 创建 vue3 实例,避免多实例情况下全局方法未成功挂载
|
|
4
|
+
*
|
|
5
|
+
* @author chitanda
|
|
6
|
+
* @date 2024-02-04 15:02:54
|
|
7
|
+
* @export
|
|
8
|
+
* @param {Component} rootComponent
|
|
9
|
+
* @param {IData} [rootProps]
|
|
10
|
+
* @param {Plugin[]} [plugins]
|
|
11
|
+
* @return {*} {App<Element>}
|
|
12
|
+
*/
|
|
13
|
+
export declare function createVueApp(rootComponent: Component, rootProps?: IData): App<Element>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createApp, KeepAlive } from 'vue';
|
|
2
|
+
import ElementPlus from 'element-plus';
|
|
3
|
+
import zhCn from '../node_modules/.pnpm/element-plus@2.4.2_vue@3.3.8/node_modules/element-plus/dist/locale/zh-cn.mjs';
|
|
4
|
+
import { AppHooks, piniaInstance } from '@ibiz-template/vue3-util';
|
|
5
|
+
import IBizVue3 from '../ibiz-vue3.mjs';
|
|
6
|
+
import { i18n } from '../locale/index.mjs';
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
function createVueApp(rootComponent, rootProps) {
|
|
10
|
+
const app = createApp(rootComponent, rootProps);
|
|
11
|
+
app.component("KeepAlive", KeepAlive);
|
|
12
|
+
app.config.errorHandler = function(err) {
|
|
13
|
+
ibiz.util.error.handle(err);
|
|
14
|
+
};
|
|
15
|
+
const installPlugin = (_, plugin) => {
|
|
16
|
+
app.use(plugin);
|
|
17
|
+
};
|
|
18
|
+
AppHooks.useComponent.tap(installPlugin);
|
|
19
|
+
if (rootProps) {
|
|
20
|
+
const oldUnMounted = rootProps.unmounted;
|
|
21
|
+
rootProps.unmounted = () => {
|
|
22
|
+
oldUnMounted();
|
|
23
|
+
AppHooks.useComponent.removeTap(installPlugin);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
app.use(i18n);
|
|
27
|
+
app.use(ElementPlus, {
|
|
28
|
+
locale: zhCn
|
|
29
|
+
});
|
|
30
|
+
app.use(piniaInstance);
|
|
31
|
+
app.use(IBizVue3);
|
|
32
|
+
AppHooks.createApp.callSync(null, app);
|
|
33
|
+
ibiz.plugin.register(app);
|
|
34
|
+
return app;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { createVueApp };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { HttpError, RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { ModelHelper } from '@ibiz-template/model-helper';
|
|
3
|
+
import { mergeDeepRight } from 'ramda';
|
|
4
|
+
import { AppHooks } from '@ibiz-template/vue3-util';
|
|
5
|
+
import { i18n } from '../../../locale/index.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
async function loadAppData() {
|
|
9
|
+
const res = await ibiz.net.get("/appdata");
|
|
10
|
+
if (res.ok) {
|
|
11
|
+
ibiz.appData = res.data;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function loadOrgData() {
|
|
15
|
+
const res = await ibiz.net.get("/uaa/getbydcsystem/".concat(ibiz.env.dcSystem));
|
|
16
|
+
if (res.ok) {
|
|
17
|
+
const orgDataItems = res.data;
|
|
18
|
+
if (orgDataItems) {
|
|
19
|
+
const [data] = orgDataItems;
|
|
20
|
+
ibiz.orgData = data;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function loadTheme() {
|
|
25
|
+
const app = ibiz.hub.getApp();
|
|
26
|
+
const uiThemes = app.model.appUIThemes || [];
|
|
27
|
+
if (uiThemes.length > 0) {
|
|
28
|
+
const theme = uiThemes[0];
|
|
29
|
+
await ibiz.util.theme.loadTheme(theme);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function initEnvironment(helper) {
|
|
33
|
+
if (helper) {
|
|
34
|
+
const app = await helper.getAppModel();
|
|
35
|
+
const userParam = app.userParam;
|
|
36
|
+
if (userParam) {
|
|
37
|
+
Object.keys(userParam).forEach((key) => {
|
|
38
|
+
const value = ibiz.util.rawValue.format(userParam[key]);
|
|
39
|
+
const keys = key.split(".");
|
|
40
|
+
let currentObj = ibiz.env;
|
|
41
|
+
for (let i = 0; i < keys.length; i++) {
|
|
42
|
+
const k = keys[i];
|
|
43
|
+
if (i === keys.length - 1) {
|
|
44
|
+
currentObj[k] = value;
|
|
45
|
+
} else {
|
|
46
|
+
currentObj[k] = currentObj[k] || {};
|
|
47
|
+
currentObj = currentObj[k];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (ibiz.env.globalConfig) {
|
|
52
|
+
ibiz.config = mergeDeepRight(ibiz.config, ibiz.env.globalConfig);
|
|
53
|
+
}
|
|
54
|
+
ibiz.log.setLevel(ibiz.env.logLevel);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
let hasModelInit = false;
|
|
59
|
+
let noPermissionModel = false;
|
|
60
|
+
async function initModel(permission = true) {
|
|
61
|
+
if (!hasModelInit || hasModelInit && noPermissionModel !== permission) {
|
|
62
|
+
ibiz.hub.reset();
|
|
63
|
+
const helper = new ModelHelper(
|
|
64
|
+
async (url, params) => {
|
|
65
|
+
const res = await ibiz.net.get(
|
|
66
|
+
"".concat(ibiz.env.remoteModelUrl).concat(url),
|
|
67
|
+
params,
|
|
68
|
+
permission ? {} : { srfdcsystem: ibiz.env.dcSystem }
|
|
69
|
+
);
|
|
70
|
+
return res.data;
|
|
71
|
+
},
|
|
72
|
+
ibiz.env.appId,
|
|
73
|
+
permission
|
|
74
|
+
);
|
|
75
|
+
await initEnvironment(helper);
|
|
76
|
+
const app = await ibiz.hub.getAppAsync(ibiz.env.appId);
|
|
77
|
+
const appModel = app.model;
|
|
78
|
+
ibiz.env.isMob = appModel.mobileApp === true;
|
|
79
|
+
if (ibiz.env.isEnableMultiLan) {
|
|
80
|
+
const lang = ibiz.i18n.getLang();
|
|
81
|
+
const m = await helper.getPSAppLang(lang.replace("-", "_").toUpperCase());
|
|
82
|
+
const items = m.languageItems || [];
|
|
83
|
+
const data = {};
|
|
84
|
+
items.forEach((item) => {
|
|
85
|
+
data[item.lanResTag] = item.content;
|
|
86
|
+
});
|
|
87
|
+
i18n.global.mergeLocaleMessage(lang, data);
|
|
88
|
+
}
|
|
89
|
+
if (!appModel.appUIThemes) {
|
|
90
|
+
const module = await import('@ibiz-template/web-theme');
|
|
91
|
+
const theme = module.default || module;
|
|
92
|
+
AppHooks.useComponent.callSync(null, theme);
|
|
93
|
+
} else {
|
|
94
|
+
await loadTheme();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
noPermissionModel = permission;
|
|
98
|
+
hasModelInit = true;
|
|
99
|
+
}
|
|
100
|
+
async function appInit() {
|
|
101
|
+
if (ibiz.env.isSaaSMode === true) {
|
|
102
|
+
await loadOrgData();
|
|
103
|
+
}
|
|
104
|
+
await loadAppData();
|
|
105
|
+
await initModel();
|
|
106
|
+
await ibiz.auth.extendLogin();
|
|
107
|
+
await ibiz.hub.notice.init();
|
|
108
|
+
}
|
|
109
|
+
function throw401() {
|
|
110
|
+
throw new HttpError({
|
|
111
|
+
response: {
|
|
112
|
+
status: 401,
|
|
113
|
+
statusText: "\u65E0\u6743\u9650\u8BBF\u95EE\uFF01"
|
|
114
|
+
}
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
async function anonymousValidate() {
|
|
119
|
+
const authInfo = ibiz.auth.getAuthInfo();
|
|
120
|
+
if (authInfo && !authInfo.isAnonymous) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
await initModel(false);
|
|
124
|
+
const urlPaths = window.location.hash.split("/");
|
|
125
|
+
const viewName = urlPaths[urlPaths.length - 2];
|
|
126
|
+
let viewModel;
|
|
127
|
+
if (viewName !== "#") {
|
|
128
|
+
try {
|
|
129
|
+
viewModel = await ibiz.hub.getAppView(viewName);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
ibiz.log.error(error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (!viewModel) {
|
|
135
|
+
ibiz.log.error(
|
|
136
|
+
"\u627E\u4E0D\u5230\u89C6\u56FE\u6A21\u578B".concat(viewName, ",\u8BF7\u786E\u4FDD\u8BE5\u89C6\u56FE\u914D\u7F6E\u4E86\u533F\u540D\u8BBF\u95EE\u548C\u7528\u6237\u5F15\u7528")
|
|
137
|
+
);
|
|
138
|
+
throw401();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (viewModel.accUserMode !== 3) {
|
|
142
|
+
throw401();
|
|
143
|
+
}
|
|
144
|
+
if (!authInfo) {
|
|
145
|
+
const loginResult = await ibiz.auth.anonymousLogin();
|
|
146
|
+
if (!loginResult) {
|
|
147
|
+
throw new RuntimeError("\u533F\u540D\u7528\u6237\u767B\u5F55\u5931\u8D25");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async function AuthGuard(notLogin = true) {
|
|
152
|
+
if (notLogin) {
|
|
153
|
+
let result = true;
|
|
154
|
+
try {
|
|
155
|
+
if (ibiz.env.enableAnonymous) {
|
|
156
|
+
await anonymousValidate();
|
|
157
|
+
}
|
|
158
|
+
await appInit();
|
|
159
|
+
} catch (error) {
|
|
160
|
+
result = false;
|
|
161
|
+
ibiz.util.error.handle(error);
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
await initModel(false);
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export { AuthGuard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AuthGuard } from './auth-guard/auth-guard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runApp } from './main';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { install } from '@ibiz-template/core';
|
|
2
|
+
import { install as install$1 } from '@ibiz-template/runtime';
|
|
3
|
+
import { AppHooks, PluginFactory, OverlayContainer } from '@ibiz-template/vue3-util';
|
|
4
|
+
import { createVueApp } from './create-vue-app.mjs';
|
|
5
|
+
import { attachEnvironmentConfig } from './attach-environment-config.mjs';
|
|
6
|
+
import App from './App.mjs';
|
|
7
|
+
import './util/index.mjs';
|
|
8
|
+
import { AppRouter } from './router/index.mjs';
|
|
9
|
+
import '../util/index.mjs';
|
|
10
|
+
import { OpenViewUtil } from '../util/open-view-util/open-view-util.mjs';
|
|
11
|
+
import { MessageUtil } from '../util/message-util/message-util.mjs';
|
|
12
|
+
import { ModalUtil } from '../util/modal-util/modal-util.mjs';
|
|
13
|
+
import { ConfirmUtil } from '../util/confirm-util/confirm-util.mjs';
|
|
14
|
+
import { NotificationUtil } from '../util/notification-util/notification-util.mjs';
|
|
15
|
+
import { LoadingUtil } from '../util/loading-util/loading-util.mjs';
|
|
16
|
+
import { NoticeUtil } from '../util/notice-util/notice-util.mjs';
|
|
17
|
+
import { OverlayController } from '../util/overlay-controller/overlay-controller.mjs';
|
|
18
|
+
import { UnauthorizedHandler } from './util/unauthorized-handler/unauthorized-handler.mjs';
|
|
19
|
+
|
|
20
|
+
"use strict";
|
|
21
|
+
async function runApp(plugins) {
|
|
22
|
+
AppHooks.createApp.tap((_, app2) => {
|
|
23
|
+
if (plugins) {
|
|
24
|
+
plugins.forEach((plugin) => {
|
|
25
|
+
app2.use(plugin);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
install();
|
|
30
|
+
install$1();
|
|
31
|
+
ibiz.plugin = new PluginFactory();
|
|
32
|
+
const app = createVueApp(App);
|
|
33
|
+
OverlayContainer.createVueApp = createVueApp;
|
|
34
|
+
window.onerror = function(_event, _source, _lineno, _colno, error) {
|
|
35
|
+
if (error) {
|
|
36
|
+
ibiz.util.error.handle(error);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
window.addEventListener("unhandledrejection", function(event) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
event.promise.catch((err) => {
|
|
42
|
+
ibiz.util.error.handle(err);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
await attachEnvironmentConfig();
|
|
46
|
+
app.use(AppRouter.getRouter());
|
|
47
|
+
ibiz.openView = new OpenViewUtil(AppRouter.getRouter());
|
|
48
|
+
ibiz.message = new MessageUtil();
|
|
49
|
+
ibiz.modal = new ModalUtil();
|
|
50
|
+
ibiz.confirm = new ConfirmUtil();
|
|
51
|
+
ibiz.notification = new NotificationUtil();
|
|
52
|
+
ibiz.loading = new LoadingUtil();
|
|
53
|
+
ibiz.notice = new NoticeUtil();
|
|
54
|
+
ibiz.overlay = new OverlayController();
|
|
55
|
+
ibiz.util.text.format = (value, code) => {
|
|
56
|
+
return app.config.globalProperties.$textFormat(value, code);
|
|
57
|
+
};
|
|
58
|
+
ibiz.util.error.register(new UnauthorizedHandler());
|
|
59
|
+
await ibiz.i18n.init();
|
|
60
|
+
app.mount("#app");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { runApp };
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { createWebHashHistory, createRouter } from 'vue-router';
|
|
2
|
+
import { AppRedirectView } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { RouteConst } from '@ibiz-template/runtime';
|
|
4
|
+
import NProgress from '../../node_modules/.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.mjs';
|
|
5
|
+
import '../guard/index.mjs';
|
|
6
|
+
import '../../view/index.mjs';
|
|
7
|
+
import '../components/index.mjs';
|
|
8
|
+
import 'nprogress/nprogress.css';
|
|
9
|
+
import { AuthGuard } from '../guard/auth-guard/auth-guard.mjs';
|
|
10
|
+
import { LoginView } from '../../view/login-view/login-view.mjs';
|
|
11
|
+
import { View404 } from '../../view/404-view/404-view.mjs';
|
|
12
|
+
import { RouterShell } from '../components/router-shell/router-shell.mjs';
|
|
13
|
+
import { ModalRouterShell } from '../components/modal-router-shell/modal-router-shell.mjs';
|
|
14
|
+
|
|
15
|
+
"use strict";
|
|
16
|
+
var __defProp = Object.defineProperty;
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __publicField = (obj, key, value) => {
|
|
19
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20
|
+
return value;
|
|
21
|
+
};
|
|
22
|
+
class AppRouter {
|
|
23
|
+
static getRouter() {
|
|
24
|
+
const placeholder = ibiz.env.routePlaceholder;
|
|
25
|
+
const paramReg = "[^/]+=[^/]+|".concat(placeholder);
|
|
26
|
+
const viewReg = "[^=/]+";
|
|
27
|
+
if (!this.router) {
|
|
28
|
+
this.router = createRouter({
|
|
29
|
+
// 4. 内部提供了 history 模式的实现。为了简单起见,我们在这里使用 hash 模式。
|
|
30
|
+
history: createWebHashHistory(),
|
|
31
|
+
routes: [
|
|
32
|
+
{
|
|
33
|
+
path: "/",
|
|
34
|
+
redirect: "/".concat(placeholder, "/index/").concat(placeholder)
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: "/login",
|
|
38
|
+
name: "loginView",
|
|
39
|
+
beforeEnter: async (_to, _from, next) => {
|
|
40
|
+
await AuthGuard(false);
|
|
41
|
+
next();
|
|
42
|
+
},
|
|
43
|
+
component: LoginView
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
path: "/404",
|
|
47
|
+
name: "404View1",
|
|
48
|
+
component: View404
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: "/appredirectview",
|
|
52
|
+
name: "appRedirectView",
|
|
53
|
+
beforeEnter: async (_to, _from, next) => {
|
|
54
|
+
const authority = await AuthGuard();
|
|
55
|
+
if (authority) {
|
|
56
|
+
next();
|
|
57
|
+
} else {
|
|
58
|
+
next(false);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
component: AppRedirectView
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
path: "/:appContext(".concat(paramReg, ")/:view1(").concat(viewReg, ")/:params1(").concat(paramReg, ")"),
|
|
65
|
+
beforeEnter: async (_to, _from, next) => {
|
|
66
|
+
const authority = await AuthGuard();
|
|
67
|
+
if (authority) {
|
|
68
|
+
next();
|
|
69
|
+
} else {
|
|
70
|
+
next(false);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
component: RouterShell,
|
|
74
|
+
children: [
|
|
75
|
+
{
|
|
76
|
+
path: "404",
|
|
77
|
+
name: "404View2",
|
|
78
|
+
component: View404
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
82
|
+
components: {
|
|
83
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
path: ":view2(".concat(viewReg, ")/:params2(").concat(paramReg, ")"),
|
|
88
|
+
component: RouterShell,
|
|
89
|
+
children: [
|
|
90
|
+
{
|
|
91
|
+
path: "404",
|
|
92
|
+
name: "404View3",
|
|
93
|
+
component: View404
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
97
|
+
components: {
|
|
98
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
path: ":view3(".concat(viewReg, ")/:params3(").concat(paramReg, ")"),
|
|
103
|
+
component: RouterShell,
|
|
104
|
+
children: [
|
|
105
|
+
{
|
|
106
|
+
path: "404",
|
|
107
|
+
name: "404View4",
|
|
108
|
+
component: View404
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
112
|
+
components: {
|
|
113
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
path: ":view4(".concat(viewReg, ")/:params4(").concat(paramReg, ")"),
|
|
118
|
+
component: RouterShell,
|
|
119
|
+
children: [
|
|
120
|
+
{
|
|
121
|
+
path: "404",
|
|
122
|
+
name: "404View5",
|
|
123
|
+
component: View404
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
127
|
+
components: {
|
|
128
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
path: ":view5(".concat(viewReg, ")/:params5(").concat(paramReg, ")"),
|
|
133
|
+
component: RouterShell,
|
|
134
|
+
children: [
|
|
135
|
+
{
|
|
136
|
+
path: "404",
|
|
137
|
+
name: "404View6",
|
|
138
|
+
component: View404
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
path: "".concat(RouteConst.ROUTE_MODAL_TAG, "/:modalView(").concat(viewReg, ")/:modalParams(").concat(paramReg, ")"),
|
|
142
|
+
components: {
|
|
143
|
+
[RouteConst.ROUTE_MODAL_TAG]: ModalRouterShell
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
path: ":view6(".concat(viewReg, ")/:params6(").concat(paramReg, ")"),
|
|
148
|
+
component: RouterShell
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
path: ":pathMatch(.*)*",
|
|
152
|
+
redirect: { name: "404View6" }
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
path: ":pathMatch(.*)*",
|
|
158
|
+
redirect: { name: "404View6" }
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
path: ":pathMatch(.*)*",
|
|
164
|
+
redirect: { name: "404View4" }
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
path: ":pathMatch(.*)*",
|
|
170
|
+
redirect: { name: "404View3" }
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
path: ":pathMatch(.*)*",
|
|
176
|
+
redirect: { name: "404View2" }
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
path: "/:pathMatch(.*)*",
|
|
182
|
+
redirect: { name: "404View1" }
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
});
|
|
186
|
+
this.router.beforeEach((_to, _from, next) => {
|
|
187
|
+
NProgress.configure({ showSpinner: false });
|
|
188
|
+
NProgress.start();
|
|
189
|
+
next();
|
|
190
|
+
});
|
|
191
|
+
this.router.afterEach(() => {
|
|
192
|
+
NProgress.done();
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return this.router;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
__publicField(AppRouter, "router");
|
|
199
|
+
|
|
200
|
+
export { AppRouter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UnauthorizedHandler } from './unauthorized-handler/unauthorized-handler';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IErrorHandler } from '@ibiz-template/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* 没有权限的错误处理器
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-11 14:10:10
|
|
7
|
+
* @export
|
|
8
|
+
* @class UnauthorizedHandler
|
|
9
|
+
*/
|
|
10
|
+
export declare class UnauthorizedHandler implements IErrorHandler {
|
|
11
|
+
match(error: unknown): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* cas登录处理
|
|
14
|
+
*
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2022-10-11 14:10:35
|
|
17
|
+
* @protected
|
|
18
|
+
* @returns {*} {Promise<void>}
|
|
19
|
+
*/
|
|
20
|
+
protected casLogin(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* 普通登录处理
|
|
23
|
+
*
|
|
24
|
+
* @author lxm
|
|
25
|
+
* @date 2022-10-11 14:10:24
|
|
26
|
+
* @protected
|
|
27
|
+
* @returns {*} {Promise<void>}
|
|
28
|
+
*/
|
|
29
|
+
protected normalLogin(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* 处理403
|
|
32
|
+
* @author lxm
|
|
33
|
+
* @date 2023-12-06 10:19:12
|
|
34
|
+
* @protected
|
|
35
|
+
* @return {*} {Promise<void>}
|
|
36
|
+
*/
|
|
37
|
+
protected handle403(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* 没有权限处理
|
|
40
|
+
*
|
|
41
|
+
* @author lxm
|
|
42
|
+
* @date 2022-10-11 14:10:50
|
|
43
|
+
* @returns {*} {Promise<void>}
|
|
44
|
+
*/
|
|
45
|
+
handle(error: unknown): boolean | undefined;
|
|
46
|
+
}
|