|
@@ -66,6 +66,10 @@ export default {
|
|
type: Array,
|
|
type: Array,
|
|
default: () => ['dwg', 'dwt', 'doc', 'docx', 'xls', 'xlsx', 'png', 'jpg', 'jpeg','mp4'],
|
|
default: () => ['dwg', 'dwt', 'doc', 'docx', 'xls', 'xlsx', 'png', 'jpg', 'jpeg','mp4'],
|
|
},
|
|
},
|
|
|
|
+ fileList: {
|
|
|
|
+ type: Array,
|
|
|
|
+ default: () => [],
|
|
|
|
+ },
|
|
// 是否显示提示
|
|
// 是否显示提示
|
|
isShowTip: {
|
|
isShowTip: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -83,36 +87,53 @@ export default {
|
|
headers: {
|
|
headers: {
|
|
Authorization: "Bearer " + getToken(),
|
|
Authorization: "Bearer " + getToken(),
|
|
},
|
|
},
|
|
- fileList: []
|
|
|
|
|
|
+ // fileList: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- watch: {
|
|
|
|
- // value: {
|
|
|
|
- // handler(val) {
|
|
|
|
- // if (val) {
|
|
|
|
- // // 首先将值转为数组
|
|
|
|
- // const list = Array.isArray(val) ? val : this.value.split(',');
|
|
|
|
- // // 然后将数组转为对象数组
|
|
|
|
- // this.fileList = list.map(item => {
|
|
|
|
- // if (typeof item === "object") {
|
|
|
|
- // item = {name: item.fileName, url: item.picUrl};
|
|
|
|
- // }
|
|
|
|
- // return item;
|
|
|
|
- // });
|
|
|
|
- // } else {
|
|
|
|
- // this.fileList = [];
|
|
|
|
- // return [];
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // deep: true,
|
|
|
|
- // immediate: true
|
|
|
|
- // }
|
|
|
|
- },
|
|
|
|
|
|
+ // watch: {
|
|
|
|
+ // value: {
|
|
|
|
+ // handler(val) {
|
|
|
|
+ // if (val) {
|
|
|
|
+ // // 首先将值转为数组
|
|
|
|
+ // const list = Array.isArray(val) ? val : this.value.split(',');
|
|
|
|
+ // // 然后将数组转为对象数组
|
|
|
|
+ // this.fileList = list.map(item => {
|
|
|
|
+ // if (typeof item === "object") {
|
|
|
|
+ // item = {name: item.fileName, url: item.picUrl};
|
|
|
|
+ // }
|
|
|
|
+ // return item;
|
|
|
|
+ // });
|
|
|
|
+ // } else {
|
|
|
|
+ // this.fileList = [];
|
|
|
|
+ // return [];
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // deep: true,
|
|
|
|
+ // immediate: true
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
computed: {
|
|
computed: {
|
|
// 是否显示提示
|
|
// 是否显示提示
|
|
showTip() {
|
|
showTip() {
|
|
return this.isShowTip && (this.fileType || this.fileSize);
|
|
return this.isShowTip && (this.fileType || this.fileSize);
|
|
},
|
|
},
|
|
|
|
+ fileList() {
|
|
|
|
+ console.log('qqqqqqqqqqqq')
|
|
|
|
+ const val = this.value;
|
|
|
|
+ if (val) {
|
|
|
|
+ // 首先将值转为数组
|
|
|
|
+ const list = Array.isArray(val) ? val : val.split(',');
|
|
|
|
+ // 然后将数组转为对象数组
|
|
|
|
+ return list.map(item => {
|
|
|
|
+ if (typeof item == "object") {
|
|
|
|
+ item = { name: item.fileName, url: item.picUrl };
|
|
|
|
+ }
|
|
|
|
+ return item;
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ return [];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
handlePreview(file) {
|
|
handlePreview(file) {
|