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

上传优化

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