修改接口

develoop
ww 5 months ago
commit 3812ab0328
  1. 32
      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. 97
      src/views/MyCourseStudy/ContainerKno.vue
  9. 99
      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 */ /* istanbul ignore file */
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
import type { ApiRequestOptions } from './ApiRequestOptions' import { GET_TKOEN } from '@/utils/token';
// 引入设置token的方法 import type { ApiRequestOptions } from './ApiRequestOptions';
import { GET_TKOEN } from '@/utils/token'
type Resolver<T> = (options: ApiRequestOptions) => Promise<T> type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
type Headers = Record<string, string> type Headers = Record<string, string>;
export type OpenAPIConfig = { export type OpenAPIConfig = {
BASE: string BASE: string;
VERSION: string VERSION: string;
WITH_CREDENTIALS: boolean WITH_CREDENTIALS: boolean;
CREDENTIALS: 'include' | 'omit' | 'same-origin' CREDENTIALS: 'include' | 'omit' | 'same-origin';
TOKEN?: string | Resolver<string> | undefined TOKEN?: string | Resolver<string> | undefined;
USERNAME?: string | Resolver<string> | undefined USERNAME?: string | Resolver<string> | undefined;
PASSWORD?: string | Resolver<string> | undefined PASSWORD?: string | Resolver<string> | undefined;
HEADERS?: Headers | Resolver<Headers> | undefined HEADERS?: Headers | Resolver<Headers> | undefined;
ENCODE_PATH?: ((path: string) => string) | undefined ENCODE_PATH?: ((path: string) => string) | undefined;
} };
export const OpenAPI: OpenAPIConfig = { export const OpenAPI: OpenAPIConfig = {
BASE: 'http://39.106.16.162:8080', BASE: 'http://39.106.16.162:8080',
@ -32,4 +32,4 @@ export const OpenAPI: OpenAPIConfig = {
Authorization: 'Bearer ' + GET_TKOEN('TOKEN'), Authorization: 'Bearer ' + GET_TKOEN('TOKEN'),
}, },
ENCODE_PATH: undefined, ENCODE_PATH: undefined,
} }

@ -18,6 +18,7 @@ export type { BaseResponse_List_TeacherInfVO_ } from './models/BaseResponse_List
export type { BaseResponse_long_ } from './models/BaseResponse_long_'; export type { BaseResponse_long_ } from './models/BaseResponse_long_';
export type { BaseResponse_Map_string_object_ } from './models/BaseResponse_Map_string_object_'; export type { BaseResponse_Map_string_object_ } from './models/BaseResponse_Map_string_object_';
export type { BaseResponse_ObjectiveContentKnowVO_ } from './models/BaseResponse_ObjectiveContentKnowVO_'; 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_ } from './models/BaseResponse_Page_';
export type { BaseResponse_Page_CourseFavourDetailVO_ } from './models/BaseResponse_Page_CourseFavourDetailVO_'; export type { BaseResponse_Page_CourseFavourDetailVO_ } from './models/BaseResponse_Page_CourseFavourDetailVO_';
export type { BaseResponse_Page_CourseResources_ } from './models/BaseResponse_Page_CourseResources_'; 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_List_CourseResources_ } from '../models/BaseResponse_List_CourseResources_';
import type { BaseResponse_Page_ } from '../models/BaseResponse_Page_'; import type { BaseResponse_Page_ } from '../models/BaseResponse_Page_';
import type { BaseResponse_string_ } from '../models/BaseResponse_string_'; import type { BaseResponse_string_ } from '../models/BaseResponse_string_';
import type { CourseResources } from '../models/CourseResources';
import type { CancelablePromise } from '../core/CancelablePromise'; import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI'; import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request'; 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_List_ObjectivesType_ } from '../models/BaseResponse_List_ObjectivesType_';
import type { BaseResponse_Map_string_object_ } from '../models/BaseResponse_Map_string_object_'; import type { BaseResponse_Map_string_object_ } from '../models/BaseResponse_Map_string_object_';
import type { BaseResponse_ObjectiveContentKnowVO_ } from '../models/BaseResponse_ObjectiveContentKnowVO_'; 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_PageDTO_CoursesVO_ } from '../models/BaseResponse_PageDTO_CoursesVO_';
import type { BaseResponse_string_ } from '../models/BaseResponse_string_'; import type { BaseResponse_string_ } from '../models/BaseResponse_string_';
import type { CourseObjectivesDTO } from '../models/CourseObjectivesDTO'; 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 * @param id id

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

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

@ -1,15 +1,29 @@
<template> <template>
<el-tab-pane label="知识点收藏" name="third"> <el-tab-pane label="知识点收藏" name="third">
<div class="Container_Kno"> <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>
<div class="KnowledgeCollent"> <div class="KnowledgeCollent">
<div class="KnoCon"> <div class="KnoCon">
<h4>课程名称</h4> <h4>{{ item_3.name }}</h4>
<p>{{ item_3 }}-xxxx</p> <p>{{ item_3.num }}-{{item_3.zjname}}</p>
</div> </div>
<div class="KnoBtn"> <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> </div>
<div class="Knowledge_point"> <div class="Knowledge_point">
@ -26,8 +40,61 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</template> </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> <style lang="scss" scoped>
.btn{
display: inline-block;
}
.item_3.noUpd{
.btn{
display: none;
}
}
.Container_Kno { .Container_Kno {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -72,7 +139,7 @@
.KnowledgeCollent h4 { .KnowledgeCollent h4 {
margin-top: 3px; margin-top: 3px;
font-size: 30px; font-size: 27px;
font-weight: 550; font-weight: 550;
font-style: normal; font-style: normal;
} }
@ -107,10 +174,6 @@
border-radius: 3px; border-radius: 3px;
} }
.btn {
display: none;
}
.btn:hover { .btn:hover {
cursor: pointer; cursor: pointer;
color: rgb(15, 57, 76); color: rgb(15, 57, 76);

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

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

@ -1,9 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
// import axios from 'axios'
import { CourseResourceControllerService } from '../../../../generated/services/CourseResourceControllerService' import { CourseResourceControllerService } from '../../../../generated/services/CourseResourceControllerService'
const props = defineProps(['dafulIndex']) const props = defineProps(['dafulIndex'])
import { QuillEditor } from '@vueup/vue-quill' import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css' import '@vueup/vue-quill/dist/vue-quill.snow.css'
import { ElMessage } from 'element-plus'
// //
const visibleDramwer = ref(false) const visibleDramwer = ref(false)
// //
@ -63,12 +65,17 @@ const selectOp = ref([
{ label: '文件', value: '5' }, { label: '文件', value: '5' },
{ label: '音频', value: '6' }, { label: '音频', value: '6' },
]) ])
const handleSel = () => {}
// const fileList = ref([])
import type { UploadProps, UploadUserFile } from 'element-plus' 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) => { const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
console.log(uploadFile, uploadFiles) console.log(uploadFile, uploadFiles)
@ -77,6 +84,82 @@ const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
const handlePreview: UploadProps['onPreview'] = (file) => { const handlePreview: UploadProps['onPreview'] = (file) => {
console.log(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> </script>
<template> <template>
<el-drawer <el-drawer
@ -118,11 +201,13 @@ const handlePreview: UploadProps['onPreview'] = (file) => {
<el-form-item label="上传资源" prop="fileList"> <el-form-item label="上传资源" prop="fileList">
<el-upload <el-upload
v-model:file-list="fileList" v-model:file-list="fileList"
:limit="1"
class="upload-demo" class="upload-demo"
action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
:on-preview="handlePreview" :on-preview="handlePreview"
:on-remove="handleRemove" :on-remove="handleRemove"
list-type="picture" list-type="picture"
:before-upload="beforeAvatarUpload"
> >
<el-button type="primary">点击上传资源</el-button> <el-button type="primary">点击上传资源</el-button>
<template #tip> <template #tip>
@ -135,7 +220,7 @@ const handlePreview: UploadProps['onPreview'] = (file) => {
<el-form-item label="资源简介" prop="description"> <el-form-item label="资源简介" prop="description">
<div class="editor"> <div class="editor">
<quill-editor <quill-editor
v-model:description="formModel.description" v-model:content="formModel.description"
content-type="html" content-type="html"
theme="snow" theme="snow"
></quill-editor> ></quill-editor>
@ -143,7 +228,7 @@ const handlePreview: UploadProps['onPreview'] = (file) => {
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary">取消</el-button> <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-item>
</el-form> </el-form>
</el-drawer> </el-drawer>

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

Loading…
Cancel
Save