Commit 03ed499e authored by 仇晓婷's avatar 仇晓婷

上传优化

parent f0982b31
......@@ -82,7 +82,8 @@ export default {
per: 0,
vshowPro: false,
Photo: true,
isactive: 0
isactive: 0,
imgId: null
};
},
created() {},
......@@ -128,6 +129,8 @@ export default {
},
methods: {
listData(li, index) {
this.imgId = li.id;
this.$emit("clickItem", this.downUrl + li.filePath, li.filePath);
this.isactive = index;
},
......@@ -158,7 +161,6 @@ export default {
objImag.id = file.response.data.id;
filesList.push(objImag);
this.nameList = this.nameList.concat(filesList);
console.log(this.nameList);
this.per = 100;
setTimeout(() => {
this.per = 0;
......@@ -196,6 +198,10 @@ export default {
return item.id === name;
});
this.nameList.splice(index, 1);
if (name == this.imgId) {
this.$emit("on-delete");
}
} else {
this.$Message.error("删除失败!");
}
......
......@@ -65,7 +65,14 @@
</Col>
<Col :span="24">
<FormItem :label="l('productUrlList')" prop="productUrlList">
<files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" />
<files
ref="refFile"
:parms="parms"
fileFormat
:Photos="true"
@clickItem="clickData"
@on-delete="deleteImg"
/>
</FormItem>
</Col>
</Row>
......@@ -155,6 +162,9 @@ export default {
this.img = liUrl;
this.entity.productUrl = liUrl;
},
deleteImg() {
this.img = "";
},
handleSelect1(v, data) {
this.entity.madeCompanyTitle = data.name;
},
......
......@@ -61,7 +61,14 @@
</Col>
<Col :span="24">
<FormItem :label="l('productUrlList')" prop="productUrlList">
<files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" />
<files
ref="refFile"
:parms="parms"
fileFormat
:Photos="true"
@clickItem="clickData"
@on-delete="deleteImg"
/>
</FormItem>
</Col>
</Row>
......@@ -144,6 +151,9 @@ export default {
this.img = liUrl;
this.entity.productUrl = liUrl;
},
deleteImg() {
this.img = "";
},
handleSelect1(v, data) {
this.entity.madeCompanyTitle = data.name;
},
......
......@@ -94,7 +94,7 @@ export default {
id: Number,
parentName: String,
ids: String,
bomId:Number,
bomId: Number
}
},
data() {
......@@ -102,8 +102,9 @@ export default {
action: Api.index,
fullscreen: false,
easySearch: {
keys: { op: "mmcode,name,productCode", value: null },
levelId: { op: "In", value: this.id }
keys: { op: "mmcode,name", value: null },
levelId: { op: "In", value: this.id },
upId: { op: "In", value: 0 }
},
modal: false,
title: "新增",
......
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