修改接口

develoop
ww 5 months ago
commit 3812ab0328
  1. 30
      generated/core/OpenAPI.ts
  2. 1
      generated/index.ts
  3. 11
      generated/models/BaseResponse_ObjectiveContents_.ts
  4. 21
      generated/services/CourseResourceControllerService.ts
  5. 23
      generated/services/Service.ts
  6. 3
      src/api/courseChaptersApi.ts
  7. 45
      src/views/MyCourseStudy/ContainerCla.vue
  8. 83
      src/views/MyCourseStudy/ContainerKno.vue
  9. 97
      src/views/MyCourseStudy/courseCollections.vue
  10. 18
      src/views/MyCourseStudy/learningProcess.vue
  11. 97
      src/views/courseResources/componse/resourceAdd.vue
  12. 18
      src/views/courseResources/index.vue

@ -2,23 +2,23 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ApiRequestOptions } from './ApiRequestOptions'
// 引入设置token的方法
import { GET_TKOEN } from '@/utils/token'
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>
type Headers = Record<string, string>
import { GET_TKOEN } from '@/utils/token';
import type { ApiRequestOptions } from './ApiRequestOptions';
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
type Headers = Record<string, string>;
export type OpenAPIConfig = {
BASE: string
VERSION: string
WITH_CREDENTIALS: boolean
CREDENTIALS: 'include' | 'omit' | 'same-origin'
TOKEN?: string | Resolver<string> | undefined
USERNAME?: string | Resolver<string> | undefined
PASSWORD?: string | Resolver<string> | undefined
HEADERS?: Headers | Resolver<Headers> | undefined
ENCODE_PATH?: ((path: string) => string) | undefined
}
BASE: string;
VERSION: string;
WITH_CREDENTIALS: boolean;
CREDENTIALS: 'include' | 'omit' | 'same-origin';
TOKEN?: string | Resolver<string> | undefined;
USERNAME?: string | Resolver<string> | undefined;
PASSWORD?: string | Resolver<string> | undefined;
HEADERS?: Headers | Resolver<Headers> | undefined;
ENCODE_PATH?: ((path: string) => string) | undefined;
};
export const OpenAPI: OpenAPIConfig = {
BASE: 'http://39.106.16.162:8080',

@ -18,6 +18,7 @@ export type { BaseResponse_List_TeacherInfVO_ } from './models/BaseResponse_List
export type { BaseResponse_long_ } from './models/BaseResponse_long_';
export type { BaseResponse_Map_string_object_ } from './models/BaseResponse_Map_string_object_';
export type { BaseResponse_ObjectiveContentKnowVO_ } from './models/BaseResponse_ObjectiveContentKnowVO_';
export type { BaseResponse_ObjectiveContents_ } from './models/BaseResponse_ObjectiveContents_';
export type { BaseResponse_Page_ } from './models/BaseResponse_Page_';
export type { BaseResponse_Page_CourseFavourDetailVO_ } from './models/BaseResponse_Page_CourseFavourDetailVO_';
export type { BaseResponse_Page_CourseResources_ } from './models/BaseResponse_Page_CourseResources_';

@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ObjectiveContents_ } from './ObjectiveContents_';
export type BaseResponse_ObjectiveContents_ = {
code?: number;
data?: ObjectiveContents_;
message?: string;
};

@ -5,6 +5,7 @@
import type { BaseResponse_List_CourseResources_ } from '../models/BaseResponse_List_CourseResources_';
import type { BaseResponse_Page_ } from '../models/BaseResponse_Page_';
import type { BaseResponse_string_ } from '../models/BaseResponse_string_';
import type { CourseResources } from '../models/CourseResources';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
@ -74,4 +75,24 @@ export class CourseResourceControllerService {
},
});
}
/**
* saveCourseResource
* @param courseResources courseResources
* @returns BaseResponse_string_ OK
* @throws ApiError
*/
public static saveCourseResourceUsingGet1(
courseResources: CourseResources,
): CancelablePromise<BaseResponse_string_> {
return __request(OpenAPI, {
method: 'GET',
url: '/courses/save',
body: courseResources,
errors: {
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
},
});
}
}

@ -8,6 +8,7 @@ import type { BaseResponse_List_CourseObjectivesTreeVO_ } from '../models/BaseRe
import type { BaseResponse_List_ObjectivesType_ } from '../models/BaseResponse_List_ObjectivesType_';
import type { BaseResponse_Map_string_object_ } from '../models/BaseResponse_Map_string_object_';
import type { BaseResponse_ObjectiveContentKnowVO_ } from '../models/BaseResponse_ObjectiveContentKnowVO_';
import type { BaseResponse_ObjectiveContents_ } from '../models/BaseResponse_ObjectiveContents_';
import type { BaseResponse_PageDTO_CoursesVO_ } from '../models/BaseResponse_PageDTO_CoursesVO_';
import type { BaseResponse_string_ } from '../models/BaseResponse_string_';
import type { CourseObjectivesDTO } from '../models/CourseObjectivesDTO';
@ -365,6 +366,28 @@ export class Service {
},
});
}
/**
* id查询目标内容
* @param id id
* @returns BaseResponse_ObjectiveContents_ OK
* @throws ApiError
*/
public static updateContentUsingGet1(
id: string,
): CancelablePromise<BaseResponse_ObjectiveContents_> {
return __request(OpenAPI, {
method: 'GET',
url: '/objective_contents/{id}',
path: {
'id': id,
},
errors: {
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
},
});
}
/**
*
* @param id id

@ -8,7 +8,8 @@ export function getAssApi(params: {
page: number,
pageSize: number,
resourceIdList: string,
type: 1 | 2 | 3 | 4 | 5
type: 1 | 2 | 3 | 4 | 5,
userId: string
}) {
return request.get('/Favour/get', {
params

@ -2,12 +2,14 @@
<!-- 课程收藏页面 -->
<el-tab-pane label="课程收藏" name="first">
<div class="Container_Cla" ref="container">
<div class="item_1" v-for="(item_1, index) in datalist" :key="index">
<div class="item_1" v-for="item_1 in datalist" :key="item_1.id">
<!-- 课程图片盒子 -->
<div class="ClassImg">
<!-- 更多图片盒子 -->
<div class="ClassGd">
<img src="../../assets/icons/更多.svg" width="100%" height="100%" />
<!-- <img src="../../assets/icons/更多.svg" width="100%" height="100%" /> -->
<p>查看课程</p>
<p>取消收藏</p>
</div>
<!-- 课程图片 -->
<img :src="item_1.img" />
@ -40,7 +42,7 @@
</el-tab-pane>
</template>
<script lang="ts" setup>
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { ref, onMounted } from 'vue'
import { SeCourseFavourControllerService } from '../../../generated/services/SeCourseFavourControllerService'
import { CourseFavourQueryRequest } from 'generated/models/CourseFavourQueryRequest'
// ===============================
@ -69,27 +71,18 @@ onMounted(() => myObserver.observe(container.value))
const total = ref(0)
const datalist = ref([
{
/**
* 课程学时
*/
//
classhours: '',
/**
* 课程学分
*/
//
credit: '',
id: '',
img: '',
name: '',
/**
* 教师id
*/
// id
teacher: '',
},
])
/**
* 表单信息
*/
//
let params = ref<CourseFavourQueryRequest>({
current: 1,
pageSize: 12,
@ -97,7 +90,7 @@ let params = ref<CourseFavourQueryRequest>({
sortOrder: '',
userId: 2,
})
//
const getDatalist = async () => {
const res = await SeCourseFavourControllerService.listPostByPageUsingPost1(
params.value,
@ -108,6 +101,7 @@ const getDatalist = async () => {
getDatalist()
//
const handleSizeChange = (size: any) => {
// console.log(size)
params.value.current = 1
@ -200,10 +194,23 @@ const handleCurrentChange = (page: any) => {
.ClassGd {
position: absolute;
background-color: rgb(217, 217, 217, 0.5);
display: none;
margin-top: -9px;
margin-left: 95%;
margin-left: 85%;
padding: 3px 5px;
cursor: pointer;
border-radius: 20%;
& > p {
margin-top: 3px;
margin-bottom: 3px;
font-size: 10px;
font-weight: 350;
color: black;
&:hover {
color: #2952f6;
font-weight: 35s0;
}
}
}
.ClaCon {

@ -1,15 +1,29 @@
<template>
<el-tab-pane label="知识点收藏" name="third">
<div class="Container_Kno">
<div class="item_3" v-for="(item_3, index) in 10" :key="index">
<div class="item_3 noUpd" v-for="item_3 in arr" :onclick="handClick" :key="item_3.id">
<div>
<div class="KnowledgeCollent">
<div class="KnoCon">
<h4>课程名称</h4>
<p>{{ item_3 }}-xxxx</p>
<h4>{{ item_3.name }}</h4>
<p>{{ item_3.num }}-{{item_3.zjname}}</p>
</div>
<div class="KnoBtn">
<img src="../../assets/icons/更多.svg" alt="" />
<img class="cli" src="../../assets/icons/更多.svg" />
</div>
</div>
<div class="Knowledge_point">
<ul>
<li v-for="(item, index) in 5" :key="index">
&nbsp;
{{ index + 1 }}. 知识点知识点知识点
&nbsp;
<span class="btn">×</span>
&nbsp;
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="Knowledge_point">
@ -26,8 +40,61 @@
</div>
</el-tab-pane>
</template>
<script lang="ts" setup></script>
<script setup>
import {ref,reactive} from 'vue'
function handClick(e){
if(e.target.classList.contains('cli')){
this.classList.toggle('noUpd')
}
}
const arr = reactive([])
const a =[
{
id:1,
name:"操作系统",
num:1,
zjname:'操作系统引论',
},
{
id:2,
name:"跨文化交际",
num:1,
},
{
id:3,
name:"软件项目管理",
num:1,
},
{
id:4,
name:"英语课",
num:1,
},
]
arr.length=0
arr.push(...a)
const ShowDel = ref(false)
function XsDel(id){
const item = arr.find(o=>o.a.id==id)
item.ShowDel = !item.ShowDel
}
</script>
<style lang="scss" scoped>
.btn{
display: inline-block;
}
.item_3.noUpd{
.btn{
display: none;
}
}
.Container_Kno {
width: 100%;
height: 100%;
@ -72,7 +139,7 @@
.KnowledgeCollent h4 {
margin-top: 3px;
font-size: 30px;
font-size: 27px;
font-weight: 550;
font-style: normal;
}
@ -107,10 +174,6 @@
border-radius: 3px;
}
.btn {
display: none;
}
.btn:hover {
cursor: pointer;
color: rgb(15, 57, 76);

@ -92,7 +92,9 @@
<span>点击开了一个弹框</span>
<template #footer>
<div class="dialog-footer">
<video src=""></video>
<video
src="https://www.bilibili.com/video/BV1HV4y1a7n4?p=50&vd_source=9e99d3200788d6043e077de463ef019b"
></video>
</div>
</template>
</el-dialog>
@ -120,6 +122,9 @@
</div>
<div class="ResClaDic">
<p>音频名称-----{{ item }}</p>
<el-button plain @click="centerDialogVisible = true">
点击播放
</el-button>
</div>
</div>
</div>
@ -149,20 +154,21 @@ import type { TabsPaneContext } from 'element-plus'
import ContainerCla from './ContainerCla.vue'
import ContainerKno from './ContainerKno.vue'
import { getAssApi } from '@/api/courseChaptersApi'
import { SeResourceFavourControllerService } from '../../../generated/services/SeResourceFavourControllerService'
const centerDialogVisible = ref(false)
const activeIndex = ref(1)
function hsndelShow(index: number) {
activeIndex.value = index
}
//=========================
function handleApi(params) {
getAssApi(params).then((res) => {
arr.value = res.data.records
total.value = res.data.total
console.log(arr.value, '-', total.value)
})
}
// //=========================
// function handleApi(params) {
// getAssApi(params).then(res => {
// arr.value = res.data.records
// total.value = res.data.total
// console.log(arr.value, '-', total.value)
// })
// }
const arr = ref([])
const total = ref(0)
//
@ -171,10 +177,10 @@ const pageSize1 = ref(10)
const disabled = ref(false)
const handleSizeChange = (val: number) => {
hand()
getDatalist()
}
const handleCurrentChange = (val: number) => {
hand()
getDatalist()
}
function initFenYie() {
@ -185,24 +191,53 @@ function initFenYie() {
watch(activeIndex, (newVal) => {
initFenYie()
hand()
getDatalist()
})
function hand() {
// function hand() {
// console.log(res)
// // handleApi(params)
// }
const params = {
current: currentPage1.value,
type: activeIndex.value,
page: currentPage1.value,
pageSize: pageSize1.value,
resourceIdList: '1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20',
}
handleApi(params)
sortField: '',
sortOrder: '',
userId: '3',
}
const obj = {
type: activeIndex.value,
page: currentPage1.value,
pageSize: pageSize1.value,
resourceIdList: '1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20',
}
handleApi(obj)
const datalist = ref([
{
description: '',
id: '',
img: '',
name: '',
path: '',
status: '',
tags: '',
type: '',
},
])
const getDatalist = async () => {
const res =
await SeResourceFavourControllerService.listPostByPageUsingPost3(params)
datalist.value = res.data.records
total.value = res.data.total
console.log(datalist.value[0])
}
getDatalist()
// hand()
// const obj = {
// type: activeIndex.value,
// page: currentPage1.value,
// pageSize: pageSize1.value,
// sortField:'',
// sortOrder:'',
// resourceIdList: ''
// }
// handleApi(obj)
//=========================
const activeName = ref('first')
@ -364,8 +399,6 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
}
.item_2-2,
.item_2-3,
.item_2-4,
.item_2-5 {
width: 100%;
height: 300px;
@ -377,6 +410,18 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
border-radius: 6px;
margin-bottom: 32px;
}
.item_2-3,
.item_2-4 {
width: 100%;
height: 300px;
margin-top: 20px;
border-left: 1px solid #e4e4e4;
border-top: 1px solid #e4e4e4;
overflow: hidden;
box-shadow: 2px 2px 2px 2px rgba(214, 212, 212, 0.5);
border-radius: 6px;
margin-bottom: 32px;
}
.Page-2 {
width: 100%;

@ -155,6 +155,7 @@ const goToAnotherPage = (address) => {
<ul v-if="recordList.length > 0">
<li v-for="record in recordList" :key="record.id" v-loading="loading">
<input
style="display: flex"
type="checkbox"
:value="record.id"
@change="toggleSelection(record.id)"
@ -241,29 +242,30 @@ ul {
padding: 10;
display: flex;
flex-wrap: wrap;
justify-content: start;
}
li {
/* margin-bottom: 30px; */
transition: filter 0.3s; /* 添加过渡动画 */
flex: 0 0 20%;
/* flex: 1 0 20%; */
width: calc(20% - 20px);
flex-direction: column;
margin-bottom: 10px;
align-items: center;
text-align: center;
/* margin: 0 15px; */
padding: 10px;
box-sizing: border-box;
transition: box-shadow 0.3s;
cursor: pointer;
align-items: center;
}
li:hover {
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.img {
width: 100%;
height: 100%;
display: block;
width: 250px;
height: 250px;
}
</style>

@ -1,9 +1,11 @@
<script lang="ts" setup>
import { ref } from 'vue'
// import axios from 'axios'
import { CourseResourceControllerService } from '../../../../generated/services/CourseResourceControllerService'
const props = defineProps(['dafulIndex'])
import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css'
import { ElMessage } from 'element-plus'
//
const visibleDramwer = ref(false)
//
@ -63,12 +65,17 @@ const selectOp = ref([
{ label: '文件', value: '5' },
{ label: '音频', value: '6' },
])
const handleSel = () => {}
//
import type { UploadProps, UploadUserFile } from 'element-plus'
const fileList = ref([])
function clearFileList() {
fileList.value.length = 0
}
const handleSel = () => {
fileList.value.length = 0
}
const fileList = ref<UploadUserFile[]>([])
//
import type { UploadProps } from 'element-plus'
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles)
@ -77,6 +84,82 @@ const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
const handlePreview: UploadProps['onPreview'] = (file) => {
console.log(file)
}
const formRef = ref()
function isSubmit() {
formRef.value.validate((valid, fields) => {
if (valid) {
const params = {
name: formModel.value.name,
type: selectVal.value,
img: fileList.value[0]?.raw,
description: formModel.value.description,
}
console.log('根据参数:', params, '去调用接口???')
} else {
console.log('error submit!', fields)
}
})
}
// upd
const beforeAvatarUpload = (rawFile) => {
console.log('执行了')
switch (+selectVal.value) {
case 1:
if (rawFile.type !== 'application/vnd.ms-powerpoint') {
clearFileList()
ElMessage.error('必须是ppt文件!')
} else {
clearFileList()
fileList.value.push(rawFile)
}
break
case 2:
if (!rawFile.type.startsWith('image/')) {
clearFileList()
ElMessage.error('必须是??文件!')
} else {
clearFileList()
fileList.value.push(rawFile)
}
break
// case 3:
// if (false) {
// clearFileList()
// ElMessage.error('??')
// } else {
// clearFileList()
// fileList.value.push(rawFile)
// }
// break
// case 4:
// if (false) {
// clearFileList()
// ElMessage.error('??')
// } else {
// clearFileList()
// fileList.value.push(rawFile)
// }
// break
// case 5:
// if (false) {
// clearFileList()
// ElMessage.error('??')
// } else {
// clearFileList()
// fileList.value.push(rawFile)
// }
// break
// case 6:
// if (false) {
// clearFileList()
// ElMessage.error('??')
// } else {
// clearFileList()
// fileList.value.push(rawFile)
// }
// break
}
}
</script>
<template>
<el-drawer
@ -118,11 +201,13 @@ const handlePreview: UploadProps['onPreview'] = (file) => {
<el-form-item label="上传资源" prop="fileList">
<el-upload
v-model:file-list="fileList"
:limit="1"
class="upload-demo"
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
:on-preview="handlePreview"
:on-remove="handleRemove"
list-type="picture"
:before-upload="beforeAvatarUpload"
>
<el-button type="primary">点击上传资源</el-button>
<template #tip>
@ -135,7 +220,7 @@ const handlePreview: UploadProps['onPreview'] = (file) => {
<el-form-item label="资源简介" prop="description">
<div class="editor">
<quill-editor
v-model:description="formModel.description"
v-model:content="formModel.description"
content-type="html"
theme="snow"
></quill-editor>
@ -143,7 +228,7 @@ const handlePreview: UploadProps['onPreview'] = (file) => {
</el-form-item>
<el-form-item>
<el-button type="primary">取消</el-button>
<el-button type="info">确定</el-button>
<el-button type="info" @click="isSubmit">确定</el-button>
</el-form-item>
</el-form>
</el-drawer>

@ -185,13 +185,13 @@ const onEditResource = (row) => {
<Edit />
</el-icon>
</div>
<div
class="vedio"
<img
class="img"
@click="generateRecords(resource)"
style="margin-top: 10px; margin-bottom: 10px"
>
<img :src="resource.img" />
</div>
:src="resource.img"
/>
<div class="box" style="display: flex; flex-direction: column">
<p style="margin-bottom: 10px">{{ resource.name }}</p>
<p style="margin-top: 10px">{{ resource.description }}</p>
@ -243,7 +243,6 @@ const onEditResource = (row) => {
}
.body {
background-color: #fff;
height: 100%;
}
.top {
margin-bottom: 20px;
@ -267,7 +266,7 @@ ul {
}
li {
transition: filter 0.3s; /* 添加过渡动画 */
flex: 0 0 20%;
width: calc(25% - 25px);
flex-direction: column;
align-items: center;
margin-bottom: 10px;
@ -295,4 +294,9 @@ li:hover {
.box p:hover {
font-weight: bold;
}
.img {
display: block;
width: 250px;
height: 250px;
}
</style>

Loading…
Cancel
Save