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
882 lines
22 KiB
Vue
882 lines
22 KiB
Vue
<!-- components/bluetooth-print.vue -->
|
||
<template>
|
||
<view class="container">
|
||
<view class="bluetooth-print" v-if="bluetoothAvailable">
|
||
<!-- 内容区域 -->
|
||
<view class="section">
|
||
<!-- 蓝牙设备选择组件 -->
|
||
<BluetoothDeviceSelector :selectedDevice="selectedDevice" :deviceList="deviceList"
|
||
@scan="scanBluetoothDevices" :discovering="discovering" @change="confirmSelection" />
|
||
|
||
<!-- 打印模板选择 -->
|
||
<view class="detail-item selectable" @click="showTemplateSelector = true">
|
||
<text class="detail-item-label">打印模板:</text>
|
||
<view class="detail-item-value">
|
||
<text>{{ printRenderData.selectedTemplate ? `${printRenderData.selectedTemplate.template_name}【${printRenderData.selectedTemplate.page_width}mm*${printRenderData.selectedTemplate.page_height}mm】` : "点击选择打印模板" }}</text>
|
||
<u-icon name="arrow-right" size="24" color="#666"></u-icon>
|
||
</view>
|
||
</view>
|
||
<view class="detail-item selectable" :prop="printRenderData" :change:prop="printRender.update"
|
||
@click="printRender.generateImage">
|
||
<text class="detail-item-label">预览</text>
|
||
</view>
|
||
<view class="view-section">
|
||
<scroll-view class="viewer" scroll-x="true" scroll-y="true" >
|
||
<image :src="imageUrl" :style="contentStyle"></image>
|
||
</scroll-view>
|
||
<view class="card-content" id="card-content" :style="contentStyle">1111</view>
|
||
</view>
|
||
<!-- 操作日志区域 -->
|
||
<view class="log-section" v-if="log.length > 0">
|
||
<view class="log-header">
|
||
<u-icon name="file-text" size="32" color="#2979ff"></u-icon>
|
||
<text class="log-title">操作日志</text>
|
||
<text class="log-count">({{ log.length }})</text>
|
||
|
||
<view class="log-actions">
|
||
<u-button size="mini" type="primary" @click="clearLogs" :plain="true">
|
||
清空
|
||
</u-button>
|
||
</view>
|
||
</view>
|
||
|
||
<scroll-view scroll-y class="log-container">
|
||
<view class="log-list">
|
||
<view v-for="(item, index) in log" :key="index" class="log-item"
|
||
:class="[`log-${item.type}`]">
|
||
<view class="log-item-header">
|
||
<u-icon :name="getLogIcon(item.type)" size="24"
|
||
:color="getLogColor(item.type)"></u-icon>
|
||
<text class="log-type">{{ getLogTypeText(item.type) }}</text>
|
||
<text class="log-time">{{ formatTime(item.timestamp) }}</text>
|
||
</view>
|
||
|
||
<view class="log-message">
|
||
{{ item.message }}
|
||
</view>
|
||
|
||
<view v-if="item.details" class="log-details">
|
||
<text class="details-label">详情:</text>
|
||
<text class="details-content">{{ item.details }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<view v-if="log.length === 0" class="log-empty">
|
||
<u-icon name="list" size="60" color="#dcdfe6"></u-icon>
|
||
<text class="empty-text">暂无操作日志</text>
|
||
</view>
|
||
</scroll-view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 操作按钮 -->
|
||
<view class="action-buttons">
|
||
<u-button type="primary" :disabled="!selectedDevice || !printRenderData.selectedTemplate"
|
||
@click="handlePrint" :loading="printing">
|
||
|
||
{{ printing ? '打印中...' : '开始打印' }}
|
||
</u-button>
|
||
</view>
|
||
</view>
|
||
<u-empty class="bluetoothUnAvailable" mode="address" text="蓝牙未开启" velse>
|
||
</u-empty>
|
||
|
||
<!-- 打印模板选择弹窗 -->
|
||
<u-popup :show="showTemplateSelector" mode="bottom" round="20" @close="showTemplateSelector = false">
|
||
<view class="template-selector-popup">
|
||
<view class="popup-header">
|
||
<text class="popup-title">选择打印模板</text>
|
||
</view>
|
||
|
||
<scroll-view scroll-y class="template-list" style="height: 400px;">
|
||
<view v-for="template in printTemplateList" :key="template.id" class="template-item"
|
||
:class="{ selected: printRenderData.selectedTemplate && printRenderData.selectedTemplate.id === template.id }"
|
||
@click="selectTemplate(template)">
|
||
<u-icon name="file-text" size="40" color="#19be6b"></u-icon>
|
||
<view class="template-info">
|
||
<text
|
||
class="template-name">{{ template.template_name }}【{{template.page_width}}mm*{{template.page_height}}mm】</text>
|
||
</view>
|
||
<u-icon
|
||
v-if="printRenderData.selectedTemplate && printRenderData.selectedTemplate.id === template.id"
|
||
name="checkbox-mark" size="28" color="#2979ff"></u-icon>
|
||
</view>
|
||
|
||
<view v-if="printTemplateList.length === 0" class="empty-state">
|
||
<u-icon name="file-text" size="60" color="#ccc"></u-icon>
|
||
<text class="empty-text">暂无可用模板</text>
|
||
</view>
|
||
</scroll-view>
|
||
</view>
|
||
</u-popup>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
name: 'BluetoothPrint',
|
||
|
||
props: {
|
||
printData: {
|
||
type: Object,
|
||
default: () => ({})
|
||
}
|
||
},
|
||
|
||
data() {
|
||
return {
|
||
printTemplateList: [],
|
||
showTemplateSelector: false,
|
||
printing: false,
|
||
//bluetoothAvailable: true,
|
||
|
||
showView: false,
|
||
printRenderData: {
|
||
selectedTemplate: null,
|
||
targetSize: 203.2,
|
||
mmToDot: 8,
|
||
cardWidthMm: 40,
|
||
cardHeightMm: 30,
|
||
printImage: "",
|
||
},
|
||
imageUrl: null,
|
||
CanvasData: {}
|
||
}
|
||
},
|
||
|
||
mounted() {
|
||
this.init();
|
||
},
|
||
computed: {
|
||
contentStyle(){
|
||
return {
|
||
width:this.printRenderData.selectedTemplate?.page_width+"mm"||0,
|
||
height:this.printRenderData.selectedTemplate?.page_height+"mm"||0,
|
||
}
|
||
},
|
||
deviceList() {
|
||
return this.$store.state.bluetoothPrint.bluetoothDevices
|
||
},
|
||
printConfig() {
|
||
return this.$store.state.bluetoothPrint.printerConfig
|
||
},
|
||
printConfig() {
|
||
return this.$store.state.bluetoothPrint.printerConfig
|
||
},
|
||
selectedDevice() {
|
||
return this.$store.state.bluetoothPrint.currentDevice
|
||
},
|
||
discovering() {
|
||
return this.$store.state.bluetoothPrint.discovering
|
||
},
|
||
log() {
|
||
return this.$store.state.bluetoothPrint.operationLogs || []
|
||
},
|
||
bluetoothAvailable() {
|
||
|
||
return this.$store.state.bluetoothPrint.bluetoothAvailable
|
||
}
|
||
},
|
||
watch: {
|
||
printData: {
|
||
handler(newVal) {
|
||
console.log(newVal)
|
||
if (newVal.type) {
|
||
this.getPrintTemplate();
|
||
}
|
||
},
|
||
deep: true
|
||
},
|
||
bluetoothAvailable: {
|
||
handler(newVal) {
|
||
if (newVal) {
|
||
this.init();
|
||
}
|
||
}
|
||
}
|
||
},
|
||
|
||
methods: {
|
||
// 初始化
|
||
async init() {
|
||
console.log(this.deviceList);
|
||
await this.getPrintTemplate();
|
||
},
|
||
//渲染canvas
|
||
renderCanvas() {
|
||
if (this.selectedTemplate.id) {
|
||
this.showView = true;
|
||
} else {
|
||
uni.showToast({
|
||
title: '未选择打印模板',
|
||
icon: 'none'
|
||
});
|
||
}
|
||
},
|
||
// 获取打印模板
|
||
async getPrintTemplate() {
|
||
console.log("getPrintTemplate", this.printData.type)
|
||
const templates = await this.$store.dispatch("bluetoothPrint/getPrintTemplate", this.printData.type);
|
||
console.log("========templates", templates);
|
||
if (templates.code == 200) {
|
||
this.printTemplateList = templates.data || [];
|
||
}
|
||
},
|
||
|
||
// 扫描蓝牙设备
|
||
async scanBluetoothDevices(status) {
|
||
console.log("搜索设备", status ? "开" : "关");
|
||
const devices = await this.$store.dispatch('bluetoothPrint/scanDevices', status);
|
||
},
|
||
|
||
// 选择模板
|
||
selectTemplate(template) {
|
||
this.printRenderData.selectedTemplate = template;
|
||
this.showTemplateSelector = false;
|
||
},
|
||
|
||
// 确认模板选择
|
||
confirmTemplate() {
|
||
this.showTemplateSelector = false;
|
||
},
|
||
|
||
// 处理打印
|
||
async handlePrint() {
|
||
if (!this.selectedDevice) {
|
||
uni.showToast({
|
||
title: '请选择打印设备',
|
||
icon: 'none'
|
||
})
|
||
return
|
||
}
|
||
|
||
|
||
this.printing = true;
|
||
|
||
try {
|
||
await this.$store.dispatch('bluetoothPrint/printCanvas', this.CanvasData);
|
||
uni.showToast({
|
||
title: '打印指令已发送',
|
||
icon: 'success'
|
||
});
|
||
|
||
} catch (error) {
|
||
console.error('打印失败:', error);
|
||
uni.showToast({
|
||
title: error.message || '打印失败',
|
||
icon: 'none'
|
||
});
|
||
} finally {
|
||
this.printing = false;
|
||
}
|
||
},
|
||
|
||
async confirmSelection(device) {
|
||
const result = await this.$store.dispatch('bluetoothPrint/connectDevice', device);
|
||
console.log(result);
|
||
},
|
||
|
||
// 获取日志图标
|
||
getLogIcon(type) {
|
||
const icons = {
|
||
'success': 'checkmark-circle',
|
||
'error': 'close-circle',
|
||
'warning': 'error-circle',
|
||
'info': 'info-circle',
|
||
'default': 'chat'
|
||
}
|
||
return icons[type] || icons['default'];
|
||
},
|
||
|
||
// 获取日志颜色
|
||
getLogColor(type) {
|
||
const colors = {
|
||
'success': '#19be6b',
|
||
'error': '#fa3534',
|
||
'warning': '#ff9900',
|
||
'info': '#2979ff',
|
||
'default': '#909399'
|
||
}
|
||
return colors[type] || colors['default'];
|
||
},
|
||
|
||
// 获取日志类型文本
|
||
getLogTypeText(type) {
|
||
const texts = {
|
||
'success': '成功',
|
||
'error': '错误',
|
||
'warning': '警告',
|
||
'info': '信息',
|
||
'default': '日志'
|
||
}
|
||
return texts[type] || texts['default'];
|
||
},
|
||
|
||
// 格式化时间
|
||
formatTime(timestamp) {
|
||
if (!timestamp) return '';
|
||
const date = new Date(timestamp);
|
||
return `1`;
|
||
|
||
},
|
||
|
||
// 清空日志
|
||
clearLogs() {
|
||
this.$store.dispatch('bluetoothPrint/clearLogs');
|
||
},
|
||
onImage(src) {
|
||
this.imageUrl = src;
|
||
},
|
||
canvasData(canvas) {
|
||
this.CanvasData = canvas;
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
<script module="printRender" lang="renderjs">
|
||
import html2canvas from 'html2canvas'
|
||
import dpiConverter from '@/core/utils/dpi-converter'
|
||
let datas = {};
|
||
|
||
function inArray(arr, key, val) {
|
||
for (let i = 0; i < arr.length; i++) {
|
||
if (arr[i][key] === val) {
|
||
return i;
|
||
}
|
||
}
|
||
return -1;
|
||
}
|
||
|
||
// ArrayBuffer转16进度字符串示例
|
||
function ab2hex(buffer) {
|
||
var hexArr = Array.prototype.map.call(
|
||
new Uint8Array(buffer),
|
||
function (bit) {
|
||
return ('00' + bit.toString(16)).slice(-2)
|
||
}
|
||
)
|
||
return hexArr.join('');
|
||
}
|
||
|
||
function convertToGrayscale(data) {
|
||
let g = 0
|
||
for (let i = 0; i < data.length; i += 4) {
|
||
g = (data[i] * 0.3 + data[i + 1] * 0.59 + data[i + 2] * 0.11)
|
||
data[i] = g
|
||
data[i + 1] = g
|
||
data[i + 2] = g
|
||
}
|
||
return data
|
||
}
|
||
|
||
function setPixel(data, offset, value) {
|
||
data[offset] = value;
|
||
data[offset + 1] = value;
|
||
data[offset + 2] = value;
|
||
}
|
||
|
||
function adjustPixel(data, offset, value) {
|
||
data[offset] += value;
|
||
}
|
||
function convertToMonoImage(width, height, imageData, shake) {
|
||
// 创建新的数据数组,避免修改原数据
|
||
const data = new Uint8ClampedArray(imageData.data);
|
||
let g = 0;
|
||
let e = 0;
|
||
|
||
// 第一步:转为灰度(只修改R通道作为灰度值)
|
||
for (let i = 0; i < data.length; i += 4) {
|
||
// 计算灰度值
|
||
g = Math.round(data[i] * 0.3 + data[i + 1] * 0.59 + data[i + 2] * 0.11);
|
||
// 设置所有通道为相同的灰度值
|
||
data[i] = g; // R
|
||
data[i + 1] = g; // G
|
||
data[i + 2] = g; // B
|
||
// data[i + 3] 保持原alpha不变
|
||
}
|
||
|
||
if (!shake) {
|
||
// 如果不抖动,直接二值化
|
||
for (let i = 0; i < data.length; i += 4) {
|
||
const gray = data[i];
|
||
const value = gray >= 150 ? 255 : 0;
|
||
data[i] = value;
|
||
data[i + 1] = value;
|
||
data[i + 2] = value;
|
||
}
|
||
return new ImageData(data, width, height);
|
||
}
|
||
|
||
// 第二步:Floyd-Steinberg抖动
|
||
for (let y = 0; y < height; y++) {
|
||
for (let x = 0; x < width; x++) {
|
||
const idx = (y * width + x) * 4;
|
||
const oldPixel = data[idx]; // 当前像素的灰度值
|
||
|
||
// 量化
|
||
const newPixel = oldPixel >= 150 ? 255 : 0;
|
||
const error = oldPixel - newPixel;
|
||
|
||
// 设置量化后的值
|
||
data[idx] = newPixel;
|
||
data[idx + 1] = newPixel;
|
||
data[idx + 2] = newPixel;
|
||
|
||
if (error !== 0) {
|
||
// 向右传播 7/16
|
||
if (x + 1 < width) {
|
||
const rightIdx = (y * width + (x + 1)) * 4;
|
||
data[rightIdx] = Math.min(255, Math.max(0, data[rightIdx] + error * 7 / 16));
|
||
}
|
||
|
||
// 向左下传播 3/16
|
||
if (y + 1 < height && x > 0) {
|
||
const bottomLeftIdx = ((y + 1) * width + (x - 1)) * 4;
|
||
data[bottomLeftIdx] = Math.min(255, Math.max(0, data[bottomLeftIdx] + error * 3 / 16));
|
||
}
|
||
|
||
// 向下传播 5/16
|
||
if (y + 1 < height) {
|
||
const bottomIdx = ((y + 1) * width + x) * 4;
|
||
data[bottomIdx] = Math.min(255, Math.max(0, data[bottomIdx] + error * 5 / 16));
|
||
}
|
||
|
||
// 向右下传播 1/16
|
||
if (y + 1 < height && x + 1 < width) {
|
||
const bottomRightIdx = ((y + 1) * width + (x + 1)) * 4;
|
||
data[bottomRightIdx] = Math.min(255, Math.max(0, data[bottomRightIdx] + error * 1 / 16));
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return new ImageData(data, width, height);
|
||
}
|
||
export default {
|
||
methods: {
|
||
async update(newval) {
|
||
datas = newval;
|
||
},
|
||
async generateImage(event, ownerInstance) {
|
||
console.log("点击预览", datas);
|
||
try {
|
||
if (!datas.selectedTemplate.id) {
|
||
throw new Error('未选择模板');
|
||
}
|
||
const element = document.getElementById('card-content')
|
||
console.log("element", element);
|
||
// 获取当前元素实际渲染尺寸
|
||
const rect = element.getBoundingClientRect();
|
||
console.log("rect", rect);
|
||
const currentWidthPx = rect.width
|
||
const currentHeightPx = rect.height
|
||
console.log("currentWidthPx", currentWidthPx);
|
||
datas.selectedTemplate.page_width
|
||
console.log('当前尺寸:', currentWidthPx, 'px');
|
||
const scaleFactor = datas.selectedTemplate.page_width*8/currentWidthPx;
|
||
const targetSize = {
|
||
width:datas.selectedTemplate.page_width*8,
|
||
height:datas.selectedTemplate.page_height*8
|
||
};
|
||
console.log('目标尺寸:', datas.selectedTemplate.page_width*8, 'px');
|
||
console.log('缩放比例:', datas.selectedTemplate.page_width*8/currentWidthPx)
|
||
console.log('目标尺寸:', targetSize, 'px')
|
||
// 生成高精度画布
|
||
html2canvas(element, {
|
||
|
||
backgroundColor: '#ffffff',
|
||
useCORS: true,
|
||
allowTaint: false,
|
||
logging: true,
|
||
width: rect.width,
|
||
height: rect.height
|
||
}).then(sourceCanvas => {
|
||
// 创建两个 canvas:一个用于图像处理,一个用于显示测试
|
||
const imageCanvas = document.createElement('canvas');
|
||
imageCanvas.width = sourceCanvas.width;
|
||
imageCanvas.height = sourceCanvas.height;
|
||
const imageCtx = imageCanvas.getContext('2d', { willReadFrequently: true });
|
||
|
||
const displayCanvas = document.createElement('canvas');
|
||
displayCanvas.width = sourceCanvas.width;
|
||
displayCanvas.height = sourceCanvas.height;
|
||
const displayCtx = displayCanvas.getContext('2d', { willReadFrequently: true });
|
||
|
||
// 复制源内容到两个 canvas
|
||
imageCtx.drawImage(sourceCanvas, 0, 0);
|
||
displayCtx.drawImage(sourceCanvas, 0, 0);
|
||
|
||
// 处理图像数据
|
||
const imgData = imageCtx.getImageData(0, 0, sourceCanvas.width, sourceCanvas.height);
|
||
const processedImgData = convertToMonoImage(
|
||
sourceCanvas.width,
|
||
sourceCanvas.height,
|
||
imgData,
|
||
true
|
||
);
|
||
|
||
// 将处理后的数据写入两个 canvas
|
||
imageCtx.putImageData(processedImgData, 0, 0);
|
||
displayCtx.putImageData(processedImgData, 0, 0);
|
||
|
||
// 在显示用的 canvas 上添加测试标记
|
||
displayCtx.fillStyle = 'red';
|
||
displayCtx.fillRect(10, 10, 50, 50);
|
||
|
||
// 等待一帧确保所有绘制完成
|
||
requestAnimationFrame(() => {
|
||
// 验证处理后的图像数据
|
||
const testImagePixel = imageCtx.getImageData(15, 15, 1, 1);
|
||
console.log('处理后图像像素 (应该是黑白):', testImagePixel.data);
|
||
|
||
// 验证显示用的测试标记
|
||
const testDisplayPixel = displayCtx.getImageData(15, 15, 1, 1);
|
||
console.log('显示用 canvas 像素 (应该是红色):', testDisplayPixel.data);
|
||
|
||
// 返回处理后的图像数据(不包含测试标记)
|
||
const finalImgData = imageCtx.getImageData(0, 0, sourceCanvas.width, sourceCanvas.height);
|
||
|
||
// 生成图片(使用 imageCanvas,不包含测试标记)
|
||
const src = imageCanvas.toDataURL('image/png');
|
||
ownerInstance.callMethod('onImage', src);
|
||
|
||
|
||
// 返回处理后的数据
|
||
ownerInstance.callMethod('canvasData', {
|
||
data: processedImgData.data,
|
||
width: imageCanvas.width,
|
||
height: imageCanvas.height
|
||
});
|
||
|
||
// 可以临时显示测试用的 canvas 来验证
|
||
// document.body.appendChild(displayCanvas);
|
||
});
|
||
});
|
||
|
||
} catch (error) {
|
||
console.error('生成失败:', error)
|
||
|
||
}
|
||
},
|
||
|
||
/**
|
||
* 保存为打印文件
|
||
*/
|
||
savePrintFile() {
|
||
if (!this.printImage) return
|
||
|
||
const link = document.createElement('a')
|
||
link.download = `print-card-${this.cardWidthMm}x${this.cardHeightMm}mm-${this.targetDpi}dpi.png`
|
||
link.href = this.printImage
|
||
link.click()
|
||
},
|
||
}
|
||
}
|
||
</script>
|
||
<style scoped lang="scss">
|
||
.container {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.bluetooth-print {
|
||
height: 100%;
|
||
padding: 20rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
box-sizing: border-box;
|
||
|
||
.section {
|
||
display: flex;
|
||
flex-direction: column;
|
||
flex: 1;
|
||
height: 100rpx;
|
||
gap: 24rpx;
|
||
|
||
}
|
||
|
||
.view-section {
|
||
width: 100%;
|
||
height: 300rpx;
|
||
|
||
.viewer {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
|
||
.card-content {
|
||
position: fixed;
|
||
top: 100%;
|
||
width: 40mm;
|
||
height: 30mm;
|
||
font-size: 1mm;
|
||
color:#ff0000;
|
||
}
|
||
}
|
||
|
||
// 日志区域样式
|
||
.log-section {
|
||
|
||
background: #fff;
|
||
border-radius: 12rpx;
|
||
border: 1rpx solid #e4e7ed;
|
||
overflow: hidden;
|
||
margin-top: 16rpx;
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
|
||
.log-header {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 24rpx 32rpx;
|
||
border-bottom: 1rpx solid #f0f0f0;
|
||
background: #f8f9fa;
|
||
|
||
.log-title {
|
||
font-size: 32rpx;
|
||
font-weight: 600;
|
||
color: #303133;
|
||
margin-left: 12rpx;
|
||
}
|
||
|
||
.log-count {
|
||
font-size: 24rpx;
|
||
color: #909399;
|
||
margin-left: 8rpx;
|
||
}
|
||
|
||
.log-actions {
|
||
margin-left: auto;
|
||
}
|
||
}
|
||
|
||
.log-container {
|
||
flex: 1;
|
||
height: 400rpx;
|
||
|
||
.log-list {
|
||
padding: 16rpx 24rpx;
|
||
}
|
||
|
||
.log-item {
|
||
padding: 20rpx;
|
||
margin-bottom: 16rpx;
|
||
border-radius: 8rpx;
|
||
background: #f8f9fa;
|
||
border-left: 4rpx solid;
|
||
|
||
&.log-success {
|
||
border-left-color: #19be6b;
|
||
background: linear-gradient(135deg, #f0f9eb 0%, #e8f5e9 100%);
|
||
}
|
||
|
||
&.log-error {
|
||
border-left-color: #fa3534;
|
||
background: linear-gradient(135deg, #fef0f0 0%, #fde2e2 100%);
|
||
}
|
||
|
||
&.log-warning {
|
||
border-left-color: #ff9900;
|
||
background: linear-gradient(135deg, #fdf6ec 0%, #fef8e8 100%);
|
||
}
|
||
|
||
&.log-info {
|
||
border-left-color: #2979ff;
|
||
background: linear-gradient(135deg, #ecf5ff 0%, #e8f3ff 100%);
|
||
}
|
||
|
||
.log-item-header {
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 12rpx;
|
||
|
||
.log-type {
|
||
font-size: 24rpx;
|
||
font-weight: 500;
|
||
margin-left: 8rpx;
|
||
color: #303133;
|
||
}
|
||
|
||
.log-time {
|
||
margin-left: auto;
|
||
font-size: 22rpx;
|
||
color: #909399;
|
||
}
|
||
}
|
||
|
||
.log-message {
|
||
font-size: 28rpx;
|
||
color: #606266;
|
||
line-height: 1.5;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.log-details {
|
||
margin-top: 8rpx;
|
||
padding-top: 8rpx;
|
||
border-top: 1rpx dashed #dcdfe6;
|
||
|
||
.details-label {
|
||
font-size: 24rpx;
|
||
color: #909399;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.details-content {
|
||
font-size: 24rpx;
|
||
color: #606266;
|
||
margin-left: 4rpx;
|
||
}
|
||
}
|
||
}
|
||
|
||
.log-empty {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 80rpx 0;
|
||
color: #c0c4cc;
|
||
|
||
.empty-text {
|
||
margin-top: 16rpx;
|
||
font-size: 28rpx;
|
||
color: #909399;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
.detail-item {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 24rpx 0;
|
||
border-bottom: 1rpx solid #f5f5f5;
|
||
|
||
&.selectable {
|
||
cursor: pointer;
|
||
|
||
&:active {
|
||
background-color: #f9f9f9;
|
||
}
|
||
}
|
||
|
||
.detail-item-label {
|
||
font-size: 32rpx;
|
||
color: #333;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.detail-item-value {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
font-size: 28rpx;
|
||
color: #666;
|
||
max-width: 60%;
|
||
text-align: right;
|
||
|
||
text {
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
}
|
||
}
|
||
|
||
.action-buttons {
|
||
margin-top: auto;
|
||
padding-top: 30rpx;
|
||
border-top: 1rpx solid #eee;
|
||
}
|
||
}
|
||
|
||
.template-selector-popup {
|
||
background-color: #fff;
|
||
border-radius: 20rpx 20rpx 0 0;
|
||
height: 60vh;
|
||
|
||
.popup-header {
|
||
padding: 40rpx 32rpx 24rpx;
|
||
border-bottom: 1rpx solid #f0f0f0;
|
||
|
||
.popup-title {
|
||
font-size: 36rpx;
|
||
font-weight: bold;
|
||
color: #333;
|
||
}
|
||
}
|
||
|
||
.template-list {
|
||
padding: 24rpx 32rpx;
|
||
|
||
.template-item {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 24rpx;
|
||
margin-bottom: 16rpx;
|
||
border-radius: 16rpx;
|
||
border: 2rpx solid #eee;
|
||
|
||
&:active {
|
||
background-color: #f9f9f9;
|
||
}
|
||
|
||
&.selected {
|
||
border-color: #2979ff;
|
||
background-color: #f0f7ff;
|
||
}
|
||
|
||
.template-info {
|
||
flex: 1;
|
||
margin-left: 24rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
|
||
.template-name {
|
||
font-size: 32rpx;
|
||
color: #333;
|
||
font-weight: 500;
|
||
margin-bottom: 8rpx;
|
||
}
|
||
|
||
.template-desc {
|
||
font-size: 24rpx;
|
||
color: #999;
|
||
}
|
||
}
|
||
}
|
||
|
||
.empty-state {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
padding: 80rpx 0;
|
||
|
||
.empty-text {
|
||
margin-top: 24rpx;
|
||
font-size: 28rpx;
|
||
color: #999;
|
||
}
|
||
}
|
||
}
|
||
|
||
.popup-actions {
|
||
display: flex;
|
||
padding: 24rpx 32rpx;
|
||
border-top: 1rpx solid #f0f0f0;
|
||
gap: 24rpx;
|
||
|
||
.u-button {
|
||
flex: 1;
|
||
}
|
||
}
|
||
}
|
||
|
||
.bluetoothUnAvailable {
|
||
width: 100%;
|
||
height: 100%;
|
||
}
|
||
</style> |