diff --git a/src/views/course/CoursewareAddOrUpdate.vue b/src/views/course/CoursewareAddOrUpdate.vue index a3816d1..3162ac0 100644 --- a/src/views/course/CoursewareAddOrUpdate.vue +++ b/src/views/course/CoursewareAddOrUpdate.vue @@ -6,10 +6,10 @@ - + - -
+ +
课件名称:  @@ -32,8 +32,9 @@

- 视频上传:  - + 视频上传:  + {{this.uploadButtonText}}     @@ -42,8 +43,8 @@
- -
+ +
课件名称:  @@ -66,8 +67,9 @@

- 文件上传:  - + 文件上传:  + {{this.uploadButtonText}}     @@ -203,22 +205,19 @@ export default { //判断是否加载数据 if (this.queryParam.coursewareId) this.load(); - // 是否资源库ifResources - console.log("资源库标号"+this.$route.query.ifResources+"课件ID:"+this.$route.query.coursewareId) + // 是否资源库ifResources + if (this.$route.query.coursewareId && this.$route.query.ifResources == 1) { + this.pageName = '资源库编辑'; + } else if (!this.$route.query.coursewareId && this.$route.query.ifResources == 1) { + this.pageName = '资源库新增'; + } - if(this.$route.query.coursewareId && this.$route.query.ifResources == 1 ) { - this.pageName = '资源库编辑' - }else if(!this.$route.query.coursewareId && this.$route.query.ifResources == 1){ - this.pageName = '资源库新增' - } - - if(this.$route.query.coursewareId && this.$route.query.ifResources == 0) { - this.pageName = '课件编辑' - }else if(!this.$route.query.coursewareId && this.$route.query.ifResources == 0){ - this.pageName = '课件新增' - } - -}, + if (this.$route.query.coursewareId && this.$route.query.ifResources == 0) { + this.pageName = '课件编辑'; + } else if (!this.$route.query.coursewareId && this.$route.query.ifResources == 0) { + this.pageName = '课件新增'; + } + }, methods: { //弹框 showModal() { @@ -248,7 +247,6 @@ export default { //顶级标签页 parentcallback(key) { - console.log(key); this.fileUpload.videoForm = {}; this.fileUpload.textForm = {}; this.videoPath = []; //置空文件 @@ -258,16 +256,15 @@ export default { callback(key) { this.fileUpload.videoForm = {}; this.fileUpload.textForm = {}; - console.log('aaaaaaa ', this.fileUpload.videoForm); - console.log('aaaaaaa ', this.fileUpload.textForm); this.videoPath = []; //置空文件 - this.successOssFile = this.successOssFile.splice(this.successOssFile.length, 0); //清空数组 - console.log('清除后的文件', this.successOssFile); + // this.successOssFile = this.successOssFile.splice(this.successOssFile.length, 0); //清空数组 + this.fileUpload.tabkey = key; //等于当前的Key - // 数据初始化 - // this.initialize(key) + for (let i = 0; i < this.successOssFile.length; i++) { + this.deleteVideo(this.successOssFile[i]); + } }, //获取Tonken @@ -308,13 +305,11 @@ export default { res.data.uuid = file.uid; res.data.size = file.size; - console.log('文件大小---', file.size); this.successOssFile.push(res.data); //刷新文件大小 this.refreshFileSize(); - console.log('上传之后的文件', this.successOssFile); } else { this.$message.error(res.data.msg); this.$refs.inputFile.value = ''; @@ -372,10 +367,9 @@ export default { //删除已上传的视频 deleteVideo(file) { - console.log('deleteVideo - file:{}', file); // 删除元素 for (let i = 0; i < this.successOssFile.length; i++) { - if (this.successOssFile[i].uuid == file.uid) { + if (this.successOssFile[i].uuid == file.uid || this.successOssFile[i].uuid == file.uuid) { this.successOssFile.splice(i, 1); break; } @@ -386,7 +380,6 @@ export default { //保存 save() { - console.log('this.ifResources', this.ifResources); //视频赋给表单里面的字段 this.successOssFile.forEach((item, index) => { @@ -407,7 +400,6 @@ export default { from = this.textFormV(); if (typeof from == 'boolean' && !from) return; } else if (this.parentTabKey == '2') { - console.log(this.videoServerLink); from = this.videoServerLinkV(); if (typeof from == 'boolean' && !from) return; } else if (this.parentTabKey == '3') { @@ -417,7 +409,6 @@ export default { //提交保存请求 coursewareAdd(from).then(res => { - console.log(res); if (res.code == 200) { this.$message.success('课件保存成功!'); this.goback(); @@ -445,7 +436,6 @@ export default { this.fileUpload.videoForm.ifResources = this.$route.query.ifResources || 0; let form = {}; form = this.fileUpload.videoForm; - console.log('FORM', form); return form; }, @@ -477,7 +467,6 @@ export default { //给课程ID this.videoServerLink.courseId = this.$route.query.courseId; this.videoServerLink.videoPath = this.videoPath; - console.log(this.videoServerLink); let form = {}; form = this.videoServerLink; @@ -495,7 +484,6 @@ export default { this.thirdAddress.courseId = this.$route.query.courseId; this.thirdAddress.videoPath = this.videoPath; - console.log(this.thirdAddress); let form = {}; form = this.thirdAddress; return form; @@ -508,8 +496,6 @@ export default { let parameter = {}; coursewareDeatil(Object.assign(parameter, this.queryParam)).then(res => { this.courseware = res.data; - console.log('加载数据了'); - console.log('courseware:', this.courseware); //编辑只能更改所在的位置的 this.fileUpload.disabled = true;