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.

57 lines
1.1 KiB

import { Notification } from 'element-ui'
import emptySign from '@static/js/emptySign'
import eventBus from '@/page-subspecialty/utils/eventBus'
export default {
data() {
return {
WebSign: null,
model: '', // 型号
sn: '' // 序列号
}
},
methods: {
initSign(text) {
this.WebSign = new 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() {
}
}
}