[260210]
- 테이블 모드 추가 - 상품 선택하여 엑셀로 견적 내기 기능 추가. - 데이터는 세션 스토리지에 저장
This commit is contained in:
@@ -4,14 +4,24 @@ import { STATUS_META } from './config.js';
|
||||
|
||||
export const productsData = products;
|
||||
|
||||
// 초기 로드 시 세션 스토리지에서 선택 내역 불러오기
|
||||
const savedIds = JSON.parse(sessionStorage.getItem('selectedProductIds') || '[]');
|
||||
|
||||
export const state = {
|
||||
currentPage: 1,
|
||||
activeCategories: new Set(['All']),
|
||||
visibleProducts: [...products],
|
||||
searchKeyword: '',
|
||||
viewMode: 'grid', // 기본값
|
||||
selectedIds: new Set(savedIds),
|
||||
activeStatuses: new Set(
|
||||
Object.entries(STATUS_META)
|
||||
.filter(([_, meta]) => meta.defaultVisible)
|
||||
.map(([status]) => status),
|
||||
),
|
||||
};
|
||||
|
||||
// 선택 내역이 변경될 때마다 세션 스토리지에 저장하는 헬퍼 함수
|
||||
export function saveSelection() {
|
||||
sessionStorage.setItem('selectedProductIds', JSON.stringify(Array.from(state.selectedIds)));
|
||||
}
|
||||
Reference in New Issue
Block a user