feat(project): 대시보드 "예정된 작업 합계(담당자별)"는 관리자에게만
사람별 업무량이 드러나는 차트라 is_admin 일 때만 그린다. 나머지 타일·차트는 그대로. 정적 파일 버전 20260926e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+20
-17
@@ -4088,24 +4088,27 @@
|
||||
]));
|
||||
charts.appendChild(statusCard);
|
||||
|
||||
// 담당자별 예정된 업무 — 미완료 + 일정(시작/마감일) 있는 업무만, 상위 10명.
|
||||
const byAssignee = {};
|
||||
incomplete.forEach(function (t) {
|
||||
if (!t.start_date && !t.due_date) return;
|
||||
const k = t.assignee_email ? (t.assignee_name || idOf(t.assignee_email)) : "담당자 없음";
|
||||
byAssignee[k] = (byAssignee[k] || 0) + 1;
|
||||
});
|
||||
let assigneeEntries = Object.keys(byAssignee).map(function (k) { return { label: k, value: byAssignee[k] }; })
|
||||
.sort(function (a, b) { return b.value - a.value; });
|
||||
if (assigneeEntries.length > 10) {
|
||||
const rest = assigneeEntries.slice(10).reduce(function (s, x) { return s + x.value; }, 0);
|
||||
assigneeEntries = assigneeEntries.slice(0, 10).concat([{ label: "기타", value: rest }]);
|
||||
// 담당자별 예정된 작업 — 미완료 + 일정(시작/마감일) 있는 작업만, 상위 10명.
|
||||
// 사람별 업무량이 드러나는 표라 관리자에게만 보여준다.
|
||||
if (isAdmin) {
|
||||
const byAssignee = {};
|
||||
incomplete.forEach(function (t) {
|
||||
if (!t.start_date && !t.due_date) return;
|
||||
const k = t.assignee_email ? (t.assignee_name || idOf(t.assignee_email)) : "담당자 없음";
|
||||
byAssignee[k] = (byAssignee[k] || 0) + 1;
|
||||
});
|
||||
let assigneeEntries = Object.keys(byAssignee).map(function (k) { return { label: k, value: byAssignee[k] }; })
|
||||
.sort(function (a, b) { return b.value - a.value; });
|
||||
if (assigneeEntries.length > 10) {
|
||||
const rest = assigneeEntries.slice(10).reduce(function (s, x) { return s + x.value; }, 0);
|
||||
assigneeEntries = assigneeEntries.slice(0, 10).concat([{ label: "기타", value: rest }]);
|
||||
}
|
||||
const assigneeCard = document.createElement("div");
|
||||
assigneeCard.className = "pj-dash-card pj-dash-card-wide";
|
||||
assigneeCard.innerHTML = '<div class="pj-dash-card-title">예정된 작업 합계(담당자별)</div>';
|
||||
assigneeCard.appendChild(dashBarChart(assigneeEntries));
|
||||
charts.appendChild(assigneeCard);
|
||||
}
|
||||
const assigneeCard = document.createElement("div");
|
||||
assigneeCard.className = "pj-dash-card pj-dash-card-wide";
|
||||
assigneeCard.innerHTML = '<div class="pj-dash-card-title">예정된 작업 합계(담당자별)</div>';
|
||||
assigneeCard.appendChild(dashBarChart(assigneeEntries));
|
||||
charts.appendChild(assigneeCard);
|
||||
|
||||
root.appendChild(charts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user