|
@@ -1,6 +1,5 @@
|
|
|
import { reactive, computed, watch, ref, unref, isRef, nextTick } from 'vue'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
|
-import { numberToChinese } from '@/utils/common'
|
|
|
import { ExtractApiResponse } from 'api-type'
|
|
|
import type { Ref } from 'vue'
|
|
|
|
|
@@ -74,7 +73,7 @@ const useOptions = (types: (keyof DataModel)[], initModel?: DataModel | Ref<Data
|
|
|
})
|
|
|
|
|
|
const groupList = computed<Group[]>(() => {
|
|
|
- const groupList = mainQuestionInfo.value?.groupNumber
|
|
|
+ return mainQuestionInfo.value?.groupNumber
|
|
|
? Array.from({ length: mainQuestionInfo.value.groupNumber }).map((_, i) => {
|
|
|
return {
|
|
|
value: i + 1,
|
|
@@ -82,8 +81,10 @@ const useOptions = (types: (keyof DataModel)[], initModel?: DataModel | Ref<Data
|
|
|
}
|
|
|
})
|
|
|
: []
|
|
|
+ })
|
|
|
|
|
|
- return groupList?.length ? groupList.concat({ label: '全部', value: void 0 } as unknown as Group) : []
|
|
|
+ const groupListWithAll = computed(() => {
|
|
|
+ return groupList.value?.length ? [{ label: '全部', value: void 0 } as unknown as Group].concat(groupList.value) : []
|
|
|
})
|
|
|
|
|
|
watch(
|
|
@@ -172,6 +173,7 @@ const useOptions = (types: (keyof DataModel)[], initModel?: DataModel | Ref<Data
|
|
|
subjectList,
|
|
|
mainQuestionList,
|
|
|
groupList,
|
|
|
+ groupListWithAll,
|
|
|
dataModel,
|
|
|
initFinish,
|
|
|
onOptionInit,
|