add bar code

This commit is contained in:
lq 2024-07-19 16:39:43 +08:00
parent 3b23ffaf0c
commit dce43668b3

View File

@ -1145,10 +1145,7 @@ export default {
const imageFileDom = document.querySelector('#image') const imageFileDom = document.querySelector('#image')
imageFileDom.click() imageFileDom.click()
}, },
getSelectQrCode() {
const imageFileDom = document.querySelector('#qrCode')
imageFileDom.click()
},
selectImage(event) { selectImage(event) {
event.stopPropagation() event.stopPropagation()
let _this = this let _this = this
@ -1173,29 +1170,7 @@ export default {
} }
} }
}, },
selectQrCode(event) {
let _this = this
//console.log('cododododo')
const imageFileDom = document.querySelector('#qrCode')
const file = event.target.files[0]//imageFileDom.files![0]!
const fileReader = new FileReader()
fileReader.readAsDataURL(file)
fileReader.onload = function () {
//
const image = new Image()
const value = fileReader.result
image.src = value
image.onload = function () {
_this.instance.command.executeImage({
value,
width: image.width,
height: image.height,
field: _this.imageType
})
imageFileDom.value = ''
}
}
},
executeInsertElementList() { executeInsertElementList() {
this.instance.command.executeInsertElementList([ this.instance.command.executeInsertElementList([
{ {