/** * Project Master Overseas Inquiries JS * 기능: 문의사항 로드, 필터링, 답변 관리, 아코디언 및 이미지 모달 */ // --- 초기화 --- async function loadInquiries() { initStickyHeader(); const pmType = document.getElementById('filterPmType').value; const category = document.getElementById('filterCategory').value; const status = document.getElementById('filterStatus').value; const keyword = document.getElementById('searchKeyword').value; const params = new URLSearchParams({ pm_type: pmType, category: category, keyword: keyword }); try { const response = await fetch(`${API.INQUIRIES}?${params}`); const data = await response.json(); updateStats(data); const filteredData = status ? data.filter(item => item.status === status) : data; renderInquiryList(filteredData); } catch (e) { console.error("데이터 로딩 중 오류 발생:", e); } } function initStickyHeader() { const header = document.getElementById('stickyHeader'); const thead = document.querySelector('.inquiry-table thead'); if (header && thead) { const headerHeight = header.offsetHeight; const totalOffset = 36 + headerHeight; document.querySelectorAll('.inquiry-table thead th').forEach(th => { th.style.top = totalOffset + 'px'; }); } } function renderInquiryList(data) { const tbody = document.getElementById('inquiryList'); tbody.innerHTML = data.map(item => `