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.
54 lines
1.0 KiB
54 lines
1.0 KiB
import eventBus from '@/page-subspecialty/utils/eventBus'
|
|
export default {
|
|
data() {
|
|
return {
|
|
WebSign: null,
|
|
model: '', // 型号
|
|
sn: '' // 序列号
|
|
}
|
|
},
|
|
methods: {
|
|
initSign(text) {
|
|
this.WebSign = this.$jSign
|
|
|
|
this.WebSign.Init((status) => {
|
|
if (status) {
|
|
this.BeginSign()
|
|
this.saveImgBase64(text)
|
|
}
|
|
})
|
|
},
|
|
saveImgBase64(text) {
|
|
this.WebSign.onSignConfirm = (e) => {
|
|
if (e.img) {
|
|
const img_base64 = 'data:image/png;base64,' + e.img
|
|
const data = {
|
|
idName: text,
|
|
src: img_base64
|
|
}
|
|
this.formListValue[this.currentSignText] = img_base64
|
|
eventBus.$emit('saveSignRes', data)
|
|
this.DisconnSign()
|
|
}
|
|
}
|
|
},
|
|
DisconnSign() {
|
|
this.WebSign.Destroy(() => {
|
|
this.model = ''
|
|
this.sn = ''
|
|
})
|
|
},
|
|
BeginSign() {
|
|
this.WebSign.BeginSign((status) => {
|
|
|
|
})
|
|
},
|
|
ClearSign() {
|
|
|
|
},
|
|
EndSign() {
|
|
|
|
}
|
|
}
|
|
}
|
|
|