add bar code
This commit is contained in:
parent
eaa19b0629
commit
a2b981a72e
23
src/App.vue
23
src/App.vue
|
@ -238,7 +238,7 @@ import TheWelcome from './components/TheWelcome.vue'
|
|||
<div class="table-panel" @click="tablePanel" @mousemove="ceshi"></div>
|
||||
</div>
|
||||
<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">
|
||||
</div>
|
||||
<!-- <div class="menu-item__code" @click="getSelectQrCode">
|
||||
|
@ -511,6 +511,7 @@ import JsBarcode from 'jsbarcode'
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
count:'',
|
||||
fieldArr: [],
|
||||
confShow: false,
|
||||
tableCol: 4,
|
||||
|
@ -1138,11 +1139,27 @@ export default {
|
|||
_this.imageType = type
|
||||
//console.log('type', type)
|
||||
_this.gageImage()
|
||||
|
||||
_this.startTimer()
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
startTimer() {
|
||||
this.count = 9
|
||||
this.timer = setInterval(() => {
|
||||
// 强制Vue重新计算computed属性
|
||||
this.count--
|
||||
if(this.count <= 0) {
|
||||
this.clearTimer()
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
clearTimer() {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
this.count = ''
|
||||
this.flag = false
|
||||
},
|
||||
gageImage() {
|
||||
const imageFileDom = document.querySelector('#image')
|
||||
imageFileDom.click(function(event){
|
||||
|
@ -1175,7 +1192,7 @@ export default {
|
|||
imageFileDom.value = ''
|
||||
}
|
||||
}
|
||||
this.flag = false
|
||||
this.clearTimer()
|
||||
},
|
||||
selectQrCode(event) {
|
||||
let _this = this
|
||||
|
|
Loading…
Reference in New Issue
Block a user