new file: LICENSE new file: README.md new file: WMS_PDA.code-workspace new file: common/api.js new file: common/config.js new file: common/demo.scss new file: common/mixin.js new file: common/props.js new file: components/BluetoothDeviceSelector/BluetoothDeviceSelector.vue new file: components/BluetoothPrint/BluetoothPrint.vue new file: components/PrintPanel/PrintPanel.vue new file: components/WorkbenchPrint/WorkbenchPrint.vue new file: components/demo-com/demo-com.vue new file: components/inputAndSelect/inputAndSelect.vue new file: components/page-nav/page-nav.vue new file: components/pagination/pagination.vue new file: components/space-list/space-list.vue new file: components/uploadImgCos/uploadImgCos.vue new file: core/index.js new file: core/mixins/index.js new file: core/request/apis.js new file: core/request/index.js new file: core/request/request.js new file: core/router/index.js new file: core/router/uni-simple-router.js new file: core/store/index.js new file: core/store/modules/bluetoothPrint.js new file: core/store/modules/broadcast.js new file: core/store/modules/floatWindowManager.js new file: core/store/modules/print.js new file: core/store/modules/setting.js new file: core/store/modules/user.js new file: core/utils/auth.js new file: core/utils/base64.js new file: core/utils/broadcast.js new file: core/utils/dpi-converter.js new file: core/utils/encoding-indexes.js new file: core/utils/encoding.js new file: core/utils/floatWindowManager.js new file: core/utils/simpleFloat.js new file: core/utils/tool.js new file: core/utils/tsc.js new file: env.js new file: main.js new file: manifest.json new file: package.json new file: pages.json new file: pages/403.vue new file: pages/404.vue new file: pages/componentsA/backtop/backtop.nvue new file: pages/componentsA/button/button.nvue new file: pages/componentsA/cell/cell.nvue new file: pages/componentsA/checkbox/checkbox.nvue new file: pages/componentsA/divider/divider.nvue new file: pages/componentsA/empty/empty.nvue new file: pages/componentsA/gap/gap.nvue new file: pages/componentsA/grid/grid.nvue new file: pages/componentsA/icon/icon.nvue new file: pages/componentsA/image/image.nvue new file: pages/componentsA/line/line.nvue new file: pages/componentsA/link/link.nvue new file: pages/componentsA/loading-icon/loading-icon.nvue new file: pages/componentsA/loading-page/loading-page.nvue new file: pages/componentsA/overlay/overlay.nvue new file: pages/componentsA/popup/popup.nvue new file: pages/componentsA/radio/radio.nvue new file: pages/componentsA/rate/rate.nvue new file: pages/componentsA/sticky/sticky.nvue new file: pages/componentsA/swipeAction/swipeAction.nvue new file: pages/componentsA/test/test.vue new file: pages/componentsA/transition/transition.nvue new file: pages/componentsB/actionSheet/actionSheet.nvue new file: pages/componentsB/alert/alert.nvue new file: pages/componentsB/badge/badge.nvue new file: pages/componentsB/code/code.nvue new file: pages/componentsB/collapse/collapse.nvue new file: pages/componentsB/color/color.nvue new file: pages/componentsB/countDown/countDown.nvue new file: pages/componentsB/countTo/countTo.nvue new file: pages/componentsB/dropdown/dropdown.nvue new file: pages/componentsB/keyboard/keyboard.nvue new file: pages/componentsB/noticeBar/noticeBar.nvue new file: pages/componentsB/notify/notify.nvue new file: pages/componentsB/numberBox/numberBox.nvue new file: pages/componentsB/parse/content.js new file: pages/componentsB/parse/jump.vue new file: pages/componentsB/parse/parse.nvue new file: pages/componentsB/progress/progress.nvue new file: pages/componentsB/search/search.nvue new file: pages/componentsB/slider/slider.nvue new file: pages/componentsB/switch/switch.nvue new file: pages/componentsB/tabbar/tabbar.nvue new file: pages/componentsB/tag/tag.nvue new file: pages/componentsB/toast/toast.nvue new file: pages/componentsB/upload/upload.nvue new file: pages/componentsC/album/album.nvue new file: pages/componentsC/avatar/avatar.nvue new file: pages/componentsC/calendar/calendar.nvue new file: pages/componentsC/codeInput/codeInput.nvue new file: pages/componentsC/datetimePicker/datetimePicker.nvue new file: pages/componentsC/form/form.nvue new file: pages/componentsC/indexList/indexList.nvue new file: pages/componentsC/input/input.nvue new file: pages/componentsC/layout/layout.nvue new file: pages/componentsC/list/list.nvue new file: pages/componentsC/loadmore/loadmore.nvue new file: pages/componentsC/modal/modal.nvue new file: pages/componentsC/navbar/navbar.nvue new file: pages/componentsC/noNetwork/noNetwork.nvue new file: pages/componentsC/picker/picker.nvue new file: pages/componentsC/readMore/readMore.nvue new file: pages/componentsC/scrollList/scrollList.nvue new file: pages/componentsC/skeleton/skeleton.nvue new file: pages/componentsC/steps/steps.vue new file: pages/componentsC/subsection/subsection.nvue new file: pages/componentsC/swiper/swiper.nvue new file: pages/componentsC/table/table.nvue new file: pages/componentsC/tabs/tabs.nvue new file: pages/componentsC/text/text.nvue new file: pages/componentsC/textarea/textarea.nvue new file: pages/componentsC/tooltip/tooltip.vue new file: pages/index/index.vue new file: pages/login/index.vue new file: pages/message/index.vue new file: pages/oa/index.vue new file: pages/settings/broadcastSettings.vue new file: pages/settings/index.vue new file: pages/settings/networkTest.vue new file: pages/user/index.vue new file: pages/work/index.vue new file: pages/work/storage/receiving/components/ProductInfoEditor.vue new file: pages/work/storage/receiving/components/detail-container.vue new file: pages/work/storage/receiving/components/info-container.vue new file: pages/work/storage/receiving/components/stockList.vue new file: pages/work/storage/receiving/receiving.vue new file: pages/work/storage/receiving/receivingCreate.vue new file: pages/work/storage/receiving/receivingDetail.vue new file: pages/work/storage/receiving/receivingList.vue new file: pages/work/storage/relocation.vue new file: static/app-plus/mp-html/js/handler.js new file: static/app-plus/mp-html/js/uni.webview.min.js new file: static/app-plus/mp-html/local.html new file: static/common/js/touch-emulator.js new file: static/icon/index.png new file: static/icon/index_a.png new file: static/icon/mime.png new file: static/icon/mime_a.png new file: static/icon/oa.png new file: static/icon/oa_a.png new file: static/loginbg.jpg new file: template.h5.html new file: tree.md new file: uni.scss new file: uni_modules/uni-read-pages/README.md new file: uni_modules/uni-read-pages/index.js new file: uni_modules/uni-read-pages/package.json new file: uni_modules/uni-simple-router/.eslintignore new file: uni_modules/uni-simple-router/.eslintrc.js new file: uni_modules/uni-simple-router/.github/ISSUE_TEMPLATE/bug_report.md new file: uni_modules/uni-simple-router/.github/ISSUE_TEMPLATE/feature_request.md new file: uni_modules/uni-simple-router/CODE_OF_CONDUCT.md new file: uni_modules/uni-simple-router/LICENSE new file: uni_modules/uni-simple-router/README.md new file: uni_modules/uni-simple-router/RFC.md new file: uni_modules/uni-simple-router/api-extractor.json new file: uni_modules/uni-simple-router/dist/link.vue new file: uni_modules/uni-simple-router/dist/uni-simple-router.d.ts new file: uni_modules/uni-simple-router/dist/uni-simple-router.js new file: uni_modules/uni-simple-router/github.sh new file: uni_modules/uni-simple-router/jest.config.js new file: uni_modules/uni-simple-router/package.json new file: uni_modules/uni-simple-router/progress.md new file: uni_modules/uni-simple-router/src/H5/buildRouter.ts new file: uni_modules/uni-simple-router/src/H5/proxyHook.ts new file: uni_modules/uni-simple-router/src/app/appPatch.ts new file: uni_modules/uni-simple-router/src/applets/appletPatch.ts new file: uni_modules/uni-simple-router/src/component/link.vue new file: uni_modules/uni-simple-router/src/global.d.ts new file: uni_modules/uni-simple-router/src/helpers/config.ts new file: uni_modules/uni-simple-router/src/helpers/createRouteMap.ts new file: uni_modules/uni-simple-router/src/helpers/lifeCycle.ts new file: uni_modules/uni-simple-router/src/helpers/mixins.ts new file: uni_modules/uni-simple-router/src/helpers/utils.ts new file: uni_modules/uni-simple-router/src/helpers/warn.ts new file: uni_modules/uni-simple-router/src/index.ts new file: uni_modules/uni-simple-router/src/options/base.ts new file: uni_modules/uni-simple-router/src/options/config.ts new file: uni_modules/uni-simple-router/src/public/hooks.ts new file: uni_modules/uni-simple-router/src/public/methods.ts new file: uni_modules/uni-simple-router/src/public/page.ts new file: uni_modules/uni-simple-router/src/public/query.ts new file: uni_modules/uni-simple-router/src/public/rewrite.ts new file: uni_modules/uni-simple-router/src/public/router.ts new file: uni_modules/uni-simple-router/src/public/uniOrigin.ts new file: uni_modules/uni-simple-router/test/path-to-regexp.spec.ts new file: uni_modules/uni-simple-router/test/query-toggle.spec.ts new file: uni_modules/uni-simple-router/tsconfig.json new file: uni_modules/uni-simple-router/webpack/webpack.common.js new file: uni_modules/uni-simple-router/webpack/webpack.dev.js new file: uni_modules/uni-simple-router/webpack/webpack.prod.js new file: uni_modules/uview-ui/LICENSE new file: uni_modules/uview-ui/README.md new file: uni_modules/uview-ui/changelog.md new file: uni_modules/uview-ui/components/u--form/u--form.vue new file: uni_modules/uview-ui/components/u--image/u--image.vue new file: uni_modules/uview-ui/components/u--input/u--input.vue new file: uni_modules/uview-ui/components/u--text/u--text.vue new file: uni_modules/uview-ui/components/u--textarea/u--textarea.vue new file: uni_modules/uview-ui/components/u-action-sheet/props.js new file: uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue new file: uni_modules/uview-ui/components/u-album/props.js new file: uni_modules/uview-ui/components/u-album/u-album.vue new file: uni_modules/uview-ui/components/u-alert/props.js new file: uni_modules/uview-ui/components/u-alert/u-alert.vue new file: uni_modules/uview-ui/components/u-avatar-group/props.js new file: uni_modules/uview-ui/components/u-avatar-group/u-avatar-group.vue new file: uni_modules/uview-ui/components/u-avatar/props.js new file: uni_modules/uview-ui/components/u-avatar/u-avatar.vue new file: uni_modules/uview-ui/components/u-back-top/props.js new file: uni_modules/uview-ui/components/u-back-top/u-back-top.vue new file: uni_modules/uview-ui/components/u-badge/props.js new file: uni_modules/uview-ui/components/u-badge/u-badge.vue new file: uni_modules/uview-ui/components/u-button/nvue.scss new file: uni_modules/uview-ui/components/u-button/props.js new file: uni_modules/uview-ui/components/u-button/u-button.vue new file: uni_modules/uview-ui/components/u-button/vue.scss new file: uni_modules/uview-ui/components/u-calendar/header.vue new file: uni_modules/uview-ui/components/u-calendar/month.vue new file: uni_modules/uview-ui/components/u-calendar/props.js new file: uni_modules/uview-ui/components/u-calendar/u-calendar.vue new file: uni_modules/uview-ui/components/u-calendar/util.js new file: uni_modules/uview-ui/components/u-car-keyboard/props.js new file: uni_modules/uview-ui/components/u-car-keyboard/u-car-keyboard.vue new file: uni_modules/uview-ui/components/u-cell-group/props.js new file: uni_modules/uview-ui/components/u-cell-group/u-cell-group.vue new file: uni_modules/uview-ui/components/u-cell/props.js new file: uni_modules/uview-ui/components/u-cell/u-cell.vue new file: uni_modules/uview-ui/components/u-checkbox-group/props.js new file: uni_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue new file: uni_modules/uview-ui/components/u-checkbox/props.js new file: uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue new file: uni_modules/uview-ui/components/u-circle-progress/props.js new file: uni_modules/uview-ui/components/u-circle-progress/u-circle-progress.vue new file: uni_modules/uview-ui/components/u-code-input/props.js new file: uni_modules/uview-ui/components/u-code-input/u-code-input.vue new file: uni_modules/uview-ui/components/u-code/props.js new file: uni_modules/uview-ui/components/u-code/u-code.vue new file: uni_modules/uview-ui/components/u-col/props.js new file: uni_modules/uview-ui/components/u-col/u-col.vue new file: uni_modules/uview-ui/components/u-collapse-item/props.js new file: uni_modules/uview-ui/components/u-collapse-item/u-collapse-item.vue new file: uni_modules/uview-ui/components/u-collapse/props.js new file: uni_modules/uview-ui/components/u-collapse/u-collapse.vue new file: uni_modules/uview-ui/components/u-column-notice/props.js new file: uni_modules/uview-ui/components/u-column-notice/u-column-notice.vue new file: uni_modules/uview-ui/components/u-count-down/props.js new file: uni_modules/uview-ui/components/u-count-down/u-count-down.vue new file: uni_modules/uview-ui/components/u-count-down/utils.js new file: uni_modules/uview-ui/components/u-count-to/props.js new file: uni_modules/uview-ui/components/u-count-to/u-count-to.vue new file: uni_modules/uview-ui/components/u-datetime-picker/props.js new file: uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue new file: uni_modules/uview-ui/components/u-divider/props.js new file: uni_modules/uview-ui/components/u-divider/u-divider.vue new file: uni_modules/uview-ui/components/u-dropdown-item/props.js new file: uni_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue new file: uni_modules/uview-ui/components/u-dropdown/props.js new file: uni_modules/uview-ui/components/u-dropdown/u-dropdown.vue new file: uni_modules/uview-ui/components/u-empty/props.js new file: uni_modules/uview-ui/components/u-empty/u-empty.vue new file: uni_modules/uview-ui/components/u-form-item/props.js new file: uni_modules/uview-ui/components/u-form-item/u-form-item.vue new file: uni_modules/uview-ui/components/u-form/props.js new file: uni_modules/uview-ui/components/u-form/u-form.vue new file: uni_modules/uview-ui/components/u-gap/props.js new file: uni_modules/uview-ui/components/u-gap/u-gap.vue new file: uni_modules/uview-ui/components/u-grid-item/props.js new file: uni_modules/uview-ui/components/u-grid-item/u-grid-item.vue new file: uni_modules/uview-ui/components/u-grid/props.js new file: uni_modules/uview-ui/components/u-grid/u-grid.vue new file: uni_modules/uview-ui/components/u-icon/icons.js new file: uni_modules/uview-ui/components/u-icon/props.js new file: uni_modules/uview-ui/components/u-icon/u-icon.vue new file: uni_modules/uview-ui/components/u-image/props.js new file: uni_modules/uview-ui/components/u-image/u-image.vue new file: uni_modules/uview-ui/components/u-index-anchor/props.js new file: uni_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue new file: uni_modules/uview-ui/components/u-index-item/props.js new file: uni_modules/uview-ui/components/u-index-item/u-index-item.vue new file: uni_modules/uview-ui/components/u-index-list/props.js new file: uni_modules/uview-ui/components/u-index-list/u-index-list.vue new file: uni_modules/uview-ui/components/u-input/props.js new file: uni_modules/uview-ui/components/u-input/u-input.vue new file: uni_modules/uview-ui/components/u-keyboard/props.js new file: uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue new file: uni_modules/uview-ui/components/u-line-progress/props.js new file: uni_modules/uview-ui/components/u-line-progress/u-line-progress.vue new file: uni_modules/uview-ui/components/u-line/props.js new file: uni_modules/uview-ui/components/u-line/u-line.vue new file: uni_modules/uview-ui/components/u-link/props.js new file: uni_modules/uview-ui/components/u-link/u-link.vue new file: uni_modules/uview-ui/components/u-list-item/props.js new file: uni_modules/uview-ui/components/u-list-item/u-list-item.vue new file: uni_modules/uview-ui/components/u-list/props.js new file: uni_modules/uview-ui/components/u-list/u-list.vue new file: uni_modules/uview-ui/components/u-loading-icon/props.js new file: uni_modules/uview-ui/components/u-loading-icon/u-loading-icon.vue new file: uni_modules/uview-ui/components/u-loading-page/props.js new file: uni_modules/uview-ui/components/u-loading-page/u-loading-page.vue new file: uni_modules/uview-ui/components/u-loadmore/props.js new file: uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue new file: uni_modules/uview-ui/components/u-modal/props.js new file: uni_modules/uview-ui/components/u-modal/u-modal.vue new file: uni_modules/uview-ui/components/u-navbar/props.js new file: uni_modules/uview-ui/components/u-navbar/u-navbar.vue new file: uni_modules/uview-ui/components/u-no-network/props.js new file: uni_modules/uview-ui/components/u-no-network/u-no-network.vue new file: uni_modules/uview-ui/components/u-notice-bar/props.js new file: uni_modules/uview-ui/components/u-notice-bar/u-notice-bar.vue new file: uni_modules/uview-ui/components/u-notify/props.js new file: uni_modules/uview-ui/components/u-notify/u-notify.vue new file: uni_modules/uview-ui/components/u-number-box/props.js new file: uni_modules/uview-ui/components/u-number-box/u-number-box.vue new file: uni_modules/uview-ui/components/u-number-keyboard/props.js new file: uni_modules/uview-ui/components/u-number-keyboard/u-number-keyboard.vue new file: uni_modules/uview-ui/components/u-overlay/props.js new file: uni_modules/uview-ui/components/u-overlay/u-overlay.vue new file: uni_modules/uview-ui/components/u-parse/node/node.vue new file: uni_modules/uview-ui/components/u-parse/parser.js new file: uni_modules/uview-ui/components/u-parse/props.js new file: uni_modules/uview-ui/components/u-parse/u-parse.vue new file: uni_modules/uview-ui/components/u-picker-column/props.js new file: uni_modules/uview-ui/components/u-picker-column/u-picker-column.vue new file: uni_modules/uview-ui/components/u-picker/props.js new file: uni_modules/uview-ui/components/u-picker/u-picker.vue new file: uni_modules/uview-ui/components/u-popup/props.js new file: uni_modules/uview-ui/components/u-popup/u-popup.vue new file: uni_modules/uview-ui/components/u-radio-group/props.js new file: uni_modules/uview-ui/components/u-radio-group/u-radio-group.vue new file: uni_modules/uview-ui/components/u-radio/props.js new file: uni_modules/uview-ui/components/u-radio/u-radio.vue new file: uni_modules/uview-ui/components/u-rate/props.js new file: uni_modules/uview-ui/components/u-rate/u-rate.vue new file: uni_modules/uview-ui/components/u-read-more/props.js new file: uni_modules/uview-ui/components/u-read-more/u-read-more.vue new file: uni_modules/uview-ui/components/u-row-notice/props.js new file: uni_modules/uview-ui/components/u-row-notice/u-row-notice.vue new file: uni_modules/uview-ui/components/u-row/props.js new file: uni_modules/uview-ui/components/u-row/u-row.vue new file: uni_modules/uview-ui/components/u-safe-bottom/props.js new file: uni_modules/uview-ui/components/u-safe-bottom/u-safe-bottom.vue new file: uni_modules/uview-ui/components/u-scroll-list/nvue.js new file: uni_modules/uview-ui/components/u-scroll-list/other.js new file: uni_modules/uview-ui/components/u-scroll-list/props.js new file: uni_modules/uview-ui/components/u-scroll-list/scrollWxs.wxs new file: uni_modules/uview-ui/components/u-scroll-list/u-scroll-list.vue new file: uni_modules/uview-ui/components/u-search/props.js new file: uni_modules/uview-ui/components/u-search/u-search.vue new file: uni_modules/uview-ui/components/u-skeleton/props.js new file: uni_modules/uview-ui/components/u-skeleton/u-skeleton.vue new file: uni_modules/uview-ui/components/u-slider/mpother.js new file: uni_modules/uview-ui/components/u-slider/mpwxs.js new file: uni_modules/uview-ui/components/u-slider/mpwxs.wxs new file: "uni_modules/uview-ui/components/u-slider/nvue - \345\211\257\346\234\254.js" new file: uni_modules/uview-ui/components/u-slider/nvue.js new file: uni_modules/uview-ui/components/u-slider/props.js new file: uni_modules/uview-ui/components/u-slider/u-slider.vue new file: uni_modules/uview-ui/components/u-status-bar/props.js new file: uni_modules/uview-ui/components/u-status-bar/u-status-bar.vue new file: uni_modules/uview-ui/components/u-steps-item/props.js new file: uni_modules/uview-ui/components/u-steps-item/u-steps-item.vue new file: uni_modules/uview-ui/components/u-steps/props.js new file: uni_modules/uview-ui/components/u-steps/u-steps.vue new file: uni_modules/uview-ui/components/u-sticky/props.js new file: uni_modules/uview-ui/components/u-sticky/u-sticky.vue new file: uni_modules/uview-ui/components/u-subsection/props.js new file: uni_modules/uview-ui/components/u-subsection/u-subsection.vue new file: uni_modules/uview-ui/components/u-swipe-action-item/index - backup.wxs new file: uni_modules/uview-ui/components/u-swipe-action-item/index.wxs new file: uni_modules/uview-ui/components/u-swipe-action-item/nvue - backup.js new file: uni_modules/uview-ui/components/u-swipe-action-item/nvue.js new file: uni_modules/uview-ui/components/u-swipe-action-item/props.js new file: uni_modules/uview-ui/components/u-swipe-action-item/u-swipe-action-item.vue new file: uni_modules/uview-ui/components/u-swipe-action-item/wxs.js new file: uni_modules/uview-ui/components/u-swipe-action/props.js new file: uni_modules/uview-ui/components/u-swipe-action/u-swipe-action.vue new file: uni_modules/uview-ui/components/u-swiper-indicator/props.js new file: uni_modules/uview-ui/components/u-swiper-indicator/u-swiper-indicator.vue new file: uni_modules/uview-ui/components/u-swiper/props.js new file: uni_modules/uview-ui/components/u-swiper/u-swiper.vue new file: uni_modules/uview-ui/components/u-switch/props.js new file: uni_modules/uview-ui/components/u-switch/u-switch.vue new file: uni_modules/uview-ui/components/u-tabbar-item/props.js new file: uni_modules/uview-ui/components/u-tabbar-item/u-tabbar-item.vue new file: uni_modules/uview-ui/components/u-tabbar/props.js new file: uni_modules/uview-ui/components/u-tabbar/u-tabbar.vue new file: uni_modules/uview-ui/components/u-table/props.js new file: uni_modules/uview-ui/components/u-table/u-table.vue new file: uni_modules/uview-ui/components/u-tabs-item/props.js new file: uni_modules/uview-ui/components/u-tabs-item/u-tabs-item.vue new file: uni_modules/uview-ui/components/u-tabs/props.js new file: uni_modules/uview-ui/components/u-tabs/u-tabs.vue new file: uni_modules/uview-ui/components/u-tag/props.js new file: uni_modules/uview-ui/components/u-tag/u-tag.vue new file: uni_modules/uview-ui/components/u-td/props.js new file: uni_modules/uview-ui/components/u-td/u-td.vue new file: uni_modules/uview-ui/components/u-text/props.js new file: uni_modules/uview-ui/components/u-text/u-text.vue new file: uni_modules/uview-ui/components/u-text/value.js new file: uni_modules/uview-ui/components/u-textarea/props.js new file: uni_modules/uview-ui/components/u-textarea/u-textarea.vue new file: uni_modules/uview-ui/components/u-toast/u-toast.vue new file: uni_modules/uview-ui/components/u-toolbar/props.js new file: uni_modules/uview-ui/components/u-toolbar/u-toolbar.vue new file: uni_modules/uview-ui/components/u-tooltip/clipboard.min.js new file: uni_modules/uview-ui/components/u-tooltip/props.js new file: uni_modules/uview-ui/components/u-tooltip/u-tooltip.vue new file: uni_modules/uview-ui/components/u-tr/props.js new file: uni_modules/uview-ui/components/u-tr/u-tr.vue new file: uni_modules/uview-ui/components/u-transition/nvue.ani-map.js new file: uni_modules/uview-ui/components/u-transition/props.js new file: uni_modules/uview-ui/components/u-transition/transition.js new file: uni_modules/uview-ui/components/u-transition/u-transition.vue new file: uni_modules/uview-ui/components/u-transition/vue.ani-style.scss new file: uni_modules/uview-ui/components/u-upload/mixin.js new file: uni_modules/uview-ui/components/u-upload/props.js new file: uni_modules/uview-ui/components/u-upload/u-upload.vue new file: uni_modules/uview-ui/components/u-upload/utils.js new file: uni_modules/uview-ui/components/uview-ui/uview-ui.vue new file: uni_modules/uview-ui/index.js new file: uni_modules/uview-ui/index.scss new file: uni_modules/uview-ui/libs/config/color.js new file: uni_modules/uview-ui/libs/config/config.js new file: uni_modules/uview-ui/libs/config/props.js new file: uni_modules/uview-ui/libs/config/props/actionSheet.js new file: uni_modules/uview-ui/libs/config/props/album.js new file: uni_modules/uview-ui/libs/config/props/alert.js new file: uni_modules/uview-ui/libs/config/props/avatar.js new file: uni_modules/uview-ui/libs/config/props/avatarGroup.js new file: uni_modules/uview-ui/libs/config/props/backtop.js new file: uni_modules/uview-ui/libs/config/props/badge.js new file: uni_modules/uview-ui/libs/config/props/button.js new file: uni_modules/uview-ui/libs/config/props/calendar.js new file: uni_modules/uview-ui/libs/config/props/carKeyboard.js new file: uni_modules/uview-ui/libs/config/props/cell.js new file: uni_modules/uview-ui/libs/config/props/cellGroup.js new file: uni_modules/uview-ui/libs/config/props/checkbox.js new file: uni_modules/uview-ui/libs/config/props/checkboxGroup.js new file: uni_modules/uview-ui/libs/config/props/circleProgress.js new file: uni_modules/uview-ui/libs/config/props/code.js new file: uni_modules/uview-ui/libs/config/props/codeInput.js new file: uni_modules/uview-ui/libs/config/props/col.js new file: uni_modules/uview-ui/libs/config/props/collapse.js new file: uni_modules/uview-ui/libs/config/props/collapseItem.js new file: uni_modules/uview-ui/libs/config/props/columnNotice.js new file: uni_modules/uview-ui/libs/config/props/countDown.js new file: uni_modules/uview-ui/libs/config/props/countTo.js new file: uni_modules/uview-ui/libs/config/props/datetimePicker.js new file: uni_modules/uview-ui/libs/config/props/divider.js new file: uni_modules/uview-ui/libs/config/props/empty.js new file: uni_modules/uview-ui/libs/config/props/form.js new file: uni_modules/uview-ui/libs/config/props/formItem.js new file: uni_modules/uview-ui/libs/config/props/gap.js new file: uni_modules/uview-ui/libs/config/props/grid.js new file: uni_modules/uview-ui/libs/config/props/gridItem.js new file: uni_modules/uview-ui/libs/config/props/icon.js new file: uni_modules/uview-ui/libs/config/props/image.js new file: uni_modules/uview-ui/libs/config/props/indexAnchor.js new file: uni_modules/uview-ui/libs/config/props/indexList.js new file: uni_modules/uview-ui/libs/config/props/input.js new file: uni_modules/uview-ui/libs/config/props/keyboard.js new file: uni_modules/uview-ui/libs/config/props/line.js new file: uni_modules/uview-ui/libs/config/props/lineProgress.js new file: uni_modules/uview-ui/libs/config/props/link.js new file: uni_modules/uview-ui/libs/config/props/list.js new file: uni_modules/uview-ui/libs/config/props/listItem.js new file: uni_modules/uview-ui/libs/config/props/loadingIcon.js new file: uni_modules/uview-ui/libs/config/props/loadingPage.js new file: uni_modules/uview-ui/libs/config/props/loadmore.js new file: uni_modules/uview-ui/libs/config/props/modal.js new file: uni_modules/uview-ui/libs/config/props/navbar.js new file: uni_modules/uview-ui/libs/config/props/noNetwork.js new file: uni_modules/uview-ui/libs/config/props/noticeBar.js new file: uni_modules/uview-ui/libs/config/props/notify.js new file: uni_modules/uview-ui/libs/config/props/numberBox.js new file: uni_modules/uview-ui/libs/config/props/numberKeyboard.js new file: uni_modules/uview-ui/libs/config/props/overlay.js new file: uni_modules/uview-ui/libs/config/props/parse.js new file: uni_modules/uview-ui/libs/config/props/picker.js new file: uni_modules/uview-ui/libs/config/props/popup.js new file: uni_modules/uview-ui/libs/config/props/radio.js new file: uni_modules/uview-ui/libs/config/props/radioGroup.js new file: uni_modules/uview-ui/libs/config/props/rate.js new file: uni_modules/uview-ui/libs/config/props/readMore.js new file: uni_modules/uview-ui/libs/config/props/row.js new file: uni_modules/uview-ui/libs/config/props/rowNotice.js new file: uni_modules/uview-ui/libs/config/props/scrollList.js new file: uni_modules/uview-ui/libs/config/props/search.js new file: uni_modules/uview-ui/libs/config/props/section.js new file: uni_modules/uview-ui/libs/config/props/skeleton.js new file: uni_modules/uview-ui/libs/config/props/slider.js new file: uni_modules/uview-ui/libs/config/props/statusBar.js new file: uni_modules/uview-ui/libs/config/props/steps.js new file: uni_modules/uview-ui/libs/config/props/stepsItem.js new file: uni_modules/uview-ui/libs/config/props/sticky.js new file: uni_modules/uview-ui/libs/config/props/subsection.js new file: uni_modules/uview-ui/libs/config/props/swipeAction.js new file: uni_modules/uview-ui/libs/config/props/swipeActionItem.js new file: uni_modules/uview-ui/libs/config/props/swiper.js new file: uni_modules/uview-ui/libs/config/props/swipterIndicator.js new file: uni_modules/uview-ui/libs/config/props/switch.js new file: uni_modules/uview-ui/libs/config/props/tabbar.js new file: uni_modules/uview-ui/libs/config/props/tabbarItem.js new file: uni_modules/uview-ui/libs/config/props/tabs.js new file: uni_modules/uview-ui/libs/config/props/tag.js new file: uni_modules/uview-ui/libs/config/props/text.js new file: uni_modules/uview-ui/libs/config/props/textarea.js new file: uni_modules/uview-ui/libs/config/props/toast.js new file: uni_modules/uview-ui/libs/config/props/toolbar.js new file: uni_modules/uview-ui/libs/config/props/tooltip.js new file: uni_modules/uview-ui/libs/config/props/transition.js new file: uni_modules/uview-ui/libs/config/props/upload.js new file: uni_modules/uview-ui/libs/config/zIndex.js new file: uni_modules/uview-ui/libs/css/color.scss new file: uni_modules/uview-ui/libs/css/common.scss new file: uni_modules/uview-ui/libs/css/components.scss new file: uni_modules/uview-ui/libs/css/flex.scss new file: uni_modules/uview-ui/libs/css/h5.scss new file: uni_modules/uview-ui/libs/css/mixin.scss new file: uni_modules/uview-ui/libs/css/mp.scss new file: uni_modules/uview-ui/libs/css/nvue.scss new file: uni_modules/uview-ui/libs/css/vue.scss new file: uni_modules/uview-ui/libs/function/colorGradient.js new file: uni_modules/uview-ui/libs/function/debounce.js new file: uni_modules/uview-ui/libs/function/digit.js new file: uni_modules/uview-ui/libs/function/index.js new file: uni_modules/uview-ui/libs/function/platform.js new file: uni_modules/uview-ui/libs/function/test.js new file: uni_modules/uview-ui/libs/function/throttle.js new file: uni_modules/uview-ui/libs/luch-request/adapters/index.js new file: uni_modules/uview-ui/libs/luch-request/core/InterceptorManager.js new file: uni_modules/uview-ui/libs/luch-request/core/Request.js new file: uni_modules/uview-ui/libs/luch-request/core/buildFullPath.js new file: uni_modules/uview-ui/libs/luch-request/core/defaults.js new file: uni_modules/uview-ui/libs/luch-request/core/dispatchRequest.js new file: uni_modules/uview-ui/libs/luch-request/core/mergeConfig.js new file: uni_modules/uview-ui/libs/luch-request/core/settle.js new file: uni_modules/uview-ui/libs/luch-request/helpers/buildURL.js new file: uni_modules/uview-ui/libs/luch-request/helpers/combineURLs.js new file: uni_modules/uview-ui/libs/luch-request/helpers/isAbsoluteURL.js new file: uni_modules/uview-ui/libs/luch-request/index.d.ts new file: uni_modules/uview-ui/libs/luch-request/index.js new file: uni_modules/uview-ui/libs/luch-request/utils.js new file: uni_modules/uview-ui/libs/luch-request/utils/clone.js new file: uni_modules/uview-ui/libs/mixin/button.js new file: uni_modules/uview-ui/libs/mixin/mixin.js new file: uni_modules/uview-ui/libs/mixin/mpMixin.js new file: uni_modules/uview-ui/libs/mixin/mpShare.js new file: uni_modules/uview-ui/libs/mixin/openType.js new file: uni_modules/uview-ui/libs/mixin/style.js new file: uni_modules/uview-ui/libs/mixin/touch.js new file: uni_modules/uview-ui/libs/util/async-validator.js new file: uni_modules/uview-ui/libs/util/calendar.js new file: uni_modules/uview-ui/libs/util/dayjs.js new file: uni_modules/uview-ui/libs/util/emitter.js new file: uni_modules/uview-ui/libs/util/route.js new file: uni_modules/uview-ui/package.json new file: uni_modules/uview-ui/theme.scss new file: vue.config.js
453 lines
14 KiB
TypeScript
453 lines
14 KiB
TypeScript
import {H5Config, InstantiateConfig} from '../options/config';
|
||
import {RoutesRule, routesMapRule, routesMapKeysRule, Router, totalNextRoute, objectAny, navErrorRule, NAVTYPE, navRoute, uniBackApiRule, uniBackRule} from '../options/base';
|
||
import {baseConfig} from '../helpers/config';
|
||
import {ERRORHOOK} from '../public/hooks'
|
||
import {warnLock} from '../helpers/warn'
|
||
import { createRoute, navjump } from '../public/methods';
|
||
const Regexp = require('path-to-regexp');
|
||
|
||
export function voidFun(...args:any):void{}
|
||
|
||
export function def(
|
||
defObject:objectAny,
|
||
key:string,
|
||
getValue:Function
|
||
) {
|
||
Object.defineProperty(defObject, key, {
|
||
get() {
|
||
return getValue();
|
||
}
|
||
})
|
||
}
|
||
|
||
export function timeOut(time:number):Promise<void> {
|
||
return new Promise(resolve => {
|
||
setTimeout(() => {
|
||
resolve();
|
||
}, time)
|
||
})
|
||
}
|
||
|
||
export function mergeConfig<T extends InstantiateConfig>(baseConfig: T, userConfig: T): T {
|
||
const config: {[key: string]: any} = Object.create(null);
|
||
const baseConfigKeys: Array<string> = Object.keys(baseConfig).concat(['resolveQuery', 'parseQuery']);
|
||
for (let i = 0; i < baseConfigKeys.length; i += 1) {
|
||
const key = baseConfigKeys[i];
|
||
if (userConfig[key] != null) {
|
||
if (userConfig[key].constructor === Object) {
|
||
config[key] = {
|
||
...baseConfig[key],
|
||
...userConfig[key]
|
||
};
|
||
} else if (key === 'routes') {
|
||
config[key] = [
|
||
...baseConfig[key],
|
||
...userConfig[key]
|
||
];
|
||
} else {
|
||
config[key] = userConfig[key];
|
||
}
|
||
} else {
|
||
config[key] = baseConfig[key];
|
||
}
|
||
}
|
||
return config as T;
|
||
}
|
||
|
||
export function notDeepClearNull<T>(object:T):T {
|
||
for (const key in object) {
|
||
if (object[key] == null) {
|
||
delete object[key];
|
||
}
|
||
}
|
||
return object;
|
||
}
|
||
|
||
export function getRoutePath(route: RoutesRule, router:Router): {
|
||
finallyPath: string | string[];
|
||
aliasPath: string;
|
||
path: string;
|
||
alias: string | string[] | undefined;
|
||
} {
|
||
let finallyPath = route.aliasPath || route.alias || route.path;
|
||
if (router.options.platform !== 'h5') {
|
||
finallyPath = route.path
|
||
}
|
||
return {
|
||
finallyPath,
|
||
aliasPath: route.aliasPath || route.path,
|
||
path: route.path,
|
||
alias: route.alias
|
||
}
|
||
}
|
||
|
||
export function assertNewOptions<T extends InstantiateConfig>(
|
||
options: T
|
||
): T | never {
|
||
const {platform, routes} = options;
|
||
if (platform == null) {
|
||
throw new Error(`你在实例化路由时必须传递 'platform'`);
|
||
}
|
||
if (routes == null || routes.length === 0) {
|
||
throw new Error(`你在实例化路由时必须传递 routes 为空,这是无意义的。`);
|
||
}
|
||
if (options.platform === 'h5') {
|
||
if (options.h5?.vueRouterDev) {
|
||
baseConfig.routes = [];
|
||
}
|
||
}
|
||
const mergeOptions = mergeConfig<T>(baseConfig as T, options);
|
||
return mergeOptions;
|
||
}
|
||
|
||
export function getWildcardRule(
|
||
router:Router,
|
||
msg?:navErrorRule
|
||
):RoutesRule|never {
|
||
const routesMap = (router.routesMap as routesMapRule);
|
||
const route = routesMap.finallyPathMap['*'];
|
||
if (route) { // 有写通配符
|
||
return route
|
||
}
|
||
if (msg) {
|
||
ERRORHOOK[0](msg, router);
|
||
}
|
||
throw new Error(`当前路由表匹配规则已全部匹配完成,未找到满足的匹配规则。你可以使用 '*' 通配符捕捉最后的异常`);
|
||
}
|
||
|
||
export function notRouteTo404(
|
||
router:Router,
|
||
toRoute:RoutesRule|{
|
||
redirect:any;
|
||
path:string
|
||
},
|
||
parseToRule:totalNextRoute,
|
||
navType:NAVTYPE
|
||
):RoutesRule|totalNextRoute|never {
|
||
if (toRoute.path !== '*') { // 不是通配符 正常匹配成功
|
||
return (toRoute as RoutesRule);
|
||
}
|
||
|
||
const redirect = toRoute.redirect;
|
||
|
||
if (typeof redirect === 'undefined') {
|
||
throw new Error(` * 通配符必须配合 redirect 使用。redirect: string | Location | Function`);
|
||
}
|
||
|
||
let newRoute = redirect;
|
||
if (typeof newRoute === 'function') {
|
||
newRoute = newRoute(parseToRule) as totalNextRoute;
|
||
}
|
||
const redirectRule = navjump(newRoute as totalNextRoute, router, navType, undefined, undefined, undefined, false);
|
||
return (redirectRule as totalNextRoute);
|
||
}
|
||
|
||
export function routesForMapRoute(
|
||
router: Router,
|
||
path: string,
|
||
mapArrayKey:Array<routesMapKeysRule>,
|
||
deepFind:boolean|undefined = false
|
||
):RoutesRule|never {
|
||
if (router.options.h5?.vueRouterDev) {
|
||
return {path}
|
||
}
|
||
// 【Fixe】 https://github.com/SilurianYang/uni-simple-router/issues/252
|
||
const startPath = path.split('?')[0];
|
||
let wildcard = '';
|
||
const routesMap = (router.routesMap as routesMapRule);
|
||
for (let i = 0; i < mapArrayKey.length; i++) {
|
||
const mapKey = mapArrayKey[i];
|
||
const mapList = routesMap[mapKey];
|
||
for (const [key, value] of Object.entries(mapList)) {
|
||
if (key === '*') {
|
||
if (wildcard === '') {
|
||
wildcard = '*'
|
||
}
|
||
continue;
|
||
}
|
||
const route:string|RoutesRule = value;
|
||
let rule:string = key;
|
||
if (getDataType<Array<string>|objectAny>(mapList) === '[object Array]') {
|
||
rule = (route as string);
|
||
}
|
||
const pathRule:RegExp = Regexp(rule);
|
||
const result = pathRule.exec(startPath);
|
||
if (result != null) {
|
||
if (getDataType<string|RoutesRule>(route) === '[object String]') {
|
||
return routesMap.finallyPathMap[(route as string)];
|
||
}
|
||
return (route as RoutesRule);
|
||
}
|
||
}
|
||
}
|
||
// 【Fixe】 https://github.com/SilurianYang/uni-simple-router/issues/302 2021-8-4 16:38:44
|
||
if (deepFind) {
|
||
return ({} as RoutesRule);
|
||
}
|
||
if (routesMap['aliasPathMap']) {
|
||
const results = routesForMapRoute(router, path, ['aliasPathMap'], true);
|
||
if (Object.keys(results).length > 0) {
|
||
return results;
|
||
}
|
||
}
|
||
if (wildcard !== '') {
|
||
return getWildcardRule(router);
|
||
}
|
||
throw new Error(`${path} 路径无法在路由表中找到!检查跳转路径及路由表`);
|
||
}
|
||
|
||
export function getDataType<T>(data:T):string {
|
||
return Object.prototype.toString.call(data)
|
||
}
|
||
|
||
export function copyData<T>(object:T): T {
|
||
return JSON.parse(JSON.stringify(object))
|
||
}
|
||
|
||
export function getUniCachePage<T extends objectAny>(pageIndex?:number):T|[] {
|
||
const pages:T = getCurrentPages();
|
||
if (pageIndex == null) {
|
||
return pages
|
||
}
|
||
if (pages.length === 0) {
|
||
return pages;
|
||
}
|
||
const page = pages.reverse()[pageIndex];
|
||
if (page == null) {
|
||
return []
|
||
}
|
||
return page;
|
||
}
|
||
|
||
export function urlToJson(url :string):{
|
||
path:string;
|
||
query:objectAny
|
||
} {
|
||
const query:objectAny = {};
|
||
const [path, params] = url.split('?');
|
||
if (params != null) {
|
||
const parr = params.split('&');
|
||
for (const i of parr) {
|
||
const arr = i.split('=');
|
||
query[arr[0]] = arr[1];
|
||
}
|
||
}
|
||
return {
|
||
path,
|
||
query
|
||
}
|
||
}
|
||
|
||
export function forMatNextToFrom<T extends totalNextRoute>(
|
||
router:Router,
|
||
to:T,
|
||
from:T
|
||
):{
|
||
matTo:T;
|
||
matFrom: T;
|
||
} {
|
||
let [matTo, matFrom] = [to, from];
|
||
if (router.options.platform === 'h5') {
|
||
const {vueNext, vueRouterDev} = (router.options.h5 as H5Config);
|
||
if (!vueNext && !vueRouterDev) {
|
||
matTo = createRoute(router, undefined, matTo) as T;
|
||
matFrom = createRoute(router, undefined, matFrom) as T;
|
||
}
|
||
} else {
|
||
matTo = createRoute(router, undefined, deepClone<T>(matTo)) as T;
|
||
matFrom = createRoute(router, undefined, deepClone<T>(matFrom)) as T;
|
||
}
|
||
return {
|
||
matTo: matTo,
|
||
matFrom: matFrom
|
||
}
|
||
}
|
||
|
||
export function paramsToQuery(
|
||
router:Router,
|
||
toRule:totalNextRoute|string
|
||
):totalNextRoute|string {
|
||
if (router.options.platform === 'h5' && !router.options.h5?.paramsToQuery) {
|
||
return toRule;
|
||
}
|
||
if (getDataType<totalNextRoute|string>(toRule) === '[object Object]') {
|
||
const {name, params, ...moreToRule} = (toRule as totalNextRoute);
|
||
let paramsQuery = params;
|
||
if (router.options.platform !== 'h5' && paramsQuery == null) {
|
||
paramsQuery = {};
|
||
}
|
||
if (name != null && paramsQuery != null) {
|
||
let route = (router.routesMap as routesMapRule).nameMap[name];
|
||
if (route == null) {
|
||
route = getWildcardRule(router, { type: 2, msg: `命名路由为:${name} 的路由,无法在路由表中找到!`, toRule});
|
||
}
|
||
const {finallyPath} = getRoutePath(route, router);
|
||
if (finallyPath.includes(':')) { // 动态路由无法使用 paramsToQuery
|
||
ERRORHOOK[0]({ type: 2, msg: `动态路由:${finallyPath} 无法使用 paramsToQuery!`, toRule}, router);
|
||
} else {
|
||
return {
|
||
...moreToRule,
|
||
path: finallyPath as string,
|
||
query: paramsQuery
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return toRule
|
||
}
|
||
|
||
export function assertDeepObject(object:objectAny):boolean {
|
||
let arrMark = null;
|
||
try {
|
||
arrMark = JSON.stringify(object).match(/\{|\[|\}|\]/g);
|
||
} catch (error) {
|
||
warnLock(`传递的参数解析对象失败。` + error)
|
||
}
|
||
if (arrMark == null) {
|
||
return false
|
||
}
|
||
if (arrMark.length > 3) {
|
||
return true;
|
||
}
|
||
return false
|
||
}
|
||
|
||
export function baseClone<
|
||
T extends {
|
||
[key:string]:any
|
||
}, K extends keyof T
|
||
>(
|
||
source:T,
|
||
target:Array<any>|objectAny
|
||
):Array<any>|objectAny|null {
|
||
// 【Fixe】 https://github.com/SilurianYang/uni-simple-router/issues/292
|
||
// 小程序会将null解析为字符串 undefined 建议不要在参数中传递 null
|
||
if (source == null) {
|
||
target = source;
|
||
} else {
|
||
for (const key of Object.keys(source)) {
|
||
const dyKey = key as T[K];
|
||
if (source[key] === source) continue
|
||
if (typeof source[key] === 'object') {
|
||
target[dyKey] = getDataType<T>(source[key]) === '[object Array]' ? ([] as Array<any>) : ({} as objectAny)
|
||
target[dyKey] = baseClone(source[key], target[dyKey])
|
||
} else {
|
||
target[dyKey] = source[key]
|
||
}
|
||
}
|
||
}
|
||
return target;
|
||
}
|
||
|
||
export function deepClone<T>(source:T):T {
|
||
const __ob__ = getDataType<T>(source) === '[object Array]' ? ([] as Array<any>) : ({} as objectAny);
|
||
baseClone(source, __ob__)
|
||
return __ob__ as T
|
||
}
|
||
|
||
export function lockDetectWarn(
|
||
router:Router,
|
||
to:string|number|totalNextRoute|navRoute,
|
||
navType:NAVTYPE,
|
||
next:Function,
|
||
uniActualData:uniBackApiRule|uniBackRule|undefined = {},
|
||
passiveType?:'beforeHooks'| 'afterHooks'
|
||
):void{
|
||
if (passiveType === 'afterHooks') {
|
||
next();
|
||
} else {
|
||
const {detectBeforeLock} = router.options;
|
||
detectBeforeLock && detectBeforeLock(router, to, navType);
|
||
if (router.$lockStatus) {
|
||
(router.options.routerErrorEach as (error: navErrorRule, router:Router) => void)({
|
||
type: 2,
|
||
msg: '当前页面正在处于跳转状态,请稍后再进行跳转....',
|
||
NAVTYPE: navType,
|
||
uniActualData
|
||
}, router);
|
||
} else {
|
||
next();
|
||
}
|
||
}
|
||
}
|
||
|
||
export function assertParentChild(
|
||
parentPath:string,
|
||
vueVim:any,
|
||
):boolean {
|
||
while (vueVim.$parent != null) {
|
||
const mpPage = vueVim.$parent.$mp;
|
||
if (mpPage.page && mpPage.page.is === parentPath) {
|
||
return true;
|
||
}
|
||
vueVim = vueVim.$parent;
|
||
}
|
||
try {
|
||
if (vueVim.$mp.page.is === parentPath || vueVim.$mp.page.route === parentPath) {
|
||
return true
|
||
}
|
||
} catch (error) {
|
||
return false
|
||
}
|
||
return false
|
||
}
|
||
|
||
export function resolveAbsolutePath(
|
||
path:string,
|
||
router:Router
|
||
):string|never {
|
||
const reg = /^\/?([^\?\s]+)(\?.+)?$/;
|
||
const trimPath = path.trim();
|
||
if (!reg.test(trimPath)) {
|
||
throw new Error(`【${path}】 路径错误,请提供完整的路径(10001)。`);
|
||
}
|
||
const paramsArray = trimPath.match(reg);
|
||
if (paramsArray == null) {
|
||
throw new Error(`【${path}】 路径错误,请提供完整的路径(10002)。`);
|
||
}
|
||
const query:string = paramsArray[2] || '';
|
||
if (/^\.\/[^\.]+/.test(trimPath)) { // 当前路径下
|
||
const navPath:string = router.currentRoute.path + path;
|
||
return navPath.replace(/[^\/]+\.\//, '');
|
||
}
|
||
const relative = paramsArray[1].replace(/\//g, `\\/`).replace(/\.\./g, `[^\\/]+`).replace(/\./g, '\\.');
|
||
const relativeReg = new RegExp(`^\\/${relative}$`);
|
||
const route = router.options.routes.filter(it => relativeReg.test(it.path));
|
||
if (route.length !== 1) {
|
||
throw new Error(`【${path}】 路径错误,尝试转成绝对路径失败,请手动转成绝对路径(10003)。`);
|
||
}
|
||
return route[0].path + query;
|
||
}
|
||
|
||
export function deepDecodeQuery(
|
||
query:objectAny
|
||
):objectAny {
|
||
const formatQuery:objectAny = getDataType<objectAny>(query) === '[object Array]' ? [] : {};
|
||
const keys = Object.keys(query);
|
||
for (let i = 0; i < keys.length; i++) {
|
||
const key = keys[i];
|
||
const it = query[key];
|
||
if (typeof it === 'string') {
|
||
try {
|
||
let json = JSON.parse(decodeURIComponent(it));
|
||
if (typeof json !== 'object') {
|
||
json = it;
|
||
}
|
||
formatQuery[key] = json;
|
||
} catch (error) {
|
||
try {
|
||
formatQuery[key] = decodeURIComponent(it)
|
||
} catch (error) {
|
||
formatQuery[key] = it
|
||
}
|
||
}
|
||
} else if (typeof it === 'object') {
|
||
const childQuery = deepDecodeQuery(it);
|
||
formatQuery[key] = childQuery
|
||
} else {
|
||
formatQuery[key] = it
|
||
}
|
||
}
|
||
return formatQuery
|
||
}
|