|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<!-- 做使用el-dialog做签字的弹框 -->
|
|
|
- <el-dialog title="签字" v-if="dialogVisible" :visible.sync="dialogVisible" width="800px" append-to-body>
|
|
|
+ <el-dialog title="签字" :visible.sync="show" width="800px" destroy-on-close >
|
|
|
<!-- 使用这个签名组件 -->
|
|
|
<vue-esign
|
|
|
ref="esign"
|
|
@@ -26,7 +26,7 @@
|
|
|
<div>
|
|
|
<el-button @click="handleGenerate" type="primary">保存</el-button>
|
|
|
<el-button @click="handleReset">清空画板</el-button>
|
|
|
- <el-button @click="dialogVisible = false">取消</el-button>
|
|
|
+ <el-button @click="show = false">取消</el-button>
|
|
|
</div>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
@@ -36,11 +36,10 @@
|
|
|
import { submitElectiveModels } from '@/api/webApi/elective/selected-subject'
|
|
|
|
|
|
export default {
|
|
|
- name: 'elective-esign-dialog',
|
|
|
- props: ['generation'],
|
|
|
+ // props: ['generation'],
|
|
|
data() {
|
|
|
return {
|
|
|
- dialogVisible: false, // 弹框是否开启
|
|
|
+ show: false, // 弹框是否开启
|
|
|
lineWidth: 3, // 画笔的线条粗细
|
|
|
lineColor: '#000000', // 画笔的颜色
|
|
|
bgColor: '', // 画布的背景颜色
|
|
@@ -56,32 +55,31 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- open() {
|
|
|
- this.dialogVisible = true
|
|
|
- },
|
|
|
// 清空画板
|
|
|
handleReset() {
|
|
|
this.$refs.esign.reset()
|
|
|
},
|
|
|
- saveElective() {
|
|
|
- submitElectiveModels({
|
|
|
- models: this.generation.activeModel.selectedList,
|
|
|
- esign:this.base64Img
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.dialogVisible = false
|
|
|
- this.$message.success('报名成功')
|
|
|
- this.refreshData()
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+ // saveElective() {
|
|
|
+ // submitElectiveModels({
|
|
|
+ // models: this.generation.activeModel.selectedList,
|
|
|
+ // esign:this.base64Img
|
|
|
+ // }).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.dialogVisible = false
|
|
|
+ // this.$message.success('报名成功')
|
|
|
+ // this.refreshData()
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
// 生成签字图
|
|
|
handleGenerate() {
|
|
|
this.$refs.esign
|
|
|
.generate() // 使用生成器调用把签字的图片转换成为base64图片格式
|
|
|
.then((res) => {
|
|
|
this.base64Img = res
|
|
|
- this.saveElective()
|
|
|
+ // this.saveElective()
|
|
|
+ this.show = false
|
|
|
+ this.success()
|
|
|
// 在这里向后端发请求把转换后的base64文件传给后端,后端接收以后再转换成图片做静态图片存储
|
|
|
// 当然也可以把base64转成流文件blob格式的,类似上传给后端这样,具体哪种方式看后端要求
|
|
|
})
|
|
@@ -93,7 +91,6 @@ export default {
|
|
|
})
|
|
|
return
|
|
|
})
|
|
|
- this.dialogVisible = true
|
|
|
}
|
|
|
}
|
|
|
}
|