Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into baigl
This commit is contained in:
commit
328e623db7
|
@ -6,6 +6,7 @@
|
||||||
import { toRaw } from 'vue'
|
import { toRaw } from 'vue'
|
||||||
import msgUtils from '@/plugins/modal' // 消息工具
|
import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||||
|
import * as API_smarttalk from '@/api/file' // 相关api
|
||||||
import * as useStore from '../store' // pptist-状态管理
|
import * as useStore from '../store' // pptist-状态管理
|
||||||
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
import { sessionStore } from '@/utils/store' // electron-store 状态管理
|
||||||
import useUserStore from '@/store/modules/user' // 外部-用户信息
|
import useUserStore from '@/store/modules/user' // 外部-用户信息
|
||||||
|
@ -166,6 +167,14 @@ export class PPTApi {
|
||||||
} else msgUtils.msgError(res.msg || '删除失败');resolve(false)
|
} else msgUtils.msgError(res.msg || '删除失败');resolve(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新-备课资源 标题
|
||||||
|
static updateSmarttalk(data: object): Promise<Boolean> {
|
||||||
|
return API_smarttalk.updateSmarttalk(data).then(res => {
|
||||||
|
if (res.code === 200) return true
|
||||||
|
else msgUtils.msgError(res.msg || '更新失败');return false
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PPTApi
|
export default PPTApi
|
|
@ -7,7 +7,8 @@ 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 状态管理
|
||||||
const slidesStore = store.useSlidesStore()
|
const slidesStore = store.useSlidesStore()
|
||||||
const resource = sessionStore.get('curr.resource')
|
const resource = sessionStore.get('curr.resource') // apt 资源
|
||||||
|
const smarttalk = sessionStore.get('curr.smarttalk') // 备课资源
|
||||||
/**
|
/**
|
||||||
* @description 监听器
|
* @description 监听器
|
||||||
*/
|
*/
|
||||||
|
@ -28,4 +29,11 @@ const updatePPT = async (data) => {
|
||||||
data.id = resource.id
|
data.id = resource.id
|
||||||
await PPTApi.updateSlide(data) // 更新ppt内容
|
await PPTApi.updateSlide(data) // 更新ppt内容
|
||||||
sessionStore.set('curr.resource.title', data.title)
|
sessionStore.set('curr.resource.title', data.title)
|
||||||
|
// 更新smarttalk内容
|
||||||
|
if (!!smarttalk && !!data.title) {
|
||||||
|
const {id, fileFlag} = smarttalk
|
||||||
|
const params = { id, fileShowName: `${data.title}.${fileFlag}` }
|
||||||
|
await PPTApi.updateSmarttalk(params) // 更新ppt内容
|
||||||
|
sessionStore.set('curr.smarttalk.fileShowName', params.fileShowName)
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -34,7 +34,8 @@ const getFileTypeIcon = () => {
|
||||||
gif: 'icon-gif',
|
gif: 'icon-gif',
|
||||||
txt: 'icon-txt',
|
txt: 'icon-txt',
|
||||||
rar: 'icon-rar',
|
rar: 'icon-rar',
|
||||||
apt: 'icon-A'
|
apt: 'icon-A',
|
||||||
|
aptist: 'icon-A',
|
||||||
}
|
}
|
||||||
if (iconObj[name]) {
|
if (iconObj[name]) {
|
||||||
return '#' + iconObj[name]
|
return '#' + iconObj[name]
|
||||||
|
|
|
@ -52,7 +52,12 @@ import { useRouter } from 'vue-router'
|
||||||
import { Plus, Refresh, Upload, Files, UploadFilled } from '@element-plus/icons-vue'
|
import { Plus, Refresh, Upload, Files, UploadFilled } from '@element-plus/icons-vue'
|
||||||
import useUserStore from '@/store/modules/user' // 用户信息
|
import useUserStore from '@/store/modules/user' // 用户信息
|
||||||
import msgUtils from '@/plugins/modal' // 消息工具
|
import msgUtils from '@/plugins/modal' // 消息工具
|
||||||
|
<<<<<<< HEAD
|
||||||
import { createWindow } from '@/utils/tool' // 相关工具
|
import { createWindow } from '@/utils/tool' // 相关工具
|
||||||
|
=======
|
||||||
|
import { createWindow, sessionStore } from '@/utils/tool' // 相关工具
|
||||||
|
import * as API_smarttalk from '@/api/file' // 文件相关api
|
||||||
|
>>>>>>> c22b360e0fc344cad791625894423981d45c5cb2
|
||||||
import * as API_entpcourse from '@/api/education/entpcourse' // 相关api
|
import * as API_entpcourse from '@/api/education/entpcourse' // 相关api
|
||||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||||
import { dataSetJson } from '@/utils/comm' // 数据集id文生图
|
import { dataSetJson } from '@/utils/comm' // 数据集id文生图
|
||||||
|
@ -196,6 +201,19 @@ const getResourceList = async () => {
|
||||||
// 统一HTTP处理
|
// 统一HTTP处理
|
||||||
const HTTP_SERVER_API = (type, params = {}) => {
|
const HTTP_SERVER_API = (type, params = {}) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case 'addSmarttalk': { // 获取课程
|
||||||
|
const def = {
|
||||||
|
fileId: '', // 文件id - Entpcoursefile 对应id
|
||||||
|
fileFlag: 'aptist',
|
||||||
|
fileShowName: courseObj.coursetitle + '.aptist',
|
||||||
|
textbookId: courseObj.textbookId,
|
||||||
|
levelFirstId: courseObj.levelFirstId,
|
||||||
|
levelSecondId: courseObj.levelSecondId,
|
||||||
|
fileSource: '个人',
|
||||||
|
fileRoot: '备课'
|
||||||
|
}
|
||||||
|
return API_smarttalk.creatAPT({...def, ...params})
|
||||||
|
}
|
||||||
case 'addEntpcourse': { // 添加课程
|
case 'addEntpcourse': { // 添加课程
|
||||||
const node = courseObj.node || {}
|
const node = courseObj.node || {}
|
||||||
if (!node) return msgUtils.msgWarning('请选择章节?')
|
if (!node) return msgUtils.msgWarning('请选择章节?')
|
||||||
|
@ -278,6 +296,8 @@ const handleAll = async(type, row) =>{
|
||||||
}
|
}
|
||||||
// 生成ppt课件-子级(slide)
|
// 生成ppt课件-子级(slide)
|
||||||
await HTTP_SERVER_API('addEntpcoursefile', params)
|
await HTTP_SERVER_API('addEntpcoursefile', params)
|
||||||
|
// 生成备课资源-Smarttalk
|
||||||
|
await HTTP_SERVER_API('addSmarttalk',{fileId: id})
|
||||||
// 刷新资源列表
|
// 刷新资源列表
|
||||||
await getResourceList()
|
await getResourceList()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -59,14 +59,16 @@
|
||||||
<!-- 手机登录 -->
|
<!-- 手机登录 -->
|
||||||
<template #item_mobile>
|
<template #item_mobile>
|
||||||
<div>
|
<div>
|
||||||
<div>开始新的课堂,需要点击先创建课堂,才能显示手机二维码</div>
|
<div v-if="myClassActive.filetype=='apt'">开始新的课堂,需要点击先创建课堂,才能显示手机二维码</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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- 故障备用 -->
|
<!-- 故障备用 -->
|
||||||
<template #item_backup>
|
<template #item_backup>
|
||||||
<div>
|
<div>
|
||||||
<div>如果手机扫码后进入课堂,但本页面没自动跳转,请点击下面按钮</div>
|
<div v-if="myClassActive.filetype=='apt'">如果手机扫码后进入课堂,但本页面没自动跳转,请点击下面按钮</div>
|
||||||
|
<div v-else>本页面没自动跳转,请点击下面按钮</div>
|
||||||
<el-button type="primary" plain @click="classTeachingStart">开始上课</el-button>
|
<el-button type="primary" plain @click="classTeachingStart">开始上课</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -81,7 +83,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
// 功能说明:课程开始
|
// 功能说明:课程开始
|
||||||
import { onMounted, reactive, ref, watchEffect, watch, nextTick } from 'vue' // vue
|
import { onMounted, reactive, ref, watchEffect, watch, nextTick, toRaw } from 'vue' // vue
|
||||||
import { Refresh } from '@element-plus/icons-vue'
|
import { Refresh } from '@element-plus/icons-vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus' // ui框架: 消息提示
|
import { ElMessage, ElMessageBox } from 'element-plus' // ui框架: 消息提示
|
||||||
import vueQr from 'vue-qr/src/packages/vue-qr.vue' // 插件: 二维码
|
import vueQr from 'vue-qr/src/packages/vue-qr.vue' // 插件: 二维码
|
||||||
|
@ -149,9 +151,9 @@ const open = async (id, classObj) => {
|
||||||
teacherForm.form.classcourseid = classObj.id
|
teacherForm.form.classcourseid = classObj.id
|
||||||
}
|
}
|
||||||
// 初始化im-chat
|
// 初始化im-chat
|
||||||
nextTick(async() => {
|
// nextTick(async() => {
|
||||||
chat = await imChatRef.value?.initImChat()
|
// chat = await imChatRef.value?.initImChat()
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
|
@ -259,7 +261,15 @@ const createClasscourse = async () => {
|
||||||
dt.loading = false
|
dt.loading = false
|
||||||
// getClasscourseList('update') // 更新列表
|
// getClasscourseList('update') // 更新列表
|
||||||
ElMessage.success('创建课程-成功')
|
ElMessage.success('创建课程-成功')
|
||||||
|
// 新版-pptList 打开公屏
|
||||||
|
if (myClassActive.value.filetype == 'aptist') {
|
||||||
|
const msgEl = ElMessage.warning({message:'正在打开公屏,请稍后...',duration: 0})
|
||||||
|
setTimeout(() => {
|
||||||
|
msgEl.close()
|
||||||
|
const classcourse = {...params, id: teacherForm.form.classcourseid}
|
||||||
|
openPublicScreen(classcourse)
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 删除课程
|
// 删除课程
|
||||||
const removeClasscourse = async () => {
|
const removeClasscourse = async () => {
|
||||||
|
@ -323,6 +333,21 @@ const getQrUrl = async() => {
|
||||||
}
|
}
|
||||||
teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
teacherForm.form.qrUrl = baseUrl + qrCodeUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开公屏
|
||||||
|
const openPublicScreen = (classcourse) => {
|
||||||
|
const resource = toRaw(myClassActive.value)
|
||||||
|
sessionStore.set('curr.resource', resource) // 缓存当前资源信息
|
||||||
|
sessionStore.set('curr.classcourse', classcourse) // 缓存当前当前上课
|
||||||
|
createWindow('open-win', {
|
||||||
|
url: '/pptist', // 窗口关闭时,清除缓存
|
||||||
|
close: () => {
|
||||||
|
sessionStore.set('curr.resource', null) // 清除缓存
|
||||||
|
sessionStore.set('curr.classcourse', null) // 清除缓存
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 定时器监听
|
// 定时器监听
|
||||||
|
|
||||||
// ================== 监听 =======================
|
// ================== 监听 =======================
|
||||||
|
|
|
@ -332,6 +332,10 @@ export default {
|
||||||
const { id, rootid } = sessionStore.get('subject.curNode')
|
const { id, rootid } = sessionStore.get('subject.curNode')
|
||||||
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + id + "&bookId=" + rootid;
|
const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + id + "&bookId=" + rootid;
|
||||||
let configObj = outLink().getBaseData()
|
let configObj = outLink().getBaseData()
|
||||||
|
configObj.fullPath = 'https://localhost:7860/'
|
||||||
|
configObj.data.url = 'https://localhost:7860/'
|
||||||
|
configObj.data.domain = 'localhost'
|
||||||
|
console.log(configObj)
|
||||||
let fullPath = configObj.fullPath + path
|
let fullPath = configObj.fullPath + path
|
||||||
fullPath = fullPath.replaceAll('//', '/')
|
fullPath = fullPath.replaceAll('//', '/')
|
||||||
// 通知主进程
|
// 通知主进程
|
||||||
|
@ -341,6 +345,8 @@ export default {
|
||||||
cookieData: { ...configObj.data }
|
cookieData: { ...configObj.data }
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
} else if(items.fileFlag === 'aptist') { // aptist 被点击 打开PPT-List 课件
|
||||||
|
return this.$emit('change', 'click', items)
|
||||||
}
|
}
|
||||||
if (!items||!items.fileSuffix) return;
|
if (!items||!items.fileSuffix) return;
|
||||||
getPrepareById(items.id).then((item) => {
|
getPrepareById(items.id).then((item) => {
|
||||||
|
|
|
@ -175,8 +175,9 @@ import { updateClasscourse } from '@/api/teaching/classcourse'
|
||||||
import { getClassInfo, getSelfReserv, endClass } from '@/api/classManage'
|
import { getClassInfo, getSelfReserv, endClass } from '@/api/classManage'
|
||||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||||
import { editListItem } from '@/hooks/useClassTask'
|
import { editListItem } from '@/hooks/useClassTask'
|
||||||
import { addEntpcoursefileReturnId } from '@/api/education/entpcoursefile'
|
import { addEntpcoursefileReturnId, getEntpcoursefile } from '@/api/education/entpcoursefile'
|
||||||
import ClassReserv from '@/views/classManage/classReserv.vue'
|
import ClassReserv from '@/views/classManage/classReserv.vue'
|
||||||
|
import TreeLog from '@/views/prepare/components/treeLog.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 登录初始化
|
||||||
|
@ -239,7 +240,9 @@ export default {
|
||||||
activeClass: null,
|
activeClass: null,
|
||||||
pptDialog: false,
|
pptDialog: false,
|
||||||
// 打开章节的弹窗
|
// 打开章节的弹窗
|
||||||
treelogRef:null
|
treelogRef:null,
|
||||||
|
// 获取当前章节对应的课程信息 Entpcourse
|
||||||
|
entp: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -249,10 +252,12 @@ export default {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
currentKJFileList() {
|
currentKJFileList() {
|
||||||
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','aptist','课件'].includes(item.fileFlag))
|
||||||
},
|
},
|
||||||
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','aptist','课件'].includes(item.fileFlag))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -305,8 +310,8 @@ export default {
|
||||||
// 开始上课
|
// 开始上课
|
||||||
startClass(item, classObj) {
|
startClass(item, classObj) {
|
||||||
// 关闭状态,打开上课相关功能(已打开,忽略)
|
// 关闭状态,打开上课相关功能(已打开,忽略)
|
||||||
const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null
|
// const id = sessionStore.has('activeClass.id') ? sessionStore.get('activeClass.id') : null
|
||||||
if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作')
|
// if (id && id == item.id) return ElMessage.warning('当前正在上课,请勿重复操作')
|
||||||
// 当前上课-store
|
// 当前上课-store
|
||||||
sessionStore.set('activeClass', item)
|
sessionStore.set('activeClass', item)
|
||||||
this.activeClass = item
|
this.activeClass = item
|
||||||
|
@ -316,6 +321,9 @@ export default {
|
||||||
if(item.fileFlag === 'apt') {
|
if(item.fileFlag === 'apt') {
|
||||||
this.$refs.calssRef.open(item.fileId, classObj)
|
this.$refs.calssRef.open(item.fileId, classObj)
|
||||||
}
|
}
|
||||||
|
if(item.fileFlag === 'aptist') {
|
||||||
|
this.$refs.calssRef.open(item.fileId, classObj)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 继续上课-apt
|
// 继续上课-apt
|
||||||
async changeClass(type, row, other) {
|
async changeClass(type, row, other) {
|
||||||
|
@ -370,6 +378,28 @@ export default {
|
||||||
}, 1000)
|
}, 1000)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
case 'click': { // 点击-打开课件-aptist
|
||||||
|
if (row.fileFlag === 'aptist' && !!row.fileId) {
|
||||||
|
const res = await getEntpcoursefile(row.fileId)
|
||||||
|
if (res && res.code === 200) {
|
||||||
|
sessionStore.set('curr.resource', res.data) // 缓存当前资源信息
|
||||||
|
sessionStore.set('curr.smarttalk', row) // 缓存当前文件smarttalk
|
||||||
|
createWindow('open-win', {
|
||||||
|
url: '/pptist', // 窗口关闭时,清除缓存
|
||||||
|
close: () => {
|
||||||
|
sessionStore.set('curr.resource', null) // 清除缓存
|
||||||
|
sessionStore.set('curr.smarttalk', null) // 清除缓存
|
||||||
|
this.asyncAllFile() // 刷新资源列表
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(res.msg||'文件获取异常!')
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ElMessage.warning('该功能暂未开放!')
|
||||||
|
break
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -623,6 +653,7 @@ export default {
|
||||||
for (let i = 0; i < this.currentFileList.length; i++) {
|
for (let i = 0; i < this.currentFileList.length; i++) {
|
||||||
let item = this.currentFileList[i]
|
let item = this.currentFileList[i]
|
||||||
if (item.fileFlag === 'apt') continue;
|
if (item.fileFlag === 'apt') continue;
|
||||||
|
if (item.fileFlag === 'aptist') continue;
|
||||||
await asyncLocalFile(item)
|
await asyncLocalFile(item)
|
||||||
}
|
}
|
||||||
this.asyncAllFileVisiable = false
|
this.asyncAllFileVisiable = false
|
||||||
|
@ -651,6 +682,11 @@ export default {
|
||||||
toolStore.curSubjectNode.querySearch = this.uploadData
|
toolStore.curSubjectNode.querySearch = this.uploadData
|
||||||
this.initHomeWork()
|
this.initHomeWork()
|
||||||
await this.asyncAllFile()
|
await this.asyncAllFile()
|
||||||
|
// 获取当前章节对应的课程信息
|
||||||
|
const params = { evalid: this.currentNode.id, edituserid: this.userStore.userId, pageSize: 1 }
|
||||||
|
const res = await listEntpcourse(params)
|
||||||
|
this.entp = res?.rows?.[0] || null
|
||||||
|
sessionStore.set('curr.entp', this.entp) // 缓存当前课程信息
|
||||||
},
|
},
|
||||||
// 获取作业
|
// 获取作业
|
||||||
async initHomeWork() {
|
async initHomeWork() {
|
||||||
|
|
Loading…
Reference in New Issue