|
|
@@ -20,10 +20,10 @@
|
|
|
</filterList>
|
|
|
</div>
|
|
|
<!--课件列表-->
|
|
|
- <div class="file" v-if="list.length != 0 && tool.checkAuth($route.name,'read')">
|
|
|
+ <div class="file" v-if="list.length != 0 && tool.checkAuth($route.name,'read')" v-pullElementLoad="pullElementLoad">
|
|
|
<div class="file-item" v-for="(item,index) in list" :key="index" @click="itemClick(item)">
|
|
|
<div class="top">
|
|
|
- <el-image style="width: 100%; height: 100%" :src="item.cover || require('@/assets/video.png')" fit="fill">
|
|
|
+ <el-image style="width: 100%; height: 100%" :src="getCover(item)" fit="none">
|
|
|
</el-image>
|
|
|
</div>
|
|
|
<div class="bottom">
|
|
|
@@ -41,9 +41,9 @@
|
|
|
</div>
|
|
|
<el-empty description="暂无数据" v-else></el-empty>
|
|
|
<!--分页-->
|
|
|
- <pagination :total="total" :pageSize="param.content.pageSize" :currentPage="param.content.pageNumber"
|
|
|
+ <!-- <pagination :total="total" :pageSize="param.content.pageSize" :currentPage="param.content.pageNumber"
|
|
|
@pageChange="pageChange">
|
|
|
- </pagination>
|
|
|
+ </pagination> -->
|
|
|
</div>
|
|
|
<div v-if="activeName=='学习足迹'">
|
|
|
<div class="header-panl">
|
|
|
@@ -53,7 +53,7 @@
|
|
|
</filterList>
|
|
|
</div>
|
|
|
<!--课件列表-->
|
|
|
- <div class="file" v-if="list.length != 0 && tool.checkAuth($route.name,'read')">
|
|
|
+ <div class="file" v-pullElementLoad="pullElementLoad2" v-if="list.length != 0 && tool.checkAuth($route.name,'read')">
|
|
|
<div class="file-item" v-for="(item,index) in list2" :key="index" @click="itemClick(item)" style="width:240px">
|
|
|
<div class="top" style="width:240px">
|
|
|
<el-image style="width: 100%; height: 100%" :src="item.cover || require('@/assets/video.png')" fit="fill">
|
|
|
@@ -69,9 +69,9 @@
|
|
|
</div>
|
|
|
<el-empty description="暂无数据" v-else></el-empty>
|
|
|
<!--分页-->
|
|
|
- <pagination :total="total2" :pageSize="param2.content.pageSize" :currentPage="param2.content.pageNumber"
|
|
|
+ <!-- <pagination :total="total2" :pageSize="param2.content.pageSize" :currentPage="param2.content.pageNumber"
|
|
|
@pageChange="pageChange2">
|
|
|
- </pagination>
|
|
|
+ </pagination> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--课程详情-->
|
|
|
@@ -100,7 +100,7 @@ export default {
|
|
|
"content": {
|
|
|
nocache: true,
|
|
|
"pageNumber": 1,
|
|
|
- "pageSize": 12,
|
|
|
+ "pageSize": 30,
|
|
|
"where": {
|
|
|
"condition": "",
|
|
|
"sat_courseware_classid": ''
|
|
|
@@ -143,7 +143,9 @@ export default {
|
|
|
currentSelectFile: '',
|
|
|
activeName:'课程列表',
|
|
|
total2:0,
|
|
|
- list2:[]
|
|
|
+ list2:[],
|
|
|
+ totalPage:0,
|
|
|
+ totalPage2:0,
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
@@ -167,16 +169,42 @@ export default {
|
|
|
async getFileData () {
|
|
|
let res = await this.$api.requested(this.param)
|
|
|
this.total = res.total
|
|
|
- this.list = res.data
|
|
|
+ this.totalPage = res.pageTotal
|
|
|
+ for (let i = 0; i < res.data.length; i++) {
|
|
|
+ this.fileType.fileList(res.data[i].attinfos)
|
|
|
+ }
|
|
|
+ this.list = this.param.content.pageNumber == 1 ? res.data : this.list.concat(res.data)
|
|
|
this.param.content.sort = res.sort
|
|
|
},
|
|
|
+ pullElementLoad () {
|
|
|
+ if (this.param.content.pageNumber == this.totalPage) return
|
|
|
+ this.param.content.pageNumber += 1
|
|
|
+ this.getFileData()
|
|
|
+ console.log('触底');
|
|
|
+ },
|
|
|
//获取学习足迹
|
|
|
async getStudyHistory () {
|
|
|
let res = await this.$api.requested(this.param2)
|
|
|
this.total2 = res.total
|
|
|
- this.list2 = res.data
|
|
|
+ this.totalPage2 = res.pageTotal
|
|
|
+ this.list2 = this.param.content.pageNumber == 1 ? res.data : this.list2.concat(res.data)
|
|
|
this.param2.content.sort = res.sort
|
|
|
},
|
|
|
+ pullElementLoad2 () {
|
|
|
+ if (this.param2.content.pageNumber == this.totalPage2) return
|
|
|
+ this.param2.content.pageNumber += 1
|
|
|
+ this.getStudyHistory()
|
|
|
+ console.log('触底');
|
|
|
+ },
|
|
|
+ //获取封面
|
|
|
+ getCover(item) {
|
|
|
+ let result = this.fileType.getSpecifiedImage(item.attinfos.find(item1 => item1.fileType == 'image') || {subfiles:[]})
|
|
|
+ if (result) {
|
|
|
+ return result
|
|
|
+ } else {
|
|
|
+ return require('@/assets/video.png')
|
|
|
+ }
|
|
|
+ },
|
|
|
sortTypeChange (name) {
|
|
|
for (let i = 0; i < this.param.content.sort.length; i++) {
|
|
|
this.param.content.sort[i].sorted = this.param.content.sort[i].sortname == name ? 1 : 0
|
|
|
@@ -329,6 +357,8 @@ export default {
|
|
|
.normal-card1 .file {
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: calc(100vh - 330px);
|
|
|
}
|
|
|
.normal-card1 .file .file-item {
|
|
|
width: 220px;
|