fix(project): 연간 목표 — 월 칸 너비 85px, 영역 색에 색 없음 + 연한 16색

- 표 칸 너비를 여백 포함(border-box)으로 — 150px 이 padding 만큼 171px 로 늘던 문제, 월 칸 85px
- 좁아진 칸에 맞춰 숫자·글 칸 안쪽 여백 6px
- 색 바꾸기 팝업: 맨 위 색 없음(흰 배경) + 연한 16색(8칸×2줄, 기존 8색 포함)
- project.js/css 캐시 버전 20260930b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 11:32:25 +09:00
parent 86ee50b2e6
commit 7de93e78d7
10 changed files with 58 additions and 33 deletions
+9 -3
View File
@@ -334,11 +334,14 @@ def validate_time(t: Any) -> str | None:
# ════════════════════════════════════════════════════════════
GOAL_METRICS: tuple[str, ...] = ("sales", "roas") # 매출 · 로아스
GOAL_KINDS: tuple[str, ...] = ("target", "actual") # 목표 · 실적
# 업무 영역 줄 배경색 — 스프레드시트처럼 연한 색만(글자는 항상 진한 색).
# 업무 영역 줄 배경색 — 스프레드시트처럼 연한 색 16가지(글자는 항상 진한 색, 8칸×2줄).
# 처음 8색(상품·마케팅·컨텐츠·유통 기본색 포함)은 예전 목록 그대로 들어 있다.
# 빈 문자열 = 색 없음(흰 배경, GOAL_NO_COLOR).
GOAL_AREA_COLORS: tuple[str, ...] = (
"#fbe1d5", "#d9f2d0", "#d4d4d4", "#f0cdec",
"#dbe8fb", "#fff2c2", "#e3dcfb", "#d3f0ee",
"#fcd9d9", "#fde4c8", "#fbe1d5", "#fff2c2", "#eef5c8", "#d9f2d0", "#c9ecd9", "#d3f0ee",
"#cfeaf7", "#dbe8fb", "#e3dcfb", "#f0cdec", "#fcdcec", "#eadcd0", "#d4d4d4", "#eef0f2",
)
GOAL_NO_COLOR = ""
# 새 연도를 만들 때 이전 연도가 없으면 이 영역으로 시작한다(이전 연도가 있으면 그 구조를 복사).
DEFAULT_GOAL_AREAS: tuple[tuple[str, str, tuple[str, ...]], ...] = (
("상품", "#fbe1d5", ("",)),
@@ -401,7 +404,10 @@ def validate_goal_row_label(label: Any) -> str:
def validate_goal_color(color: Any) -> str:
"""영역 색 — 16색 중 하나, 빈값/"none" 은 색 없음(""), 목록 밖은 첫 색."""
v = norm_str(color).lower()
if v in ("", "none"):
return GOAL_NO_COLOR
return v if v in GOAL_AREA_COLORS else GOAL_AREA_COLORS[0]
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930a" />
<link rel="stylesheet" href="/static/project.css?v=20260930b" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -106,7 +106,7 @@
{# ── 업무 영역 — 영역마다 tbody 하나, 배경은 영역 색 ── #}
{% for area in board.areas %}
<tbody class="pj-goal-area" data-area-id="{{ area.id }}" style="--goal-bg: {{ area.color }}">
<tbody class="pj-goal-area" data-area-id="{{ area.id }}" style="--goal-bg: {{ area.color or '#fff' }}">
{% for row in area.rows %}
<tr data-row-id="{{ row.id }}">
{% if loop.first %}
@@ -168,5 +168,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260930a" defer></script>
<script src="/static/project.js?v=20260930b" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930a" />
<link rel="stylesheet" href="/static/project.css?v=20260930b" />
<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=20260930a" />
<link rel="stylesheet" href="/static/project.css?v=20260930b" />
<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=20260930a" defer></script>
<script src="/static/project.js?v=20260930b" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930a" />
<link rel="stylesheet" href="/static/project.css?v=20260930b" />
<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=20260930a" defer></script>
<script src="/static/project.js?v=20260930b" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930a" />
<link rel="stylesheet" href="/static/project.css?v=20260930b" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -491,5 +491,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260930a" defer></script>
<script src="/static/project.js?v=20260930b" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260930a" />
<link rel="stylesheet" href="/static/project.css?v=20260930b" />
<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=20260930a" defer></script>
<script src="/static/project.js?v=20260930b" defer></script>
{% endblock %}
+25 -9
View File
@@ -2010,7 +2010,9 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
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;
}
/* 칸 너비는 여백·테두리 포함(border-box) — 안 그러면 padding 만큼 넓어진다 */
.pj-goal-table th, .pj-goal-table td {
box-sizing: border-box;
border-right: 1px solid #e6e8eb; border-bottom: 1px solid #e6e8eb; padding: 0; vertical-align: top;
}
.pj-goal-table tr > :last-child { border-right: none; }
@@ -2018,8 +2020,8 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
position: sticky; top: 0; z-index: 3; background: #f7f8f9; height: 32px; padding: 0 10px;
font-weight: 700; text-align: left; vertical-align: middle; white-space: nowrap;
}
.pj-goal-table thead th:not(.pj-goal-c1):not(.pj-goal-c2) { width: 150px; min-width: 150px; }
.pj-goal-table thead th.pj-goal-year-col { width: 210px; min-width: 210px; }
.pj-goal-table thead th { width: 85px; min-width: 85px; max-width: 85px; } /* 1~12월 */
.pj-goal-table thead th.pj-goal-year-col { width: 210px; min-width: 210px; max-width: 210px; }
.pj-goal-table thead th.is-now { color: var(--pj-accent-dark); box-shadow: inset 0 -2px 0 var(--pj-accent); }
.pj-goal-c1, .pj-goal-c2 {
position: sticky; z-index: 2; width: 72px; min-width: 72px; max-width: 72px;
@@ -2027,20 +2029,22 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
}
.pj-goal-c1 { left: 0; }
.pj-goal-c2 { left: 72px; font-weight: 600; color: #3b4048; }
.pj-goal-table thead .pj-goal-c1, .pj-goal-table thead .pj-goal-c2 { z-index: 4; }
.pj-goal-table thead th.pj-goal-c1, .pj-goal-table thead th.pj-goal-c2 {
z-index: 4; width: 72px; min-width: 72px; max-width: 72px; /* 왼쪽 고정 두 칸 — c2 의 left:72px 와 맞춤 */
}
.pj-goal-table tbody th { padding: 7px 8px; }
/* 숫자 지표 */
.pj-goal-kpi td { height: 32px; vertical-align: middle; }
.pj-goal-kpi td.is-now { background: #faf9ff; }
input.pj-goal-num, span.pj-goal-num {
display: block; width: 100%; box-sizing: border-box; height: 32px; padding: 0 10px; border: none;
display: block; width: 100%; box-sizing: border-box; height: 32px; padding: 0 6px; border: none;
background: transparent; font: inherit; font-variant-numeric: tabular-nums; text-align: right; line-height: 32px;
}
input.pj-goal-num:focus { outline: 2px solid var(--pj-accent); outline-offset: -2px; background: #fff; }
.pj-goal-sum { padding: 0 10px !important; text-align: right; font-weight: 700; background: #fafafb;
.pj-goal-sum { padding: 0 6px !important; text-align: right; font-weight: 700; background: #fafafb;
font-variant-numeric: tabular-nums; }
.pj-goal-rate { padding: 0 10px !important; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pj-goal-rate { padding: 0 6px !important; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.pj-goal-rate.is-good { color: #1f8a4c; }
.pj-goal-rate.is-low { color: #c2410c; }
.pj-goal-kpi tr:last-child > * { border-bottom: 2px solid #d5d9de; }
@@ -2057,12 +2061,12 @@ input.pj-goal-num:focus { outline: 2px solid var(--pj-accent); outline-offset: -
.pj-goal-tools .pj-icon-btn .material-symbols-outlined { font-size: 15px; }
.pj-goal-tools .pj-icon-btn:hover { background: rgba(255, 255, 255, .7); }
textarea.pj-goal-text {
display: block; width: 100%; box-sizing: border-box; min-height: 46px; padding: 7px 9px; border: none;
display: block; width: 100%; box-sizing: border-box; min-height: 46px; padding: 6px; border: none;
background: transparent; font: inherit; line-height: 1.5; color: inherit; resize: none; overflow: hidden;
}
textarea.pj-goal-text:focus { outline: 2px solid var(--pj-accent); outline-offset: -2px; background: rgba(255, 255, 255, .75); }
textarea.pj-goal-text::placeholder { color: rgba(0, 0, 0, .3); }
.pj-goal-text-ro { min-height: 46px; padding: 7px 9px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-goal-text-ro { min-height: 46px; padding: 6px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-goal-area td.is-now { box-shadow: inset 2px 0 0 rgba(123, 104, 238, .35), inset -2px 0 0 rgba(123, 104, 238, .35); }
.pj-goal-texttd.pj-goal-year-col { font-weight: 600; }
@@ -2073,10 +2077,22 @@ textarea.pj-goal-text::placeholder { color: rgba(0, 0, 0, .3); }
/* 영역 색 고르기 팝업(body 에 붙음) */
.pj-goal-colorpop {
position: fixed; z-index: 1000; display: grid; grid-template-columns: repeat(4, 26px); gap: 6px;
position: fixed; z-index: 1000; display: grid; grid-template-columns: repeat(8, 26px); gap: 6px;
padding: 10px; background: #fff; border: 1px solid var(--pj-border); border-radius: 10px;
box-shadow: 0 8px 24px rgba(16, 24, 40, .16);
}
.pj-goal-swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .12); cursor: pointer; padding: 0; }
.pj-goal-swatch:hover { transform: scale(1.08); }
.pj-goal-swatch.is-on { outline: 2px solid var(--pj-accent); outline-offset: 1px; }
/* 맨 위 "색 없음" — 한 줄 전체, 흰 칸에 빨간 사선 */
.pj-goal-swatch-none {
grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px;
border: 1px solid var(--pj-border); border-radius: 6px; background: #fff; color: var(--pj-ink);
font-size: 12.5px; cursor: pointer;
}
.pj-goal-swatch-none:hover { background: #f6f7f8; }
.pj-goal-swatch-none.is-on { outline: 2px solid var(--pj-accent); outline-offset: 1px; }
.pj-goal-swatch-x {
width: 16px; height: 16px; border: 1px solid rgba(0, 0, 0, .2); border-radius: 4px; background:
linear-gradient(to top right, transparent calc(50% - 1px), #e5484d calc(50% - 1px), #e5484d calc(50% + 1px), transparent calc(50% + 1px));
}
+10 -7
View File
@@ -7632,23 +7632,26 @@
closeColorPop();
colorPop = document.createElement("div");
colorPop.className = "pj-goal-colorpop";
colorPop.innerHTML = colors.map(function (c) {
return '<button type="button" class="pj-goal-swatch' + (c === current ? " is-on" : "") +
'" data-c="' + c + '" style="background:' + c + '"></button>';
}).join("");
// 맨 위 "색 없음"(흰 배경, 빈 값) + 연한 16색(8칸×2줄)
colorPop.innerHTML = '<button type="button" class="pj-goal-swatch-none' + (!current ? " is-on" : "") +
'" data-c=""><span class="pj-goal-swatch-x"></span>색 없음</button>' +
colors.map(function (c) {
return '<button type="button" class="pj-goal-swatch' + (c === current ? " is-on" : "") +
'" data-c="' + c + '" style="background:' + c + '"></button>';
}).join("");
document.body.appendChild(colorPop);
const r = anchor.getBoundingClientRect();
const w = colorPop.offsetWidth;
colorPop.style.left = Math.max(8, Math.min(r.left, document.documentElement.clientWidth - w - 8)) + "px";
colorPop.style.top = (r.bottom + 6) + "px";
colorPop.addEventListener("click", async function (e) {
const sw = e.target.closest(".pj-goal-swatch");
const sw = e.target.closest(".pj-goal-swatch, .pj-goal-swatch-none");
if (!sw) return;
const c = sw.dataset.c;
closeColorPop();
try {
await api("PUT", "/project/api/goals/areas/" + areaId, { color: c });
tbody.style.setProperty("--goal-bg", c);
await api("PUT", "/project/api/goals/areas/" + areaId, { color: c || "none" });
tbody.style.setProperty("--goal-bg", c || "#fff");
anchor.dataset.color = c;
} catch (err) { showToast("색 변경 실패: " + err.message, "error"); }
});
+2 -2
View File
@@ -487,11 +487,11 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
(`initGoalSide`, localStorage `pj_goal_open`, 목표 화면에선 항상 펼침). 연도 목록은 `router._goal_years_nav`
(`goal_years` 최근 연도 먼저 + **올해는 항상**, 013 미적용이면 올해만) — 사이드바를 그리는 모든 화면 컨텍스트에 `goal_years`.
- 연도를 누르면 `/project/goals/{연도}`(`goals.html`) — 스프레드시트 같은 한 표. 머리 줄(연간·1~12월)과 왼쪽 두 칸은 고정,
이번 달 열 강조.
이번 달 열 강조. 월 칸 너비 85px·연간 210px(여백 포함, `box-sizing: border-box`).
- **숫자 지표** `goal_metrics`(year·metric `sales|roas`·kind `target|actual`·month 1~12·value NUMERIC(18,2)) —
매출 목표/실적/달성, 로아스 목표/실적. 매출 연간 = 월 합계, 달성률 = 실적÷목표(월별, 연간은 실적이 있는 달의 목표 합계 대비)는
화면에서 계산(저장 안 함). 매출 단위 글자는 `goal_years.sales_unit`.
- **업무 영역** `goal_areas`(연도별, 이름·색 `store.GOAL_AREA_COLORS` 8색·순서) → `goal_rows`(영역 안 줄, 최소 1줄 — 마지막 줄은
- **업무 영역** `goal_areas`(연도별, 이름·색 `store.GOAL_AREA_COLORS` 연한 16색 + 색 없음(빈 값 = 흰 배경)·순서) → `goal_rows`(영역 안 줄, 최소 1줄 — 마지막 줄은
못 지움) → `goal_cells`(row × month, **0 = 연간**, 빈 글 = 행 삭제). 영역 색이 줄 전체 배경.
- 권한: 조회는 `project` 권한자 전원, **입력·구조 변경은 관리자만**(`_require_admin`, 화면도 관리자에게만 입력칸·도구).
- 연도 추가(`POST /api/goals/years {year}`)는 가장 가까운 이전 연도(없으면 다음 연도)의 영역·줄 구조를 글 없이 복사,