Compare commits
10 Commits
0cbb513a60
...
9eb6d991c1
Author | SHA1 | Date |
---|---|---|
白了个白 | 9eb6d991c1 | |
lyc | be765b21b6 | |
lyc | 34c1c66b31 | |
lyc | 5f06657b09 | |
zhengdegang | aa35621b59 | |
zdg | 49de9ee9c2 | |
zdg | 0ef5ef424f | |
baigl | 89ae43a458 | |
lyc | db2be260a7 | |
baigl | b06ad0f411 |
|
@ -6,7 +6,7 @@
|
|||
<i class="iconfont icon-xiangyou"></i>
|
||||
</div>
|
||||
<div class="book-list" v-loading="treeLoading">
|
||||
<el-tree ref="refTree" :data="treeData" :props="defaultProps" node-key="id"
|
||||
<el-tree ref="refTree" :data="treeData" accordion :props="defaultProps" node-key="id"
|
||||
:default-expanded-keys="defaultExpandedKeys" :current-node-key="currentNodeId" highlight-current
|
||||
@node-click="handleNodeClick">
|
||||
<template #default="{ node }">
|
||||
|
@ -109,6 +109,8 @@ const getSubjectContent = async () => {
|
|||
evaluationList.value = JSON.parse(localStorage.getItem('evaluationList'))
|
||||
}
|
||||
else{
|
||||
localStorage.removeItem('defaultExpandedKeys')
|
||||
localStorage.removeItem('currentNodeId')
|
||||
const { rows } = await listEvaluation(params)
|
||||
localStorage.setItem('evaluationList', JSON.stringify(rows))
|
||||
evaluationList.value = rows
|
||||
|
@ -134,6 +136,10 @@ const changeBook = ({ id, itemtitle, avartar, fileurl }) => {
|
|||
curBookName.value = itemtitle
|
||||
curBookImg.value = BaseUrl + avartar
|
||||
curBookPath.value = fileurl
|
||||
|
||||
localStorage.removeItem('defaultExpandedKeys')
|
||||
localStorage.removeItem('currentNodeId')
|
||||
localStorage.setItem('curBook', JSON.stringify({id, itemtitle, avartar, fileurl}))
|
||||
getTreeData()
|
||||
setTimeout(() => {
|
||||
dialogVisible.value = false
|
||||
|
@ -144,7 +150,6 @@ const getTreeData = () => {
|
|||
//数据过滤
|
||||
let upData = transData(evaluationList.value)
|
||||
|
||||
|
||||
if(upData.length){
|
||||
treeData.value = [...upData]
|
||||
}
|
||||
|
@ -153,10 +158,22 @@ const getTreeData = () => {
|
|||
return
|
||||
}
|
||||
nextTick(() => {
|
||||
|
||||
let defaultCurNodeId = localStorage.getItem('currentNodeId')
|
||||
if(defaultCurNodeId){
|
||||
defaultCurNodeId = JSON.parse(defaultCurNodeId)
|
||||
const data = findNode(defaultCurNodeId)
|
||||
currentNode.data = findNode(defaultCurNodeId)
|
||||
currentNodeId.value = data.id
|
||||
currentNodeName.value = data.label
|
||||
}
|
||||
else{
|
||||
defaultExpandedKeys.value = [treeData.value[0].id]
|
||||
currentNode.data = getLastLevelData(treeData.value)[0]
|
||||
currentNodeId.value = getLastLevelData(treeData.value)[0].id
|
||||
currentNodeName.value = getLastLevelData(treeData.value)[0].label
|
||||
}
|
||||
|
||||
emitChangeBook()
|
||||
})
|
||||
|
||||
|
@ -183,6 +200,9 @@ const emitChangeBook = () => {
|
|||
},
|
||||
node: curNode
|
||||
}
|
||||
|
||||
localStorage.setItem('defaultExpandedKeys', JSON.stringify(defaultExpandedKeys.value))
|
||||
localStorage.setItem('currentNodeId', JSON.stringify(currentNodeId.value))
|
||||
emit('changeBook', data)
|
||||
}
|
||||
|
||||
|
@ -230,6 +250,11 @@ const findParentByChildId = (treeData, targetNodeId) => {
|
|||
return null;
|
||||
}
|
||||
|
||||
const findNode = (id) =>{
|
||||
if(!id) return
|
||||
return evaluationList.value.find( item => item.id == id)
|
||||
}
|
||||
|
||||
const transData = (data) => {
|
||||
let ary = []
|
||||
data.forEach(item => {
|
||||
|
@ -281,10 +306,21 @@ const getSubject = async () => {
|
|||
|
||||
// 默认第一个
|
||||
if(!subjectList.value.length) return
|
||||
let curBook = localStorage.getItem('curBook')
|
||||
if(curBook){
|
||||
curBook = JSON.parse(curBook)
|
||||
curBookName.value = curBook.itemtitle
|
||||
curBookId.value = curBook.id
|
||||
curBookImg.value = BaseUrl + curBook.avartar
|
||||
curBookPath.value = curBook.fileurl
|
||||
}
|
||||
else{
|
||||
curBookName.value = subjectList.value[0].itemtitle
|
||||
curBookId.value = subjectList.value[0].id
|
||||
curBookImg.value = BaseUrl + subjectList.value[0].avartar
|
||||
curBookPath.value = subjectList.value[0].fileurl
|
||||
localStorage.setItem('curBookId', curBookId.value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -321,7 +357,12 @@ const handleNodeClick = (data, node) => {
|
|||
node: toRaw(nodeData)
|
||||
}
|
||||
currentNode.data = curData
|
||||
|
||||
localStorage.setItem('defaultExpandedKeys', nodeData.parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id]))
|
||||
localStorage.setItem('currentNodeId', JSON.stringify(data.id))
|
||||
|
||||
emit('nodeClick', curData)
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
getSubjectContent()
|
||||
|
|
|
@ -66,9 +66,10 @@ function stateSyncWatch(storeName, newState) {
|
|||
const keyArr = key.split('.') || []
|
||||
keyArr.reduce((o,c,i)=>{o[c] = i === keyArr.length-1 ? value : {};return o[c]}, newValue)
|
||||
const jsonStr = JSON.stringify(newValue) // 从新组装-json数据
|
||||
// // 更新本地数据-session
|
||||
// 更新本地数据-session
|
||||
// console.log('state-change-update:', key, value)
|
||||
sessionStore.set(key, value)
|
||||
// // 通知主线程更新
|
||||
// 通知主线程更新
|
||||
ipcRenderer?.invoke('pinia-state-change', storeName, jsonStr)
|
||||
// console.log('======',key, value, jsonStr )
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ const menuList = [{
|
|||
// path: '/prepare'
|
||||
// },
|
||||
{
|
||||
name: '教学实施',
|
||||
name: '教学实践',
|
||||
icon: 'icon-jiaoxuefenxi',
|
||||
path: '/prepare'
|
||||
},
|
||||
|
|
|
@ -119,71 +119,22 @@ onMounted(() => {
|
|||
*/
|
||||
const open = async (id) => {
|
||||
visible.value = true
|
||||
if (id) {
|
||||
// 重置数据
|
||||
reset()
|
||||
// 获取apt详情
|
||||
if (id) await getAptInfo(id)
|
||||
// 模拟数据
|
||||
// myClassActive.value = {
|
||||
// "createBy": null,
|
||||
// "createTime": null,
|
||||
// "updateBy": null,
|
||||
// "updateTime": null,
|
||||
// "remark": null,
|
||||
// "id": 14740,
|
||||
// "idarray": null,
|
||||
// "jsonarray": null,
|
||||
// "entpid": 255,
|
||||
// "parentid": 14741,
|
||||
// "linkids": "",
|
||||
// "linklist": "",
|
||||
// "entpcourseid": 7300,
|
||||
// "entpcourseidarray": null,
|
||||
// "evalid": 39952,
|
||||
// "evaltitle": " 质点 参考系",
|
||||
// "coursetitle": " 质点 参考系",
|
||||
// "classid": 0,
|
||||
// "ppttype": "file",
|
||||
// "title": " 质点 参考系",
|
||||
// "fileidx": 0,
|
||||
// "fileurl": "",
|
||||
// "pathfile": null,
|
||||
// "filetype": "ppt",
|
||||
// "filesize": null,
|
||||
// "datacontent": "",
|
||||
// "filekey": "",
|
||||
// "filetag": "",
|
||||
// "dflag": 0,
|
||||
// "status": "",
|
||||
// "edituserid": 2781,
|
||||
// "editusername": "张雪林",
|
||||
// "edituserheadimgurl": "/profile/avatar/2024/08/12/blob_20240812152930A001.jpeg",
|
||||
// "edituserentpname": "AIx数字平台内测中心",
|
||||
// "editstudentid": null,
|
||||
// "editstudentname": null,
|
||||
// "timestamp": "2024-09-10 15:07:20",
|
||||
// "token": null,
|
||||
// "base64Code": null,
|
||||
// "orderby": null,
|
||||
// "childcount": 4,
|
||||
// "commentlikecount": 0,
|
||||
// "commenttextcount": 0,
|
||||
// "commentusecount": 0,
|
||||
// "commentvisitcount": 90,
|
||||
// "unixstamp": null,
|
||||
// "classworkcount": 0,
|
||||
// "classworklist": "",
|
||||
// "authjson": "",
|
||||
// "defaultslide": null
|
||||
// }
|
||||
await getAptInfo(id)
|
||||
// 获取班级列表
|
||||
getClassList()
|
||||
|
||||
// 初始化im-chat
|
||||
// nextTick(async() => {
|
||||
// chat = await imChatRef.value?.initImChat()
|
||||
// })
|
||||
nextTick(async() => {
|
||||
chat = await imChatRef.value?.initImChat()
|
||||
})
|
||||
}
|
||||
}
|
||||
// 关闭弹窗
|
||||
const handleClose = async () => {
|
||||
reset() // 重置数据
|
||||
await chat?.logout()
|
||||
chat = null
|
||||
}
|
||||
|
@ -204,6 +155,15 @@ const initData = () => {
|
|||
{ label: '故障备用', prop: 'backup', show: false },
|
||||
]
|
||||
}
|
||||
// 重置数据
|
||||
const reset = () => {
|
||||
// 初始化-表单数据
|
||||
classForm.form = {}
|
||||
teacherForm.form = { classcourseid: 0 }
|
||||
dt.isCreate = false
|
||||
dt.isHistory = false
|
||||
dt.atCourse = {}
|
||||
}
|
||||
// 获取课件APT
|
||||
const getAptInfo = async (id) => {
|
||||
const res = await Http_Entpcoursefile.getEntpcoursefile(id)
|
|
@ -52,7 +52,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="prepare-body-main-item-btn">
|
||||
<el-button type="primary" @click="clickStartClass(item)">上课</el-button>
|
||||
<el-button v-if="activeClassId==item.id" type="success" @click="clickStartClass(item)">上课中</el-button>
|
||||
<el-button v-else type="primary" @click="clickStartClass(item)">上课</el-button>
|
||||
</div>
|
||||
<div class="prepare-body-main-item-tool">
|
||||
<el-popover
|
||||
|
@ -65,18 +66,20 @@
|
|||
<template #default>
|
||||
<div style="width: 100%">
|
||||
<div class="item-popover" @click="closePopver(index)">
|
||||
<div v-if="userInfo.userId === Number(item.createUserId)" class="item-popover-item">
|
||||
<template v-if="userInfo.userId === Number(item.createUserId)">
|
||||
<div class="item-popover-item">
|
||||
<el-button text @click="editTalk(item, index)">
|
||||
<i class="iconfont icon-bianji"></i>
|
||||
<span>标签</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-if="userInfo.userId === Number(item.createUserId)" class="item-popover-item">
|
||||
<el-button text @click="deleteTalk(item)">
|
||||
<div class="item-popover-item">
|
||||
<el-button text @click="deleteTalk(item)" :disabled="activeClassId==item.id">
|
||||
<i class="iconfont icon-shanchu"></i>
|
||||
<span>删除</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -98,6 +101,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||
import { deleteSmarttalk, updateSmarttalk, getPrepareById } from '@/api/file'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
export default {
|
||||
|
@ -115,6 +119,10 @@ export default {
|
|||
default: function () {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
activeClassId: { // 当前上课id
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
emits: { 'on-start-class': null, 'on-delete': null, 'on-set': null, 'on-delhomework': null,'on-filearg': null },
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
:key="index"
|
||||
:item="item"
|
||||
:index="index"
|
||||
:activeClassId="activeClass?.id"
|
||||
@on-delete="deleteTalk"
|
||||
@on-start-class="startClass"
|
||||
>
|
||||
|
@ -192,7 +193,7 @@ import { getClassInfo, getSelfReserv } from '@/api/classManage'
|
|||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { addEntpcoursefileReturnId } from '@/api/education/entpcoursefile'
|
||||
import ClassReserv from '@/views/classManage/classReserv.vue'
|
||||
import classStart from '@/views/desktop/container/class-start.vue' // 预备上课
|
||||
import classStart from './container/class-start.vue' // 预备上课
|
||||
const toolStore = useToolState()
|
||||
|
||||
const fs = require('fs')
|
||||
|
@ -246,7 +247,9 @@ export default {
|
|||
// 布置作业弹窗
|
||||
setDialog: false,
|
||||
row: '',
|
||||
isOpenHomework: false
|
||||
isOpenHomework: false,
|
||||
// 当前上课课程
|
||||
activeClass: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -272,6 +275,9 @@ export default {
|
|||
})
|
||||
this.lastAsyncAllTime = localStorage.getItem('lastAsyncAllTime')
|
||||
// this.initReserv()
|
||||
|
||||
// zdg: 获取缓存中的当前课程
|
||||
this.activeClass = sessionStore.get('activeClass') || null
|
||||
},
|
||||
mounted() {
|
||||
this.$watch(
|
||||
|
@ -298,15 +304,20 @@ export default {
|
|||
// },
|
||||
methods: {
|
||||
startClass(item) {
|
||||
console.log(item)
|
||||
// console.log(item, sessionStore)
|
||||
if(item.fileFlag === '课件') {
|
||||
// 关闭状态,打开上课相关功能(已打开,忽略)
|
||||
const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null
|
||||
if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作')
|
||||
this.openReserv()
|
||||
}
|
||||
if(item.fileFlag === 'apt') {
|
||||
//TODO 打开apt
|
||||
const { fileId: aptId } = item
|
||||
this.$refs.calssRef.open(aptId)
|
||||
//TODO 打开apt - fileId: aptId
|
||||
this.$refs.calssRef.open(item.fileId)
|
||||
}
|
||||
// 当前上课-store
|
||||
sessionStore.set('activeClass', item)
|
||||
this.activeClass = item
|
||||
},
|
||||
initReserv(id) {
|
||||
getClassInfo(id).then((res) => {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<upvote-vue ref="upvoteRef" type="2"></upvote-vue>
|
||||
|
||||
<!-- im-chat 聊天组件 -->
|
||||
<im-chat ref="imChatRef" @change="chatChange" isGroup />
|
||||
<im-chat ref="imChatRef" @change="chatChange" group />
|
||||
|
||||
<!-- 底部工具栏 -->
|
||||
<div class="tool-bottom-all" @mouseenter="mouseChange(0)" @mouseleave="mouseChange(1)">
|
||||
|
|
Loading…
Reference in New Issue