fix: 修正日报建议接口返回类型处理逻辑
Some checks failed
Lint Code / Lint Code (push) Failing after 1m35s

修复日报分析建议接口返回类型不一致的问题。当接口返回数组类型时,将其包装为包含 suggestions 字段的对象,以保持前端数据结构的统一性。
This commit is contained in:
2026-04-01 11:30:26 +08:00
parent dab86a40ff
commit 5363ec8342
2 changed files with 7 additions and 6 deletions

View File

@@ -369,11 +369,9 @@ export const getDailyReportAnalysisSuggestions = (params: {
reportDate?: string;
submitterUsername?: string;
}) => {
return http.request<Result<DailyReportAnalysisSuggestionsVO>>(
"get",
"/api/v1/daily-report/analysis/suggestions",
{ params }
);
return http.request<
Result<DailyReportAnalysisSuggestionsVO | DailyReportUpdateSuggestionVO[]>
>("get", "/api/v1/daily-report/analysis/suggestions", { params });
};
export type ApplyDailyReportSuggestionsRequest = {

View File

@@ -568,7 +568,10 @@ async function fetchDailyReportSuggestions() {
});
const result = res as any;
if (result.code === 200) {
dailyReportSuggestions.value = result.data || null;
const data = result.data;
dailyReportSuggestions.value = Array.isArray(data)
? { suggestions: data }
: data || null;
selectedSuggestionIds.value = [];
}
} catch (error) {