lex 2 年之前
父节点
当前提交
55c5178ae8
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      src/school/orchestra/compontent/plan.tsx

+ 8 - 5
src/school/orchestra/compontent/plan.tsx

@@ -92,6 +92,7 @@ export default defineComponent({
 
 
     const onConfirmDate = (date: any) => {
     const onConfirmDate = (date: any) => {
       state.currentData = date.selectedValues
       state.currentData = date.selectedValues
+
       const year = Number(state.currentData[0]) + 1
       const year = Number(state.currentData[0]) + 1
       if (state.actionType === 'up') {
       if (state.actionType === 'up') {
         state.params.startTime = dayjs(year + startTime.value).format('YYYY-MM-DD HH:mm:ss')
         state.params.startTime = dayjs(year + startTime.value).format('YYYY-MM-DD HH:mm:ss')
@@ -149,12 +150,15 @@ export default defineComponent({
     }
     }
 
 
     onMounted(async () => {
     onMounted(async () => {
-      const sysStartTime = dayjs(dayjs().year() + startTime.value).format('YYYY-MM-DD HH:mm:ss')
-      const sysEndTime = dayjs(dayjs().year() + endTime.value).format('YYYY-MM-DD HH:mm:ss')
+      const sysStartTime = dayjs(dayjs().year() + startTime.value).format('YYYY-MM-DD')
+      const sysEndTime = dayjs(dayjs().year() + endTime.value).format('YYYY-MM-DD')
       const nowTime = dayjs().format('YYYY-MM-DD')
       const nowTime = dayjs().format('YYYY-MM-DD')
-      const before = dayjs(nowTime).isSameOrBefore(dayjs(sysStartTime))
-      const after = dayjs(nowTime).isSameOrBefore(dayjs(sysEndTime))
+      console.log(nowTime, sysStartTime)
+      const before = dayjs(nowTime).isBefore(dayjs(sysStartTime))
+      const after = dayjs(nowTime).isBefore(dayjs(sysEndTime))
       const year = dayjs().year()
       const year = dayjs().year()
+
+      // console.log(before, after, year)
       if (before && after) {
       if (before && after) {
         state.currentData = [year - 1 + '']
         state.currentData = [year - 1 + '']
         state.params.startTime = dayjs(year - 1 + startTime.value).format('YYYY-MM-DD HH:mm:ss')
         state.params.startTime = dayjs(year - 1 + startTime.value).format('YYYY-MM-DD HH:mm:ss')
@@ -191,7 +195,6 @@ export default defineComponent({
             item.color = ''
             item.color = ''
           }
           }
         })
         })
-
         state.currentData = [year - 1 + '']
         state.currentData = [year - 1 + '']
         state.actionText = '下学期'
         state.actionText = '下学期'
         state.actionType = 'up'
         state.actionType = 'up'