add bar code

This commit is contained in:
lq 2024-07-19 16:14:21 +08:00
parent dcdaf3f919
commit eaa19b0629

View File

@ -239,12 +239,12 @@ import TheWelcome from './components/TheWelcome.vue'
</div>
<div class="menu-item__image" @click="getSelectImage">
<i title="图片"></i>
<input @change="selectImage" type="file" id="image" accept=".png, .jpg, .jpeg, .svg, .gif">
<input @change.stop="selectImage" type="file" id="image" accept=".png, .jpg, .jpeg, .svg, .gif">
</div>
<div class="menu-item__code" @click="getSelectQrCode">
<!-- <div class="menu-item__code" @click="getSelectQrCode">
<i title="二维码"></i>
<input @change="selectQrCode" type="file" id="qrCode" accept=".png, .jpg, .jpeg, .svg, .gif">
</div>
</div> -->
<div class="menu-item__hyperlink" @click="executeHyperlink">
<i title="超链接"></i>
</div>
@ -539,6 +539,7 @@ export default {
imageType: '',
id: 0,
code:'',
flag: false,
options: {
margins: [100, 120, 100, 120],
watermark: {
@ -1103,6 +1104,7 @@ export default {
getSelectImage() {
//const imageFileDom = document.querySelector('#image')
//imageFileDom.click()
if(this.flag == true) return
let _this = this
new Dialog({
title: '图片类型',
@ -1130,27 +1132,28 @@ export default {
}
],
onConfirm: payload => {
_this.flag = true
//console.log('eeeee', payload);
const type = payload.find(p => p.name === 'type')?.value
_this.imageType = type
//console.log('type', type)
//setTimeout('_this.gageImage()', 500)
_this.gageImage()
//_this.instance.command.executeInsertElementList([blockElement])
}
})
},
gageImage() {
const imageFileDom = document.querySelector('#image')
imageFileDom.click()
imageFileDom.click(function(event){
event.stopPropagation()
})
},
getSelectQrCode() {
const imageFileDom = document.querySelector('#qrCode')
imageFileDom.click()
},
selectImage(event) {
console.log(this.imageType);
let _this = this
//console.log(event.target.files[0])
const imageFileDom = document.querySelector('#image')
@ -1172,6 +1175,7 @@ export default {
imageFileDom.value = ''
}
}
this.flag = false
},
selectQrCode(event) {
let _this = this