develoop
lijiaqi 4 months ago
commit 0b7db324da
  1. 1
      generated/index.ts
  2. 10
      generated/models/BaseResponse_List_CourseLearningRecords.ts
  3. 7
      generated/models/BaseResponse_List_LearningRecords_.ts
  4. 9
      generated/models/CourseLearningRecords.ts
  5. 9
      generated/models/LearningRecords.ts
  6. 114
      generated/services/LearningRecordsControllerService.ts
  7. 6
      package.json
  8. 9214
      pnpm-lock.yaml
  9. 1
      src/App.vue
  10. 3
      src/api/record.js
  11. BIN
      src/assets/images/test.mp4
  12. 1
      src/main.ts
  13. 20
      src/router/routers.ts
  14. 121
      src/views/MyCourseStudy/knowledgeLearningProcess.vue
  15. 38
      src/views/MyCourseStudy/learningProcess.vue
  16. 154
      src/views/MyCourseStudy/resourceLearning.vue
  17. 12
      src/views/courseResources/index.vue

@ -12,6 +12,7 @@ export type { BaseResponse_boolean_ } from './models/BaseResponse_boolean_';
export type { BaseResponse_CoursesDTO_ } from './models/BaseResponse_CoursesDTO_'; export type { BaseResponse_CoursesDTO_ } from './models/BaseResponse_CoursesDTO_';
export type { BaseResponse_List_CourseObjectivesTreeVO_ } from './models/BaseResponse_List_CourseObjectivesTreeVO_'; export type { BaseResponse_List_CourseObjectivesTreeVO_ } from './models/BaseResponse_List_CourseObjectivesTreeVO_';
export type { BaseResponse_List_CourseResources_ } from './models/BaseResponse_List_CourseResources_'; export type { BaseResponse_List_CourseResources_ } from './models/BaseResponse_List_CourseResources_';
export type {BaseResponse_List_CourseLearningRecords_} from './models/BaseResponse_List_CourseLearningRecords'
export type { BaseResponse_List_LearningRecords_ } from './models/BaseResponse_List_LearningRecords_'; export type { BaseResponse_List_LearningRecords_ } from './models/BaseResponse_List_LearningRecords_';
export type { BaseResponse_List_ObjectivesType_ } from './models/BaseResponse_List_ObjectivesType_'; export type { BaseResponse_List_ObjectivesType_ } from './models/BaseResponse_List_ObjectivesType_';
export type { BaseResponse_List_TeacherInfVO_ } from './models/BaseResponse_List_TeacherInfVO_'; export type { BaseResponse_List_TeacherInfVO_ } from './models/BaseResponse_List_TeacherInfVO_';

@ -0,0 +1,10 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { courseLearningRecords } from './CourseLearningRecords';
export type BaseResponse_List_CourseLearningRecords_ = {
code?: number;
data?: Array<courseLearningRecords>;
message?: string;
};

@ -9,3 +9,10 @@ export type BaseResponse_List_LearningRecords_ = {
message?: string; message?: string;
}; };
import type { courseLearningRecords } from './LearningRecords';
export type BaseResponse_List_CourseLearningRecords_ = {
code?: number;
data?: Array<courseLearningRecords>;
message?: string;
};

@ -0,0 +1,9 @@
export type courseLearningRecords = {
time?: string;
chapterId?: string;
coursesId?: string;
id?: string;
userId?: string;
img?: string;
};

@ -20,3 +20,12 @@ export type LearningRecords = {
userId?: string; userId?: string;
}; };
export type courseLearningRecords = {
time?: string;
chapterId?: string;
coursesId?: string;
id?: string;
userId?: string;
img?: string;
};

@ -47,6 +47,21 @@ export class LearningRecordsControllerService {
}, },
}); });
} }
public static deleteCourseRecords(
ids: Array<number>,
): CancelablePromise<BaseResponse_string_> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/courselearingrecord/delete',
query: {
'ids': ids,
},
errors: {
401: `Unauthorized`,
403: `Forbidden`,
},
});
}
/** /**
* getAll * getAll
* @param userId userId * @param userId userId
@ -75,6 +90,105 @@ export class LearningRecordsControllerService {
}, },
}); });
} }
//查询课程学习记录
public static courseLearningRecords(
userId: string,
pagenum: number = 1,
pagesize: number = 10,
): CancelablePromise<BaseResponse_Page_> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/courselearingrecord/page',
query: {
'pagenum': pagenum,
'pagesize': pagesize,
'userId': userId,
},
errors: {
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
},
});
}
//查询知识点学习记录
public static knowlegdeLearningRecords(
userId: string,
courseId: string,
pagenum: number = 1,
pagesize: number = 10,
): CancelablePromise<BaseResponse_Page_> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/knowledgelearning/page',
query: {
'pagenum': pagenum,
'pagesize': pagesize,
'userId': userId,
'courseId': courseId,
},
errors: {
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
},
});
}
//查询资源学习记录
public static resourceLearningRecords(
userId: string,
knowledgeId: string,
courseId: string,
pagenum: number = 1,
pagesize: number = 10,
): CancelablePromise<BaseResponse_Page_> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/resourcelearningrecords/page',
query: {
'pagenum': pagenum,
'pagesize': pagesize,
'userId': userId,
'courseId': courseId,
'knowledgeId': knowledgeId,
},
errors: {
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
},
});
}
//播放
public static bf(
): CancelablePromise<BaseResponse_string_> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/resourcelearningrecords/bf',
errors: {
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
},
});
}
//文件上传
public static upload(
file : File
): CancelablePromise<BaseResponse_string_> {
return __request(OpenAPI, {
method: 'GET',
url: '/api/resourcelearningrecords/upload',
query:{
'file' : file
},
errors: {
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
},
});
}
/** /**
* saveRecords * saveRecords
* @param learningRecords learningRecords * @param learningRecords learningRecords

@ -28,6 +28,7 @@
"echarts": "^5.5.0", "echarts": "^5.5.0",
"echarts-liquidfill": "^3.1.0", "echarts-liquidfill": "^3.1.0",
"element-plus": "^2.6.0", "element-plus": "^2.6.0",
"element-ui": "^2.15.14",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
@ -38,7 +39,9 @@
"vue": "^3.4.27", "vue": "^3.4.27",
"vue-echarts": "^6.7.2", "vue-echarts": "^6.7.2",
"vue-quill": "^1.5.1", "vue-quill": "^1.5.1",
"vue-router": "^4.3.0" "vue-router": "^4.3.0",
"vue-video-player": "^6.0.0",
"vue3-video-play": "^1.3.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.23.10", "@babel/eslint-parser": "^7.23.10",
@ -52,6 +55,7 @@
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-vue": "^9.22.0", "eslint-plugin-vue": "^9.22.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"openapi-typescript-codegen": "^0.29.0",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"postcss": "^8.4.35", "postcss": "^8.4.35",
"postcss-html": "^1.6.0", "postcss-html": "^1.6.0",

File diff suppressed because it is too large Load Diff

@ -3,6 +3,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
// import { useRouter, useRoute } from 'vue-router' // import { useRouter, useRoute } from 'vue-router'
// vue3 compositionAPI // vue3 compositionAPI
// 1. router useRouter // 1. router useRouter

@ -6,3 +6,6 @@ export const getRecordListService = (params) =>
export function DelRecordService(ids) { export function DelRecordService(ids) {
return request.delete(`h//api/learningrecords/delete?ids=${ids}`) return request.delete(`h//api/learningrecords/delete?ids=${ids}`)
} }
//获取课程学习记录列表
export const getCourseLearningRecords = (params) =>
request.get('/api/courselearingrecord/page', { params })

Binary file not shown.

@ -24,6 +24,7 @@ const app = createApp(App)
import gloablComponent from '@/components/index' import gloablComponent from '@/components/index'
import 'echarts' import 'echarts'
import ECharts from 'vue-echarts' import ECharts from 'vue-echarts'
// 导入jquery // 导入jquery
// import $ from 'jquery' // import $ from 'jquery'
app.use(gloablComponent) app.use(gloablComponent)

@ -192,6 +192,26 @@ export const constantRoute: any = [
icon: 'StarFilled', icon: 'StarFilled',
}, },
}, },
{
path: '/myCourseStudyManagement/learningProcess1',
component: () => import('@/views/MyCourseStudy/knowledgeLearningProcess.vue'),
name: 'LearningProcess1',
meta: {
title: '知识点学习记录',
hidden: false,
icon: 'StarFilled',
},
},
{
path: '/myCourseStudyManagement/learningProcess2',
component: () => import('@/views/MyCourseStudy/resourceLearning.vue'),
name: 'LearningProcess2',
meta: {
title: '资源学习记录',
hidden: false,
icon: 'StarFilled',
},
},
{ {
path: '/myCourseStudyManagement/courseCollections', path: '/myCourseStudyManagement/courseCollections',
component: () => import('@/views/MyCourseStudy/courseCollections.vue'), component: () => import('@/views/MyCourseStudy/courseCollections.vue'),

@ -0,0 +1,121 @@
<script setup>
import { ref } from 'vue'
import { onMounted } from 'vue'
import { useRouter,useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user'
import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService'
const recordList = ref([])
const userStore = useUserStore()
onMounted(()=>{
userStore.getUserInfo()
})
const route = useRoute()
const router = useRouter()
const params = ref({
userId: userStore.data.id,
courseId: route.query.courseId,
pagenum: '1',
pagesize: '10',
})
// console.log("courseId:"+ route.query.courseId);
//this.$route.query.courseId
//
const getrecordList = async () => {
const res = await LearningRecordsControllerService.knowlegdeLearningRecords(
params.value.userId,
params.value.courseId,
params.value.pagenum,
params.value.pagesize,
)
console.log("记录列表:");
console.log(res)
recordList.value = res.data.records
}
//
const goToAnotherPage = (address,courseId,knowledgeId) => {
router.push({
path:address,
query:{
courseId: courseId,
knowledgeId: knowledgeId
}
})
}
//()
const goToAnotherPageback = () => {
router.push({
path:'/myCourseStudyManagement/learningProcess'
})
}
getrecordList()
</script>
<style lang="scss" scoped></style>
<template>
<!-- 头部 -->
<div class="header">
<el-button type="primary" plain>浏览记录</el-button>
<el-button
type="primary"
plain
@click="goToAnotherPageback"
style="float: right"
>
返回上级目录
</el-button>
</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: 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>

@ -4,33 +4,37 @@ import { ref } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import useUserStore from '@/store/modules/user'
import { onMounted } from 'vue'
// //
import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService' import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService'
const total = ref(0) const total = ref(0)
const userStore = useUserStore()
const recordList = ref([]) const recordList = ref([])
const selectedIds = ref([]) const selectedIds = ref([])
const loading = ref(false) const loading = ref(false)
const showCheckbox = ref(false) const showCheckbox = ref(false)
onMounted(()=>{
userStore.getUserInfo()
})
const params = ref({ const params = ref({
// pagesize: '10', // pagesize: '10',
// pagenum: '1', // pagenum: '1',
userId: '1', userId: userStore.data.id,
}) })
console.log(userStore.data.id);
// //
const getrecordList = async () => { const getrecordList = async () => {
//console.log(1111111)
loading.value = true loading.value = true
// const res = await getRecordListService(params.value) // const res = await getRecordListService(params.value)
const res = await LearningRecordsControllerService.getAllUsingGet3( const res = await LearningRecordsControllerService.courseLearningRecords(
params.value.userId, params.value.userId,
params.value.pagenum, params.value.pagenum,
params.value.pagesize, params.value.pagesize,
) )
console.log(res) console.log(res)
recordList.value = res.data.records recordList.value = res.data.records
console.log(res)
// //
total.value = res.data.total total.value = res.data.total
loading.value = false loading.value = false
@ -61,7 +65,7 @@ const onDeleteRecord = async (ids) => {
//await DelRecordService(ids) //await DelRecordService(ids)
console.log('hello') console.log('hello')
await LearningRecordsControllerService.deleteRecordsUsingDelete3(ids) await LearningRecordsControllerService.deleteCourseRecords(ids)
// console.log(ids) // console.log(ids)
ElMessage({ type: 'success', message: '删除成功' }) ElMessage({ type: 'success', message: '删除成功' })
@ -104,7 +108,7 @@ const deleteSelected = async () => {
}) })
// //
await LearningRecordsControllerService.deleteRecordsUsingDelete3( await LearningRecordsControllerService.deleteCourseRecords(
selectedIds.value, selectedIds.value,
) )
.then(() => { .then(() => {
@ -121,9 +125,13 @@ const deleteSelected = async () => {
} }
// //
const router = useRouter() const router = useRouter()
const goToAnotherPage = (address) => { const goToAnotherPage = (address,courseId) => {
//console.log(address) router.push({
router.push(address) path:address,
query:{
courseId: courseId
}
})
} }
// //
</script> </script>
@ -154,7 +162,7 @@ const goToAnotherPage = (address) => {
<!-- 中间 --> <!-- 中间 -->
<div class="record-list"> <div class="record-list">
<ul v-if="recordList.length > 0"> <ul v-if="recordList.length > 0">
<li v-for="record in recordList" :key="record.id" v-loading="loading"> <li v-for="record in recordList" :key="record.id" v-loading="loading" @click="goToAnotherPage('/myCourseStudyManagement/learningProcess1' , record.courseId)">
<input <input
style="display: flex" style="display: flex"
type="checkbox" type="checkbox"
@ -165,7 +173,7 @@ const goToAnotherPage = (address) => {
<img <img
class="img" class="img"
:src="record.content" :src="record.img"
@click="goToAnotherPage(record.address)" @click="goToAnotherPage(record.address)"
style="margin-bottom: 10px" style="margin-bottom: 10px"
/> />
@ -180,7 +188,7 @@ const goToAnotherPage = (address) => {
" "
> >
<p> <p>
{{ record.coursesName }} {{ record.courseName }}
</p> </p>
<el-icon @click="onDeleteRecord(record.id)"> <el-icon @click="onDeleteRecord(record.id)">
<Delete /> <Delete />
@ -195,7 +203,7 @@ const goToAnotherPage = (address) => {
" "
> >
<p>{{ record.time }}</p> <p>{{ record.time }}</p>
<p>{{ record.number }} 观看次数</p> <p>学习人数:{{ record.number }}</p>
</div> </div>
</li> </li>
</ul> </ul>

@ -0,0 +1,154 @@
<script setup>
import { ref } from 'vue'
import { onMounted } from 'vue'
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'
const recordList = ref([])
const userStore = useUserStore()
onMounted(()=>{
userStore.getUserInfo()
})
const sp = "https://wenyu132.oss-cn-beijing.aliyuncs.com/wenyu/merge.mp4"
// const video = "D:\Users\Desktop\image\video\merge.mp4"
const route = useRoute()
const router = useRouter()
const params = ref({
userId: userStore.data.id,
knowledgeId: route.query.knowledgeId,
courseId: route.query.courseId,
pagenum: '1',
pagesize: '10',
})
//
const getrecordList = async () => {
const res = await LearningRecordsControllerService.resourceLearningRecords(
params.value.userId,
params.value.knowledgeId,
params.value.courseId,
params.value.pagenum,
params.value.pagesize,
)
// console.log("");
// console.log(res)
recordList.value = res.data.records
}
//()
const goToAnotherPage = () => {
router.push({
path:'/myCourseStudyManagement/learningProcess1',
query:{
courseId: route.query.courseId
}
})
}
getrecordList()
//
const upload = async(file) => {
console.log(file);
console.log(file.raw);
new FormData(file)
const res = await LearningRecordsControllerService.upload(
new FormData(file)
)
}
// const video = this.$refs.videoRef;
</script>
<style lang="scss" scoped></style>
<template>
<!-- 头部 -->
<div class="header">
<el-button type="primary" plain>浏览记录</el-button>
<el-button
type="primary"
plain
@click="goToAnotherPage"
style="float: right"
>
返回上级目录
</el-button>
</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: 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
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 /></el-icon>
</el-upload>
<!-- autoplay -->
<!-- <video ref="videoRef" controls width="600">
<source :src="sp" type="video/mp4" />
</video> -->
<!-- <div>
<video ref="videoRef" controls="true" :controlslist="nodownload" @contextmenu="handleContextMenu"></video>
</div> -->
</template>

@ -14,6 +14,9 @@ import { LearningRecordsControllerService } from '../../../generated/services/Le
import { CourseResourceControllerService } from '../../../generated/services/CourseResourceControllerService' import { CourseResourceControllerService } from '../../../generated/services/CourseResourceControllerService'
import resourceAdd from './componse/resourceAdd.vue' import resourceAdd from './componse/resourceAdd.vue'
import useUserStore from '@/store/modules/user'
import { onMounted } from 'vue'
const total = ref(0) const total = ref(0)
const pptresourceList = ref([]) const pptresourceList = ref([])
@ -77,10 +80,14 @@ const onDeleteResource = async (ids) => {
ElMessage({ type: 'success', message: '删除成功' }) ElMessage({ type: 'success', message: '删除成功' })
getpptresourceList() getpptresourceList()
} }
const userStore = useUserStore()
onMounted(()=>{
userStore.getUserInfo()
})
const param = ref({ const param = ref({
coursesId: '', coursesId: '',
userId: '1', coursesName: '',
userId: userStore.data.id,
open: '1', open: '1',
download: '0', download: '0',
content: '', content: '',
@ -91,6 +98,7 @@ const param = ref({
const generateRecords = async (rescource) => { const generateRecords = async (rescource) => {
param.value.content = rescource.img param.value.content = rescource.img
param.value.coursesId = rescource.id.toString() param.value.coursesId = rescource.id.toString()
param.value.coursesName = rescource.name
await LearningRecordsControllerService.saveRecordsUsingPost1(param.value) await LearningRecordsControllerService.saveRecordsUsingPost1(param.value)
// console.log(param) // console.log(param)
} }

Loading…
Cancel
Save