SCORM课件的上传

This commit is contained in:
daihh
2022-12-12 17:22:05 +08:00
parent 6f32244ab4
commit 1baef6b998
2 changed files with 69 additions and 24 deletions

View File

@@ -46,6 +46,10 @@ export default {
props: {
// 值
value: [String, Object, Array],
beforeMsg:{
type: String,
default:''
},
showList: {
type: Boolean,
default: false
@@ -78,7 +82,7 @@ export default {
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3"],
default: () => ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3","zip"],
},
// 是否显示提示
isShowTip: {
@@ -131,6 +135,10 @@ export default {
methods: {
// 上传前校检格式和大小
handleBeforeUpload(file) {
if(this.beforeMsg){
this.$message({message:this.beforeMsg,type:'error',offset:100})
return false;
}
// 校检文件类型
if (this.fileType) {
let fileExtension = "";
@@ -200,7 +208,7 @@ export default {
}
},
created() {
this.fileList = this.list;
},
};
@@ -215,14 +223,14 @@ export default {
line-height: 2;
margin-bottom: 10px;
position: relative;
}
.upload-file-list .ele-upload-list__item-content {
display: flex;
justify-content: space-between;
align-items: center;
color: inherit;
}
.ele-upload-list__item-content-action .el-link {
margin-right: 10px;