[st] chore: 알림톡발송 페이지 수정
This commit is contained in:
@@ -77,6 +77,16 @@ interface SelectedRecipient extends SewerStUserItem {
|
|||||||
variableOverrides: Record<string, string>;
|
variableOverrides: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CommonVariableKey =
|
||||||
|
| "userNm"
|
||||||
|
| "sido"
|
||||||
|
| "gugun"
|
||||||
|
| "gubunNm"
|
||||||
|
| "deptNm"
|
||||||
|
| "jbgdNm"
|
||||||
|
| "telNo"
|
||||||
|
| "custom";
|
||||||
|
|
||||||
const EMPTY_ADST_LIST: AdstZoneResponseDto[] = [];
|
const EMPTY_ADST_LIST: AdstZoneResponseDto[] = [];
|
||||||
const GUBUN_OPTIONS = [
|
const GUBUN_OPTIONS = [
|
||||||
{ value: "PIC", label: "입력자" },
|
{ value: "PIC", label: "입력자" },
|
||||||
@@ -139,18 +149,7 @@ function NtitlkSndng() {
|
|||||||
Record<string, string>
|
Record<string, string>
|
||||||
>({});
|
>({});
|
||||||
const [commonVariableMapping, setCommonVariableMapping] = useState<
|
const [commonVariableMapping, setCommonVariableMapping] = useState<
|
||||||
Record<
|
Record<string, CommonVariableKey>
|
||||||
string,
|
|
||||||
| "userNm"
|
|
||||||
| "sido"
|
|
||||||
| "gugun"
|
|
||||||
| "gubunNm"
|
|
||||||
| "deptNm"
|
|
||||||
| "jbgdNm"
|
|
||||||
| "telNo"
|
|
||||||
| "custom"
|
|
||||||
| ""
|
|
||||||
>
|
|
||||||
>({});
|
>({});
|
||||||
|
|
||||||
const [previewRecipient, setPreviewRecipient] =
|
const [previewRecipient, setPreviewRecipient] =
|
||||||
@@ -286,7 +285,7 @@ function NtitlkSndng() {
|
|||||||
rowSelection: userListRowSelection,
|
rowSelection: userListRowSelection,
|
||||||
},
|
},
|
||||||
onRowSelectionChange: setUserListRowSelection,
|
onRowSelectionChange: setUserListRowSelection,
|
||||||
getRowId: (row) => `${row.userNm}-${row.telNo}`,
|
getRowId: (row, i) => `${i}-${row.telNo}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectedTemplate = useMemo(
|
const selectedTemplate = useMemo(
|
||||||
@@ -527,7 +526,7 @@ function NtitlkSndng() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-3">
|
<div className="space-y-4">
|
||||||
<p className="text-lg font-medium">미리보기</p>
|
<p className="text-lg font-medium">미리보기</p>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<div className="h-[32rem] overflow-auto rounded-[20px] rounded-b-none bg-[rgb(176,192,207)] p-8 pb-0 before:absolute before:left-0 before:top-0 before:block before:h-full before:w-full before:rounded-[20px] before:rounded-b-none before:border-[10px] before:border-b-0 before:border-black before:content-['']">
|
<div className="h-[32rem] overflow-auto rounded-[20px] rounded-b-none bg-[rgb(176,192,207)] p-8 pb-0 before:absolute before:left-0 before:top-0 before:block before:h-full before:w-full before:rounded-[20px] before:rounded-b-none before:border-[10px] before:border-b-0 before:border-black before:content-['']">
|
||||||
@@ -640,7 +639,7 @@ function NtitlkSndng() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="h-[32rem] overflow-x-auto rounded-md border">
|
<div className="h-[28rem] overflow-x-auto rounded-md border">
|
||||||
{isUserListLoading ? (
|
{isUserListLoading ? (
|
||||||
<div className="flex items-center justify-center p-6">
|
<div className="flex items-center justify-center p-6">
|
||||||
<div className="relative flex size-[6rem] justify-center">
|
<div className="relative flex size-[6rem] justify-center">
|
||||||
@@ -659,7 +658,7 @@ function NtitlkSndng() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{!isUserListLoading && userList.length > 0 && (
|
{!isUserListLoading && userList.length > 0 && (
|
||||||
<div className="mt-3 flex items-center justify-end gap-4">
|
<div className="mt-4 flex items-center justify-end gap-4">
|
||||||
<p className="text-xl text-muted-foreground">
|
<p className="text-xl text-muted-foreground">
|
||||||
선택{" "}
|
선택{" "}
|
||||||
<span className="font-semibold text-foreground">
|
<span className="font-semibold text-foreground">
|
||||||
@@ -692,6 +691,14 @@ function NtitlkSndng() {
|
|||||||
<span className="text-xl font-semibold text-foreground">
|
<span className="text-xl font-semibold text-foreground">
|
||||||
{selectedRecipients.length}명
|
{selectedRecipients.length}명
|
||||||
</span>
|
</span>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
color="white"
|
||||||
|
onClick={() => setSelectedRecipients([])}
|
||||||
|
disabled={selectedRecipients.length === 0}
|
||||||
|
>
|
||||||
|
초기화
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
color="green"
|
color="green"
|
||||||
@@ -741,16 +748,8 @@ function NtitlkSndng() {
|
|||||||
setCommonVariableMapping(
|
setCommonVariableMapping(
|
||||||
(prev) => ({
|
(prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
[variableName]: value as
|
[variableName]:
|
||||||
| "userNm"
|
value as CommonVariableKey,
|
||||||
| "sido"
|
|
||||||
| "gugun"
|
|
||||||
| "gubunNm"
|
|
||||||
| "deptNm"
|
|
||||||
| "jbgdNm"
|
|
||||||
| "telNo"
|
|
||||||
| "custom"
|
|
||||||
| "",
|
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -850,8 +849,10 @@ function NtitlkSndng() {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{selectedRecipients.map((recipient) => (
|
{selectedRecipients.map((recipient, i) => (
|
||||||
<TableRow key={recipient.telNo}>
|
<TableRow
|
||||||
|
key={`${i}-${recipient.telNo}`}
|
||||||
|
>
|
||||||
<TableCell align="center">
|
<TableCell align="center">
|
||||||
{recipient.userNm}
|
{recipient.userNm}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
Reference in New Issue
Block a user