260518_01_ENH: 순위 테이블, 코멘트 테이블에 타이틀 추가 및
섹션 타이틀에 SUFFIX 추가
This commit is contained in:
@@ -3,11 +3,18 @@
|
|||||||
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
||||||
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
||||||
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
||||||
|
import { COMMENT_TABLE_TITLE } from "@/config/kfpaConfig";
|
||||||
|
|
||||||
const BridgePlatformPage = () => {
|
const BridgePlatformPage = () => {
|
||||||
const { selectedDiv } = useLayoutFilter();
|
const { selectedDiv } = useLayoutFilter();
|
||||||
|
|
||||||
return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} />;
|
return selectedDiv === "-1"
|
||||||
|
? <CustomerSatisfactionTotal />
|
||||||
|
: <CustomerSatisfactionDetail
|
||||||
|
selectedDiv={selectedDiv}
|
||||||
|
viewSubTitle={false}
|
||||||
|
sectionTitleSuffix={COMMENT_TABLE_TITLE}
|
||||||
|
/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default BridgePlatformPage;
|
export default BridgePlatformPage;
|
||||||
|
|||||||
@@ -3,11 +3,18 @@
|
|||||||
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
||||||
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
import CustomerSatisfactionTotal from "@/components/kfpa/CustomerSatisfactionTotal";
|
||||||
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDetail";
|
||||||
|
import { COMMENT_TABLE_TITLE } from "@/config/kfpaConfig";
|
||||||
|
|
||||||
const UcisPage = () => {
|
const UcisPage = () => {
|
||||||
const { selectedDiv } = useLayoutFilter();
|
const { selectedDiv } = useLayoutFilter();
|
||||||
|
|
||||||
return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} />;
|
return selectedDiv === "-1"
|
||||||
|
? <CustomerSatisfactionTotal />
|
||||||
|
: <CustomerSatisfactionDetail
|
||||||
|
selectedDiv={selectedDiv}
|
||||||
|
viewSubTitle={false}
|
||||||
|
sectionTitleSuffix={COMMENT_TABLE_TITLE}
|
||||||
|
/>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default UcisPage;
|
export default UcisPage;
|
||||||
|
|||||||
10
src/components/common/SectionSubTitle.tsx
Normal file
10
src/components/common/SectionSubTitle.tsx
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
const SectionSubTitle = ({title}:{title:string}) => {
|
||||||
|
return (
|
||||||
|
<div className="font-semibold flex items-center gap-2 content-text-lg mb-1">
|
||||||
|
<span className="w-3 h-3 bg-black-600" />
|
||||||
|
{title}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SectionSubTitle;
|
||||||
@@ -16,9 +16,11 @@ import { useLayoutFilter } from "@/components/layout/LayoutCategoryContext";
|
|||||||
import { useAuth } from "@/hooks/useAuth";
|
import { useAuth } from "@/hooks/useAuth";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import {
|
import {
|
||||||
|
COMMENT_TABLE_TITLE,
|
||||||
getDashboardCommentRows,
|
getDashboardCommentRows,
|
||||||
getDashboardRankRows,
|
getDashboardRankRows,
|
||||||
getSideMenuLabel,
|
getSideMenuLabel,
|
||||||
|
RANK_TABLE_TITLE,
|
||||||
} from "@/config/kfpaConfig";
|
} from "@/config/kfpaConfig";
|
||||||
import CustomerSatisfactionRankTable from "./CustomerSatisfactionRankTable";
|
import CustomerSatisfactionRankTable from "./CustomerSatisfactionRankTable";
|
||||||
import CustomerSatisfactionCommentTable from "./CustomerSatisfactionCommentTable";
|
import CustomerSatisfactionCommentTable from "./CustomerSatisfactionCommentTable";
|
||||||
@@ -28,12 +30,19 @@ import {
|
|||||||
getCommentColumns,
|
getCommentColumns,
|
||||||
getSelectedDetail,
|
getSelectedDetail,
|
||||||
} from "@/lib/kfpa-util";
|
} from "@/lib/kfpa-util";
|
||||||
|
import SectionSubTitle from "@/components/common/SectionSubTitle";
|
||||||
|
|
||||||
export type CustomerSatisfactionDetailProps = {
|
export type CustomerSatisfactionDetailProps = {
|
||||||
selectedDiv: string;
|
selectedDiv: string;
|
||||||
|
sectionTitleSuffix?: string;
|
||||||
|
viewSubTitle?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const CustomerSatisfactionDetail = ({ selectedDiv }: CustomerSatisfactionDetailProps) => {
|
const CustomerSatisfactionDetail = ({
|
||||||
|
selectedDiv,
|
||||||
|
sectionTitleSuffix,
|
||||||
|
viewSubTitle = true,
|
||||||
|
}: CustomerSatisfactionDetailProps) => {
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const { auth } = useAuth();
|
const { auth } = useAuth();
|
||||||
@@ -58,6 +67,7 @@ const CustomerSatisfactionDetail = ({ selectedDiv }: CustomerSatisfactionDetailP
|
|||||||
}, [commentColumns, detail?.commentValues, selectedDiv]);
|
}, [commentColumns, detail?.commentValues, selectedDiv]);
|
||||||
|
|
||||||
const canEdit = hasAdminRouteParam(searchParams) && !!auth.user;
|
const canEdit = hasAdminRouteParam(searchParams) && !!auth.user;
|
||||||
|
const tableHeaderClassName = "mb-1 flex min-h-9 items-center gap-3 [&>div]:mb-0";
|
||||||
|
|
||||||
const updateDraft = (columnKey: string, field: CommentField, value: string) => {
|
const updateDraft = (columnKey: string, field: CommentField, value: string) => {
|
||||||
setDraft((prev) => ({
|
setDraft((prev) => ({
|
||||||
@@ -113,49 +123,59 @@ const CustomerSatisfactionDetail = ({ selectedDiv }: CustomerSatisfactionDetailP
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<SectionTitle title={`${getSideMenuLabel(categoryKey, selectedDiv)} 상세 내역`} />
|
<SectionTitle title={`${getSideMenuLabel(categoryKey, selectedDiv)} ${sectionTitleSuffix ?? '상세 내역'}`} />
|
||||||
|
|
||||||
<div className={cn("mt-6 flex w-full items-start gap-16 overflow-x-auto pb-2", canEdit && "pt-10")}>
|
<div className="mt-4 flex w-full items-start gap-16 overflow-x-auto pb-2">
|
||||||
{shouldShowRankTable && <CustomerSatisfactionRankTable detail={detail} rankRows={rankRows} />}
|
{shouldShowRankTable && (
|
||||||
|
<div className="shrink-0 w-[285px]">
|
||||||
|
<div className={tableHeaderClassName}>
|
||||||
|
{viewSubTitle && <SectionSubTitle title={RANK_TABLE_TITLE} />}
|
||||||
|
</div>
|
||||||
|
<CustomerSatisfactionRankTable detail={detail} rankRows={rankRows} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className={cn("relative min-w-[760px] flex-1", !shouldShowRankTable && "w-full")}>
|
<div className={cn("min-w-[760px] flex-1", !shouldShowRankTable && "w-full")}>
|
||||||
{canEdit && (
|
<div className={cn(tableHeaderClassName, viewSubTitle ? "justify-between" : "justify-end")}>
|
||||||
<div className="absolute -top-10 right-0 flex justify-end gap-2">
|
{viewSubTitle && <SectionSubTitle title={COMMENT_TABLE_TITLE} />}
|
||||||
<Button
|
{canEdit && (
|
||||||
type="button"
|
<div className="flex shrink-0 justify-end gap-2">
|
||||||
className={
|
|
||||||
isEditing
|
|
||||||
? "gap-2 border border-transparent bg-red-600 text-white w-25 shadow-sm hover:bg-red-500 hover:text-white"
|
|
||||||
: "gap-2 border border-transparent bg-green-600 text-white w-25 shadow-sm hover:bg-green-500 hover:text-white"
|
|
||||||
}
|
|
||||||
disabled={writeMutation.isPending}
|
|
||||||
onClick={handleEditToggle}
|
|
||||||
>
|
|
||||||
{isEditing ? (
|
|
||||||
<>
|
|
||||||
<Save className="w-4 h-4" />
|
|
||||||
<span className="hidden sm:inline">저장</span>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Pencil className="w-4 h-4" />
|
|
||||||
<span className="hidden sm:inline">수정</span>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
{isEditing && (
|
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
className="gap-2 border border-transparent bg-black-400 text-white w-25 shadow-sm hover:bg-black-200 hover:text-white"
|
className={
|
||||||
|
isEditing
|
||||||
|
? "gap-2 border border-transparent bg-red-600 text-white w-25 shadow-sm hover:bg-red-500 hover:text-white"
|
||||||
|
: "gap-2 border border-transparent bg-green-600 text-white w-25 shadow-sm hover:bg-green-500 hover:text-white"
|
||||||
|
}
|
||||||
disabled={writeMutation.isPending}
|
disabled={writeMutation.isPending}
|
||||||
onClick={handleCancelEdit}
|
onClick={handleEditToggle}
|
||||||
>
|
>
|
||||||
<X className="w-4 h-4" />
|
{isEditing ? (
|
||||||
<span className="hidden sm:inline">취소</span>
|
<>
|
||||||
|
<Save className="w-4 h-4" />
|
||||||
|
<span className="hidden sm:inline">저장</span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Pencil className="w-4 h-4" />
|
||||||
|
<span className="hidden sm:inline">수정</span>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
{isEditing && (
|
||||||
</div>
|
<Button
|
||||||
)}
|
type="button"
|
||||||
|
className="gap-2 border border-transparent bg-black-400 text-white w-25 shadow-sm hover:bg-black-200 hover:text-white"
|
||||||
|
disabled={writeMutation.isPending}
|
||||||
|
onClick={handleCancelEdit}
|
||||||
|
>
|
||||||
|
<X className="w-4 h-4" />
|
||||||
|
<span className="hidden sm:inline">취소</span>
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
<CustomerSatisfactionCommentTable
|
<CustomerSatisfactionCommentTable
|
||||||
columns={commentColumns}
|
columns={commentColumns}
|
||||||
|
|||||||
@@ -43,18 +43,16 @@ const CustomerSatisfactionRankTable = ({ detail, rankRows }: CustomerSatisfactio
|
|||||||
}, [detail?.csiRanks, rankRows]);
|
}, [detail?.csiRanks, rankRows]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="shrink-0 w-[285px]">
|
<DataTable
|
||||||
<DataTable
|
columns={rankColumns}
|
||||||
columns={rankColumns}
|
rows={rows}
|
||||||
rows={rows}
|
tableClassName="kfpa-table kfpa-detail-table kfpa-detail-rank-table"
|
||||||
tableClassName="kfpa-table kfpa-detail-table kfpa-detail-rank-table"
|
wrapperClassName="w-full"
|
||||||
wrapperClassName="w-full"
|
minWidth={285}
|
||||||
minWidth={285}
|
getCellClassName={(row, column) =>
|
||||||
getCellClassName={(row, column) =>
|
column.key === "type" ? row.headerClassName : undefined
|
||||||
column.key === "type" ? row.headerClassName : undefined
|
}
|
||||||
}
|
/>
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
export const SITE_TITLE = "고객 관계 성과측정 실시간 대시보드";
|
|
||||||
|
|
||||||
import type { TopChartTableRow } from "@/components/combo/types";
|
import type { TopChartTableRow } from "@/components/combo/types";
|
||||||
import type { SignStyle } from "@/components/table/types";
|
import type { SignStyle } from "@/components/table/types";
|
||||||
import { GAP_WORDING } from "@/const/kfpa.const";
|
import { GAP_WORDING } from "@/const/kfpa.const";
|
||||||
|
|
||||||
|
export const SITE_TITLE = "고객 관계 성과측정 실시간 대시보드";
|
||||||
|
|
||||||
export const CUSTOMER_SATISFACTION_DECIMAL_PLACES = 2;
|
export const CUSTOMER_SATISFACTION_DECIMAL_PLACES = 2;
|
||||||
|
|
||||||
|
export const RANK_TABLE_TITLE = "물건 유형별 고객만족지수";
|
||||||
|
|
||||||
|
export const COMMENT_TABLE_TITLE = "고객 관점의 성과분류";
|
||||||
|
|
||||||
export const CUSTOMER_SATISFACTION_GAP_SIGN_STYLE: SignStyle<TopChartTableRow> = {
|
export const CUSTOMER_SATISFACTION_GAP_SIGN_STYLE: SignStyle<TopChartTableRow> = {
|
||||||
rowSelector: (row) => row.label === GAP_WORDING,
|
rowSelector: (row) => row.label === GAP_WORDING,
|
||||||
display: "arrow",
|
display: "arrow",
|
||||||
@@ -70,7 +74,7 @@ const SIDE_MENU_ENTRIES_BY_CATEGORY = {
|
|||||||
],
|
],
|
||||||
"2604005_D": [
|
"2604005_D": [
|
||||||
["-1", CATEGORY_KEY_MAP["2604005_D"]],
|
["-1", CATEGORY_KEY_MAP["2604005_D"]],
|
||||||
["21", "손해데이터팀"],
|
["21", "인슈데이터팀"],
|
||||||
],
|
],
|
||||||
"2604005_C": [["-1", CATEGORY_KEY_MAP["2604005_C"]]],
|
"2604005_C": [["-1", CATEGORY_KEY_MAP["2604005_C"]]],
|
||||||
"2604005_A": [["-1", CATEGORY_KEY_MAP["2604005_A"]]],
|
"2604005_A": [["-1", CATEGORY_KEY_MAP["2604005_A"]]],
|
||||||
|
|||||||
Reference in New Issue
Block a user