Merge pull request 'add:章节节点添加;' (#398) from yangws into main
Reviewed-on: #398
This commit is contained in:
commit
f0fcbed61e
|
@ -0,0 +1,59 @@
|
||||||
|
<template>
|
||||||
|
<div style="padding: 10px;">
|
||||||
|
<el-dialog
|
||||||
|
v-model="dialogVisible"
|
||||||
|
width="30%"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<div style="display: flex;justify-content: center;">
|
||||||
|
<ChooseTextbook @node-click="nodeClick" />
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click.stop="save">确定</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, defineExpose } from 'vue'
|
||||||
|
import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
||||||
|
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const getNodeInfo = ref([])
|
||||||
|
|
||||||
|
const openDialog = () => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFullObj = (node) => {
|
||||||
|
const obj = []
|
||||||
|
const recursive = (currentNode) => {
|
||||||
|
// 这里添加节点参数
|
||||||
|
if (currentNode.parentNode) {
|
||||||
|
obj.unshift(Object.assign({curentId: currentNode.id,title:currentNode.itemtitle}, currentNode.parentNode))
|
||||||
|
recursive(currentNode.parentNode)
|
||||||
|
} else {
|
||||||
|
obj.unshift({id: currentNode.id,title:currentNode.itemtitle})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
recursive(node)
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
|
||||||
|
const nodeClick = (data) => {
|
||||||
|
getNodeInfo.value = getFullObj(data.node)
|
||||||
|
console.log(getNodeInfo.value, 'getNodeInfo.value')
|
||||||
|
}
|
||||||
|
|
||||||
|
const save = () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
openDialog
|
||||||
|
})
|
||||||
|
</script>
|
|
@ -2,6 +2,7 @@
|
||||||
<div v-loading="isLoading" class="page-resource flex">
|
<div v-loading="isLoading" class="page-resource flex">
|
||||||
<ChooseTextbook @node-click="nodeClick" />
|
<ChooseTextbook @node-click="nodeClick" />
|
||||||
<div class="page-center-wrap">
|
<div class="page-center-wrap">
|
||||||
|
<el-button @click="openChapter" type="primary">打开章节</el-button>
|
||||||
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
<el-tabs v-model="activeAptTab" style="height: 100%;">
|
||||||
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
|
<el-tab-pane label="教学课件" name="教学课件" class="prepare-center-jxkj">
|
||||||
<div class="prepare-center-header">
|
<div class="prepare-center-header">
|
||||||
|
@ -140,6 +141,8 @@
|
||||||
<!-- 上课配置 -->
|
<!-- 上课配置 -->
|
||||||
<class-start ref="calssRef" @close="closeChange"/>
|
<class-start ref="calssRef" @close="closeChange"/>
|
||||||
<PptDialog @add-success="addAiPPT" :currentNode="currentNode" :uploadData="uploadData" v-model="pptDialog"/>
|
<PptDialog @add-success="addAiPPT" :currentNode="currentNode" :uploadData="uploadData" v-model="pptDialog"/>
|
||||||
|
<!-- 章节弹窗 -->
|
||||||
|
<TreeLog ref="treelogRef"/>
|
||||||
<!-- <button @click="test">test</button> -->
|
<!-- <button @click="test">test</button> -->
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -178,6 +181,7 @@ import ClassReserv from '@/views/classManage/classReserv.vue'
|
||||||
import classStart from './container/class-start.vue' // 预备上课
|
import classStart from './container/class-start.vue' // 预备上课
|
||||||
import MsgEnum from '@/plugins/imChat/msgEnum' // im 消息枚举
|
import MsgEnum from '@/plugins/imChat/msgEnum' // im 消息枚举
|
||||||
import Chat from '@/utils/chat' // im 登录初始化
|
import Chat from '@/utils/chat' // im 登录初始化
|
||||||
|
import TreeLog from './components/treeLog.vue'
|
||||||
if (!Chat.imChat) Chat.init()
|
if (!Chat.imChat) Chat.init()
|
||||||
|
|
||||||
const toolStore = useToolState()
|
const toolStore = useToolState()
|
||||||
|
@ -235,7 +239,9 @@ export default {
|
||||||
isOpenHomework: false,
|
isOpenHomework: false,
|
||||||
// 当前上课课程
|
// 当前上课课程
|
||||||
activeClass: null,
|
activeClass: null,
|
||||||
pptDialog: false
|
pptDialog: false,
|
||||||
|
// 打开章节的弹窗
|
||||||
|
treelogRef:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -630,6 +636,8 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async nodeClick(data) {
|
async nodeClick(data) {
|
||||||
|
console.log(data,'data');
|
||||||
|
|
||||||
if (this.currentNode.id === data.node.id) return
|
if (this.currentNode.id === data.node.id) return
|
||||||
this.curBookImg = data.textBook.curBookImg
|
this.curBookImg = data.textBook.curBookImg
|
||||||
this.curBookPath = data.textBook.curBookPath
|
this.curBookPath = data.textBook.curBookPath
|
||||||
|
@ -788,6 +796,11 @@ export default {
|
||||||
'&reservId=' +
|
'&reservId=' +
|
||||||
id
|
id
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 打开章节
|
||||||
|
openChapter(){
|
||||||
|
// 打开弹窗
|
||||||
|
this.$refs.treelogRef.openDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue