feat(tkpurchase/tkuser): 사이드바에 협력업체 관리 외부 링크 추가 + tkuser ?tab= 라우팅

tkpurchase 사이드바에 tkuser 협력업체 관리 페이지로 이동하는 링크 추가.
tkuser에 URL ?tab= 파라미터 기반 탭 자동 전환 지원 (화이트리스트 + replaceState).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-16 07:37:44 +09:00
parent 54bb26dbd6
commit 5398581b87
12 changed files with 36 additions and 13 deletions

View File

@@ -133,7 +133,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-accounts.js?v=2026031601"></script>
<script>initAccountsPage();</script>
</body>

View File

@@ -148,7 +148,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-daylabor.js?v=2026031601"></script>
<script>initDayLaborPage();</script>
</body>

View File

@@ -88,7 +88,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-dashboard.js?v=2026031601"></script>
<script>initDashboard();</script>
</body>

View File

@@ -61,7 +61,7 @@
<div id="historyPagination" class="mt-4 flex justify-center gap-2"></div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-partner-history.js?v=2026031601"></script>
<script>initPartnerHistory();</script>
</body>

View File

@@ -81,7 +81,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-partner-portal.js?v=2026031601"></script>
<script>initPartnerPortal();</script>
</body>

View File

@@ -294,7 +294,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-partner.js?v=2026031601"></script>
<script>initPartnerPage();</script>
</body>

View File

@@ -275,7 +275,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-schedule.js?v=2026031601"></script>
<script>initSchedulePage();</script>
</body>

View File

@@ -109,6 +109,11 @@ function toggleMobileMenu() {
document.body.style.overflow = open ? 'hidden' : '';
}
/* ===== tkuser URL ===== */
const _tkuserBase = location.hostname.includes('technicalkorea.net')
? 'https://tkuser.technicalkorea.net'
: `http://${location.hostname}:30380`;
/* ===== Navbar ===== */
function renderNavbar() {
const currentPage = location.pathname.replace(/\//g, '') || 'index.html';
@@ -119,13 +124,15 @@ function renderNavbar() {
{ href: '/workreport.html', icon: 'fa-clipboard-list', label: '업무현황', match: ['workreport.html'] },
{ href: '/workreport-summary.html', icon: 'fa-chart-bar', label: '업무 종합', match: ['workreport-summary.html'] },
{ href: '/accounts.html', icon: 'fa-user-shield', label: '계정 관리', match: ['accounts.html'] },
{ href: `${_tkuserBase}/?tab=partners`, icon: 'fa-truck', label: '협력업체 관리', external: true },
];
const nav = document.getElementById('sideNav');
if (!nav) return;
nav.innerHTML = links.map(l => {
const active = l.match.some(m => currentPage === m || currentPage.endsWith(m));
const active = l.match && l.match.some(m => currentPage === m || currentPage.endsWith(m));
const extIcon = l.external ? ' <i class="fas fa-external-link-alt text-xs opacity-50"></i>' : '';
return `<a href="${l.href}" class="nav-link flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm transition-colors ${active ? 'active' : 'text-gray-600 hover:bg-gray-100'}">
<i class="fas ${l.icon} w-5 text-center"></i><span>${l.label}</span></a>`;
<i class="fas ${l.icon} w-5 text-center"></i><span>${l.label}${extIcon}</span></a>`;
}).join('');
// 모바일: nav-link 클릭 시 메뉴 닫기
nav.querySelectorAll('.nav-link').forEach(a => {

View File

@@ -100,7 +100,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-workreport-summary.js?v=2026031601"></script>
<script>initSummaryPage();</script>
</body>

View File

@@ -114,7 +114,7 @@
</div>
</div>
<script src="/static/js/tkpurchase-core.js?v=2026031601"></script>
<script src="/static/js/tkpurchase-core.js?v=2026031602"></script>
<script src="/static/js/tkpurchase-workreport.js?v=2026031601"></script>
<script>initWorkReportPage();</script>
</body>

View File

@@ -1997,7 +1997,7 @@
</div>
<!-- JS: Core (config, token, api, toast, helpers, init) -->
<script src="/static/js/tkuser-core.js?v=2026031401"></script>
<script src="/static/js/tkuser-core.js?v=2026031601"></script>
<!-- JS: Tabs -->
<script src="/static/js/tkuser-tabs.js?v=2026031401"></script>
<!-- JS: Individual modules -->

View File

@@ -186,7 +186,23 @@ async function init() {
// 알림 벨 로드
_loadNotificationBell();
setTimeout(() => document.querySelectorAll('.fade-in').forEach(el => el.classList.add('visible')), 50);
setTimeout(() => {
document.querySelectorAll('.fade-in').forEach(el => el.classList.add('visible'));
// URL ?tab= 파라미터로 탭 자동 전환 (화이트리스트 + URL 정리)
const ALLOWED_TABS = ['users','projects','workplaces','workers','departments',
'permissions','issueTypes','tasks','vacations','partners','vendors',
'consumables','notificationRecipients'];
const urlTab = new URLSearchParams(location.search).get('tab');
if (urlTab && ALLOWED_TABS.includes(urlTab)) {
const tabBtn = document.querySelector(`.tab-btn[onclick*="switchTab('${urlTab}')"]`);
if (tabBtn && tabBtn.style.display !== 'none') {
tabBtn.click();
const url = new URL(location);
url.searchParams.delete('tab');
history.replaceState(null, '', url);
}
}
}, 50);
}
/* ===== 알림 벨 ===== */