feat(project): 연간 목표 상·하반기 → 1~4분기, 주간 회의록 머리·표 다듬기

연간 목표 표
- 3·6·9·12월 오른쪽에 1~4분기 칸(글 칸 13=1분기·15=2분기·14=3분기·16=4분기 — 예전 반기 칸 번호를 이어 써서
  글 옮기기 없음, 예전 상반기 글은 1분기·하반기 글은 3분기에 보임)
- 분기 합계·달성률·로아스 가중 평균, 분기 접기(pj_goal_fold_q), 열 너비 키 q1~q4
- 가로 병합은 같은 분기 월 칸 안에서만(서버·화면·DB CHECK), 분기를 넘는 예전 병합은 잘라서 그림
- 마이그레이션 017: goal_cells 월 칸 0~16, 분기를 넘는 병합은 분기 끝까지로 줄임(글 유지),
  회의록 줄 이름 "메타(숫자)" → "메타". 미적용이면 2·4분기 칸 읽기 전용 + 503

주간 회의록
- 달력 폭 줄이고(174px) 글자·칸 5% 키움, 주차 탭은 달력 바로 왼쪽
- 지난주 리뷰 머리에 지난주 기간, "목표 금액" → "정량 목표", "목표 표에서 보기" 삭제
- 첫 회의록 기본 줄 "메타(숫자)" → "메타"

도움말·문서·테스트 갱신, project.css/js 캐시 버전 올림

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 16:30:24 +09:00
parent b791f7be68
commit 51727e419a
16 changed files with 283 additions and 143 deletions
+20 -4
View File
@@ -1841,6 +1841,15 @@ class ProjectStore:
with self._pool.connection() as conn:
return self._table_exists(conn, "goal_years")
@staticmethod
def _goal_quarters(conn: Any) -> bool:
"""마이그레이션 017(분기) 적용 여부 — goal_cells 월 칸 CHECK 가 16(4분기)까지 받는가."""
row = conn.execute(
"SELECT pg_get_constraintdef(c.oid) AS d FROM pg_constraint c "
"WHERE c.conname = 'goal_cells_month_check' AND c.conrelid = 'goal_cells'::regclass"
).fetchone()
return bool(row) and "16" in str(row["d"])
def goals_halves_enabled(self) -> bool:
"""상·하반기 글 칸·월 칸 병합(마이그레이션 014) 적용 여부."""
with self._pool.connection() as conn:
@@ -1931,7 +1940,8 @@ class ProjectStore:
metrics = {"sales": {"target": {1: 12.0, ...}, "actual": {...}}, "roas": {...}}
areas = [{id, name, color, rows: [{id, label, cells: {0: "연간 글", 1: "1월 글", 13: "상반기 글", ...},
merges: {시작 칸: (가로 칸 수, 세로 줄 수)}}]}]
halves = 마이그레이션 014 적용 여부(상·하반기 글 칸·병합)
halves = 마이그레이션 014 적용 여부(기간 글 칸·병합 — 이름은 예전 그대로, 지금은 분기 칸)
quarters = 마이그레이션 017 적용 여부(2·4분기 칸 15·16 저장)
rect = 마이그레이션 015 적용 여부(세로 병합·연간/반기 칸 병합·주간 회의록)
"""
with self._pool.connection() as conn:
@@ -1962,6 +1972,7 @@ class ProjectStore:
).fetchall()
halves = self._table_exists(conn, "goal_cell_merges")
rect = halves and self._column_exists(conn, "goal_cell_merges", "row_span")
quarters = halves and self._goal_quarters(conn)
merge_rows = conn.execute(
"SELECT m.row_id, m.start_month, m.span" + (", m.row_span" if rect else "") + " FROM goal_cell_merges m "
"JOIN goal_rows r ON r.id = m.row_id JOIN goal_areas a ON a.id = r.area_id "
@@ -1993,7 +2004,8 @@ class ProjectStore:
for a in area_rows
]
return {"year": int(head["year"]), "sales_unit": head["sales_unit"],
"metrics": metrics, "areas": areas, "halves": halves, "rect": rect, "groups": groups}
"metrics": metrics, "areas": areas, "halves": halves, "rect": rect, "groups": groups,
"quarters": quarters}
def set_goal_metric(
self, *, year: int, metric: str, kind: str, month: int, value: float | None, updated_by: str = ""
@@ -2268,6 +2280,8 @@ class ProjectStore:
halves = self._table_exists(conn, "goal_cell_merges")
if m > 12 and not halves:
raise store.GoalMigration014Needed()
if m in store.GOAL_Q_NEW and not self._goal_quarters(conn):
raise store.GoalMigration017Needed()
if halves:
# 병합에 가려진 칸(글은 왼쪽 위 칸에만 둔다) — 다른 창에서 병합된 뒤의 늦은 저장
area_id = conn.execute("SELECT area_id FROM goal_rows WHERE id = %s", (row_id,)).fetchone()["area_id"]
@@ -2334,7 +2348,7 @@ class ProjectStore:
) -> dict[str, int]:
"""업무 영역 칸을 엑셀처럼 사각형으로 합친다 → {row_id(왼쪽 위 줄), start, span, row_span}.
줄은 같은 영역 안 연속된 줄, 칸은 화면 순서(연간·1~6월·상반기·7~12월·하반기) — 가로는 같은 반기 월 칸끼리만.
줄은 같은 영역 안 연속된 줄, 칸은 화면 순서(연간·1~3월·1분기·…·10~12월·4분기) — 가로는 같은 분기 월 칸끼리만.
걸친 기존 병합은 통째로 흡수(엑셀이 선택을 넓히듯). 글은 범위 안 칸들의 글을 왼쪽 위부터 줄·칸 순서대로
줄바꿈으로 이어 왼쪽 위 칸에 두고, 나머지 칸 글은 지운다(글을 잃지 않게)."""
who = store.norm_str(updated_by, lower=True)
@@ -2367,8 +2381,10 @@ class ProjectStore:
row_span = r1 - r0 + 1
if span * row_span < 2:
raise ValueError("두 칸 이상 골라야 병합할 수 있습니다.")
if (row_span > 1 or start in (store.GOAL_YEAR, store.GOAL_H1, store.GOAL_H2)) and not rect:
if (row_span > 1 or start == store.GOAL_YEAR or start in store.GOAL_COL_QUARTER) and not rect:
raise store.GoalMigration015Needed()
if start in store.GOAL_Q_NEW and not self._goal_quarters(conn):
raise store.GoalMigration017Needed()
rows_in = ids[r0:r1 + 1]
cols_in = list(store.GOAL_COL_ORDER[c0:c1 + 1])
bodies = {(int(c["row_id"]), int(c["month"])): str(c["body"]).strip() for c in conn.execute(
+18 -11
View File
@@ -2514,7 +2514,8 @@ def inbox_page(request: Request) -> HTMLResponse:
# 조회: project 권한자 전원 · 입력/구조 변경: 관리자(is_admin) 전용
# ────────────────────────────────────────────────────────────
_GOALS_MIGRATION_MSG = "연간 목표 기능이 아직 준비되지 않았습니다(DB 마이그레이션 013 필요)."
_GOALS_014_MSG = "상·하반기 칸과 칸 병합은 DB 마이그레이션 014 가 필요합니다."
_GOALS_014_MSG = "분기 칸과 칸 병합은 DB 마이그레이션 014 가 필요합니다."
_GOALS_017_MSG = "2·4분기 칸은 DB 마이그레이션 017 이 필요합니다."
_GOALS_015_MSG = "세로 병합·연간/반기 칸 병합과 주간 회의록은 DB 마이그레이션 015 가 필요합니다."
_GOALS_016_MSG = "같은 항목 칸 안에 줄 추가(3열)는 DB 마이그레이션 016 이 필요합니다."
@@ -2535,11 +2536,12 @@ def _goal_label(metric: str, v: float | None) -> str:
def _goal_area_layout(rows: list[dict[str, Any]], this_month: int) -> None:
"""업무 영역 줄마다 칸 배치(row["layout"]) — 연간 · 1~6월 · 상반기 · 7~12월 · 하반기 순서, 엑셀식 사각형 병합.
"""업무 영역 줄마다 칸 배치(row["layout"]) — 연간 · 1~3월 · 1분기 · 4~6월 · 2분기 … 4분기 순서, 엑셀식 사각형 병합.
병합(row["merges"] = {시작 칸: (가로 칸 수, 세로 줄 수)})의 시작 칸은 {"span", "rspan"}(colspan/rowspan),
병합에 가려진 칸은 빼고 그린다. 칸 = {"m", "kind": year|month|half, "h", "span", "rspan", "now"}.
가로는 같은 반기 월 칸 안, 세로는 영역 끝까지로 자른다. 겹치는 병합(있을 수 없지만)은 나중 것을 무시."""
병합에 가려진 칸은 빼고 그린다. 칸 = {"m", "kind": year|month|quarter, "h"(분기 1~4), "span", "rspan", "now"}.
가로는 같은 분기 월 칸 안(예전 반기 병합이 분기를 넘으면 여기서 잘림), 세로는 영역 끝까지로 자른다.
겹치는 병합(있을 수 없지만)은 나중 것을 무시."""
order = store.GOAL_COL_ORDER
covered: set[tuple[int, int]] = set()
anchors: dict[tuple[int, int], tuple[int, int]] = {}
@@ -2562,8 +2564,8 @@ def _goal_area_layout(rows: list[dict[str, Any]], this_month: int) -> None:
if (ri, ci) in covered:
continue
span, rspan = anchors.get((ri, ci), (1, 1))
kind = "year" if m == store.GOAL_YEAR else "half" if m in (store.GOAL_H1, store.GOAL_H2) else "month"
h = 0 if kind == "year" else (1 if m == store.GOAL_H1 else 2) if kind == "half" else store.goal_half_of(m)
kind = "year" if m == store.GOAL_YEAR else "quarter" if m in store.GOAL_COL_QUARTER else "month"
h = 0 if kind == "year" else store.GOAL_COL_QUARTER[m] if kind == "quarter" else store.goal_quarter_of(m)
out.append({"m": m, "kind": kind, "h": h, "span": span, "rspan": rspan,
"now": kind == "month" and m <= this_month <= m + span - 1})
row["layout"] = out
@@ -2593,6 +2595,8 @@ def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
raise HTTPException(status_code=503, detail=_GOALS_015_MSG)
except store.GoalMigration016Needed:
raise HTTPException(status_code=503, detail=_GOALS_016_MSG)
except store.GoalMigration017Needed:
raise HTTPException(status_code=503, detail=_GOALS_017_MSG)
except UndefinedTable:
raise HTTPException(status_code=503, detail=_GOALS_MIGRATION_MSG)
except KeyError:
@@ -2656,8 +2660,9 @@ def goals_page(request: Request, year: int) -> HTMLResponse:
"goal_year": year,
"board": board,
"months": list(range(1, 13)),
"halves": [(1, list(range(1, 7)), store.GOAL_H1, "상반기"),
(2, list(range(7, 13)), store.GOAL_H2, "하반기")],
# 분기 — (분기, 그 분기 월, 분기 글 칸 번호, 이름). 분기 칸은 그 분기 월 바로 오른쪽
"quarters": [(q, list(range(q * 3 - 2, q * 3 + 1)), store.GOAL_QUARTER_COL[q], f"{q}분기")
for q in (1, 2, 3, 4)],
"this_month": this_month,
"goal_area_colors": list(store.GOAL_AREA_COLORS),
},
@@ -2790,7 +2795,8 @@ def api_move_goal_row(request: Request, row_id: int, payload: dict[str, Any] = B
def api_set_goal_cell(
request: Request, row_id: int, month: int, payload: dict[str, Any] = Body(...)
) -> JSONResponse:
"""업무 영역 칸 글 — month 0 = 연간, 1~12 = 월, 13 = 상반기, 14 = 하반기(014). 빈 글 = 지움."""
"""업무 영역 칸 글 — month 0 = 연간, 1~12 = 월, 분기 칸 13 = 1분기 · 15 = 2분기 · 14 = 3분기 · 16 = 4분기
(014, 15·16 은 017). 빈 글 = 지움."""
user = _require_admin(request)
st = _db_or_503(request)
_goal_call(
@@ -2802,8 +2808,8 @@ def api_set_goal_cell(
@router.post("/api/goals/areas/{area_id}/merge")
def api_merge_goal_rect(request: Request, area_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
"""엑셀식 병합 {row_from, row_to(줄 id), col_from, col_to(칸 번호 0·1~12·13·14)} — 같은 영역 안 사각형,
가로는 같은 반기 월 칸끼리. 걸친 병합은 흡수, 글은 왼쪽 위부터 이어서 왼쪽 위 칸에."""
"""엑셀식 병합 {row_from, row_to(줄 id), col_from, col_to(칸 번호 0·1~12·13~16)} — 같은 영역 안 사각형,
가로는 같은 분기 월 칸끼리. 걸친 병합은 흡수, 글은 왼쪽 위부터 이어서 왼쪽 위 칸에."""
user = _require_admin(request)
st = _db_or_503(request)
res = _goal_call(
@@ -3081,6 +3087,7 @@ def goal_meeting_page(request: Request, year: int, month: int, week: str | None
"week_n": next(i + 1 for i, (w, _) in enumerate(weeks) if w == sel),
"week_end": (sel + timedelta(days=6)).isoformat(),
"prev_week": (sel - timedelta(days=7)).isoformat(),
"prev_week_end": (sel - timedelta(days=1)).isoformat(),
# 주차를 열면 다시 받을 매출 기간(실적 모듈 매출 업데이트) — 지난주 월요일 ~ 이번 주 일요일(오늘까지)
"sync_from": (sel - timedelta(days=7)).isoformat() if sel - timedelta(days=7) <= today else "",
"sync_to": min(sel + timedelta(days=6), today).isoformat(),
+28 -20
View File
@@ -388,32 +388,40 @@ def validate_goal_year(y: Any) -> int:
class GoalMigration014Needed(RuntimeError):
"""상·하반기 글 칸·월 칸 병합은 마이그레이션 014(goal_cell_merges) 뒤에만 된다."""
"""기간(분기) 글 칸·월 칸 병합은 마이그레이션 014(goal_cell_merges) 뒤에만 된다."""
class GoalMigration017Needed(RuntimeError):
"""2·4분기 글 칸(15·16)은 마이그레이션 017(분기) 뒤에만 된다."""
GOAL_YEAR = 0 # 업무 영역 글 칸 — 연간
GOAL_H1 = 13 # 상반기(1~6월) — 마이그레이션 014
GOAL_H2 = 14 # 하반기(7~12월)
# 분기 글 칸(2026-10-01 상·하반기 → 1~4분기). 칸 번호는 예전 반기 칸을 그대로 이어 쓴다 — 데이터 옮기기 없이
# 예전 상반기 글(13)은 1분기, 하반기 글(14)은 3분기에 보인다. 2분기(15)·4분기(16)는 마이그레이션 017 뒤에 저장.
GOAL_QUARTER_COL: dict[int, int] = {1: 13, 2: 15, 3: 14, 4: 16}
GOAL_COL_QUARTER: dict[int, int] = {c: q for q, c in GOAL_QUARTER_COL.items()}
GOAL_Q_NEW: tuple[int, ...] = (15, 16) # 017 이 있어야 저장되는 분기 칸
GOAL_MAX_COL = 16
def goal_half_of(month: int) -> int:
"""1~6월 → 1(상반기), 7~12월 → 2(하반기)."""
return 1 if month <= 6 else 2
def goal_quarter_of(month: int) -> int:
"""1~3월 → 1분기, 4~6월 → 2분기, 7~9월 → 3분기, 10~12월 → 4분기."""
return (int(month) - 1) // 3 + 1
def validate_goal_month(m: Any, *, allow_year: bool = False) -> int:
"""1~12월. allow_year 이면 업무 영역 글 칸 — 0(연간)·13(상반기)·14(하반기)도 허용."""
"""1~12월. allow_year 이면 업무 영역 글 칸 — 0(연간)·13~16(분기 칸, GOAL_QUARTER_COL)도 허용."""
try:
v = int(m)
except (TypeError, ValueError):
raise ValueError("월이 올바르지 않습니다.")
if not ((0 if allow_year else 1) <= v <= (GOAL_H2 if allow_year else 12)):
if not ((0 if allow_year else 1) <= v <= (GOAL_MAX_COL if allow_year else 12)):
raise ValueError("월이 올바르지 않습니다.")
return v
def validate_goal_merge(start: Any, end: Any) -> tuple[int, int]:
"""월 칸 병합 범위(start~end 월, 2칸 이상) — 상반기·하반기를 넘지 않는다."""
"""월 칸 병합 범위(start~end 월, 2칸 이상) — 분기를 넘지 않는다."""
try:
s, e = int(start), int(end)
except (TypeError, ValueError):
@@ -422,8 +430,8 @@ def validate_goal_merge(start: Any, end: Any) -> tuple[int, int]:
s, e = e, s
if not (1 <= s and e <= 12) or s == e:
raise ValueError("병합은 1~12월 안에서 2칸 이상 골라야 합니다.")
if goal_half_of(s) != goal_half_of(e):
raise ValueError("상반기(1~6월)와 하반기(7~12월)를 넘어 병합할 수 없습니다.")
if goal_quarter_of(s) != goal_quarter_of(e):
raise ValueError("분기(1~3·4~6·7~9·10~12월)를 넘어 병합할 수 없습니다.")
return s, e
@@ -481,22 +489,22 @@ class GoalMigration016Needed(RuntimeError):
"""항목 칸(2열) 묶음(같은 항목 칸 안에 줄 추가)은 마이그레이션 016 뒤에만 된다."""
# 업무 영역 글 칸의 화면 순서 — 연간 · 1~6월 · 상반기 · 7~12월 · 하반기
GOAL_COL_ORDER: tuple[int, ...] = (0, 1, 2, 3, 4, 5, 6, GOAL_H1, 7, 8, 9, 10, 11, 12, GOAL_H2)
# 업무 영역 글 칸의 화면 순서 — 연간 · 1~3월 · 1분기 · 4~6월 · 2분기 · 7~9월 · 3분기 · 10~12월 · 4분기
GOAL_COL_ORDER: tuple[int, ...] = (0, 1, 2, 3, 13, 4, 5, 6, 15, 7, 8, 9, 14, 10, 11, 12, 16)
def goal_col_group(m: int) -> str:
"""병합 가능 묶음 — 가로 병합은 같은 묶음 안에서만(연간·반기 칸은 혼자, 월은 같은 반기끼리)."""
"""병합 가능 묶음 — 가로 병합은 같은 묶음 안에서만(연간·분기 칸은 혼자, 월은 같은 분기끼리)."""
if m == GOAL_YEAR:
return "year"
if m in (GOAL_H1, GOAL_H2):
return f"half{1 if m == GOAL_H1 else 2}"
return f"months{goal_half_of(m)}"
if m in GOAL_COL_QUARTER:
return f"q{GOAL_COL_QUARTER[m]}"
return f"months{goal_quarter_of(m)}"
def validate_goal_rect_cols(col_from: Any, col_to: Any) -> tuple[int, int]:
"""병합할 칸 범위(화면 순서의 양 끝 칸 번호) → (시작 칸 번호, 가로 칸 수).
가로로 여러 칸이면 같은 반기의 월 칸끼리만 — 연간·상반기·하반기 칸은 세로로만 합칠 수 있다."""
가로로 여러 칸이면 같은 분기의 월 칸끼리만 — 연간·분기 칸은 세로로만 합칠 수 있다."""
try:
a, b = int(col_from), int(col_to)
except (TypeError, ValueError):
@@ -506,7 +514,7 @@ def validate_goal_rect_cols(col_from: Any, col_to: Any) -> tuple[int, int]:
ia, ib = sorted((GOAL_COL_ORDER.index(a), GOAL_COL_ORDER.index(b)))
cols = GOAL_COL_ORDER[ia:ib + 1]
if len({goal_col_group(m) for m in cols}) > 1:
raise ValueError("연간·상반기·하반기 칸은 세로로만, 월 칸은 같은 반기 안에서만 합칠 수 있습니다.")
raise ValueError("연간·분기 칸은 세로로만, 월 칸은 같은 분기 안에서만 합칠 수 있습니다.")
return cols[0], len(cols)
@@ -518,7 +526,7 @@ MEETING_LABEL_MAX = 50
# 그 줄들로, 없는 구역은 빈 줄 하나. 다음 주부터는 지난주 회의록 줄을 그대로 이어받는다.
MEETING_TEMPLATE: dict[str, tuple[str, ...]] = {
"상품": ("상품1", "상품2", "상품3", "상품4", "상품5"),
"마케팅": ("메타(숫자)", "구글", "네이버", "기타.신규"),
"마케팅": ("메타", "구글", "네이버", "기타.신규"),
"컨텐츠": ("내용1", "내용2", "내용3", "내용4", "내용5"),
"유통": ("신규 인플루언서", "콜라보", "쿠팡", "네이버", "gs", "토스", "애터미", "해외", "오프라인", "기타"),
}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001x" />
<link rel="stylesheet" href="/static/project.css?v=20261001y" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -13,7 +13,7 @@
{% block content %}
{# 주간 회의록 — 목표 표 월 머리를 누르면 열린다(/project/goals/{연도}/meetings/{월}?week=월요일).
주(월~일)마다 회의록 하나: 머리(월 목표·지난주까지 누적·주당 필요 매출, 전주 목표·결과, 금주 목표·현재)
+ 구역(목표 표 업무 영역)별 줄 — 이번주 할 일·목표 금액 | 전주 할 일·목표·결과·달성률·평가.
+ 구역(목표 표 업무 영역)별 줄 — 이번주 할 일·정량 목표 | 전주 할 일·목표·결과·달성률·평가.
전주 칸은 지난 회의록의 같은 줄(carry_from). 쇼핑몰 연결 줄의 결과·전주/금주 매출·누적은 실적 모듈에서 자동.
입력은 관리자만(칸별 즉시 저장, project.js initGoalMeeting). DB: project_db 015 (goal_meetings·goal_meeting_items). #}
<div class="pj-wrap pj-inbox-view pj-goal-view pj-meet-view">
@@ -56,8 +56,7 @@
{# 이 달 계획 — 연간 목표 표의 그 달 열 글(업무 영역별, router._month_plan) #}
{% if month_plan is not none %}
<section class="pj-meet-plan">
<div class="pj-meet-plan-head"><span class="material-symbols-outlined">event_note</span>{{ goal_month }}월 계획
<a href="/project/goals/{{ goal_year }}">목표 표에서 보기</a></div>
<div class="pj-meet-plan-head"><span class="material-symbols-outlined">event_note</span>{{ goal_month }}월 계획</div>
{% if month_plan %}
<div class="pj-meet-plan-grid">
{% for a in month_plan %}
@@ -188,13 +187,13 @@
<tr class="pj-meet-group">
<th colspan="2"></th>
<th colspan="2" class="is-this">이번주 ({{ week[5:] | replace('-', '/') }} ~ {{ week_end[5:] | replace('-', '/') }})</th>
<th colspan="5" class="is-prev">지난주 리뷰</th>
<th colspan="5" class="is-prev">지난주 리뷰 ({{ prev_week[5:] | replace('-', '/') }} ~ {{ prev_week_end[5:] | replace('-', '/') }})</th>
</tr>
<tr>
<th class="pj-meet-c-sec">구역</th>
<th class="pj-meet-c-label">항목</th>
<th class="pj-meet-c-text">이번주 할 일 · 행사</th>
<th class="pj-meet-c-amt">목표 금액</th>
<th class="pj-meet-c-amt">정량 목표</th>
<th class="pj-meet-c-text is-prev">지난주 할 일</th>
<th class="pj-meet-c-amt is-prev">지난주 목표</th>
<th class="pj-meet-c-amt is-prev">결과</th>
@@ -278,5 +277,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001w" defer></script>
<script src="/static/project.js?v=20261001y" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001x" />
<link rel="stylesheet" href="/static/project.css?v=20261001y" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -51,9 +51,10 @@
{% else %}
{% set sm = board.metrics.sales %}
{% set rm = board.metrics.roas %}
{# 월 칸은 pj-goal-m + data-h(1 = 상반기 1~6월, 2 = 하반기 7~12월) — 반기 접기(initGoals)가 이걸로 숨긴다 #}
{# 월 칸은 pj-goal-m + data-h(분기 1~4) — 분기 접기(initGoals)가 이걸로 숨긴다.
분기 칸 클래스는 예전 이름 pj-goal-half-col 그대로(연간 칸처럼 굵게·회색 합계) #}
{% macro num_cell(metric, kind, labels, mo) -%}
<td class="pj-goal-numtd pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ 1 if mo <= 6 else 2 }}">
<td class="pj-goal-numtd pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ (mo - 1) // 3 + 1 }}">
{%- if is_admin -%}
<input type="text" class="pj-goal-num" inputmode="decimal" autocomplete="off"
data-metric="{{ metric }}" data-kind="{{ kind }}" data-month="{{ mo }}"
@@ -71,29 +72,29 @@
{# 오른쪽 끝을 끌어 이름 칸 너비 조절 — 브라우저에 기억(localStorage pj_goal_col_w) #}
<th class="pj-goal-c1"><span class="pj-goal-colresize" data-col="c1" title="끌어서 너비 조절"></span></th>
<th class="pj-goal-c2"><span class="pj-goal-colresize" data-col="c2" title="끌어서 너비 조절"></span></th>
{# 연간·월·반기 칸도 머리 칸 오른쪽 끝을 끌어 너비 조절(data-col: y · m1~m12 · h1 · h2) #}
{# 연간·월·분기 칸도 머리 칸 오른쪽 끝을 끌어 너비 조절(data-col: y · m1~m12 · q1~q4) #}
<th class="pj-goal-year-col" data-col="y">연간<span class="pj-goal-colresize" data-col="y" title="끌어서 너비 조절"></span></th>
{% for h, hmonths, hm, hname in halves %}
{% for h, hmonths, hm, hname in quarters %}
{# 월 이름을 누르면 그 달 주간 회의록(/goals/{연도}/meetings/{월}) #}
{% for mo in hmonths %}<th class="pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ h }}" data-col="m{{ mo }}"><a class="pj-goal-mlabel pj-goal-mlink" href="/project/goals/{{ goal_year }}/meetings/{{ mo }}" title="{{ mo }}월 주간 회의록">{{ mo }}월</a><span class="pj-goal-colresize" data-col="m{{ mo }}" title="끌어서 너비 조절"></span></th>{% endfor %}
{# 반기 칸 — 버튼으로 그 반기의 월 칸을 접었다 편다(localStorage pj_goal_fold) #}
<th class="pj-goal-half-col" data-h="{{ h }}" data-col="h{{ h }}">
{# 분기 칸 — 버튼으로 그 분기의 월 칸을 접었다 편다(localStorage pj_goal_fold_q) #}
<th class="pj-goal-half-col" data-h="{{ h }}" data-col="q{{ h }}">
<button type="button" class="pj-goal-fold" data-h="{{ h }}" aria-expanded="true"
data-label="{{ hmonths[0] }}~{{ hmonths[-1] }}월"
title="{{ hmonths[0] }}~{{ hmonths[-1] }}월 접기"><span class="material-symbols-outlined">chevron_left</span></button>{{ hname }}
<span class="pj-goal-colresize" data-col="h{{ h }}" title="끌어서 너비 조절"></span>
<span class="pj-goal-colresize" data-col="q{{ h }}" title="끌어서 너비 조절"></span>
</th>
{% endfor %}
</tr>
</thead>
{# ── 숫자 지표 — 연간·반기 칸은 화면에서 계산(매출 합계·달성률, 로아스 매출 가중 평균), 로아스는 % 단위 ── #}
{# ── 숫자 지표 — 연간·분기 칸은 화면에서 계산(매출 합계·달성률, 로아스 매출 가중 평균), 로아스는 % 단위 ── #}
<tbody class="pj-goal-kpi">
<tr>
<th class="pj-goal-c1" rowspan="3">매출</th>
<th class="pj-goal-c2">목표</th>
<td class="pj-goal-sum pj-goal-year-col" data-metric="sales" data-kind="target" data-scope="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for h, hmonths, hm, hname in quarters %}
{% for mo in hmonths %}{{ num_cell("sales", "target", sm.target_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-half-col" data-metric="sales" data-kind="target" data-scope="{{ hm }}"></td>
{% endfor %}
@@ -101,7 +102,7 @@
<tr>
<th class="pj-goal-c2">실적</th>
<td class="pj-goal-sum pj-goal-year-col" data-metric="sales" data-kind="actual" data-scope="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for h, hmonths, hm, hname in quarters %}
{% for mo in hmonths %}{{ num_cell("sales", "actual", sm.actual_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-half-col" data-metric="sales" data-kind="actual" data-scope="{{ hm }}"></td>
{% endfor %}
@@ -109,7 +110,7 @@
<tr class="pj-goal-rate-row">
<th class="pj-goal-c2">달성</th>
<td class="pj-goal-rate pj-goal-year-col" data-month="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for h, hmonths, hm, hname in quarters %}
{% for mo in hmonths %}<td class="pj-goal-rate pj-goal-m{% if mo == this_month %} is-now{% endif %}" data-h="{{ h }}" data-month="{{ mo }}"></td>{% endfor %}
<td class="pj-goal-rate pj-goal-half-col" data-month="{{ hm }}"></td>
{% endfor %}
@@ -117,9 +118,9 @@
<tr>
<th class="pj-goal-c1" rowspan="2">로아스</th>
<th class="pj-goal-c2">목표</th>
{# 로아스 연간·반기 = 월 매출로 가중한 평균(광고비 = 매출 ÷ 로아스로 환산) — project.js recompute #}
{# 로아스 연간·분기 = 월 매출로 가중한 평균(광고비 = 매출 ÷ 로아스로 환산) — project.js recompute #}
<td class="pj-goal-sum pj-goal-year-col" data-metric="roas" data-kind="target" data-scope="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for h, hmonths, hm, hname in quarters %}
{% for mo in hmonths %}{{ num_cell("roas", "target", rm.target_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-half-col" data-metric="roas" data-kind="target" data-scope="{{ hm }}"></td>
{% endfor %}
@@ -127,7 +128,7 @@
<tr>
<th class="pj-goal-c2">실적</th>
<td class="pj-goal-sum pj-goal-year-col" data-metric="roas" data-kind="actual" data-scope="0"></td>
{% for h, hmonths, hm, hname in halves %}
{% for h, hmonths, hm, hname in quarters %}
{% for mo in hmonths %}{{ num_cell("roas", "actual", rm.actual_label, mo) }}{% endfor %}
<td class="pj-goal-sum pj-goal-half-col" data-metric="roas" data-kind="actual" data-scope="{{ hm }}"></td>
{% endfor %}
@@ -153,14 +154,14 @@
{% endif %}
{# 칸 배치는 router._goal_area_layout — 엑셀식 사각형 병합(colspan·rowspan), 가려진 칸은 없다 #}
{% for c in row.layout %}
{% set editable = is_admin and (c.kind != 'half' or board.halves) %}
{% set editable = is_admin and (c.kind != 'quarter' or (board.halves and (c.m not in (15, 16) or board.quarters))) %}
{% set merged = c.span > 1 or c.rspan > 1 %}
<td class="pj-goal-texttd {{ 'pj-goal-m' if c.kind == 'month' else ('pj-goal-year-col' if c.kind == 'year' else 'pj-goal-half-col') }}{% if merged %} is-merged{% endif %}{% if c.now %} is-now{% endif %}"
{% if c.kind == 'month' %}data-h="{{ c.h }}" {% endif %}data-month="{{ c.m }}" data-span="{{ c.span }}" data-rspan="{{ c.rspan }}"
{%- if c.span > 1 %} colspan="{{ c.span }}" style="--span: {{ c.span }}"{% endif %}{% if c.rspan > 1 %} rowspan="{{ c.rspan }}"{% endif %}>
{%- if editable -%}
<textarea class="pj-goal-text" rows="1" data-row="{{ row.id }}" data-month="{{ c.m }}"
placeholder="{{ '연간 목표' if c.m == 0 else ('상반기 목표' if c.m == 13 else ('하반기 목표' if c.m == 14 else '')) }}">{{ row.cells.get(c.m, '') }}</textarea>
placeholder="{{ '연간 목표' if c.m == 0 else ((c.h ~ '분기 목표') if c.kind == 'quarter' else '') }}">{{ row.cells.get(c.m, '') }}</textarea>
{%- else -%}
<div class="pj-goal-text-ro">{{ row.cells.get(c.m, '') }}</div>
{%- endif -%}
@@ -189,5 +190,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001w" defer></script>
<script src="/static/project.js?v=20261001y" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001x" />
<link rel="stylesheet" href="/static/project.css?v=20261001y" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -90,14 +90,14 @@
<li><b>휴지통</b> — 지운 작업을 3개월 보관합니다. 관리자에게만 보입니다. (<a href="#trash">19장</a>)</li>
<li><b>목표</b> — 누르면 바로 아래에 연도가 펼쳐집니다. 연도를 누르면 오른쪽에 그해 전체 목표가 한 표로 나옵니다 —
맨 위에 <b>매출</b>(목표·실적·달성률)과 <b>로아스</b>(목표·실적, 단위 %)를 달마다, 그 아래에 <b>업무 영역</b>(상품·마케팅·컨텐츠·유통 등)별로
연간·반기·월별 계획을 적습니다. 6월 오른쪽에 <b>상반기</b>, 12월 오른쪽에 <b>하반기</b> 칸이 있고, 매출의 <b>연간·반기</b> 칸은 월 합계,
<b>달성</b>은 실적÷목표(100% 이상 초록)로 저절로 계산됩니다. 반기 칸 머리의 <b>‹</b> 버튼을 누르면 그 반기의 월 칸(1~6월 또는 7~12월)이
접히고, 다시 누르면 펼쳐집니다(접힌 상태는 내 브라우저에 기억).
연간·분기·월별 계획을 적습니다. 3·6·9·12월 오른쪽에 <b>1~4분기</b> 칸이 있고, 매출의 <b>연간·분기</b> 칸은 월 합계,
<b>달성</b>은 실적÷목표(100% 이상 초록)로 저절로 계산됩니다. 분기 칸 머리의 <b>‹</b> 버튼을 누르면 그 분기의 월 칸 3개가
접히고, 다시 누르면 펼쳐집니다(접힌 상태는 내 브라우저에 기억). 월 이름을 누르면 그 달 <b>주간 회의록</b>이 열립니다.
<b>입력은 관리자만</b> 할 수 있고(칸을 고치면 바로 저장), 다른 직원은 보기만 합니다. 관리자는 <b>+ 연도 추가</b>로 새해 목표를
만들고(이전 연도의 업무 영역 구성을 그대로 가져옴), 영역·줄 이름은 <b>눌러서 그 자리에서 고치고</b>(Enter 저장, Esc 취소),
이름 칸에 마우스를 올려 색·순서·줄 추가·삭제를 합니다. 업무 영역의 월 칸은 <b>병합</b>할 수 있습니다 — 한 칸을 누르고
<b>Shift+클릭</b>으로 같은 줄의 다른 칸까지 고른 뒤 떠 있는 "병합" 버튼을 누르거나, 칸을 <b>우클릭</b>해 "오른쪽/왼쪽 칸과 병합"·"병합 해제".
병합은 상반기·하반기 안에서만 되고, 칸들의 글은 월 순서대로 첫 칸에 모입니다.</li>
구역·항목 칸을 <b>우클릭</b>해 색·순서·줄 추가·삭제를 합니다. 업무 영역 칸은 엑셀처럼 <b>병합</b>할 수 있습니다 — 칸을 마우스로
끌어 여러 칸을 고른 뒤 우클릭 → "셀 병합", 병합된 칸은 우클릭 → "병합 해제"(글은 왼쪽 위 칸에 남음).
가로 병합은 같은 분기의 월 칸끼리만(연간·분기 칸은 세로로만) 되고, 칸들의 글은 순서대로 첫 칸에 모입니다.</li>
<li><b>프로젝트</b> — 내가 멤버인 프로젝트 목록입니다. 누르면 그 프로젝트 화면으로 갑니다. 완료한 프로젝트는 아래 <b>완료 프로젝트</b>에 흐리게 모입니다.</li>
<li><b>전체 멤버</b> — 관리자에게만 보입니다. 사람 아이콘을 누르면 그 사람이 맡은 모든 작업을 한눈에 봅니다.</li>
</ul>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001x" />
<link rel="stylesheet" href="/static/project.css?v=20261001y" />
<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=20261001w" defer></script>
<script src="/static/project.js?v=20261001y" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001x" />
<link rel="stylesheet" href="/static/project.css?v=20261001y" />
<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=20261001w" defer></script>
<script src="/static/project.js?v=20261001y" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001x" />
<link rel="stylesheet" href="/static/project.css?v=20261001y" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — 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=20261001w" defer></script>
<script src="/static/project.js?v=20261001y" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001x" />
<link rel="stylesheet" href="/static/project.css?v=20261001y" />
<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=20261001w" defer></script>
<script src="/static/project.js?v=20261001y" defer></script>
{% endblock %}
+11 -13
View File
@@ -2020,7 +2020,7 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
/* 가로·세로 스크롤은 이 칸 하나가 맡고, 머리 줄과 왼쪽 두 칸(구분·항목)은 붙어 있다 */
.pj-goal-pane { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* width: 1px — table-layout: fixed 는 표 너비가 auto 가 아닐 때만 먹는다. 표는 칸 너비 합만큼 늘어나고,
칸 너비가 머리 칸 width 로만 정해져야 반기 접기 애니메이션이 양방향으로 부드럽다(auto 면 펼 때 한 번에 튄다). */
칸 너비가 머리 칸 width 로만 정해져야 분기 접기 애니메이션이 양방향으로 부드럽다(auto 면 펼 때 한 번에 튄다). */
.pj-goal-table {
width: 1px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px;
color: var(--pj-ink); background: #fff; border: 1px solid #dfe2e6; border-radius: 10px;
@@ -2124,7 +2124,7 @@ textarea.pj-goal-text::placeholder { color: rgba(0, 0, 0, .3); }
.pj-goal-table th.is-saved { animation: pj-goal-saved 1s ease-out; }
/* 상반기·하반기 칸 — 6월·12월 오른쪽. 앞 칸 오른쪽 테두리와 겹쳐 두 줄로 구분된다. */
/* 분기 칸(클래스 이름은 반기 때 그대로) — 3·6·9·12월 오른쪽. 앞 칸 오른쪽 테두리와 겹쳐 두 줄로 구분된다. */
.pj-goal-table thead th.pj-goal-half-col {
width: var(--cw, 90px); min-width: var(--cw, 90px); max-width: var(--cw, 90px); padding: 0 6px; background: #eef0f3;
}
@@ -2132,7 +2132,7 @@ textarea.pj-goal-text::placeholder { color: rgba(0, 0, 0, .3); }
.pj-goal-kpi td.pj-goal-half-col { background: #f4f5f7; }
.pj-goal-texttd.pj-goal-half-col { font-weight: 600; }
.pj-goal-kpi td { white-space: nowrap; }
/* 반기 접기 버튼(반기 칸 머리) — 펼침 = ‹(왼쪽 월 칸을 접는다), 접힘 = 뒤집혀 ›, 강조색 */
/* 분기 접기 버튼(분기 칸 머리) — 펼침 = ‹(왼쪽 월 칸을 접는다), 접힘 = 뒤집혀 ›, 강조색 */
.pj-goal-fold {
display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
margin: 0 2px 0 -2px; padding: 0; border: none; border-radius: 5px; background: transparent;
@@ -2211,20 +2211,21 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
.pj-meet-goalbtn:hover { background: var(--pj-accent); border-color: var(--pj-accent); color: #fff; }
.pj-goal-head-acts .pj-btn .material-symbols-outlined { font-size: 17px; vertical-align: -3px; }
/* 머리 — 왼쪽: 제목·인쇄·삭제·주차 탭(한 줄) + 이 달 계획(달력 앞까지) / 오른쪽 위: 작은 달력(81% — 90%의 90%) */
.pj-meet-headgrid { display: flex; align-items: flex-start; gap: 16px; margin: 8px 0 12px; }
/* 머리 — 왼쪽: 제목·인쇄·삭제 … 주차 탭(달력 쪽 끝) + 이 달 계획(달력 앞까지) / 오른쪽 위: 작은 달력(폭 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; }
.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; }
.pj-meet-weeks { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 0 6px; padding-top: 6px; } /* "이번 주" 꼬리표 자리 */
/* 주차 탭 — 제목 줄 오른쪽 끝(달력 바로 왼쪽)에 붙인다 */
.pj-meet-weeks { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 0 auto; padding-top: 6px; } /* "이번 주" 꼬리표 자리 */
.pj-meet-cal {
flex: 0 0 auto; width: 191px; padding: 6px 9px 4px; border: 1px solid var(--pj-border); border-radius: 10px; background: #fff;
flex: 0 0 auto; width: 174px; padding: 6px 6px 4px; border: 1px solid var(--pj-border); border-radius: 10px; background: #fff;
}
.pj-meet-cal-head { font-size: 10.5px; font-weight: 800; text-align: center; margin-bottom: 2px; }
.pj-meet-cal-head { font-size: 11px; font-weight: 800; text-align: center; margin-bottom: 2px; }
.pj-meet-cal-wd, .pj-meet-cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.pj-meet-cal-wd span { font-size: 8.5px; font-weight: 700; color: var(--pj-ink-soft); text-align: center; padding: 1px 0; }
.pj-meet-cal-wd span { font-size: 9px; font-weight: 700; color: var(--pj-ink-soft); text-align: center; padding: 1px 0; }
.pj-meet-cal-row {
position: relative; margin: 1px 0; border-radius: 7px; color: var(--pj-ink); text-decoration: none; cursor: pointer;
}
@@ -2234,7 +2235,7 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
/* 앞뒤 달에 속한 주(월요일이 다른 달) — 흐리게, 누르면 그 달 회의록 */
.pj-meet-cal-row.is-other { opacity: .55; }
.pj-meet-cal-row.is-other:hover { opacity: 1; }
.pj-meet-cal-d { height: 20px; line-height: 20px; text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.pj-meet-cal-d { height: 21px; line-height: 21px; text-align: center; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.pj-meet-cal-d.is-sat { color: #2563eb; }
.pj-meet-cal-d.is-sun { color: #dc2626; }
.pj-meet-cal-d.is-out { opacity: .35; }
@@ -2299,8 +2300,6 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
.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: 13px; font-weight: 800; margin-bottom: 6px; }
.pj-meet-plan-head .material-symbols-outlined { font-size: 18px; color: var(--pj-accent); }
.pj-meet-plan-head a { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--pj-ink-soft); text-decoration: none; }
.pj-meet-plan-head a:hover { color: var(--pj-accent-dark); text-decoration: underline; }
.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; }
.pj-meet-plan-name { display: block; font-size: 12px; margin-bottom: 2px; }
@@ -2311,7 +2310,6 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
.pj-meet-plan-text { white-space: pre-line; overflow-wrap: anywhere; }
.pj-meet-plan-item em { flex: none; margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--pj-ink-soft); }
.pj-meet-plan-empty { margin: 0; font-size: 12px; color: var(--pj-ink-soft); }
@media print { .pj-meet-plan-head a { display: none; } }
/* 참석자 — 멤버 칩 + [참석자] 고르기 창(body 에 붙음) */
.pj-meet-attend { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; font-size: 12.5px; }
+24 -23
View File
@@ -7956,10 +7956,10 @@
// ── 열 너비 — 머리 칸 오른쪽 끝을 끌어 조절, 브라우저에 기억(localStorage pj_goal_col_w) ──
// · c1·c2 = 왼쪽 이름 두 칸(구분·항목) → 표의 CSS 변수 --goal-c1-w·--goal-c2-w(c2 의 left 도 c1 너비로 정해진다)
// · y = 연간, m1~m12 = 월, h1·h2 = 상·하반기 → 그 머리 칸의 --cw(표는 table-layout: fixed 라 머리 칸 너비가 열 너비)
// · y = 연간, m1~m12 = 월, q1~q4 = 분기 → 그 머리 칸의 --cw(표는 table-layout: fixed 라 머리 칸 너비가 열 너비)
// 화면 배율(uiZoom) 안이라 마우스 이동 거리는 배율로 나눈다. 더블클릭 = 기본 너비.
const COL_KEY = "pj_goal_col_w";
const colDefault = { c1: 72, c2: 72, y: 90, h1: 90, h2: 90 };
const colDefault = { c1: 72, c2: 72, y: 90, q1: 80, q2: 80, q3: 80, q4: 80 };
for (let m = 1; m <= 12; m++) colDefault["m" + m] = 85;
function colLimit(key) { return key === "c1" || key === "c2" ? [48, 320] : [40, 600]; }
function clampCol(key, w) { const lim = colLimit(key); return Math.min(lim[1], Math.max(lim[0], w)); }
@@ -7983,7 +7983,7 @@
table.querySelectorAll("thead th[data-col]").forEach(function (th) {
th.style.setProperty("--cw", colW[th.dataset.col] + "px");
});
// 반기 접기 애니메이션 동안 월 칸 안 내용을 고정할 폭(병합 칸 = 걸친 월 너비 합, 오른쪽 테두리 1px 빼고)
// 분기 접기 애니메이션 동안 월 칸 안 내용을 고정할 폭(병합 칸 = 걸친 월 너비 합, 오른쪽 테두리 1px 빼고)
table.querySelectorAll("td.pj-goal-m[data-month]").forEach(function (td) {
const m = parseInt(td.dataset.month, 10), span = parseInt(td.dataset.span || "1", 10);
let w = 0;
@@ -8065,8 +8065,9 @@
td.textContent = (Math.round(r * 10) / 10).toLocaleString("ko-KR") + "%";
td.classList.add(r >= 100 ? "is-good" : "is-low");
}
// 합계 칸 — 연간(0) · 상반기(13, 1~6월) · 하반기(14, 7~12월)
const SUM_SCOPES = [[0, 1, 12], [13, 1, 6], [14, 7, 12]];
// 합계 칸 — 연간(0) · 분기 칸(store.GOAL_QUARTER_COL: 13 = 1분기 1~3월, 15 = 2분기, 14 = 3분기, 16 = 4분기)
const SUM_SCOPES = [[0, 1, 12], [13, 1, 3], [15, 4, 6], [14, 7, 9], [16, 10, 12]];
const SCOPE_NAME = { 0: "연간", 13: "1분기", 15: "2분기", 14: "3분기", 16: "4분기" };
function recompute() {
const tg = values("sales", "target"), ac = values("sales", "actual");
for (let m = 1; m <= 12; m++) {
@@ -8084,13 +8085,13 @@
if (st) st.textContent = sumT == null ? "" : fmtNum(sumT);
if (sa) sa.textContent = sumA == null ? "" : fmtNum(sumA);
const rt = table.querySelector('.pj-goal-rate[data-month="' + sc[0] + '"]');
// 연간·반기 달성률 = 입력된 실적 합계 ÷ 그 기간 목표 합계 전체(2026-10-01 사용자 기준 — 예전엔 실적이 있는 달의 목표만)
// 연간·분기 달성률 = 입력된 실적 합계 ÷ 그 기간 목표 합계 전체(2026-10-01 사용자 기준 — 예전엔 실적이 있는 달의 목표만)
if (rt) {
setRate(rt, sumA, sumT);
rt.dataset.tip = sumT ? (sc[0] === 0 ? "연간" : sc[0] === 13 ? "상반기" : "하반기") + " 목표 합계 대비 실적" : "";
rt.dataset.tip = sumT ? SCOPE_NAME[sc[0]] + " 목표 합계 대비 실적" : "";
}
});
// 로아스 연간·반기 — 기간 로아스 = 기간 매출 ÷ 기간 광고비. 광고비를 따로 적지 않으니 월마다 매출 ÷ 로아스로 환산해
// 로아스 연간·분기 — 기간 로아스 = 기간 매출 ÷ 기간 광고비. 광고비를 따로 적지 않으니 월마다 매출 ÷ 로아스로 환산해
// 합친다(매출 가중 평균). 로아스가 있는 달 중 매출(같은 목표/실적)이 없는 달이 있으면 단순 평균.
["target", "actual"].forEach(function (kind) {
const roas = values("roas", kind), sales = kind === "target" ? tg : ac;
@@ -8117,15 +8118,17 @@
}
recompute();
// ── 상·하반기 접기 — 반기 칸 머리의 버튼이 그 반기 월 칸(.pj-goal-m[data-h])을 접었다 편다.
// ── 분기 접기 — 분기 칸 머리의 버튼이 그 분기 월 칸(.pj-goal-m[data-h], 1~4)을 접었다 편다.
// 칸 너비를 0 으로 줄이는 애니메이션(.is-shrunk, CSS transition) 뒤 display:none(.is-gone),
// 펼 때는 거꾸로. 상태는 브라우저에 기억(localStorage pj_goal_fold). 보기만 하는 사람도 쓸 수 있다.
const FOLD_KEY = "pj_goal_fold";
// 펼 때는 거꾸로. 상태는 브라우저에 기억(localStorage pj_goal_fold_q — 반기 때 키 pj_goal_fold 와 따로).
// 보기만 하는 사람도 쓸 수 있다.
const FOLD_KEY = "pj_goal_fold_q";
const FOLD_MS = 320;
const fold = { 1: false, 2: false };
const QUARTERS = [1, 2, 3, 4];
const fold = { 1: false, 2: false, 3: false, 4: false };
try {
const saved = JSON.parse(localStorage.getItem(FOLD_KEY) || "null");
if (saved) { fold[1] = !!saved[1]; fold[2] = !!saved[2]; }
if (saved) QUARTERS.forEach(function (q) { fold[q] = !!saved[q]; });
} catch (_) {}
const foldTimers = {};
function halfCells(h) { return table.querySelectorAll('.pj-goal-m[data-h="' + h + '"]'); }
@@ -8161,8 +8164,8 @@
foldTimers[h] = setTimeout(function () {
if (folded) cells.forEach(function (c) { c.classList.add("is-gone"); });
else table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] textarea.pj-goal-text').forEach(fit);
if (!foldTimers[3 - h]) table.classList.remove("is-folding");
delete foldTimers[h];
if (!Object.keys(foldTimers).length) table.classList.remove("is-folding");
}, FOLD_MS + 20);
}
table.querySelectorAll(".pj-goal-fold").forEach(function (btn) {
@@ -8182,8 +8185,7 @@
ta.style.height = ta.scrollHeight + "px";
}
function fitAll() { table.querySelectorAll("textarea.pj-goal-text").forEach(fit); }
applyFold(1, false);
applyFold(2, false);
QUARTERS.forEach(function (q) { applyFold(q, false); });
// 병합 선택(Shift+클릭) — 관리자 전용, 아래에서 채운다. 접기 버튼이 먼저 부르므로 여기 둔다.
let clearMergeSel = function () {};
@@ -8393,8 +8395,7 @@
table.querySelectorAll("tbody.pj-goal-area").forEach(function (t) { t.remove(); });
fresh.querySelectorAll("tbody.pj-goal-area").forEach(function (t) { table.appendChild(document.importNode(t, true)); });
applyColW();
applyFold(1, false);
applyFold(2, false);
QUARTERS.forEach(function (q) { applyFold(q, false); });
bindTexts(table);
if (!reduce) {
table.querySelectorAll("tbody.pj-goal-area > tr[data-row-id]").forEach(function (tr) {
@@ -8625,12 +8626,12 @@
});
// ── 칸 병합 — 엑셀처럼: 업무 영역 글 칸을 마우스로 끌어(또는 Shift+클릭) 사각형으로 고른 뒤 우클릭 → 셀 병합,
// 병합된 칸은 우클릭 → 병합 해제(글은 왼쪽 위 칸에 남는다). 같은 업무 영역 안에서만, 가로는 같은 반기 월 칸끼리
// (연간·상반기·하반기 칸은 세로로만). 고른 범위가 병합된 칸에 걸치면 엑셀처럼 그 칸 전체로 넓힌다.
// 병합된 칸은 우클릭 → 병합 해제(글은 왼쪽 위 칸에 남는다). 같은 업무 영역 안에서만, 가로는 같은 분기 월 칸끼리
// (연간·분기 칸은 세로로만). 고른 범위가 병합된 칸에 걸치면 엑셀처럼 그 칸 전체로 넓힌다.
// 병합하면 서버가 범위 안 글을 왼쪽 위부터 이어 왼쪽 위 칸에 모은다(글을 잃지 않게).
if (table.dataset.halves === "true") {
const ORDER = [0, 1, 2, 3, 4, 5, 6, 13, 7, 8, 9, 10, 11, 12, 14]; // store.GOAL_COL_ORDER
const groupOf = function (m) { return m === 0 ? "y" : m === 13 ? "h1" : m === 14 ? "h2" : (m <= 6 ? "m1" : "m2"); };
const ORDER = [0, 1, 2, 3, 13, 4, 5, 6, 15, 7, 8, 9, 14, 10, 11, 12, 16]; // store.GOAL_COL_ORDER
const groupOf = function (m) { return m === 0 ? "y" : m > 12 ? "q" + m : "m" + Math.ceil(m / 3); };
const textTd = function (node) {
const td = node && node.closest && node.closest("td.pj-goal-texttd");
return td && table.contains(td) && td.closest("tbody.pj-goal-area") ? td : null;
@@ -8688,7 +8689,7 @@
const cols = ORDER.slice(s.c0, s.c1 + 1);
const groups = cols.map(groupOf).filter(function (g, i, a) { return a.indexOf(g) === i; });
if (groups.length > 1) {
showToast("연간·상반기·하반기 칸은 세로로만, 월 칸은 같은 반기 안에서만 합칠 수 있습니다.", "error");
showToast("연간·분기 칸은 세로로만, 월 칸은 같은 분기 안에서만 합칠 수 있습니다.", "error");
return;
}
const rows = s.tbody.rows;