Merge pull request 'develop' (#50) from develop into master
Reviewed-on: #50
This commit is contained in:
@@ -174,12 +174,13 @@ const ListContactPageContent = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6 text-sm">
|
<div className="space-y-6 text-sm">
|
||||||
<div className="flex items-center gap-3 w-1/2 pr-5">
|
{/* lg 미만은 아래 패널이 1열이므로 전체 폭을 쓰고, 한 줄에 들어가도록 글자/간격을 줄인다. */}
|
||||||
|
<div className="flex w-full items-center gap-2 lg:w-1/2 lg:gap-3 lg:pr-5">
|
||||||
<Button type="button" variant="outline" size="icon" onClick={handleGoToListManage} aria-label="목록으로">
|
<Button type="button" variant="outline" size="icon" onClick={handleGoToListManage} aria-label="목록으로">
|
||||||
<ArrowLeft className="h-4 w-4" />
|
<ArrowLeft className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
<h1 className="text-2xl font-bold tracking-tight">컨택 진행</h1>
|
<h1 className="text-xl font-bold tracking-tight max-lg:whitespace-nowrap lg:text-2xl">컨택 진행</h1>
|
||||||
<span className="text-2xl font-bold tracking-tight">SID: {sid}</span>
|
<span className="text-xl font-bold tracking-tight max-lg:min-w-0 max-lg:truncate lg:text-2xl">SID: {sid}</span>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ const ListManagePage = () => {
|
|||||||
initialSearchState={restoredForThisProject}
|
initialSearchState={restoredForThisProject}
|
||||||
onSearchStateChange={setSearchUiState}
|
onSearchStateChange={setSearchUiState}
|
||||||
focusRowId={restoredForThisProject?.sid}
|
focusRowId={restoredForThisProject?.sid}
|
||||||
|
collapsibleFiltersOnMobile
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{isInternal && (
|
{isInternal && (
|
||||||
|
|||||||
@@ -48,69 +48,79 @@ export function AppHeader({
|
|||||||
const ctiConnectionStatus = useCtiConnectionStatus();
|
const ctiConnectionStatus = useCtiConnectionStatus();
|
||||||
const isCtiConnected = ctiConnectionStatus === "open";
|
const isCtiConnected = ctiConnectionStatus === "open";
|
||||||
|
|
||||||
|
const showProjectTitle = isViewProjectTitle && !!projectName;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<KriHeader
|
<>
|
||||||
logo={
|
<KriHeader
|
||||||
<div className="flex h-10 w-20 items-center justify-center">
|
logo={
|
||||||
<Image
|
<div className="flex h-10 w-20 items-center justify-center">
|
||||||
src="/kri_logo.png"
|
<Image
|
||||||
alt="KRI 로고"
|
src="/kri_logo.png"
|
||||||
width={120}
|
alt="KRI 로고"
|
||||||
height={40}
|
width={120}
|
||||||
className="object-contain"
|
height={40}
|
||||||
priority
|
className="object-contain"
|
||||||
/>
|
priority
|
||||||
</div>
|
/>
|
||||||
}
|
|
||||||
homePath="/"
|
|
||||||
menus={isContactPage? []:topMenus}
|
|
||||||
activeMenuId={activeTopId}
|
|
||||||
menuOpen={menuOpen}
|
|
||||||
showMenuButton={!isMain && !isContactPage}
|
|
||||||
onToggleMenu={onToggleMenu}
|
|
||||||
onNavigate={(path) => {if(!isContactPage) onNavigate(path)}}
|
|
||||||
className="border-gray-200 bg-white"
|
|
||||||
innerClassName="h-16 px-4"
|
|
||||||
center={
|
|
||||||
isViewProjectTitle && projectName ? (
|
|
||||||
<h1 className="ml-3 text-2xl font-bold">{projectName}</h1>
|
|
||||||
) : null
|
|
||||||
}
|
|
||||||
right={
|
|
||||||
<>
|
|
||||||
<div className="flex items-center gap-1 border-r pr-4">
|
|
||||||
<Button variant="ghost" size="icon" onClick={decreaseFontSize} title="폰트 작게">
|
|
||||||
<ZoomOut className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
<span className="min-w-[3rem] text-center text-xs text-gray-500">{fontSize}px</span>
|
|
||||||
<Button variant="ghost" size="icon" onClick={increaseFontSize} title="폰트 크게">
|
|
||||||
<ZoomIn className="h-4 w-4" />
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
<Button variant="ghost" size="icon-lg" onClick={onOpenReserveSearch} title="예약 내역 조회">
|
}
|
||||||
<CalendarClock className="size-6" />
|
homePath="/"
|
||||||
</Button>
|
menus={isContactPage? []:topMenus}
|
||||||
<span className="hidden items-center gap-1.5 text-sm text-gray-600 sm:inline-flex">
|
activeMenuId={activeTopId}
|
||||||
{userInfo?.userName || ""}
|
menuOpen={menuOpen}
|
||||||
{seatNo ? (
|
showMenuButton={!isMain && !isContactPage}
|
||||||
<span className="inline-flex items-center gap-1">
|
onToggleMenu={onToggleMenu}
|
||||||
{`(${seatNo})`}
|
onNavigate={(path) => {if(!isContactPage) onNavigate(path)}}
|
||||||
<span
|
className="border-gray-200 bg-white"
|
||||||
className={cn(
|
innerClassName="h-16 px-4"
|
||||||
"inline-block h-2 w-2 rounded-full",
|
center={
|
||||||
isCtiConnected ? "bg-green-500" : "bg-red-500",
|
showProjectTitle ? (
|
||||||
)}
|
<h1 className="ml-3 hidden truncate text-2xl font-bold lg:block" title={projectName}>{projectName}</h1>
|
||||||
title={isCtiConnected ? "CTI 연결됨" : "CTI 연결 안됨"}
|
) : null
|
||||||
/>
|
}
|
||||||
</span>
|
right={
|
||||||
) : null}
|
<>
|
||||||
</span>
|
<div className="flex items-center gap-1 border-r pr-4">
|
||||||
<Button variant="ghost" size="sm" className="gap-2" onClick={() => onNavigate("/logout")}>
|
<Button variant="ghost" size="icon" onClick={decreaseFontSize} title="폰트 작게">
|
||||||
<LogOut className="h-4 w-4" />
|
<ZoomOut className="h-4 w-4" />
|
||||||
<span className="hidden sm:inline">로그아웃</span>
|
</Button>
|
||||||
</Button>
|
<span className="min-w-[3rem] text-center text-xs text-gray-500">{fontSize}px</span>
|
||||||
</>
|
<Button variant="ghost" size="icon" onClick={increaseFontSize} title="폰트 크게">
|
||||||
}
|
<ZoomIn className="h-4 w-4" />
|
||||||
/>
|
</Button>
|
||||||
|
</div>
|
||||||
|
<Button variant="ghost" size="icon-lg" onClick={onOpenReserveSearch} title="예약 내역 조회">
|
||||||
|
<CalendarClock className="size-6" />
|
||||||
|
</Button>
|
||||||
|
<span className="hidden items-center gap-1.5 text-sm text-gray-600 sm:inline-flex">
|
||||||
|
{userInfo?.userName || ""}
|
||||||
|
{seatNo ? (
|
||||||
|
<span className="inline-flex items-center gap-1">
|
||||||
|
{`(${seatNo})`}
|
||||||
|
<span
|
||||||
|
className={cn(
|
||||||
|
"inline-block h-2 w-2 rounded-full",
|
||||||
|
isCtiConnected ? "bg-green-500" : "bg-red-500",
|
||||||
|
)}
|
||||||
|
title={isCtiConnected ? "CTI 연결됨" : "CTI 연결 안됨"}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
) : null}
|
||||||
|
</span>
|
||||||
|
<Button variant="ghost" size="sm" className="gap-2" onClick={() => onNavigate("/logout")}>
|
||||||
|
<LogOut className="h-4 w-4" />
|
||||||
|
<span className="hidden sm:inline">로그아웃</span>
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{/* 모바일(lg 미만)은 헤더 공간이 좁아 프로젝트명을 헤더 아래 한 줄로 내려 표시한다. */}
|
||||||
|
{showProjectTitle ? (
|
||||||
|
<div className="border-b border-gray-200 bg-white px-4 py-2 lg:hidden">
|
||||||
|
<h1 className="truncate text-center text-lg font-bold" title={projectName}>{projectName}</h1>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,6 +154,11 @@ export default function AppMainLayout({ children, initialFontSize }: AppMainLayo
|
|||||||
setFontSize(Math.min(FONT_SIZE.MAX, fontSize + 2));
|
setFontSize(Math.min(FONT_SIZE.MAX, fontSize + 2));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 모바일(lg 미만)에서는 사이드바가 본문을 덮는 오버레이라 메뉴를 접힌 상태로 시작한다.
|
||||||
|
useEffect(() => {
|
||||||
|
if (!window.matchMedia("(min-width: 64rem)").matches) setMenuOpen(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ const FieldRow = ({ label, editable, children }: { label: string; editable?: boo
|
|||||||
<Label
|
<Label
|
||||||
className={cn(
|
className={cn(
|
||||||
'w-24 shrink-0 rounded-md px-2 py-2.5 text-sm font-bold text-foreground',
|
'w-24 shrink-0 rounded-md px-2 py-2.5 text-sm font-bold text-foreground',
|
||||||
editable && 'bg-blue-100 text-black',
|
editable && 'bg-blue-100',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{label}
|
{label}
|
||||||
@@ -215,44 +215,47 @@ const ListContactInfoPanel = ({
|
|||||||
if (header.listHderTy === ListHeaderConst.TEL_NUM) {
|
if (header.listHderTy === ListHeaderConst.TEL_NUM) {
|
||||||
return (
|
return (
|
||||||
<FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}>
|
<FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}>
|
||||||
<div className="flex gap-2">
|
{/* 모바일(md 미만)은 버튼을 입력란 아래 줄로 내린다. */}
|
||||||
|
<div className="flex flex-col gap-2 md:flex-row">
|
||||||
<Input
|
<Input
|
||||||
value={formatKoreanPhoneNumber(value)}
|
value={formatKoreanPhoneNumber(value)}
|
||||||
readOnly={!editable}
|
readOnly={!editable}
|
||||||
onChange={(e) => onChange(e.target.value.replace(/\D/g, ''))}
|
onChange={(e) => onChange(e.target.value.replace(/\D/g, ''))}
|
||||||
className={readOnlyContrastClass}
|
className={readOnlyContrastClass}
|
||||||
/>
|
/>
|
||||||
<Button
|
<div className="flex shrink-0 flex-wrap gap-2">
|
||||||
type="button"
|
<Button
|
||||||
variant="outline"
|
type="button"
|
||||||
className={cn('shrink-0 gap-2', isOnCall && 'bg-accent text-accent-foreground')}
|
variant="outline"
|
||||||
disabled={isEditing || !isCtiReady || isDialing}
|
className={cn('shrink-0 gap-2', isOnCall && 'bg-accent text-accent-foreground')}
|
||||||
title={getCallButtonTitle(isCtiReady, isDialing)}
|
disabled={isEditing || !isCtiReady || isDialing}
|
||||||
onClick={() => handleCall(value, header.listHderId)}
|
title={getCallButtonTitle(isCtiReady, isDialing)}
|
||||||
>
|
onClick={() => handleCall(value, header.listHderId)}
|
||||||
<Phone className="h-4 w-4" />
|
>
|
||||||
{getCallButtonLabel(isDialing, isOnCall)}
|
<Phone className="h-4 w-4" />
|
||||||
</Button>
|
{getCallButtonLabel(isDialing, isOnCall)}
|
||||||
<Button
|
</Button>
|
||||||
type="button"
|
<Button
|
||||||
variant="outline"
|
type="button"
|
||||||
className="shrink-0 gap-2"
|
variant="outline"
|
||||||
disabled={isEditing}
|
className="shrink-0 gap-2"
|
||||||
onClick={() => handleSend('sms', header.listHderId)}
|
disabled={isEditing}
|
||||||
>
|
onClick={() => handleSend('sms', header.listHderId)}
|
||||||
<MessageSquare className="h-4 w-4" />
|
>
|
||||||
발송
|
<MessageSquare className="h-4 w-4" />
|
||||||
</Button>
|
발송
|
||||||
<Button
|
</Button>
|
||||||
type="button"
|
<Button
|
||||||
variant="outline"
|
type="button"
|
||||||
className="shrink-0 gap-2"
|
variant="outline"
|
||||||
disabled={isEditing}
|
className="shrink-0 gap-2"
|
||||||
onClick={() => handleSend('kko', header.listHderId)}
|
disabled={isEditing}
|
||||||
>
|
onClick={() => handleSend('kko', header.listHderId)}
|
||||||
<MessageCircle className="h-4 w-4" />
|
>
|
||||||
알림톡
|
<MessageCircle className="h-4 w-4" />
|
||||||
</Button>
|
알림톡
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{(isDialing || isOnCall) &&
|
{(isDialing || isOnCall) &&
|
||||||
<p className="text-sm text-red-600 font-medium mt-1">
|
<p className="text-sm text-red-600 font-medium mt-1">
|
||||||
@@ -266,23 +269,25 @@ const ListContactInfoPanel = ({
|
|||||||
if (header.listHderTy === ListHeaderConst.EMAIL) {
|
if (header.listHderTy === ListHeaderConst.EMAIL) {
|
||||||
return (
|
return (
|
||||||
<FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}>
|
<FieldRow key={header.listHderId} label={header.listHderNm} editable={canEditField}>
|
||||||
<div className="flex gap-2">
|
<div className="flex flex-col gap-2 md:flex-row">
|
||||||
<Input
|
<Input
|
||||||
value={value}
|
value={value}
|
||||||
readOnly={!editable}
|
readOnly={!editable}
|
||||||
onChange={(e) => onChange(e.target.value)}
|
onChange={(e) => onChange(e.target.value)}
|
||||||
className={readOnlyContrastClass}
|
className={readOnlyContrastClass}
|
||||||
/>
|
/>
|
||||||
<Button
|
<div className="flex shrink-0 gap-2">
|
||||||
type="button"
|
<Button
|
||||||
variant="outline"
|
type="button"
|
||||||
className="shrink-0 gap-2"
|
variant="outline"
|
||||||
disabled={isEditing}
|
className="shrink-0 gap-2"
|
||||||
onClick={() => handleSend('email', header.listHderId)}
|
disabled={isEditing}
|
||||||
>
|
onClick={() => handleSend('email', header.listHderId)}
|
||||||
<Mail className="h-4 w-4" />
|
>
|
||||||
발송
|
<Mail className="h-4 w-4" />
|
||||||
</Button>
|
발송
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
)
|
)
|
||||||
@@ -367,14 +372,17 @@ const ListContactInfoPanel = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FieldRow key={survey.prjctSurveyIdx ?? survey.surveyOrder} label={survey.surveyName || 'Web'}>
|
<FieldRow key={survey.prjctSurveyIdx ?? survey.surveyOrder} label={survey.surveyName || 'Web'}>
|
||||||
<div className="flex items-center gap-2">
|
{/* 모바일(md 미만)은 응답 상태를 버튼 아래 줄로 내린다. */}
|
||||||
<Button type="button" className="gap-2" disabled={isEditing} onClick={() => handleStartSurvey(survey)}>
|
<div className="flex flex-col items-start gap-2 md:flex-row md:items-center">
|
||||||
조사 시작
|
<div className="flex items-center gap-2">
|
||||||
</Button>
|
<Button type="button" className="gap-2" disabled={isEditing} onClick={() => handleStartSurvey(survey)}>
|
||||||
<Button type="button" variant="outline" className="gap-2" disabled={isEditing} onClick={() => handleShowQr(survey)}>
|
조사 시작
|
||||||
<QrCode className="h-4 w-4" />
|
</Button>
|
||||||
QR
|
<Button type="button" variant="outline" className="gap-2" disabled={isEditing} onClick={() => handleShowQr(survey)}>
|
||||||
</Button>
|
<QrCode className="h-4 w-4" />
|
||||||
|
QR
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
{hasSurveyResponse ? (
|
{hasSurveyResponse ? (
|
||||||
<span className="text-sm">
|
<span className="text-sm">
|
||||||
[{resultCodes.find((rc) => rc.resultCdTy === ResultCodeType.SURVEY && rc.resultCd === result.lastResultCd)
|
[{resultCodes.find((rc) => rc.resultCdTy === ResultCodeType.SURVEY && rc.resultCd === result.lastResultCd)
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState, type ClipboardEvent, type ReactNode } from 'react'
|
import { useCallback, useEffect, useMemo, useRef, useState, type ClipboardEvent, type ReactNode } from 'react'
|
||||||
import type { PaginationState, SortingState } from '@tanstack/react-table'
|
import type { PaginationState, SortingState } from '@tanstack/react-table'
|
||||||
import { Funnel, PencilLine } from 'lucide-react'
|
import { ChevronDown, Funnel, PencilLine } from 'lucide-react'
|
||||||
|
import { Badge } from '@/components/ui/badge'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover'
|
import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/popover'
|
||||||
@@ -13,6 +14,7 @@ import KriDateRangePicker, { type KriDateRange } from '@/components/common/KriDa
|
|||||||
import ListBatchEditDialog, { type BatchEditPayload, type BatchEditResultCodes, type BatchEditRow, type BatchEditSurveyResultCodes } from '@/components/dialog/ListBatchEditDialog'
|
import ListBatchEditDialog, { type BatchEditPayload, type BatchEditResultCodes, type BatchEditRow, type BatchEditSurveyResultCodes } from '@/components/dialog/ListBatchEditDialog'
|
||||||
import ListFilterDialog, { operatorLabel } from '@/components/dialog/ListFilterDialog'
|
import ListFilterDialog, { operatorLabel } from '@/components/dialog/ListFilterDialog'
|
||||||
import { useDialog } from '@/hooks/useDialog'
|
import { useDialog } from '@/hooks/useDialog'
|
||||||
|
import { cn } from '@/lib/utils'
|
||||||
import { useListSearchQuery, useUpdateListMutation } from '@/query/list'
|
import { useListSearchQuery, useUpdateListMutation } from '@/query/list'
|
||||||
import { getListColumns, LIST_IS_USE_LABEL, type ListTableRow } from '@/components/table-column/ListTableColumn'
|
import { getListColumns, LIST_IS_USE_LABEL, type ListTableRow } from '@/components/table-column/ListTableColumn'
|
||||||
import { useAssignTargetRows } from '@/components/assign/AssignTargetList'
|
import { useAssignTargetRows } from '@/components/assign/AssignTargetList'
|
||||||
@@ -72,6 +74,8 @@ export type ListSearchTableProps = {
|
|||||||
initialSearchState?: ListSearchUiState
|
initialSearchState?: ListSearchUiState
|
||||||
onSearchStateChange?: (state: ListSearchUiState) => void
|
onSearchStateChange?: (state: ListSearchUiState) => void
|
||||||
focusRowId?: string
|
focusRowId?: string
|
||||||
|
/** 모바일(md 미만)에서 기본 검색 필터를 1열로 쌓고 접기/펼치기 토글을 노출한다. */
|
||||||
|
collapsibleFiltersOnMobile?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const toSidSet = (value: string) =>
|
const toSidSet = (value: string) =>
|
||||||
@@ -197,8 +201,10 @@ export function ListSearchTable({
|
|||||||
initialSearchState,
|
initialSearchState,
|
||||||
onSearchStateChange,
|
onSearchStateChange,
|
||||||
focusRowId,
|
focusRowId,
|
||||||
|
collapsibleFiltersOnMobile = false,
|
||||||
}: ListSearchTableProps) {
|
}: ListSearchTableProps) {
|
||||||
const { showDialog } = useDialog()
|
const { showDialog } = useDialog()
|
||||||
|
const [filtersOpen, setFiltersOpen] = useState(true)
|
||||||
const [searchText, setSearchText] = useState(initialSearchState?.searchText ?? '')
|
const [searchText, setSearchText] = useState(initialSearchState?.searchText ?? '')
|
||||||
const [showSidHangulHint, setShowSidHangulHint] = useState(false)
|
const [showSidHangulHint, setShowSidHangulHint] = useState(false)
|
||||||
const [searchContactResult, setSearchContactResult] = useState<string[]>(initialSearchState?.searchContactResult ?? [])
|
const [searchContactResult, setSearchContactResult] = useState<string[]>(initialSearchState?.searchContactResult ?? [])
|
||||||
@@ -696,88 +702,132 @@ export function ListSearchTable({
|
|||||||
resetToFirstPage()
|
resetToFirstPage()
|
||||||
}, [externalAssignFilter])
|
}, [externalAssignFilter])
|
||||||
|
|
||||||
|
// md 이상에서는 기존 클래스와 동일하게 렌더링되도록 모바일 전용 값만 분기한다.
|
||||||
|
const filterRowClassName = collapsibleFiltersOnMobile
|
||||||
|
? 'flex flex-col gap-2 md:flex-row md:flex-wrap md:items-center'
|
||||||
|
: 'flex items-center gap-2 flex-wrap'
|
||||||
|
const filterItemClassName = collapsibleFiltersOnMobile
|
||||||
|
? 'w-full md:w-auto md:flex-1 md:min-w-0 md:max-w-xs'
|
||||||
|
: 'flex-1 min-w-0 max-w-xs'
|
||||||
|
const dateFilterClassName = collapsibleFiltersOnMobile
|
||||||
|
? 'w-full md:w-auto md:flex-1 md:min-w-[240px] md:max-w-xs'
|
||||||
|
: 'flex-1 min-w-[240px] max-w-xs'
|
||||||
|
const surveyFilterClassName = collapsibleFiltersOnMobile
|
||||||
|
? 'w-full md:w-auto md:flex-1 md:min-w-[180px] md:max-w-xs'
|
||||||
|
: 'flex-1 min-w-[180px] max-w-xs'
|
||||||
|
|
||||||
|
// 접힌 상태에서도 기본 검색 조건 적용 여부를 알 수 있도록 토글 버튼에 표시한다.
|
||||||
|
const hasActiveFilters =
|
||||||
|
searchText.trim().length > 0 ||
|
||||||
|
searchContactResult.length > 0 ||
|
||||||
|
Boolean(searchContactDateRange.from || searchContactDateRange.to) ||
|
||||||
|
(fieldInterviewEnabled && searchInterviewResult.length > 0) ||
|
||||||
|
Object.values(surveyResultSelections).some((values) => values.length > 0)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center gap-2 flex-wrap">
|
{collapsibleFiltersOnMobile ? (
|
||||||
<div className="flex-1 min-w-0 max-w-xs">
|
<Button
|
||||||
<Popover open={showSidHangulHint}>
|
type="button"
|
||||||
<PopoverAnchor asChild>
|
variant="outline"
|
||||||
<Input
|
className="w-full justify-between md:hidden"
|
||||||
placeholder="SID 검색"
|
aria-expanded={filtersOpen}
|
||||||
className="h-9 bg-white w-full"
|
aria-controls="list-search-filters"
|
||||||
value={searchText}
|
onClick={() => setFiltersOpen((prev) => !prev)}
|
||||||
onChange={(e) => handleSearchTextChange(e.target.value)}
|
>
|
||||||
onPaste={handleSidPaste}
|
<span className="flex items-center gap-2">
|
||||||
/>
|
검색 조건
|
||||||
</PopoverAnchor>
|
{hasActiveFilters ? <Badge>적용 중</Badge> : null}
|
||||||
<PopoverContent
|
</span>
|
||||||
align="start"
|
<ChevronDown className={cn('h-4 w-4 transition-transform', filtersOpen && 'rotate-180')} />
|
||||||
className="w-auto p-2 text-xs text-destructive"
|
</Button>
|
||||||
onOpenAutoFocus={(e) => e.preventDefault()}
|
) : null}
|
||||||
>
|
|
||||||
한글은 입력할 수 없습니다. 한/영 전환 후 영문·숫자로 입력해 주세요.
|
<div
|
||||||
</PopoverContent>
|
id="list-search-filters"
|
||||||
</Popover>
|
className={cn('space-y-2', collapsibleFiltersOnMobile && !filtersOpen && 'hidden md:block')}
|
||||||
</div>
|
>
|
||||||
<div className="flex-1 min-w-0 max-w-xs">
|
<div className={filterRowClassName}>
|
||||||
<KriMultiSelect
|
<div className={filterItemClassName}>
|
||||||
items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.CONTACT)}
|
<Popover open={showSidHangulHint}>
|
||||||
value={searchContactResult}
|
<PopoverAnchor asChild>
|
||||||
onChange={handleContactResultChange}
|
<Input
|
||||||
getValue={(item) => String(item.resultCd)}
|
placeholder="SID 검색"
|
||||||
getLabel={(item) => item.resultCdLbl}
|
className="h-9 bg-white w-full"
|
||||||
placeholder="컨택 결과"
|
value={searchText}
|
||||||
widthClassName="w-full"
|
onChange={(e) => handleSearchTextChange(e.target.value)}
|
||||||
heightClassName="h-9"
|
onPaste={handleSidPaste}
|
||||||
/>
|
/>
|
||||||
</div>
|
</PopoverAnchor>
|
||||||
<KriDateRangePicker
|
<PopoverContent
|
||||||
value={searchContactDateRange}
|
align="start"
|
||||||
onChange={(range) => {
|
className="w-auto p-2 text-xs text-destructive"
|
||||||
setSearchContactDateRange(range)
|
onOpenAutoFocus={(e) => e.preventDefault()}
|
||||||
setPagination((prev) => ({ ...prev, pageIndex: 0 }))
|
>
|
||||||
}}
|
한글은 입력할 수 없습니다. 한/영 전환 후 영문·숫자로 입력해 주세요.
|
||||||
placeholder="컨택 일자"
|
</PopoverContent>
|
||||||
className="flex-1 min-w-[240px] max-w-xs"
|
</Popover>
|
||||||
/>
|
</div>
|
||||||
{fieldInterviewEnabled ? (
|
<div className={filterItemClassName}>
|
||||||
<div className="flex-1 min-w-0 max-w-xs">
|
|
||||||
<KriMultiSelect
|
<KriMultiSelect
|
||||||
items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.INTERVIEW)}
|
items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.CONTACT)}
|
||||||
value={searchInterviewResult}
|
value={searchContactResult}
|
||||||
onChange={handleInterviewResultChange}
|
onChange={handleContactResultChange}
|
||||||
getValue={(item) => String(item.resultCd)}
|
getValue={(item) => String(item.resultCd)}
|
||||||
getLabel={(item) => item.resultCdLbl}
|
getLabel={(item) => item.resultCdLbl}
|
||||||
placeholder="면접 결과"
|
placeholder="컨택 결과"
|
||||||
widthClassName="w-full"
|
widthClassName="w-full"
|
||||||
heightClassName="h-9"
|
heightClassName="h-9"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<KriDateRangePicker
|
||||||
|
value={searchContactDateRange}
|
||||||
|
onChange={(range) => {
|
||||||
|
setSearchContactDateRange(range)
|
||||||
|
setPagination((prev) => ({ ...prev, pageIndex: 0 }))
|
||||||
|
}}
|
||||||
|
placeholder="컨택 일자"
|
||||||
|
className={dateFilterClassName}
|
||||||
|
/>
|
||||||
|
{fieldInterviewEnabled ? (
|
||||||
|
<div className={filterItemClassName}>
|
||||||
|
<KriMultiSelect
|
||||||
|
items={resultCodes.filter((item) => item.resultCdTy === ResultCodeType.INTERVIEW)}
|
||||||
|
value={searchInterviewResult}
|
||||||
|
onChange={handleInterviewResultChange}
|
||||||
|
getValue={(item) => String(item.resultCd)}
|
||||||
|
getLabel={(item) => item.resultCdLbl}
|
||||||
|
placeholder="면접 결과"
|
||||||
|
widthClassName="w-full"
|
||||||
|
heightClassName="h-9"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{surveys.length > 0 ? (
|
||||||
|
<div className={filterRowClassName}>
|
||||||
|
{surveys
|
||||||
|
.filter((survey) => survey.prjctSurveyIdx != null)
|
||||||
|
.map((survey) => (
|
||||||
|
<div key={survey.prjctSurveyIdx} className={surveyFilterClassName}>
|
||||||
|
<KriMultiSelect
|
||||||
|
items={surveyResultCodeOptions}
|
||||||
|
value={surveyResultSelections[survey.prjctSurveyIdx as number] ?? []}
|
||||||
|
onChange={(value) => handleChangeSurveyResult(survey.prjctSurveyIdx as number, value)}
|
||||||
|
getValue={(item) => String(item.resultCd)}
|
||||||
|
getLabel={(item) => item.resultCdLbl}
|
||||||
|
placeholder={`${survey.surveyName} 결과`}
|
||||||
|
widthClassName="w-full"
|
||||||
|
heightClassName="h-9"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{surveys.length > 0 ? (
|
|
||||||
<div className="flex items-center gap-2 flex-wrap">
|
|
||||||
{surveys
|
|
||||||
.filter((survey) => survey.prjctSurveyIdx != null)
|
|
||||||
.map((survey) => (
|
|
||||||
<div key={survey.prjctSurveyIdx} className="flex-1 min-w-[180px] max-w-xs">
|
|
||||||
<KriMultiSelect
|
|
||||||
items={surveyResultCodeOptions}
|
|
||||||
value={surveyResultSelections[survey.prjctSurveyIdx as number] ?? []}
|
|
||||||
onChange={(value) => handleChangeSurveyResult(survey.prjctSurveyIdx as number, value)}
|
|
||||||
getValue={(item) => String(item.resultCd)}
|
|
||||||
getLabel={(item) => item.resultCdLbl}
|
|
||||||
placeholder={`${survey.surveyName} 결과`}
|
|
||||||
widthClassName="w-full"
|
|
||||||
heightClassName="h-9"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
<div className="flex items-center gap-2 flex-wrap justify-between">
|
<div className="flex items-center gap-2 flex-wrap justify-between">
|
||||||
<div className="flex items-center gap-2 flex-wrap">
|
<div className="flex items-center gap-2 flex-wrap">
|
||||||
<Button type="button" variant="outline" className="gap-2" onClick={() => showDialog('listFilterDialog')}>
|
<Button type="button" variant="outline" className="gap-2" onClick={() => showDialog('listFilterDialog')}>
|
||||||
|
|||||||
@@ -43,30 +43,10 @@ export function useCtiConnection() {
|
|||||||
// 뒤로/앞으로 가기로 bfcache에 들어갔다가 돌아오면 React 상태가 그대로 복원되어 위 effect가 다시 실행되지 않는다.
|
// 뒤로/앞으로 가기로 bfcache에 들어갔다가 돌아오면 React 상태가 그대로 복원되어 위 effect가 다시 실행되지 않는다.
|
||||||
// 떠날 때 CTI 서버에 Logout, 돌아올 때 다시 Login 하여 새로고침 없이 전화걸기를 쓸 수 있게 한다.
|
// 떠날 때 CTI 서버에 Logout, 돌아올 때 다시 Login 하여 새로고침 없이 전화걸기를 쓸 수 있게 한다.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// TEMP_CTI_LOG: pagehide 시점 로그가 콘솔에 남지 않아, 떠날 때 정보를 sessionStorage에 남기고 돌아오거나 다시 로드될 때 출력한다.
|
|
||||||
const PAGEHIDE_DEBUG_KEY = "__cti_pagehide_debug"; // TEMP_CTI_LOG
|
|
||||||
const printLastPageHide = (from: string) => {
|
|
||||||
const saved = sessionStorage.getItem(PAGEHIDE_DEBUG_KEY);
|
|
||||||
if (!saved) return;
|
|
||||||
console.log(`[CTI][TEMP_LOG] last pagehide (${from}) ->`, JSON.parse(saved)); // TEMP_CTI_LOG
|
|
||||||
sessionStorage.removeItem(PAGEHIDE_DEBUG_KEY);
|
|
||||||
};
|
|
||||||
printLastPageHide("mount");
|
|
||||||
console.log("[CTI][TEMP_LOG] page lifecycle listeners registered"); // TEMP_CTI_LOG
|
|
||||||
|
|
||||||
const handlePageHide = (event: PageTransitionEvent) => {
|
const handlePageHide = (event: PageTransitionEvent) => {
|
||||||
console.log("[CTI][TEMP_LOG] pagehide, persisted =", event.persisted); // TEMP_CTI_LOG
|
|
||||||
sessionStorage.setItem(PAGEHIDE_DEBUG_KEY, JSON.stringify({
|
|
||||||
persisted: event.persisted,
|
|
||||||
at: new Date().toISOString(),
|
|
||||||
path: window.location.pathname,
|
|
||||||
connectionState: ctiClient.getConnectionState(),
|
|
||||||
})); // TEMP_CTI_LOG
|
|
||||||
if (event.persisted) ctiClient.suspendForPageHide();
|
if (event.persisted) ctiClient.suspendForPageHide();
|
||||||
};
|
};
|
||||||
const handlePageShow = (event: PageTransitionEvent) => {
|
const handlePageShow = (event: PageTransitionEvent) => {
|
||||||
console.log("[CTI][TEMP_LOG] pageshow, persisted =", event.persisted); // TEMP_CTI_LOG
|
|
||||||
printLastPageHide("pageshow");
|
|
||||||
if (event.persisted) ctiClient.resumeFromPageShow();
|
if (event.persisted) ctiClient.resumeFromPageShow();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -769,12 +769,8 @@ const connectAndLogin = (params: CtiLoginParams) => {
|
|||||||
const suspendForPageHide = () => {
|
const suspendForPageHide = () => {
|
||||||
if (!currentLoginParams) return;
|
if (!currentLoginParams) return;
|
||||||
stopReconnectLoop();
|
stopReconnectLoop();
|
||||||
if (currentAgentLoginId && connectionState === "open") {
|
if (currentAgentLoginId && connectionState === "open" && !isCallInProgress()) {
|
||||||
if (isCallInProgress()) {
|
send({ ZCommand: "Logout", AgentLoginID: currentAgentLoginId });
|
||||||
console.log("[CTI][TEMP_LOG] pagehide logout skipped, call is in progress"); // TEMP_CTI_LOG
|
|
||||||
} else {
|
|
||||||
send({ ZCommand: "Logout", AgentLoginID: currentAgentLoginId });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
teardownSocket();
|
teardownSocket();
|
||||||
};
|
};
|
||||||
@@ -784,7 +780,6 @@ const resumeFromPageShow = () => {
|
|||||||
const params = currentLoginParams;
|
const params = currentLoginParams;
|
||||||
if (!params) return;
|
if (!params) return;
|
||||||
if (connectionState === "open" || connectionState === "connecting") return;
|
if (connectionState === "open" || connectionState === "connecting") return;
|
||||||
console.log("[CTI][TEMP_LOG] pageshow resume, reconnecting"); // TEMP_CTI_LOG
|
|
||||||
connectAndLogin(params);
|
connectAndLogin(params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user