baigl #208

Merged
baigl merged 7 commits from baigl into main 2024-09-14 14:22:38 +08:00
1 changed files with 26 additions and 4 deletions
Showing only changes of commit 490add5467 - Show all commits

View File

@ -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'