diff --git a/resources/views/juil/bim-viewer.blade.php b/resources/views/juil/bim-viewer.blade.php index 80441550..cbf52bb4 100644 --- a/resources/views/juil/bim-viewer.blade.php +++ b/resources/views/juil/bim-viewer.blade.php @@ -579,33 +579,48 @@ class BimScene { React Components ════════════════════════════════════════════════ */ -function BimSidebar() { +const PMIS_MENUS = [ + { icon: 'ri-building-2-line', label: 'BIM 관리', id: 'bim', children: [ + { label: 'BIM 뷰어', id: 'bim-viewer', url: '/juil/construction-pmis/bim-viewer' }, + ]}, + { icon: 'ri-line-chart-line', label: '시공관리', id: 'construction', children: [ + { label: '인원관리', id: 'workforce', url: '/juil/construction-pmis/workforce' }, + { label: '장비관리', id: 'equipment', url: '/juil/construction-pmis/equipment' }, + { label: '자재관리', id: 'materials', url: '/juil/construction-pmis/materials' }, + { label: '공사량관리', id: 'work-volume', url: '/juil/construction-pmis/work-volume' }, + { label: '출면일보', id: 'daily-attendance', url: '/juil/construction-pmis/daily-attendance' }, + { label: '작업일보', id: 'daily-report', url: '/juil/construction-pmis/daily-report' }, + ]}, + { icon: 'ri-file-list-3-line', label: '품질관리', id: 'quality', children: [ + { label: '시정조치', id: 'corrective-action', url: '/juil/construction-pmis/corrective-action' }, + ]}, + { icon: 'ri-shield-check-line', label: '안전관리', id: 'safety', children: [ + { label: '안전보건교육', id: 'safety-education', url: '/juil/construction-pmis/safety-education' }, + { label: 'TBM현장', id: 'tbm', url: '/juil/construction-pmis/tbm' }, + { label: '위험성 평가', id: 'risk-assessment', url: '/juil/construction-pmis/risk-assessment' }, + { label: '재해예방조치', id: 'disaster-prevention', url: '/juil/construction-pmis/disaster-prevention' }, + ]}, + { icon: 'ri-folder-line', label: '자료실', id: 'archive', children: [ + { label: '자료보관함', id: 'archive-files', url: '/juil/construction-pmis/archive-files' }, + { label: '매뉴얼', id: 'archive-manual', url: '/juil/construction-pmis/archive-manual' }, + { label: '공지사항', id: 'archive-notice', url: '/juil/construction-pmis/archive-notice' }, + ]}, +]; + +function PmisSidebar({ activePage }) { const [profile, setProfile] = useState(null); + const [expanded, setExpanded] = useState(() => { + for (const m of PMIS_MENUS) { + if (m.children?.some(c => c.id === activePage)) return m.id; + } + return null; + }); + useEffect(() => { fetch('/juil/construction-pmis/profile', { headers: { Accept: 'application/json' } }) .then(r => r.json()).then(d => setProfile(d.worker)).catch(() => {}); }, []); - const menus = [ - { icon: 'ri-building-2-line', label: 'BIM 관리', active: true, children: [{ label: 'BIM 뷰어', active: true }] }, - { icon: 'ri-line-chart-line', label: '시공관리', children: [ - { label: '인원관리', url: '/juil/construction-pmis/workforce' }, - { label: '장비관리', url: '/juil/construction-pmis/equipment' }, - { label: '자재관리', url: '/juil/construction-pmis/materials' }, - { label: '공사량관리', url: '/juil/construction-pmis/work-volume' }, - { label: '출면일보', url: '/juil/construction-pmis/daily-attendance' }, - { label: '작업일보', url: '/juil/construction-pmis/daily-report' }, - ]}, - { icon: 'ri-file-list-3-line', label: '품질관리', id: 'quality', children: [ - { label: '시정조치', id: 'corrective-action', url: '/juil/construction-pmis/corrective-action' }, - ]}, - { icon: 'ri-shield-check-line', label: '안전관리', id: 'safety', children: [ - { label: '안전보건교육', id: 'safety-education', url: '/juil/construction-pmis/safety-education' }, - { label: 'TBM현장', id: 'tbm', url: '/juil/construction-pmis/tbm' }, - { label: '위험성 평가', id: 'risk-assessment', url: '/juil/construction-pmis/risk-assessment' }, - { label: '재해예방조치', id: 'disaster-prevention', url: '/juil/construction-pmis/disaster-prevention' }, - ]}, - { icon: 'ri-folder-line', label: '자료실' }, - ]; + return (
@@ -613,22 +628,27 @@ function BimSidebar() {
- {profile?.profile_photo_path ? : } + {profile?.profile_photo_path + ? + : }
{profile?.name || '...'}
{profile?.department || ''}
- {menus.map(m => ( -
-
+ {PMIS_MENUS.map(m => ( +
+
setExpanded(expanded === m.id ? null : m.id)} + className={`flex items-center gap-2 px-4 py-2.5 text-sm cursor-pointer transition ${expanded === m.id ? 'bg-blue-50 text-blue-700 font-semibold' : 'text-gray-600 hover:bg-gray-50'}`}> {m.label} - +
- {m.active && m.children?.map(c => ( -
+ {expanded === m.id && m.children?.map(c => ( + {c.label} -
+ ))}
))} @@ -888,7 +908,7 @@ function BimViewerApp() { return (
- +