feat: 권한 탭 분리 + 부서 인원 표시 + 다수 시스템 개선
- tkuser: 권한 관리를 별도 탭으로 분리, 부서 클릭 시 소속 인원 목록 표시 - system1: 모바일 UI 개선, nginx 권한 보정, 신고 카테고리 타입 마이그레이션 - system2: 신고 상세/보고서 개선, 내 보고서 페이지 추가 - system3: 이슈 뷰/수신함/관리함 개선 - gateway: 포털 라우팅 수정 - user-management API: 부서별 권한 벌크 설정 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,8 +33,21 @@ function showToast(msg, type = 'success') {
|
||||
}
|
||||
|
||||
/* ===== Helpers ===== */
|
||||
const DEPT = { production:'생산', quality:'품질', purchasing:'구매', design:'설계', sales:'영업' };
|
||||
function deptLabel(d) { return DEPT[d] || d || ''; }
|
||||
const DEPT_FALLBACK = { production:'생산', quality:'품질', purchasing:'구매', design:'설계', sales:'영업' };
|
||||
let departmentsCache = [];
|
||||
async function loadDepartmentsCache() {
|
||||
try {
|
||||
const r = await api('/departments');
|
||||
departmentsCache = (r.data || r).filter(d => d.is_active !== 0 && d.is_active !== false);
|
||||
} catch(e) { console.warn('부서 캐시 로드 실패:', e); }
|
||||
}
|
||||
function deptLabel(d, deptId) {
|
||||
if (deptId && departmentsCache.length) {
|
||||
const dept = departmentsCache.find(x => x.department_id === deptId);
|
||||
if (dept) return dept.department_name;
|
||||
}
|
||||
return DEPT_FALLBACK[d] || d || '';
|
||||
}
|
||||
function formatDate(d) { if (!d) return ''; return d.substring(0, 10); }
|
||||
function escHtml(s) { if (!s) return ''; const d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
|
||||
|
||||
@@ -64,6 +77,7 @@ async function init() {
|
||||
if (currentUser.role === 'admin') {
|
||||
document.getElementById('tabNav').classList.remove('hidden');
|
||||
document.getElementById('adminSection').classList.remove('hidden');
|
||||
await loadDepartmentsCache();
|
||||
await loadUsers();
|
||||
} else {
|
||||
document.getElementById('passwordChangeSection').classList.remove('hidden');
|
||||
|
||||
Reference in New Issue
Block a user