查询作业修改

This commit is contained in:
lyc 2024-08-14 14:57:00 +08:00
parent bf783cf940
commit c72d103082
3 changed files with 13 additions and 115 deletions

View File

@ -11,6 +11,7 @@ let chapterId = null
export const useGetHomework = async (node) => {
/**
* node
* 左侧选择章节的节点数据
*/
if (!node) return
curNode = node
@ -26,7 +27,10 @@ export const useGetHomework = async (node) => {
chapterId = rows[0].id
}
return await getHomeWorkList()
return new Promise(async (resolve) =>{
const res = await getHomeWorkList()
resolve({res,chapterId})
})
}

View File

@ -139,7 +139,6 @@ import { useToolState } from '@/store/modules/tool'
import MoveFile from '@/components/move-file/index.vue'
import FileListItem from '@/views/prepare/container/file-list-item.vue'
import { getSmarttalkPage, moveSmarttalk } from '@/api/file'
import { homeworklist, listEntpcourse } from '@/api/teaching/classwork'
import { toTimeText } from '@/utils/date'
import { ElMessage } from 'element-plus'
import { parseCataByNode, creatPPT, asyncLocalFile } from '@/utils/talkFile'
@ -148,8 +147,9 @@ import SetHomework from './container/set-homework.vue'
import outLink from '@/utils/linkConfig'
import { createWindow } from '@/utils/tool'
import { cloneDeep } from 'lodash'
import { delClasswork, addEntpcourse } from '@/api/teaching/classwork'
import { delClasswork } from '@/api/teaching/classwork'
import { getSelfReserv, startClass } from '@/api/classManage'
import { useGetHomework } from '@/hooks/useGetHomework'
const toolStore = useToolState()
const fs = require('fs')
const { ipcRenderer } = window.electron || {}
@ -428,44 +428,11 @@ export default {
this.initHomeWork()
await this.asyncAllFile()
},
//
async initHomeWork() {
if (this.uploadData.levelSecondId) {
// ID
let { rows } = await this.getChapterId()
if (rows.length > 0) {
this.entpcourseid = rows[0].id
} else {
await this.createEntpcourse()
let { rows } = await this.getChapterId()
this.entpcourseid = rows[0].id
}
//
this.getHomeWorkList()
}
},
// entpcourse
createEntpcourse() {
// web AIx
var cform = {}
cform.entpid = this.userStore.deptId
cform.level = 1
cform.parentid = 0
cform.dictid = 0
cform.evalid = this.currentNode.id
cform.evalparentid = 0
cform.edusubject = this.currentNode.edusubject
cform.edudegree = this.currentNode.edudegree
cform.edustage = this.currentNode.edustage
cform.coursetype = '课标学科'
cform.coursetitle = this.currentNode.itemtitle
cform.coursedesc = ''
cform.status = ''
cform.dflag = 0
cform.edituserid = this.userStore.userId
cform.createblankfile = 'yes'
return addEntpcourse(cform)
const { res, chapterId } = await useGetHomework(this.currentNode)
this.entpcourseid = chapterId
this.currentWorkList = cloneDeep(res)
},
openReserv() {
this.$refs['reservDialog'].openDialog()
@ -495,79 +462,6 @@ export default {
cookieData: { ...configObj.data }
})
},
// ID ID
getChapterId() {
return listEntpcourse({
evalid: this.uploadData.levelSecondId,
edituserid: this.userStore.userId,
pageSize: 500
})
},
//
getHomeWorkList() {
homeworklist({
entpcourseid: this.entpcourseid,
edituserid: this.userStore.userId,
pageSize: 100
}).then((res) => {
// AIx web
let list = []
for (var i = 0; i < res.rows.length; i++) {
res.rows[i].taskconfig = []
// child
for (var j = 0; j < res.rows.length; j++) {
if (res.rows[j].parentid == res.rows[i].id) {
var ss = []
if (res.rows[j].classworkdatastudentids != null) {
ss = JSON.parse('[' + res.rows[j].classworkdatastudentids + ']')
}
var js = {
id: res.rows[j].id,
classid: res.rows[j].classid,
classcaption: res.rows[j].classcaption,
parentid: 0,
worktype: '',
workkey: res.rows[j].workkey,
worktag: '',
entpcourseid: 0,
evalid: 0,
edusubject: '',
edudegree: '',
workdate: '',
title: '',
workcodes: '',
studentlist: ss,
deaddate: res.rows[j].deaddate,
timelength: res.rows[j].timelength,
weights: res.rows[j].weights,
feedtype: res.rows[j].feedtype
}
res.rows[i].taskconfig.push(js)
}
}
res.rows[i].fileShowName = res.rows[i].uniquekey
// slideid>0PPT
// 2024-05-15jackyshen
if (res.rows[i].classid == 0 && res.rows[i].slideid == 0) {
list.push(res.rows[i])
}
//
if (res.rows[i].entpcourseworklist != '') {
res.rows[i].entpcourseworklistarray = JSON.parse(
'[' + res.rows[i].entpcourseworklist + ']'
)
} else {
res.rows[i].entpcourseworklistarray = []
}
}
//
this.currentWorkList = cloneDeep(list)
})
},
getWeekday1(date) {
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
const weekday = new Date(date).getDay()
@ -586,7 +480,7 @@ export default {
ElMessage.success('操作成功')
this.isLoading = false
await this.asyncAllFile()
this.getHomeWorkList()
this.initHomeWork()
})
.catch(() => {
this.isLoading = false

View File

@ -118,7 +118,7 @@ const closeHomework = () => {
const changeChapter = async (data)=>{
const res = await useGetHomework(data)
const { res } = await useGetHomework(data)
dataList.value = res
let cata = parseCataByNode(data)