Commit 79e0c9a6 by 宋珺琪

判断的修改和删除、图片回显

parent 0169dfed
File deleted
......@@ -98,8 +98,9 @@ export default {
this.getAnswerInfo();
},
methods: {
//查询按钮
//模糊查询按钮
searchList(){
this.pagination.current = 1
this.getAnswerInfo(this.searchForm.question)
},
//清空按钮
......
/**
* Base64字符串转二进制流
* @param {String} dataurl Base64字符串(字符串包含Data URI scheme,例如:data:image/png;base64, )
*/
function dataURLtoBlob(dataurl) {
var arr = dataurl.split(","),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], {
type: mime,
});
}
/**
* Base64字符串转File文件
* @param {String} dataurl Base64字符串(字符串包含Data URI scheme,例如:data:image/png;base64, )
* @param {String} filename 文件名称
*/
function dataURLtoFile(dataurl, ) {
let arr = dataurl.split(',');
let mime = arr[0].match(/:(.*?);/)[1];
let bstr = atob(arr[1]);
let n = bstr.length;
let u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], {
type: mime
});
}
export default {
dataURLtoBlob,
dataURLtoFile
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment