260716_02_ENH: 프로젝트에 발신 번호추가 및 리다이렉트 url, api 수정

This commit is contained in:
2026-07-16 14:10:42 +09:00
parent 36c7b41191
commit 7275c77db0
13 changed files with 153 additions and 41 deletions

View File

@@ -11,6 +11,8 @@ import { useUploadListItemFileMutation } from '@/query/list'
import { ListHeaderConst } from '@/const/listConst'
import type { listHeader, ListSearchWithFullResult } from '@/types/list'
import type { MessageSendChannel } from '@/types/message'
import { type ResultCode, ResultCodeType } from '@/types/project'
import { formatKst } from '@kri/common'
import { isListFieldEditableForContact, isListFieldVisibleForContact } from '@/utils/listAccess'
import { substituteSurveyUrl } from '@/lib/surveyUrl'
import SurveyQrDialog from '@/components/dialog/SurveyQrDialog'
@@ -30,6 +32,8 @@ export type ListContactInfoPanelProps = {
listHeaders: listHeader[]
detail?: ListSearchWithFullResult
surveyUrl?: string
callerTelNum?: string
resultCodes: ResultCode[]
formValues: Record<number, string>
onFieldChange: (listHderId: number, value: string) => void
onSaved?: () => void
@@ -69,6 +73,8 @@ const ListContactInfoPanel = ({
listHeaders,
detail,
surveyUrl,
callerTelNum,
resultCodes,
formValues,
onFieldChange,
onSaved,
@@ -88,7 +94,12 @@ const ListContactInfoPanel = ({
.sort((a, b) => a.listHderOrder - b.listHderOrder)
const substitutedSurveyUrl = surveyUrl ? substituteSurveyUrl(surveyUrl, sid) : ''
const hasSurveyResponse = detail?.surveyResult?.lastResultCd !== undefined
const surveyResult = detail?.surveyResult
const hasSurveyResponse = surveyResult?.lastResultCd !== undefined
const surveyResultLabel = hasSurveyResponse
? resultCodes.find((rc) => rc.resultCdTy === ResultCodeType.SURVEY && rc.resultCd === surveyResult?.lastResultCd)
?.resultCdLbl ?? String(surveyResult?.lastResultCd)
: ''
const handleStartSurvey = () => {
if (!substitutedSurveyUrl) return
@@ -102,7 +113,7 @@ const ListContactInfoPanel = ({
const handleCall = (telNum: string, listHderId: number) => {
if (!telNum || !isCtiReady || isOnCall) return
ctiClient.makeCall({ dialNumber: telNum, prjctIdx, sid: Number(sid), listHderId })
ctiClient.makeCall({ dialNumber: telNum, prjctIdx, sid: Number(sid), listHderId, aniNumber: callerTelNum ?? '' })
}
const handlePickFile = (listHderId: number) => {
@@ -265,7 +276,16 @@ const ListContactInfoPanel = ({
<QrCode className="h-4 w-4" />
QR
</Button>
{!hasSurveyResponse && <span className="text-sm text-muted-foreground">[응답없음]</span>}
{hasSurveyResponse ? (
<span className="text-sm">
[{surveyResultLabel}]{' '}
<span className="text-muted-foreground">
({formatKst(surveyResult?.lastResultDt ?? '', 'dateHourMin')})
</span>
</span>
) : (
<span className="text-sm text-muted-foreground">[응답없음]</span>
)}
</div>
</FieldRow>
) : null}

View File

@@ -57,6 +57,21 @@ const getResultColumns = (resultCodeArray: ResultCode[]): DataTableColumn<ListTa
);
};
const formatSurveyResult = (result?: ListResultBase) => {
const lastResultCd = result?.lastResultCd;
if (lastResultCd === undefined) return "";
const label = getResultLabel(ResultCodeType.SURVEY, result);
const dt = `(${formatKst(result?.lastResultDt ?? "", "dateHourMin")})`;
return (
<div className="leading-tight">
<div>{label}</div>
<div>{dt}</div>
</div>
);
};
const columns: DataTableColumn<ListTableRow>[] = [
{
@@ -90,7 +105,8 @@ const getResultColumns = (resultCodeArray: ResultCode[]): DataTableColumn<ListTa
{
id: "surveyStatus",
header: "설문 진행 상태",
accessorFn: (row) => getResultLabel(ResultCodeType.SURVEY, row.surveyResult as ListResultBase | undefined),
cell: ({ row }) =>
formatSurveyResult(row.original.surveyResult as ListResultBase | undefined),
enableSorting: false,
},
];