add bar code

This commit is contained in:
lq 2024-07-19 16:30:36 +08:00
parent eaa19b0629
commit a2b981a72e

View File

@ -238,7 +238,7 @@ import TheWelcome from './components/TheWelcome.vue'
<div class="table-panel" @click="tablePanel" @mousemove="ceshi"></div> <div class="table-panel" @click="tablePanel" @mousemove="ceshi"></div>
</div> </div>
<div class="menu-item__image" @click="getSelectImage"> <div class="menu-item__image" @click="getSelectImage">
<i title="图片"></i> <i title="图片">{{ count }}</i>
<input @change.stop="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>
<!-- <div class="menu-item__code" @click="getSelectQrCode"> <!-- <div class="menu-item__code" @click="getSelectQrCode">
@ -511,6 +511,7 @@ import JsBarcode from 'jsbarcode'
export default { export default {
data() { data() {
return { return {
count:'',
fieldArr: [], fieldArr: [],
confShow: false, confShow: false,
tableCol: 4, tableCol: 4,
@ -1138,11 +1139,27 @@ export default {
_this.imageType = type _this.imageType = type
//console.log('type', type) //console.log('type', type)
_this.gageImage() _this.gageImage()
_this.startTimer()
} }
}) })
}, },
startTimer() {
this.count = 9
this.timer = setInterval(() => {
// Vuecomputed
this.count--
if(this.count <= 0) {
this.clearTimer()
}
}, 1000);
},
clearTimer() {
clearInterval(this.timer)
this.timer = null
this.count = ''
this.flag = false
},
gageImage() { gageImage() {
const imageFileDom = document.querySelector('#image') const imageFileDom = document.querySelector('#image')
imageFileDom.click(function(event){ imageFileDom.click(function(event){
@ -1175,7 +1192,7 @@ export default {
imageFileDom.value = '' imageFileDom.value = ''
} }
} }
this.flag = false this.clearTimer()
}, },
selectQrCode(event) { selectQrCode(event) {
let _this = this let _this = this