上海市东方医院导视
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
699 B

import { ref } from 'vue'
import QRCode from 'qrcode'
import Message from '@/base/Message/Message'
export const useGenerateQRcode = (config, currentFloor) => {
const QRCodeRef = ref('')
function generateQRCode(floorOrder, yaxis, name) {
const text = `s=${currentFloor.value.floorOrder}_${currentFloor.value.yaxis}_${currentFloor.value.devNum}&e=${floorOrder}_${yaxis}_${name}`
QRCode.toDataURL(config.value.mobileNav + '?' + text)
.then(code => {
QRCodeRef.value = code
})
// eslint-disable-next-line no-unused-vars
.catch(_err => {
Message({ type: 'error', text: '生成二维码失败' })
})
}
return { QRCodeRef, generateQRCode }
}