feat(project): meeting header with plan, notes and quick task table
Three header areas that stay visible while the table scrolls: month plan with the four numbers in one compact line, decisions/notes, and a task table (title, assignee, project, section) whose cells open pick lists; Apply creates the task in that project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+53
-3
@@ -2482,7 +2482,58 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
|
||||
/* 머리 — 왼쪽: 제목·인쇄·삭제 … 주차 탭(달력 쪽 끝) + 이 달 계획(달력 앞까지) / 오른쪽 위: 작은 달력(폭 174px, 글자 10.5px) */
|
||||
.pj-meet-headgrid { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 12px; }
|
||||
.pj-meet-headleft { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
|
||||
.pj-meet-headleft > .pj-meet-plan { margin: 0; }
|
||||
/* 머리 영역 3칸(2026-10-07) — ① 월 계획 + 숫자 한 줄 ② 결정 사항·메모 ③ 작업 등록. 머리는 스크롤되지 않아 늘 보인다 */
|
||||
.pj-meet-board { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr) minmax(0, 1.35fr); gap: 10px; }
|
||||
@media (max-width: 1500px) { .pj-meet-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pj-meet-quick { grid-column: 1 / -1; } }
|
||||
.pj-meet-area {
|
||||
display: flex; flex-direction: column; min-width: 0; height: 230px; margin: 0; padding: 8px 10px;
|
||||
border: 1px solid var(--pj-border); border-radius: 10px; background: #fff;
|
||||
}
|
||||
.pj-meet-area h3, .pj-meet-area.pj-meet-notes h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
|
||||
.pj-meet-area.pj-meet-notes { margin: 0; } /* 예전 .pj-meet-notes 여백(16px) 덮기 */
|
||||
.pj-meet-area h3 small { margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--pj-ink-soft); }
|
||||
.pj-meet-area-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
|
||||
.pj-meet-area.pj-meet-notes textarea, .pj-meet-area.pj-meet-notes .pj-meet-ro {
|
||||
flex: 1 1 auto; min-height: 0; max-height: none; height: auto !important; overflow-y: auto; padding: 8px 10px;
|
||||
border: 1px solid #dfe2e6; border-radius: 8px; background: #fff;
|
||||
}
|
||||
/* ① 머리 줄 — 제목 + 숫자 4개(작게 한 줄) */
|
||||
.pj-meet-plan-title { display: inline-flex; align-items: center; gap: 6px; flex: none; }
|
||||
.pj-meet-kpiline {
|
||||
display: flex; align-items: baseline; gap: 10px; flex: 1 1 0; flex-wrap: nowrap; min-width: 0; margin-left: 10px;
|
||||
font-size: 11px; overflow: hidden; white-space: nowrap; /* 늘 1행 — 좁으면 끝이 가려지고 말풍선으로 */
|
||||
}
|
||||
.pj-meet-kpiline .pj-meet-kpi { display: inline-flex; flex-direction: row; align-items: baseline; gap: 4px; padding: 0; border: none; background: none; white-space: nowrap; }
|
||||
.pj-meet-kpiline .pj-meet-kpi + .pj-meet-kpi::before { content: "·"; margin-right: 6px; color: #c4c8cf; }
|
||||
.pj-meet-kpiline .pj-meet-kpi { flex: none; }
|
||||
.pj-meet-kpiline .pj-meet-kpi-label { font-size: 11px; font-weight: 500; overflow: visible; }
|
||||
.pj-meet-kpiline .pj-meet-kpi-val { font-size: 12px; font-weight: 700; }
|
||||
.pj-meet-kpiline .pj-meet-kpi-val small { font-size: 10px; }
|
||||
.pj-meet-kpiline .pj-meet-kpi-rate { color: inherit; font-weight: 700; }
|
||||
/* ③ 작업 등록 표 — 빈 칸을 누르면 목록(body 에 붙는 메뉴) */
|
||||
.pj-meet-quick-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
|
||||
.pj-meet-quick-table th { position: sticky; top: 0; z-index: 1; background: #f7f8f9; padding: 4px 6px; font-size: 11.5px; font-weight: 600; color: var(--pj-ink-soft); text-align: left; border-bottom: 1px solid var(--pj-border); }
|
||||
.pj-meet-quick-table th:nth-child(1) { width: 34%; }
|
||||
.pj-meet-quick-table th:nth-child(2) { width: 17%; }
|
||||
.pj-meet-quick-table th:nth-child(3) { width: 20%; }
|
||||
.pj-meet-quick-table th:nth-child(4) { width: 15%; }
|
||||
.pj-meet-quick-table th:nth-child(5) { width: 14%; }
|
||||
.pj-meet-quick-table td { padding: 2px 3px; border-bottom: 1px solid #eef0f2; vertical-align: middle; }
|
||||
.pj-meet-quick-table input { width: 100%; box-sizing: border-box; height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; }
|
||||
.pj-meet-quick-table input:hover, .pj-meet-quick-table input:focus { border-color: #dfe2e6; background: #fff; outline: none; }
|
||||
.pj-meet-pick-cell {
|
||||
display: block; width: 100%; height: 26px; padding: 0 6px; border: 1px dashed transparent; border-radius: 6px; background: none;
|
||||
font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; color: var(--pj-ink);
|
||||
}
|
||||
.pj-meet-pick-cell.is-empty { color: #a7adb6; }
|
||||
.pj-meet-pick-cell:hover { border-color: #cfd4da; background: #fafbfc; }
|
||||
.pj-meet-quick-apply { height: 26px; padding: 0 10px; border: none; border-radius: 6px; background: var(--pj-accent); color: #fff; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
|
||||
.pj-meet-quick-apply:disabled { opacity: .5; cursor: default; }
|
||||
.pj-meet-quick-done { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: #1f8a4c; white-space: nowrap; }
|
||||
.pj-meet-quick-done a { color: inherit; }
|
||||
.pj-meet-quick-table tr.is-done input, .pj-meet-quick-table tr.is-done .pj-meet-pick-cell { color: var(--pj-ink-soft); pointer-events: none; }
|
||||
.pj-meet-quick-add { margin-top: 4px; padding: 2px 6px; border: none; background: none; color: var(--pj-accent-dark); font: inherit; font-size: 12px; cursor: pointer; }
|
||||
@media print { .pj-meet-quick { display: none !important; } .pj-meet-area { height: auto; } }
|
||||
.pj-meet-title { flex-wrap: wrap; }
|
||||
.pj-meet-title-acts { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
|
||||
.pj-meet-title-acts .material-symbols-outlined { font-size: 16px; margin-right: 3px; }
|
||||
@@ -2593,8 +2644,7 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
|
||||
@media (max-width: 1300px) { .pj-meet-kpibar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pj-meet-kpi:nth-child(2) { border-right: none; } .pj-meet-kpi:nth-child(-n+2) { border-bottom: 1px solid var(--pj-border); } }
|
||||
|
||||
/* 이 달 계획 — 연간 목표 표의 그 달 열(업무 영역별 작은 카드) */
|
||||
.pj-meet-plan { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--pj-border); border-radius: 10px; background: #fff; }
|
||||
.pj-meet-plan-head { display: flex; align-items: center; gap: 6px; font-size: var(--pj-text-size); font-weight: 500; margin-bottom: 6px; line-height: 20px; color: var(--pj-ink); }
|
||||
.pj-meet-plan-head { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; min-width: 0; font-size: var(--pj-text-size); font-weight: 500; margin-bottom: 6px; line-height: 20px; color: var(--pj-ink); }
|
||||
.pj-meet-plan-head .material-symbols-outlined { font-size: 18px; color: var(--pj-accent); }
|
||||
.pj-meet-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
|
||||
.pj-meet-plan-area { padding: 6px 8px; border-radius: 8px; background: var(--goal-bg, #f4f5f7); font-size: 12px; line-height: 1.45; min-width: 0; }
|
||||
|
||||
@@ -10238,12 +10238,154 @@
|
||||
});
|
||||
}
|
||||
|
||||
// ── 회의록 머리 ③ 작업 등록 표 — 제목 입력, 담당자·프로젝트·섹션 칸을 누르면 목록(showContextMenu — body 에 붙음),
|
||||
// [적용] = 그 프로젝트에 작업 만들기(POST /project/api/projects/{id}/tasks, 담당자는 그 프로젝트 멤버·소유자만 —
|
||||
// 서버 _check_assignee). 프로젝트 목록은 내가 멤버인 최상위 프로젝트(GET /project/api/projects).
|
||||
// 아직 적용 안 한 줄은 이 브라우저에 보관(localStorage pj_meet_quick:{이메일}) — 새로고침해도 남는다.
|
||||
function initMeetQuickTasks() {
|
||||
const box = el("pj-meet-quick");
|
||||
if (!box) return;
|
||||
const tbody = box.querySelector("tbody");
|
||||
const wrap = document.querySelector(".pj-wrap");
|
||||
const KEY = "pj_meet_quick:" + ((wrap && wrap.dataset.me) || "");
|
||||
const people = {};
|
||||
(window.PJ_MEET_MEMBERS || []).forEach(function (m) { people[String(m.email).toLowerCase()] = m.name; });
|
||||
const nameOf = function (email) { return people[String(email).toLowerCase()] || capName(idOf(email)); };
|
||||
const blank = function () { return { title: "", assignee: "", projectId: null, projectName: "", stageId: null, stageName: "" }; };
|
||||
let rows = [];
|
||||
try { rows = (JSON.parse(localStorage.getItem(KEY) || "[]") || []).filter(function (r) { return r && !r.done; }); } catch (_) { rows = []; }
|
||||
while (rows.length < 3) rows.push(blank());
|
||||
const save = function () {
|
||||
try { localStorage.setItem(KEY, JSON.stringify(rows.filter(function (r) { return !r.done && (r.title || r.projectId || r.assignee); }))); } catch (_) {}
|
||||
};
|
||||
let projects = null;
|
||||
const memberCache = {}, stageCache = {};
|
||||
async function loadProjects() {
|
||||
if (projects) return projects;
|
||||
const res = await api("GET", "/project/api/projects");
|
||||
projects = (res.projects || []).filter(function (p) { return !p.parent_id; });
|
||||
return projects;
|
||||
}
|
||||
async function membersOf(pid) {
|
||||
if (memberCache[pid]) return memberCache[pid];
|
||||
const res = await api("GET", "/project/api/projects/" + pid + "/members");
|
||||
const list = (res.members || []).map(function (m) { return String(m.user_email).toLowerCase(); });
|
||||
const proj = (projects || []).find(function (p) { return p.id === pid; });
|
||||
if (proj && proj.owner_email && list.indexOf(String(proj.owner_email).toLowerCase()) < 0) list.unshift(String(proj.owner_email).toLowerCase());
|
||||
memberCache[pid] = list;
|
||||
return list;
|
||||
}
|
||||
async function stagesOf(pid) {
|
||||
if (stageCache[pid]) return stageCache[pid];
|
||||
const res = await api("GET", "/project/api/projects/" + pid + "/stages");
|
||||
stageCache[pid] = (res.stages || []).slice().sort(function (a, b) { return a.sort_order - b.sort_order; });
|
||||
return stageCache[pid];
|
||||
}
|
||||
function cell(kind, text, placeholder) {
|
||||
return '<button type="button" class="pj-meet-pick-cell' + (text ? "" : " is-empty") + '" data-pick="' + kind + '">' +
|
||||
escapeHtml(text || placeholder) + "</button>";
|
||||
}
|
||||
function render() {
|
||||
tbody.innerHTML = rows.map(function (r, i) {
|
||||
return '<tr data-i="' + i + '"' + (r.done ? ' class="is-done"' : "") + ">" +
|
||||
'<td><input type="text" data-field="title" maxlength="200" placeholder="작업 제목" value="' + escapeHtml(r.title) + '"></td>' +
|
||||
"<td>" + cell("assignee", r.assignee ? nameOf(r.assignee) : "", "담당자") + "</td>" +
|
||||
"<td>" + cell("project", r.projectName, "프로젝트") + "</td>" +
|
||||
"<td>" + cell("stage", r.stageName, "섹션") + "</td>" +
|
||||
"<td>" + (r.done
|
||||
? '<span class="pj-meet-quick-done"><span class="material-symbols-outlined" style="font-size:16px">check_circle</span>' +
|
||||
'<a href="/project/p/' + r.done.pid + "?task=" + r.done.id + '" target="_blank" rel="noopener">등록됨</a></span>'
|
||||
: '<button type="button" class="pj-meet-quick-apply" data-quick="apply">적용</button>') + "</td></tr>";
|
||||
}).join("");
|
||||
}
|
||||
function menuAt(btn, items) {
|
||||
const r = btn.getBoundingClientRect();
|
||||
showContextMenu(r.left, r.bottom + 2, items.length ? items : [{ label: "고를 항목이 없습니다", onClick: function () {} }]);
|
||||
}
|
||||
async function pickProject(r, btn) {
|
||||
const list = await loadProjects();
|
||||
menuAt(btn, list.map(function (p) {
|
||||
return { label: p.name, icon: menuIcon("folder"), checked: r.projectId === p.id, onClick: async function () {
|
||||
if (r.projectId !== p.id) { r.stageId = null; r.stageName = ""; }
|
||||
r.projectId = p.id; r.projectName = p.name;
|
||||
try {
|
||||
const [mem, stages] = await Promise.all([membersOf(p.id), stagesOf(p.id)]);
|
||||
if (r.assignee && mem.indexOf(r.assignee.toLowerCase()) < 0) {
|
||||
showToast(nameOf(r.assignee) + "님은 이 프로젝트 멤버가 아니어서 담당자를 비웠습니다.");
|
||||
r.assignee = "";
|
||||
}
|
||||
if (!r.stageId && stages.length) { r.stageId = stages[0].id; r.stageName = stages[0].name; }
|
||||
} catch (e) { showToast("프로젝트 정보를 읽지 못했습니다: " + e.message, "error"); }
|
||||
save(); render();
|
||||
} };
|
||||
}));
|
||||
}
|
||||
async function pickAssignee(r, btn) {
|
||||
// 프로젝트를 골랐으면 그 프로젝트 멤버·소유자만(작업을 볼 수 있는 사람), 아니면 프로젝트 권한이 있는 전체 직원
|
||||
const emails = r.projectId ? await membersOf(r.projectId)
|
||||
: (window.PJ_MEET_MEMBERS || []).map(function (m) { return String(m.email).toLowerCase(); });
|
||||
menuAt(btn, [{ label: "담당자 없음", icon: menuIcon("person_off"), checked: !r.assignee, onClick: function () { r.assignee = ""; save(); render(); } }, null]
|
||||
.concat(emails.map(function (e) {
|
||||
return { label: nameOf(e), icon: menuIcon("person"), checked: r.assignee === e, onClick: function () { r.assignee = e; save(); render(); } };
|
||||
})));
|
||||
}
|
||||
async function pickStage(r, btn) {
|
||||
if (!r.projectId) { showToast("프로젝트를 먼저 고르세요."); return; }
|
||||
const stages = await stagesOf(r.projectId);
|
||||
menuAt(btn, stages.map(function (st) {
|
||||
return { label: st.name, icon: menuIcon("view_column"), checked: r.stageId === st.id, onClick: function () { r.stageId = st.id; r.stageName = st.name; save(); render(); } };
|
||||
}));
|
||||
}
|
||||
async function apply(r, btn) {
|
||||
if (!r.title.trim()) { showToast("작업 제목을 쓰세요."); return; }
|
||||
if (!r.projectId) { showToast("프로젝트를 고르세요."); return; }
|
||||
btn.disabled = true;
|
||||
try {
|
||||
const res = await api("POST", "/project/api/projects/" + r.projectId + "/tasks", {
|
||||
title: r.title.trim(), stage_id: r.stageId, assignee_email: r.assignee || "",
|
||||
assignee_name: r.assignee ? nameOf(r.assignee) : "",
|
||||
});
|
||||
r.done = { id: res.task.id, pid: r.projectId };
|
||||
showToast("‘" + r.projectName + "’에 작업을 등록했습니다.");
|
||||
if (!rows.some(function (x) { return !x.done; })) rows.push(blank());
|
||||
save(); render();
|
||||
} catch (e) {
|
||||
btn.disabled = false;
|
||||
showToast("작업 등록 실패: " + e.message, "error");
|
||||
}
|
||||
}
|
||||
tbody.addEventListener("input", function (e) {
|
||||
const inp = e.target.closest("input[data-field=title]");
|
||||
if (!inp) return;
|
||||
rows[+inp.closest("tr").dataset.i].title = inp.value;
|
||||
save();
|
||||
});
|
||||
tbody.addEventListener("keydown", function (e) {
|
||||
const inp = e.target.closest("input[data-field=title]");
|
||||
if (inp && e.key === "Enter" && !isImeEnter(e)) { e.preventDefault(); inp.closest("tr").querySelector('[data-pick="assignee"]').click(); }
|
||||
});
|
||||
tbody.addEventListener("click", function (e) {
|
||||
const tr = e.target.closest("tr");
|
||||
if (!tr) return;
|
||||
const r = rows[+tr.dataset.i], pick = e.target.closest("[data-pick]");
|
||||
if (r.done) return;
|
||||
const fail = function (err) { showToast("목록을 읽지 못했습니다: " + err.message, "error"); };
|
||||
if (pick) {
|
||||
e.stopPropagation();
|
||||
({ project: pickProject, assignee: pickAssignee, stage: pickStage })[pick.dataset.pick](r, pick).catch(fail);
|
||||
} else if (e.target.closest('[data-quick="apply"]')) apply(r, e.target.closest('[data-quick="apply"]'));
|
||||
});
|
||||
box.querySelector('[data-quick="add"]').addEventListener("click", function () { rows.push(blank()); save(); render(); });
|
||||
render();
|
||||
}
|
||||
|
||||
function initGoalMeeting() {
|
||||
const pane = el("pj-meet-pane");
|
||||
if (!pane) return;
|
||||
initMeetOrder();
|
||||
initMeetTop(pane);
|
||||
initMeetBoard(pane.dataset.week);
|
||||
initMeetQuickTasks();
|
||||
const week = pane.dataset.week, year = pane.dataset.year;
|
||||
const isAdmin = pane.dataset.admin === "true";
|
||||
const SCROLL_KEY = "pj_meet_scroll";
|
||||
|
||||
Reference in New Issue
Block a user