|
@@ -50,7 +50,7 @@ export default {
|
|
|
accept: "",
|
|
|
fileTypeName: "",
|
|
|
uploadName: "",
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -75,7 +75,7 @@ export default {
|
|
|
SessionID +
|
|
|
"&SecurityLevel=Mid"
|
|
|
);
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
datafileList: {
|
|
@@ -83,8 +83,8 @@ export default {
|
|
|
this.initUpload();
|
|
|
},
|
|
|
// 深度观察监听
|
|
|
- deep: true
|
|
|
- }
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
@@ -127,12 +127,12 @@ export default {
|
|
|
lock: true,
|
|
|
text: "Loading",
|
|
|
spinner: "el-icon-loading",
|
|
|
- background: "rgba(0, 0, 0, 0.7)"
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
});
|
|
|
},
|
|
|
handleRemove(file, fileList) {
|
|
|
console.log(fileList);
|
|
|
- this.changeFillId(fileList);
|
|
|
+ this.changeFillId(fileList, "", this.index);
|
|
|
this.$message.success("移除成功");
|
|
|
},
|
|
|
beforeRemove(file, fileList) {
|
|
@@ -143,48 +143,49 @@ export default {
|
|
|
this.$message.warning(
|
|
|
`当前限制选择 ${
|
|
|
this.filleNumber ? this.filleNumber : 1
|
|
|
- } 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length +
|
|
|
- fileList.length} 个文件`
|
|
|
+ } 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
+ files.length + fileList.length
|
|
|
+ } 个文件`
|
|
|
);
|
|
|
},
|
|
|
initUpload() {
|
|
|
this.fileList = this.datafileList || [];
|
|
|
- let name = '只能上传';
|
|
|
+ let name = "只能上传";
|
|
|
switch (this.uploadType) {
|
|
|
case "image":
|
|
|
this.accept = "image/*";
|
|
|
this.fileTypeName = "图片";
|
|
|
- this.uploadName = name + '图片';
|
|
|
+ this.uploadName = name + "图片";
|
|
|
break;
|
|
|
case "mp3":
|
|
|
this.accept = "audio/*";
|
|
|
this.fileTypeName = "音频";
|
|
|
- this.uploadName = name + '音频';
|
|
|
+ this.uploadName = name + "音频";
|
|
|
break;
|
|
|
case "pdf":
|
|
|
this.accept = ".pdf";
|
|
|
this.fileTypeName = "pdf";
|
|
|
- this.uploadName = name + 'pdf';
|
|
|
+ this.uploadName = name + "pdf";
|
|
|
break;
|
|
|
case "xls":
|
|
|
this.accept = ".xls,.xlsx";
|
|
|
this.fileTypeName = "表格";
|
|
|
- this.uploadName = name + '表格';
|
|
|
+ this.uploadName = name + "表格";
|
|
|
break;
|
|
|
case "lrc":
|
|
|
this.accept = ".lrc";
|
|
|
this.fileTypeName = "lrc";
|
|
|
- this.uploadName = name + 'lrc';
|
|
|
+ this.uploadName = name + "lrc";
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
this.accept = "*";
|
|
|
this.fileTypeName = "文件";
|
|
|
- this.uploadName = '';
|
|
|
+ this.uploadName = "";
|
|
|
break;
|
|
|
}
|
|
|
- }
|
|
|
- } // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ },
|
|
|
+ }, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|