feat(project): month-bounded meeting weeks, weekly sales targets, sticky header
- Weeks stay inside the month: week 1 starts on the 1st (through the next Sunday if the 1st is a weekend); a trailing Mon/Tue joins the last week. "Last week" is the previous period. - Prev-week review columns: 전주 업무 | 결과(text, new result_note) | 전주 목표 | 결과(amount). - Header now shows month target, cumulative weekly target, month-to-date sales and gap (amount + %), with decisions/notes beside it; the area stays fixed while scrolling. - Goals board: the monthly sales target is entered per week; the sum becomes the month target. - Migration 020: result_note, goal_week_targets, drop Monday-only check, move absorbed Monday meetings to the new week start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+47
-13
@@ -2501,17 +2501,28 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
|
||||
.pj-meet-sync.is-warn { background: #fff4ec; color: #b45309; }
|
||||
@keyframes pj-meet-spin { to { transform: rotate(360deg); } }
|
||||
@media print { .pj-meet-sync { display: none !important; } }
|
||||
/* 숫자 — 한 줄 막대(칸 9개, 좁으면 두 줄). 설명 문구는 말풍선(title) */
|
||||
/* 위쪽 고정 영역(2026-10-07) — 왼쪽 절반 숫자 4칸 | 오른쪽 절반 결정 사항·메모. 스크롤해도 위에 붙는다(.pj-meet-pane 기준).
|
||||
표 머리 줄은 이 높이(--pj-meet-top-h, project.js initMeetTop) 아래에 붙는다. 설명 문구는 말풍선(title) */
|
||||
.pj-meet-top {
|
||||
position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px;
|
||||
align-items: stretch; padding: 0 0 10px; background: #fff;
|
||||
}
|
||||
.pj-meet-kpibar {
|
||||
display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); margin-bottom: 10px;
|
||||
display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: stretch;
|
||||
border: 1px solid var(--pj-border); border-radius: 10px; background: #fff; overflow: hidden;
|
||||
}
|
||||
.pj-meet-kpis { display: contents; }
|
||||
.pj-meet-kpi { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; min-width: 0; border-right: 1px solid var(--pj-border); }
|
||||
.pj-meet-kpis.is-week .pj-meet-kpi:last-child { border-right: none; }
|
||||
.pj-meet-kpis:not(.is-week) .pj-meet-kpi:last-child { border-right: 2px solid #d5d9de; } /* 월 | 주 경계 */
|
||||
.pj-meet-kpi { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 12px; min-width: 0; border-right: 1px solid var(--pj-border); }
|
||||
.pj-meet-kpi:last-child { border-right: none; }
|
||||
.pj-meet-kpi.is-accent { background: #faf9ff; }
|
||||
.pj-meet-kpi.is-input { background: #fffaf4; }
|
||||
.pj-meet-kpi-sub.is-good { color: #1f8a4c; font-weight: 700; }
|
||||
.pj-meet-kpi-sub.is-low { color: #c2410c; font-weight: 700; }
|
||||
.pj-meet-kpi-link { color: var(--pj-accent-dark); text-decoration: none; }
|
||||
.pj-meet-kpi-link:hover { text-decoration: underline; }
|
||||
.pj-meet-top .pj-meet-notes { margin: 0; display: flex; flex-direction: column; min-width: 0; }
|
||||
.pj-meet-top .pj-meet-notes h3 { margin: 0 0 4px; font-size: 13px; }
|
||||
.pj-meet-top .pj-meet-notes textarea, .pj-meet-top .pj-meet-notes .pj-meet-ro {
|
||||
flex: 1 1 auto; min-height: 64px; max-height: 140px; overflow-y: auto; padding: 8px 10px;
|
||||
}
|
||||
.pj-meet-kpi-label { font-size: 11px; color: var(--pj-ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.pj-meet-kpi-label small { font-weight: 500; }
|
||||
.pj-meet-kpi-val { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 2px; white-space: nowrap; }
|
||||
@@ -2523,7 +2534,7 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
|
||||
font-size: 14px; font-weight: 800; height: 24px; width: 100%; text-align: left;
|
||||
border: 1px solid #f3d2b0; border-radius: 6px; background: #fff; padding: 0 6px;
|
||||
}
|
||||
@media (max-width: 1300px) { .pj-meet-kpibar { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
|
||||
@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; }
|
||||
@@ -2587,11 +2598,11 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
|
||||
}
|
||||
.pj-meet-table tr > :last-child { border-right: none; }
|
||||
.pj-meet-table thead th {
|
||||
position: sticky; top: 0; z-index: 3; background: #f7f8f9; height: 32px; padding: 0 8px; font-weight: 700;
|
||||
position: sticky; top: var(--pj-meet-top-h, 0px); z-index: 3; background: #f7f8f9; height: 32px; padding: 0 8px; font-weight: 700;
|
||||
text-align: center; vertical-align: middle; white-space: nowrap;
|
||||
}
|
||||
.pj-meet-table thead tr.pj-meet-group th { top: 0; height: 26px; font-size: 12px; }
|
||||
.pj-meet-table thead tr:nth-child(2) th { top: 26px; }
|
||||
.pj-meet-table thead tr.pj-meet-group th { top: var(--pj-meet-top-h, 0px); height: 26px; font-size: 12px; }
|
||||
.pj-meet-table thead tr:nth-child(2) th { top: calc(var(--pj-meet-top-h, 0px) + 26px); }
|
||||
.pj-meet-table thead th.is-this { background: #fff7ed; color: #9a4b0b; }
|
||||
/* 이번주 ↔ 지난주 순서 바꾸기 버튼(표 왼쪽 위 빈 칸) */
|
||||
.pj-meet-order-cell { vertical-align: middle; }
|
||||
@@ -2627,11 +2638,13 @@ th.pj-meet-c-label { position: relative; font-weight: 600; color: #3b4048; text-
|
||||
.pj-meet-more { position: absolute; top: 3px; right: 2px; width: 24px; height: 24px; opacity: 0; transition: opacity .12s; }
|
||||
.pj-meet-more .material-symbols-outlined { font-size: 18px; }
|
||||
th.pj-meet-c-label:hover .pj-meet-more, .pj-meet-more:focus { opacity: 1; }
|
||||
textarea.pj-meet-text, .pj-meet-notes textarea {
|
||||
textarea.pj-meet-text, textarea.pj-meet-rnote, .pj-meet-notes textarea {
|
||||
display: block; width: 100%; box-sizing: border-box; min-height: 38px; padding: 6px; border: none; background: transparent;
|
||||
font: inherit; line-height: var(--pj-text-leading); color: inherit; resize: none; overflow: hidden;
|
||||
}
|
||||
textarea.pj-meet-text:focus { outline: none; }
|
||||
textarea.pj-meet-text:focus, textarea.pj-meet-rnote:focus { outline: none; }
|
||||
textarea.pj-meet-rnote { min-height: calc(var(--pj-text-leading) + 12px); padding: 6px; }
|
||||
textarea.pj-meet-rnote::placeholder { color: rgba(0, 0, 0, .28); }
|
||||
/* 같은 행의 가장 긴 내용으로 높이를 정하고, 짧은 셀은 위에서 시작한다. */
|
||||
textarea.pj-meet-text { min-height: calc(var(--pj-text-leading) + 12px); }
|
||||
.pj-meet-notes textarea:focus { outline: 2px solid var(--pj-accent); outline-offset: -2px; background: rgba(255, 255, 255, .8); }
|
||||
@@ -2670,10 +2683,31 @@ input.pj-meet-amount::placeholder { color: rgba(0, 0, 0, .28); }
|
||||
.erp-sidebar, .erp-topbar, .pj-side, .pj-goal-head-acts, .pj-meet-weeks, .pj-goal-foot, .pj-meet-more, .pj-meet-sec-add,
|
||||
.pj-meet-goalbtn, .pj-meet-title .pj-btn { display: none !important; }
|
||||
.pj-meet-pane { overflow: visible; }
|
||||
.pj-meet-top { position: static; }
|
||||
.pj-meet-table thead th { position: static; }
|
||||
input.pj-meet-amount { border: none; appearance: none; }
|
||||
}
|
||||
|
||||
/* 목표 표 — 매출 목표 칸(주차별 입력, 020): 누르면 주차 입력 창 */
|
||||
.pj-goal-numtd.is-weekly .pj-goal-num { cursor: pointer; }
|
||||
.pj-goal-numtd.is-weekly input.pj-goal-num:hover { background: var(--pj-accent-tint); }
|
||||
.pj-goal-wkpop {
|
||||
position: fixed; z-index: 1000; width: 260px; padding: 10px 12px; background: #fff; border: 1px solid var(--pj-border);
|
||||
border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .16); font-size: 13px;
|
||||
}
|
||||
.pj-goal-wkpop-head { font-weight: 700; margin-bottom: 8px; }
|
||||
.pj-goal-wkpop-head small { font-weight: 500; color: var(--pj-ink-soft); }
|
||||
.pj-goal-wkpop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; }
|
||||
.pj-goal-wkpop-row em { font-style: normal; color: var(--pj-ink-soft); font-size: 12px; }
|
||||
.pj-goal-wkpop-row input {
|
||||
width: 100px; height: 26px; padding: 0 6px; border: 1px solid var(--pj-border); border-radius: 6px; font: inherit;
|
||||
text-align: right; font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.pj-goal-wkpop-row input[readonly] { background: #f7f8f9; }
|
||||
.pj-goal-wkpop-sum { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--pj-border); }
|
||||
.pj-goal-wkpop-sum b { font-variant-numeric: tabular-nums; }
|
||||
.pj-goal-wkpop-acts { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
|
||||
|
||||
/* 영역 색 고르기 팝업(body 에 붙음) */
|
||||
.pj-goal-colorpop {
|
||||
position: fixed; z-index: 1000; display: grid; grid-template-columns: repeat(8, 26px); gap: 6px;
|
||||
|
||||
+119
-14
@@ -9023,16 +9023,103 @@
|
||||
function fitAll() { table.querySelectorAll(".pj-goal-text").forEach(fit); }
|
||||
QUARTERS.forEach(function (q) { applyFold(q, false); });
|
||||
|
||||
// 병합 선택(Shift+클릭) — 관리자 전용, 아래에서 채운다. 접기 버튼이 먼저 부르므로 여기 둔다.
|
||||
let clearMergeSel = function () {};
|
||||
if (!isAdmin) return;
|
||||
|
||||
function flashSaved(node) {
|
||||
node.classList.remove("is-saved");
|
||||
void node.offsetWidth;
|
||||
node.classList.add("is-saved");
|
||||
}
|
||||
|
||||
// ── 주차별 매출 목표(020) — 매출 목표 칸을 누르면 그 달 주차 입력 창(body 에 붙음). 저장하면 주차 합계가 월 목표.
|
||||
// 관리자는 입력·저장, 보기만 하는 사람은 주차별 값 보기. 주차는 서버(store.month_weeks)가 정한다.
|
||||
const WEEKS = window.PJ_GOAL_WEEKS || null;
|
||||
let weekPop = null;
|
||||
function closeWeekPop() {
|
||||
if (!weekPop) return;
|
||||
weekPop.remove();
|
||||
weekPop = null;
|
||||
document.removeEventListener("mousedown", onWeekDoc, true);
|
||||
document.removeEventListener("keydown", onWeekKey, true);
|
||||
}
|
||||
function onWeekDoc(e) { if (weekPop && !weekPop.contains(e.target)) closeWeekPop(); }
|
||||
function onWeekKey(e) { if (e.key === "Escape") closeWeekPop(); }
|
||||
function openWeekPop(cell) {
|
||||
closeWeekPop();
|
||||
const mo = cell.dataset.month, list = (WEEKS && WEEKS[mo]) || [];
|
||||
const unit = window.PJ_GOAL_UNIT || "";
|
||||
const edit = isAdmin && cell.tagName === "INPUT";
|
||||
weekPop = document.createElement("div");
|
||||
weekPop.className = "pj-goal-wkpop";
|
||||
weekPop.innerHTML = '<div class="pj-goal-wkpop-head">' + mo + "월 주차별 매출 목표" +
|
||||
(unit ? " <small>(" + escapeHtml(unit) + ")</small>" : "") + "</div>" +
|
||||
list.map(function (w) {
|
||||
return '<label class="pj-goal-wkpop-row"><span>' + w.n + "주차 <em>" + escapeHtml(w.label) + "</em></span>" +
|
||||
'<input type="text" inputmode="decimal" autocomplete="off" data-start="' + w.start + '" value="' +
|
||||
escapeHtml(w.value || "") + '"' + (edit ? "" : " readonly") + "></label>";
|
||||
}).join("") +
|
||||
'<div class="pj-goal-wkpop-sum"><span>합계 = 월 목표</span><b></b></div>' +
|
||||
(edit ? '<div class="pj-goal-wkpop-acts"><button type="button" class="pj-btn pj-btn-sm" data-act="cancel">취소</button>' +
|
||||
'<button type="button" class="pj-btn pj-btn-sm pj-btn-primary" data-act="save">저장</button></div>' : "");
|
||||
document.body.appendChild(weekPop);
|
||||
const r = cell.getBoundingClientRect(), vw = document.documentElement.clientWidth, vh = document.documentElement.clientHeight;
|
||||
weekPop.style.left = Math.max(8, Math.min(r.left, vw - weekPop.offsetWidth - 8)) + "px";
|
||||
weekPop.style.top = (r.bottom + 6 + weekPop.offsetHeight > vh ? Math.max(8, r.top - weekPop.offsetHeight - 6) : r.bottom + 6) + "px";
|
||||
const inputs = Array.from(weekPop.querySelectorAll("input"));
|
||||
const sumEl = weekPop.querySelector(".pj-goal-wkpop-sum b");
|
||||
function paintSum() {
|
||||
let t = null;
|
||||
inputs.forEach(function (i) { const n = numOf(i); if (n != null) t = (t || 0) + n; });
|
||||
sumEl.textContent = t == null ? "—" : fmtNum(t);
|
||||
}
|
||||
inputs.forEach(function (i) { i.addEventListener("input", paintSum); });
|
||||
paintSum();
|
||||
async function save(btn) {
|
||||
const weeks = {};
|
||||
inputs.forEach(function (i) { weeks[i.dataset.start] = i.value; });
|
||||
btn.disabled = true;
|
||||
try {
|
||||
const res = await api("PUT", "/project/api/goals/" + year + "/week-targets/" + mo, { weeks: weeks });
|
||||
list.forEach(function (w) { if (res.weeks && w.start in res.weeks) w.value = res.weeks[w.start]; });
|
||||
cell.value = res.label || "";
|
||||
recompute();
|
||||
flashSaved(cell.parentElement);
|
||||
closeWeekPop();
|
||||
} catch (err) {
|
||||
btn.disabled = false;
|
||||
showToast("저장 실패: " + err.message, "error");
|
||||
}
|
||||
}
|
||||
weekPop.addEventListener("click", function (e) {
|
||||
const b = e.target.closest("[data-act]");
|
||||
if (!b) return;
|
||||
if (b.dataset.act === "save") save(b); else closeWeekPop();
|
||||
});
|
||||
weekPop.addEventListener("keydown", function (e) {
|
||||
if (edit && e.key === "Enter" && !isImeEnter(e) && e.target.tagName === "INPUT") {
|
||||
e.preventDefault();
|
||||
save(weekPop.querySelector('[data-act="save"]'));
|
||||
}
|
||||
});
|
||||
setTimeout(function () {
|
||||
document.addEventListener("mousedown", onWeekDoc, true);
|
||||
document.addEventListener("keydown", onWeekKey, true);
|
||||
}, 0);
|
||||
if (edit && inputs.length) { inputs[0].focus(); inputs[0].select(); }
|
||||
}
|
||||
if (WEEKS) {
|
||||
table.addEventListener("click", function (e) {
|
||||
const c = e.target.closest(".pj-goal-num[data-weekly]");
|
||||
if (c) openWeekPop(c);
|
||||
});
|
||||
table.addEventListener("keydown", function (e) {
|
||||
const c = e.target.closest(".pj-goal-num[data-weekly]");
|
||||
if (c && (e.key === "Enter" || e.key === " ") && !isImeEnter(e)) { e.preventDefault(); openWeekPop(c); }
|
||||
});
|
||||
}
|
||||
|
||||
// 병합 선택(Shift+클릭) — 관리자 전용, 아래에서 채운다. 접기 버튼이 먼저 부르므로 여기 둔다.
|
||||
let clearMergeSel = function () {};
|
||||
if (!isAdmin) return;
|
||||
|
||||
// ── 숫자 칸 — Enter·칸 떠남에 저장(createFieldSaver: 같은 칸 요청 차례대로, 늦은 응답이 새 입력을 덮지 않음).
|
||||
// 서버 표기(쉼표)는 요청 뒤 입력이 그대로일 때만 칸에 넣는다. 실패해도 입력값은 그대로(빨간 테두리), Esc = 저장된 값으로.
|
||||
const numSaver = createFieldSaver({
|
||||
@@ -9054,7 +9141,7 @@
|
||||
},
|
||||
onFail: function (inp, err) { markSaveFailed(inp.parentElement, err); },
|
||||
});
|
||||
table.querySelectorAll("input.pj-goal-num").forEach(function (inp) {
|
||||
table.querySelectorAll("input.pj-goal-num:not([data-weekly])").forEach(function (inp) {
|
||||
numSaver.track(inp, inp.value);
|
||||
inp.addEventListener("focus", function () { inp.select(); });
|
||||
inp.addEventListener("input", recompute);
|
||||
@@ -9984,7 +10071,7 @@
|
||||
// · 글(주요 업무·메모): 0.8초 멈춤·칸 떠남·페이지 떠남에 저장. 금액·참석자: 칸 떠남·Enter 에 저장.
|
||||
// · 지난주 결과 금액은 지난 회의록의 같은 줄(tr data-prev)에 저장한다.
|
||||
// · 줄 추가·순서·삭제·구역 추가는 저장 뒤 새로고침(스크롤 위치 되살림). 메뉴는 body 에 붙는다.
|
||||
// ── 회의록 표 — 이번주(2칸) ↔ 지난주 리뷰(3칸) 순서 바꾸기. 줄마다 is-this / is-prev 칸 묶음을 통째로 옮긴다
|
||||
// ── 회의록 표 — 이번주(2칸) ↔ 지난주 리뷰(4칸) 순서 바꾸기. 줄마다 is-this / is-prev 칸 묶음을 통째로 옮긴다
|
||||
// (colgroup·머리 두 줄·구역 줄 모두). 보는 사람마다 브라우저에 기억 — localStorage pj_meet_order:{로그인 이메일} = "prev"(지난주 먼저).
|
||||
// 다시 그리기(repaintMeeting)는 칸을 선택자로 찾으므로 순서와 무관.
|
||||
function initMeetOrder() {
|
||||
@@ -10026,10 +10113,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
// ── 회의록 위쪽 고정 영역(숫자 4칸 | 결정 사항·메모) — 스크롤해도 위에 붙고, 표 머리 줄은 그 아래에 붙는다.
|
||||
// 높이가 바뀌면(메모 줄 수·창 너비) --pj-meet-top-h 를 다시 잰다. 배율(.pj-ui-scale) 안이라 offsetHeight(배율 전 값)로.
|
||||
function initMeetTop(pane) {
|
||||
const top = el("pj-meet-top");
|
||||
if (!top) return;
|
||||
const apply = function () { pane.style.setProperty("--pj-meet-top-h", top.offsetHeight + "px"); };
|
||||
apply();
|
||||
if (window.ResizeObserver) new ResizeObserver(apply).observe(top);
|
||||
else window.addEventListener("resize", apply);
|
||||
}
|
||||
|
||||
function initGoalMeeting() {
|
||||
const pane = el("pj-meet-pane");
|
||||
if (!pane) return;
|
||||
initMeetOrder();
|
||||
initMeetTop(pane);
|
||||
const week = pane.dataset.week, year = pane.dataset.year;
|
||||
const isAdmin = pane.dataset.admin === "true";
|
||||
const SCROLL_KEY = "pj_meet_scroll";
|
||||
@@ -10076,7 +10175,7 @@
|
||||
const meetingUrl = "/project/api/goals/meetings/" + week;
|
||||
function itemUrl(id) { return "/project/api/goals/meeting-items/" + id; }
|
||||
|
||||
// ── 금액 칸(금주 목표 · 줄 정량 목표 · 지난주 결과) — Enter·칸 떠남에 저장(createFieldSaver: 같은 칸 요청 차례대로).
|
||||
// ── 금액 칸(줄 정량 목표 · 지난주 결과 금액) — Enter·칸 떠남에 저장(createFieldSaver: 같은 칸 요청 차례대로).
|
||||
// 서버 확정값(원 정수)을 쉼표 표기로 칸에 넣는 건 요청 뒤 입력이 그대로일 때만 — 그 사이 다시 입력한 초안은 덮지 않는다.
|
||||
// 실패해도 입력값은 그대로(빨간 테두리), Esc = 저장된 값으로.
|
||||
// 금주 목표 저장 뒤 머리 숫자는 페이지 새로고침 없이 숫자 칸만 다시 그린다(meetRepaint — 다른 칸의 저장 안 된 글 보존).
|
||||
@@ -10223,7 +10322,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
// ── 글 칸(이번주 할 일·메모) — 0.8초 멈춤·칸 떠남에 저장(createFieldSaver).
|
||||
// ── 글 칸(주요 업무 · 지난주 결과 글 · 메모) — 0.8초 멈춤·칸 떠남에 저장(createFieldSaver).
|
||||
// 지난주 결과 글(.pj-meet-rnote, data-field=result_note)은 지난 주차 줄(tr data-prev)에 저장한다.
|
||||
// 보낸 값만 저장됨으로 기록하고, 같은 칸 요청은 차례대로(진행 중에 새로 쓴 글은 뒤이어 저장). 실패해도 글은 그대로 두고
|
||||
// 다음 입력·칸 떠남·줄 작업 전에 다시 보낸다. 초안은 localStorage(pj_draft:meet:…)에도 — 페이지가 닫혀도 다음에 되살린다.
|
||||
const notes = el("pj-meet-notes");
|
||||
@@ -10231,11 +10331,16 @@
|
||||
read: function (ta) { return ta.value; },
|
||||
write: function (ta, v) { ta.value = v; fit(ta); },
|
||||
send: function (ta, v, o) {
|
||||
return ta === notes ? api("PUT", meetingUrl, { notes: v }, o)
|
||||
: api("PUT", itemUrl(ta.closest("tr").dataset.item), { content: v }, o);
|
||||
if (ta === notes) return api("PUT", meetingUrl, { notes: v }, o);
|
||||
const tr = ta.closest("tr");
|
||||
if (ta.dataset.field === "result_note") return api("PUT", itemUrl(tr.dataset.prev), { result_note: v }, o);
|
||||
return api("PUT", itemUrl(tr.dataset.item), { content: v }, o);
|
||||
},
|
||||
draftKey: function (ta) {
|
||||
return ta === notes ? "meet:notes:" + week : "meet:item:" + ta.closest("tr").dataset.item + ":content";
|
||||
if (ta === notes) return "meet:notes:" + week;
|
||||
const tr = ta.closest("tr");
|
||||
return ta.dataset.field === "result_note" ? "meet:item:" + tr.dataset.prev + ":result_note"
|
||||
: "meet:item:" + tr.dataset.item + ":content";
|
||||
},
|
||||
onSaved: function (ta) { const n = ta.closest("td") || ta; clearSaveFailed(n); flashSaved(n); },
|
||||
onClear: function (ta) { clearSaveFailed(ta.closest("td") || ta); },
|
||||
@@ -10259,7 +10364,7 @@
|
||||
ta.addEventListener("blur", function () { textSaver.flush(ta).catch(function () {}); });
|
||||
}
|
||||
if (notes) bindText(notes);
|
||||
if (table) table.querySelectorAll(".pj-meet-text").forEach(bindText);
|
||||
if (table) table.querySelectorAll(".pj-meet-text, .pj-meet-rnote").forEach(bindText);
|
||||
if (cellGrid) cellGrid.bindSaver({ flush: flushAll, save: function (ta) { return textSaver.flush(ta); },
|
||||
replace: function (ta, value) { ta.value = value; textSaver.acceptSaved(ta, ta.value); },
|
||||
rowMenu: rowMenu, addRow: function (section, ref, place) { run(function () { return addRow(section, ref, place); }); },
|
||||
@@ -10267,7 +10372,7 @@
|
||||
if (table && window.PJGoalText) window.PJGoalText.init(table, el("pj-goal-format"));
|
||||
if (restored) showToast("저장되지 않았던 글 " + restored + "칸을 되살려 다시 저장합니다.");
|
||||
else if (conflict) showToast("다른 곳에서 바뀐 칸 " + conflict + "개는 예전 초안을 되살리지 않았습니다.");
|
||||
window.addEventListener("resize", function () { document.querySelectorAll(".pj-meet-text, #pj-meet-notes").forEach(fit); });
|
||||
window.addEventListener("resize", function () { document.querySelectorAll(".pj-meet-text, .pj-meet-rnote, #pj-meet-notes").forEach(fit); });
|
||||
// 페이지 떠남 — 글은 keepalive 로 한 번 더 보내고(보장 아님, 초안 백업이 남음), 실패·진행 중·금액 미저장이면 이탈 경고
|
||||
window.addEventListener("beforeunload", function (e) {
|
||||
textSaver.onBeforeUnload(e);
|
||||
@@ -10279,7 +10384,7 @@
|
||||
table.addEventListener("click", function (e) {
|
||||
if (e.button !== 0 || e.defaultPrevented || e.target.closest("textarea, input, select, button, a, [contenteditable], [data-meet-edit], .pj-meet-colresize, .pj-goal-move-edge")) return;
|
||||
const td = e.target.closest("td");
|
||||
const f = td && td.querySelector(".pj-meet-text, input.pj-meet-amount");
|
||||
const f = td && td.querySelector(".pj-meet-text, .pj-meet-rnote, input.pj-meet-amount");
|
||||
if (!f || f === document.activeElement) return;
|
||||
f.focus();
|
||||
if (f.tagName === "TEXTAREA") { const n = f.value.length; f.setSelectionRange(n, n); }
|
||||
|
||||
Reference in New Issue
Block a user