mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 20:36:43 +08:00
Merge branch 'zcwy_0806_paihangb' into dev0515
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
:show-file-list="showList"
|
:show-file-list="showList"
|
||||||
:data="data"
|
:data="data"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
|
:on-remove="handleRemove"
|
||||||
class="upload-file-uploader"
|
class="upload-file-uploader"
|
||||||
ref="upload"
|
ref="upload"
|
||||||
>
|
>
|
||||||
@@ -142,6 +143,9 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleRemove(file, fileList){
|
||||||
|
this.$emit('isTrue',false)
|
||||||
|
},
|
||||||
// 上传前校检格式和大小
|
// 上传前校检格式和大小
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
if(this.beforeMsg){
|
if(this.beforeMsg){
|
||||||
@@ -186,6 +190,8 @@ export default {
|
|||||||
if(this.loading) {
|
if(this.loading) {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
}
|
}
|
||||||
|
this.$emit('isTrue',true)
|
||||||
|
this.$emit('isFalse',true)
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
// 文件个数超出
|
// 文件个数超出
|
||||||
@@ -195,6 +201,7 @@ export default {
|
|||||||
// 上传失败
|
// 上传失败
|
||||||
handleUploadError(err) {
|
handleUploadError(err) {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
this.$emit('isTrue',false)
|
||||||
this.$message({message:"上传失败, 请重试",type:'error',offset:100});
|
this.$message({message:"上传失败, 请重试",type:'error',offset:100});
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
|
|||||||
@@ -149,7 +149,7 @@
|
|||||||
<el-checkbox v-model="deviceMobile" @change="isVisible(1)" label="移动端可见" border></el-checkbox>
|
<el-checkbox v-model="deviceMobile" @change="isVisible(1)" label="移动端可见" border></el-checkbox>
|
||||||
<el-checkbox v-model="devicePc" @change="isVisible(2)" label="pc端可见" border></el-checkbox>
|
<el-checkbox v-model="devicePc" @change="isVisible(2)" label="pc端可见" border></el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<file-upload scorm="zip" dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
<file-upload scorm="zip" dir="files" @isFalse="isFalseChange" @isTrue="isTrueChange" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -281,6 +281,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isTrue: false,
|
isTrue: false,
|
||||||
|
isFalse: false,
|
||||||
resOwnerListMap: [],
|
resOwnerListMap: [],
|
||||||
//fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
//fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||||
fileBaseUrl:this.$xpage.constants.fileBaseUrl, //获成动态获取的处理
|
fileBaseUrl:this.$xpage.constants.fileBaseUrl, //获成动态获取的处理
|
||||||
@@ -393,6 +394,12 @@ export default {
|
|||||||
this.search();
|
this.search();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isTrueChange(val){
|
||||||
|
this.isTrue = val
|
||||||
|
},
|
||||||
|
isFalseChange(val){
|
||||||
|
this.isFalse = val
|
||||||
|
},
|
||||||
beforeCheck(){
|
beforeCheck(){
|
||||||
if(!this.upload.orgId ||!this.upload.orgName){
|
if(!this.upload.orgId ||!this.upload.orgName){
|
||||||
return false;
|
return false;
|
||||||
@@ -535,7 +542,6 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
handleUploadSuccess(rs) {
|
handleUploadSuccess(rs) {
|
||||||
this.isTrue = true;
|
|
||||||
if (rs.status === 200) {
|
if (rs.status === 200) {
|
||||||
let type = toContentType(rs.result.fileType);
|
let type = toContentType(rs.result.fileType);
|
||||||
// ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3"]
|
// ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3"]
|
||||||
@@ -573,11 +579,11 @@ export default {
|
|||||||
this.isTrue = false;
|
this.isTrue = false;
|
||||||
}else{
|
}else{
|
||||||
this.$message.error(res.message);
|
this.$message.error(res.message);
|
||||||
this.isTrue = true
|
this.isFalse = false
|
||||||
}
|
}
|
||||||
}).catch (error=>{
|
}).catch (error=>{
|
||||||
console.log(error,'error')
|
console.log(error,'error')
|
||||||
this.isTrue = true
|
this.isFalse = false
|
||||||
//this.$message.error(error);
|
//this.$message.error(error);
|
||||||
});
|
});
|
||||||
// const { result, status } = coueseFile.saveUpload(data);
|
// const { result, status } = coueseFile.saveUpload(data);
|
||||||
@@ -606,17 +612,26 @@ export default {
|
|||||||
},
|
},
|
||||||
handleCloseCheck(done){
|
handleCloseCheck(done){
|
||||||
//console.log('关闭的处理aaaaa');
|
//console.log('关闭的处理aaaaa');
|
||||||
|
if(this.isTrue&&this.isFalse){
|
||||||
|
this.$message.error('文件正在上传中,请耐心等待');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(this.fileList.length>0){
|
if(this.fileList.length>0){
|
||||||
this.$message.error('有待保存的上传文件,请执行保存操作');
|
this.$message.error('有待保存的上传文件,请执行保存操作');
|
||||||
return false;
|
return false;
|
||||||
}else{
|
}else{
|
||||||
this.isTrue = false
|
this.isTrue = false
|
||||||
|
this.isFalse = false
|
||||||
return done(true);
|
return done(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 文件上传保存
|
// 文件上传保存
|
||||||
saveUpload() {
|
saveUpload() {
|
||||||
|
if(this.fileList.length<=0){
|
||||||
|
this.$message.error('请上传文件');
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(!this.upload.orgName){
|
if(!this.upload.orgName){
|
||||||
this.$message.success('请选择资源归属');
|
this.$message.success('请选择资源归属');
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user