diff --git a/frontend/src/core/reject-history-filters.js b/frontend/src/core/reject-history-filters.js index de7b49f..fcfc45b 100644 --- a/frontend/src/core/reject-history-filters.js +++ b/frontend/src/core/reject-history-filters.js @@ -175,6 +175,7 @@ export function buildViewParams(queryId, { detailReason = '', page = 1, perPage = 50, + policyFilters = {}, } = {}) { const params = { query_id: queryId }; if (supplementaryFilters.packages?.length > 0) { @@ -197,5 +198,16 @@ export function buildViewParams(queryId, { } params.page = page || 1; params.per_page = perPage || 50; + + // Policy filters (applied in-memory on cached data) + if (policyFilters.includeExcludedScrap) { + params.include_excluded_scrap = 'true'; + } + if (policyFilters.excludeMaterialScrap === false) { + params.exclude_material_scrap = 'false'; + } + if (policyFilters.excludePbDiode === false) { + params.exclude_pb_diode = 'false'; + } return params; } diff --git a/frontend/src/reject-history/App.vue b/frontend/src/reject-history/App.vue index f888155..1747479 100644 --- a/frontend/src/reject-history/App.vue +++ b/frontend/src/reject-history/App.vue @@ -242,6 +242,11 @@ async function refreshView() { detailReason: detailReason.value, page: page.value, perPage: DEFAULT_PER_PAGE, + policyFilters: { + includeExcludedScrap: committedPrimary.includeExcludedScrap, + excludeMaterialScrap: committedPrimary.excludeMaterialScrap, + excludePbDiode: committedPrimary.excludePbDiode, + }, }); const resp = await apiGet('/api/reject-history/view', { @@ -468,6 +473,11 @@ async function exportCsv() { for (const date of selectedTrendDates.value) params.append('trend_dates', date); if (detailReason.value) params.set('detail_reason', detailReason.value); + // Policy filters (applied in-memory on cached data) + if (committedPrimary.includeExcludedScrap) params.set('include_excluded_scrap', 'true'); + if (!committedPrimary.excludeMaterialScrap) params.set('exclude_material_scrap', 'false'); + if (!committedPrimary.excludePbDiode) params.set('exclude_pb_diode', 'false'); + const response = await fetch(`/api/reject-history/export-cached?${params.toString()}`); if (response.status === 410) { diff --git a/frontend/src/reject-history/components/FilterPanel.vue b/frontend/src/reject-history/components/FilterPanel.vue index e5b4e6b..7b188c6 100644 --- a/frontend/src/reject-history/components/FilterPanel.vue +++ b/frontend/src/reject-history/components/FilterPanel.vue @@ -173,6 +173,11 @@ function emitSupplementary(patch) { class="card-body resolution-info" > 已解析 {{ resolutionInfo.resolved_count }} 筆容器 +