260205_01_ENH: 페이지 별 엑셀 다운로드 적용
This commit is contained in:
@@ -19,9 +19,10 @@ import {
|
||||
PRODUCTS,
|
||||
YEARS,
|
||||
AXIS_HIDE_STYLE,
|
||||
GRID_X_NOT_PADDING,
|
||||
GRID_X_NOT_PADDING, PRODUCT_KEY_MAP, LAST_YEAR,
|
||||
} from "@/const/lgConst";
|
||||
import { formatRowLabel } from "@/lib/lg-dashboard";
|
||||
import {buildHeader_ProductKeyMap, exportDashboardExcel} from "@/lib/lg-export-excel";
|
||||
|
||||
const PenetrationPage = () => {
|
||||
const { isTotal, filterValue, registerExcelExporter } = useLayoutFilter();
|
||||
@@ -73,7 +74,15 @@ const PenetrationPage = () => {
|
||||
|
||||
useEffect(() => {
|
||||
registerExcelExporter(async (payload) => {
|
||||
// TODO: export
|
||||
const excelHeader = buildHeader_ProductKeyMap(PRODUCT_KEY_MAP);
|
||||
|
||||
await exportDashboardExcel({
|
||||
fileName: `20${LAST_YEAR}년도 가전 보급률 Dashboard(보급률).xlsx`,
|
||||
sheetName: "전체 보급률",
|
||||
sections: [
|
||||
{ title: "전체 보급률", header: excelHeader, rows: apiTrendCategories, rowGap: 1 },
|
||||
],
|
||||
});
|
||||
});
|
||||
return () => registerExcelExporter(null);
|
||||
}, [registerExcelExporter]);
|
||||
|
||||
Reference in New Issue
Block a user