Эх сурвалжийг харах

人员对比页面的时间下拉列表的数据在部分角色情形下 没有请求的bug fix

刘洋 2 жил өмнө
parent
commit
afa61dd78c

+ 5 - 1
src/hooks/useDayList.ts

@@ -5,7 +5,7 @@ import { getTodayByDay } from '@/utils/common'
 const useDayOptions = (dataModel: any) => {
   const dayList = ref([])
   const today = getTodayByDay()
-  watch([() => dataModel.subject, () => dataModel.question], (a: any, b: any) => {
+  function fetchDayList() {
     if (dataModel.subject && dataModel.question) {
       useFetch('getDayList')
         .fetch({ subjectCode: dataModel.subject, questionMainNumber: dataModel.question })
@@ -15,7 +15,11 @@ const useDayOptions = (dataModel: any) => {
             .map((item: any) => ({ label: item.value, value: item.key }))
         })
     }
+  }
+  watch([() => dataModel.subject, () => dataModel.question], (a: any, b: any) => {
+    fetchDayList()
   })
+  fetchDayList()
 
   const dayOptions = computed(() => [{ label: '当天', value: today }, { label: '全部', value: '' }, ...dayList.value])
   return {