Commit 696dc91d authored by miaohaoyun's avatar miaohaoyun

Merge branch 'mhy' into 'master'

Mhy

See merge request !57
parents 08fd94e7 0ff4d752
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"echarts": "^4.2.1",
"element-ui": "^2.4.6", "element-ui": "^2.4.6",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
......
...@@ -169,14 +169,16 @@ export default { ...@@ -169,14 +169,16 @@ export default {
this.dataForm = { this.dataForm = {
id: 0, id: 0,
name: '', name: '',
remark: '' remark: '',
} }
this.sealUrl = [];
}, },
// 显示编辑界面 // 显示编辑界面
handleEdit: function (params) { handleEdit: function (params) {
this.dialogVisible = true this.dialogVisible = true
this.operation = false this.operation = false
this.dataForm = Object.assign({}, params.row) this.dataForm = Object.assign({}, params.row)
this.sealUrl = [];
}, },
// 编辑 // 编辑
submitForm: function () { submitForm: function () {
...@@ -302,28 +304,20 @@ export default { ...@@ -302,28 +304,20 @@ export default {
       },        },
changeSeal(file) { changeSeal(file) {
var This = this; var This = this;
this.sealUrl.length = 0; this.sealUrl = [];
this.sealUrl.push(file); this.sealUrl.push(file);
if (this.sealUrl.length > 0) { if (this.sealUrl.length > 0) {
var aa; this.convertImageToBase64(function (base64) {
aa = this.convertImageToBase64(); This.dataForm.sealStr = base64;
console.log(aa); });
console.log(this.dataForm);
} }
}, },
convertImageToBase64() { convertImageToBase64(callback) {
var This = this;
var base64;
let reader = new FileReader(); let reader = new FileReader();
reader.readAsDataURL(this.sealUrl[0].raw); reader.readAsDataURL(this.sealUrl[0].raw);
reader.onload = function (e) { reader.onload = function (e) {
console.log(this.result.substring(this.result.indexOf(",") + 1)); callback.call(this, this.result.substring(this.result.indexOf(",") + 1));
base64 = this.result.substring(this.result.indexOf(",") + 1);
This.sealUrl[0] = this.result.substring(this.result.indexOf(",") + 1);
} }
console.log(This.sealUrl[0]);
console.log(base64);
return base64;
} }
}, },
mounted() { mounted() {
......
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