| @@ -205,16 +205,24 @@ | |||
| this.openFile2.splice(index,1); | |||
| }, | |||
| afterRead(file) { | |||
| console.log(file) | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.map(res=>{ | |||
| this.openPic.push(res.file); | |||
| console.log(file instanceof Array) | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| this.openPic.push(res.file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| this.openPic.push(file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| let params1 = new FormData(); | |||
| @@ -107,7 +107,7 @@ | |||
| </template> | |||
| </van-field> | |||
| <vue-html5-editor :content="form.openContent" :height="400" @change="updateData" style="margin-top: 10px;"></vue-html5-editor> | |||
| <vue-html5-editor :content="form.openContent==null?'':form.openContent" :height="400" @change="updateData" style="margin-top: 10px;"></vue-html5-editor> | |||
| <van-field v-model="form.remark" placeholder="请输入备注" input-align="right" :border="false" > | |||
| <template #label> | |||
| @@ -232,14 +232,21 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| // this.openPic.push(file.file); | |||
| file.forEach(res=> { | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| let params1 = new FormData(); | |||
| @@ -165,14 +165,23 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.map(res=> { | |||
| this.openPic.push(res.file); | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| this.openPic.push(res.file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| this.openPic.push(file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| console.log(file) | |||
| @@ -192,13 +192,21 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.forEach(res=> { | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| console.log(file) | |||
| @@ -170,14 +170,23 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.map(res=> { | |||
| this.openPic.push(res.file); | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| this.openPic.push(res.file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| this.openPic.push(file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| console.log(file) | |||
| @@ -200,13 +200,21 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.forEach(res=> { | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| let params1 = new FormData(); | |||
| @@ -189,14 +189,23 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.map(res=> { | |||
| this.openPic.push(res.file); | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| this.openPic.push(res.file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| this.openPic.push(file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| let params1 = new FormData(); | |||
| @@ -209,13 +209,21 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.forEach(res=> { | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| let params1 = new FormData(); | |||
| @@ -163,14 +163,23 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.map(res=> { | |||
| this.openPic.push(res.file); | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| this.openPic.push(res.file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| this.openPic.push(file); | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| let params1 = new FormData(); | |||
| @@ -192,13 +192,21 @@ | |||
| }, | |||
| afterRead(file) { | |||
| // 此时可以自行将文件上传至服务器 | |||
| file.forEach(res=> { | |||
| if (file instanceof Array){//判断是否为数组,单张图片为array,多张为数组,数组返回true否则为false | |||
| file.map(res=>{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| }else{ | |||
| let params1 = new FormData(); | |||
| params1.append("file", res.file); | |||
| params1.append("file", file.file); | |||
| commonUpload(params1).then((r1) => { | |||
| this.openPic2.push(r1.fileName); | |||
| }) | |||
| }) | |||
| } | |||
| }, | |||
| afterReadOpenFile(file){ | |||
| let params1 = new FormData(); | |||