| | |
| | | </template> --> |
| | | </a-list> |
| | | </div> |
| | | <div class="w-2/4 xl:w-4/6 p-5" v-if="show"> |
| | | <div class="w-2/4 xl:w-4/6 p-5"> |
| | | <!-- <CollapseContainer title="二维码" class="text-center qrcode-demo-item"></CollapseContainer> --> |
| | | <div class="mb-4 pt-4 text-center" style="width: 99%; background-color: white"> |
| | | <QrCode |
| | |
| | | </PageWrapper> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { ref } from 'vue'; |
| | | import { onMounted, onUnmounted, ref } from 'vue'; |
| | | import { List, ListItem, ListItemMeta } from 'ant-design-vue'; |
| | | import { QrCode } from '/@/components/Qrcode/index'; |
| | | import LogoImg from '/@/assets/images/logo.png'; |
| | |
| | | import { useQrhisStore } from '/@/store/modules/qrhis'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { buildUUID } from '/@/utils/uuid'; |
| | | import printJS from 'print-js'; |
| | | import { useWebSocketStore } from '/@/store/modules/websocket'; |
| | | |
| | | const AList = List; |
| | | const AListItem = ListItem; |
| | |
| | | ]; |
| | | |
| | | let qrDatas: any[] = []; |
| | | const usewebSocket = useWebSocketStore(); |
| | | const useQrhis = useQrhisStore(); |
| | | const { hisData } = storeToRefs(useQrhis); |
| | | const { createMessage } = useMessage(); |
| | |
| | | createMessage.error('输入的条码为空'); |
| | | } |
| | | } |
| | | const unsubscribe = usewebSocket.$subscribe((mutation, state) => { |
| | | if (state.printTag == qrCodeUrl.value) { |
| | | jsonPrint(state.printJson); |
| | | usewebSocket.SetPrintTag(''); |
| | | } |
| | | }); |
| | | |
| | | // 当组件卸载时取消订阅 |
| | | onUnmounted(() => { |
| | | unsubscribe(); |
| | | }); |
| | | |
| | | /** |
| | | * @description: 显示二维码 |
| | |
| | | }, |
| | | pageSize: 10, |
| | | }; |
| | | |
| | | function jsonPrint(option) { |
| | | printJS(option); |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .qrcode-demo-item { |