feat: 중간 점검 보고 내용은 지시자·담당자만 열람(상태는 전원 노출)
보고 '내용' 열람을 지시자 + 해당 업무 담당자로 제한: - 백엔드 buildDetail: viewerId 기준으로 권한 없으면 checkpointReports 를 빈 배열로 응답(findOne 에 현재 사용자 전달). 점검일에는 reported 플래그를 두어 상태는 전원 공유 - 프론트: checkpointState 는 reported 플래그 기준, '보고 완료' 클릭(모달)은 지시자·담당자만. 그 외는 비클릭 상태 배지 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -55,10 +55,12 @@ export interface ChecklistItem {
|
||||
/** 중간 점검일(표시용) */
|
||||
export interface TaskCheckpointView {
|
||||
id: string
|
||||
/** ISO — 보고 가능 구간(점검일~마감) 계산용 */
|
||||
/** ISO — 점검일 당일 판정용 */
|
||||
checkAt: string
|
||||
/** 표시 라벨 */
|
||||
dateLabel: string
|
||||
/** 보고 접수 여부(상태 배지용) */
|
||||
reported: boolean
|
||||
}
|
||||
|
||||
/** 중간 점검 보고(스냅샷, 표시용) */
|
||||
|
||||
@@ -322,10 +322,12 @@ const CP_STATE_LABEL: Record<CheckpointState, string> = {
|
||||
reported: '보고 완료',
|
||||
missed: '누락',
|
||||
}
|
||||
// 체크포인트 상태 — 보고됨 / 당일 / 지남(누락) / 예정
|
||||
// 보고 '내용' 열람 권한 — 지시자 또는 해당 업무 담당자(백엔드도 동일하게 제한)
|
||||
const canViewReports = computed(() => isIssuer.value || isAssignee.value)
|
||||
|
||||
// 체크포인트 상태 — 보고됨 / 당일 / 지남(누락) / 예정. 보고됨은 reported 플래그(전원 공유) 기준
|
||||
function checkpointState(cp: TaskCheckpointView): CheckpointState {
|
||||
const reported = task.value?.checkpointReports.some((r) => r.checkpointId === cp.id) ?? false
|
||||
if (reported) return 'reported'
|
||||
if (cp.reported) return 'reported'
|
||||
const cpDay = kstDate(cp.checkAt)
|
||||
if (cpDay === todayKst.value) return 'today'
|
||||
if (cpDay < todayKst.value) return 'missed'
|
||||
@@ -1279,7 +1281,7 @@ function badgeFor(name: string | undefined): { label: string; cls: string } {
|
||||
{{ reportingCpId === cp.id ? '취소' : '보고서 작성' }}
|
||||
</button>
|
||||
<button
|
||||
v-else-if="checkpointState(cp) === 'reported'"
|
||||
v-else-if="checkpointState(cp) === 'reported' && canViewReports"
|
||||
class="cp-state reported clickable"
|
||||
type="button"
|
||||
title="보고 내용 보기"
|
||||
|
||||
@@ -209,6 +209,7 @@ function toTaskDetailView(api: ApiTaskDetail): TaskDetailView {
|
||||
id: c.id,
|
||||
checkAt: c.checkAt,
|
||||
dateLabel: monthDayKo(c.checkAt),
|
||||
reported: c.reported,
|
||||
})),
|
||||
checkpointReports: api.checkpointReports.map((r) => ({
|
||||
id: r.id,
|
||||
|
||||
@@ -40,6 +40,8 @@ export interface ApiChecklistItem {
|
||||
export interface ApiCheckpoint {
|
||||
id: string
|
||||
checkAt: string
|
||||
// 보고 접수 여부(상태 표시용, 전원 노출)
|
||||
reported: boolean
|
||||
}
|
||||
|
||||
// 중간 점검 보고 스냅샷 항목
|
||||
|
||||
Reference in New Issue
Block a user