资源推送
This commit is contained in:
parent
28a815169d
commit
33e84ca006
|
@ -42,4 +42,13 @@ export function delClasswork(id) {
|
|||
url: '/education/classwork/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增classwork
|
||||
export function addClassworkReturnId(data) {
|
||||
return request({
|
||||
url: '/education/classwork/saveAndReturnId',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
|
@ -81,8 +81,8 @@ import { ipcMsgSend, ipcMsgSend2, ipcMsgInvoke } from '@/utils/tool'
|
|||
import { useToolState } from '@/store/modules/tool'
|
||||
import Lesson from './lesson.vue';
|
||||
import { parseCataByNode } from '@/utils/talkFile'
|
||||
import outLink from '@/utils/linkConfig'
|
||||
import MsgEnum from '@/plugins/imChat/msgEnum' // 消息枚举
|
||||
import { createHomework } from '../createHomework'
|
||||
|
||||
const route = useRoute();
|
||||
const usertore = useUserStore().user
|
||||
|
@ -129,16 +129,35 @@ const changeChapter = async (data)=>{
|
|||
getResource()
|
||||
}
|
||||
|
||||
// 文件资源打开web AIX 布置作业
|
||||
const openFileLink = (item) =>{
|
||||
// key 对应的 linkConfig.js 外部链接配置
|
||||
let key = 'filehomework'
|
||||
let configObj = outLink()[key]
|
||||
ipcMsgSend2('openWindow', {
|
||||
key,
|
||||
fullPath: configObj.fullPath + `&fileShowName=${item.fileShowName}&fileFullPath=${item.fileFullPath}`,
|
||||
cookieData: { ...configObj.data }
|
||||
})
|
||||
// 资源推送
|
||||
const openFileLink = async (item) =>{
|
||||
/**
|
||||
* 资源推送
|
||||
* 1:先生成作业
|
||||
* 2:再进行推送
|
||||
*/
|
||||
|
||||
// 根据当前月份日期 生成一个作业编号
|
||||
const today = new Date();
|
||||
// 获取月份
|
||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||
// 获取当前日
|
||||
const day = String(today.getDate()).padStart(2, '0');
|
||||
// 生成一个作业编号
|
||||
const uniquekey = `${usertore.edusubject}-${month}${day}-${dataList.value.length + 1}`
|
||||
|
||||
// 章节ID
|
||||
const querySearch = toolStore.curSubjectNode.querySearch
|
||||
const evalid = querySearch.levelSecondId ? querySearch.levelSecondId : querySearch.levelFirstId
|
||||
|
||||
// 资源数据
|
||||
const data = [{name: item.fileShowName, ulr: item.fileFullPath}]
|
||||
// 生成作业
|
||||
await createHomework({ uniquekey, evalid, data, entpcourseid: entpcourseid.value })
|
||||
// 查询作业
|
||||
getHomework()
|
||||
let row = dataList.value.at(-1)
|
||||
sendHomework(row)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
import useUserStore from '@/store/modules/user'
|
||||
import { addClassworkReturnId } from '@/api/teaching/classwork'
|
||||
|
||||
export const createHomework = ({ uniquekey, evalid, data, entpcourseid }) =>{
|
||||
const usertore = useUserStore().user
|
||||
|
||||
var formObj = {};
|
||||
formObj.id = 0;
|
||||
|
||||
formObj.deaddate = '';
|
||||
formObj.entpid = usertore.deptId;
|
||||
formObj.level = 1;
|
||||
formObj.parentid = 0;
|
||||
formObj.worktype = '常规作业';
|
||||
formObj.workkey = '';
|
||||
formObj.worktag = '';
|
||||
|
||||
formObj.uniquekey = uniquekey;
|
||||
|
||||
formObj.classid = 0;
|
||||
formObj.classcourseid = 0;
|
||||
|
||||
formObj.entpcourseid = entpcourseid;
|
||||
|
||||
formObj.slideid = 0;
|
||||
|
||||
formObj.workcodes = JSON.stringify(data);
|
||||
|
||||
formObj.edusubject = usertore.edusubject;
|
||||
formObj.evalid = evalid
|
||||
|
||||
formObj.edustage = usertore.edustage;
|
||||
formObj.status = '';
|
||||
formObj.edituserid = usertore.userId;
|
||||
formObj.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
|
||||
return addClassworkReturnId(formObj)
|
||||
}
|
Loading…
Reference in New Issue