Files
tk-factory-services/system1-factory/web/static/js/shared-bottom-nav.js
Hyungi Ahn cf75462380 feat(purchase): 소모품 신청 시스템 v2 — 모바일 최적화, 스마트 검색, 그룹화, 입고 알림
- 4단계 상태 플로우: pending → grouped → purchased → received
- 한국어 스마트 검색: 초성 매칭(ㅁㅈㄱ→면장갑), 별칭 테이블, 인메모리 캐시
- 모바일 전용 신청 페이지: 바텀시트 UI, FAB, 카드 리스트, 스크롤 페이지네이션
- 인라인 품목 등록: 미등록 품목 검색→등록→신청 단일 트랜잭션
- 관리자 그룹화: 체크박스 다중 선택, 구매 그룹(batch) 생성/일괄 구매/입고
- 입고 처리: 사진+보관위치 등록, 부분 입고 허용, batch 자동 상태 전환
- 알림: notifyHelper에 target_user_ids 추가, 구매진행중/입고완료 시 신청자 ntfy+push

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:21:20 +09:00

45 lines
2.1 KiB
JavaScript

/**
* shared-bottom-nav.js — 하단 네비게이션 공유 컴포넌트
* 각 페이지에서 <script src="/static/js/shared-bottom-nav.js"></script> 로드하면 자동 생성
*/
(function() {
var SVG_ATTR = 'viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"';
var NAV_ITEMS = [
{
href: '/pages/dashboard-new.html',
label: '홈',
icon: '<svg ' + SVG_ATTR + '><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>'
},
{
href: '/pages/work/tbm-mobile.html',
label: 'TBM',
icon: '<svg ' + SVG_ATTR + '><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>'
},
{
href: '/pages/work/report-create-mobile.html',
label: '작업보고',
icon: '<svg ' + SVG_ATTR + '><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>'
},
{
href: '/pages/purchase/request-mobile.html',
label: '소모품',
icon: '<svg ' + SVG_ATTR + '><path d="M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z"/><line x1="3" y1="6" x2="21" y2="6"/><path d="M16 10a4 4 0 0 1-8 0"/></svg>'
},
{
href: '/pages/attendance/my-vacation-info.html',
label: '연차관리',
icon: '<svg ' + SVG_ATTR + '><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/><path d="M9 16l2 2 4-4"/></svg>'
}
];
var currentPath = location.pathname;
var nav = document.createElement('nav');
nav.className = 'm-bottom-nav';
nav.innerHTML = NAV_ITEMS.map(function(item) {
var active = currentPath === item.href ? ' active' : '';
return '<a href="' + item.href + '" class="m-nav-item' + active + '">'
+ item.icon + '<span class="m-nav-label">' + item.label + '</span></a>';
}).join('');
document.body.appendChild(nav);
})();