Add multi-office seat maps and dev/prod DB sync protocol

This commit is contained in:
hyunho
2026-03-27 16:34:43 +09:00
parent 1d15cf9b9b
commit d66614123e
16 changed files with 3427 additions and 146 deletions

View File

@@ -101,8 +101,8 @@ const APP_BASE_URL = String(window.__MH_BASE_URL || "").replace(/\/$/, "");
const seatMapOffices = [
{ key: "technical-development-center", label: "기술개발센터", ready: true },
{ key: "hanmac-building-7f", label: "한맥빌딩 7층", ready: false },
{ key: "hanmac-building-6f", label: "한맥빌딩 6층", ready: false },
{ key: "hanmac-building-6f", label: "한맥빌딩 6층", ready: true },
{ key: "hanmac-building-7f", label: "한맥빌딩 7층", ready: true },
];
const viewLabels = {
@@ -148,7 +148,7 @@ const seatMapState = {
forceReadOnly: false,
};
let currentView = "organization";
let currentView = "project";
const globalDateState = {
loaded: true,
startDate: "2026-01-01",
@@ -1168,22 +1168,7 @@ async function loadSeatMapData(force = false) {
try {
const office = getCurrentSeatMapOffice();
if (!office.ready) {
const membersPayload = await fetchJson("/api/members");
seatMapState.seatMap = null;
seatMapState.members = Array.isArray(membersPayload.items) ? membersPayload.items : [];
seatMapState.slots = [];
seatMapState.placements = [];
seatMapState.zoom = 1;
seatMapState.hoveredSlotId = null;
seatMapState.editMode = canEditSeatMap();
resetSeatMapDraft();
seatMapState.loaded = true;
setSeatMapStatus(`${office.label} 도면은 아직 등록 전입니다.`, "info");
renderSeatMap();
return;
}
const activePayload = await fetchJson("/api/seat-maps/active");
const activePayload = await fetchJson(`/api/seat-maps/active?office_key=${encodeURIComponent(office.key)}`);
const activeSeatMap = activePayload.item;
const layoutPayload = await fetchJson(`/api/seat-maps/${activeSeatMap.id}/layout`);
seatMapState.seatMap = {
@@ -1479,12 +1464,10 @@ if (loginForm) {
body: formData,
});
setSession(payload);
setActiveView("project");
loginForm.reset();
loginMessage.textContent = "";
renderAuth();
if (currentView === "seatmap-admin" || currentView === "seatmap-readonly") {
await loadSeatMapData(true);
}
} catch (error) {
loginMessage.textContent = error.message || "로그인에 실패했습니다.";
}

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MH 조직현황 대시보드</title>
<title>MH 대시보드-공개용</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pretendard:wght@400;600;700;900&display=swap" rel="stylesheet">