Merge pull request 'zdg_dev' (#163) from zdg_dev into main

Reviewed-on: #163
This commit is contained in:
zhengdegang 2024-12-20 16:00:48 +08:00
commit 18370129df
3 changed files with 68 additions and 12 deletions

View File

@ -59,6 +59,7 @@ export class PPTApi {
// 获取所有幻灯片列表 isUpdate为true不更新
static getSlideList(parentid: (Number | String),isUpdate?:Boolean): Promise<Boolean> {
const classcourse = sessionStore.get('curr.classcourse') // 课堂信息
return new Promise(async (resolve, reject) => {
const params: object = { parentid, orderByColumn: 'fileidx', isAsc: 'asc', pageSize: 9999 }
const res: Result = await API_entpcoursefile.listEntpcoursefileNew(params)
@ -79,12 +80,10 @@ export class PPTApi {
// 活动列表处理
// const workList = (res.rows || []).map(o => o.activityContent)
const workItem = res.rows ? [...res.rows] : []
// 写入作业列表数据
// slidesStore.setWorkList(workList)
// 获取所有的pptlist的数据
slidesStore.setWorkItem(workItem)
this.updateWorkList()
// 没有上课时调用-作业列表
if(!classcourse) this.updateWorkList()
resolve(true)
} else msgUtils.msgError(res.msg || '获取数据失败');resolve(false)
})
@ -232,10 +231,22 @@ export class PPTApi {
})
}
// 批量更新缩略图-异步
static batchUpdateThumUrl() {
return new Promise(async resolve => {
const list = slidesStore.workItem || []
if (!list.length) return resolve()
const upList = []
for (const [ind,o] of list.entries()) {
const thumUrl = await this.getSlideThumUrl(ind)
}
})
}
// thumbnail-slide thumbnail 缩略图
static getSlideThumUrl(): Promise<Boolean> {
static getSlideThumUrl(index?:number): Promise<Boolean> {
return nextTick().then(async() => {
const slideIndex = slidesStore.slideIndex
const slideIndex = index ?? slidesStore.slideIndex
const elements = document.querySelectorAll('.thumbnail-slide')
if (elements.length && slideIndex >= 0) {
const element = elements[slideIndex]

View File

@ -36,8 +36,8 @@
</div>
<div
class="tools-right" :class="{ 'visible': rightToolsVisible }"
@mouseleave="rightToolsVisible = false"
@mouseenter="rightToolsVisible = true"
@mouseleave="toolTrigger('leave')"
@mouseenter="toolTrigger('enter')"
>
<div class="content">
<div class="tool-btn page-number" @click="slideThumbnailModelVisible = true">幻灯片 {{slideIndex + 1}} / {{slides.length}}</div>
@ -50,6 +50,10 @@
<IconPower class="tool-btn" v-tooltip="'结束放映'" @click="exitScreening()" />
<IconPower class="tool-btn close" v-if="chat.groupid" v-tooltip="'结束课堂'" @click="exitCourse()" />
</div>
<div :class="['tools-icon',{opacity:iconHide}]" @click.stop="toolTrigger('icon')">
<circle-double-down v-if="rightToolsVisible" theme="outline" size="30" fill="#409EFF"/>
<circle-double-up v-else="!rightToolsVisible" theme="outline" size="30" fill="#E6A23C"/>
</div>
</div>
</div>
</template>
@ -71,6 +75,7 @@ import WritingBoardTool from './WritingBoardTool.vue'
import CountdownTimer from './CountdownTimer.vue'
import emitter from '@/utils/mitt';
import Chat from '../../api/chat' //
import { CircleDoubleDown, CircleDoubleUp } from '@icon-park/vue-next' // icon-park
const props = defineProps<{
changeViewMode: (mode: 'base' | 'presenter') => void
@ -103,12 +108,15 @@ const { exitScreening } = useScreening()
const { fullscreenState, manualExitFullscreen } = useFullscreen()
const chat:any = Chat() //
const screenStore =useScreenStore()
const rightToolsVisible = ref(false)
const writingBoardToolVisible = ref(false)
const timerlVisible = ref(false)
const slideThumbnailModelVisible = ref(false)
const laserPen = ref(false)
const screenStore =useScreenStore()
const timer = ref(0) //
const iconHide = ref(false) //
const timerId = ref(null) // id
const contextmenus = (): ContextmenuItem[] => {
return [
{
@ -191,6 +199,30 @@ const contextmenus = (): ContextmenuItem[] => {
]
}
const toolTrigger = (type:string) => {
const curT = Date.now()
if (curT - timer.value < 200) return
iconHide.value = false //
if (timerId.value) clearTimeout(timerId.value) //
switch (type) {
case 'icon': //
timer.value = curT
rightToolsVisible.value = !rightToolsVisible.value
break
case 'enter': //
timer.value = curT
rightToolsVisible.value = true
break
case 'leave': //
rightToolsVisible.value = false
break
default:
break
}
timerId.value = setTimeout(() => { //
iconHide.value = true //
}, 2000)
}
//
const exitCourse = async () => {
// console.log('', chat)
@ -253,6 +285,18 @@ const exitCourse = async () => {
top: -66px;
}
.tools-icon{
position: absolute;
right: 8px;
top: -35px;
z-index: 1;
cursor: pointer;
transition: opacity $transitionDelay;
&.opacity{
opacity: .35;
}
}
.content {
width: 100%;
height: 100%;

View File

@ -194,7 +194,7 @@ import outLink from '@/utils/linkConfig'
import { createWindow, sessionStore, getAppInstallUrl, ipcMsgSend } from '@/utils/tool'
import { cloneDeep } from 'lodash'
import { delClasswork, listEntpcourse } from '@/api/teaching/classwork'
import { updateClasscourse } from '@/api/teaching/classcourse'
import { updateClasscourse, getClasscourse } from '@/api/teaching/classcourse'
import { getClassInfo, getSelfReserv, endClass } from '@/api/classManage'
import { useGetHomework } from '@/hooks/useGetHomework'
import { editListItem } from '@/hooks/useClassTask'
@ -389,12 +389,13 @@ export default {
if (res.code == 200) {
const resource = res.data
if (resource.filetype != 'aippt') this.$refs.calssRef.open(aptFileId, row)
else {
else { // aippt
if (!!sessionStore.get('curr.classcourse')) return ElMessage.warning('公屏已打开,请勿重复操作')
const { data:classcourse } = await getClasscourse(row.id) //
const msgEl = ElMessage.warning({message:'正在打开公屏,请稍后...',duration: 0})
setTimeout(()=>{
msgEl.close()
this.openPublicScreen('class', resource, row) // -
this.openPublicScreen('class', resource, classcourse||row) // -
}, 2000)
}
} else ElMessage.error(res.msg||'获取课件信息失败')