提交 b3e669b7 authored 作者: matian's avatar matian

updates

上级 ef69fe8c
...@@ -143,7 +143,9 @@ const title = computed(() => { ...@@ -143,7 +143,9 @@ const title = computed(() => {
/> />
</template> </template>
</AppList> </AppList>
<div class="btn-box" style="display: flex; justify-content: center">
<el-button type="primary" @click="handleSave">保存</el-button> <el-button type="primary" @click="handleSave">保存</el-button>
</div>
</el-drawer> </el-drawer>
</template> </template>
<style lang="scss"> <style lang="scss">
......
...@@ -76,14 +76,13 @@ const loading = ref(false) ...@@ -76,14 +76,13 @@ const loading = ref(false)
const lecturerValue = ref([]) const lecturerValue = ref([])
// 所有被搜索出来的值 // 所有被搜索出来的值
const allLecturers: any = ref([]) const allLecturers: any = ref([])
const handleLiveList = (query: string) => { const handleLiveList = (query: string) => {
if (query) { if (query) {
loading.value = true loading.value = true
getLiveList({ name: query }).then((res: any) => { getLiveList({ name: query }).then((res: any) => {
loading.value = false loading.value = false
liveList.value = res.data.list.filter((item: any) => { liveList.value = res.data.list
return !lecturerValue.value.find((id: string) => id === item.id)
})
liveList.value.forEach((item: any) => { liveList.value.forEach((item: any) => {
const findItem = allLecturers.value.find((cItem: any) => cItem.id === item.id) const findItem = allLecturers.value.find((cItem: any) => cItem.id === item.id)
if (!findItem) { if (!findItem) {
...@@ -99,7 +98,7 @@ const handleLiveList = (query: string) => { ...@@ -99,7 +98,7 @@ const handleLiveList = (query: string) => {
<template> <template>
<el-dialog :model-value="isShowLiveDialog" draggable :before-close="handleCancel" width="30%" title="添加直播"> <el-dialog :model-value="isShowLiveDialog" draggable :before-close="handleCancel" width="30%" title="添加直播">
<el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="120px"> <el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="120px">
<el-form-item props="resource_id" label="直播名称:"> <el-form-item props="lecturerValue" label="直播名称:">
<el-select <el-select
v-model="lecturerValue" v-model="lecturerValue"
filterable filterable
......
...@@ -143,7 +143,9 @@ const handleSave = () => { ...@@ -143,7 +143,9 @@ const handleSave = () => {
<el-empty v-else description="暂无数据" /> <el-empty v-else description="暂无数据" />
</template> </template>
</AppList> </AppList>
<div class="btn-box" style="display: flex; justify-content: center">
<el-button type="primary" @click="handleSave">保存</el-button> <el-button type="primary" @click="handleSave">保存</el-button>
</div>
</el-drawer> </el-drawer>
</template> </template>
<style lang="scss"> <style lang="scss">
......
<script lang="ts" setup> <script lang="ts" setup>
import { Plus } from '@element-plus/icons-vue' import { Plus } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import AddSectionDialog from '../components/stepTwoComponents/AddSectionDialog.vue'
import AddLiveDialog from '../components/stepTwoComponents/AddLiveDialog.vue'
import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue'
import AddExamDialog from '../components/stepTwoComponents/AddExamDialog.vue'
import VideoPlayDialog from '../components/stepTwoComponents/VideoPlayDialog.vue'
import { import {
getCharacter, getCharacter,
...@@ -16,7 +11,15 @@ import { ...@@ -16,7 +11,15 @@ import {
dragChapterList, dragChapterList,
getOtherDetails getOtherDetails
} from '../api' } from '../api'
import AddSectionDialog from '../components/stepTwoComponents/AddSectionDialog.vue'
import AddLiveDialog from '../components/stepTwoComponents/AddLiveDialog.vue'
import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue'
import AddExamDialog from '../components/stepTwoComponents/AddExamDialog.vue'
import VideoPlayDialog from '../components/stepTwoComponents/VideoPlayDialog.vue'
import AddChapterDialog from '../components/stepTwoComponents/AddChapterDialog.vue'
const route = useRoute() const route = useRoute()
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 = ref([])
...@@ -74,13 +77,14 @@ onMounted(() => { ...@@ -74,13 +77,14 @@ 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
}) })
} }
// 新增章节 // 新增章节
const handleAddChapter = () => { const handleAddChapter = () => {
isShowDialog.value = true isShowDialog.value = true
console.log(isShowDialog.value)
isEdit.value = false isEdit.value = false
} }
// 页面刷新 // 页面刷新
...@@ -97,7 +101,6 @@ const handleAddSection = (node: any) => { ...@@ -97,7 +101,6 @@ const handleAddSection = (node: any) => {
} }
//编辑章节 //编辑章节
const handleEdit = (node: any) => { const handleEdit = (node: any) => {
console.log(node)
chapterID.value = node.key chapterID.value = node.key
isEdit.value = true isEdit.value = true
chapterName.value = node.label chapterName.value = node.label
...@@ -119,7 +122,6 @@ const handleDel = (node: any) => { ...@@ -119,7 +122,6 @@ const handleDel = (node: any) => {
// 添加 // 添加
const handleAddDialog = (node: any, item: any) => { const handleAddDialog = (node: any, item: any) => {
console.log(node, '----', item)
chapterID.value = node.key chapterID.value = node.key
chapterName.value = node.label chapterName.value = node.label
btnInfo.value = item btnInfo.value = item
...@@ -252,6 +254,9 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) => ...@@ -252,6 +254,9 @@ const handleDrop = (startNode: any, endNode: any, position: any, event: any) =>
</span> </span>
</template> </template>
</el-tree> </el-tree>
<div class="btn-box" style="display: flex; justify-content: center">
<el-button type="primary" @click="router.push('/course/my')">保存</el-button>
</div>
</AppCard> </AppCard>
<!-- 添加章 --> <!-- 添加章 -->
<AddChapterDialog <AddChapterDialog
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论