修复日报分析建议接口返回类型不一致的问题。当接口返回数组类型时,将其包装为包含 suggestions 字段的对象,以保持前端数据结构的统一性。
This commit is contained in:
@@ -369,11 +369,9 @@ export const getDailyReportAnalysisSuggestions = (params: {
|
|||||||
reportDate?: string;
|
reportDate?: string;
|
||||||
submitterUsername?: string;
|
submitterUsername?: string;
|
||||||
}) => {
|
}) => {
|
||||||
return http.request<Result<DailyReportAnalysisSuggestionsVO>>(
|
return http.request<
|
||||||
"get",
|
Result<DailyReportAnalysisSuggestionsVO | DailyReportUpdateSuggestionVO[]>
|
||||||
"/api/v1/daily-report/analysis/suggestions",
|
>("get", "/api/v1/daily-report/analysis/suggestions", { params });
|
||||||
{ params }
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ApplyDailyReportSuggestionsRequest = {
|
export type ApplyDailyReportSuggestionsRequest = {
|
||||||
|
|||||||
@@ -568,7 +568,10 @@ async function fetchDailyReportSuggestions() {
|
|||||||
});
|
});
|
||||||
const result = res as any;
|
const result = res as any;
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
dailyReportSuggestions.value = result.data || null;
|
const data = result.data;
|
||||||
|
dailyReportSuggestions.value = Array.isArray(data)
|
||||||
|
? { suggestions: data }
|
||||||
|
: data || null;
|
||||||
selectedSuggestionIds.value = [];
|
selectedSuggestionIds.value = [];
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user