feat(project): meeting rows added from the task cell stay in the same item cell (migration 027), in-place redraw with animation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 20:28:24 +09:00
parent 59add598fa
commit 3882836fd5
22 changed files with 514 additions and 72 deletions
@@ -2,7 +2,7 @@
{% block head_extra %}
{# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
{% endblock %}
@@ -64,7 +64,7 @@
</section>
</div>
<script>window.NTC_PEOPLE = {{ people | tojson }};</script>
<script src="/static/project.js?v=20261012k" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
<script src="/static/erp-notice-admin.js?v=20261012b" defer></script>
{% endif %}
{% endblock %}
+84 -7
View File
@@ -2776,7 +2776,23 @@ class ProjectStore:
return (self._MEETING_ITEM_COLS + (", line_key" if self._meeting_keys(conn) else "")
+ (", content_row_span" if self._meeting_cells(conn) else "")
+ (", result_note" if self._meeting_v20(conn) else "")
+ (", target_text, result_text" if self._meeting_v21(conn) else ""))
+ (", target_text, result_text" if self._meeting_v21(conn) else "")
+ (", label_cont" if self._meeting_v27(conn) else ""))
def _meeting_v27(self, conn: Any) -> bool:
"""마이그레이션 027 — 항목 칸 묶음(label_cont: 바로 위 줄의 항목 칸에 이어 붙는 줄)."""
if getattr(self, "_meeting_v27_ok", False):
return True
ok = self._column_exists(conn, "goal_meeting_items", "label_cont")
if ok:
self._meeting_v27_ok = True
return ok
@staticmethod
def _meeting_conts(rows: list[dict[str, Any]]) -> list[bool]:
"""줄 순서대로 '실제로 이어 붙은 줄'인가 — label_cont 이고 바로 위 줄이 같은 구역일 때만(구역 첫 줄은 늘 묶음 첫 줄)."""
return [bool(r.get("label_cont")) and i > 0 and rows[i - 1]["section"] == r["section"]
for i, r in enumerate(rows)]
def _meeting_v21(self, conn: Any) -> bool:
"""마이그레이션 021 — 정량 목표·결과 글(target_text·result_text, 예: "20개")."""
@@ -2999,6 +3015,7 @@ class ProjectStore:
if ws.weekday() != 0 and not self._meeting_v20(conn):
raise store.MeetingMigration020Needed() # 월요일만 허용하던 CHECK 가 아직 있다
keyed = self._meeting_keys(conn)
v27 = self._meeting_v27(conn)
ins = conn.execute(
"INSERT INTO goal_meetings (week_start, created_by, updated_by) VALUES (%s, %s, %s) "
"ON CONFLICT (week_start) DO NOTHING RETURNING week_start",
@@ -3006,7 +3023,8 @@ class ProjectStore:
).fetchone()
if ins is None:
return False
src_cols = "id, section, section_color, label, marketplace_code, sort_order" + (", line_key" if keyed else "")
src_cols = ("id, section, section_color, label, marketplace_code, sort_order" + (", line_key" if keyed else "")
+ (", label_cont" if v27 else ""))
src_items: list[dict[str, Any]] = []
src_is_prev = True
for cmp_, order, is_prev in (("<", "DESC", True), (">", "ASC", False)):
@@ -3042,6 +3060,12 @@ class ProjectStore:
"marketplace_code, carry_from, sort_order, updated_by) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)",
(ws, r["section"], r["section_color"], r["label"], r["marketplace_code"], carry, n, who),
)
if v27 and r.get("label_cont"):
# 항목 칸 묶음도 그대로 이어받는다(027) — 방금 넣은 줄(같은 주차·순서)
conn.execute(
"UPDATE goal_meeting_items SET label_cont = true WHERE week_start = %s AND sort_order = %s",
(ws, n),
)
else:
n = 0
for name, color in sections or [(k, "") for k in store.MEETING_TEMPLATE]:
@@ -3108,9 +3132,14 @@ class ProjectStore:
def add_meeting_item(
self, *, week_start: date, section: str, section_color: str = "", label: str = "",
ref_item_id: int | None = None, place: str = "below", updated_by: str = "",
ref_item_id: int | None = None, place: str = "below", updated_by: str = "", same_label: bool = False,
) -> int:
"""줄 추가 — 기준 줄 위/아래(같은 구역), 없으면 그 구역 끝(구역이 없으면 맨 끝 = 새 구역)."""
"""줄 추가 — 기준 줄 위/아래(같은 구역), 없으면 그 구역 끝(구역이 없으면 맨 끝 = 새 구역).
same_label(주요 업무 칸에서 추가, 027) = 새 줄을 기준 줄과 **같은 항목 칸** 안에: 아래면 새 줄이 이어 붙고(label_cont),
위면 — 기준 줄이 묶음 첫 줄이면 새 줄이 첫 줄이 되어 이름을 넘겨받고 기준 줄이 이어 붙는다(연간 목표 016 과 같은 규칙)."""
if same_label and ref_item_id is None:
raise ValueError("같은 항목 칸에 추가하려면 기준 줄이 필요합니다.")
sec = store.norm_str(section)
if not sec or len(sec) > store.MEETING_LABEL_MAX:
raise ValueError("구역 이름을 입력하세요(50자 이하).")
@@ -3141,14 +3170,31 @@ class ProjectStore:
i = same[-1] + 1 if same else len(ids)
if any(a < i <= b for a, b in self._meeting_merge_ranges(rows)):
raise ValueError("병합된 셀 안에 줄을 추가하려면 먼저 병합을 해제해 주세요.")
cont = False
if same_label:
if not self._meeting_v27(conn):
raise store.MeetingMigration027Needed()
k = ids.index(ref_item_id)
ref = rows[k]
if ref["section"] != sec:
raise ValueError("기준 줄과 같은 구역이어야 합니다.")
if place == "above" and not self._meeting_conts(rows)[k]:
# 묶음 첫 줄 위 — 새 줄이 첫 줄(이름을 넘겨받음), 기준 줄은 이어 붙는다
lb = ref["label"]
conn.execute("UPDATE goal_meeting_items SET label = '', label_cont = true WHERE id = %s",
(ref_item_id,))
else:
lb, cont = "", True
# 새 줄 = 새 연결키(018) — 이름이 같은 다른 줄과 섞이지 않는다
keyed = self._meeting_keys(conn)
v27 = self._meeting_v27(conn)
new_id = int(conn.execute(
"INSERT INTO goal_meeting_items (week_start, section, section_color, label, marketplace_code, "
"sort_order, updated_by" + (", line_key" if keyed else "") + ") VALUES (%s,%s,%s,%s,%s,0,%s"
+ (",%s" if keyed else "") + ") RETURNING id",
"sort_order, updated_by" + (", line_key" if keyed else "") + (", label_cont" if v27 else "")
+ ") VALUES (%s,%s,%s,%s,%s,0,%s" + (",%s" if keyed else "") + (",%s" if v27 else "") + ") RETURNING id",
(week_start, sec, color, lb, store.guess_meeting_market(sec, lb),
store.norm_str(updated_by, lower=True), *((str(uuid.uuid4()),) if keyed else ())),
store.norm_str(updated_by, lower=True), *((str(uuid.uuid4()),) if keyed else ()),
*((cont,) if v27 else ())),
).fetchone()["id"])
ids.insert(i, new_id)
for n, x in enumerate(ids):
@@ -3304,6 +3350,15 @@ class ProjectStore:
i = next(n for n, r in enumerate(rows) if int(r["id"]) == item_id)
if any(a <= i <= b for a, b in self._meeting_merge_ranges(rows)):
raise ValueError("병합된 셀의 줄을 삭제하려면 먼저 병합을 해제해 주세요.")
if self._meeting_v27(conn):
# 항목 칸 묶음 첫 줄을 지우면 바로 아래 이어 붙은 줄이 첫 줄이 되고 이름을 넘겨받는다(비어 있으면)
conts = self._meeting_conts(rows)
if not conts[i] and i + 1 < len(rows) and conts[i + 1]:
conn.execute(
"UPDATE goal_meeting_items SET label_cont = false, "
"label = CASE WHEN label = '' THEN %s ELSE label END WHERE id = %s",
(rows[i]["label"], rows[i + 1]["id"]),
)
row = conn.execute("DELETE FROM goal_meeting_items WHERE id = %s RETURNING id", (item_id,)).fetchone()
if row is None:
raise KeyError(item_id)
@@ -3321,6 +3376,10 @@ class ProjectStore:
return
if any(a <= i <= b or a <= j <= b for a, b in self._meeting_merge_ranges(rows)):
raise ValueError("병합된 셀의 줄을 이동하려면 먼저 병합을 해제해 주세요.")
conts = self._meeting_conts(rows)
in_group = lambda k: conts[k] or (k + 1 < len(rows) and conts[k + 1]) # noqa: E731
if in_group(i) or in_group(j):
raise ValueError("같은 항목 칸으로 묶인 줄은 옮길 수 없습니다. 항목 칸을 나눈 뒤 옮기세요.")
ids[i], ids[j] = ids[j], ids[i]
for n, x in enumerate(ids):
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
@@ -3348,6 +3407,24 @@ class ProjectStore:
for n, x in enumerate(order):
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
def split_meeting_label(self, *, item_id: int) -> int:
"""항목 칸 나누기(027) — item_id(묶음 첫 줄) 아래 이어 붙은 줄들을 각자 항목 칸으로(이름은 빈 칸). 나눈 줄 수."""
with self._pool.connection() as conn:
with conn.transaction():
self._require_meetings(conn)
if not self._meeting_v27(conn):
raise store.MeetingMigration027Needed()
rows = self._locked_meeting_items(conn, item_id)
conts = self._meeting_conts(rows)
i = next(n for n, r in enumerate(rows) if int(r["id"]) == item_id)
n = 0
for k in range(i + 1, len(rows)):
if not conts[k]:
break
conn.execute("UPDATE goal_meeting_items SET label_cont = false WHERE id = %s", (rows[k]["id"],))
n += 1
return n
# ── 회의록 작업 등록 표(025) — 주차별 한 표, 모두가 같이 본다. [적용] 전 줄은 고치고, [적용]은 한 번만 ──
# 026 — 작업 칸(parent_task_id): 고르면 [적용] 때 그 작업의 세부 작업으로(비우면 그 섹션에 새 작업).
# 025 의 parent_id(표 안 줄끼리 세부 작업)는 화면에서 쓰지 않는다(열·값은 그대로, 읽기·쓰기 안 함).
+28 -1
View File
@@ -2924,6 +2924,20 @@ def _goal_area_layout(rows: list[dict[str, Any]], this_month: int) -> None:
row["layout"] = out
def _meeting_label_spans(rows: list[dict[str, Any]]) -> None:
"""회의록 구역 한 덩어리의 항목 칸 묶음(027) — 이어 붙은 줄(label_cont, 구역 첫 줄 제외)은 항목 칸을 그리지 않고
(label_hidden) 묶음 첫 줄이 rowspan(label_span). label_shown = 그 줄이 속한 항목 이름(칸 이름표·접근성용)."""
grp: dict[str, Any] | None = None
for i, it in enumerate(rows):
if i and it.get("label_cont") and grp is not None:
it["label_hidden"] = True
grp["label_span"] += 1
else:
grp = it
it["label_hidden"], it["label_span"] = False, 1
it["label_shown"] = grp["label"]
def _goal_label_spans(rows: list[dict[str, Any]]) -> None:
"""항목 칸(2열) 묶음(016) — 묶음 첫 줄 label_span = 이어 붙은 줄 수 + 1, 이어 붙은 줄은 label_span 0(2열을 그리지 않음).
영역 첫 줄은 늘 묶음 첫 줄."""
@@ -2956,6 +2970,8 @@ def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
raise HTTPException(status_code=409, detail="회의가 완료되어 수정할 수 없습니다. 관리자가 [완료 해제]하면 다시 고칠 수 있습니다.")
except store.MeetingMigration022Needed:
raise HTTPException(status_code=503, detail="회의 완료 기능은 project_db 마이그레이션 022 적용 후 사용할 수 있습니다.")
except store.MeetingMigration027Needed:
raise HTTPException(status_code=503, detail="같은 항목 칸 안 줄 추가·항목 칸 나누기는 project_db 마이그레이션 027 적용 후 사용할 수 있습니다.")
except store.MeetingParentTaskMigrationNeeded:
raise HTTPException(status_code=503, detail="작업 칸(이미 있는 작업의 세부 작업으로 등록)은 project_db 마이그레이션 026 적용 후 사용할 수 있습니다.")
except store.MeetingTaskMigrationNeeded:
@@ -3440,6 +3456,7 @@ def _meeting_view(request: Request, st: Any, *, year: int, month: int, week: dat
meeting["sections"] = sections
for sec in sections:
covered = 0
_meeting_label_spans(sec["rows"])
for i, it in enumerate(sec["rows"]):
it["content_html"] = store.goal_text_html(it["content"])
it["content_hidden"] = covered > 0
@@ -3683,7 +3700,8 @@ def api_delete_meeting(request: Request, week_start: str) -> JSONResponse:
@router.post("/api/goals/meetings/{week_start}/items")
def api_add_meeting_item(request: Request, week_start: str, payload: dict[str, Any] = Body(...)) -> JSONResponse:
"""줄 추가 {section, label?, ref_item_id?, place?: above|below} — 기준 줄 위/아래, 없으면 구역 끝(새 구역이면 맨 끝)."""
"""줄 추가 {section, label?, ref_item_id?, place?: above|below, same_label?} — 기준 줄 위/아래, 없으면 구역 끝(새 구역이면 맨 끝).
same_label = 주요 업무 칸에서 추가 — 기준 줄과 같은 항목 칸 안에(027)."""
user = _require_user(request)
st = _db_or_503(request)
ws = _goal_call(store.validate_week_start, week_start)
@@ -3695,6 +3713,7 @@ def api_add_meeting_item(request: Request, week_start: str, payload: dict[str, A
item_id = _goal_call(
st.add_meeting_item, week_start=ws, section=payload.get("section", ""), label=payload.get("label", ""),
ref_item_id=ref_id, place=payload.get("place") or "below", updated_by=user["email"],
same_label=bool(payload.get("same_label")),
)
return JSONResponse({"ok": True, "id": item_id}, status_code=201)
@@ -3753,6 +3772,14 @@ def api_move_meeting_item(request: Request, item_id: int, payload: dict[str, Any
return JSONResponse({"ok": True})
@router.post("/api/goals/meeting-items/{item_id}/split-label")
def api_split_meeting_label(request: Request, item_id: int) -> JSONResponse:
"""항목 칸 나누기(027) — item_id = 묶음 첫 줄. 이어 붙은 줄들이 각자 항목 칸(이름 빈 칸)으로. 줄 순서와 같은 권한."""
_require_user(request)
n = _goal_call(_db_or_503(request).split_meeting_label, item_id=item_id)
return JSONResponse({"ok": True, "split": n})
# ── 회의록 작업 등록 표(025) — 주차별 한 표를 서버에(예전엔 각자 브라우저에만 있어 다른 사람 줄이 안 보였다) ──
# 보기·고치기: 회의록을 볼 수 있는 사람 누구나(회의 완료면 잠금). 줄에 고른 프로젝트는 내가 멤버인 것만 고를 수 있고,
# 내가 멤버가 아닌 프로젝트를 가리키는 남의 줄은 프로젝트·섹션 이름·만든 작업을 가린다. [적용] = 그 프로젝트 멤버만.
+4
View File
@@ -431,6 +431,10 @@ class MeetingMigration022Needed(RuntimeError):
"""회의 완료(잠금)는 마이그레이션 022 뒤에만 된다."""
class MeetingMigration027Needed(RuntimeError):
"""같은 항목 칸 안 줄 추가·항목 칸 나누기(goal_meeting_items.label_cont)는 마이그레이션 027 뒤에만 된다."""
class MeetingTaskMigrationNeeded(RuntimeError):
"""회의록 작업 등록 표(서버 저장)는 마이그레이션 025 뒤에만 된다."""
@@ -1,7 +1,7 @@
{% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -227,22 +227,25 @@
<tbody class="pj-meet-sec" data-section="{{ sec.name }}" style="--goal-bg: {{ sec.color or '#fff' }}">
{% for it in sec.rows %}
{% set p = it.prev %}
<tr data-item="{{ it.id }}" data-section="{{ sec.name }}" data-market="{{ it.marketplace_code }}" data-target-amount="{{ it.target_amount if it.target_amount is not none else '' }}"{% if p %} data-prev="{{ p.id }}" data-prev-target="{{ p.target_amount if p.target_amount is not none else '' }}"{% endif %}>
<tr data-item="{{ it.id }}" data-section="{{ sec.name }}"{% if it.label_hidden %} data-label-cont="1"{% endif %} data-market="{{ it.marketplace_code }}" data-target-amount="{{ it.target_amount if it.target_amount is not none else '' }}"{% if p %} data-prev="{{ p.id }}" data-prev-target="{{ p.target_amount if p.target_amount is not none else '' }}"{% endif %}>
{% if loop.first %}
<th class="pj-meet-c-sec" rowspan="{{ sec.rows | length }}">{{ sec.name }}
{% if edit %}<button type="button" class="pj-icon-btn pj-meet-more pj-meet-sec-more" data-meet-act="sec-menu" title="구역 메뉴(위로·아래로) · 우클릭도 됩니다"><span class="material-symbols-outlined">more_horiz</span></button>
<button type="button" class="pj-meet-sec-add" data-meet-act="sec-add" title="{{ sec.name }} 구역 끝에 줄 추가">+</button>{% endif %}
</th>
{% endif %}
<th class="pj-meet-c-label">
{# 항목 칸 — 같은 항목 칸 안에 이어 붙은 줄(027 label_cont)은 그리지 않고 묶음 첫 줄이 rowspan #}
{% if not it.label_hidden %}
<th class="pj-meet-c-label"{% if (it.label_span or 1) > 1 %} rowspan="{{ it.label_span }}"{% endif %}>
<span class="pj-meet-label-line">
<span class="pj-meet-label"{% if edit %} data-meet-edit="label" title="눌러서 이름 수정 · 우클릭 = 줄 메뉴"{% endif %}>{{ it.label }}</span>
</span>
{% if edit %}<button type="button" class="pj-icon-btn pj-meet-more" data-meet-act="menu" title="줄 메뉴"><span class="material-symbols-outlined">more_horiz</span></button>{% endif %}
</th>
{% endif %}
{% if not it.content_hidden %}
<td class="pj-meet-c-text" rowspan="{{ it.content_span or 1 }}" data-meet-item="{{ it.id }}">
{% if edit %}<div class="pj-meet-text pj-goal-text" contenteditable="true" role="textbox" aria-multiline="true" aria-label="{{ it.label }} 주요 업무" data-field="content" data-placeholder="주요 업무">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>
{% if edit %}<div class="pj-meet-text pj-goal-text" contenteditable="true" role="textbox" aria-multiline="true" aria-label="{{ it.label_shown if it.label_shown is defined else it.label }} 주요 업무" data-field="content" data-placeholder="주요 업무">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>
{% else %}<div class="pj-meet-ro">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>{% endif %}
</td>
{% endif %}
@@ -255,7 +258,7 @@
<td class="pj-meet-c-text is-prev"><div class="pj-meet-ro">{% if p.content_html is defined %}{{ p.content_html | safe }}{% else %}{{ p.content }}{% endif %}</div></td>
{# 결과(글) — 지난 주차 줄의 result_note(020). 미적용이면 보기만 #}
<td class="pj-meet-c-text is-prev pj-meet-c-note">
{% if edit and meeting.result_notes %}<textarea class="pj-meet-rnote" rows="1" data-field="result_note" data-target="prev" aria-label="{{ it.label }} 결과" placeholder="결과">{{ p.result_note or '' }}</textarea>
{% if edit and meeting.result_notes %}<textarea class="pj-meet-rnote" rows="1" data-field="result_note" data-target="prev" aria-label="{{ it.label_shown if it.label_shown is defined else it.label }} 결과" placeholder="결과">{{ p.result_note or '' }}</textarea>
{% else %}<div class="pj-meet-ro">{{ p.result_note or '' }}</div>{% endif %}
</td>
<td class="pj-meet-c-amt is-prev">{{ p.target_text or won(p.target_amount) }}</td>
@@ -294,6 +297,6 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project-meeting-cells.js?v=20261007a" defer></script>
<script src="/static/project.js?v=20261012k" defer></script>
<script src="/static/project-meeting-cells.js?v=20261012a" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -207,5 +207,5 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project.js?v=20261012k" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -699,6 +699,7 @@
<ul>
<li>구역 이름 옆 <span class="pjh-ui">+</span>는 그 구역 끝에 줄을 추가합니다. 표 아래 <span class="pjh-ui">+ 구역 추가</span>로 새 구역을 만듭니다.</li>
<li>항목 이름을 클릭하면 그 자리에서 고칩니다. 우클릭 또는 ⋯ 메뉴에서 <span class="pjh-ui">위에 줄 추가 · 아래에 줄 추가 · 위로 · 아래로 · 줄 삭제</span>를 사용합니다. 순서 이동은 같은 구역 안에서 합니다.</li>
<li><b>주요 업무</b> 칸을 우클릭해 <span class="pjh-ui">위에 줄 추가 · 아래에 줄 추가</span>를 하면 <b>항목 칸은 그대로</b> 두고 그 항목 안에 줄이 늘어납니다(줄마다 주요 업무·정량 목표는 따로). 같은 메뉴의 <span class="pjh-ui">줄 삭제</span>는 그 한 줄만 지웁니다. 묶인 항목 칸은 항목 칸 메뉴의 <span class="pjh-ui">항목 칸 나누기</span>로 다시 나눕니다. 줄을 추가·삭제하면 새로고침 없이 표가 그 자리에서 움직이며 바뀝니다.</li>
<li><b>구역 순서</b> — 첫 열 <b>구분</b> 칸을 우클릭하거나 마우스를 올려 나오는 <span class="pjh-ui">⋯</span>를 누르면 <span class="pjh-ui">구역 위로 · 구역 아래로 · 구역 끝에 줄 추가</span>가 나옵니다. 구역 안의 줄 순서·병합은 그대로 함께 옮겨지고, 다음에 만드는 회의록도 바뀐 순서를 이어받습니다(회의 완료 전까지, 누구나).</li>
<li>줄을 삭제하면 주요 업무·정량 목표도 함께 삭제됩니다. 새 줄은 지난주에 이어진 항목이 없으면 지난주 리뷰가 비어 있습니다.</li>
</ul>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -101,5 +101,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261012k" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<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=20261012k" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -108,5 +108,5 @@
});
})();
</script>
<script src="/static/project.js?v=20261012k" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -468,5 +468,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261012k" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
<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=20261012k" defer></script>
<script src="/static/project.js?v=20261012l" defer></script>
{% endblock %}
+9 -3
View File
@@ -287,19 +287,25 @@
if (merged.length) items.push({ label: "병합 해제", icon: opts.icon("call_split"), onClick: () => unmergeCells(merged) });
if (cells.some(c => editorOf(c).value)) items.push({ label: "내용 지우기 (Del)", icon: opts.icon("ink_eraser"), onClick: () => clearCells(cells) });
if (saver) {
// 주요 업무 칸에서 추가한 줄은 같은 항목 칸 안에 들어간다(항목 칸은 그대로 — 027 sameLabel)
items.push(null,
{ label: "위에 줄 추가", icon: opts.icon("add_row_above"), onClick: () => saver.addRow(cell.closest("tbody").dataset.section, cell.dataset.meetItem, "above") },
{ label: "위에 줄 추가", icon: opts.icon("add_row_above"), onClick: () => saver.addRow(cell.closest("tbody").dataset.section, cell.dataset.meetItem, "above", { sameLabel: true }) },
{ label: "아래에 줄 추가", icon: opts.icon("add_row_below"), onClick: () => {
const rows = Array.from(cell.closest("tbody").rows), bottom = rows[rows.indexOf(cell.parentElement) + cell.rowSpan - 1];
saver.addRow(cell.closest("tbody").dataset.section, bottom.dataset.item, "below");
saver.addRow(cell.closest("tbody").dataset.section, bottom.dataset.item, "below", { sameLabel: true });
} });
if (cell.rowSpan === 1 && cells.length === 1 && saver.deleteRow) {
items.push({ label: "줄 삭제", danger: true, icon: opts.icon("delete"), onClick: () => saver.deleteRow(cell.parentElement) });
}
}
}
if (items.length) items.push(null);
items.push(...widthItems(td));
if (items.length) { e.preventDefault(); opts.menu(e.clientX, e.clientY, items); }
});
return { bindSaver: s => { saver = s; }, widthItems: widthItems };
// 줄 구조를 다시 끼운 뒤(refreshMeeting) — 새 칸에 열 너비 손잡이·이동 테두리, 너비 다시 적용, 선택 풀기
function refresh() { anchor = null; clearSelection(); handles(); applyWidths(); }
return { bindSaver: s => { saver = s; }, widthItems: widthItems, refresh: refresh };
}
window.PJMeetingCells = { init: init };
})();
+3
View File
@@ -2475,6 +2475,9 @@ html.pj-goal-moving, html.pj-goal-moving * { cursor: grabbing !important; user-s
@keyframes pj-goal-merge-flash { from { box-shadow: inset 0 0 0 2px var(--pj-accent), inset 0 0 0 999px rgba(123, 104, 238, .14); }
to { box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 999px rgba(123, 104, 238, 0); } }
@media (prefers-reduced-motion: reduce) { .pj-goal-table tr.is-new-row > *, .pj-goal-table td.is-merge-flash { animation: none; } }
/* 주간 회의록 — 줄을 그 자리에서 다시 그린 뒤(refreshMeeting) 새 줄 잠깐 강조(연간 목표와 같은 색) */
.pj-meet-table tr.is-new-row > * { animation: pj-goal-row-new 1.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .pj-meet-table tr.is-new-row > * { animation: none; } }
/* 칸 병합 — 끌어서 고르는 동안 글 선택 막기 */
html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important; cursor: cell !important; }
/* 칸 아무 곳이나 눌러 입력 — 칸 전체가 글 입력 커서(관리자 화면) */
+145 -29
View File
@@ -10572,6 +10572,7 @@
btn.setAttribute("aria-pressed", prevFirst ? "true" : "false");
}
arrange();
table.addEventListener("pj-meet-rows", arrange); // 줄 구조를 다시 끼운 뒤(refreshMeeting) 새 줄도 같은 순서로
btn.addEventListener("click", function () {
prevFirst = !prevFirst;
try { localStorage.setItem(KEY, prevFirst ? "prev" : "this"); } catch (_) {}
@@ -11408,7 +11409,10 @@
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); },
onSaved: function (ta) {
const n = ta.closest("td") || ta; clearSaveFailed(n); flashSaved(n);
if (pendingMeetRefresh && !textSaver.anyDirty()) refreshMeeting().catch(function (err) { showToast(err.message, "error"); });
},
onClear: function (ta) { clearSaveFailed(ta.closest("td") || ta); },
onFail: function (ta, err) { markSaveFailed(ta.closest("td") || ta, err); },
});
@@ -11433,8 +11437,11 @@
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); }); },
reload: reloadKeepScroll });
rowMenu: rowMenu,
// 주요 업무 칸 메뉴 — 위/아래 줄 추가는 같은 항목 칸 안에(027, 이름을 묻지 않음), 줄 삭제
addRow: function (section, ref, place, o) { run(function () { return addRow(section, ref, place, o && o.sameLabel); }); },
deleteRow: function (tr) { run(function () { return deleteRow(tr); }); },
reload: function () { refreshMeeting().catch(function (err) { showToast("처리 실패: " + err.message, "error"); }); } });
if (table && window.PJGoalText) window.PJGoalText.init(table, el("pj-goal-format"));
if (restored) showToast("저장되지 않았던 글 " + restored + "칸을 되살려 다시 저장합니다.");
else if (conflict) showToast("다른 곳에서 바뀐 칸 " + conflict + "개는 예전 초안을 되살리지 않았습니다.");
@@ -11500,41 +11507,150 @@
span.addEventListener("blur", onBlur);
});
// ── 줄 메뉴(⋯ · 항목 우클릭) — 위/아래 줄 추가 · 순서 · 삭제 ──
// 줄 작업 뒤엔 새로고침 — 그 전에 저장 안 된 칸(대기·진행 중·실패)을 저장하고, 실패하면 작업 자체를 하지 않는다(초안 유지)
async function run(fn) {
try {
await flushAll();
if (!(await fn())) return;
await flushAll();
reloadKeepScroll();
} catch (err) { showToast("처리 실패: " + err.message, "error"); }
// ── 줄 메뉴(⋯ · 항목 우클릭) — 위/아래 줄 추가 · 순서 · 항목 칸 나누기 · 삭제 ──
// 줄 작업 전에 저장 안 된 칸(대기·진행 중·실패)을 저장하고, 실패하면 작업 자체를 하지 않는다(초안 유지).
// 작업 뒤엔 새로고침 대신 표만 그 자리에서 다시 그린다(refreshMeeting — 연간 목표 표와 같은 애니메이션).
// fn 이 true 면 다시 그리기, { removed: [tr…] } 면 그 줄을 흐리게 지운 뒤 다시 그리기, false 면 아무것도 안 함.
let meetStruct = Promise.resolve();
function run(fn) {
const job = meetStruct.then(async function () { // 줄 작업은 한 번에 하나씩(앞 작업 다시 그리기가 끝난 뒤)
try {
await flushAll();
const r = await fn();
if (!r) return;
await flushAll();
await refreshMeeting(r === true ? {} : r);
} catch (err) { showToast("처리 실패: " + err.message, "error"); }
});
meetStruct = job;
return job;
}
async function addRow(section, ref, place) {
// sameLabel(주요 업무 칸에서) = 기준 줄과 같은 항목 칸 안에 — 이름을 묻지 않는다(027)
async function addRow(section, ref, place, sameLabel) {
if (sameLabel) {
await api("POST", meetingUrl + "/items", { section: section, label: "", ref_item_id: ref, place: place, same_label: true });
return true;
}
const v = await prompt("새 줄 이름 (예: 쿠팡 — 비워 둬도 됩니다)", "");
if (v == null) return false;
await api("POST", meetingUrl + "/items", { section: section, label: String(v).trim(), ref_item_id: ref, place: place });
return true;
}
// 항목 칸 묶음의 첫 줄(이어 붙은 줄이면 위로 거슬러 올라감)·맨 아래 줄
function groupHead(tr) {
let r = tr;
while (r && r.dataset.labelCont === "1" && r.previousElementSibling) r = r.previousElementSibling;
return r;
}
function groupBottom(tr) {
const head = groupHead(tr), th = head.querySelector("th.pj-meet-c-label");
const rows = Array.from(head.closest("tbody").rows);
return rows[Math.min(rows.length - 1, rows.indexOf(head) + ((th && th.rowSpan) || 1) - 1)];
}
async function deleteRow(tr) {
const head = groupHead(tr);
const label = ((head.querySelector(".pj-meet-label") || {}).textContent || "").trim();
const grouped = groupBottom(tr) !== head;
const msg = !grouped ? "'" + (label || "이 줄") + "' 줄을 삭제할까요? 주요 업무·금액도 함께 삭제됩니다."
: tr === head ? "'" + (label || "이 항목") + "' 항목의 첫 줄을 삭제할까요? 주요 업무·금액도 함께 삭제되고, 아래 줄이 항목 이름을 이어받습니다."
: "'" + (label || "이 항목") + "' 항목의 이 줄을 삭제할까요? 주요 업무·금액도 함께 삭제됩니다.";
const ok = await confirm(msg, { okText: "삭제", cancelText: "취소" });
if (!ok) return false;
await api("DELETE", itemUrl(tr.dataset.item));
return { removed: [tr] };
}
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, [
tr = groupHead(tr);
const id = tr.dataset.item, section = tr.dataset.section, bottom = groupBottom(tr);
const grouped = bottom !== tr;
// 항목 칸에서 추가 = 항목 칸 밖에 따로(묶음 맨 위·맨 아래 기준). 묶인 칸은 순서 대신 "항목 칸 나누기"
const items = [
{ 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; }); } },
null,
{ label: "줄 삭제", danger: true, icon: menuIcon("delete"), onClick: function () {
run(async function () {
const ok = await confirm("'" + (label.trim() || "이 줄") + "' 줄을 삭제할까요? 주요 업무·금액도 함께 삭제됩니다.",
{ okText: "삭제", cancelText: "취소" });
if (!ok) return false;
await api("DELETE", itemUrl(id));
return true;
{ label: "아래에 줄 추가", icon: menuIcon("add_row_below"), onClick: function () { run(function () { return addRow(section, bottom.dataset.item, "below"); }); } },
];
if (grouped) {
items.push({ label: "항목 칸 나누기", icon: menuIcon("horizontal_split"), onClick: function () {
run(async function () { await api("POST", itemUrl(id) + "/split-label"); return true; });
} });
} else {
items.push(
{ 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; }); } });
}
items.push(null, { label: grouped ? "첫 줄 삭제" : "줄 삭제", danger: true, icon: menuIcon("delete"), onClick: function () {
run(function () { return deleteRow(tr); });
} });
showContextMenu(x, y, items.concat(cellGrid ? [null].concat(cellGrid.widthItems(tr.querySelector("th.pj-meet-c-label"))) : []));
}
// ── 줄 구조가 바뀐 뒤(줄 추가·삭제·이동·항목 칸 나누기·구역 이동·셀 병합) 새로고침 없이 표의 구역 부분만 서버에서 다시 받아
// 그 자리에서 바꿔 끼운다(연간 목표 refreshTable 과 같은 방식) — 지운 줄은 흐려지며 사라지고, 남은 줄은 예전 자리에서
// 새 자리로 미끄러지고(FLIP), 새 줄은 위에서 내려오며 잠깐 강조. 동작 줄이기 설정이면 애니메이션 없이.
// 글 보호: 시작 전에 저장(실패하면 throw — 표는 그대로), 받는 사이에 새로 입력한 글이 있으면 저장 후 다시 받고,
// 계속 입력 중이면 바꿔 끼우지 않고 저장이 끝난 뒤 다시 그린다(pendingMeetRefresh). 받아 오기에 실패하면 예전처럼 새로고침.
const MEET_ANIM_MS = 280;
let pendingMeetRefresh = false;
async function refreshMeeting(opts) {
opts = opts || {};
await flushAll();
const reduce = !Element.prototype.animate ||
(window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
const busy = function () {
return textSaver.anyDirty() || amtSaver.anyDirty() || !!table.querySelector("[data-meet-edit].is-editing");
};
let fresh = null, anims = [];
for (let tries = 0; ; tries++) {
fresh = null;
try {
const res = await fetch(location.href, { credentials: "same-origin", cache: "no-store" });
if (res.ok) fresh = new DOMParser().parseFromString(await res.text(), "text/html").getElementById("pj-meet-table");
} catch (_) { fresh = null; }
if (!busy() && opts.removed && opts.removed.length && !reduce && !anims.length) {
anims = opts.removed.filter(function (tr) { return tr.isConnected; }).map(function (tr) {
return tr.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 180, easing: "ease-in", fill: "forwards" });
});
} },
].concat(cellGrid ? [null].concat(cellGrid.widthItems(tr.querySelector("th.pj-meet-c-label"))) : []));
await Promise.all(anims.map(function (a) { return a.finished.catch(function () {}); }));
}
if (!busy()) break;
anims.forEach(function (a) { try { a.cancel(); } catch (_) {} });
anims = [];
if (tries >= 2) {
pendingMeetRefresh = true;
showToast("입력 중인 칸이 있어 표를 아직 다시 그리지 않았습니다 — 저장되면 다시 그립니다.");
return;
}
await flushAll(); // 받는 동안 새로 입력한 글 — 저장 실패면 throw(표는 그대로)
}
if (!fresh) { reloadKeepScroll(); return; }
pendingMeetRefresh = false;
const before = new Map();
table.querySelectorAll("tbody.pj-meet-sec > tr[data-item]").forEach(function (tr) {
before.set(tr.dataset.item, tr.getBoundingClientRect().top);
});
table.querySelectorAll("tbody.pj-meet-sec").forEach(function (t) { t.remove(); });
fresh.querySelectorAll("tbody.pj-meet-sec").forEach(function (t) { table.appendChild(document.importNode(t, true)); });
textSaver.prune();
amtSaver.prune();
table.querySelectorAll(".pj-meet-text, .pj-meet-rnote").forEach(bindText);
table.querySelectorAll("input.pj-meet-amount").forEach(bindAmount);
table.dispatchEvent(new CustomEvent("pj-meet-rows")); // 이번주 ↔ 지난주 칸 순서(initMeetOrder)
if (cellGrid && cellGrid.refresh) cellGrid.refresh(); // 열 너비 손잡이·이동 테두리·선택
if (reduce) return;
table.querySelectorAll("tbody.pj-meet-sec > tr[data-item]").forEach(function (tr) {
const top = tr.getBoundingClientRect().top;
if (before.has(tr.dataset.item)) {
const dy = before.get(tr.dataset.item) - top;
if (Math.abs(dy) > 1) {
tr.animate([{ transform: "translateY(" + dy + "px)" }, { transform: "translateY(0)" }],
{ duration: MEET_ANIM_MS, easing: "cubic-bezier(.2,.8,.2,1)" });
}
} else {
tr.animate([{ opacity: 0, transform: "translateY(-10px)" }, { opacity: 1, transform: "translateY(0)" }],
{ duration: MEET_ANIM_MS + 40, easing: "cubic-bezier(.2,.8,.2,1)" });
tr.classList.add("is-new-row");
setTimeout(function () { tr.classList.remove("is-new-row"); }, 1400);
}
});
}
// ── 구역 메뉴(구분 칸 ⋯ · 우클릭) — 구역을 통째로 위/아래(그 안의 줄 순서·병합은 그대로), 구역 끝에 줄 추가 ──
function secMenu(x, y, tbody) {