develoop
significative 3 months ago
parent 16b0f84bbf
commit ffaef9724e
  1. 103
      src/views/MyCourseStudy/knowledgeLearningProcess.vue
  2. 125
      src/views/MyCourseStudy/resourceLearning.vue

@ -1,14 +1,13 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { onMounted } 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 useUserStore from '@/store/modules/user'
import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService' import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService'
const recordList = ref([]) const recordList = ref([])
const userStore = useUserStore() const userStore = useUserStore()
onMounted(()=>{ onMounted(() => {
userStore.getUserInfo() userStore.getUserInfo()
}) })
const route = useRoute() const route = useRoute()
@ -34,10 +33,10 @@ const getrecordList = async () => {
recordList.value = res.data.records recordList.value = res.data.records
} }
// //
const goToAnotherPage = (address,courseId,knowledgeId) => { const goToAnotherPage = (address, courseId, knowledgeId) => {
router.push({ router.push({
path:address, path: address,
query:{ query: {
courseId: courseId, courseId: courseId,
knowledgeId: knowledgeId knowledgeId: knowledgeId
} }
@ -46,7 +45,7 @@ const goToAnotherPage = (address,courseId,knowledgeId) => {
//() //()
const goToAnotherPageback = () => { const goToAnotherPageback = () => {
router.push({ router.push({
path:'/myCourseStudyManagement/learningProcess' path: '/myCourseStudyManagement/learningProcess'
}) })
} }
getrecordList() getrecordList()
@ -54,68 +53,32 @@ getrecordList()
<style lang="scss" scoped></style> <style lang="scss" scoped></style>
<template> <template>
<!-- 头部 --> <!-- 头部 -->
<div class="header"> <div class="header">
<el-button type="primary" plain>浏览记录</el-button> <el-button type="primary" plain>浏览记录</el-button>
<el-button <el-button type="primary" plain @click="goToAnotherPageback" style="float: right">
type="primary" 返回上级目录
plain </el-button>
@click="goToAnotherPageback" </div>
style="float: right" <!-- 中间 -->
> <div class="record-list">
返回上级目录 <el-table class="table" :data="recordList" border style="width: 100%" :row-style="{ cursor: 'pointer' }"
</el-button> @row-click="record => goToAnotherPage('/myCourseStudyManagement/learningProcess2', record.coursesId, record.knowledgeId)">
</div> <el-table-column prop="knowledgeName" label="知识点名称" />
<!-- 中间 --> <el-table-column prop="time" label="学习时间" />
<div class="record-list"> <el-table-column prop="number" label="学习人数" />
<ul v-if="recordList.length > 0"> <template #empty>
<li> <el-empty description="暂时没有浏览记录" />
<div </template>
style=" </el-table>
display: flex; </div>
justify-content: space-between; </template>
flex-grow: 1;
margin-top: 10px;
margin-bottom: 10px;
background-color: aqua;
"
>
<p>
知识点名称
</p>
<p>
学习时间
</p>
<p>
学习人数
</p>
</div>
</li>
<li v-for="record in recordList" :key="record.id" @click="goToAnotherPage('/myCourseStudyManagement/learningProcess2',record.coursesId,record.knowledgeId)">
<div
style="
display: flex;
justify-content: space-between;
flex-grow: 1;
margin-top: 10px;
margin-bottom: 10px;
"
>
<p>
{{ record.knowledgeName}}
</p>
<p>
{{ record.time}}
</p>
<p>
{{record.number}}
</p>
</div>
</li>
</ul>
<el-empty v-else description="暂时没有浏览记录" />
</div>
</template>
<style lang="scss" scoped>
::v-deep .table {
.el-scrollbar__wrap {
padding: 0 !important;
}
}
</style>

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