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.

63 lines
1.3 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()
const _this = this
_this.WebSign.Init(function(status) {
if (status) {
_this.WebSign.Status(function(status, data) {
})
_this.BeginSign()
_this.saveImgBase64(text)
}
})
},
saveImgBase64(text) {
const _this = this
this.WebSign.onSignConfirm = function(e) {
if (e.img) {
const img_base64 = 'data:image/png;base64,' + e.img
const data = {
idName: text,
src: img_base64
}
eventBus.$emit('saveSignRes', data)
_this.DisconnSign()
}
}
},
DisconnSign() {
const _this = this
_this.WebSign.Destroy(function() {
_this.connState = ''
_this.model = ''
_this.sn = ''
})
},
BeginSign() {
this.WebSign.BeginSign(function(status) {
})
},
ClearSign() {
},
EndSign() {
}
}
}