|
|
@@ -444,7 +444,8 @@ a {
|
|
|
action="/api/admin/uploadfile"
|
|
|
list-type="picture-card"
|
|
|
:data="{ type: item.label }"
|
|
|
- :on-success="handleSuccess"
|
|
|
+ :on-success="(value)=> imageChange(item.label, value)"
|
|
|
+ :on-remove="(file,filelist)=> handleRemove(item.label, file,filelist)"
|
|
|
>
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
@@ -556,7 +557,8 @@ a {
|
|
|
action="/api/admin/uploadfile"
|
|
|
list-type="picture-card"
|
|
|
:on-preview="handlePreview"
|
|
|
- :on-remove="handleRemove"
|
|
|
+ :on-remove="(file,filelist)=> handleRemove(iitem.label + '(' + item.label + ')', file,filelist)"
|
|
|
+ :on-success="(value)=> imageChange(iitem.label + '(' + item.label + ')', value)"
|
|
|
>
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
@@ -821,8 +823,18 @@ export default {
|
|
|
handlePreview(){
|
|
|
|
|
|
},
|
|
|
- handleRemove(){
|
|
|
-
|
|
|
+ handleRemove(label,file,filelist){
|
|
|
+ console.log(label,filelist)
|
|
|
+ let imgs=[];
|
|
|
+ for(let i=0;i<filelist.length;i++){
|
|
|
+ imgs.push(filelist[i].response.data)
|
|
|
+ }
|
|
|
+ this.form2[label]=imgs
|
|
|
+ },
|
|
|
+ imageChange(label,data){
|
|
|
+ console.log(label,data)
|
|
|
+ this.form2[label].push(data.data)
|
|
|
+
|
|
|
},
|
|
|
switchStatus(row) {
|
|
|
if (row.status == 1) {
|
|
|
@@ -920,7 +932,7 @@ export default {
|
|
|
this.widgetList = res.data.data.widget;
|
|
|
let rules1 = {};
|
|
|
this.widgetList.forEach((i) => {
|
|
|
- if (i.type == "checkbox") {
|
|
|
+ if (i.type == "checkbox"||i.type == "image") {
|
|
|
// _this.form2[i.label] = [] ;
|
|
|
_this.$set(_this.form2, i.label, []);
|
|
|
}
|