260812_01_ENH: 배정·진행 현황 개선 및 예약/이벤트 이력 기능 추가
- 프로젝트별 외주사·필드워커 배정 현황 및 미배정 건수 UI 추가 - 현장 면접 진행 여부와 사용자 권한에 따른 배정 탭·필터·컬럼 노출 제어 - 컨택 마지막 이벤트 일자 필터·정렬 및 결과/일자 컬럼 분리 - 컨택·면접·발송 현황의 날짜 범위 선택 optional 처리 - 진행 현황의 미배정 표시 및 일자별 미사용 결과 제외 - 전역 예약 기간 조회·이동 및 5분 단위 예약 알림 추가 - 내부 관리자용 이벤트 이력 단건 삭제 기능 추가 - 리스트 필터 UI 및 일반 헤더 정렬 기준 개선 - 프로젝트 저장 시 선택 프로젝트 정보 동기화
This commit is contained in:
@@ -24,7 +24,7 @@ const getResultColumns = (resultCodeArray: ResultCode[], surveys: ProjectSurvey[
|
||||
|
||||
const formatResult = (
|
||||
result?: ListResultBase,
|
||||
options?: { resultType?: ResultCodeType; showCount?: boolean },
|
||||
options?: { resultType?: ResultCodeType; showCount?: boolean; showDate?: boolean },
|
||||
) => {
|
||||
const lastResultCd = result?.lastResultCd;
|
||||
if (lastResultCd === undefined) return "";
|
||||
@@ -33,6 +33,7 @@ const getResultColumns = (resultCodeArray: ResultCode[], surveys: ProjectSurvey[
|
||||
options?.resultType !== undefined ? labelByTypeCode.get(`${options.resultType}:${lastResultCd}`) ?? "" : "";
|
||||
const label = result?.lastResultViewLabel || fallbackLabel;
|
||||
const showCount = options?.showCount ?? true;
|
||||
const showDate = options?.showDate ?? true;
|
||||
const count = result?.attemptCount ?? 0;
|
||||
const resultText = showCount ? `${lastResultCd}. ${label} (${count}회)` : `${lastResultCd}. ${label}`;
|
||||
const dt = result?.lastResultDt ? formatKst(result.lastResultDt, "dateHourMin") : "";
|
||||
@@ -40,7 +41,7 @@ const getResultColumns = (resultCodeArray: ResultCode[], surveys: ProjectSurvey[
|
||||
return (
|
||||
<div className="leading-tight">
|
||||
<div>{resultText}</div>
|
||||
{dt && <div>({dt})</div>}
|
||||
{showDate && dt && <div>({dt})</div>}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -65,7 +66,20 @@ const getResultColumns = (resultCodeArray: ResultCode[], surveys: ProjectSurvey[
|
||||
header: "컨택 결과",
|
||||
accessorFn: (row) => (row.contactResult as ListContactResult | undefined)?.lastResultCd ?? null,
|
||||
cell: ({ row }) =>
|
||||
formatResult(row.original.contactResult as ListContactResult | undefined, { resultType: ResultCodeType.CONTACT }),
|
||||
formatResult(row.original.contactResult as ListContactResult | undefined, {
|
||||
resultType: ResultCodeType.CONTACT,
|
||||
showDate: false,
|
||||
}),
|
||||
enableSorting: true,
|
||||
},
|
||||
{
|
||||
id: "result-date-contact",
|
||||
header: "컨택 일자",
|
||||
accessorFn: (row) => (row.contactResult as ListContactResult | undefined)?.lastResultDt ?? null,
|
||||
cell: ({ row }) => {
|
||||
const lastResultDt = (row.original.contactResult as ListContactResult | undefined)?.lastResultDt;
|
||||
return lastResultDt ? formatKst(lastResultDt, "dateHourMin") : "";
|
||||
},
|
||||
enableSorting: true,
|
||||
},
|
||||
{
|
||||
@@ -108,9 +122,10 @@ const getResultColumns = (resultCodeArray: ResultCode[], surveys: ProjectSurvey[
|
||||
|
||||
const resultColumnOrder = new Map([
|
||||
["result-contact", 0],
|
||||
["result-interview", 1],
|
||||
["mailSendResult", 3],
|
||||
["smsSendResult", 4],
|
||||
["result-date-contact", 1],
|
||||
["result-interview", 2],
|
||||
["mailSendResult", 4],
|
||||
["smsSendResult", 5],
|
||||
]);
|
||||
|
||||
return columns.sort((a, b) => (resultColumnOrder.get(a.id ?? "") ?? 2) - (resultColumnOrder.get(b.id ?? "") ?? 2));
|
||||
|
||||
@@ -18,7 +18,8 @@ export const getProjectColumns = (
|
||||
e.stopPropagation();
|
||||
onNavigateToInfo(projectInfo);
|
||||
};
|
||||
const infoCellClass = "flex h-full w-full items-center cursor-pointer";
|
||||
// DataTable의 body row td 패딩(px-2 py-1)만큼 음수 마진/확장으로 채워서, 클릭 영역을 셀 패딩까지 포함한 전체로 넓힌다.
|
||||
const infoCellClass = "flex h-[calc(100%+0.5rem)] w-[calc(100%+1rem)] -mx-2 -my-1 items-center px-2 cursor-pointer";
|
||||
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user