refactor: 优化问卷列表和详情功能

1. 添加 formatTime 工具函数,支持日期格式化
2. 重命名搜索处理函数 blurs 为 handleSearchClick,提高可读性
3. 更新问卷项数据字段,使用 answer_num_h5 和 recycle_progress_h5
4. 优化问卷场景名称处理逻辑,增加默认值
5. 完善 SurveyItem 类型定义,添加缺失的字段类型
This commit is contained in:
Huangzhe
2025-05-23 19:03:11 +08:00
parent 77f5fc10a4
commit d84badc63d
5 changed files with 52 additions and 37 deletions

View File

@@ -35,8 +35,8 @@ async function fetchSurveys(form: any) {
total.value = res.data.meta.total;
survey.value.forEach((item) => {
const sceneName = JSON.parse(JSON.stringify(item.scene_name));
const nameList = sceneName ? sceneName?.split('-') : ['其他', '未知问卷'];
const nameList = sceneName ? sceneName.split('-') : [];
if (nameList.length > 0) {
item.scene_name = nameList[1] ? nameList[1] : nameList[0];
}
@@ -51,7 +51,6 @@ async function fetchSurveys(form: any) {
if (survey.value.length >= total.value) {
finished.value = true;
}
} else {
// Toast()
}