@ -1,8 +1,7 @@
< script setup >
import { ref } from 'vue'
import { onMounted } from 'vue'
import { useRouter , useRoute } from 'vue-router'
import { useRouter , useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user'
import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService'
import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs'
@ -10,7 +9,7 @@ import component from 'element-plus/es/components/tree-select/src/tree-select-op
const recordList = ref ( [ ] )
const userStore = useUserStore ( )
onMounted ( ( ) => {
onMounted ( ( ) => {
userStore . getUserInfo ( )
} )
const sp = "https://wenyu132.oss-cn-beijing.aliyuncs.com/wenyu/merge.mp4"
@ -42,8 +41,8 @@ const getrecordList = async () => {
/ / 跳 转 页 面 ( 返 回 上 级 目 录 )
const goToAnotherPage = ( ) => {
router . push ( {
path : '/myCourseStudyManagement/learningProcess1' ,
query : {
path : '/myCourseStudyManagement/learningProcess1' ,
query : {
courseId : route . query . courseId
}
} )
@ -51,7 +50,7 @@ const goToAnotherPage = () => {
getrecordList ( )
/ / 上 传 文 件
const upload = async ( file ) => {
const upload = async ( file ) => {
console . log ( file ) ;
console . log ( file . raw ) ;
new FormData ( file )
@ -61,85 +60,41 @@ const upload = async(file) => {
}
/ / c o n s t v i d e o = t h i s . $ r e f s . v i d e o R e f ;
function beforeAvatarUpload ( ) { } ;
const imageUrl = ''
< / script >
< style lang = "scss" scoped > < / style >
< template >
<!-- 头部 -- >
< div class = "header" >
< el -button type = "primary" plain > 浏览记录 < / e l - b u t t o n >
< el -button
type = "primary"
plain
@ click = "goToAnotherPage"
style = "float: right"
>
返回上级目录
< / e l - b u t t o n >
< / div >
<!-- 中间 -- >
< div class = "record-list" >
< ul v-if ="recordList.length > 0" >
< li >
< div
style = "
display : flex ;
justify - content : space - between ;
flex - grow : 1 ;
margin - top : 10 px ;
margin - bottom : 10 px ;
background - color : aqua ;
"
>
< p >
资源名称
< / p >
< p >
学习时间
< / p >
< p >
学习人数
< / p >
< / div >
< / li >
< li v -for = " record in recordList " :key ="record.id" >
< div
style = "
display : flex ;
justify - content : space - between ;
flex - grow : 1 ;
margin - top : 10 px ;
margin - bottom : 10 px ;
"
>
< p >
{ { record . resourceName } }
< / p >
< p >
{ { record . time } }
< / p >
< p >
{ { record . number } }
< / p >
< / div >
< / li >
< / ul >
< el -empty v -else description = "暂时没有浏览记录" / >
< / div >
< hr >
< el -upload
class = "avatar-uploader"
: show - file - list = "false"
: auto - upload = "false"
: before - upload = "beforeAvatarUpload"
: on - change = "upload"
>
< img v -if = " imageUrl " :src ="imageUrl" class = "avatar" / >
< el -icon v -else class = "avatar-uploader-icon" > < Plus / > < / e l - i c o n >
< / e l - u p l o a d >
<!-- autoplay -- >
<!-- 头部 -- >
< div class = "header" >
< el -button type = "primary" plain > 浏览记录 < / e l - b u t t o n >
< el -button type = "primary" plain @click ="goToAnotherPage" style = "float: right" >
返回上级目录
< / e l - b u t t o n >
< / div >
<!-- 中间 -- >
< div class = "record-list" >
< el -table class = "table" :data ="recordList" border style = "width: 100%" >
< el -table -column prop = "resourceName" label = "资源名称" / >
< el -table -column prop = "time" label = "学习时间" / >
< el -table -column prop = "number" label = "学习人数" / >
< template # empty >
< el -empty description = "暂时没有浏览记录" / >
< / template >
< / e l - t a b l e >
< / div >
< hr >
< el -upload class = "avatar-uploader" :show-file-list ="false" :auto-upload ="false" :before-upload ="beforeAvatarUpload"
: on - change = "upload" >
< img v -if = " imageUrl " :src ="imageUrl" class = "avatar" / >
< el -icon v -else class = "avatar-uploader-icon" >
< Plus / >
< / e l - i c o n >
< / e l - u p l o a d >
<!-- autoplay -- >
<!-- < video ref = "videoRef" controls width = "600" >
< source :src ="sp" type = "video/mp4" / >
< / video > -- >
@ -148,7 +103,13 @@ const upload = async(file) => {
< video ref = "videoRef" controls = "true" :controlslist ="nodownload" @contextmenu ="handleContextMenu" > < / video >
< / div > -- >
< / template >
< / template >
< style lang = "scss" scoped >
: : v - deep . table {
. el - scrollbar _ _wrap {
padding : 0 ! important ;
}
}
< / style >