From ddd53943b88f3f3896889e536927c584e938363c Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 18 Sep 2024 09:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=83=E7=BD=AE=E4=BD=9C=E4=B8=9A-=E6=88=AA?= =?UTF-8?q?=E6=AD=A2=E6=97=B6=E9=97=B4=E9=BB=98=E8=AE=A4=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/set-homework/index.vue | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) 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') }) -- 2.44.0.windows.1