From e8eddd1486ede2a8f4c27d2cca612ad0c3c9df75 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Wed, 25 Dec 2024 18:28:12 +0800
Subject: [PATCH] fix
---
src/pages/lesson/content/index.vue | 80 ++++++----
src/pages/lesson/content/source.vue | 231 +++++++++++++++++++++-------
src/pages/resourse/list/index.vue | 4 +-
src/pages/resourse/upload.vue | 1 +
4 files changed, 223 insertions(+), 93 deletions(-)
diff --git a/src/pages/lesson/content/index.vue b/src/pages/lesson/content/index.vue
index 1226cd3..08d4e0d 100644
--- a/src/pages/lesson/content/index.vue
+++ b/src/pages/lesson/content/index.vue
@@ -38,38 +38,44 @@
-
+
- -
-
-

-
-
{{ i + 1 }}.
-

-

-

-

-

-

-

-
{{ section.name }}
-
-
- 下载
- 预览
- 修改资源名称
- 更换
- 移除
-
-
+
+ -
+
+

+
+
{{ i + 1 }}.
+

+

+

+

+

+

+

+
{{ section.name }}
+
+
+ 下载
+ 预览
+ 修改资源名称
+ 更换
+ 移除
+
+
+
+
+

+
暂无数据
+
@@ -400,13 +406,6 @@ export default {
Oss.del(this.fileUrl)
this.fileUrl = ''
},
- uploadSure () {
- this.importVisible = false
- this.pageNo = 1
- this.staffGradeId = ''
- this.keyword = ''
- this.getTeacher()
- },
transferType (ext) {
if ("jpg,jpeg,png,gif,svg,psd".includes(ext)) return "图片";
if ("mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv".includes(ext)) return "视频";
@@ -956,7 +955,7 @@ export default {
.left {
width: 400px;
- height: calc(100vh - 247px);
+ height: calc(100vh - 375px);
padding: 0 15px 15px 0;
margin-right: 20px;
border-right: 1px solid #eee;
@@ -1001,7 +1000,9 @@ export default {
flex: 1;
.sections {
+ max-height: calc(100vh - 429px);
margin-top: 20px;
+ overflow: auto;
li {
display: flex;
@@ -1038,6 +1039,17 @@ export default {
}
}
+.none {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ height: 100%;
+ font-size: 14px;
+ text-align: center;
+ color: #a3a3a3;
+}
+
/deep/.source-list {
display: flex;
gap: 10px;
diff --git a/src/pages/lesson/content/source.vue b/src/pages/lesson/content/source.vue
index f9044a6..d8d10e1 100644
--- a/src/pages/lesson/content/source.vue
+++ b/src/pages/lesson/content/source.vue
@@ -3,53 +3,86 @@
custom-class="source-dia" @closed="closeDia">
-
-
+
-
-
-
-
-
-
![]()
-
{{ course.curriculumName }}
-
-
-
-
-
-
- {{
- chapter.name
- }}
-
+
+
+
+
+
+
+
+
+
![]()
+
{{ course.curriculumName }}
+
+
+
+
+
+
+ {{
+ chapter.name
+ }}
+
-
-
+
+
+
+
@@ -67,7 +100,7 @@
-
+
{{ i + 1 }}
@@ -84,6 +117,7 @@
暂无数据
+
@@ -97,6 +131,7 @@
import Setting from '@/setting'
import Util from '@/libs/util'
import _ from 'lodash'
+import SourceConst from '@/const/source'
export default {
props: ['visible'],
data () {
@@ -108,6 +143,9 @@ export default {
tab2: '精品课程',
tab3: '文件素材',
},
+ sourceType: SourceConst.types,
+ sources: [],
+ checkAll: false,
keyword: '',
searchTimer: null,
checkedKeyword: '',
@@ -138,38 +176,59 @@ export default {
init () {
this.getCourse()
this.checked = []
+ this.sourceType.forEach(e => {
+ e.check = false
+ })
},
// 课程列表
async getCourse () {
try {
this.loading = true
- const { list } = await this.$post(`${this.api[this.active === 'tab1' ? 'curriculumTree' : 'boutiqueCurriculumTree']}?name=${this.keyword}`)
- if (list.length) {
- const all = []
+ this.checkAll = false
+ if (this.active === 'tab3') {
+ const { page } = await this.$post(this.api.resourceLibrary, {
+ pageNum: 1,
+ pageSize: 10000,
+ platformId: Setting.platformId,
+ type: 2,
+ keyword: this.keyword,
+ displayFileType: this.sourceType.filter(e => e.check).map(e => e.name),
+ })
+ const list = page.records
list.forEach(e => {
- e.shrink = false
+ e.name = e.resourceName
e.check = false
- e.chapters.forEach(n => {
- n.shrink = false
- n.check = false
- all.push(...n.subsections)
- n.subsections.forEach(m => {
- m.check = false
+ })
+ this.sources = list
+ } else {
+ const { list } = await this.$post(`${this.api[this.active === 'tab1' ? 'curriculumTree' : 'boutiqueCurriculumTree']}?name=${this.keyword}`)
+ if (list.length) {
+ const all = []
+ list.forEach(e => {
+ e.shrink = false
+ e.check = false
+ e.chapters.forEach(n => {
+ n.shrink = false
+ n.check = false
+ all.push(...n.subsections)
+ n.subsections.forEach(m => {
+ m.check = false
+ })
})
})
- })
- list[0].shrink = true
- list[0].chapters[0].shrink = true
- this.allSections = all
+ list[0].shrink = true
+ list[0].chapters[0].shrink = true
+ this.allSections = all
+ }
+ this.course = list
}
- this.course = list
} finally {
this.loading = false
}
},
initData () {
- this.page = 1
- this.getData()
+ this.page = 1;
+ this.getData();
},
tabChange (index) {
this.active = index
@@ -231,6 +290,28 @@ export default {
}
chapter.check = chapter.subsections.every(e => e.check)
},
+ // 资源全选回调
+ checkAllChange (val) {
+ this.sources.map(e => {
+ e.check = val
+ this.sourceChange(e)
+ })
+ },
+ // 资源列表选择回调
+ sourceChange (row) {
+ const { check } = row
+ const { checked } = this
+ const cur = checked.findIndex(m => m.id === row.id)
+ if (check) {
+ if (cur === -1) {
+ const section = _.cloneDeep(row)
+ section.check = false
+ this.checked.push(section)
+ }
+ } else {
+ cur !== -1 && this.checked.splice(cur, 1)
+ }
+ },
// 批量移除
async batchDelChecked (val) {
@@ -270,7 +351,7 @@ export default {
chapterId,
cid: id,
resourceId: e.id,
- type: e.cid ? 0 : 1,
+ type: e.cid ? 0 : e.resourceName ? 2 : 1,
}
})
@@ -345,8 +426,7 @@ export default {
.left {
width: 700px;
- padding: 0 20px;
- padding: 15px;
+ padding: 0 15px;
border-right: 1px solid #eee;
box-sizing: border-box;
@@ -379,6 +459,10 @@ export default {
.check {
margin: 0 10px;
+
+ img {
+ vertical-align: middle;
+ }
}
.cover {
@@ -416,6 +500,12 @@ export default {
flex: 1;
padding: 15px;
+ .total {
+ font-size: 15px;
+ color: #333;
+ font-weight: 600;
+ }
+
.lines {
height: calc(100vh - 228px);
padding-right: 10px;
@@ -451,5 +541,32 @@ export default {
cursor: pointer;
}
}
+
+ .materials {
+ display: flex;
+ gap: 20px;
+ }
+
+ .types {
+ width: 250px;
+ height: calc(100vh - 223px);
+ padding: 15px;
+ background-color: #f9f9f9;
+ box-sizing: border-box;
+ overflow: auto;
+
+ .line {
+ margin-bottom: 10px;
+ }
+ }
+
+ .sources {
+ flex: 1;
+ padding: 10px;
+
+ .line {
+ margin-top: 8px;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/pages/resourse/list/index.vue b/src/pages/resourse/list/index.vue
index d6db333..2f30c7a 100644
--- a/src/pages/resourse/list/index.vue
+++ b/src/pages/resourse/list/index.vue
@@ -43,7 +43,7 @@
-
-
+
@@ -198,7 +198,7 @@ export default {
keyword: '',
startTime: '',
endTime: '',
- displayFileType: '',
+ displayFileType: [],
editor: '',
},
multipleSelection: [],
diff --git a/src/pages/resourse/upload.vue b/src/pages/resourse/upload.vue
index 47b70e6..ccd29ae 100644
--- a/src/pages/resourse/upload.vue
+++ b/src/pages/resourse/upload.vue
@@ -138,6 +138,7 @@ export default {
platformId: Setting.platformId,
...form
})
+ this.submiting = false
this.uploadVisible = false
},
// 弹框关闭回调