Merge branch 'main' into zouyf_dev
This commit is contained in:
commit
2d615923e7
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win-ws",
|
"name": "aix-win-ws",
|
||||||
"version": "2.5.9",
|
"version": "2.5.10",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "上海交大重庆人工智能研究院",
|
"author": "上海交大重庆人工智能研究院",
|
||||||
|
|
|
@ -13,6 +13,34 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
||||||
const appTempFilePath = userDataPath + '\\tempFile\\'
|
const appTempFilePath = userDataPath + '\\tempFile\\'
|
||||||
let Spark = new SparkMD5.ArrayBuffer()
|
let Spark = new SparkMD5.ArrayBuffer()
|
||||||
|
|
||||||
|
ipcMain.on('remove-local-file-list', (e, list) => {
|
||||||
|
let filePath = appRootFilePath
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
let item = list[i];
|
||||||
|
if (!isAccess(filePath + item.fileNewName)) {
|
||||||
|
e.reply('remove-local-file-list-not', item)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
fs.unlinkSync(filePath + item.fileNewName);
|
||||||
|
console.log(`${filePath} 已成功删除`);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`删除文件时出错:`, err);
|
||||||
|
e.reply('remove-local-file-list-error', item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
e.reply('remove-local-file-list-reply')
|
||||||
|
})
|
||||||
|
|
||||||
|
const isAccess = (filePath) => {
|
||||||
|
try {
|
||||||
|
fs.accessSync(filePath);
|
||||||
|
return true
|
||||||
|
} catch (err) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ipcMain.on('upload-file-change', (e, { id, fileNewName, cookie, fileType }) => {
|
ipcMain.on('upload-file-change', (e, { id, fileNewName, cookie, fileType }) => {
|
||||||
let filePath = appRootFilePath + fileNewName
|
let filePath = appRootFilePath + fileNewName
|
||||||
//执行更新,上传文件
|
//执行更新,上传文件
|
||||||
|
@ -58,7 +86,6 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
||||||
}
|
}
|
||||||
//倒数十秒提交更改,十秒之内有继续修改则重置倒数
|
//倒数十秒提交更改,十秒之内有继续修改则重置倒数
|
||||||
uploadId = setTimeout(() => {
|
uploadId = setTimeout(() => {
|
||||||
console.log(223)
|
|
||||||
//执行更新,上传文件
|
//执行更新,上传文件
|
||||||
let formData = new FormData()
|
let formData = new FormData()
|
||||||
formData.append('id', id)
|
formData.append('id', id)
|
||||||
|
@ -89,8 +116,12 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
||||||
|
|
||||||
function getFileMsg(path) {
|
function getFileMsg(path) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const stats = fs.statSync(path)
|
try {
|
||||||
return resolve(stats.mtime.getTime())
|
const stats = fs.statSync(path)
|
||||||
|
resolve(stats.mtime.getTime())
|
||||||
|
}catch (e) {
|
||||||
|
reject(e)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,17 +334,20 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
||||||
},
|
},
|
||||||
onDownloadCancelled: async () => {
|
onDownloadCancelled: async () => {
|
||||||
console.log("取消")
|
console.log("取消")
|
||||||
reject({type:"取消了下载"})
|
resolve({type:"取消了下载"})
|
||||||
},
|
},
|
||||||
onDownloadInterrupted: async () => {
|
onDownloadInterrupted: async () => {
|
||||||
console.log('中断')
|
console.log('中断')
|
||||||
reject({type:"下载被中断"})
|
resolve({type:"下载被中断"})
|
||||||
},
|
},
|
||||||
onError: (err, data) => {
|
onError: (err, data) => {
|
||||||
console.log(err.toString())
|
console.log(err.toString())
|
||||||
reject({type:"下载出错",err})
|
resolve({type:"下载出错",err})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).catch(err=>{
|
||||||
|
console.log(err)
|
||||||
|
resolve({type:"下载出错",err})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -360,6 +394,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
console.log(error)
|
||||||
e.reply('download-file-default' + fileName, false)
|
e.reply('download-file-default' + fileName, false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -97,14 +97,30 @@ export class PPTApi {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 批量插入slide
|
||||||
|
* @param slides 批量新增的幻灯片
|
||||||
|
* @param slideAll 所有幻灯片
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
static async addSlideServer(slides: object[], slideAll: object[]) {
|
||||||
|
const resource = sessionStore.get('curr.resource')||{}
|
||||||
|
for(const slide of slides){
|
||||||
|
slide.id = resource.id // 覆盖默认随机id
|
||||||
|
await this.addSlide(slide)
|
||||||
|
}
|
||||||
|
await this.batchUpdateSlides(slideAll, true) // 批量更新-排序
|
||||||
|
return PPTApi.getSlideList(resource.id) // 更新幻灯片列表以及活动相关
|
||||||
|
}
|
||||||
|
|
||||||
// 新增幻灯片
|
// 新增幻灯片
|
||||||
static addSlide(data: object): Promise<Boolean> {
|
static addSlide(data: object): Promise<Boolean> {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
const enpt = sessionStore.get('curr.entp')||{}
|
const enpt = sessionStore.get('curr.entp')||{}
|
||||||
const resource = sessionStore.get('curr.resource')||{}
|
// const resource = sessionStore.get('curr.resource')||{}
|
||||||
const {id, ...content} = data
|
const {id, ...content} = data
|
||||||
const params = {
|
const params = {
|
||||||
parentid: resource.id,
|
parentid: id,
|
||||||
entpid: userStore.user.deptId,
|
entpid: userStore.user.deptId,
|
||||||
entpcourseid: enpt.id,
|
entpcourseid: enpt.id,
|
||||||
ppttype: 'file',
|
ppttype: 'file',
|
||||||
|
@ -126,7 +142,7 @@ export class PPTApi {
|
||||||
// msgUtils.msgSuccess('新增成功')
|
// msgUtils.msgSuccess('新增成功')
|
||||||
this.isUpdate = false // 新增后会触发监听,不再更新数据
|
this.isUpdate = false // 新增后会触发监听,不再更新数据
|
||||||
resolve(true)
|
resolve(true)
|
||||||
} else msgUtils.msgError('新增失败');resolve(false)
|
} else msgUtils.msgError('新增失败');reject(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -147,22 +163,17 @@ export class PPTApi {
|
||||||
const currInd = toRaw(slidesStore.slideIndex) // 当前页索引-new
|
const currInd = toRaw(slidesStore.slideIndex) // 当前页索引-new
|
||||||
const oldInd = oldData.findIndex(o => o.id == currentSlide.id) // 当前页索引-old
|
const oldInd = oldData.findIndex(o => o.id == currentSlide.id) // 当前页索引-old
|
||||||
const isBatch = oldVal && oldVal.length && currInd != oldInd // 是否批量更新-排序
|
const isBatch = oldVal && oldVal.length && currInd != oldInd // 是否批量更新-排序
|
||||||
if (isAdd) { // 新增的幻灯片(id 为非数字,说明是新增的幻灯片)
|
if (isAdd) return // 新增-这里不处理 状态管理-处理
|
||||||
const bool = await this.addSlide(currentSlide)
|
// 防抖-更新
|
||||||
bool && await this.batchUpdateSlides(newData, true) // 批量更新-排序
|
if (!this.isUpdate) return this.isUpdate = true // 下次更新数据
|
||||||
const resource = sessionStore.get('curr.resource')||{}
|
if (isBatch) { // 批量更新-排序
|
||||||
await PPTApi.getSlideList(resource.id)
|
this.batchUpdateSlides(newData, true)
|
||||||
} else { // 防抖-更新
|
} else { // 更新当前页幻灯片
|
||||||
if (!this.isUpdate) return this.isUpdate = true // 下次更新数据
|
const params = {
|
||||||
if (isBatch) { // 批量更新-排序
|
id: currentSlide.id,
|
||||||
this.batchUpdateSlides(newData, true)
|
datacontent: JSON.stringify(currentSlide),
|
||||||
} else { // 更新当前页幻灯片
|
|
||||||
const params = {
|
|
||||||
id: currentSlide.id,
|
|
||||||
datacontent: JSON.stringify(currentSlide),
|
|
||||||
}
|
|
||||||
Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2)
|
|
||||||
}
|
}
|
||||||
|
Utils.mxThrottle(() => {this.updateSlide(params)}, 200, 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新幻灯片 isThum 是否更新缩略图
|
// 更新幻灯片 isThum 是否更新缩略图
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* @description 公共监听器
|
* @description 公共监听器
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { watch } from 'vue'
|
import { watch, render } from 'vue'
|
||||||
import { PPTApi } from './index'
|
import { PPTApi } from './index'
|
||||||
import * as store from '../store'
|
import * as store from '../store'
|
||||||
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||||
|
@ -99,6 +99,7 @@ export default () => {
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页
|
case MsgEnum.HEADS.MSG_slideFlapping: // 幻灯片翻页
|
||||||
|
render(null, document.body) //移除弹窗
|
||||||
emitter.emit('closegridPic') //如果有推图片窗口 就关闭
|
emitter.emit('closegridPic') //如果有推图片窗口 就关闭
|
||||||
const slideIndex = content?.current || 0
|
const slideIndex = content?.current || 0
|
||||||
const type = content?.animation // 上下动作
|
const type = content?.animation // 上下动作
|
||||||
|
@ -130,7 +131,7 @@ export default () => {
|
||||||
case MsgEnum.HEADS.MSG_yh: // 疑惑
|
case MsgEnum.HEADS.MSG_yh: // 疑惑
|
||||||
hooksUpvote.trigger(2)
|
hooksUpvote.trigger(2)
|
||||||
break
|
break
|
||||||
case MsgEnum.HEADS.MSG_pushSreen_ImgList: // 推图片上屏
|
case MsgEnum.HEADS.MSG_pushSreen_ImgList: // 推图片上屏
|
||||||
const imgArray = content.ImgList.map((obj) => obj.url);
|
const imgArray = content.ImgList.map((obj) => obj.url);
|
||||||
emitter.emit('opengridPic',{arr:imgArray}) // 打开推图片上屏窗口
|
emitter.emit('opengridPic',{arr:imgArray}) // 打开推图片上屏窗口
|
||||||
break
|
break
|
||||||
|
@ -148,14 +149,4 @@ export default () => {
|
||||||
window.close() // 关闭窗口
|
window.close() // 关闭窗口
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
// setTimeout(async () => {
|
|
||||||
// emitter.emit('opengridPic',{arr:['https://prev.ysaix.com:7868/src/assets/images/homecard4.jpg']})
|
|
||||||
// }, 3000)
|
|
||||||
|
|
||||||
// setTimeout(async () => {
|
|
||||||
// emitter.emit('closegridPic')
|
|
||||||
// }, 6000)
|
|
||||||
// setTimeout(async () => {
|
|
||||||
// emitter.emit('opengridPic',{arr:['https://prev.ysaix.com:7868/src/assets/images/homecard4.jpg','https://prev.ysaix.com:7868/src/assets/images/homecard4.jpg']})
|
|
||||||
// }, 9000)
|
|
||||||
}
|
}
|
|
@ -148,7 +148,8 @@ export const useSlidesStore = defineStore('slides', {
|
||||||
this.workItem = list
|
this.workItem = list
|
||||||
},
|
},
|
||||||
|
|
||||||
addSlide(slide: Slide | Slide[]) {
|
async addSlide(slide: Slide | Slide[]) {
|
||||||
|
const { PPTApi } = await import('../api/index')
|
||||||
const slides = Array.isArray(slide) ? slide : [slide]
|
const slides = Array.isArray(slide) ? slide : [slide]
|
||||||
for (const slide of slides) {
|
for (const slide of slides) {
|
||||||
if (slide.sectionTag) delete slide.sectionTag
|
if (slide.sectionTag) delete slide.sectionTag
|
||||||
|
@ -156,6 +157,8 @@ export const useSlidesStore = defineStore('slides', {
|
||||||
const addIndex = this.slideIndex + 1
|
const addIndex = this.slideIndex + 1
|
||||||
this.slides.splice(addIndex, 0, ...slides)
|
this.slides.splice(addIndex, 0, ...slides)
|
||||||
this.slideIndex = addIndex
|
this.slideIndex = addIndex
|
||||||
|
// 添加到服务器
|
||||||
|
PPTApi.addSlideServer(slides, this.slides)
|
||||||
},
|
},
|
||||||
updateSlide(props: Partial<Slide>, slideId?: string) {
|
updateSlide(props: Partial<Slide>, slideId?: string) {
|
||||||
const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex
|
const slideIndex = slideId ? this.slides.findIndex(item => item.id === slideId) : this.slideIndex
|
||||||
|
|
|
@ -95,8 +95,8 @@
|
||||||
style="width: 65%;"
|
style="width: 65%;"
|
||||||
:options="[
|
:options="[
|
||||||
{ label: '主动触发', value: 'click' },
|
{ label: '主动触发', value: 'click' },
|
||||||
{ label: '与上一动画同时', value: 'meantime' },
|
// { label: '与上一动画同时', value: 'meantime' },
|
||||||
{ label: '上一动画之后', value: 'auto' },
|
// { label: '上一动画之后', value: 'auto' },
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -47,8 +47,9 @@
|
||||||
<IconListView class="tool-btn" v-tooltip="'演讲者视图'" @click="changeViewMode('presenter')" />
|
<IconListView class="tool-btn" v-tooltip="'演讲者视图'" @click="changeViewMode('presenter')" />
|
||||||
<IconOffScreenOne class="tool-btn" v-tooltip="'退出全屏'" v-if="fullscreenState" @click="manualExitFullscreen()" />
|
<IconOffScreenOne class="tool-btn" v-tooltip="'退出全屏'" v-if="fullscreenState" @click="manualExitFullscreen()" />
|
||||||
<IconFullScreenOne class="tool-btn" v-tooltip="'进入全屏'" v-else @click="enterFullscreen()" />
|
<IconFullScreenOne class="tool-btn" v-tooltip="'进入全屏'" v-else @click="enterFullscreen()" />
|
||||||
<IconPower class="tool-btn" v-tooltip="'结束放映'" @click="exitScreening()" />
|
<IconPower class="tool-btn" v-if="!classcourse" v-tooltip="'结束放映'" @click="exitScreening()" />
|
||||||
<IconPower class="tool-btn close" v-if="chat.groupid" v-tooltip="'结束课堂'" @click="exitCourse()" />
|
<IconPower class="tool-btn" v-else v-tooltip="'结束课堂'" @click="exitCourse()" size="30" fill="#d0021b" strokeLinecap="butt" />
|
||||||
|
<Share class="tool-btn" v-if="classcourse" v-tooltip="'分享'" @click="ShareCode()" />
|
||||||
</div>
|
</div>
|
||||||
<div :class="['tools-icon',{opacity:iconHide}]" @click.stop="toolTrigger('icon')">
|
<div :class="['tools-icon',{opacity:iconHide}]" @click.stop="toolTrigger('icon')">
|
||||||
<circle-double-down v-if="rightToolsVisible" theme="outline" size="30" fill="#409EFF"/>
|
<circle-double-down v-if="rightToolsVisible" theme="outline" size="30" fill="#409EFF"/>
|
||||||
|
@ -75,7 +76,8 @@ import WritingBoardTool from './WritingBoardTool.vue'
|
||||||
import CountdownTimer from './CountdownTimer.vue'
|
import CountdownTimer from './CountdownTimer.vue'
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
import Chat from '../../api/chat' // 聊天
|
import Chat from '../../api/chat' // 聊天
|
||||||
import { CircleDoubleDown, CircleDoubleUp } from '@icon-park/vue-next' // icon-park 图标库
|
import { CircleDoubleDown, CircleDoubleUp, Share } from '@icon-park/vue-next' // icon-park 图标库
|
||||||
|
import { ShareCode } from '@/utils/ppt' // ppt相关
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
changeViewMode: (mode: 'base' | 'presenter') => void
|
changeViewMode: (mode: 'base' | 'presenter') => void
|
||||||
|
@ -102,6 +104,7 @@ const {
|
||||||
execPrev,
|
execPrev,
|
||||||
execNext,
|
execNext,
|
||||||
animationIndex,
|
animationIndex,
|
||||||
|
turning,
|
||||||
} = useExecPlay()
|
} = useExecPlay()
|
||||||
const { slideWidth, slideHeight } = useSlideSize()
|
const { slideWidth, slideHeight } = useSlideSize()
|
||||||
const { exitScreening } = useScreening()
|
const { exitScreening } = useScreening()
|
||||||
|
@ -198,7 +201,7 @@ const contextmenus = (): ContextmenuItem[] => {
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
// 工具栏按钮触发
|
||||||
const toolTrigger = (type:string) => {
|
const toolTrigger = (type:string) => {
|
||||||
const curT = Date.now()
|
const curT = Date.now()
|
||||||
if (curT - timer.value < 200) return
|
if (curT - timer.value < 200) return
|
||||||
|
|
|
@ -10,9 +10,10 @@
|
||||||
<IconOffScreenOne class="tool-icon" v-else />
|
<IconOffScreenOne class="tool-icon" v-else />
|
||||||
<span>{{ fullscreenState ? '退出全屏' : '全屏' }}</span>
|
<span>{{ fullscreenState ? '退出全屏' : '全屏' }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tool-btn" @click="ShareCode()"><Share class="tool-icon" /><span>分享</span></div>
|
||||||
<Divider class="divider" />
|
<Divider class="divider" />
|
||||||
<div class="tool-btn" @click="exitScreening()"><IconPower class="tool-icon" /><span>结束放映</span></div>
|
<div class="tool-btn" v-if="!classcourse" @click="exitScreening()"><IconPower class="tool-icon" /><span>结束放映</span></div>
|
||||||
<div class="tool-btn close" @click="exitCourse()" v-if="chat.groupid"><IconPower class="tool-icon" /><span>结束课堂</span></div>
|
<div class="tool-btn" v-else @click="exitCourse()" size="30" fill="#d0021b" strokeLinecap="butt"><IconPower class="tool-icon" /><span>结束课堂</span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
@ -78,6 +79,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { Share } from '@icon-park/vue-next' // icon-park 图标库
|
||||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useSlidesStore, useClasscourseStore } from '../../store'
|
import { useSlidesStore, useClasscourseStore } from '../../store'
|
||||||
|
@ -97,6 +99,7 @@ import CountdownTimer from './CountdownTimer.vue'
|
||||||
import Divider from '../../components/Divider.vue'
|
import Divider from '../../components/Divider.vue'
|
||||||
import emitter from '@/utils/mitt';
|
import emitter from '@/utils/mitt';
|
||||||
import Chat from '../../api/chat' // 聊天
|
import Chat from '../../api/chat' // 聊天
|
||||||
|
import { ShareCode } from '@/utils/ppt' // ppt相关
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
changeViewMode: (mode: 'base' | 'presenter') => void
|
changeViewMode: (mode: 'base' | 'presenter') => void
|
||||||
|
@ -125,7 +128,7 @@ const { slideWidth, slideHeight } = useSlideSize(slideListWrapRef)
|
||||||
const { exitScreening } = useScreening()
|
const { exitScreening } = useScreening()
|
||||||
const { slidesLoadLimit } = useLoadSlides()
|
const { slidesLoadLimit } = useLoadSlides()
|
||||||
const { fullscreenState, manualExitFullscreen } = useFullscreen()
|
const { fullscreenState, manualExitFullscreen } = useFullscreen()
|
||||||
const chat:any = Chat() // 聊天室
|
const chatApi:any = Chat() // 聊天室
|
||||||
|
|
||||||
const remarkFontSize = ref(16)
|
const remarkFontSize = ref(16)
|
||||||
const currentSlideRemark = computed(() => {
|
const currentSlideRemark = computed(() => {
|
||||||
|
@ -134,15 +137,20 @@ const currentSlideRemark = computed(() => {
|
||||||
|
|
||||||
// 切换到指定的幻灯片
|
// 切换到指定的幻灯片
|
||||||
const turnSlideTo = (index: number, e: PointerEvent) => {
|
const turnSlideTo = (index: number, e: PointerEvent) => {
|
||||||
// 课堂信息存在时,不允许翻页
|
const preInd = slideIndex.value
|
||||||
console.log('课堂信息', classcourse, index)
|
|
||||||
if (!!classcourse.value) return
|
|
||||||
turnSlideToIndex(index)
|
turnSlideToIndex(index)
|
||||||
|
if (!!classcourse.value) {// 上课中
|
||||||
|
if (preInd == index) return
|
||||||
|
const animationSteps = 0
|
||||||
|
const animation = index > preInd?'Nextsteps':'Previoustep'
|
||||||
|
const msg = { current:index, animation, animationSteps}
|
||||||
|
chatApi.slideFlapping(msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 下课
|
// 下课
|
||||||
const exitCourse = async () => {
|
const exitCourse = async () => {
|
||||||
// console.log('下课', chat)
|
// console.log('下课', chat)
|
||||||
await chat.exitCourse() // 下课消息
|
await chatApi.exitCourse() // 下课消息
|
||||||
exitScreening() // 结束放映
|
exitScreening() // 结束放映
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,53 +28,56 @@ export default (isLoader?: boolean = true) => {
|
||||||
|
|
||||||
// 执行元素动画 isAsync 为 true 时,异步执行,否则同步执行
|
// 执行元素动画 isAsync 为 true 时,异步执行,否则同步执行
|
||||||
const runAnimation = (isAsync: boolean) => {
|
const runAnimation = (isAsync: boolean) => {
|
||||||
// 正在执行动画时,禁止其他新的动画开始
|
return new Promise((resolve, reject) => {
|
||||||
if (inAnimation.value && !isAsync) return
|
// 正在执行动画时,禁止其他新的动画开始
|
||||||
|
if (inAnimation.value && !isAsync) return resolve()
|
||||||
|
|
||||||
const { animations, autoNext } = formatedAnimations.value[animationIndex.value]
|
const { animations, autoNext } = formatedAnimations.value[animationIndex.value]
|
||||||
animationIndex.value += 1
|
animationIndex.value += 1
|
||||||
|
|
||||||
// 标记开始执行动画
|
// 标记开始执行动画
|
||||||
inAnimation.value = true
|
inAnimation.value = true
|
||||||
|
|
||||||
let endAnimationCount = 0
|
let endAnimationCount = 0
|
||||||
|
|
||||||
// 依次执行该位置中的全部动画
|
// 依次执行该位置中的全部动画
|
||||||
for (const animation of animations) {
|
for (const animation of animations) {
|
||||||
const elRef: HTMLElement | null = document.querySelector(`#screen-element-${animation.elId} [class^=base-element-]`)
|
const elRef: HTMLElement | null = document.querySelector(`#screen-element-${animation.elId} [class^=base-element-]`)
|
||||||
if (!elRef) {
|
if (!elRef) {
|
||||||
endAnimationCount += 1
|
endAnimationCount += 1
|
||||||
continue
|
continue
|
||||||
}
|
|
||||||
|
|
||||||
const animationName = `${ANIMATION_CLASS_PREFIX}${animation.effect}`
|
|
||||||
|
|
||||||
// 执行动画前先清除原有的动画状态(如果有)
|
|
||||||
elRef.style.removeProperty('--animate-duration')
|
|
||||||
for (const classname of elRef.classList) {
|
|
||||||
if (classname.indexOf(ANIMATION_CLASS_PREFIX) !== -1) elRef.classList.remove(classname, `${ANIMATION_CLASS_PREFIX}animated`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 执行动画
|
|
||||||
elRef.style.setProperty('--animate-duration', `${animation.duration}ms`)
|
|
||||||
elRef.classList.add(animationName, `${ANIMATION_CLASS_PREFIX}animated`)
|
|
||||||
|
|
||||||
// 执行动画结束,将“退场”以外的动画状态清除
|
|
||||||
const handleAnimationEnd = () => {
|
|
||||||
if (animation.type !== 'out') {
|
|
||||||
elRef.style.removeProperty('--animate-duration')
|
|
||||||
elRef.classList.remove(animationName, `${ANIMATION_CLASS_PREFIX}animated`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断该位置上的全部动画都已经结束后,标记动画执行完成,并尝试继续向下执行(如果有需要)
|
const animationName = `${ANIMATION_CLASS_PREFIX}${animation.effect}`
|
||||||
endAnimationCount += 1
|
|
||||||
if (endAnimationCount === animations.length) {
|
// 执行动画前先清除原有的动画状态(如果有)
|
||||||
inAnimation.value = false
|
elRef.style.removeProperty('--animate-duration')
|
||||||
if (autoNext) runAnimation()
|
for (const classname of elRef.classList) {
|
||||||
|
if (classname.indexOf(ANIMATION_CLASS_PREFIX) !== -1) elRef.classList.remove(classname, `${ANIMATION_CLASS_PREFIX}animated`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 执行动画
|
||||||
|
elRef.style.setProperty('--animate-duration', `${animation.duration}ms`)
|
||||||
|
elRef.classList.add(animationName, `${ANIMATION_CLASS_PREFIX}animated`)
|
||||||
|
|
||||||
|
// 执行动画结束,将“退场”以外的动画状态清除
|
||||||
|
const handleAnimationEnd = async() => {
|
||||||
|
if (animation.type !== 'out') {
|
||||||
|
elRef.style.removeProperty('--animate-duration')
|
||||||
|
elRef.classList.remove(animationName, `${ANIMATION_CLASS_PREFIX}animated`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断该位置上的全部动画都已经结束后,标记动画执行完成,并尝试继续向下执行(如果有需要)
|
||||||
|
endAnimationCount += 1
|
||||||
|
if (endAnimationCount === animations.length) {
|
||||||
|
inAnimation.value = false
|
||||||
|
if (autoNext) await runAnimation()
|
||||||
|
resolve() // 执行完成
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elRef.addEventListener('animationend', handleAnimationEnd, { once: true })
|
||||||
}
|
}
|
||||||
elRef.addEventListener('animationend', handleAnimationEnd, { once: true })
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isLoader) { // 加载相关钩子
|
if (isLoader) { // 加载相关钩子
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -147,7 +150,7 @@ export default (isLoader?: boolean = true) => {
|
||||||
}
|
}
|
||||||
inAnimation.value = false
|
inAnimation.value = false
|
||||||
}
|
}
|
||||||
const execNext = (isAsync: boolean) => {
|
const execNext = async(isAsync: boolean) => {
|
||||||
if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) {
|
if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) {
|
||||||
runAnimation(isAsync)
|
runAnimation(isAsync)
|
||||||
}
|
}
|
||||||
|
@ -216,9 +219,17 @@ export default (isLoader?: boolean = true) => {
|
||||||
// 向上翻页/向下翻页
|
// 向上翻页/向下翻页
|
||||||
const turning = async (e, type) => {
|
const turning = async (e, type) => {
|
||||||
e.preventDefault() // 阻止默认事件
|
e.preventDefault() // 阻止默认事件
|
||||||
if (type === 'prev') execPrev()
|
window.scrollTo(0, 0) // 滚动到顶部
|
||||||
else if (type === 'next') execNext()
|
const isCourse = !!classcourseStore.classcourse
|
||||||
if (classcourseStore.classcourse) { // 上课中
|
if (type === 'prev') {
|
||||||
|
if (!isCourse) execPrev() // 上一步
|
||||||
|
else { // 上课状态: 上一步 动作变成 上一页
|
||||||
|
const current = slideIndex.value
|
||||||
|
if (current <= 0) return throttleMassage('已经是第一页了')
|
||||||
|
turnSlideToIndex(current - 1) // 翻页: 上一页
|
||||||
|
}
|
||||||
|
} else if (type === 'next') execNext()
|
||||||
|
if (isCourse) { // 上课中
|
||||||
const current = slideIndex.value
|
const current = slideIndex.value
|
||||||
const animationSteps = animationIndex.value
|
const animationSteps = animationIndex.value
|
||||||
const animation = type == 'next'?'Nextsteps':'Previoustep'
|
const animation = type == 'next'?'Nextsteps':'Previoustep'
|
||||||
|
@ -285,5 +296,6 @@ export default (isLoader?: boolean = true) => {
|
||||||
execPrev,
|
execPrev,
|
||||||
execNext,
|
execNext,
|
||||||
animationIndex,
|
animationIndex,
|
||||||
|
turning,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,4 +102,16 @@ export function setPaging(data) {
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取分享码(邀请码)
|
||||||
|
* @param {*} id 课堂id
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getShareCode(id) {
|
||||||
|
return request({
|
||||||
|
url: '/education/classcourse/refresh/code',
|
||||||
|
method: 'post',
|
||||||
|
data: { id }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="whiteboart-container" :style="{ height: height + 'px' }">
|
<div class="whiteboart-container" :style="{ height: height + 'px' }">
|
||||||
<div class="canvasBox" ref="box" @mouseleave="handleMouseLeave" ></div>
|
<div class="canvasBox" ref="box" @mouseenter.capture="handleMouseEnter" @mouseleave.capture="handleMouseLeave"></div>
|
||||||
|
|
||||||
<div class="footerLeft" @click.stop
|
<div class="footerLeft" @click.stop
|
||||||
:style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']">
|
:style="type == 'design' ? ['top: 10px', 'justify-content: space-between'] : ['bottom: 10px', 'justify-content: center']">
|
||||||
|
@ -278,7 +278,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, getCurrentInstance, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue'
|
import { onMounted, onBeforeUnmount, ref, getCurrentInstance, watch, toRaw, nextTick, computed, reactive, defineProps, defineEmits } from 'vue'
|
||||||
import TinyWhiteboard from 'whiteboard_lyc'
|
import TinyWhiteboard from 'whiteboard_lyc'
|
||||||
import ColorPicker from './components/ColorPicker.vue'
|
import ColorPicker from './components/ColorPicker.vue'
|
||||||
import {
|
import {
|
||||||
|
@ -791,6 +791,25 @@ const init = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const isMyCanvas = ref(false); // 鼠标 是否进入画布判断
|
||||||
|
const handleKeyDown=(event)=> {
|
||||||
|
// console.log('键盘按键被按下:', event.key);
|
||||||
|
// console.log(isMyCanvas.value,'??????????')
|
||||||
|
if(isMyCanvas.value == false){
|
||||||
|
event.stopPropagation();
|
||||||
|
// console.log('键盘事件被捕获,已阻止冒泡:', event.key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 鼠标进入事件
|
||||||
|
*/
|
||||||
|
const handleMouseEnter = () => {
|
||||||
|
console.log('进入白板')
|
||||||
|
isMyCanvas.value = true;
|
||||||
|
document.addEventListener('keydown', handleKeyDown, true);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 课堂展示-鼠标离开白板监听事件:该事件是避免,选中状态,在其他地方点击、后退、删除等事件,会删除白板内选中的元素
|
* 课堂展示-鼠标离开白板监听事件:该事件是避免,选中状态,在其他地方点击、后退、删除等事件,会删除白板内选中的元素
|
||||||
*/
|
*/
|
||||||
|
@ -798,7 +817,10 @@ const handleMouseLeave = () => {
|
||||||
console.log('离开白板')
|
console.log('离开白板')
|
||||||
// 清除激活项--点击事件的激活项
|
// 清除激活项--点击事件的激活项
|
||||||
app.cancelActiveElement()
|
app.cancelActiveElement()
|
||||||
// TODO 缺失点击拖动范围的取消激活项……
|
// 阻止 点击拖动范围的取消激活项……
|
||||||
|
isMyCanvas.value = false;
|
||||||
|
// 确保事件处理函数在组件挂载后绑定
|
||||||
|
document.addEventListener('keydown', handleKeyDown, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 暴露方法
|
// 暴露方法
|
||||||
|
|
|
@ -6,6 +6,10 @@ import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库
|
||||||
import { PPTXFileToJson } from "@/AixPPTist/src/hooks/useImport"
|
import { PPTXFileToJson } from "@/AixPPTist/src/hooks/useImport"
|
||||||
import ThumbnailSlide from '@/AixPPTist/src/views/components/ThumbnailSlide/index.vue'
|
import ThumbnailSlide from '@/AixPPTist/src/views/components/ThumbnailSlide/index.vue'
|
||||||
import { useSlidesStore } from '@/AixPPTist/src/store'
|
import { useSlidesStore } from '@/AixPPTist/src/store'
|
||||||
|
import * as ElementPlus from 'element-plus'
|
||||||
|
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||||
|
import * as Http_Classcourse from '@/api/teaching/classcourse' // api接口
|
||||||
|
|
||||||
// 延时
|
// 延时
|
||||||
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||||
|
|
||||||
|
@ -84,4 +88,44 @@ export const slidesToImg = (slides = [], options) => {
|
||||||
export const pptToImg = async(file, options) => {
|
export const pptToImg = async(file, options) => {
|
||||||
const { slides } = await PPTXFileToJson(file)
|
const { slides } = await PPTXFileToJson(file)
|
||||||
return slidesToImg(slides, options)
|
return slidesToImg(slides, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课堂-分享码
|
||||||
|
*/
|
||||||
|
export const ShareCode = async(code, cb) => {
|
||||||
|
let shareCode
|
||||||
|
if (typeof code =='string') shareCode = code
|
||||||
|
else { // 自动获取邀请码
|
||||||
|
const classcourse = sessionStore.get('curr.classcourse') // 课堂信息
|
||||||
|
if (!classcourse) return ElementPlus.ElMessage.warning('没有课堂信息')
|
||||||
|
const isRefresh = typeof code == 'boolean' && code // 是否刷新邀请码
|
||||||
|
shareCode = classcourse.shareCode
|
||||||
|
if (!shareCode || isRefresh) { // 获取邀请码
|
||||||
|
const res = await Http_Classcourse.getShareCode(classcourse.id)
|
||||||
|
shareCode = res.msg
|
||||||
|
// 更新邀请码
|
||||||
|
sessionStore.set('curr.classcourse.shareCode', shareCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const msg = h('div', [
|
||||||
|
h('h1', [`我的邀请码:`, h('b',{style:{color:'#F56C6C',fontSize:'1.5em'}}, shareCode)]),
|
||||||
|
h('div', {style:{color:'#E6A23C',fontSize:'13px'}}, `该邀请码1小时内有效,请在学生端填写邀请码后即可进入课堂。`)
|
||||||
|
])
|
||||||
|
return ElementPlus.ElMessageBox.alert(msg, '分享课程', {
|
||||||
|
confirmButtonText: '更新',
|
||||||
|
cancelButtonText: '关闭',
|
||||||
|
showCancelButton: true,
|
||||||
|
|
||||||
|
beforeClose: (action, instance, done) => {
|
||||||
|
if (action =='confirm') { // 更新
|
||||||
|
if (!!cb) { // 回调
|
||||||
|
cb({ h, instance, action, done }, done) && done()
|
||||||
|
} else { // 默认更新
|
||||||
|
ShareCode(true)
|
||||||
|
done()
|
||||||
|
}
|
||||||
|
} else done()
|
||||||
|
}
|
||||||
|
}).catch(() => {})
|
||||||
}
|
}
|
|
@ -1,3 +1,5 @@
|
||||||
|
import {ElMessage} from "element-plus";
|
||||||
|
|
||||||
const { ipcRenderer } = window.electron || {}
|
const { ipcRenderer } = window.electron || {}
|
||||||
|
|
||||||
export const asyncLocalFile = (item) => {
|
export const asyncLocalFile = (item) => {
|
||||||
|
@ -15,6 +17,9 @@ export const asyncLocalFile = (item) => {
|
||||||
fileName: item.fileNewName
|
fileName: item.fileNewName
|
||||||
})
|
})
|
||||||
ipcRenderer.once('download-file-default' + item.fileNewName, (e, isSuccess) => {
|
ipcRenderer.once('download-file-default' + item.fileNewName, (e, isSuccess) => {
|
||||||
|
if (isSuccess == false) {
|
||||||
|
ElMessage.error(`${item.fileShowName}下载失败!`)
|
||||||
|
}
|
||||||
item.async = isSuccess
|
item.async = isSuccess
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
|
@ -112,3 +117,24 @@ export const creatAIPPT = (name, url, uploadData) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const removeLocalFiles = async (list) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
ipcRenderer.send('remove-local-file-list', JSON.parse(JSON.stringify(list)))
|
||||||
|
ipcRenderer.removeListener('remove-local-file-list-error', removeLocalFileListError)
|
||||||
|
ipcRenderer.removeListener('remove-local-file-list-not', removeLocalFileListNot)
|
||||||
|
ipcRenderer.on('remove-local-file-list-error', removeLocalFileListError)
|
||||||
|
ipcRenderer.on('remove-local-file-list-not', removeLocalFileListNot)
|
||||||
|
ipcRenderer.once('remove-local-file-list-reply', (e, res) => {
|
||||||
|
resolve(res)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeLocalFileListError(e, item) {
|
||||||
|
ElMessage.error(`${item.fileShowName}删除失败`)
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeLocalFileListNot(e, item) {
|
||||||
|
ElMessage.error(`${item.fileShowName}删除失败,并没有该文件!`)
|
||||||
|
}
|
||||||
|
|
|
@ -60,8 +60,8 @@
|
||||||
<template #item_mobile>
|
<template #item_mobile>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="myClassActive.filetype=='apt'">开始新的课堂,需要点击先创建课堂,才能显示手机二维码</div>
|
<div v-if="myClassActive.filetype=='apt'">开始新的课堂,需要点击先创建课堂,才能显示手机二维码</div>
|
||||||
<div v-else>开始新的课堂,需要点击先创建课堂</div>
|
<div v-else>开始新的课堂</div>
|
||||||
<el-button type="warning" :loading="dt.loading" @click="createClasscourse()">创建课堂</el-button>
|
<!-- <el-button type="warning" :loading="dt.loading" @click="createClasscourse()">创建课堂</el-button> -->
|
||||||
<el-button type="success" @click="createClasscourse(true)">公屏上课</el-button>
|
<el-button type="success" @click="createClasscourse(true)">公屏上课</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -139,6 +139,8 @@ onMounted(() => {
|
||||||
* @param classObj 课程对象-用于继续上课
|
* @param classObj 课程对象-用于继续上课
|
||||||
*/
|
*/
|
||||||
const open = async (id, classObj) => {
|
const open = async (id, classObj) => {
|
||||||
|
dt.loading = false
|
||||||
|
dt.loadingDel = false
|
||||||
visible.value = true
|
visible.value = true
|
||||||
if (id) {
|
if (id) {
|
||||||
// 重置数据
|
// 重置数据
|
||||||
|
@ -167,6 +169,8 @@ const handleClose = async () => {
|
||||||
// await chat?.logout()
|
// await chat?.logout()
|
||||||
// chat = null
|
// chat = null
|
||||||
dt.ctCourse = null
|
dt.ctCourse = null
|
||||||
|
dt.loading = false
|
||||||
|
dt.loadingDel = false
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
// 初始化-数据
|
// 初始化-数据
|
||||||
|
@ -264,7 +268,7 @@ const createClasscourse = async (isPublic = false) => {
|
||||||
}
|
}
|
||||||
// teacherForm.form.classcourseid = 100
|
// teacherForm.form.classcourseid = 100
|
||||||
teacherForm.form.classcourseid = await Http_Classcourse.addClasscourseReturnId(params)
|
teacherForm.form.classcourseid = await Http_Classcourse.addClasscourseReturnId(params)
|
||||||
dt.loading = false
|
.finally(() => {dt.loading = false})
|
||||||
// getClasscourseList('update') // 更新列表
|
// getClasscourseList('update') // 更新列表
|
||||||
let msgEl = ElMessage.success('创建课程-成功')
|
let msgEl = ElMessage.success('创建课程-成功')
|
||||||
// 新版-pptList 打开公屏
|
// 新版-pptList 打开公屏
|
||||||
|
@ -360,8 +364,12 @@ const openPublicScreen = (classcourse, isPublic) => {
|
||||||
console.log('打开公屏', classcourse)
|
console.log('打开公屏', classcourse)
|
||||||
if (!dt.ctCourse) { // 新开课需要发送消息-继续上课不需要直接打开
|
if (!dt.ctCourse) { // 新开课需要发送消息-继续上课不需要直接打开
|
||||||
// 发送app端待开课消息
|
// 发送app端待开课消息
|
||||||
const data = { id: classcourse.id }
|
const TeacherId = userStore.id
|
||||||
ChatWs.sendMsg(MsgEnum.HEADS.MSG_0000, data, {}, ChatWs.TYPES.single, userStore.id)
|
const data = { id: classcourse.id, TeacherId }
|
||||||
|
const head = isPublic ? MsgEnum.HEADS.MSG_open : MsgEnum.HEADS.MSG_0000 // 消息头
|
||||||
|
const type = isPublic ? ChatWs.TYPES.group : ChatWs.TYPES.single // 消息类型
|
||||||
|
const toId = isPublic ? classcourse.timgroupid : TeacherId // 消息接收人
|
||||||
|
ChatWs.sendMsg(head, data, {}, type, toId)
|
||||||
}
|
}
|
||||||
// 缓存当前资源信息
|
// 缓存当前资源信息
|
||||||
const resource = toRaw(myClassActive.value)
|
const resource = toRaw(myClassActive.value)
|
||||||
|
|
|
@ -83,6 +83,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-button size="small" @click="isDialogOpen = true">上传资料</el-button>
|
<el-button size="small" @click="isDialogOpen = true">上传资料</el-button>
|
||||||
|
<el-button size="small" @click="reloadFiles">资源重载</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-checkbox-group
|
<el-checkbox-group
|
||||||
|
@ -187,8 +188,8 @@ import FileListItem from '@/views/prepare/container/file-list-item.vue'
|
||||||
import KjListItem from '@/views/prepare/container/kj-list-item.vue'
|
import KjListItem from '@/views/prepare/container/kj-list-item.vue'
|
||||||
import { getSmarttalkPage, moveSmarttalk, creatAPT } from '@/api/file'
|
import { getSmarttalkPage, moveSmarttalk, creatAPT } from '@/api/file'
|
||||||
import { toTimeText } from '@/utils/date'
|
import { toTimeText } from '@/utils/date'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
|
import {parseCataByNode, creatPPT, asyncLocalFile, removeLocalFiles} from '@/utils/talkFile'
|
||||||
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
import FileOperBatch from '@/views/prepare/container/file-oper-batch.vue'
|
||||||
import SetHomework from '@/components/set-homework/index.vue'
|
import SetHomework from '@/components/set-homework/index.vue'
|
||||||
import outLink from '@/utils/linkConfig'
|
import outLink from '@/utils/linkConfig'
|
||||||
|
@ -301,7 +302,7 @@ export default {
|
||||||
},
|
},
|
||||||
currentSCFileList() {
|
currentSCFileList() {
|
||||||
// return this.currentFileList.filter((item) => item.fileFlag !== 'apt' && item.fileFlag !== '课件')
|
// return this.currentFileList.filter((item) => item.fileFlag !== 'apt' && item.fileFlag !== '课件')
|
||||||
return this.currentFileList.filter((item) => !['apt','aippt','课件'].includes(item.fileFlag))
|
return this.currentFileList.filter((item) => !['apt','aippt'].includes(item.fileFlag))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -449,6 +450,7 @@ export default {
|
||||||
}
|
}
|
||||||
case 'click': { // 点击-打开课件-aippt
|
case 'click': { // 点击-打开课件-aippt
|
||||||
if (row.fileFlag === 'aippt' && !!row.fileId) {
|
if (row.fileFlag === 'aippt' && !!row.fileId) {
|
||||||
|
sessionStore.delete('curr.classcourse') // 清除上课相关信息
|
||||||
const res = await getEntpcoursefile(row.fileId)
|
const res = await getEntpcoursefile(row.fileId)
|
||||||
if (res && res.code === 200) {
|
if (res && res.code === 200) {
|
||||||
this.openPublicScreen('edit', res.data, row) // 打开公屏-窗口
|
this.openPublicScreen('edit', res.data, row) // 打开公屏-窗口
|
||||||
|
@ -932,6 +934,24 @@ export default {
|
||||||
}
|
}
|
||||||
console.log('File copied to:', filePath)
|
console.log('File copied to:', filePath)
|
||||||
},
|
},
|
||||||
|
reloadFiles() {
|
||||||
|
// TODO清除当前页所有文件缓存
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'是否确认重载当前资源,重载后将清除本页资源从新下载线上资源?',
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '是',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
removeLocalFiles(this.currentSCFileList)
|
||||||
|
this.currentSCFileList.filter((item) => {
|
||||||
|
item.async = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
asyncAllFile() {
|
asyncAllFile() {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
return getSmarttalkPage({
|
return getSmarttalkPage({
|
||||||
|
|
Loading…
Reference in New Issue