|
@@ -40,7 +40,7 @@ export default {
|
|
url: { type: null },
|
|
url: { type: null },
|
|
limit: { type: Number },
|
|
limit: { type: Number },
|
|
data: { type: null },
|
|
data: { type: null },
|
|
- type: { type: String },
|
|
|
|
|
|
+ model: { type: String },
|
|
isBtn: { type: Boolean, default: false },
|
|
isBtn: { type: Boolean, default: false },
|
|
uploadBtn: { type: Boolean, default: false },
|
|
uploadBtn: { type: Boolean, default: false },
|
|
showList: { type: Boolean, default: true },
|
|
showList: { type: Boolean, default: true },
|
|
@@ -75,7 +75,7 @@ export default {
|
|
handleRemove(file, fileList) {
|
|
handleRemove(file, fileList) {
|
|
this.$set(this, `fileList`, []);
|
|
this.$set(this, `fileList`, []);
|
|
// let index = fileList.findIndex(f => _.isEqual(f, file));
|
|
// let index = fileList.findIndex(f => _.isEqual(f, file));
|
|
- this.$emit('delete', { file, type: this.type });
|
|
|
|
|
|
+ this.$emit('delete', { file, model: this.model });
|
|
return false;
|
|
return false;
|
|
},
|
|
},
|
|
outLimit() {
|
|
outLimit() {
|
|
@@ -83,7 +83,7 @@ export default {
|
|
},
|
|
},
|
|
onSuccess(response, file, fileList) {
|
|
onSuccess(response, file, fileList) {
|
|
//将文件整理好传回父组件
|
|
//将文件整理好传回父组件
|
|
- this.$emit('upload', { type: this.type, data: { ...response, name: file.name } });
|
|
|
|
|
|
+ this.$emit('upload', { model: this.model, data: { ...response, name: file.name } });
|
|
},
|
|
},
|
|
beforeUpload(file) {
|
|
beforeUpload(file) {
|
|
const sizeLimit = file.size / 1024 / 1024 < 100;
|
|
const sizeLimit = file.size / 1024 / 1024 < 100;
|
|
@@ -117,4 +117,8 @@ export default {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+/deep/.el-upload-list__item.is-ready {
|
|
|
|
+ display: none;
|
|
|
|
+}
|
|
|
|
+</style>
|