Commit be376af9 authored by liwei's avatar liwei

修改bug

parent 69105779
......@@ -679,9 +679,11 @@ export default {
return commonField
}
},
mounted() {
created() {
// 尝试查询数据
this.loadCatalog()
},
mounted() {
this.getUploadType() // 查询上传类型
},
methods: {
......@@ -1043,6 +1045,59 @@ export default {
})
},
// 查询课程目录
elseLoadCatalog(lessonId) {
// 清空原课时信息
this.classCurrent = ''
// 清空原章节列表
this.chapterList = ''
// 点击目录的时候会传课程id与课时,如果组件中没有课程id则不加载
if (lessonId !== undefined || this.lessonId !== '') {
// console.log('查询课程目录!');
const loading = this.$loading({
lock: true,
text: '正在加载课程目录...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
customClass: 'myLoading'
})
const _this = this
const params = {
lessonId: lessonId,
lessonOrSl: 1
}
queryBChaptersWithoutAuth(params).then(res => {
loading.close()
_this.chapterList = res.data.chapterList
console.log('章节列表:', _this.chapterList)
// 赋文件上传路径
_this.resForm.resUrl = _this.HTTPApi + 'bfile/uploadVideo'
// 统计当前课时
const classCurrent = 0
for (let i = 0; i < _this.chapterList.length; i++) {
this.$set(_this.chapterList[i], 'inputDisabled', true)
for (let j = 0; j < _this.chapterList[i].childList.length; j++) {
this.$set(_this.chapterList[i].childList[j], 'inputDisabled', true)
// classCurrent += parseInt(_this.chapterList[i].childList[j].classHour)
for (let k = 0; k < _this.chapterList[i].childList[j].childList.length; k++) {
this.$set(_this.chapterList[i].childList[j].childList[k], 'inputDisabled', true)
// classCurrent += parseInt(_this.chapterList[i].childList[j].childList[k].classHour)
}
}
}
_this.classCurrent = classCurrent
// 关闭loading
loading.close()
}).catch((err) => {
_this.$notify({
title: '失败',
message: '网络错误3',
type: 'error'
})
loading.close()
})
}
},
// 查询课程目录
loadCatalog(lessonId, classHours, lessonName, code, dirId, stuMeansFile, cpage) {
this.lessonId = lessonId
this.currentPage = cpage
......@@ -2132,7 +2187,8 @@ export default {
console.log('yesLoadingyesLoadingyesLoadingyesLoading', this.uploadList.some(item => item.yesLoading === true))
if (this.uploadList.length < 1 || (this.uploadList.some(item => item.uploadStatus === '上传中') === false && this.uploadList.some(item => item.yesLoading === true) === false)) {
this.batchDialog = false
this.loadCatalog()
// this.loadCatalog()
this.elseLoadCatalog(this.lessonId)
} else {
this.$confirm('当前还有文件在上传中是否确认关闭?', '提示', {
confirmButtonText: '确定',
......@@ -2140,7 +2196,8 @@ export default {
type: 'warning'
}).then(() => {
this.batchDialog = false
this.loadCatalog()
// this.loadCatalog()
this.elseLoadCatalog(this.lessonId)
}).catch(() => {
})
}
......@@ -2566,7 +2623,7 @@ export default {
message: '删除成功',
type: 'success'
})
this.loadCatalog()
this.elseLoadCatalog(this.lessonId)
if (type === 0) {
this.openUploadDialog('视频维护', this.saveItem, type, '只能上传以.mp4格式结尾的文件', res.data.videoUrl)
} else {
......
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