Commit 9c48b908 authored by 赵啸非's avatar 赵啸非

更新附件添加多个设置

parent f7aff401
......@@ -113,6 +113,42 @@ export default {
value: {
handler(val) {
if (val) {
this.showFileList();
// let temp = 1;
// // 首先将值转为数组
// const filePathlist = this.value.split(',');
// // 然后将数组转为对象数组
// const fileNamelist =this.fileName.split(',');
// for (var i = 0; i < filePathlist.length; i++) {
// let item = {}
// console.log(fileNamelist.length===filePathlist.length)
// if(fileNamelist.length===filePathlist.length){
// item.name = fileNamelist[i];
// }else{
// item.name = filePathlist[i];
// }
// item.url = filePathlist[i];
// item.uid = new Date().getTime() + temp++;
// this.fileList.push(item)
// }
} else {
this.fileList = [];
return [];
}
}
}
},
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
},
methods: {
showFileList(){
let temp = 1;
// 首先将值转为数组
const filePathlist = this.value.split(',');
......@@ -120,31 +156,19 @@ export default {
const fileNamelist =this.fileName.split(',');
for (var i = 0; i < filePathlist.length; i++) {
let item = {}
console.log(fileNamelist.length===filePathlist.length)
if(fileNamelist.length===filePathlist.length){
console.log(fileNamelist.length === filePathlist.length)
if (fileNamelist.length === filePathlist.length) {
item.name = fileNamelist[i];
}else{
} else {
item.name = filePathlist[i];
}
item.url = filePathlist[i];
item.uid = new Date().getTime() + temp++;
this.fileList.push(item)
}
} else {
this.fileList = [];
return [];
}
}
}
},
computed: {
// 是否显示提示
showTip() {
return this.isShowTip && (this.fileType || this.fileSize);
},
},
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
// 校检文件类型
......@@ -218,6 +242,8 @@ export default {
}
},
created() {
console.log("file create")
this.showFileList();
// this.fileList = this.list;
},
};
......
......@@ -102,7 +102,7 @@ function getComponent(fileName) {
try {
return require('./views/' + fileName).default
} catch (error) {
console.log("error:",error)
//console.log("error:",error)
return fileNotFound;
}
}
......
......@@ -125,8 +125,6 @@
},
/**获取数据后弹框 */
afterRender(data) {
console.log(data)
console.log(this.form)
this.open = true;
},
......
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