提交 700210fd authored 作者: matian's avatar matian

updates

上级 5a37f9d7
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
this.initPlayer() this.initPlayer()
} }
this.player && this.initPlayer() this.player && this.initPlayer()
// this.$emit()
}, },
beforeUnmount() { beforeUnmount() {
this.player && this.player.dispose() this.player && this.player.dispose()
...@@ -77,6 +78,8 @@ export default { ...@@ -77,6 +78,8 @@ export default {
const self = this const self = this
this.player = videojs(document.querySelector('#videoJS'), this.videoOptions, function onPlayerReady() { this.player = videojs(document.querySelector('#videoJS'), this.videoOptions, function onPlayerReady() {
self.$emit('ready', this) self.$emit('ready', this)
self.$emit('videoHeight', document.getElementById('videoJS')?.offsetHeight)
self.$emit('videoWidth', document.getElementById('videoJS')?.offsetWidth)
const DEFAULT_EVENTS = [ const DEFAULT_EVENTS = [
'abort', 'abort',
'canplay', 'canplay',
......
...@@ -103,6 +103,7 @@ const handleFresh = () => { ...@@ -103,6 +103,7 @@ const handleFresh = () => {
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)" @change="handleChangeStatus(row)"
:disabled="!isAdmin"
></el-switch> ></el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
......
<script setup lang="ts"> <script setup lang="ts">
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { getProList, updatePro } from '../api' import { getProList, updatePro } from '../api'
import { useUserStore } from '@/stores/user'
import AddPro from '../components/AddPro.vue' import AddPro from '../components/AddPro.vue'
// 判断当前用户是不是超级管理员
const user = useUserStore().roles
const isAdmin = !!user.find((item: any) => item.name === '超级管理员')
const appList = ref() const appList = ref()
const title = ref('') const title = ref('')
const id = ref('') const id = ref('')
...@@ -71,6 +74,7 @@ const handleChangeStatus = (row: any) => { ...@@ -71,6 +74,7 @@ const handleChangeStatus = (row: any) => {
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)" @change="handleChangeStatus(row)"
:disabled="!isAdmin"
></el-switch> ></el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
......
...@@ -92,6 +92,7 @@ const handleChangeStatus = (row: any) => { ...@@ -92,6 +92,7 @@ const handleChangeStatus = (row: any) => {
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)" @change="handleChangeStatus(row)"
:disabled="!isAdmin"
></el-switch> ></el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
......
...@@ -102,6 +102,7 @@ const handleChangeStatus = (row: any) => { ...@@ -102,6 +102,7 @@ const handleChangeStatus = (row: any) => {
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)" @change="handleChangeStatus(row)"
:disabled="!isAdmin"
></el-switch> ></el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
......
...@@ -138,6 +138,8 @@ const handleSelectionChange = (val: any) => { ...@@ -138,6 +138,8 @@ const handleSelectionChange = (val: any) => {
inline-prompt inline-prompt
style="--el-switch-on-color: #aa1941" style="--el-switch-on-color: #aa1941"
@change="handleChangeStatus(row)" @change="handleChangeStatus(row)"
:disabled="!isAdmin"
></el-switch> ></el-switch>
</template> </template>
<template #table-operate="{ row }"> <template #table-operate="{ row }">
......
...@@ -12,7 +12,7 @@ const route = useRoute() ...@@ -12,7 +12,7 @@ const route = useRoute()
const router = useRouter() const router = useRouter()
const isEditCourse = route.query.isEditCourse as string const isEditCourse = route.query.isEditCourse as string
const id = route.query.id as string const id = route.query.id as string
const dataSource = ref([]) const dataSource: any = ref([])
const isShowDialog = ref(false) const isShowDialog = ref(false)
const isShowSectionDialog = ref(false) const isShowSectionDialog = ref(false)
const isShowLiveDialog = ref(false) const isShowLiveDialog = ref(false)
...@@ -68,6 +68,8 @@ onMounted(() => { ...@@ -68,6 +68,8 @@ onMounted(() => {
const handleChapterList = () => { const handleChapterList = () => {
getCharacter({ course_id: id, type: 'tree' }).then((res: any) => { getCharacter({ course_id: id, type: 'tree' }).then((res: any) => {
dataSource.value = res.data[0]?.children dataSource.value = res.data[0]?.children
console.log(dataSource, 'dataSource')
defaultExpandedKeys.value = [dataSource.value[0]?.id]
dataSource.value?.forEach((item: any) => { dataSource.value?.forEach((item: any) => {
if (item.children.length) { if (item.children.length) {
item.children.forEach((it: any) => { item.children.forEach((it: any) => {
...@@ -250,6 +252,7 @@ const nodeType = (node: any) => { ...@@ -250,6 +252,7 @@ const nodeType = (node: any) => {
} }
} }
const handleNodeExpand = (data: any) => { const handleNodeExpand = (data: any) => {
console.log(data, '0000000')
defaultExpandedKeys.value = [data.id] defaultExpandedKeys.value = [data.id]
console.log(defaultExpandedKeys.value) console.log(defaultExpandedKeys.value)
} }
...@@ -276,10 +279,11 @@ const handleNodeCollapse = () => { ...@@ -276,10 +279,11 @@ const handleNodeCollapse = () => {
:default-expanded-keys="defaultExpandedKeys" :default-expanded-keys="defaultExpandedKeys"
:expand-on-click-node="false" :expand-on-click-node="false"
@node-drop="handleDrop" @node-drop="handleDrop"
style="min-width: 100%"
@node-expand="handleNodeExpand" @node-expand="handleNodeExpand"
@node-collapse="handleNodeCollapse" @node-collapse="handleNodeCollapse"
style="min-width: 100%"
> >
<!-- -->
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node"> <span class="custom-tree-node">
<span> <span>
......
...@@ -11,7 +11,9 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string) ...@@ -11,7 +11,9 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
<div class="chapter-list"> <div class="chapter-list">
<div class="item" v-for="(item, index) in data" :key="item.id"> <div class="item" v-for="(item, index) in data" :key="item.id">
<div class="order">{{ index + 1 }}</div> <div class="order">
<div class="order-number">{{ index + 1 }}</div>
</div>
<div class="chapter-text"> <div class="chapter-text">
<div class="chapter">{{ item.name }}</div> <div class="chapter">{{ item.name }}</div>
<div class="sections" v-for="child in item.children" :key="child.id"> <div class="sections" v-for="child in item.children" :key="child.id">
...@@ -37,10 +39,8 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string) ...@@ -37,10 +39,8 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
&.active-black { &.active-black {
background: #1f1e24; background: #1f1e24;
border-radius: 0px; border-radius: 0px;
max-height: 506px;
overflow-y: auto; overflow-y: auto;
margin-left: 0px; margin-left: 0px;
.chapter-list { .chapter-list {
.item { .item {
border-bottom: 1px dashed #fff; border-bottom: 1px dashed #fff;
...@@ -78,14 +78,17 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string) ...@@ -78,14 +78,17 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
margin-top: 30px; margin-top: 30px;
.order { .order {
width: 26px; width: 26px;
height: 26px;
background: rgba(255, 255, 255, 1);
border-radius: 50%;
font-size: 16px;
line-height: 26px;
color: #aa1941;
text-align: center;
margin-right: 7px; margin-right: 7px;
.order-number {
width: 26px;
height: 26px;
background: rgba(255, 255, 255, 1);
border-radius: 50%;
font-size: 16px;
line-height: 26px;
color: #aa1941;
text-align: center;
}
} }
.chapter-text { .chapter-text {
.chapter { .chapter {
...@@ -103,7 +106,10 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string) ...@@ -103,7 +106,10 @@ const id = route.query.id ? route.query.id : (route.params.courseId as string)
color: #ffffff; color: #ffffff;
margin-bottom: 20px; margin-bottom: 20px;
cursor: pointer; cursor: pointer;
text-indent: 1em; margin-left: 15px;
cursor: pointer;
word-break: break-all;
text-align: left;
} }
} }
} }
......
...@@ -189,17 +189,16 @@ const liveOptions = computed(() => { ...@@ -189,17 +189,16 @@ const liveOptions = computed(() => {
display: block; display: block;
} }
.label { .label {
font-size: 14px;
line-height: 100%;
color: #666666;
padding-top: 10px; padding-top: 10px;
padding-bottom: 13px; padding-bottom: 13px;
text-align: left; text-align: left;
margin-left: 15px; margin-left: 15px;
font-size: 14px;
line-height: 100%;
color: #999999;
} }
.value { .value {
font-size: 16px; font-size: 14px;
font-weight: 500;
line-height: 100%; line-height: 100%;
color: #333333; color: #333333;
margin-bottom: 10px; margin-bottom: 10px;
......
...@@ -49,84 +49,108 @@ watch( ...@@ -49,84 +49,108 @@ watch(
const changeVideo = (index: number) => { const changeVideo = (index: number) => {
videoIndex = index videoIndex = index
} }
const chapterHeight: any = ref(0)
const chapterWidth: any = ref(0)
// onMounted(() => {
// setTimeout(() => {
// chapter.value = document.getElementById('video_con')?.offsetHeight
// console.log(document.getElementById('video_con')?.offsetHeight, 'ppp')
// }, 2000)
// })
const videoHeight = (h: number) => {
chapterHeight.value = h
}
const videoWidth = (h: number) => {
chapterWidth.value = h
}
</script> </script>
<template> <template>
<div class="main_content"> <el-card>
<div class="content_top"> <div class="main_content">
<AppVideoPlayer :options="videoOptions" class="video_con" height="506" width=" 75%"></AppVideoPlayer> <div class="content_top">
<div class="chapter_con"> <AppVideoPlayer
<ViewCourseChapter :isBlack="true" :data="props.chapterTree"></ViewCourseChapter> @videoHeight="videoHeight"
@videoWidth="videoWidth"
:options="videoOptions"
id="video_con"
class="video_con"
></AppVideoPlayer>
<div class="chapter_con">
<ViewCourseChapter
:style="{ height: chapterHeight + 'px' }"
:isBlack="true"
:data="props.chapterTree"
></ViewCourseChapter>
</div>
</div> </div>
</div> <div class="content_bottom" :style="{ width: chapterWidth + 300 + 'px' }">
<div></div> <div style="margin-top: 20px">本小节视频资源:</div>
<div style="margin-top: 20px">本小节视频资源:</div> <div class="cover-list">
<div class="cover-list"> <div class="cover-box">
<div class="cover-box"> <div
<div class="cover-img"
class="cover-img" :style="`background-image: url(${item.cover})`"
:style="`background-image: url(${item.cover})`" v-for="(item, index) in props.data"
v-for="(item, index) in props.data" :key="item.id"
:key="item.id" @click="changeVideo(index)"
@click="changeVideo(index)" >
> <div :class="index === videoIndex ? 'border active' : 'border'"></div>
<div :class="index === videoIndex ? 'border active' : 'border'"></div> <div class="cover-name">{{ item.name }}</div>
<div class="cover-name">{{ item.name }}</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </el-card>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.main_content { .main_content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.content_top { .content_top {
height: 506px;
display: flex; display: flex;
.video_con { .video_con {
width: 75%; width: 75%;
// height: 506px;
}
.chapter_con {
height: 506px;
} }
} }
} }
.cover-list { .content_bottom {
overflow-x: auto; .cover-list {
} overflow-x: auto;
.cover-box {
display: flex; .cover-box {
justify-content: flex-start; display: flex;
margin-bottom: 30px; justify-content: flex-start;
} margin-bottom: 30px;
.cover-img { }
min-width: 200px; .cover-img {
min-height: 100px; min-width: 200px;
background-size: cover; min-height: 100px;
margin: 20px 10px 0; background-size: cover;
cursor: pointer; margin: 20px 10px 0;
box-sizing: border-box; cursor: pointer;
.border { box-sizing: border-box;
width: 100%; .border {
height: 100%; width: 100%;
box-sizing: border-box; height: 100%;
&.active { box-sizing: border-box;
border-top: 5px solid #aa1941; &.active {
border-left: 5px solid #aa1941; border-top: 5px solid #aa1941;
border-right: 5px solid #aa1941; border-left: 5px solid #aa1941;
border-right: 5px solid #aa1941;
}
}
}
.cover-name {
width: 100%;
background: #aa1941;
text-align: center;
line-height: 30px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #fff;
} }
} }
} }
.cover-name {
width: 100%;
// height: 30px;
background: #aa1941;
text-align: center;
line-height: 30px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #fff;
}
</style> </style>
...@@ -221,17 +221,15 @@ const handleExamDetail = (row: any) => { ...@@ -221,17 +221,15 @@ const handleExamDetail = (row: any) => {
<div class="chapter-box"> <div class="chapter-box">
<div class="title">{{ chapterDetails?.name }}</div> <div class="title">{{ chapterDetails?.name }}</div>
<div class="chapter-content"> <div class="chapter-content">
<el-card> <div class="content-top">
<div class="content-top"> <ViewDetailsVideo
<ViewDetailsVideo v-if="Object.keys(resourceData.videoData).length"
v-if="Object.keys(resourceData.videoData).length" :data="resourceData.videoData"
:data="resourceData.videoData" :chapterTree="chapterTree"
:chapterTree="chapterTree" class="video_con"
class="video_con" ></ViewDetailsVideo>
></ViewDetailsVideo> <el-empty description="暂无数据" v-else />
<el-empty description="暂无数据" v-else /> </div>
</div>
</el-card>
<div class="content-bottom"> <div class="content-bottom">
<el-tabs :lazy="true" v-model="activeName" class="demo-tabs"> <el-tabs :lazy="true" v-model="activeName" class="demo-tabs">
...@@ -276,32 +274,10 @@ const handleExamDetail = (row: any) => { ...@@ -276,32 +274,10 @@ const handleExamDetail = (row: any) => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.chapter-box { .chapter-box {
// max-width: 1200px;
// margin: auto;
// padding: 0 42px;
.title { .title {
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }
.chapter-content {
max-width: 1200px;
min-width: 960px;
margin: auto;
display: flex;
flex-direction: column;
.content-top {
display: flex;
justify-content: center;
align-items: flex-start;
height: 700px;
.video_con {
width: 100%;
height: 100%;
}
}
}
} }
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论