diff --git a/src/renderer/src/components/set-homework/index.vue b/src/renderer/src/components/set-homework/index.vue index 7518cf2..abfb4d1 100644 --- a/src/renderer/src/components/set-homework/index.vue +++ b/src/renderer/src/components/set-homework/index.vue @@ -10,13 +10,13 @@
- + - + {{ tag.name }} @@ -53,6 +53,7 @@ import { ElMessage } from 'element-plus' import { listClassmain, listClassgroup } from '@/api/classManage/index' import { saveByClassWorkArray } from '@/api/teaching/classwork' import useUserStore from '@/store/modules/user' +import { getCurrentTime } from '@/utils/date' import { uniqBy, groupBy } from 'lodash' const model = defineModel({ type: Boolean, default: false }) @@ -233,7 +234,7 @@ const onSubmit = (formEl) => { timelength: form.timelength, weights: 1, deaddate: form.deaddate, - workdate: getCurrentDate(), + workdate: getCurrentTime('YYYY-MM-DD'), uniquekey: props.row.uniquekey, entpcourseworklist: '[' + props.row.entpcourseworklist + ']', needMsgNotifine: 'false', @@ -275,24 +276,10 @@ const cloneDialog = (formEl) => { formEl.resetFields() model.value = false } -// 获取当前年月日 -const getCurrentDate = () => { - const now = new Date() - const year = now.getFullYear() - let month = now.getMonth() + 1 // 月份是从0开始的,所以需要+1 - let day = now.getDate() - if (month < 10) { - month = '0' + month - } - if (day < 10) { - day = '0' + day - } - return `${year}-${month}-${day}` -} onMounted(() => { // 默认当前 - form.deaddate = getCurrentDate() + ' ' + '10:00:00' + form.deaddate = getCurrentTime('YYYY-MM-DD HH:mm') })