diff --git a/src/api/user/record.js b/src/api/user/record.js deleted file mode 100644 index edbafc1..0000000 --- a/src/api/user/record.js +++ /dev/null @@ -1,10 +0,0 @@ -import request from '@/utils/request' -//获取浏览记录列表 -export const getRecordListService = (params) => - request.get('http://39.106.16.162:8080/learningrecords/getall', { params }) -//删除浏览记录 -export function DelRecordService(ids) { - return request.delete( - `http://39.106.16.162:8080/learningrecords/delete?ids=${ids}`, - ) -} diff --git a/src/api/user/resource.js b/src/api/user/resource.js deleted file mode 100644 index 0bfb6f8..0000000 --- a/src/api/user/resource.js +++ /dev/null @@ -1,9 +0,0 @@ -import request from '@/utils/request' -//获取ppt资源列表 -export const getpptResourceListService = (params) => - request.get('http://localhost:8080/courses/getall', { params }) -export function DelpptResourceListService(ids) { - return request.delete( - `http://localhost:8080/learningrecords/delete?ids=${ids}`, - ) -} diff --git a/src/views/MyCourseStudy/learningProcess.vue b/src/views/MyCourseStudy/learningProcess.vue index ffd22a7..f1f4aa9 100644 --- a/src/views/MyCourseStudy/learningProcess.vue +++ b/src/views/MyCourseStudy/learningProcess.vue @@ -1,10 +1,10 @@ + diff --git a/src/views/courseResources/index.vue b/src/views/courseResources/index.vue index 6b1c643..c26680f 100644 --- a/src/views/courseResources/index.vue +++ b/src/views/courseResources/index.vue @@ -7,14 +7,14 @@ import pdf from '@/assets/icons/pdf (1).png' import test from '@/assets/icons/文件.png' import audio from '@/assets/icons/音频1.png' +import { ElMessageBox, ElMessage } from 'element-plus' import { ref } from 'vue' -//默认抽屉隐藏 -const visibleDramwer = ref(false) -//定义一个selectedOption属性,用于存储当前选中的值 -const selectedOption = ref('') -import { getpptResourceListService } from '@/api/user/resource.js' -import { DelpptResourceListService } from '@/api/user/resource.js' +import { LearningRecordsControllerService } from '../../../generated/services/LearningRecordsControllerService' +import { CourseResourceControllerService } from '../../../generated/services/CourseResourceControllerService' + +import resourceAdd from './componse/resourceAdd.vue' + const total = ref(0) const pptresourceList = ref([]) const loading = ref(false) @@ -27,7 +27,11 @@ const params = ref({ //获取资源列表 const getpptresourceList = async () => { loading.value = true - const res = await getpptResourceListService(params.value) + const res = await CourseResourceControllerService.getAllUsingGet1( + params.value.pagenum, + params.value.pagesize, + params.value.type, + ) pptresourceList.value = res.data.records console.log(res) //获取资源列表 @@ -59,81 +63,49 @@ const onCurrentChange = (page) => { //删除资源 -通过ID进行删除 const onDeleteResource = async (ids) => { + console.log(111111111111111) await ElMessageBox.confirm('你确认删除该条浏览信息吗?', '温馨提示', { type: 'warning', confirmButtonText: '确认', cancelButtonText: '取消', }) - await DelpptResourceListService(ids) - // console.log(ids) + console.log(ids) + await CourseResourceControllerService.deleteRecordsUsingDelete1(ids) ElMessage({ type: 'success', message: '删除成功' }) getpptresourceList() } -//上传文件 -import tool from '@/utils/oss.js' -const FileList = ref([]) -const upload = async (option) => { - const res = await tool.oss.upload(option.file) - console.log(22, res) - console.log(res.name) - const url = 'https://wenyu132.oss-cn-beijing.aliyuncs.com/' + res.name - console.log(url) + +const param = ref({ + coursesId: '', + userId: '1', + open: '1', + download: '0', + content: '', + address: '/portal', + type: '4', +}) +//点击生成浏览记录 +const generateRecords = async (rescource) => { + param.value.content = rescource.img + param.value.coursesId = rescource.id.toString() + await LearningRecordsControllerService.saveRecordsUsingPost1(param.value) + // console.log(param) +} + +const resourceAddRef = ref() +//添加资源 +const onAddResource = () => { + resourceAddRef.value.open({}) +} +//编辑资源 +const onEditResource = (row) => { + resourceAddRef.value.open(row) }