作业批阅:待继续完善

This commit is contained in:
白了个白 2024-11-04 17:31:30 +08:00
parent b07a4e07b9
commit 033c0a3b19
5 changed files with 115 additions and 52 deletions

View File

@ -89,6 +89,13 @@ export function updateClassworkdata(data) {
data: data data: data
}) })
} }
export function updateClassWorkDataAutoFinish(data) {
return request({
url: '/education/classworkdata/updAutoFinish',
method: 'put',
data: data
})
}
// 修改classwork // 修改classwork
export function updateClasswork(data) { export function updateClasswork(data) {

View File

@ -167,3 +167,19 @@ export function getTomorrow() {
return tomorrow; return tomorrow;
} }
/**
* date z转为日期格式
* @param {*} format
* @returns
*/
export const getDateFormatDate = (newDate)=> {
const now = newDate; // new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
// const hours = now.getHours().toString().padStart(2, '0');
// const minutes = now.getMinutes().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
}

View File

@ -19,6 +19,16 @@
/> />
</div> </div>
</div> </div>
<div class="demo-date-picker">
<el-date-picker
v-model="startEndDate"
type="daterange"
start-placeholder="Start Date"
end-placeholder="End Date"
:default-time="defaultTime"
@change="changeStartEndDate"
/>
</div>
</div> </div>
</div> </div>
<div class="class-reserv-body"> <div class="class-reserv-body">
@ -63,7 +73,7 @@ import { listByDeadDate, listClassworkdata } from '@/api/classTask'
import TaskItem from '@/views/classTask/container/classTask/task-item.vue' import TaskItem from '@/views/classTask/container/classTask/task-item.vue'
// import ItemDialog from '@/views/classTask/container/item-dialog.vue' // import ItemDialog from '@/views/classTask/container/item-dialog.vue'
import { useToolState } from '@/store/modules/tool' import { useToolState } from '@/store/modules/tool'
import { getCurrentTime } from '@/utils/date' import { getCurrentTime, getDateFormatDate } from '@/utils/date'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import useClassTaskStore from "@/store/modules/classTask"; import useClassTaskStore from "@/store/modules/classTask";
import {createWindow} from '@/utils/tool' import {createWindow} from '@/utils/tool'
@ -81,6 +91,16 @@ const tabActive = ref('待批改')
const dataList = ref([]) const dataList = ref([])
const EndDate = ref(getCurrentTime('YYYY-MM-DD')) const EndDate = ref(getCurrentTime('YYYY-MM-DD'))
const startEndDate = ref([
new Date(2024, 9, 1, 0, 0, 0),
new Date(2024, 11, 1, 23, 59, 59),
])
const defaultTime = ref<[Date, Date]>([
new Date(2024, 9, 1, 0, 0, 0),
new Date(2024, 11, 1, 23, 59, 59),
])
console.log(new Date(2000, 1, 1, 0, 0, 0),'-------------------' )
// //
const classWorkList = ref([]) const classWorkList = ref([])
const total = ref(0) const total = ref(0)
@ -110,6 +130,14 @@ const changeEndDate = (val) => {
console.log('截止日期改变', val) console.log('截止日期改变', val)
getData() // getData() //
} }
const changeStartEndDate = (val) => {
console.log('启止日期改变', val)
console.log('startEndDate', startEndDate.value)
console.log('startEndDate-0', getDateFormatDate(startEndDate.value[0]))
console.log('startEndDate-1', getDateFormatDate(startEndDate.value[1]))
getData() //
}
// //
const getData = async () => { const getData = async () => {
@ -145,8 +173,9 @@ const getClassWorkList = async () => {
edustage: userStore.edustage, // edustage: userStore.edustage, //
edusubject: userStore.edusubject,// edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,// // deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,// startdate: tabActive.value === '待批改'? '' : getDateFormatDate(startEndDate.value[0]),
status: '1', // 1- deaddate: tabActive.value === '待批改'? '' : getDateFormatDate(startEndDate.value[1]),//
status: tabActive.value === '待批改'? '1' : '2', // 1-
orderby: 'deaddate DESC', orderby: 'deaddate DESC',
pageSize: 100, pageSize: 100,
}) })
@ -156,15 +185,15 @@ const getClassWorkList = async () => {
* 1待批改以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断 * 1待批改以前是以明天判断现改为传当天的日期并根据当前日期的时分与截止日期进行判断
* 2已批改以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断 * 2已批改以前默认是以明天判断现依然以明天为判断并根据当前日期时分大于截止日期时分判断
*/ */
let list = []; // let list = [];
if(tabActive.value === '待批改'){ // if(tabActive.value === ''){
// // //
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate); // // list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') < item.deaddate); //
}else{ // }else{
list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate); // // list = response.rows&&response.rows.filter(item => item.deaddate && getCurrentTime('YYYY-MM-DD HH:mm') > item.deaddate); //
} // }
let list = response.rows || [];
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
// //
list[i].workdatalist = [] list[i].workdatalist = []
@ -226,7 +255,9 @@ const getStudentClassWorkData = async() => {
// edusubject: userStore.edusubject,// // edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,// // deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
// deaddate: EndDate.value,// // deaddate: EndDate.value,//
// //status: '1', // 1- // startdate: tabActive.value === ''? '' : getDateFormatDate(startEndDate.value[0]),
// deaddate:tabActive.value === ''? '' : getDateFormatDate(startEndDate.value[1]),
// //status: tabActive.value === ''? '1' : '2', // 1-
// orderby: "deaddate DESC",// // orderby: "deaddate DESC",//
// pageSize: 1000, // pageSize: 1000,
// }) // })
@ -426,8 +457,10 @@ const getStudentVisible = async () => {
edustage: userStore.edustage,// edustage: userStore.edustage,//
edusubject: userStore.edusubject,// edusubject: userStore.edusubject,//
// deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,// // deaddate: tabActive.value === ''? getTomorrow() : EndDate.value,//
deaddate: EndDate.value,// // deaddate: EndDate.value,//
status: '1', // 1- startdate: tabActive.value === '待批改'? '' : getDateFormatDate(startEndDate.value[0]),
deaddate: tabActive.value === '待批改'? '' : getDateFormatDate(startEndDate.value[1]),
status: tabActive.value === '待批改'? '1' : '2', // 1-
// orderby: 'concat(deaddate,uniquekey) DESC', // orderby: 'concat(deaddate,uniquekey) DESC',
orderby: 'deaddate DESC', orderby: 'deaddate DESC',
pageSize: 100 pageSize: 100

View File

@ -427,7 +427,7 @@ import useUserStore from '@/store/modules/user'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
// import { Plus } from '@element-plus/icons-vue' // import { Plus } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from 'element-plus' import { ElMessageBox, ElMessage } from 'element-plus'
import { updateClassworkeval, updateClassworkdata, getClassworkdata, updateClassworkevalList } from '@/api/classTask' import { updateClassworkeval,updateClasswork, updateClassWorkDataAutoFinish, getClassworkdata, updateClassworkevalList } from '@/api/classTask'
import { getTimeDate } from '@/utils/date' import { getTimeDate } from '@/utils/date'
import ReFilePreview from '@/components/refile-preview/index.vue' import ReFilePreview from '@/components/refile-preview/index.vue'
import { quizStrToList } from '@/utils/comm'; import { quizStrToList } from '@/utils/comm';
@ -871,6 +871,13 @@ const onSubmit = () => {
}) })
return return
} }
/** 1、 更新当前作业是否已经批阅完成 */
// TODO updateClasswork
/** 2、 更新每个学生的批阅 */
var formd = { var formd = {
id: dialogProps.value.studentObj.id, // this.activeClassWork.id; id: dialogProps.value.studentObj.id, // this.activeClassWork.id;
@ -878,7 +885,7 @@ const onSubmit = () => {
updatedate: getTimeDate(),// = year+'-'+month+'-'+day+' '+hh+':'+mm; updatedate: getTimeDate(),// = year+'-'+month+'-'+day+' '+hh+':'+mm;
}; };
// //
updateClassworkdata(formd).then(res => { updateClassWorkDataAutoFinish(formd).then(res => {
}) })
// //

View File

@ -35,7 +35,7 @@
</span> </span>
</div> </div>
<!-- TODO 练习次数\引用次数 这里随便的假数据--> <!-- TODO 练习次数引用次数 这里随便的假数据-->
<div v-if=" tabactive == '已批改' " class="class-reserv-item-tool"> <div v-if=" tabactive == '已批改' " class="class-reserv-item-tool">
<span style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultsum }}</span> <span style="color:#000fff; font-weight: 900; font-size: 15px">{{ item.workdataresultsum }}</span>
<span>练习次数</span> <span>练习次数</span>