diff --git a/components.d.ts b/components.d.ts index 10084e6..3e50c9f 100644 --- a/components.d.ts +++ b/components.d.ts @@ -66,4 +66,7 @@ declare module 'vue' { YLPicker: typeof import('./src/components/YLPicker.vue')['default'] YLSelect: typeof import('./src/components/YLSelect.vue')['default'] } + export interface ComponentCustomProperties { + vLoading: typeof import('element-plus/es')['ElLoadingDirective'] + } } diff --git a/src/api/anslysis/index.ts b/src/api/anslysis/index.ts index ff693e7..14d7fea 100644 --- a/src/api/anslysis/index.ts +++ b/src/api/anslysis/index.ts @@ -3,12 +3,35 @@ import type { CycleProgressResponse } from "../types/response"; /** * - * @param sn 循环题组配额列表 + * @param sn 循环题组sn * @param params 可选的页数信息 */ -export function fetchCycleProgress (sn: string, params?: ParticalParams) { +export function cycleProgress (sn: string, params?: ParticalParams) { return request({ url: `console/survey_publishes/${sn}/cycle_progress_h5`, params }); } +/** + * 随机题组列表查询 + * @param sn 随机题组sn + * @param params 可选的页数信息 + */ +export function randomProgress (sn: string, params?: ParticalParams) { + return request({ + url: `console/survey_publishes/${sn}/random_progress_h5`, + params + }); +} +/** + * 逻辑配额列表查询 + * @param sn 逻辑配额sn + * @param params 可选的页数信息 + */ +export function quotaProgress (sn: string, params?: ParticalParams) { + return request({ + url: `console/survey_publishes/${sn}/publish_statistics_h5/quota_progress`, + params + }); +} + diff --git a/src/views/Survey/views/Analysis/components/LogicInfo/Index.vue b/src/views/Survey/views/Analysis/components/LogicInfo/Index.vue index 0b8cbf5..1679c79 100644 --- a/src/views/Survey/views/Analysis/components/LogicInfo/Index.vue +++ b/src/views/Survey/views/Analysis/components/LogicInfo/Index.vue @@ -1,32 +1,48 @@ - + diff --git a/src/views/Survey/views/Analysis/components/LogicInfo/hooks/useLogicInfo.ts b/src/views/Survey/views/Analysis/components/LogicInfo/hooks/useLogicInfo.ts index 1a1f616..6319d2e 100644 --- a/src/views/Survey/views/Analysis/components/LogicInfo/hooks/useLogicInfo.ts +++ b/src/views/Survey/views/Analysis/components/LogicInfo/hooks/useLogicInfo.ts @@ -1,14 +1,34 @@ -import { fetchCycleProgress } from "@/api/anslysis"; -import { ref } from "vue"; -import type { CycleProgressItem } from "../types/cycleProgress"; +import { cycleProgress, randomProgress, quotaProgress } from '@/api/anslysis'; +import { ref } from 'vue'; +import type { CycleProgressItem } from '../types/cycleProgress'; -const cycleProgress = ref([]) +const loading = ref(false); -async function fetchCycleProgressData (sn: string) { - const response = await fetchCycleProgress(sn) - console.log(response.data.data.cycle_progress); - - cycleProgress.value = response.data.data.cycle_progress +// 循环逻辑配额列表 +const cycle = ref([]); +// 随机题组配额列表 +const random = ref(); +// 逻辑配额 +const quota = ref(); + +async function updateDate(sn: string) { + loading.value = false; + // 获取逻辑配额相关数据 + let response = await quotaProgress(sn); + // console.log(response.data.data); + quota.value = response.data.data; + + + // 获取循环配额相关数据 + response = await cycleProgress(sn); + // console.log(response.data.data.cycle_progress); + cycle.value = response.data.data.cycle_progress; + + response = await randomProgress(sn); + // console.log(response.data.data.randomProgress); + random.value = response.data.data.randomProgress; + + loading.value = false; } -export { fetchCycleProgressData, cycleProgress } \ No newline at end of file +export { updateDate, cycle, loading }; \ No newline at end of file diff --git a/src/views/Survey/views/Analysis/components/types/logicInfo.d.ts b/src/views/Survey/views/Analysis/components/types/logicInfo.d.ts index d513755..3d312ae 100644 --- a/src/views/Survey/views/Analysis/components/types/logicInfo.d.ts +++ b/src/views/Survey/views/Analysis/components/types/logicInfo.d.ts @@ -1,3 +1,5 @@ type LogicInfoTab = { title: string, + props: unknown, + data: unknown } \ No newline at end of file