Compare commits

...

19 Commits

Author SHA1 Message Date
小杨 7861727e92 fix:修改pptlist活动的bug; 2024-12-12 16:39:01 +08:00
zhangxuelin c5e71e6e7b Merge pull request '修改作业弹窗' (#122) from zxl into main
Reviewed-on: #122
2024-12-12 16:38:33 +08:00
zhangxuelin c7ebc6de65 1 2024-12-12 16:37:51 +08:00
zhangxuelin b906a1e688 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into zxl 2024-12-12 16:37:22 +08:00
baigl f75ab621d2 Merge pull request 'baigl' (#124) from baigl into main
Reviewed-on: #124
2024-12-12 16:35:47 +08:00
白了个白 a711eb2745 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into baigl 2024-12-12 16:35:04 +08:00
白了个白 363b284b7c 1 2024-12-12 16:34:47 +08:00
baigl dc4c0fd334 Merge pull request 'baigl' (#123) from baigl into main
Reviewed-on: #123
2024-12-12 16:24:36 +08:00
白了个白 fb3ffd5dda Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into baigl 2024-12-12 16:23:51 +08:00
白了个白 5771533039 ppts: 插入试题 图片路径存储修改 2024-12-12 16:23:28 +08:00
zhangxuelin 75ea11e171 Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into zxl 2024-12-12 16:15:55 +08:00
zhangxuelin 851a39897b 修改作业弹窗 2024-12-12 16:15:16 +08:00
zhangxuelin 69bfc68b28 Merge pull request '作业弹窗' (#121) from zxl into main
Reviewed-on: #121
2024-12-12 16:12:53 +08:00
zhangxuelin 590b318757 作业弹窗 2024-12-12 16:12:32 +08:00
CYS 4421ee7fea Merge pull request '政治课标dataset_id修改' (#120) from cys_dev into main
Reviewed-on: #120
2024-12-12 16:05:55 +08:00
cys 19ef95447c 1 2024-12-12 16:04:43 +08:00
baigl 25b6da7f26 Merge pull request '教程分析:pdf页面展示修改' (#119) from baigl into main
Reviewed-on: #119
2024-12-12 15:27:00 +08:00
白了个白 892b4ee3b0 教程分析:pdf页面展示修改 2024-12-12 15:26:14 +08:00
yangws 3d8f7c2a3a Merge pull request 'fix:修改pptlist添加活动的bug;' (#118) from yws_dev into main
Reviewed-on: #118
2024-12-12 11:27:19 +08:00
7 changed files with 118 additions and 42 deletions

View File

@ -13097,15 +13097,15 @@ const PDFViewerApplication = {
}
if (isValidSpreadMode(spread)) {
//默认双页
// this.pdfViewer.spreadMode = spread;
this.pdfViewer.spreadMode = 1;
this.pdfViewer.spreadMode = spread;
// this.pdfViewer.spreadMode = 1;
}
};
this.isInitialViewSet = true;
this.pdfSidebar?.setInitialView(sidebarView);
//默认双页
// setViewerModes(scrollMode, spreadMode);
setViewerModes(scrollMode, 1);
setViewerModes(scrollMode, spreadMode);
// setViewerModes(scrollMode, 1);
if (this.initialBookmark) {
setRotation(this.initialRotation);
delete this.initialRotation;

View File

@ -73,7 +73,6 @@ export class PPTApi {
// 活动列表处理
const workList = (res.rows || []).map(o => o.activityContent)
const workItem = [...res.rows]
// 加入活动后刷新ppt数据内容不跟换为第一页
// slidesStore.updateSlideIndex(0) // 下标0 为第一页
slidesStore.setSlides(slides) // 写入数据
// 写入作业列表数据
@ -110,11 +109,9 @@ export class PPTApi {
const rid = await API_entpcoursefile.addEntpcoursefileReturnId(params)
if (!!rid) {
data.id = rid
params.id = rid
params.activityContent = null
slidesStore.addWorkItem(params)
slidesStore.updateSlide(data)
// msgUtils.msgSuccess('新增成功')
PPTApi.getSlideList(resource.id)
this.isUpdate = false // 新增后会触发监听,不再更新数据
resolve(true)
} else msgUtils.msgError('新增失败');resolve(false)

View File

@ -114,7 +114,7 @@
/>
</Modal>
<!--插入试题-->
<el-dialog v-model="classWorkTaskVisible" append-to-body :show-close="false" width="70%">
<QuestToPPTist
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/pngimage/jpegimage/webp
type = data[0].match(/:(.*?);/)[1],
// pngjpegwebp
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 ele = await toPng(html);
createImageElement(ele);
const base64Dta = await toPng(html);
const toFile = base64ToFile(base64Dta)
// 线
PPTApi.toRousrceUrl(toFile).then(data=>{
createImageElement(data)
})
// createImageElement(ele);
}
const shapePoolVisible = ref(false)

View File

@ -305,10 +305,10 @@ const upDateData = async () => {
// await PPTApi.updateSlide(paramData.value)
loadingActive.value = true
await updateEntpcoursefileNew(paramData.value)
const res = await homeworklist({ ids: paramData.value.activityContent, pageSize: 100 })
await formatClassWorkFile(res.rows)
const resource = sessionStore.get('curr.resource')
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>) => {

View File

@ -82,6 +82,8 @@ export class MsgEnum {
MSG_classcourseopen : 'classcourseopen',
/** @desc: 学生的测练结果反馈 */
MSG_classquizfeedback : 'classquizfeedback',
/** @desc: 学生提交作业 */
MSG_finishHomework : 'finishHomework',
/** @desc: 老师端:接收到学生反馈消息-课堂测练中的其他任务 */
MSG_classtaskfeedback : 'classtaskfeedback',
/** @desc: 老师端学生反馈的消息具体要看其中的feedbackkey类别较繁杂 */

View File

@ -395,6 +395,6 @@ export const dataSetJson = {
"课标-高中-英语": "e889fcac9fd011efb22a0242ac140006",
"课标-高中-数学": "e03aa4fe9fd011ef91270242ac140006",
"课标-高中-地理": "270516829fd111efb13c0242ac140006",
"课标-高中-政治": "a7df2b01aafd11ef8bb40242ac140002",
"课标-高中-政治": "a2f0b247b85d11ef84290242ac140005",
"鉴权": "ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm"
}

View File

@ -162,9 +162,10 @@ import ItemDialogScore from '@/views/classTask/container/classTask/item-dialog-s
import quizStats from '@/views/classTask/container/quizStats.vue'
import ClassOverview from '@/views/classTask/container/classOverview.vue'
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 emit = defineEmits(['cle-click'])
const props = defineProps({
@ -713,27 +714,39 @@ const closeDialog = () => {
// im
const msgHandle = (msg) => {
const { type, data } = msg
switch(type) {
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);
}
})
})
}
if (typeof msg === 'object'){
const { head, content, ...other } = msg
switch(head) {
case MsgEnum.HEADS.MSG_closed: // :
window.close() //
break
case MsgEnum.HEADS.MSG_finishHomework: // :
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
openDialog(data, false);
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();
// im
if (!Chat.imChat) {
Chat.init(true, true, msgHandle);
} else {
Chat.listenMsg(msgHandle);
}
if (ChatWs.ws) {
ChatWs.watch((msg, e) => {
try {
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 = () =>{
clearInterval(reloadTimer.value) //