| | |
| | | <template> |
| | | <div class="signature"> |
| | | <el-row justify="space-between"> |
| | | <el-text>签名</el-text> |
| | | <el-text>{{isRequire?'*':''}}签名</el-text> |
| | | <template v-if="!disabled"> |
| | | <el-text v-if="imageUrl" @click="imageUrl=''">清除签名</el-text> |
| | | <el-text v-else @click="signatureDialog=true">点击签名</el-text> |
| | | </template> |
| | | </el-row> |
| | | <el-image v-if="imageUrl" :src="imageUrl"></el-image> |
| | | <el-image |
| | | v-if="imageUrl" |
| | | style="width: 100%;" |
| | | :src="imageUrl.includes('http') ? imageUrl : $qxueyou.qxyRes + imageUrl"> |
| | | </el-image> |
| | | <div v-else class="image-slot"></div> |
| | | |
| | | <el-dialog |
| | |
| | | modelValue: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | isRequire: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | disabled: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | let base64 = this.editCanvas.toDataURL('image/png', 1) |
| | | let smallBase64 = await this.resizedataURL(base64, 240, 80) |
| | | // let url = await uploadByBase64(smallBase64, '签名') |
| | | // if (!url) return false |
| | | this.imageUrl = smallBase64 |
| | | let url = await uploadByBase64(smallBase64, '签名') |
| | | if (!url) return false |
| | | this.imageUrl = url |
| | | this.$emit('update:modelValue', url) |
| | | this.signatureDialog = false |
| | | }, |
| | | resizedataURL: function(base64, wantedWidth, wantedHeight){ |