Compare commits
19 Commits
78cc5edd39
...
7861727e92
Author | SHA1 | Date |
---|---|---|
小杨 | 7861727e92 | |
zhangxuelin | c5e71e6e7b | |
zhangxuelin | c7ebc6de65 | |
zhangxuelin | b906a1e688 | |
baigl | f75ab621d2 | |
白了个白 | a711eb2745 | |
白了个白 | 363b284b7c | |
baigl | dc4c0fd334 | |
白了个白 | fb3ffd5dda | |
白了个白 | 5771533039 | |
zhangxuelin | 75ea11e171 | |
zhangxuelin | 851a39897b | |
zhangxuelin | 69bfc68b28 | |
zhangxuelin | 590b318757 | |
CYS | 4421ee7fea | |
cys | 19ef95447c | |
baigl | 25b6da7f26 | |
白了个白 | 892b4ee3b0 | |
yangws | 3d8f7c2a3a |
|
@ -13097,15 +13097,15 @@ const PDFViewerApplication = {
|
||||||
}
|
}
|
||||||
if (isValidSpreadMode(spread)) {
|
if (isValidSpreadMode(spread)) {
|
||||||
//默认双页
|
//默认双页
|
||||||
// this.pdfViewer.spreadMode = spread;
|
this.pdfViewer.spreadMode = spread;
|
||||||
this.pdfViewer.spreadMode = 1;
|
// this.pdfViewer.spreadMode = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.isInitialViewSet = true;
|
this.isInitialViewSet = true;
|
||||||
this.pdfSidebar?.setInitialView(sidebarView);
|
this.pdfSidebar?.setInitialView(sidebarView);
|
||||||
//默认双页
|
//默认双页
|
||||||
// setViewerModes(scrollMode, spreadMode);
|
setViewerModes(scrollMode, spreadMode);
|
||||||
setViewerModes(scrollMode, 1);
|
// setViewerModes(scrollMode, 1);
|
||||||
if (this.initialBookmark) {
|
if (this.initialBookmark) {
|
||||||
setRotation(this.initialRotation);
|
setRotation(this.initialRotation);
|
||||||
delete this.initialRotation;
|
delete this.initialRotation;
|
||||||
|
|
|
@ -73,7 +73,6 @@ export class PPTApi {
|
||||||
// 活动列表处理
|
// 活动列表处理
|
||||||
const workList = (res.rows || []).map(o => o.activityContent)
|
const workList = (res.rows || []).map(o => o.activityContent)
|
||||||
const workItem = [...res.rows]
|
const workItem = [...res.rows]
|
||||||
// 加入活动后刷新ppt数据内容,不跟换为第一页
|
|
||||||
// slidesStore.updateSlideIndex(0) // 下标0 为第一页
|
// slidesStore.updateSlideIndex(0) // 下标0 为第一页
|
||||||
slidesStore.setSlides(slides) // 写入数据
|
slidesStore.setSlides(slides) // 写入数据
|
||||||
// 写入作业列表数据
|
// 写入作业列表数据
|
||||||
|
@ -110,11 +109,9 @@ export class PPTApi {
|
||||||
const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params)
|
const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params)
|
||||||
if (!!rid) {
|
if (!!rid) {
|
||||||
data.id = rid
|
data.id = rid
|
||||||
params.id = rid
|
|
||||||
params.activityContent = null
|
|
||||||
slidesStore.addWorkItem(params)
|
|
||||||
slidesStore.updateSlide(data)
|
slidesStore.updateSlide(data)
|
||||||
// msgUtils.msgSuccess('新增成功')
|
// msgUtils.msgSuccess('新增成功')
|
||||||
|
PPTApi.getSlideList(resource.id)
|
||||||
this.isUpdate = false // 新增后会触发监听,不再更新数据
|
this.isUpdate = false // 新增后会触发监听,不再更新数据
|
||||||
resolve(true)
|
resolve(true)
|
||||||
} else msgUtils.msgError('新增失败');resolve(false)
|
} else msgUtils.msgError('新增失败');resolve(false)
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<!--插入试题-->
|
||||||
<el-dialog v-model="classWorkTaskVisible" append-to-body :show-close="false" width="70%">
|
<el-dialog v-model="classWorkTaskVisible" append-to-body :show-close="false" width="70%">
|
||||||
<QuestToPPTist
|
<QuestToPPTist
|
||||||
class="class-work-task-modal"
|
class="class-work-task-modal"
|
||||||
|
@ -208,9 +208,63 @@ const insertImageElement = (files: FileList) => {
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取当前的时间
|
||||||
|
const getTime=()=>{
|
||||||
|
const now = new Date();
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = ('0' + (now.getMonth() + 1)).slice(-2);
|
||||||
|
const day = ('0' + now.getDate()).slice(-2);
|
||||||
|
const hours = ('0' + now.getHours()).slice(-2);
|
||||||
|
const minutes = ('0' + now.getMinutes()).slice(-2);
|
||||||
|
const seconds = ('0' + now.getSeconds()).slice(-2);
|
||||||
|
return `${year}-${month}-${day}_${hours}:${minutes}:${seconds}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* base64转图片File
|
||||||
|
* @param {String} base64 图片base64
|
||||||
|
* @param {String} fileName 图片名称| 默认 → myimg
|
||||||
|
* @returns File 返回转换后的file数据类型
|
||||||
|
*/
|
||||||
|
const base64ToFile = (base64: string, fileName = '试题图片') => {
|
||||||
|
// 将base64按照 , 进行分割 将前缀 与后续内容分隔开
|
||||||
|
let data = base64.split(','),
|
||||||
|
// 利用正则表达式 从前缀中获取图片的类型信息(image/png、image/jpeg、image/webp等)
|
||||||
|
type = data[0].match(/:(.*?);/)[1],
|
||||||
|
// 从图片的类型信息中 获取具体的文件格式后缀(png、jpeg、webp)
|
||||||
|
suffix = type.split('/')[1],
|
||||||
|
// 使用atob()对base64数据进行解码 结果是一个文件数据流 以字符串的格式输出
|
||||||
|
bstr = window.atob(data[1]),
|
||||||
|
// 获取解码结果字符串的长度
|
||||||
|
n = bstr.length,
|
||||||
|
// 根据解码结果字符串的长度创建一个等长的整形数字数组
|
||||||
|
// 但在创建时 所有元素初始值都为 0
|
||||||
|
u8arr = new Uint8Array(n)
|
||||||
|
|
||||||
|
// 将整形数组的每个元素填充为解码结果字符串对应位置字符的UTF-16 编码单元
|
||||||
|
while (n--) {
|
||||||
|
// charCodeAt():获取给定索引处字符对应的 UTF-16 代码单元
|
||||||
|
u8arr[n] = bstr.charCodeAt(n)
|
||||||
|
}
|
||||||
|
const filename = fileName+getTime()
|
||||||
|
// 利用构造函数创建File文件对象
|
||||||
|
// new File(bits, name, options)
|
||||||
|
const file = new File([u8arr], `${filename}.${suffix}`, {
|
||||||
|
type: type
|
||||||
|
})
|
||||||
|
// 返回file
|
||||||
|
return file
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const onhtml2canvas = async (html: HTMLElement) => {
|
const onhtml2canvas = async (html: HTMLElement) => {
|
||||||
const ele = await toPng(html);
|
const base64Dta = await toPng(html);
|
||||||
createImageElement(ele);
|
const toFile = base64ToFile(base64Dta)
|
||||||
|
// 上传图片转为线上地址
|
||||||
|
PPTApi.toRousrceUrl(toFile).then(data=>{
|
||||||
|
createImageElement(data)
|
||||||
|
})
|
||||||
|
// createImageElement(ele);
|
||||||
}
|
}
|
||||||
|
|
||||||
const shapePoolVisible = ref(false)
|
const shapePoolVisible = ref(false)
|
||||||
|
|
|
@ -305,10 +305,10 @@ const upDateData = async () => {
|
||||||
// await PPTApi.updateSlide(paramData.value)
|
// await PPTApi.updateSlide(paramData.value)
|
||||||
loadingActive.value = true
|
loadingActive.value = true
|
||||||
await updateEntpcoursefileNew(paramData.value)
|
await updateEntpcoursefileNew(paramData.value)
|
||||||
const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 })
|
|
||||||
await formatClassWorkFile(res.rows)
|
|
||||||
const resource = sessionStore.get('curr.resource')
|
const resource = sessionStore.get('curr.resource')
|
||||||
await PPTApi.getSlideList(resource.id)
|
await PPTApi.getSlideList(resource.id)
|
||||||
|
const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 })
|
||||||
|
await formatClassWorkFile(res.rows)
|
||||||
}
|
}
|
||||||
// 判断是否做操作
|
// 判断是否做操作
|
||||||
const objectsAreEqual = (obj1: Record<string, any>, obj2: Record<string, any>) => {
|
const objectsAreEqual = (obj1: Record<string, any>, obj2: Record<string, any>) => {
|
||||||
|
|
|
@ -82,6 +82,8 @@ export class MsgEnum {
|
||||||
MSG_classcourseopen : 'classcourseopen',
|
MSG_classcourseopen : 'classcourseopen',
|
||||||
/** @desc: 学生的测练结果反馈 */
|
/** @desc: 学生的测练结果反馈 */
|
||||||
MSG_classquizfeedback : 'classquizfeedback',
|
MSG_classquizfeedback : 'classquizfeedback',
|
||||||
|
/** @desc: 学生提交作业 */
|
||||||
|
MSG_finishHomework : 'finishHomework',
|
||||||
/** @desc: 老师端:接收到学生反馈消息-课堂测练中的其他任务 */
|
/** @desc: 老师端:接收到学生反馈消息-课堂测练中的其他任务 */
|
||||||
MSG_classtaskfeedback : 'classtaskfeedback',
|
MSG_classtaskfeedback : 'classtaskfeedback',
|
||||||
/** @desc: 老师端:学生反馈的消息,具体要看其中的feedbackkey,类别较繁杂 */
|
/** @desc: 老师端:学生反馈的消息,具体要看其中的feedbackkey,类别较繁杂 */
|
||||||
|
|
|
@ -395,6 +395,6 @@ export const dataSetJson = {
|
||||||
"课标-高中-英语": "e889fcac9fd011efb22a0242ac140006",
|
"课标-高中-英语": "e889fcac9fd011efb22a0242ac140006",
|
||||||
"课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
|
"课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
|
||||||
"课标-高中-地理": "270516829fd111efb13c0242ac140006",
|
"课标-高中-地理": "270516829fd111efb13c0242ac140006",
|
||||||
"课标-高中-政治": "a7df2b01aafd11ef8bb40242ac140002",
|
"课标-高中-政治": "a2f0b247b85d11ef84290242ac140005",
|
||||||
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
|
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
|
||||||
}
|
}
|
|
@ -162,9 +162,10 @@ import ItemDialogScore from '@/views/classTask/container/classTask/item-dialog-s
|
||||||
import quizStats from '@/views/classTask/container/quizStats.vue'
|
import quizStats from '@/views/classTask/container/quizStats.vue'
|
||||||
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
||||||
import {sessionStore} from '@/utils/store'
|
import {sessionStore} from '@/utils/store'
|
||||||
import Chat from '@/utils/chat' // im 登录初始化
|
// import Chat from '@/utils/chat' // im 登录初始化
|
||||||
|
import MsgEnum from '@/plugins/imChat/msgEnum' // im 消息枚举
|
||||||
|
import ChatWs from '@/plugins/socket' // 聊天socket
|
||||||
|
if (!ChatWs.ws) ChatWs.init()
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const emit = defineEmits(['cle-click'])
|
const emit = defineEmits(['cle-click'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -713,27 +714,39 @@ const closeDialog = () => {
|
||||||
|
|
||||||
// im监听消息回调
|
// im监听消息回调
|
||||||
const msgHandle = (msg) => {
|
const msgHandle = (msg) => {
|
||||||
const { type, data } = msg
|
if (typeof msg === 'object'){
|
||||||
switch(type) {
|
const { head, content, ...other } = msg
|
||||||
case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[]
|
switch(head) {
|
||||||
{
|
case MsgEnum.HEADS.MSG_closed: // 下课:
|
||||||
(data||[]).forEach(o => {
|
window.close() // 关闭窗口
|
||||||
const msgArr = o?.message_elem_array||[]
|
break
|
||||||
msgArr.forEach(info => {
|
case MsgEnum.HEADS.MSG_finishHomework: // 跟新作业:
|
||||||
const msgType = info?.elem_type // 消息类型 TIMElemType
|
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||||
const msgData = !!info.text_elem_content ? JSON.parse(info.text_elem_content)||'' : ''
|
openDialog(data, false);
|
||||||
// 处理学生端反馈得消息
|
|
||||||
//console.log('msgData->', msgData);
|
|
||||||
if (msgData.msgKey == "finishHomework"){
|
|
||||||
// 刷新
|
|
||||||
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
|
||||||
//console.log('data->', data);
|
|
||||||
openDialog(data, false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
break
|
break
|
||||||
|
case MsgEnum.HEADS.MSG_slideFlapping: // 切换页面
|
||||||
|
window.close() // 关闭窗口
|
||||||
|
break
|
||||||
|
// case 'TIMAddRecvNewMsgCallback': // 收到新消息 data=[]
|
||||||
|
// {
|
||||||
|
// (data||[]).forEach(o => {
|
||||||
|
// const msgArr = o?.message_elem_array||[]
|
||||||
|
// msgArr.forEach(info => {
|
||||||
|
// const msgType = info?.elem_type // 消息类型 TIMElemType
|
||||||
|
// const msgData = !!info.text_elem_content ? JSON.parse(info.text_elem_content)||'' : ''
|
||||||
|
// // 处理学生端反馈得消息
|
||||||
|
// //console.log('msgData->', msgData);
|
||||||
|
// if (msgData.msgKey == "finishHomework"){
|
||||||
|
// // 刷新
|
||||||
|
// const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||||
|
// //console.log('data->', data);
|
||||||
|
// openDialog(data, false);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,11 +763,21 @@ onMounted(() => {
|
||||||
isReloadTimer();
|
isReloadTimer();
|
||||||
|
|
||||||
// im监听消息
|
// im监听消息
|
||||||
if (!Chat.imChat) {
|
if (ChatWs.ws) {
|
||||||
Chat.init(true, true, msgHandle);
|
ChatWs.watch((msg, e) => {
|
||||||
} else {
|
try {
|
||||||
Chat.listenMsg(msgHandle);
|
msgHandle(JSON.parse(msg))
|
||||||
}
|
} catch (error) {
|
||||||
|
console.error('socket 解析异常 ', error, e)
|
||||||
|
msgHandle(msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// if (!Chat.imChat) {
|
||||||
|
// Chat.init(true, true, msgHandle);
|
||||||
|
// } else {
|
||||||
|
// Chat.listenMsg(msgHandle);
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
const isReloadTimer = () =>{
|
const isReloadTimer = () =>{
|
||||||
clearInterval(reloadTimer.value) // 关闭定时器
|
clearInterval(reloadTimer.value) // 关闭定时器
|
||||||
|
|
Loading…
Reference in New Issue