260625_01_ENH: 연구, 실사 수정사항 적용 1차
This commit is contained in:
@@ -60,6 +60,7 @@ type PerformanceFilters = {
|
||||
area: string[];
|
||||
startMonth: string[];
|
||||
monitoringDate: string;
|
||||
monitoringAdd: string[];
|
||||
localReviewStatus: string[];
|
||||
monitoring1Status: string[];
|
||||
monitoring2Status: string[];
|
||||
@@ -67,13 +68,39 @@ type PerformanceFilters = {
|
||||
keyword: string;
|
||||
};
|
||||
|
||||
const monthOptions: Code[] = Array.from({length: 12}, (_, index) => ({
|
||||
codeGroup: "month",
|
||||
codeValue: index + 1,
|
||||
codeGroupLabel: PERFORMANCE_FIELD_LABELS.performanceStartMonth,
|
||||
codeLabel: `${index + 1}월`,
|
||||
memo: "",
|
||||
}));
|
||||
const monthOptions: Code[] = [
|
||||
{
|
||||
codeGroup: "month",
|
||||
codeValue: 0,
|
||||
codeGroupLabel: PERFORMANCE_FIELD_LABELS.performanceStartMonth,
|
||||
codeLabel: `미정`,
|
||||
memo: "",
|
||||
},
|
||||
...Array.from({length: 12}, (_, index) => ({
|
||||
codeGroup: "month",
|
||||
codeValue: index + 1,
|
||||
codeGroupLabel: PERFORMANCE_FIELD_LABELS.performanceStartMonth,
|
||||
codeLabel: `${index + 1}월`,
|
||||
memo: "",
|
||||
}))
|
||||
];
|
||||
|
||||
const monitoringAddOptions: Code[] = [
|
||||
{
|
||||
codeGroup: "monitoring_add",
|
||||
codeValue: 0,
|
||||
codeGroupLabel: PERFORMANCE_FIELD_LABELS.monitoringAdd,
|
||||
codeLabel: "추가 모니터링 X",
|
||||
memo: "",
|
||||
},
|
||||
{
|
||||
codeGroup: "monitoring_add",
|
||||
codeValue: 1,
|
||||
codeGroupLabel: PERFORMANCE_FIELD_LABELS.monitoringAdd,
|
||||
codeLabel: "추가 모니터링 O",
|
||||
memo: "",
|
||||
},
|
||||
];
|
||||
|
||||
const PerformancePage = () => {
|
||||
const mounted = useMounted();
|
||||
@@ -101,6 +128,7 @@ const PerformancePage = () => {
|
||||
area: [],
|
||||
startMonth: [],
|
||||
monitoringDate: "",
|
||||
monitoringAdd: [],
|
||||
localReviewStatus: [],
|
||||
monitoring1Status: [],
|
||||
monitoring2Status: [],
|
||||
@@ -191,6 +219,7 @@ const PerformancePage = () => {
|
||||
keyword: filters.keyword,
|
||||
}) &&
|
||||
matchesStatus(filters.startMonth, String(item.performanceStartMonth)) &&
|
||||
matchesStatus(filters.monitoringAdd, item.id % 100 === 1 ? "0" : "1") &&
|
||||
matchesStatus(filters.localReviewStatus, getReviewStatusFilterValue(
|
||||
localReview,
|
||||
getCodeLabel(codes, "review_status", localReview?.reviewStatus),
|
||||
@@ -269,7 +298,7 @@ const PerformancePage = () => {
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<div className="flex min-w-24 justify-center text-xs">
|
||||
<div className="flex justify-center text-xs">
|
||||
<StatusPill
|
||||
variant={display.variant}
|
||||
onClick={onClick}
|
||||
@@ -299,7 +328,7 @@ const PerformancePage = () => {
|
||||
const visitUser = getMonitoringRecordedUser(latestVisit);
|
||||
|
||||
return (
|
||||
<div className="flex min-w-24 justify-center text-xs">
|
||||
<div className="flex justify-center text-xs">
|
||||
<StatusPill
|
||||
variant={display.variant}
|
||||
onClick={isReviewComplete(row.review) ? () => downloadReviewOriginal(performance.id, row.review) : undefined}
|
||||
@@ -319,27 +348,47 @@ const PerformancePage = () => {
|
||||
};
|
||||
|
||||
const columns = useMemo<DataTableColumn<PerformanceFull>[]>(() => [
|
||||
{accessorKey: "no", header: PERFORMANCE_FIELD_LABELS.no,
|
||||
accessorFn: (row) => row.performanceDetail["performanceNo"] ?? "",
|
||||
cell: ({row}) => row.original.performanceDetail["performanceNo"] ?? "",
|
||||
},
|
||||
{accessorKey: "id", header: PERFORMANCE_FIELD_LABELS.id, cell: ({row}) => row.original.id},
|
||||
{accessorKey: "monitoringAdd", header: PERFORMANCE_FIELD_LABELS.monitoringAdd,
|
||||
accessorFn: (row) => row.id % 100 !== 1? "추가" : "",
|
||||
cell: ({row}) => row.original.id % 100 !== 1? "추가" : "",
|
||||
},
|
||||
{id: "businessType", header: PERFORMANCE_FIELD_LABELS.businessType, cell: ({row}) => getCodeLabel(codes, "business_type", row.original.businessType)},
|
||||
{id: "genre", header: PERFORMANCE_FIELD_LABELS.performanceGenre, cell: ({row}) => getCodeLabel(codes, "genre", row.original.performanceGenre)},
|
||||
{id: "area", header: PERFORMANCE_FIELD_LABELS.performanceArea, cell: ({row}) => getCodeLabel(codes, "area", row.original.performanceArea)},
|
||||
{accessorKey: "artistName", header: PERFORMANCE_FIELD_LABELS.artistName},
|
||||
{accessorKey: "performanceName", header: PERFORMANCE_FIELD_LABELS.performanceName},
|
||||
{id: "startMonth", header: PERFORMANCE_FIELD_LABELS.performanceStartMonth,
|
||||
accessorFn: (row) => row.performanceStartMonth ?? 99,
|
||||
cell: ({row}) => `${row.original.performanceStartMonth}월`},
|
||||
accessorFn: (row) => row.performanceStartMonth ?? 0,
|
||||
cell: ({row}) => row.original.performanceStartMonth === 0? "미정":`${row.original.performanceStartMonth}월`},
|
||||
{accessorKey: "performanceDtInfo", header: PERFORMANCE_FIELD_LABELS.performanceDtInfo, enableSorting: false},
|
||||
{accessorKey: "performanceTimeInfo", header: PERFORMANCE_FIELD_LABELS.performanceTimeInfo, enableSorting: false},
|
||||
...(!isWrittenReviewer ? [{
|
||||
id: "monitoringDate",
|
||||
header: PERFORMANCE_FIELD_LABELS.monitoringDate,
|
||||
accessorFn: (row) => row.performanceMonitoringSchedule?.monitoringDate ?? "",
|
||||
cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringDate ?? "",
|
||||
} satisfies DataTableColumn<PerformanceFull>] : []),
|
||||
...(!isWrittenReviewer ? [
|
||||
{
|
||||
id: "monitoringDate",
|
||||
header: PERFORMANCE_FIELD_LABELS.monitoringDate,
|
||||
accessorFn: (row) => row.performanceMonitoringSchedule?.monitoringDate ?? "",
|
||||
cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringDate ?? "",
|
||||
},
|
||||
{
|
||||
id: "timeTreeCheckDt",
|
||||
header: PERFORMANCE_FIELD_LABELS.timeTreeCheckDt,
|
||||
accessorFn: (row) => row.performanceDetail["timeTreeCheckDt"] ?? "",
|
||||
cell: ({row}) => row.original.performanceDetail["timeTreeCheckDt"] ?? "",
|
||||
}
|
||||
]: []) as DataTableColumn<PerformanceFull>[],
|
||||
{
|
||||
id: "localReview",
|
||||
header: "지자체 평가",
|
||||
cell: ({row}) => {
|
||||
if(row.original.id % 100 !== 1){
|
||||
return "-";
|
||||
}
|
||||
|
||||
const found = getReviewByType(row.original, LOCAL_GOVERNMENT_REVIEW_TYPE);
|
||||
return renderReviewStatus({
|
||||
performance: row.original,
|
||||
@@ -349,13 +398,22 @@ const PerformancePage = () => {
|
||||
noTooltip: isWrittenReviewer,
|
||||
});
|
||||
},
|
||||
size:40,
|
||||
},
|
||||
{id: "monitoring1", header: "모니터링 1", cell: ({row}) => renderMonitoringStatus(row.original, 0)},
|
||||
{id: "monitoring2", header: "모니터링 2", cell: ({row}) => renderMonitoringStatus(row.original, 1)},
|
||||
...(!isWrittenReviewer ? [
|
||||
{id: "monitoring1", header: "모니터링 1", cell: ({row}) => renderMonitoringStatus(row.original, 0), size:40,},
|
||||
{id: "monitoring2", header: "모니터링 2", cell: ({row}) => renderMonitoringStatus(row.original, 1), size:40,},
|
||||
] : [
|
||||
{id: "monitoring", header: "모니터링", cell: ({row}) => renderMonitoringStatus(row.original, 0), size:40,}
|
||||
]) as DataTableColumn<PerformanceFull>[],
|
||||
{
|
||||
id: "writtenReview",
|
||||
header: "서면 평가",
|
||||
cell: ({row}) => {
|
||||
if(row.original.id % 100 !== 1){
|
||||
return "-";
|
||||
}
|
||||
|
||||
const found = getVisibleWrittenReviewRow(row.original);
|
||||
return renderReviewStatus({
|
||||
performance: row.original,
|
||||
@@ -365,6 +423,7 @@ const PerformancePage = () => {
|
||||
alwaysAssigned: Boolean(found?.assign),
|
||||
});
|
||||
},
|
||||
size:40,
|
||||
},
|
||||
], [codes, getVisibleWrittenReviewRow, isWrittenReviewer]);
|
||||
|
||||
@@ -410,7 +469,10 @@ const PerformancePage = () => {
|
||||
검색
|
||||
</Button>
|
||||
</div>
|
||||
<div className="grid gap-2 md:grid-cols-[183px_183px_183px_183px]">
|
||||
<div className="grid gap-2 md:grid-cols-[183px_183px_183px_183px_183px]">
|
||||
{!isWrittenReviewer && (
|
||||
<MultiFilterSelect value={filters.monitoringAdd} onChange={(value) => updateFilters((prev) => ({...prev, monitoringAdd: value}))} options={monitoringAddOptions} placeholder={PERFORMANCE_FIELD_LABELS.monitoringAdd} />
|
||||
)}
|
||||
<MultiFilterSelect value={filters.localReviewStatus} onChange={(value) => updateFilters((prev) => ({...prev, localReviewStatus: value}))} options={localReviewStatusOptions} placeholder="지자체 평가 상태" />
|
||||
<MultiFilterSelect value={filters.monitoring1Status} onChange={(value) => updateFilters((prev) => ({...prev, monitoring1Status: value}))} options={monitoringStatusOptions} placeholder="모니터링1 상태" />
|
||||
<MultiFilterSelect value={filters.monitoring2Status} onChange={(value) => updateFilters((prev) => ({...prev, monitoring2Status: value}))} options={monitoringStatusOptions} placeholder="모니터링2 상태" />
|
||||
@@ -444,6 +506,8 @@ const PerformancePage = () => {
|
||||
selectMode={isWrittenReviewer ? "none" : "click-event"}
|
||||
onRowClick={isWrittenReviewer ? undefined : openDetail}
|
||||
defaultPageSize={10}
|
||||
headerFontClass="content-text-base"
|
||||
cellFontClass="content-text-sm"
|
||||
/>
|
||||
</PagePanel>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user