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

updates

上级 df991c9f
...@@ -6,7 +6,7 @@ export function useQuestionList() { ...@@ -6,7 +6,7 @@ export function useQuestionList() {
getQuestionCategory(params).then((res: any) => { getQuestionCategory(params).then((res: any) => {
list.value = res.data.filter((item: any) => { list.value = res.data.filter((item: any) => {
item.children = detailChild(item.children) item.children = detailChild(item.children)
return parseInt(item.status) // return parseInt(item.status)
}) })
}) })
...@@ -14,7 +14,7 @@ export function useQuestionList() { ...@@ -14,7 +14,7 @@ export function useQuestionList() {
if (!child) return [] if (!child) return []
return child.filter((item: any) => { return child.filter((item: any) => {
item.children = detailChild(item.children) item.children = detailChild(item.children)
return parseInt(item.status) // return parseInt(item.status)
}) })
} }
return { list } return { list }
......
...@@ -3,7 +3,6 @@ import { createCharacter, editCharacter } from '../../api' ...@@ -3,7 +3,6 @@ import { createCharacter, editCharacter } from '../../api'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import { useMapStore } from '@/stores/map' import { useMapStore } from '@/stores/map'
const store = useMapStore() const store = useMapStore()
const emit = defineEmits<Emits>() const emit = defineEmits<Emits>()
const ruleFormRef = ref<FormInstance>() const ruleFormRef = ref<FormInstance>()
// 封面状态 // 封面状态
...@@ -80,7 +79,7 @@ onMounted(() => { ...@@ -80,7 +79,7 @@ onMounted(() => {
:title="isEdit ? '编辑:章' : '新增:章'" :title="isEdit ? '编辑:章' : '新增:章'"
> >
<el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="80px"> <el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="80px">
<el-form-item label="章-名称:" prop="type"> <el-form-item label="章-名称:" prop="name">
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -61,10 +61,11 @@ const handleConfirm = () => { ...@@ -61,10 +61,11 @@ const handleConfirm = () => {
course_id: props.course_id, course_id: props.course_id,
resource_type: props.btnInfo.resource_type, resource_type: props.btnInfo.resource_type,
parent_id: props.chapterID, parent_id: props.chapterID,
resource_id: lecturerValue.value[0] resource_id: lecturerValue.value
}, },
form form
) )
console.log(lecturerValue.value, 'lecturerValue')
createCharacter(params).then(() => { createCharacter(params).then(() => {
emit('update:isShowLiveDialog', false) emit('update:isShowLiveDialog', false)
emit('create') emit('create')
......
...@@ -79,10 +79,10 @@ onMounted(() => { ...@@ -79,10 +79,10 @@ onMounted(() => {
:title="props.isEdit ? '编辑:节' : '新增:节'" :title="props.isEdit ? '编辑:节' : '新增:节'"
> >
<el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="80px"> <el-form :model="form" :rules="rules" ref="ruleFormRef" label-width="80px">
<el-form-item label="所属章:" prop="type"> <el-form-item label="所属章:" prop="chapterName">
<p>{{ chapterName }}</p> <p>{{ chapterName }}</p>
</el-form-item> </el-form-item>
<el-form-item label="节-名称:" prop="type"> <el-form-item label="节-名称:" prop="name">
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -9,7 +9,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -9,7 +9,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
<!-- <img :src="props.data.cover" /> --> <!-- <img :src="props.data.cover" /> -->
<div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div> <div class="cover-img" :style="`background-image:url(${props.data.cover})`"></div>
<div class="tool-pop-btn"> <div class="tool-pop-btn">
<div style="min-width: 100%"> <!-- <div style="min-width: 100%">
<router-link v-if="props.data.auth_edit" :to="`/resource/video/update?id=${props.data.id}`"> <router-link v-if="props.data.auth_edit" :to="`/resource/video/update?id=${props.data.id}`">
<div class="edit-btn">编辑</div> <div class="edit-btn">编辑</div>
</router-link> </router-link>
...@@ -18,7 +18,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>() ...@@ -18,7 +18,7 @@ const props: any = defineProps<{ data: object; tabIndex: string }>()
<router-link v-if="props.data.auth_view" :to="`/resource/video/view?id=${props.data.id}`"> <router-link v-if="props.data.auth_view" :to="`/resource/video/view?id=${props.data.id}`">
<div class="view-btn">查看</div> <div class="view-btn">查看</div>
</router-link> </router-link>
</div> </div> -->
</div> </div>
</div> </div>
<div class="card-item-bottom"> <div class="card-item-bottom">
......
<script lang="ts" setup> <script lang="ts" setup>
import { Plus } from '@element-plus/icons-vue' import { Plus } from '@element-plus/icons-vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import { import {
getCharacter, getCharacter,
delCharacter, delCharacter,
...@@ -11,7 +10,6 @@ import { ...@@ -11,7 +10,6 @@ import {
dragChapterList, dragChapterList,
getOtherDetails getOtherDetails
} from '../api' } from '../api'
import AddSectionDialog from '../components/stepTwoComponents/AddSectionDialog.vue' import AddSectionDialog from '../components/stepTwoComponents/AddSectionDialog.vue'
import AddLiveDialog from '../components/stepTwoComponents/AddLiveDialog.vue' import AddLiveDialog from '../components/stepTwoComponents/AddLiveDialog.vue'
import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue' import AddVideoDialog from '../components/stepTwoComponents/AddVideoDialog.vue'
...@@ -34,8 +32,6 @@ const chapterID = ref('') ...@@ -34,8 +32,6 @@ const chapterID = ref('')
const btnInfo = ref({}) // 按钮信息 const btnInfo = ref({}) // 按钮信息
const isEdit = ref(false) const isEdit = ref(false)
const videoUrl = ref('') const videoUrl = ref('')
// const courseUrl = ref('')
// const lessonPlanUrl = ref('')
const otherUrl = ref('') const otherUrl = ref('')
const btnList = [ const btnList = [
{ {
...@@ -84,7 +80,6 @@ const handleChapterList = () => { ...@@ -84,7 +80,6 @@ const handleChapterList = () => {
// 新增章节 // 新增章节
const handleAddChapter = () => { const handleAddChapter = () => {
isShowDialog.value = true isShowDialog.value = true
console.log(isShowDialog.value)
isEdit.value = false isEdit.value = false
} }
// 页面刷新 // 页面刷新
...@@ -93,10 +88,8 @@ const handleFresh = () => { ...@@ -93,10 +88,8 @@ const handleFresh = () => {
} }
// 添加小节 // 添加小节
const handleAddSection = (node: any) => { const handleAddSection = (node: any) => {
console.log(node, 'oooo')
chapterName.value = node.label chapterName.value = node.label
chapterID.value = node.key chapterID.value = node.key
console.log(isShowSectionDialog.value)
isShowSectionDialog.value = true isShowSectionDialog.value = true
} }
//编辑章节 //编辑章节
...@@ -115,7 +108,6 @@ const handleEdit = (node: any) => { ...@@ -115,7 +108,6 @@ const handleEdit = (node: any) => {
const handleDel = (node: any) => { const handleDel = (node: any) => {
ElMessageBox.confirm('确定要删除吗?', '提示').then(() => { ElMessageBox.confirm('确定要删除吗?', '提示').then(() => {
const params = { id: node.key, course_id: id } const params = { id: node.key, course_id: id }
delCharacter(params).then(() => { delCharacter(params).then(() => {
ElMessage.success('删除成功') ElMessage.success('删除成功')
handleFresh() handleFresh()
...@@ -141,9 +133,7 @@ const handleAddDialog = (node: any, item: any) => { ...@@ -141,9 +133,7 @@ const handleAddDialog = (node: any, item: any) => {
isShowExamDialog.value = true isShowExamDialog.value = true
} }
} }
//查阅 //查阅
const handleConsult = (node: any) => { const handleConsult = (node: any) => {
console.log(node.data.resource_type, '000') console.log(node.data.resource_type, '000')
// 视频 // 视频
...@@ -175,6 +165,7 @@ const handleDownload = (node: any) => { ...@@ -175,6 +165,7 @@ const handleDownload = (node: any) => {
}) })
} }
} }
//拖拽
const allowDrop = (draggingNode: any, dropNode: any, type: any) => { const allowDrop = (draggingNode: any, dropNode: any, type: any) => {
console.log(draggingNode.data, dropNode, type) console.log(draggingNode.data, dropNode, type)
if (draggingNode.data.depth === dropNode.data.depth) { if (draggingNode.data.depth === dropNode.data.depth) {
...@@ -188,6 +179,7 @@ const allowDrop = (draggingNode: any, dropNode: any, type: any) => { ...@@ -188,6 +179,7 @@ const allowDrop = (draggingNode: any, dropNode: any, type: any) => {
return false return false
} }
} }
//拖拽列表
const handleDrop = (startNode: any, endNode: any, position: any, event: any) => { const handleDrop = (startNode: any, endNode: any, position: any, event: any) => {
console.log(startNode, endNode, position, event) console.log(startNode, endNode, position, event)
const params = { const params = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论