fix(project): 목표 표·회의록 — 칸 아무 곳이나 눌러 입력(엑셀처럼), 우클릭 메뉴 아이콘

- 칸이 세로로 길면 위쪽(글 높이)만 눌러야 입력되던 것: 글/금액 칸 아무 곳이나 누르면 그 칸 입력, 커서는 글 끝,
  칸 전체 글 입력 마우스 모양, Shift+클릭·끌기 선택은 그대로
- 우클릭 메뉴 왼쪽 아이콘(menuIcon): 줄 추가 위/아래·줄 삭제·셀 병합·병합 해제·항목 칸 나누기, 회의록 위로/아래로·쇼핑몰 연결
- goals.html 항목 칸 rowspan 계산이 값 없을 때도 안전하게, 캐시 버전 20261001l, 문서 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 13:52:30 +09:00
parent 164153dc9c
commit 4af1ad8848
10 changed files with 67 additions and 29 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001k" />
<link rel="stylesheet" href="/static/project.css?v=20261001l" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -246,5 +246,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001k" defer></script>
<script src="/static/project.js?v=20261001l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001k" />
<link rel="stylesheet" href="/static/project.css?v=20261001l" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -155,12 +155,12 @@
{% endif %}
{# 항목 칸(2열) — 같은 항목 칸으로 묶인 줄(016 label_cont)은 묶음 첫 줄이 rowspan 으로 덮는다 #}
{% if not row.label_cont %}
<th class="pj-goal-c2 pj-goal-row-label"{% if row.label_span > 1 %} rowspan="{{ row.label_span }}"{% endif %} data-label-span="{{ row.label_span or 1 }}">
<th class="pj-goal-c2 pj-goal-row-label"{% if (row.label_span or 1) > 1 %} rowspan="{{ row.label_span }}"{% endif %} data-label-span="{{ row.label_span or 1 }}">
<span class="pj-goal-row-text"{% if is_admin %} data-goal-edit="row" title="눌러서 줄 이름 수정"{% endif %}>{{ row.label }}</span>
{# 줄 도구 — + = 이 줄 아래에 줄 추가, × = 줄 삭제(영역의 마지막 한 줄은 못 지움). 우클릭 메뉴로 위/아래 추가·삭제도 #}
{% if is_admin %}
<span class="pj-goal-tools">
{% if area.rows | length > 1 and row.label_span == 1 %}
{% if area.rows | length > 1 and (row.label_span or 1) == 1 %}
<button type="button" class="pj-icon-btn" data-goal-act="row-up" title="위로">↑</button>
<button type="button" class="pj-icon-btn" data-goal-act="row-down" title="아래로">↓</button>
{% endif %}
@@ -210,5 +210,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001k" defer></script>
<script src="/static/project.js?v=20261001l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001k" />
<link rel="stylesheet" href="/static/project.css?v=20261001l" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001k" />
<link rel="stylesheet" href="/static/project.css?v=20261001l" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001k" defer></script>
<script src="/static/project.js?v=20261001l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001k" />
<link rel="stylesheet" href="/static/project.css?v=20261001l" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261001k" defer></script>
<script src="/static/project.js?v=20261001l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001k" />
<link rel="stylesheet" href="/static/project.css?v=20261001l" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -496,5 +496,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261001k" defer></script>
<script src="/static/project.js?v=20261001l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001k" />
<link rel="stylesheet" href="/static/project.css?v=20261001l" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001k" defer></script>
<script src="/static/project.js?v=20261001l" defer></script>
{% endblock %}
+8
View File
@@ -1348,6 +1348,11 @@ label.pj-desc-fmtbtn {
.pj-ctxmenu-sep { height: 1px; background: var(--pj-border); margin: 4px 2px; }
/* 메뉴 항목 아이콘(담당자 아바타 등) + 오른쪽 현재값 ✓ */
.pj-ctxmenu-ic { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
/* 메뉴 왼쪽 아이콘(menuIcon) — 회색, 위험 항목(줄 삭제)은 글자색(빨강) 그대로 */
.pj-ctxmenu-mi { font-size: 18px; color: var(--pj-ink-soft); }
.pj-ctxmenu-item.is-danger .pj-ctxmenu-mi { color: inherit; }
.pj-ctxmenu-item:hover .pj-ctxmenu-mi { color: var(--pj-ink); }
.pj-ctxmenu-item.is-danger:hover .pj-ctxmenu-mi { color: inherit; }
.pj-ctxmenu-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-ctxmenu-check { flex: 0 0 auto; font-size: 18px; color: var(--pj-accent); }
.pj-ctxmenu-item.is-checked { font-weight: 600; }
@@ -2164,6 +2169,9 @@ textarea.pj-goal-text::placeholder { color: rgba(0, 0, 0, .3); }
@media (prefers-reduced-motion: reduce) { .pj-goal-table tr.is-new-row > *, .pj-goal-table td.is-merge-flash { animation: none; } }
/* 칸 병합 — 끌어서 고르는 동안 글 선택 막기 */
html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important; cursor: cell !important; }
/* 칸 아무 곳이나 눌러 입력 — 칸 전체가 글 입력 커서(관리자 화면) */
.pj-goal-table[data-admin="true"] tbody.pj-goal-area td.pj-goal-texttd { cursor: text; }
.pj-meet-table td.pj-meet-c-text:not(.is-prev), .pj-meet-table td.pj-meet-c-amt:not(.is-prev) { cursor: text; }
/* 월 머리 → 그 달 주간 회의록 */
/* 월 머리 칸 전체가 링크(글자만이 아니라) — 오른쪽 끝 너비 조절 손잡이(z-index 5)는 링크 위에 남는다 */
.pj-goal-mlink {
+38 -14
View File
@@ -133,6 +133,8 @@
if (e.key === "Escape") closeContextMenu();
}
// items: [{label, danger?, onClick} | null(구분선)]
// 우클릭 메뉴 왼쪽 아이콘(Material Symbols) — item.icon 에 넣는다
function menuIcon(name) { return '<span class="material-symbols-outlined pj-ctxmenu-mi">' + name + "</span>"; }
function showContextMenu(x, y, items) {
closeContextMenu();
const menu = document.createElement("div");
@@ -8249,6 +8251,18 @@
});
}
bindTexts(table);
// 칸이 세로로 길어도(옆 칸 글이 길거나 세로 병합) 칸 아무 곳이나 누르면 그 칸 입력 — 커서는 글 끝(엑셀처럼).
// 입력칸(textarea)은 글 높이만큼이라 그 아래를 누르면 아무것도 안 되던 것. Shift+클릭(범위 고르기)·끌기는 그대로.
table.addEventListener("click", function (e) {
if (e.shiftKey || e.button !== 0) return;
const td = e.target.closest("td.pj-goal-texttd");
if (!td || e.target.closest("textarea, input, button, a")) return;
const ta = td.querySelector("textarea.pj-goal-text");
if (!ta || ta === document.activeElement) return;
ta.focus();
const n = ta.value.length;
ta.setSelectionRange(n, n);
});
// 한 줄 안 칸들 높이는 표가 맞춘다 — 창 폭이 바뀌면 글 줄바꿈이 달라지니 다시 잰다.
window.addEventListener("resize", fitAll);
window.addEventListener("beforeunload", function () {
@@ -8490,18 +8504,18 @@
};
};
const items = [
{ label: "위에 줄 추가", onClick: run(function () { return insertRow(top, "above", opts.sameLabel); }) },
{ label: "아래에 줄 추가", onClick: run(function () { return insertRow(bottom, "below", opts.sameLabel); }) },
{ label: "위에 줄 추가", icon: menuIcon("add_row_above"), onClick: run(function () { return insertRow(top, "above", opts.sameLabel); }) },
{ label: "아래에 줄 추가", icon: menuIcon("add_row_below"), onClick: run(function () { return insertRow(bottom, "below", opts.sameLabel); }) },
];
if (opts.splitRow) { // 항목 칸 묶음 나누기 — 이어 붙은 줄들이 각자 항목 칸으로
items.push({ label: "항목 칸 나누기", onClick: run(async function () {
items.push({ label: "항목 칸 나누기", icon: menuIcon("horizontal_split"), onClick: run(async function () {
await api("POST", "/project/api/goals/rows/" + opts.splitRow.dataset.rowId + "/split-label");
return true;
}) });
}
// 영역의 마지막 한 줄은 못 지운다(영역을 지운다) — 서버도 400
if (canDelete && top.closest(".pj-goal-area").rows.length > 1) {
items.push(null, { label: "줄 삭제", danger: true, onClick: run(async function () {
items.push(null, { label: "줄 삭제", danger: true, icon: menuIcon("delete"), onClick: run(async function () {
return (await deleteRow(top)) ? { removed: [top] } : false;
}) });
}
@@ -8738,10 +8752,11 @@
const items = [];
if (s.n >= 2) {
const rowsN = s.r1 - s.r0 + 1, colsN = s.c1 - s.c0 + 1;
items.push({ label: "셀 병합 (" + rowsN + "줄 × " + colsN + "칸)", onClick: function () { clearMergeSel(); mergeSel(s); } });
items.push({ label: "셀 병합 (" + rowsN + "줄 × " + colsN + "칸)", icon: menuIcon("cell_merge"),
onClick: function () { clearMergeSel(); mergeSel(s); } });
}
if (mergedIn.length) {
items.push({ label: "병합 해제" + (mergedIn.length > 1 ? " (" + mergedIn.length + "곳)" : ""),
items.push({ label: "병합 해제" + (mergedIn.length > 1 ? " (" + mergedIn.length + "곳)" : ""), icon: menuIcon("call_split"),
onClick: function () { clearMergeSel(); unmerge(mergedIn); } });
}
if (td.dataset.month === "0" && s.n === 1) { // 3열(연간 칸) 하나 우클릭 — 줄 추가·삭제도
@@ -8960,6 +8975,15 @@
});
if (!table) return;
// 칸이 세로로 길어도 칸 아무 곳이나 누르면 그 칸 입력(글·금액) — 커서는 끝
table.addEventListener("click", function (e) {
if (e.button !== 0 || e.target.closest("textarea, input, select, button, a, [data-meet-edit]")) return;
const td = e.target.closest("td");
const f = td && td.querySelector("textarea.pj-meet-text, 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); }
});
// ── 달성률(지난주 결과 ÷ 지난주 목표) ──
function paintRate(tr, result) {
const td = tr.querySelector("[data-rate]");
@@ -9062,20 +9086,20 @@
const pick = function (code) {
return function () { run(async function () { await api("PUT", itemUrl(tr.dataset.item), { marketplace_code: code }); return true; }); };
};
showContextMenu(x, y, [{ label: "연결 안 함(결과 직접 입력)", checked: !cur, onClick: pick("") }, null].concat(
markets.map(function (m) { return { label: m.name, checked: m.code === cur, onClick: pick(m.code) }; })));
showContextMenu(x, y, [{ label: "연결 안 함(결과 직접 입력)", icon: menuIcon("link_off"), checked: !cur, onClick: pick("") }, null].concat(
markets.map(function (m) { return { label: m.name, icon: menuIcon("storefront"), checked: m.code === cur, onClick: pick(m.code) }; })));
}
function rowMenu(x, y, tr) {
const id = tr.dataset.item, section = tr.dataset.section;
const label = (tr.querySelector(".pj-meet-label") || {}).textContent || "";
showContextMenu(x, y, [
{ label: "위에 줄 추가", onClick: function () { run(function () { return addRow(section, id, "above"); }); } },
{ label: "아래에 줄 추가", onClick: function () { run(function () { return addRow(section, id, "below"); }); } },
{ label: "위로", onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: -1 }); return true; }); } },
{ label: "아래로", onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: 1 }); return true; }); } },
{ label: "쇼핑몰 연결(결과 자동)…", onClick: function () { setTimeout(function () { marketMenu(x, y, tr); }, 0); } },
{ label: "위에 줄 추가", icon: menuIcon("add_row_above"), onClick: function () { run(function () { return addRow(section, id, "above"); }); } },
{ label: "아래에 줄 추가", icon: menuIcon("add_row_below"), onClick: function () { run(function () { return addRow(section, id, "below"); }); } },
{ label: "위로", icon: menuIcon("arrow_upward"), onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: -1 }); return true; }); } },
{ label: "아래로", icon: menuIcon("arrow_downward"), onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: 1 }); return true; }); } },
{ label: "쇼핑몰 연결(결과 자동)…", icon: menuIcon("link"), onClick: function () { setTimeout(function () { marketMenu(x, y, tr); }, 0); } },
null,
{ label: "줄 삭제", danger: true, onClick: function () {
{ label: "줄 삭제", danger: true, icon: menuIcon("delete"), onClick: function () {
run(async function () {
const ok = await confirm("'" + (label.trim() || "이 줄") + "' 줄을 삭제할까요? 이번주 할 일·금액도 함께 삭제됩니다.",
{ okText: "삭제", cancelText: "취소" });
+6
View File
@@ -574,6 +574,12 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
(`POST /api/goals/rows/{첫 줄}/split-label` — 이어 붙은 줄들이 각자 빈 이름 항목 칸으로).
- 묶음 첫 줄 삭제 → 바로 아래 이어 붙은 줄이 첫 줄이 되고 이름이 비어 있으면 넘겨받음. 묶인 줄(첫 줄·이어 붙은 줄)과 바꾸는 ↑↓ 이동은 400
(나눈 뒤 이동), 묶음 첫 줄 도구 막대엔 ↑↓ 없음. 새 연도 만들기는 묶음도 복사한다.
- **칸 아무 곳이나 눌러 입력**(엑셀처럼) — 글 칸(textarea)은 글 높이만큼이라, 옆 칸 글이 길거나 세로 병합으로 칸이 길면 아래쪽을 눌러도
입력이 안 됐다. 이제 업무 영역 글 칸(`td.pj-goal-texttd`)·회의록 글/금액 칸 아무 곳이나 누르면 그 칸 입력으로 들어가고 커서는 글 끝.
칸 전체가 글 입력 마우스 모양. Shift+클릭(범위 고르기)·끌기(병합 선택)는 그대로.
- **우클릭 메뉴 아이콘** — `menuIcon(name)`(Material Symbols)을 `showContextMenu` 항목 `icon` 에: 위에 줄 추가 `add_row_above` ·
아래에 줄 추가 `add_row_below` · 줄 삭제 `delete`(빨강) · 셀 병합 `cell_merge` · 병합 해제 `call_split` · 항목 칸 나누기
`horizontal_split` · (회의록) 위로/아래로 `arrow_upward`/`arrow_downward` · 쇼핑몰 연결 `link` · 연결 안 함 `link_off` · 쇼핑몰 `storefront`.
- **월 머리 → 주간 회의록** — 목표 표 머리의 월 칸을 누르면 `/project/goals/{연도}/meetings/{월}`(6-9-2). 링크(`a.pj-goal-mlink`)는
글자만이 아니라 **칸 전체**(absolute inset 0), 오른쪽 끝 너비 조절 손잡이(z-index 5)는 링크 위라 그대로 끌 수 있다.
- **로아스 단위 %** — 로아스 목표·실적 칸은 `499%` 처럼 보인다(`router._goal_label`, 저장 응답 `label` 도 같음). 입력은 `499`·`499%`