From a91e6792bca36e79986d28a8c219cac4e106abcf Mon Sep 17 00:00:00 2001 From: Huangzhe Date: Wed, 14 May 2025 15:03:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=A1=E6=81=AF=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD=E6=9B=B4=E6=96=B0=EF=BC=9A=201.=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20LogicInfo=20=E7=BB=84=E4=BB=B6=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=202.=20=E5=AE=8C=E5=96=84=20useLogicInfo=20=E9=92=A9?= =?UTF-8?q?=E5=AD=90=E5=87=BD=E6=95=B0=203.=20=E6=9B=B4=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=A1=E6=81=AF=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=204.=20=E4=BC=98=E5=8C=96=E5=88=86=E6=9E=90=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=20API=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 3 ++ src/api/anslysis/index.ts | 27 +++++++++- .../Analysis/components/LogicInfo/Index.vue | 54 ++++++++++++------- .../LogicInfo/hooks/useLogicInfo.ts | 40 ++++++++++---- .../Analysis/components/types/logicInfo.d.ts | 2 + 5 files changed, 95 insertions(+), 31 deletions(-) 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