baigl #208
|
@ -34,7 +34,7 @@
|
||||||
</template>
|
</template>
|
||||||
<!--作业-->
|
<!--作业-->
|
||||||
<template v-if="type == 3 || type == -1">
|
<template v-if="type == 3 || type == -1">
|
||||||
<li class="flex class-item home-list" v-for="item in homeworkList" :key="item.id">
|
<li class="flex class-item home-list" v-for="item in homeworkList" :key="item.id" @click="onClickItem(item)">
|
||||||
<div class="class-left flex">
|
<div class="class-left flex">
|
||||||
<div class="class-name flex">
|
<div class="class-name flex">
|
||||||
<span class="name">{{ item.uniquekey }}</span>
|
<span class="name">{{ item.uniquekey }}</span>
|
||||||
|
@ -52,6 +52,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
<item-dialog ref="itemDialogRef" @cle-click="closeDialog"></item-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -59,13 +60,15 @@ import { ref, onMounted } from 'vue'
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import { getSelfReserv } from '@/api/classManage'
|
import { getSelfReserv } from '@/api/classManage'
|
||||||
import { homeworklist } from '@/api/teaching/classwork'
|
import { homeworklist } from '@/api/teaching/classwork'
|
||||||
import { getCurrentTime } from '@/utils/date'
|
import { getCurrentTime, getTomorrow } from '@/utils/date'
|
||||||
|
import ItemDialog from '@/views/classTask/container/item-dialog.vue'
|
||||||
|
|
||||||
const type = ref(-1)
|
const type = ref(-1)
|
||||||
const user = useUserStore().user
|
const user = useUserStore().user
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const classList = ref([])
|
const classList = ref([])
|
||||||
const homeworkList = ref([])
|
const homeworkList = ref([])
|
||||||
|
const itemDialogRef = ref(null)
|
||||||
|
|
||||||
// 获取上课
|
// 获取上课
|
||||||
const getClass = async () => {
|
const getClass = async () => {
|
||||||
|
@ -84,15 +87,34 @@ const getHomework = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
const { edustage, edusubject } = user
|
const { edustage, edusubject } = user
|
||||||
try {
|
try {
|
||||||
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, orderby: 'uniquekey DESC', pageSize: 500 })
|
const { rows } = await homeworklist({ edituserid: user.userId, edustage, edusubject, deaddate: getTomorrow(), orderby: 'uniquekey DESC', pageSize: 500 })
|
||||||
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey)
|
// 只展示进行中的
|
||||||
|
homeworkList.value = rows.filter(item => item.deaddate && item.uniquekey&& getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate )
|
||||||
homeworkList.value.forEach((item) => {
|
homeworkList.value.forEach((item) => {
|
||||||
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
item.workdatacount = JSON.parse('[' + item.classworkdatastudentids + ']').length
|
||||||
|
// 如果是习题训练任务,则检查一共有多少道
|
||||||
|
if (item.entpcourseworklist != '') {
|
||||||
|
item.entpcourseworklistarray = JSON.parse(
|
||||||
|
'[' + item.entpcourseworklist + ']'
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
item.entpcourseworklistarray = []
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 批改作业
|
||||||
|
const onClickItem = (item) => {
|
||||||
|
console.log('开启弹窗')
|
||||||
|
itemDialogRef.value.openDialog(item)
|
||||||
|
}
|
||||||
|
// 批阅关闭
|
||||||
|
const closeDialog = () => {
|
||||||
|
console.log('关闭弹窗,查询一下作业数据,更新界面')
|
||||||
|
getHomework()
|
||||||
|
}
|
||||||
|
|
||||||
const tagType = (time) => {
|
const tagType = (time) => {
|
||||||
return getCurrentTime('YYYY-MM-DD HH:mm') > time ? 'info' : 'warning'
|
return getCurrentTime('YYYY-MM-DD HH:mm') > time ? 'info' : 'warning'
|
||||||
|
|
Loading…
Reference in New Issue