Merge branch 'main' of http://27.128.240.72:3000/zhuhao/AIx_Smarttalk_WS into zdg_dev
This commit is contained in:
commit
80b66ffb28
|
@ -208,6 +208,18 @@ 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
|
* base64转图片File
|
||||||
* @param {String} base64 图片base64
|
* @param {String} base64 图片base64
|
||||||
|
@ -234,9 +246,10 @@ const base64ToFile = (base64: string, fileName = '试题图片') => {
|
||||||
// charCodeAt():获取给定索引处字符对应的 UTF-16 代码单元
|
// charCodeAt():获取给定索引处字符对应的 UTF-16 代码单元
|
||||||
u8arr[n] = bstr.charCodeAt(n)
|
u8arr[n] = bstr.charCodeAt(n)
|
||||||
}
|
}
|
||||||
|
const filename = fileName+getTime()
|
||||||
// 利用构造函数创建File文件对象
|
// 利用构造函数创建File文件对象
|
||||||
// new File(bits, name, options)
|
// new File(bits, name, options)
|
||||||
const file = new File([u8arr], `${fileName}.${suffix}`, {
|
const file = new File([u8arr], `${filename}.${suffix}`, {
|
||||||
type: type
|
type: type
|
||||||
})
|
})
|
||||||
// 返回file
|
// 返回file
|
||||||
|
|
|
@ -714,8 +714,9 @@ 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
|
||||||
|
switch(head) {
|
||||||
case MsgEnum.HEADS.MSG_closed: // 下课:
|
case MsgEnum.HEADS.MSG_closed: // 下课:
|
||||||
window.close() // 关闭窗口
|
window.close() // 关闭窗口
|
||||||
break
|
break
|
||||||
|
@ -747,6 +748,7 @@ const msgHandle = (msg) => {
|
||||||
// break
|
// break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const reloadTimer = ref(0); // 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
const reloadTimer = ref(0); // 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
||||||
const cutid = ref(0); // 当前初始化的作业id
|
const cutid = ref(0); // 当前初始化的作业id
|
||||||
|
|
Loading…
Reference in New Issue