fix: 修复主页数据展示问题

1. 优化 MineTask 组件的数据展示逻辑
2. 修复 TypeScript 类型错误
3. 移除冗余的 SurveyAnalysis 组件引用
4. 清理未使用的样式和代码
This commit is contained in:
Huangzhe
2025-05-19 10:23:22 +08:00
parent 2af5c350ee
commit d362b4a7a4
5 changed files with 25 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
import { getSurveysDetail } from '@/api/design';
import { getSurveysPage } from '@/api/home';
import { surveyAnalysis } from '@/api/survey';
import { ref, type Ref } from 'vue';
// 异步函数获取数据
@@ -37,4 +38,16 @@ function fetchSingleSurvey(sn: string) {
return { currentSurvey };
}
export { fetchSurveys, fetchSingleSurvey };
function useFetchAnalysis(sn: string) {
const questionAnalysis = ref();
surveyAnalysis(sn).then(({ data }) => {
questionAnalysis.value = data.data;
});
return {
questionAnalysis
};
}
export { fetchSurveys, fetchSingleSurvey, useFetchAnalysis };