mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-356): Include filter details in export header
This commit is contained in:
@@ -219,11 +219,37 @@ const rekapitulasiData = (data: HppPerKandangReport['rows']) => {
|
|||||||
const getParameterText = (params: HppPerKandangExportParams['params']) => {
|
const getParameterText = (params: HppPerKandangExportParams['params']) => {
|
||||||
const paramsText = [];
|
const paramsText = [];
|
||||||
|
|
||||||
|
if (params.area_name && params.area_name !== 'Semua Area') {
|
||||||
|
paramsText.push(`Area: ${params.area_name}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.location_name && params.location_name !== 'Semua Lokasi') {
|
||||||
|
paramsText.push(`Lokasi: ${params.location_name}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.kandang_name && params.kandang_name !== 'Semua Kandang') {
|
||||||
|
paramsText.push(`Kandang: ${params.kandang_name}`);
|
||||||
|
}
|
||||||
|
|
||||||
if (params.period) {
|
if (params.period) {
|
||||||
const formattedDate = formatDate(params.period, 'DD MMM YYYY');
|
const formattedDate = formatDate(params.period, 'DD MMM YYYY');
|
||||||
paramsText.push(`Tanggal: ${formattedDate}`);
|
paramsText.push(`Tanggal: ${formattedDate}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.weight_min || params.weight_max) {
|
||||||
|
const weightRange =
|
||||||
|
params.weight_min && params.weight_max
|
||||||
|
? `${params.weight_min} - ${params.weight_max} kg`
|
||||||
|
: params.weight_min
|
||||||
|
? `≥ ${params.weight_min} kg`
|
||||||
|
: `≤ ${params.weight_max} kg`;
|
||||||
|
paramsText.push(`Rentang Bobot: ${weightRange}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.show_unrecorded === 'true') {
|
||||||
|
paramsText.push('Tampilkan: Tanpa Recording');
|
||||||
|
}
|
||||||
|
|
||||||
const currentDate = formatDate(new Date().toISOString(), 'DD MMM YYYY HH:mm');
|
const currentDate = formatDate(new Date().toISOString(), 'DD MMM YYYY HH:mm');
|
||||||
paramsText.push(`Dicetak: ${currentDate}`);
|
paramsText.push(`Dicetak: ${currentDate}`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user