|
@@ -5,21 +5,23 @@ import useOptions from '@/hooks/useOptions'
|
|
|
import useVW from '@/hooks/useVW'
|
|
|
import { getCurDayRange } from '@/utils/common'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
|
-
|
|
|
+import useDayList from '@/hooks/useDayList'
|
|
|
+import { getTodayByDay } from '@/utils/common'
|
|
|
import type { EpFormItem, EpFormRows } from 'global-type'
|
|
|
import type { ExtractApiParams } from '@/api/api'
|
|
|
|
|
|
type FormMode = Omit<
|
|
|
ExtractApiParams<'getStatisticsByGroup'>,
|
|
|
- 'endTime' | 'startTime' | 'hasGroupLeaderScore' | 'markingGroupNumber'
|
|
|
+ 'curDay' | 'hasGroupLeaderScore' | 'markingGroupNumber'
|
|
|
> & {
|
|
|
- time: string[]
|
|
|
+ curDay: string
|
|
|
hasGroupLeaderScore: string[]
|
|
|
expand: string[]
|
|
|
markingGroupNumber?: number | string
|
|
|
}
|
|
|
|
|
|
const useStatisticsFilter = () => {
|
|
|
+ // console.log('dayList:', dayList)
|
|
|
const {
|
|
|
subjectList,
|
|
|
mainQuestionList,
|
|
@@ -30,18 +32,25 @@ const useStatisticsFilter = () => {
|
|
|
isExpert,
|
|
|
isLeader,
|
|
|
} = useOptions(['subject', 'question', 'group'])
|
|
|
+
|
|
|
const curDayRange = getCurDayRange()
|
|
|
const model = reactive<any>({
|
|
|
subjectCode: dataModel.subject || '',
|
|
|
questionMainNumber: dataModel.question,
|
|
|
markingGroupNumber: dataModel.group,
|
|
|
- time: [curDayRange[0], curDayRange[1]],
|
|
|
+ // time: [curDayRange[0], curDayRange[1]],
|
|
|
+ curDay: getTodayByDay(),
|
|
|
// hasGroupLeaderScore: ['true'],
|
|
|
hasGroupLeaderScore: [],
|
|
|
expand: [],
|
|
|
markerId: '',
|
|
|
online: '',
|
|
|
})
|
|
|
+ const { dayOptions } = useDayList(dataModel)
|
|
|
+ watch(dayOptions, () => {
|
|
|
+ model.curDay = getTodayByDay()
|
|
|
+ })
|
|
|
+
|
|
|
const { fetch: getMarkerList, result: markerList } = useFetch('getMarkerList')
|
|
|
watch(
|
|
|
() => [model.subjectCode, model.questionMainNumber, model.markingGroupNumber],
|
|
@@ -61,9 +70,10 @@ const useStatisticsFilter = () => {
|
|
|
)
|
|
|
// const fetchModel = computed<ExtractApiParams<'getStatisticsByGroup'> & { expand: boolean }>(() => {
|
|
|
const fetchModel = computed<any>(() => {
|
|
|
- return Object.assign(omit(model, 'time'), {
|
|
|
- startTime: model.time?.[0],
|
|
|
- endTime: model.time?.[1],
|
|
|
+ return Object.assign(omit(model, 'curDay'), {
|
|
|
+ // startTime: model.time?.[0],
|
|
|
+ // endTime: model.time?.[1],
|
|
|
+ curDay: model.curDay,
|
|
|
hasGroupLeaderScore: model.hasGroupLeaderScore.length > 0,
|
|
|
expand: model.expand.length > 0,
|
|
|
// markingGroupNumber:
|
|
@@ -153,16 +163,25 @@ const useStatisticsFilter = () => {
|
|
|
labelWidth: '0px',
|
|
|
slotName: 'columns-setting',
|
|
|
}),
|
|
|
- TwoRowSpan8({
|
|
|
+ // TwoRowSpan8({
|
|
|
+ // labelWidth: '52px',
|
|
|
+ // label: '时间',
|
|
|
+ // slotType: 'dateTime',
|
|
|
+ // prop: 'time',
|
|
|
+ // slot: {
|
|
|
+ // type: 'datetimerange',
|
|
|
+ // valueFormat: 'YYYYMMDDHHmmss',
|
|
|
+ // startPlaceholder: '开始时间',
|
|
|
+ // endPlaceholder: '结束时间',
|
|
|
+ // },
|
|
|
+ // }),
|
|
|
+ TwoRowSpan4({
|
|
|
labelWidth: '52px',
|
|
|
label: '时间',
|
|
|
- slotType: 'dateTime',
|
|
|
- prop: 'time',
|
|
|
+ slotType: 'select',
|
|
|
+ prop: 'curDay',
|
|
|
slot: {
|
|
|
- type: 'datetimerange',
|
|
|
- valueFormat: 'YYYYMMDDHHmmss',
|
|
|
- startPlaceholder: '开始时间',
|
|
|
- endPlaceholder: '结束时间',
|
|
|
+ options: dayOptions.value,
|
|
|
},
|
|
|
}),
|
|
|
TwoRowSpan4({
|