完善课程模块;添加轮播图模块
This commit is contained in:
@@ -156,7 +156,9 @@ async function enterChapterChildDialog() { // 提交小章节
|
||||
}
|
||||
}
|
||||
function getFilePath(file) { // 获取上传文件之后的地址
|
||||
|
||||
console.log(file)
|
||||
chapterChildForm.value.url = file.url
|
||||
chapterChildForm.value.url_name = file.url_name
|
||||
}
|
||||
function chooseChapterChildExercises() { // 打开选择习题窗口
|
||||
|
||||
@@ -278,7 +280,7 @@ function openExercisesWinFunc() { // 打开媒体库
|
||||
<!-- class="upload-btn"-->
|
||||
<!-- @on-success="getFilePath"-->
|
||||
<!-- />-->
|
||||
<exercises-com @on-success="getFilePath" />
|
||||
<exercises-com @on-success="getFilePath" :url_name="chapterChildForm.url_name" />
|
||||
<!-- <el-button size="small" type="primary" @click="openExercisesWinFunc">点击上传</el-button>-->
|
||||
</el-form-item>
|
||||
<el-form-item label="习题管理">
|
||||
|
@@ -12,7 +12,7 @@ const route = useRoute()
|
||||
import { useUserStore } from '@/pinia/modules/user'
|
||||
const userStore = useUserStore()
|
||||
// import chapterCom from '../components/chapter.vue'
|
||||
const props = defineProps(['course_id','chapter_info'])
|
||||
const props = defineProps(['url_name'])
|
||||
const emit = defineEmits(['on-success'])
|
||||
import { clients, getNowDate } from '@/utils'
|
||||
import { getToken } from '@/utils/auth'
|
||||
@@ -22,7 +22,8 @@ const drawer = ref(false)
|
||||
const queryParams =ref({
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
name:''
|
||||
name:'',
|
||||
subject:''
|
||||
})
|
||||
// 生命周期
|
||||
const subjectList = inject('subjectList')
|
||||
@@ -83,6 +84,12 @@ async function httpUpload(file) { // 上传oss
|
||||
// 上传成功之后添加媒体库
|
||||
// this.addDepotFun(`${imgUrl}/${fileName}`, file.file.name)
|
||||
// 数据赋值
|
||||
const params = {
|
||||
url:`${imgUrl}/${fileName}`,
|
||||
url_name:file.file.name
|
||||
}
|
||||
// console.log(params)
|
||||
emit('on-success',params)
|
||||
// this.$set(this.chapterTable.sel, 'url', `${imgUrl}/${fileName}`)
|
||||
// this.$set(this.chapterTable.sel, 'url_name', file.file.name)
|
||||
}
|
||||
@@ -91,6 +98,7 @@ async function httpUpload(file) { // 上传oss
|
||||
<template>
|
||||
<div>
|
||||
<el-button size="small" type="primary" @click="openExercisesWinFunc">点击上传</el-button>
|
||||
<div v-if="url_name">{{url_name}}</div>
|
||||
<el-drawer v-model="drawer" title="媒体库" size="50%">
|
||||
<div class="drawer-section">
|
||||
<!-- 搜索框-->
|
||||
@@ -115,6 +123,7 @@ async function httpUpload(file) { // 上传oss
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-upload
|
||||
:headers="headers"
|
||||
class="upload-demo"
|
||||
action
|
||||
:http-request="httpUpload"
|
||||
@@ -129,7 +138,9 @@ async function httpUpload(file) { // 上传oss
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 数据列表-->
|
||||
<div class="list-box"></div>
|
||||
<div class="list-box">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user