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

updates

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