260702_01_ENH: 리스트 작업 도중 공용 ui를 적용하기 위한 중간 커밋
This commit is contained in:
@@ -8,24 +8,22 @@ import { ChevronLeft, ChevronRight } from 'lucide-react'
|
||||
import { KriSingleSelect } from '@/components/common/KriAutoComplete'
|
||||
import { ProjectInfo } from "@/types/project";
|
||||
import { PROJECT_SEARCH_COUNT } from "@/const/projectConst";
|
||||
import { useDebouncedValue } from "@/hooks/useDebouncedValue";
|
||||
import { useMounted } from "@/hooks/useMounted";
|
||||
import { useDebouncedValue, useMounted } from "@kri/common/hooks";
|
||||
import { UserInfo } from "@/types/user";
|
||||
import { useSelectedProject } from "@/hooks/useSelectedProject";
|
||||
import { KriSelect, KriSelectItem } from "@/components/common/KriSelect";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
import { CONTACT_USER_ROLE, FW_USER_ROLE } from "@/const/userConst";
|
||||
import {CONTACT_USER_ROLE, DEFAULT_COMPANY_NAME, FW_USER_ROLE} from "@/const/userConst";
|
||||
|
||||
import {
|
||||
useFieldworkUsersQuery,
|
||||
useFieldworkUsersQuery, useOutsourceUsersQuery,
|
||||
useRoleListQuery,
|
||||
useUserCompaniesQuery,
|
||||
} from "@/query/user";
|
||||
|
||||
import {
|
||||
useAssignedFieldworkIdsQuery,
|
||||
useSaveAssignedFieldworkMutation,
|
||||
useProjectTopQuery,
|
||||
useProjectTopQuery, useAssignedOutsourceIdsQuery,
|
||||
} from "@/query/project";
|
||||
|
||||
const ProjectAssignPage = () => {
|
||||
@@ -36,18 +34,27 @@ const ProjectAssignPage = () => {
|
||||
const prjctIdx = selectedProject?.prjctIdx ?? 0;
|
||||
const enabled = mounted && prjctIdx > 0;
|
||||
|
||||
const companyQuery = useOutsourceUsersQuery(enabled);
|
||||
const fwUsersQuery = useFieldworkUsersQuery(enabled);
|
||||
const assignedCompanyQuery = useAssignedOutsourceIdsQuery(prjctIdx, enabled);
|
||||
const assignedIdsQuery = useAssignedFieldworkIdsQuery(prjctIdx, enabled);
|
||||
const saveAssignMutation = useSaveAssignedFieldworkMutation(prjctIdx);
|
||||
|
||||
const companyQuery = useUserCompaniesQuery();
|
||||
const roleQuery = useRoleListQuery();
|
||||
|
||||
const [searchKeyword, setSearchKeyword] = useState("");
|
||||
const debouncedKeyword = useDebouncedValue(searchKeyword, 500);
|
||||
const projectTopQuery = useProjectTopQuery(PROJECT_SEARCH_COUNT, debouncedKeyword, mounted);
|
||||
const projectArray = projectTopQuery.data ?? [];
|
||||
const companyArray = companyQuery.data ?? [];
|
||||
const companyArray = useMemo(() => {
|
||||
const companies = companyQuery.data ?? [];
|
||||
const assigned = assignedCompanyQuery.data ?? [];
|
||||
const assignedCompanies = companies
|
||||
.filter(c => !assigned.includes(c.userCmpn))
|
||||
.map(c => c.userCmpn);
|
||||
|
||||
return [DEFAULT_COMPANY_NAME, ...assignedCompanies];
|
||||
}, [companyQuery.data, assignedCompanyQuery.data]);
|
||||
|
||||
const roleArray: KriSelectItem[] = useMemo(() => {
|
||||
const roles = roleQuery.data ?? [];
|
||||
@@ -252,12 +259,12 @@ const ProjectAssignPage = () => {
|
||||
if (!mounted || !selectedProject) return null;
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gray-50 p-1">
|
||||
<div className="bg-gray-50 p-1">
|
||||
<div className="max-w-7xl mx-auto">
|
||||
<div className="mb-6 rounded-lg border border-gray-200 bg-white p-4 shadow-sm">
|
||||
<div className="mb-6 rounded-lg border border-gray-200 bg-white p-2 shadow-sm">
|
||||
<div className="flex flex-col gap-3 sm:flex-row sm:items-end">
|
||||
<div className="w-full sm:w-auto flex items-center gap-3">
|
||||
<div className="w-14 content-text-lg font-medium text-gray-700 whitespace-nowrap text-right">회사</div>
|
||||
<div className="w-14 text-lg font-medium text-gray-700 whitespace-nowrap text-right">회사</div>
|
||||
<KriSelect
|
||||
items={companyArray}
|
||||
value={companyFilter}
|
||||
@@ -269,7 +276,7 @@ const ProjectAssignPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="w-full sm:w-auto flex items-center gap-3">
|
||||
<div className="w-14 content-text-lg font-medium text-gray-700 whitespace-nowrap text-right">대상</div>
|
||||
<div className="w-14 text-lg font-medium text-gray-700 whitespace-nowrap text-right">대상</div>
|
||||
<KriSelect
|
||||
items={roleArray}
|
||||
value={roleFilter?.value || ""}
|
||||
@@ -286,11 +293,11 @@ const ProjectAssignPage = () => {
|
||||
|
||||
<div className="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] gap-6 mb-6">
|
||||
<div className="min-w-0">
|
||||
<div className="p-3 bg-black text-white rounded-lg content-text-lg mb-2 h-15 flex items-center">
|
||||
<div className="p-2 bg-black text-white rounded-lg text-lg mb-2 h-13 flex items-center">
|
||||
<span className="truncate w-full">{assignInfoString}</span>
|
||||
</div>
|
||||
<div className="border border-gray-200 rounded-lg overflow-hidden bg-white shadow-sm">
|
||||
<div className="bg-gray-50 p-3 border-b border-gray-200">
|
||||
<div className="bg-gray-50 p-2 border-b border-gray-200">
|
||||
<Input
|
||||
placeholder="면접원 ID Or 면접원 이름"
|
||||
value={searchAssign}
|
||||
@@ -299,18 +306,18 @@ const ProjectAssignPage = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="h-[600px] overflow-y-auto">
|
||||
<div className="h-[550px] overflow-y-auto">
|
||||
<table className="w-full">
|
||||
<thead className="bg-black text-white sticky top-0">
|
||||
<tr>
|
||||
<th className="p-3 text-left w-12">
|
||||
<th className="p-2 text-left w-12">
|
||||
<Checkbox
|
||||
checked={selectedAssignUser.length === assignView.length && assignView.length > 0}
|
||||
onCheckedChange={handleSelectAllLeft}
|
||||
className="border-white"
|
||||
/>
|
||||
</th>
|
||||
<th className="p-3 text-left content-text-base font-medium">
|
||||
<th className="p-2 text-left text-base font-medium">
|
||||
배정된 {roleFilter?.label} ( {assignBase.length}명 )
|
||||
</th>
|
||||
</tr>
|
||||
@@ -324,14 +331,14 @@ const ProjectAssignPage = () => {
|
||||
}`}
|
||||
onClick={() => handleToggleUnassign(userInfo.userId)}
|
||||
>
|
||||
<td className="p-3">
|
||||
<td className="p-2">
|
||||
<Checkbox
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
checked={selectedAssignUser.includes(userInfo.userId)}
|
||||
onCheckedChange={() => handleToggleUnassign(userInfo.userId)}
|
||||
/>
|
||||
</td>
|
||||
<td className="p-3 content-text-base">
|
||||
<td className="p-2 text-base">
|
||||
{userInfo.userName} ({userInfo.userId})
|
||||
</td>
|
||||
</tr>
|
||||
@@ -346,7 +353,7 @@ const ProjectAssignPage = () => {
|
||||
<Button
|
||||
onClick={handleAssign}
|
||||
disabled={selectedAbleUser.length === 0}
|
||||
className="bg-black hover:bg-gray-800 w-36 h-12 flex items-center justify-center content-text-base disabled:bg-gray-300"
|
||||
className="bg-black hover:bg-gray-800 w-36 h-12 flex items-center justify-center text-base disabled:bg-gray-300"
|
||||
>
|
||||
<ChevronLeft className="w-5 h-5" />
|
||||
<span className="ml-2">배정 {selectedAbleUser.length}명</span>
|
||||
@@ -354,7 +361,7 @@ const ProjectAssignPage = () => {
|
||||
<Button
|
||||
onClick={handleRemove}
|
||||
disabled={selectedAssignUser.length === 0}
|
||||
className="bg-red-600 hover:bg-red-700 w-36 h-12 flex items-center justify-center content-text-base disabled:bg-gray-300"
|
||||
className="bg-red-600 hover:bg-red-700 w-36 h-12 flex items-center justify-center text-base disabled:bg-gray-300"
|
||||
>
|
||||
<ChevronRight className="w-5 h-5" />
|
||||
<span className="ml-2">제외 {selectedAssignUser.length}명</span>
|
||||
@@ -362,7 +369,7 @@ const ProjectAssignPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="min-w-0">
|
||||
<div className="p-3 bg-black text-white rounded-lg content-text-lg mb-2 h-15">
|
||||
<div className="p-2 bg-black text-white rounded-lg text-lg mb-2 h-13">
|
||||
<KriSingleSelect<ProjectInfo>
|
||||
items={projectArray}
|
||||
value={String(sourceProject?.prjctIdx ?? "")}
|
||||
@@ -383,7 +390,7 @@ const ProjectAssignPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="border border-gray-200 rounded-lg overflow-hidden bg-white shadow-sm">
|
||||
<div className="bg-gray-50 p-3 border-b border-gray-200">
|
||||
<div className="bg-gray-50 p-2 border-b border-gray-200">
|
||||
<Input
|
||||
placeholder="면접원 ID Or 면접원 이름"
|
||||
value={searchAble}
|
||||
@@ -392,18 +399,18 @@ const ProjectAssignPage = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="h-[600px] overflow-y-auto">
|
||||
<div className="h-[550px] overflow-y-auto">
|
||||
<table className="w-full">
|
||||
<thead className="bg-black text-white sticky top-0">
|
||||
<tr>
|
||||
<th className="p-3 text-left w-12">
|
||||
<th className="p-2 text-left w-12">
|
||||
<Checkbox
|
||||
checked={selectedAbleUser.length === ableView.length && ableView.length > 0}
|
||||
onCheckedChange={handleSelectAllRight}
|
||||
className="border-white"
|
||||
/>
|
||||
</th>
|
||||
<th className="p-3 text-left content-text-base font-medium">
|
||||
<th className="p-2 text-left text-base font-medium">
|
||||
배정 가능 {roleFilter?.label} ({ableBase.length}명 )
|
||||
</th>
|
||||
</tr>
|
||||
@@ -417,14 +424,14 @@ const ProjectAssignPage = () => {
|
||||
}`}
|
||||
onClick={() => handleToggleAssign(user.userId)}
|
||||
>
|
||||
<td className="p-3">
|
||||
<td className="p-2">
|
||||
<Checkbox
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
checked={selectedAbleUser.includes(user.userId)}
|
||||
onCheckedChange={() => handleToggleAssign(user.userId)}
|
||||
/>
|
||||
</td>
|
||||
<td className="p-3 content-text-base">
|
||||
<td className="p-2 text-base">
|
||||
{user.userName} ({user.userId})
|
||||
</td>
|
||||
</tr>
|
||||
@@ -439,7 +446,7 @@ const ProjectAssignPage = () => {
|
||||
<div className="flex justify-center">
|
||||
<Button
|
||||
onClick={handleSave}
|
||||
className="bg-black hover:bg-gray-800 px-12 h-11 content-text-base font-medium"
|
||||
className="bg-black hover:bg-gray-800 px-12 h-9 text-base font-medium"
|
||||
>
|
||||
저장
|
||||
</Button>
|
||||
@@ -449,4 +456,4 @@ const ProjectAssignPage = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default ProjectAssignPage;
|
||||
export default ProjectAssignPage;
|
||||
|
||||
@@ -5,10 +5,10 @@ import {CookieKeys} from "@/store/cookie/cookie-keys";
|
||||
import {FONT_SIZE} from "@/const/commonConst";
|
||||
|
||||
function parseFontSize(raw: string | undefined | null) {
|
||||
if (!raw) return FONT_SIZE.MIN;
|
||||
if (!raw) return FONT_SIZE.DEFAULT;
|
||||
|
||||
const parsed = parseInt(raw, 10);
|
||||
if (Number.isNaN(parsed)) return FONT_SIZE.MIN;
|
||||
if (Number.isNaN(parsed)) return FONT_SIZE.DEFAULT;
|
||||
|
||||
return Math.min(
|
||||
FONT_SIZE.MAX,
|
||||
@@ -23,7 +23,7 @@ export default async function MainLayoutWrapper({
|
||||
}) {
|
||||
const cookieStore = await cookies();
|
||||
const fontSize = cookieStore.get(CookieKeys.FontSize);
|
||||
const accessToken = cookieStore.get("access_token")?.value;
|
||||
const accessToken = cookieStore.get(CookieKeys.AuthToken)?.value;
|
||||
const initialFontSize = parseFontSize(fontSize?.value);
|
||||
|
||||
if (!accessToken) {
|
||||
@@ -35,4 +35,4 @@ export default async function MainLayoutWrapper({
|
||||
{children}
|
||||
</MainLayout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'use client'
|
||||
'use client'
|
||||
|
||||
import { useMemo, useState } from 'react'
|
||||
import { PaginationState, SortingState } from '@tanstack/react-table'
|
||||
@@ -18,34 +18,57 @@ import { DataTable } from '@/components/data-table/DataTable'
|
||||
import type { DataTableColumn } from '@/components/data-table/DataTable.type'
|
||||
import { KriMultiSelect } from '@/components/common/KriAutoComplete'
|
||||
import { LoadingOverlay } from '@/components/common/LoadingOverlay'
|
||||
import { useMounted } from '@/hooks/useMounted'
|
||||
import { useMounted } from "@kri/common/hooks";
|
||||
import { useAuth } from '@/hooks/useAuth'
|
||||
import { useDialog } from '@/hooks/useDialog'
|
||||
import { useSelectedProject } from '@/hooks/useSelectedProject'
|
||||
import { useListHeaderQuery, useListSearchQuery } from '@/query/list'
|
||||
import {
|
||||
useDownloadListEventHistoryMutation,
|
||||
useDownloadListExcelTemplateMutation,
|
||||
useDownloadListItemFileMutation,
|
||||
useDownloadListMutation,
|
||||
useDownloadListUpdateHistoryMutation,
|
||||
useDownloadUploadHistoryFileMutation,
|
||||
useListHeaderQuery,
|
||||
useListSearchQuery,
|
||||
useListUploadHistoryQuery,
|
||||
useResetListMutation,
|
||||
useUpdateListHeaderMutation,
|
||||
useUpdateListMutation,
|
||||
useUploadListExcelMutation,
|
||||
} from '@/query/list'
|
||||
import { useResultCodesQuery } from '@/query/project'
|
||||
import { getListColumns, ListTableRow } from '@/components/table-column/ListTableColumn'
|
||||
import { ListSearchRequest } from '@/types/list'
|
||||
import {
|
||||
createEmptyListFilter,
|
||||
FilterRow,
|
||||
ListEventHistoryBase,
|
||||
ListDownloadMode,
|
||||
ListDownloadPayload,
|
||||
listHeader,
|
||||
ListFilterMatchType,
|
||||
ListFilterOperator,
|
||||
ListFilterTarget,
|
||||
ListOtherItemFilterCondition,
|
||||
ListResetMode,
|
||||
ListResetScope,
|
||||
ListSearchRequest,
|
||||
ListUploadRequest,
|
||||
} from '@/types/list'
|
||||
import { ResultCode, ResultCodeType } from '@/types/project'
|
||||
import { ListHeaderAssignConst } from '@/const/listConst'
|
||||
import ListResetDialog, { ListResetScope, ListResetTarget } from '@/components/dialog/ListResetDialog'
|
||||
import ListUploadDialog, { ListUploadHistory, ValidationOption } from '@/components/dialog/ListUploadDialog'
|
||||
import ListHeaderManageDialog, { ListHeaderManageRow } from '@/components/dialog/ListHeaderManageDialog'
|
||||
import ListResetDialog from '@/components/dialog/ListResetDialog'
|
||||
import ListUploadDialog from '@/components/dialog/ListUploadDialog'
|
||||
import ListHeaderManageDialog from '@/components/dialog/ListHeaderManageDialog'
|
||||
import ListBatchEditDialog, { BatchEditRow } from '@/components/dialog/ListBatchEditDialog'
|
||||
import ListFilterDialog, { FilterRow } from '@/components/dialog/ListFilterDialog'
|
||||
import ListDownloadDialog, { ListDownloadMode } from '@/components/dialog/ListDownloadDialog'
|
||||
import ListFilterDialog from '@/components/dialog/ListFilterDialog'
|
||||
import ListDownloadDialog from '@/components/dialog/ListDownloadDialog'
|
||||
import MessageSendDialog, {
|
||||
MessageSendMode,
|
||||
MessageSendPayload,
|
||||
MessageTemplateOption,
|
||||
} from '@/components/dialog/MessageSendDialog'
|
||||
import MessageHistoryDialog, { MessageHistoryRow } from '@/components/dialog/MessageHistoryDialog'
|
||||
|
||||
const uploadHistoryMock: ListUploadHistory[] = [
|
||||
{ round: 1, fileName: 'a.xlsx', userId: 'admin', uploadCount: 3500, uploadAt: '2025-10-30T11:00:00Z' },
|
||||
{ round: 2, fileName: '1.xlsx', userId: 'admin', uploadCount: 100, uploadAt: '2025-10-30T12:00:00Z' },
|
||||
{ round: 3, fileName: '2.xlsx', userId: 'admin', uploadCount: 2000, uploadAt: '2025-10-30T13:00:00Z' },
|
||||
]
|
||||
import { downloadBase64File, downloadFile, XLSX_MIME_TYPE } from '@kri/common/browser'
|
||||
|
||||
const messageTemplateMock: MessageTemplateOption[] = [
|
||||
{
|
||||
@@ -84,7 +107,7 @@ const messageHistoryMock: MessageHistoryRow[] = [
|
||||
{
|
||||
id: 2,
|
||||
type: 'email',
|
||||
title: 'Please answer this survey',
|
||||
title: 'Survey Answer Request',
|
||||
templateName: 'EMAIL Template A',
|
||||
sendInfo: 'info@kric.com',
|
||||
targetHeader: 'Email',
|
||||
@@ -101,6 +124,39 @@ const messageHistoryMock: MessageHistoryRow[] = [
|
||||
},
|
||||
]
|
||||
|
||||
const toSidSet = (value: string) =>
|
||||
value
|
||||
.split(',')
|
||||
.map((item) => item.trim())
|
||||
.filter((item) => item.length > 0)
|
||||
|
||||
const toFilterCondition = (row: FilterRow, usesListValue: boolean): Omit<ListOtherItemFilterCondition, 'listHderId'> => {
|
||||
const values = usesListValue ? row.multiValues : [row.textValue.trim()]
|
||||
|
||||
if (row.operator === 'eq') {
|
||||
return { operator: ListFilterOperator.POSITIVE, matchType: ListFilterMatchType.EXACT, values }
|
||||
}
|
||||
if (row.operator === 'neq') {
|
||||
return { operator: ListFilterOperator.NEGATIVE, matchType: ListFilterMatchType.EXACT, values }
|
||||
}
|
||||
if (row.operator === 'contains') {
|
||||
return { operator: ListFilterOperator.POSITIVE, matchType: ListFilterMatchType.CONTAINS, values }
|
||||
}
|
||||
return { operator: ListFilterOperator.NEGATIVE, matchType: ListFilterMatchType.CONTAINS, values }
|
||||
}
|
||||
|
||||
const toDateTimeRange = (from?: string, to?: string) => {
|
||||
if (!from || !to) return undefined
|
||||
return {
|
||||
startDate: `${from}T00:00:00`,
|
||||
endDate: `${to}T23:59:59`,
|
||||
}
|
||||
}
|
||||
|
||||
const downloadArrayBuffer = (buffer: ArrayBuffer, filename: string, type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') => {
|
||||
downloadFile(new Blob([buffer], { type }), filename)
|
||||
}
|
||||
|
||||
const ListManagePage = () => {
|
||||
const mounted = useMounted()
|
||||
const { auth } = useAuth()
|
||||
@@ -118,30 +174,49 @@ const ListManagePage = () => {
|
||||
const [messageSendMode, setMessageSendMode] = useState<MessageSendMode>('email')
|
||||
const [filterRows, setFilterRows] = useState<FilterRow[]>([])
|
||||
const [batchRows, setBatchRows] = useState<BatchEditRow[]>([])
|
||||
const [selectedRows, setSelectedRows] = useState<ListTableRow[]>([])
|
||||
|
||||
const userRole = auth?.user?.userRole ?? 9000
|
||||
const prjctName = selectedProject?.prjctName ?? '';
|
||||
const prjctIdx = selectedProject?.prjctIdx ?? 0
|
||||
const enabled = mounted && prjctIdx > 0
|
||||
|
||||
const resultCodesQuery = useResultCodesQuery(prjctIdx, enabled)
|
||||
const listHeaderQuery = useListHeaderQuery(prjctIdx, enabled)
|
||||
const uploadHistoryQuery = useListUploadHistoryQuery(prjctIdx, enabled)
|
||||
const downloadListExcelTemplateMutation = useDownloadListExcelTemplateMutation()
|
||||
const uploadListExcelMutation = useUploadListExcelMutation(prjctIdx)
|
||||
const updateListHeaderMutation = useUpdateListHeaderMutation(prjctIdx)
|
||||
const resetListMutation = useResetListMutation(prjctIdx)
|
||||
const updateListMutation = useUpdateListMutation(prjctIdx)
|
||||
const downloadListMutation = useDownloadListMutation(prjctIdx)
|
||||
const downloadListUpdateHistoryMutation = useDownloadListUpdateHistoryMutation(prjctIdx)
|
||||
const downloadListEventHistoryMutation = useDownloadListEventHistoryMutation(prjctIdx)
|
||||
const downloadListItemFileMutation = useDownloadListItemFileMutation(prjctIdx)
|
||||
const downloadUploadHistoryFileMutation = useDownloadUploadHistoryFileMutation(prjctIdx)
|
||||
|
||||
const resultCodeArray = useMemo<ResultCode[]>(() => resultCodesQuery.data ?? [], [resultCodesQuery.data])
|
||||
|
||||
const listSearchRequest = useMemo<ListSearchRequest>(() => {
|
||||
const sort = sorting?.[0] ?? { id: 'sid', desc: true as const }
|
||||
const sort = sorting?.[0] ?? { id: 'sid', desc: false as const }
|
||||
const listFilter = createEmptyListFilter()
|
||||
listFilter.sidSet = toSidSet(searchText)
|
||||
listFilter.memoConditions = []
|
||||
listFilter.otherItemConditions = filterRows
|
||||
.map((row) => {
|
||||
const usesListValue = (listHeaderQuery.data ?? []).some(
|
||||
(header) => header.listHderId === row.headerId && (header.filterContents?.length ?? 0) > 0,
|
||||
)
|
||||
|
||||
return {
|
||||
listHderId: row.headerId,
|
||||
...toFilterCondition(row, usesListValue),
|
||||
}
|
||||
})
|
||||
.filter((item) => item.values.some((value) => value.trim().length > 0))
|
||||
|
||||
return {
|
||||
listFilter: {
|
||||
sidSet: [],
|
||||
listUseSet: [],
|
||||
assignUserMap: {
|
||||
[ListHeaderAssignConst.OUTSOURCE]: [],
|
||||
[ListHeaderAssignConst.CONTACT_INTERVIEWER]: [],
|
||||
[ListHeaderAssignConst.FIELD_INTERVIEWER]: [],
|
||||
},
|
||||
memo: '',
|
||||
otherItems: {},
|
||||
},
|
||||
listFilter,
|
||||
pageRequest: {
|
||||
pageIndex: pagination.pageIndex,
|
||||
pageSize: pagination.pageSize,
|
||||
@@ -149,7 +224,7 @@ const ListManagePage = () => {
|
||||
sortDir: sort.desc ? 'desc' : 'asc',
|
||||
},
|
||||
}
|
||||
}, [pagination, sorting])
|
||||
}, [filterRows, listHeaderQuery.data, pagination.pageIndex, pagination.pageSize, searchText, sorting])
|
||||
|
||||
const listSearchQuery = useListSearchQuery(prjctIdx, listSearchRequest, enabled)
|
||||
|
||||
@@ -163,6 +238,26 @@ const ListManagePage = () => {
|
||||
[listSearchQuery.data],
|
||||
)
|
||||
|
||||
const selectedSidSet = useMemo(
|
||||
() =>
|
||||
selectedRows
|
||||
.map((row) => row.sid)
|
||||
.filter((sid): sid is string | number => typeof sid === 'string' || typeof sid === 'number')
|
||||
.map(String),
|
||||
[selectedRows],
|
||||
)
|
||||
|
||||
const buildTargetFilter = (target: ListFilterTarget) => {
|
||||
if (target === 'all') return createEmptyListFilter()
|
||||
if (target === 'selected') {
|
||||
return {
|
||||
...createEmptyListFilter(),
|
||||
sidSet: selectedSidSet,
|
||||
}
|
||||
}
|
||||
return listSearchRequest.listFilter
|
||||
}
|
||||
|
||||
const totalCount = listSearchQuery.data?.totalElements ?? 0
|
||||
const pageCount = listSearchQuery.data?.totalPages ?? 0
|
||||
|
||||
@@ -175,20 +270,18 @@ const ListManagePage = () => {
|
||||
[listHeaderQuery.data],
|
||||
)
|
||||
|
||||
const headerManageRows = useMemo<ListHeaderManageRow[]>(
|
||||
() =>
|
||||
(listHeaderQuery.data ?? []).map((header) => ({
|
||||
id: header.listHderId,
|
||||
name: header.listHderNm,
|
||||
visible: header.useColView,
|
||||
locked: header.listHderGrad === 0,
|
||||
})),
|
||||
[listHeaderQuery.data],
|
||||
)
|
||||
const headerManageRows = useMemo<listHeader[]>(() => listHeaderQuery.data ?? [], [listHeaderQuery.data])
|
||||
|
||||
const filterHeaderOptions = useMemo(
|
||||
() => headerOptions.map((item) => ({ ...item, values: ['A', 'B', 'C'] })),
|
||||
[headerOptions],
|
||||
() =>
|
||||
(listHeaderQuery.data ?? [])
|
||||
.filter((header) => header.useFilter)
|
||||
.map((header) => ({
|
||||
id: header.listHderId,
|
||||
label: header.listHderNm,
|
||||
values: header.filterContents ?? [],
|
||||
})),
|
||||
[listHeaderQuery.data],
|
||||
)
|
||||
|
||||
const messageTargetHeaders = useMemo(() => {
|
||||
@@ -210,39 +303,85 @@ const ListManagePage = () => {
|
||||
showDialog('messageSendDialog')
|
||||
}
|
||||
|
||||
const handleResetConfirm = async (payload: { target: ListResetTarget; scope: ListResetScope }) => {
|
||||
void payload
|
||||
alert('List reset action callback placeholder.')
|
||||
const handleResetConfirm = async (payload: { target: ListFilterTarget; scope: ListResetScope }) => {
|
||||
const listFilter = buildTargetFilter(payload.target)
|
||||
await resetListMutation.mutateAsync({
|
||||
resetMode: payload.scope === 'result-and-history' ? ListResetMode.HIST : ListResetMode.ALL,
|
||||
listFilter,
|
||||
})
|
||||
await listSearchQuery.refetch()
|
||||
}
|
||||
|
||||
const handleUploadConfirm = async (file: File, validation: ValidationOption) => {
|
||||
void file
|
||||
void validation
|
||||
alert('List upload action callback placeholder.')
|
||||
const handleUploadConfirm = async (file: File, request: ListUploadRequest) => {
|
||||
const res = await uploadListExcelMutation.mutateAsync({ file, request })
|
||||
|
||||
if (res.hasErrorFile && res.errorFileBase64) {
|
||||
alert("업로드 중 오류가 발생하여 오류 파일을 다운로드합니다.");
|
||||
downloadBase64File(res.errorFileBase64, res.errorFileName ?? "error.xlsx", XLSX_MIME_TYPE);
|
||||
}
|
||||
else{
|
||||
alert(`${res.successCount}개의 리스트를 업로드했습니다.`);
|
||||
}
|
||||
|
||||
await listSearchQuery.refetch()
|
||||
}
|
||||
|
||||
const handleDownloadTemplate = async () => {
|
||||
alert('Template download callback placeholder.')
|
||||
if (!prjctIdx) {
|
||||
alert("프로젝트를 선택해주세요.")
|
||||
return
|
||||
}
|
||||
|
||||
const buffer = await downloadListExcelTemplateMutation.mutateAsync(prjctIdx)
|
||||
downloadArrayBuffer(buffer, `${prjctName} list-upload-template.xlsx`)
|
||||
}
|
||||
|
||||
const handleHeaderManageConfirm = async (rows: ListHeaderManageRow[]) => {
|
||||
void rows
|
||||
alert('Header manage action callback placeholder.')
|
||||
const handleHeaderManageConfirm = async (rows: listHeader[]) => {
|
||||
await updateListHeaderMutation.mutateAsync(rows)
|
||||
}
|
||||
|
||||
const handleFilterConfirm = async (rows: FilterRow[]) => {
|
||||
setFilterRows(rows)
|
||||
alert('Filter action callback placeholder.')
|
||||
}
|
||||
|
||||
const handleBatchConfirm = async (rows: BatchEditRow[]) => {
|
||||
setBatchRows(rows)
|
||||
alert('Batch edit action callback placeholder.')
|
||||
const updateContents = Object.fromEntries(rows.map((row) => [String(row.headerId), row.value]))
|
||||
await updateListMutation.mutateAsync({
|
||||
updateContents,
|
||||
listFilter: buildTargetFilter('filtered'),
|
||||
})
|
||||
await listSearchQuery.refetch()
|
||||
}
|
||||
|
||||
const handleDownloadConfirm = async (payload: { mode: ListDownloadMode; onlyFiltered: boolean }) => {
|
||||
void payload
|
||||
alert('Download action callback placeholder.')
|
||||
const handleDownloadConfirm = async (payload: ListDownloadPayload) => {
|
||||
const listFilter = buildTargetFilter(payload.target)
|
||||
|
||||
if (payload.mode === 'list') {
|
||||
const buffer = await downloadListMutation.mutateAsync(listFilter)
|
||||
downloadArrayBuffer(buffer, `${prjctName} list.xlsx`)
|
||||
return
|
||||
}
|
||||
|
||||
if (payload.mode === 'list-change-history') {
|
||||
const buffer = await downloadListUpdateHistoryMutation.mutateAsync(listFilter)
|
||||
downloadArrayBuffer(buffer, `${prjctName} update-history.xlsx`)
|
||||
return
|
||||
}
|
||||
|
||||
if (payload.mode === 'upload-file') {
|
||||
const buffer = await downloadListItemFileMutation.mutateAsync(listFilter)
|
||||
downloadArrayBuffer(buffer, `${prjctName} upload-files.zip`, 'application/zip')
|
||||
return
|
||||
}
|
||||
|
||||
const buffer = await downloadListEventHistoryMutation.mutateAsync({
|
||||
listFilter,
|
||||
resultCodeTypes: [ResultCodeType.CONTACT, ResultCodeType.INTERVIEW, ResultCodeType.SURVEY],
|
||||
searchBase: payload.contactHistoryType === 'latest' ? ListEventHistoryBase.LATEST : ListEventHistoryBase.ALL,
|
||||
dateRange: toDateTimeRange(payload.contactHistoryDateFrom, payload.contactHistoryDateTo),
|
||||
})
|
||||
downloadArrayBuffer(buffer, `${prjctName} contact-history.xlsx`)
|
||||
}
|
||||
|
||||
const handleMessageSendConfirm = async (payload: MessageSendPayload) => {
|
||||
@@ -253,55 +392,55 @@ const ListManagePage = () => {
|
||||
if (!mounted) return <LoadingOverlay force />
|
||||
|
||||
return (
|
||||
<div className="space-y-6 content-text-sm">
|
||||
<div className="space-y-6 text-sm">
|
||||
<div className="flex gap-2 items-center">
|
||||
<div className="flex flex-1 items-center gap-2 flex-wrap">
|
||||
<Button variant="destructive" className="content-text-base gap-2" onClick={() => showDialog('listResetDialog')}>
|
||||
<Button variant="destructive" className="text-base gap-2" onClick={() => showDialog('listResetDialog')}>
|
||||
<RotateCcw className="w-4 h-4" />
|
||||
리스트 초기화
|
||||
</Button>
|
||||
<Button className="content-text-base" onClick={() => showDialog('listHeaderManageDialog')}>
|
||||
<Button className="text-base" onClick={() => showDialog('listHeaderManageDialog')}>
|
||||
헤더 관리
|
||||
</Button>
|
||||
<Button className="content-text-base gap-2" onClick={() => showDialog('listUploadDialog')}>
|
||||
<Button className="text-base gap-2" onClick={() => showDialog('listUploadDialog')}>
|
||||
<Upload className="w-4 h-4" />
|
||||
리스트 업로드
|
||||
</Button>
|
||||
<Button className="content-text-base bg-excel gap-2" onClick={() => openDownloadDialog('list')}>
|
||||
<Button className="text-base bg-excel gap-2" onClick={() => openDownloadDialog('list')}>
|
||||
<Download className="w-4 h-4" />
|
||||
리스트
|
||||
</Button>
|
||||
<Button className="content-text-base bg-excel gap-2" onClick={() => openDownloadDialog('contact-history')}>
|
||||
<Button className="text-base bg-excel gap-2" onClick={() => openDownloadDialog('contact-history')}>
|
||||
<Download className="w-4 h-4" />
|
||||
컨택 이력
|
||||
</Button>
|
||||
<Button className="content-text-base bg-excel gap-2" onClick={() => openDownloadDialog('list-change-history')}>
|
||||
<Button className="text-base bg-excel gap-2" onClick={() => openDownloadDialog('list-change-history')}>
|
||||
<Download className="w-4 h-4" />
|
||||
리스트 변경 이력
|
||||
</Button>
|
||||
<Button className="content-text-base gap-2" onClick={() => openDownloadDialog('upload-file')}>
|
||||
<Button className="text-base gap-2" onClick={() => openDownloadDialog('upload-file')}>
|
||||
<Download className="w-4 h-4" />
|
||||
업로드 파일(.zip)
|
||||
</Button>
|
||||
</div>
|
||||
<Button className="content-text-base bg-blue gap-2" onClick={() => openMessageDialog('email')}>
|
||||
<Button className="text-base bg-blue gap-2" onClick={() => openMessageDialog('email')}>
|
||||
<Mail className="w-4 h-4" />
|
||||
이메일 발송
|
||||
</Button>
|
||||
<Button className="content-text-base bg-blue gap-2" onClick={() => openMessageDialog('sms')}>
|
||||
<Button className="text-base bg-blue gap-2" onClick={() => openMessageDialog('sms')}>
|
||||
<MessageSquareMore className="w-4 h-4" />
|
||||
문자 발송
|
||||
</Button>
|
||||
<Button className="content-text-base gap-2" onClick={() => showDialog('messageHistoryDialog')}>
|
||||
<Button className="text-base gap-2" onClick={() => showDialog('messageHistoryDialog')}>
|
||||
<FileClock className="w-4 h-4" />
|
||||
발송 이력
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-2 items-center">
|
||||
<div className="flex flex-1 items-center gap-2 flex-wrap">
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<Input
|
||||
placeholder="SID ',' '~' 사용 가능"
|
||||
placeholder="Search SID"
|
||||
className="w-100 h-9 bg-white"
|
||||
value={searchText}
|
||||
onChange={(e) => setSearchText(e.target.value)}
|
||||
@@ -336,9 +475,12 @@ const ListManagePage = () => {
|
||||
widthClassName="w-70"
|
||||
heightClassName="h-9"
|
||||
/>
|
||||
<Button className="content-text-lg" onClick={handleSearchClick}>
|
||||
<Button className="text-lg" onClick={handleSearchClick}>
|
||||
검색
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<Button type="button" variant="outline" className="gap-2" onClick={() => showDialog('listFilterDialog')}>
|
||||
<Funnel className="w-4 h-4" />
|
||||
필터
|
||||
@@ -354,18 +496,29 @@ const ListManagePage = () => {
|
||||
<DataTable<ListTableRow>
|
||||
columns={columns}
|
||||
data={viewList}
|
||||
getRowId={(row) => String(row.sid)}
|
||||
isClient={false}
|
||||
pageCount={pageCount}
|
||||
totalCount={totalCount}
|
||||
onPaginationChange={setPagination}
|
||||
onSortingChange={setSorting}
|
||||
selectMode="click-event"
|
||||
selectMode="multi"
|
||||
onRowSelectionChange={setSelectedRows}
|
||||
pageSizeOptions={[10, 20, 30, 50]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ListResetDialog onConfirm={handleResetConfirm} />
|
||||
<ListUploadDialog onUpload={handleUploadConfirm} onDownloadTemplate={handleDownloadTemplate} uploadHistory={uploadHistoryMock} />
|
||||
<ListUploadDialog
|
||||
onUpload={handleUploadConfirm}
|
||||
onDownloadTemplate={handleDownloadTemplate}
|
||||
uploadHistory={uploadHistoryQuery.data ?? []}
|
||||
onDownloadHistory={async (item) => {
|
||||
const buffer = await downloadUploadHistoryFileMutation.mutateAsync(item.listUploadLogId)
|
||||
downloadArrayBuffer(buffer, item.fileName)
|
||||
}}
|
||||
headerRows={headerManageRows}
|
||||
/>
|
||||
<ListHeaderManageDialog rows={headerManageRows} onConfirm={handleHeaderManageConfirm} />
|
||||
<ListFilterDialog headerOptions={filterHeaderOptions} initialRows={filterRows} onConfirm={handleFilterConfirm} />
|
||||
<ListBatchEditDialog
|
||||
@@ -380,7 +533,7 @@ const ListManagePage = () => {
|
||||
templateOptions={messageTemplateMock}
|
||||
targetHeaderOptions={messageTargetHeaders}
|
||||
defaultSenderEmail="info@kric.com"
|
||||
defaultSenderName="Korea Research"
|
||||
defaultSenderName="코리아리서치"
|
||||
defaultSenderNumber="02-0000-0000"
|
||||
onConfirm={handleMessageSendConfirm}
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'use client'
|
||||
'use client'
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import {Button} from "@/components/ui/button";
|
||||
@@ -10,11 +10,11 @@ import UserUpsertDialog from "@/components/dialog/UserUpsertDialog";
|
||||
import {UserInfoSaveRequest} from "@/types/user";
|
||||
import UserUploadDialog from "@/components/dialog/UserUploadDialog";
|
||||
import {useDialog} from "@/hooks/useDialog";
|
||||
import {downloadBase64File, downloadFile} from "@/lib/utils";
|
||||
import { downloadBase64File, downloadFile, XLSX_MIME_TYPE } from "@kri/common/browser";
|
||||
import {KriMultiSelect} from "@/components/common/KriAutoComplete";
|
||||
import {useAuth} from "@/hooks/useAuth";
|
||||
import {MultiSelectOption} from "@/components/ui/multi-select";
|
||||
import {useMounted} from "@/hooks/useMounted";
|
||||
import { useMounted } from "@kri/common/hooks";
|
||||
import {LoadingOverlay} from "@/components/common/LoadingOverlay";
|
||||
import {DEFAULT_COMPANY_NAME, EXTERNAL_USER_ROLE} from "@/const/userConst";
|
||||
import {Upload} from "lucide-react";
|
||||
@@ -101,9 +101,9 @@ const UserManagePage = () => {
|
||||
await upsertMutation.mutateAsync({ mode: dialogMode, data });
|
||||
|
||||
if (dialogMode === "create") {
|
||||
alert("등록 됐습니다.");
|
||||
alert("등록되었습니다.");
|
||||
} else {
|
||||
alert("수정 됐습니다.");
|
||||
alert("수정되었습니다.");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -117,17 +117,18 @@ const UserManagePage = () => {
|
||||
if (!confirm("정말 삭제하시겠습니까?")) return;
|
||||
|
||||
await deleteMutation.mutateAsync(userId);
|
||||
alert("삭제 됐습니다.");
|
||||
alert("삭제되었습니다.");
|
||||
};
|
||||
|
||||
const uploadFile = async (file: File) => {
|
||||
const res = await uploadMutation.mutateAsync(file);
|
||||
|
||||
if (res.hasErrorFile && res.errorFileBase64) {
|
||||
downloadBase64File(res.errorFileBase64, res.errorFileName ?? "error.xlsx");
|
||||
alert("업로드 중 오류가 발생하여 오류 파일을 다운로드합니다.");
|
||||
downloadBase64File(res.errorFileBase64, res.errorFileName ?? "error.xlsx", XLSX_MIME_TYPE);
|
||||
}
|
||||
else{
|
||||
alert(`${res.successCount}개의 계정을 생성했습니다.`);
|
||||
alert(`${res.successCount}개의 계정이 생성되었습니다.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -138,8 +139,8 @@ const UserManagePage = () => {
|
||||
const blob = new Blob([buffer], {
|
||||
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
});
|
||||
downloadFile(blob, "사용자 업로드 양식.xlsx");
|
||||
alert("다운로드 됐습니다.");
|
||||
downloadFile(blob, "사용자_업로드_양식.xlsx");
|
||||
alert("다운로드되었습니다.");
|
||||
} else {
|
||||
console.log("빈 파일입니다.");
|
||||
}
|
||||
@@ -163,13 +164,13 @@ const UserManagePage = () => {
|
||||
if (!mounted) return <LoadingOverlay force />;
|
||||
|
||||
return (
|
||||
<div className="space-y-6 content-text-sm">
|
||||
<BodyTitle titleText={"계정 관리"}/>
|
||||
<div className="space-y-6 text-sm">
|
||||
<BodyTitle titleText={"User management"}/>
|
||||
|
||||
<div className="flex gap-2 items-center">
|
||||
<div className="flex flex-1 items-center gap-2">
|
||||
<Input
|
||||
placeholder="면접원 ID Or 면접원 이름"
|
||||
placeholder="면접원 ID 또는 면접원 이름"
|
||||
className="w-70 h-9 bg-white"
|
||||
value={searchText}
|
||||
onChange={(e) => setSearchText(e.target.value)}
|
||||
@@ -197,14 +198,14 @@ const UserManagePage = () => {
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className="content-text-lg"
|
||||
className="text-lg"
|
||||
onClick={handleCreateClick}
|
||||
>
|
||||
면접원 등록
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => showDialog('userUploadDialog')}
|
||||
className="gap-2 bg-excel content-text-lg"
|
||||
className="gap-2 bg-excel text-lg"
|
||||
>
|
||||
<Upload className="w-4 h-4" />
|
||||
면접원 일괄 등록
|
||||
|
||||
@@ -15,7 +15,7 @@ const EmailTemplatePage = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6 content-text-sm">
|
||||
<div className="space-y-6 text-sm">
|
||||
<MessageTemplate pageTitle={"이메일 템플릿 관리"} defaultTemplate={defaultEmailTemplate}/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ const SmsTemplatePage = () => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6 content-text-sm">
|
||||
<div className="space-y-6 text-sm">
|
||||
<MessageTemplate pageTitle="문자 템플릿 관리" defaultTemplate={defaultSmsTemplate}/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ import {useDialog} from "@/hooks/useDialog";
|
||||
import {useAuth} from "@/hooks/useAuth";
|
||||
import {useSelectedProject} from "@/hooks/useSelectedProject";
|
||||
import {SelectedProject} from "@/store/jotai/project";
|
||||
import {useMounted} from "@/hooks/useMounted";
|
||||
import { useMounted } from "@kri/common/hooks";
|
||||
import {LoadingOverlay} from "@/components/common/LoadingOverlay";
|
||||
import {FW_USER_ROLE} from "@/const/userConst";
|
||||
import {useItrntUserList} from "@/hooks/useItrntUserList";
|
||||
@@ -144,7 +144,7 @@ const MainPage = () => {
|
||||
if (!mounted || isLoading) return <LoadingOverlay force />;
|
||||
|
||||
return (
|
||||
<div className="space-y-6 content-text-sm">
|
||||
<div className="space-y-6 text-sm">
|
||||
<BodyTitle titleText={"프로젝트"}/>
|
||||
|
||||
<div className="flex gap-2 items-center">
|
||||
@@ -192,14 +192,14 @@ const MainPage = () => {
|
||||
heightClassName="h-9"
|
||||
/>
|
||||
<Button
|
||||
className="content-text-lg"
|
||||
className="text-lg"
|
||||
onClick={handleSearchClick}
|
||||
>
|
||||
검색
|
||||
</Button>
|
||||
</div>
|
||||
<Button
|
||||
className="content-text-lg"
|
||||
className="text-lg"
|
||||
onClick={handleCreateClick}
|
||||
>
|
||||
프로젝트 등록
|
||||
@@ -231,4 +231,4 @@ const MainPage = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default MainPage;
|
||||
export default MainPage;
|
||||
|
||||
@@ -11,7 +11,7 @@ import {Tabs, TabsContent, TabsList, TabsTrigger} from '@/components/ui/tabs'
|
||||
import {KriMultiSelect, KriSingleSelect} from '@/components/common/KriAutoComplete'
|
||||
import {useDialog} from '@/hooks/useDialog'
|
||||
import ResultCodeDialog from '@/components/dialog/ResultCodeDialog'
|
||||
import {useMounted} from '@/hooks/useMounted'
|
||||
import { useDebouncedValue, useMounted } from "@kri/common/hooks";
|
||||
import {LoadingOverlay} from '@/components/common/LoadingOverlay'
|
||||
import {
|
||||
ProjectInfo, ProjectUpdateRequest, ResultCode,
|
||||
@@ -27,7 +27,6 @@ import {MultiSelectOption} from "@/components/ui/multi-select";
|
||||
import {FW_TEAM} from "@/const/userConst";
|
||||
import {useItrntUserList} from "@/hooks/useItrntUserList";
|
||||
import {useSelectedProject} from "@/hooks/useSelectedProject";
|
||||
import {useDebouncedValue} from "@/hooks/useDebouncedValue";
|
||||
import {useAuth} from "@/hooks/useAuth";
|
||||
import {KriEditor} from "@/components/kri-editor";
|
||||
import {useRouter} from "next/navigation";
|
||||
@@ -257,16 +256,16 @@ const ProjectInfoPage = () => {
|
||||
|
||||
{/* 1. 기본 정보 */}
|
||||
<div className="border rounded-lg p-6 space-y-5 bg-white mt-6">
|
||||
<h3 className="content-text-xl font-semibold">프로젝트 기본 정보</h3>
|
||||
<h3 className="text-xl font-semibold">프로젝트 기본 정보</h3>
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label className="content-text-base">프로젝트 코드</Label>
|
||||
<Label className="text-base">프로젝트 코드</Label>
|
||||
<Input value={projectInfo.prjctCd || ''} disabled className="bg-gray-100 h-9" />
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-[1fr_auto] gap-3 items-end">
|
||||
<div className="space-y-2">
|
||||
<Label className="content-text-base">진행 상태</Label>
|
||||
<Label className="text-base">진행 상태</Label>
|
||||
<RadioGroup
|
||||
value={String(projectInfo.prjctStatus ?? ProjectStatus.WAITING)}
|
||||
onValueChange={(v) => handleChange('prjctStatus', Number(v) as ProjectStatus)}
|
||||
@@ -277,7 +276,7 @@ const ProjectInfoPage = () => {
|
||||
return (
|
||||
<div key={s} className="flex items-center space-x-2">
|
||||
<RadioGroupItem value={String(s)} id={id} />
|
||||
<Label htmlFor={id} className="font-normal cursor-pointer content-text-base">
|
||||
<Label htmlFor={id} className="font-normal cursor-pointer text-base">
|
||||
{PROJECT_STATUS_LABEL[s]}
|
||||
</Label>
|
||||
</div>
|
||||
@@ -286,13 +285,13 @@ const ProjectInfoPage = () => {
|
||||
</RadioGroup>
|
||||
</div>
|
||||
|
||||
<Button onClick={handleResultCodeClick} className="h-9 content-text-base whitespace-nowrap">
|
||||
<Button onClick={handleResultCodeClick} className="h-9 text-base whitespace-nowrap">
|
||||
결과 코드 설정
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label className="content-text-base">
|
||||
<Label className="text-base">
|
||||
프로젝트 명<span className="text-red-500 ml-1">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
@@ -305,7 +304,7 @@ const ProjectInfoPage = () => {
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-2">
|
||||
<Label className="content-text-base">담당 그룹</Label>
|
||||
<Label className="text-base">담당 그룹</Label>
|
||||
<KriSingleSelect
|
||||
items={deptArray}
|
||||
value={projectInfo.ownerDept || ''}
|
||||
@@ -317,7 +316,7 @@ const ProjectInfoPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label className="content-text-base">담당 실사</Label>
|
||||
<Label className="text-base">담당 실사</Label>
|
||||
<KriSingleSelect
|
||||
items={fwArray}
|
||||
value={projectInfo.ownerFw || ''}
|
||||
@@ -334,7 +333,7 @@ const ProjectInfoPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="border rounded-lg p-6 space-y-4 bg-white mt-3">
|
||||
<h3 className="content-text-xl font-semibold">외주사</h3>
|
||||
<h3 className="text-xl font-semibold">외주사</h3>
|
||||
<KriMultiSelect
|
||||
items={outsourceOptionArray}
|
||||
value={outsourceUserArray}
|
||||
@@ -349,7 +348,7 @@ const ProjectInfoPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="border rounded-lg p-6 space-y-4 bg-white mt-3">
|
||||
<h3 className="content-text-xl font-semibold">설문 연동</h3>
|
||||
<h3 className="text-xl font-semibold">설문 연동</h3>
|
||||
|
||||
<RadioGroup
|
||||
value={String(projectInfo.surveyTy ?? SurveyType.NONE)}
|
||||
@@ -361,7 +360,7 @@ const ProjectInfoPage = () => {
|
||||
return (
|
||||
<div key={t} className="flex items-center space-x-2">
|
||||
<RadioGroupItem value={String(t)} id={id} />
|
||||
<Label htmlFor={id} className="font-normal cursor-pointer content-text-base">
|
||||
<Label htmlFor={id} className="font-normal cursor-pointer text-base">
|
||||
{SURVEY_TYPE_LABEL[t]}
|
||||
</Label>
|
||||
</div>
|
||||
@@ -371,7 +370,7 @@ const ProjectInfoPage = () => {
|
||||
|
||||
{(projectInfo.surveyTy === SurveyType.KON || projectInfo.surveyTy === SurveyType.KIWI) && (
|
||||
<div className="space-y-2">
|
||||
<Label className="content-text-base">{SURVEY_TYPE_LABEL[projectInfo.surveyTy]} 프로젝트</Label>
|
||||
<Label className="text-base">{SURVEY_TYPE_LABEL[projectInfo.surveyTy]} 프로젝트</Label>
|
||||
<KriSingleSelect
|
||||
items={surveyProjectArray}
|
||||
value={projectInfo.surveyPrjctCd || ''}
|
||||
@@ -388,7 +387,7 @@ const ProjectInfoPage = () => {
|
||||
)}
|
||||
{projectInfo.surveyTy !== SurveyType.NONE && (
|
||||
<div className="space-y-2">
|
||||
<Label className="content-text-base">설문 URL</Label>
|
||||
<Label className="text-base">설문 URL</Label>
|
||||
<Input
|
||||
value={projectInfo.surveyUrl || ''}
|
||||
onChange={(e) => handleChange('surveyUrl', e.target.value)}
|
||||
@@ -412,19 +411,19 @@ const ProjectInfoPage = () => {
|
||||
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">시작:</Label>
|
||||
<Label className="w-24 text-base">시작:</Label>
|
||||
<Input value={externalUrls.redirect.start} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">완료:</Label>
|
||||
<Label className="w-24 text-base">완료:</Label>
|
||||
<Input value={externalUrls.redirect.complete} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">스크린 아웃:</Label>
|
||||
<Label className="w-24 text-base">스크린 아웃:</Label>
|
||||
<Input value={externalUrls.redirect.screen} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">쿼터 풀:</Label>
|
||||
<Label className="w-24 text-base">쿼터 풀:</Label>
|
||||
<Input value={externalUrls.redirect.quota} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -437,19 +436,19 @@ const ProjectInfoPage = () => {
|
||||
|
||||
<div className="grid gap-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">시작 API:</Label>
|
||||
<Label className="w-24 text-base">시작 API:</Label>
|
||||
<Input value={externalUrls.api.start} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">완료 API:</Label>
|
||||
<Label className="w-24 text-base">완료 API:</Label>
|
||||
<Input value={externalUrls.api.complete} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">스크린 API:</Label>
|
||||
<Label className="w-24 text-base">스크린 API:</Label>
|
||||
<Input value={externalUrls.api.screen} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label className="w-24 content-text-base">쿼터 API:</Label>
|
||||
<Label className="w-24 text-base">쿼터 API:</Label>
|
||||
<Input value={externalUrls.api.quota} disabled className="bg-white h-9" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -463,7 +462,7 @@ const ProjectInfoPage = () => {
|
||||
</div>
|
||||
|
||||
<div className="border rounded-lg p-6 space-y-4 bg-white mt-3">
|
||||
<h3 className="content-text-xl font-semibold">기타 옵션</h3>
|
||||
<h3 className="text-xl font-semibold">기타 옵션</h3>
|
||||
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center space-x-2">
|
||||
@@ -472,7 +471,7 @@ const ProjectInfoPage = () => {
|
||||
checked={projectInfo.ff || false}
|
||||
onCheckedChange={(checked) => handleChange('ff', checked === true)}
|
||||
/>
|
||||
<Label htmlFor="ff" className="font-normal cursor-pointer content-text-base">
|
||||
<Label htmlFor="ff" className="font-normal cursor-pointer text-base">
|
||||
현장 면접 진행
|
||||
</Label>
|
||||
</div>
|
||||
@@ -483,7 +482,7 @@ const ProjectInfoPage = () => {
|
||||
checked={projectInfo.useContactSenario || false}
|
||||
onCheckedChange={(checked) => handleChange('useContactSenario', checked === true)}
|
||||
/>
|
||||
<Label htmlFor="useContactSenario" className="font-normal cursor-pointer content-text-base">
|
||||
<Label htmlFor="useContactSenario" className="font-normal cursor-pointer text-base">
|
||||
컨택 시나리오
|
||||
</Label>
|
||||
</div>
|
||||
@@ -512,12 +511,12 @@ const ProjectInfoPage = () => {
|
||||
<div className="flex justify-end gap-2">
|
||||
<Button
|
||||
variant="destructive"
|
||||
className="w-32 h-10 content-text-base"
|
||||
className="w-32 h-10 text-base"
|
||||
onClick={handleDeleteClick}
|
||||
>
|
||||
삭제
|
||||
</Button>
|
||||
<Button onClick={handleSubmit} className="w-32 h-10 content-text-base">
|
||||
<Button onClick={handleSubmit} className="w-32 h-10 text-base">
|
||||
저장
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
"use client";
|
||||
"use client";
|
||||
|
||||
import Image from "next/image";
|
||||
import {Button} from "@/components/ui/button";
|
||||
import {Card, CardContent, CardHeader} from "@/components/ui/card";
|
||||
import {Input} from "@/components/ui/input";
|
||||
import React, {useEffect, useRef, useState} from "react";
|
||||
import React, { Suspense, useEffect, useRef, useState } from "react";
|
||||
import {useRouter, useSearchParams} from "next/navigation";
|
||||
import { useStorage } from "@/hooks/useStorage"
|
||||
import { StorageKeys } from "@/store/storage/storage-keys";
|
||||
import {apiError} from "@/lib/http-util";
|
||||
import {NONE_HTTP_ERROR} from "@/const/commonConst";
|
||||
import {apiError} from "@kri/common/http";
|
||||
import {NONE_HTTP_ERROR} from "@kri/common/http";
|
||||
import {useLoginMutation} from "@/query/auth";
|
||||
import {useInternalInfoQuery} from "@/query/internal";
|
||||
|
||||
const LoginPage = () => {
|
||||
const LoginPageContent = () => {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const typeParam = searchParams.get("type") ?? "";
|
||||
|
||||
const loginMutation = useLoginMutation();
|
||||
const internalInfoQuery = useInternalInfoQuery();
|
||||
// TODO: 받은 데이터 확인
|
||||
console.log(internalInfoQuery.data);
|
||||
|
||||
const { get: getSeatNumberStorage } = useStorage(StorageKeys.SeatNumber);
|
||||
|
||||
@@ -32,15 +36,17 @@ const LoginPage = () => {
|
||||
const seatNumberInputRef = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
const tryLogin = async () => {
|
||||
if (!userId) return alert("아이디를 입력해 주세요");
|
||||
if (!userPw) return alert("PW를 입력해 주세요");
|
||||
if (loginType === "call" && !seatNum) return alert("자리번호를 입력해 주세요");
|
||||
if (!userId) return alert("Please enter ID.");
|
||||
if (!userPw) return alert("Please enter password.");
|
||||
if (loginType === "call" && !seatNum) return alert("Please enter seat number.");
|
||||
|
||||
setError(null);
|
||||
try {
|
||||
await loginMutation.mutateAsync({ userId, userPw, seatNum, loginType });
|
||||
} catch (e) {
|
||||
const err = apiError(e);
|
||||
const err = apiError(e, {
|
||||
fallbackMessage: "Login failed.",
|
||||
});
|
||||
if (err.status === 401 || err.status === 403) setError("아이디 또는 비밀번호를 다시 확인해주세요.");
|
||||
else if (err.code === NONE_HTTP_ERROR) setError("알 수 없는 오류가 발생했습니다. 잠시 후 다시 시도해주세요.");
|
||||
else setError(`로그인에 실패했습니다. (${err.message})`);
|
||||
@@ -101,7 +107,7 @@ const LoginPage = () => {
|
||||
<Image
|
||||
src="/kri_logo.png" // public/kri_logo.png
|
||||
alt="KRI 로고"
|
||||
width={500} // 원하는 크기로 줄이기
|
||||
width={500}
|
||||
height={500}
|
||||
className="object-contain ml-10"
|
||||
priority
|
||||
@@ -118,7 +124,7 @@ const LoginPage = () => {
|
||||
name="id"
|
||||
type="text"
|
||||
required
|
||||
placeholder="아이디를 입력하세요"
|
||||
placeholder="Enter ID"
|
||||
value={userId}
|
||||
onChange={(e) => setUserId(e.currentTarget.value)}
|
||||
onKeyDown={handleIdKeyDown}
|
||||
@@ -133,7 +139,7 @@ const LoginPage = () => {
|
||||
type="password"
|
||||
autoComplete="current-password"
|
||||
required
|
||||
placeholder="PW를 입력하세요"
|
||||
placeholder="Enter password"
|
||||
value={userPw}
|
||||
onChange={(e) => setUserPw(e.currentTarget.value)}
|
||||
onKeyDown={handlePwKeyDown}
|
||||
@@ -148,7 +154,7 @@ const LoginPage = () => {
|
||||
id="seatNum"
|
||||
name="seatNum"
|
||||
type="text"
|
||||
placeholder="자리번호를 입력하세요"
|
||||
placeholder="Enter seat number"
|
||||
value={seatNum}
|
||||
onChange={(e) => setSeatNum(e.currentTarget.value)}
|
||||
onKeyDown={handleSeatNumberKeyDown}
|
||||
@@ -183,4 +189,10 @@ const LoginPage = () => {
|
||||
);
|
||||
}
|
||||
|
||||
const LoginPage = () => (
|
||||
<Suspense fallback={null}>
|
||||
<LoginPageContent />
|
||||
</Suspense>
|
||||
);
|
||||
|
||||
export default LoginPage;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {createContactApi} from "@/lib/server-api";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {createContactApi} from "@/lib/http-server";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
@@ -48,4 +48,4 @@ export const PUT = async (req: NextRequest, context: RouteContext) => {
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
117
src/app/api/external/[[...slug]]/route.ts
vendored
117
src/app/api/external/[[...slug]]/route.ts
vendored
@@ -1,41 +1,94 @@
|
||||
//외부 설문에 뎐동 되는 API
|
||||
// External survey event API.
|
||||
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {createContactApi} from "@/lib/server-api";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {getClientIp} from "@/lib/utils";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { RouteContext } from "@/types/common";
|
||||
import { errorToResponse } from "@kri/common/http";
|
||||
import { getClientIp } from "@kri/common/server";
|
||||
import {
|
||||
EXTERNAL_ACTION_CODE_BY_SLUG,
|
||||
ExternalAction,
|
||||
ExternalEntryType,
|
||||
ExternalEventBody,
|
||||
} from "@/types/external";
|
||||
import {createContactApi} from "@/lib/http-server";
|
||||
|
||||
export const POST = async (req: NextRequest, context: RouteContext) => {
|
||||
const getHeader = (headers: Headers, name: string): string | null => {
|
||||
const value = headers.get(name);
|
||||
return value && value.trim().length > 0 ? value : null;
|
||||
};
|
||||
|
||||
const getEntryType = (headers: Headers): ExternalEntryType => {
|
||||
return getHeader(headers, "x-entry-type") === "redirect" ? "redirect" : "api";
|
||||
};
|
||||
|
||||
const toExternalAction = (value: string): ExternalAction | null => {
|
||||
return value in EXTERNAL_ACTION_CODE_BY_SLUG ? (value as ExternalAction) : null;
|
||||
};
|
||||
|
||||
const toRequiredNumber = (value: string): number | null => {
|
||||
const parsed = Number(value);
|
||||
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : null;
|
||||
};
|
||||
|
||||
const buildExternalEventBody = (
|
||||
req: NextRequest,
|
||||
action: ExternalAction,
|
||||
prjctIdx: number,
|
||||
sid: number,
|
||||
): ExternalEventBody => {
|
||||
const pathname = req.nextUrl.pathname;
|
||||
const h = req.headers;
|
||||
const actionCode = EXTERNAL_ACTION_CODE_BY_SLUG[action];
|
||||
|
||||
return {
|
||||
actionCode,
|
||||
prjctIdx,
|
||||
sid,
|
||||
meta: {
|
||||
entryType: getEntryType(h),
|
||||
action,
|
||||
actionCode,
|
||||
pid: String(prjctIdx),
|
||||
sid: String(sid),
|
||||
remoteAddr: getHeader(h, "x-orig-ip") || getClientIp(req),
|
||||
uri: getHeader(h, "x-orig-uri") || pathname,
|
||||
url: getHeader(h, "x-orig-url") || req.url,
|
||||
userAgent: getHeader(h, "x-orig-user-agent") || getHeader(h, "user-agent"),
|
||||
referer: getHeader(h, "x-orig-referer") || getHeader(h, "referer"),
|
||||
origin: getHeader(h, "x-orig-origin") || getHeader(h, "origin"),
|
||||
xForwardedFor: getHeader(h, "x-orig-x-forwarded-for") || getHeader(h, "x-forwarded-for"),
|
||||
forwarded: getHeader(h, "x-orig-forwarded") || getHeader(h, "forwarded"),
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const handleExternalEvent = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
const { searchParams } = new URL(req.url);
|
||||
const {slug = []} = await context.params;
|
||||
const [action] = slug;
|
||||
const { searchParams } = req.nextUrl;
|
||||
const { slug = [] } = await context.params;
|
||||
const action = toExternalAction((slug[0] ?? "").toLowerCase());
|
||||
|
||||
const sid = (searchParams.get("sid") ?? "").trim();
|
||||
const allowAction = ["start", "complete", "screen", "quota"]
|
||||
if(slug.length === 1 && allowAction.includes(action.toLowerCase()) && sid.length > 0){
|
||||
const contactApi = await createContactApi();
|
||||
|
||||
const pathname = req.nextUrl.pathname;
|
||||
const h = req.headers;
|
||||
const log = {
|
||||
remoteAddr: h.get("x-orig-ip") || getClientIp(req),
|
||||
uri: h.get("x-orig-uri") || pathname,
|
||||
url: h.get("x-orig-url") || req.url,
|
||||
userAgent: h.get("x-orig-user-agent") || h.get("user-agent"),
|
||||
referer: h.get("x-orig-referer") || h.get("referer"),
|
||||
origin: h.get("x-orig-origin") || h.get("origin"),
|
||||
xForwardedFor: h.get("x-forwarded-for"),
|
||||
forwarded: h.get("forwarded"),
|
||||
};
|
||||
|
||||
//Todo 수정 필요
|
||||
return new NextResponse(null, { status: 204 });
|
||||
if (slug.length !== 1 || !action) {
|
||||
return NextResponse.json({ message: "Not found" }, { status: 404 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ message: "Not found" }, { status: 404 });
|
||||
const prjctIdx = toRequiredNumber((searchParams.get("pid") ?? "").trim());
|
||||
const sid = toRequiredNumber((searchParams.get("sid") ?? "").trim());
|
||||
|
||||
if (!prjctIdx || !sid) {
|
||||
return NextResponse.json({ message: "pid와 sid는 필수입니다." }, { status: 400 });
|
||||
}
|
||||
|
||||
const body = buildExternalEventBody(req, action, prjctIdx, sid);
|
||||
const contactApi = await createContactApi();
|
||||
|
||||
await contactApi.post(`/list-hist/survey`, body);
|
||||
return new NextResponse(null, { status: 204 });
|
||||
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const GET = handleExternalEvent;
|
||||
export const POST = handleExternalEvent;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {createContactApi, createIntranetApi} from "@/lib/server-api";
|
||||
import {IntranetProjectSearchResponse, ProjectInfo, ProjectOwnerResponse} from "@/types/project";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {createIntranetApi} from "@/lib/http-server";
|
||||
import {IntranetProjectSearchResponse} from "@/types/project";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
import {ItrntUserInfo} from "@/types/user";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
@@ -32,4 +32,4 @@ export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {createKartApi} from "@/lib/server-api";
|
||||
import {createKartApi} from "@/lib/http-server";
|
||||
import {KonKiwiProjectInfo} from "@/types/project";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
@@ -25,4 +25,4 @@ export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {PageResponse, RouteContext} from "@/types/common";
|
||||
import {createContactApi} from "@/lib/server-api";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import type {PageResponse} from "@kri/common";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {createContactApi} from "@/lib/http-server";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
import {listHeader, ListSearchRequest, ListSearchWithFullResult} from "@/types/list";
|
||||
|
||||
const excelHeaders = {
|
||||
"Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
};
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
const {slug = []} = await context.params;
|
||||
@@ -17,6 +22,11 @@ export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
return NextResponse.json(result, { status: 200 });
|
||||
}
|
||||
|
||||
if (action === "upload-history") {
|
||||
const result = await contactApi.get(`/list/excel/upload-history/${slug[1]}`);
|
||||
return NextResponse.json(result, { status: 200 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ message: "Not found" }, { status: 404 });
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
@@ -45,8 +55,109 @@ export const POST = async (req: NextRequest, context: RouteContext) => {
|
||||
return NextResponse.json(result, { status: 200 });
|
||||
}
|
||||
|
||||
if (action === "excel-template") {
|
||||
const prjctIdx = slug[1];
|
||||
if (!prjctIdx) {
|
||||
return NextResponse.json({ message: "prjctIdx 파라미터가 없습니다." }, { status: 400 });
|
||||
}
|
||||
|
||||
const result = await contactApi.post<ArrayBuffer>(
|
||||
`/list/excel/template/${prjctIdx}`,
|
||||
undefined,
|
||||
{ expectBinary: true }
|
||||
);
|
||||
|
||||
return new NextResponse(result, {
|
||||
status: 200,
|
||||
headers: {
|
||||
...excelHeaders,
|
||||
"Content-Disposition": 'attachment; filename="list_upload_template.xlsx"',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (action === "excel-upload") {
|
||||
const form = await req.formData();
|
||||
const result = await contactApi.postForm(`/list/excel/upload/${slug[1]}`, form);
|
||||
return NextResponse.json(result, { status: 200 });
|
||||
}
|
||||
|
||||
if (action === "excel-download") {
|
||||
const body = await req.json().catch(() => null);
|
||||
const result = await contactApi.post<ArrayBuffer>(`/list/excel/download/${slug[1]}`, body, { expectBinary: true });
|
||||
return new NextResponse(result, { status: 200, headers: excelHeaders });
|
||||
}
|
||||
|
||||
if (action === "excel-download-update") {
|
||||
const body = await req.json().catch(() => null);
|
||||
const result = await contactApi.post<ArrayBuffer>(`/list/excel/download/update/${slug[1]}`, body, {
|
||||
expectBinary: true,
|
||||
});
|
||||
return new NextResponse(result, { status: 200, headers: excelHeaders });
|
||||
}
|
||||
|
||||
if (action === "event-history-download") {
|
||||
const body = await req.json().catch(() => null);
|
||||
const result = await contactApi.post<ArrayBuffer>(`/list-hist/excel/download/event/${slug[1]}`, body, {
|
||||
expectBinary: true,
|
||||
});
|
||||
return new NextResponse(result, { status: 200, headers: excelHeaders });
|
||||
}
|
||||
|
||||
if (action === "item-file-download") {
|
||||
const body = await req.json().catch(() => null);
|
||||
const result = await contactApi.post<ArrayBuffer>(`/list/item-file/download/${slug[1]}`, body, {
|
||||
expectBinary: true,
|
||||
});
|
||||
return new NextResponse(result, { status: 200, headers: { "Content-Type": "application/zip" } });
|
||||
}
|
||||
|
||||
if (action === "upload-history-file") {
|
||||
const result = await contactApi.post<ArrayBuffer>(
|
||||
`/list/excel/upload-history/file/${slug[1]}/${slug[2]}`,
|
||||
undefined,
|
||||
{ expectBinary: true },
|
||||
);
|
||||
return new NextResponse(result, { status: 200, headers: excelHeaders });
|
||||
}
|
||||
|
||||
return NextResponse.json({ message: "Not found" }, { status: 404 });
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const PATCH = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
const { slug = [] } = await context.params;
|
||||
const [action] = slug;
|
||||
const body = await req.json().catch(() => null);
|
||||
const contactApi = await createContactApi();
|
||||
|
||||
if (action === "header") {
|
||||
await contactApi.patch(`/list-header/${slug[1]}`, body);
|
||||
return new NextResponse(null, { status: 204 });
|
||||
}
|
||||
|
||||
if (action === "update") {
|
||||
const result = await contactApi.patch<number>(`/list/update/${slug[1]}`, body);
|
||||
return NextResponse.json(result, { status: 200 });
|
||||
}
|
||||
|
||||
return NextResponse.json({ message: "Not found" }, { status: 404 });
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const DELETE = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
const { slug = [] } = await context.params;
|
||||
const body = await req.json().catch(() => null);
|
||||
const contactApi = await createContactApi();
|
||||
const result = await contactApi.del<number>(`/list/${slug[0]}`, { json: body });
|
||||
return NextResponse.json(result, { status: 200 });
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import {LoginRequest, LoginUser} from "@/types/auth";
|
||||
import {serverEnv} from "@/lib/env.server";
|
||||
import {createContactApi} from "@/lib/server-api";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {createContactApi} from "@/lib/http-server";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
import {CookieKeys} from "@/store/cookie/cookie-keys";
|
||||
|
||||
//실제 Backend
|
||||
//?ㅼ젣 Backend
|
||||
type LoginResponse = {
|
||||
accessToken: string;
|
||||
user: LoginUser;
|
||||
@@ -18,16 +19,16 @@ export const POST = async (req: NextRequest) => {
|
||||
const result = await contactApi.post<LoginResponse>("/auth/login", body);
|
||||
|
||||
const res = NextResponse.json(result.user, { status: 200 });
|
||||
res.cookies.set("access_token", result.accessToken, {
|
||||
res.cookies.set(CookieKeys.AuthToken, result.accessToken, {
|
||||
httpOnly: true,
|
||||
secure: serverEnv.ENV === "prod",
|
||||
sameSite: "lax",
|
||||
path: "/",
|
||||
maxAge: 24 * 60 * 60, // 24시간
|
||||
maxAge: 24 * 60 * 60, // 24?쒓컙
|
||||
});
|
||||
|
||||
return res;
|
||||
} catch (error : unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import {serverEnv} from "@/lib/env.server";
|
||||
import {createContactApi} from "@/lib/server-api";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {createContactApi} from "@/lib/http-server";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {CookieKeys} from "@/store/cookie/cookie-keys";
|
||||
|
||||
export async function POST(
|
||||
req: NextRequest,
|
||||
@@ -21,7 +22,7 @@ export async function POST(
|
||||
await contactApi.post<boolean>(url);
|
||||
const res = NextResponse.json({ ok: true });
|
||||
|
||||
res.cookies.set("access_token", "", {
|
||||
res.cookies.set(CookieKeys.AuthToken, "", {
|
||||
httpOnly: true,
|
||||
secure: serverEnv.ENV === "prod",
|
||||
sameSite: "lax",
|
||||
@@ -33,4 +34,4 @@ export async function POST(
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {createNotihubApi} from "@/lib/server-api";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {createNotihubApi} from "@/lib/http-server";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
import {Template, TemplateSummary} from "@/types/messageTemplate";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
@@ -102,4 +102,4 @@ export const PATCH = async (req: NextRequest, context: RouteContext) => {
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {createContactApi, createIntranetApi} from "@/lib/server-api";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {PageResponse, RouteContext} from "@/types/common";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {createContactApi, createIntranetApi} from "@/lib/http-server";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
import type {PageResponse} from "@kri/common";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {ProjectInfo, ProjectListRequest, ProjectOwnerResponse} from "@/types/project";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
@@ -186,4 +187,4 @@ export const DELETE = async (req: NextRequest, context: RouteContext) => {
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {RouteContext} from "@/types/common";
|
||||
import {createContactApi} from "@/lib/server-api";
|
||||
import {createContactApi} from "@/lib/http-server";
|
||||
import {ProjectInfo, ProjectOwnerResponse, ResultCode} from "@/types/project";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
@@ -20,4 +20,4 @@ export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {createContactApi} from "@/lib/server-api";
|
||||
import {NextRequest, NextResponse} from "next/server";
|
||||
import {createContactApi} from "@/lib/http-server";
|
||||
import {RoleInfo} from "@/types/role";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
import {RouteContext} from "@/types/common";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
@@ -19,4 +19,4 @@ export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
} catch (error: unknown) {
|
||||
return errorToResponse(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { createContactApi } from "@/lib/server-api";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { createContactApi } from "@/lib/http-server";
|
||||
import {ExcelUploadResult, UserInfo} from "@/types/user";
|
||||
import {DataVerification, RouteContext} from "@/types/common";
|
||||
import {errorToResponse} from "@/lib/http-util";
|
||||
import {errorToResponse} from "@kri/common/http";
|
||||
|
||||
export const GET = async (req: NextRequest, context: RouteContext) => {
|
||||
try {
|
||||
|
||||
@@ -4,113 +4,127 @@
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--font-sans: var(--font-geist-sans);
|
||||
--font-mono: var(--font-geist-mono);
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-ring: var(--ring);
|
||||
--color-input: var(--input);
|
||||
--color-border: var(--border);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
--radius-xl: calc(var(--radius) + 4px);
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--font-sans: var(--font-geist-sans);
|
||||
--font-mono: var(--font-geist-mono);
|
||||
/* --content-font-size 배율 기반 font-size 스케일 (기본 text-* 유틸을 그대로 대체) */
|
||||
--font-size-xs: calc(var(--content-font-size) * 0.75);
|
||||
--font-size-sm: calc(var(--content-font-size) * 0.875);
|
||||
--font-size-base: var(--content-font-size);
|
||||
--font-size-lg: calc(var(--content-font-size) * 1.125);
|
||||
--font-size-xl: calc(var(--content-font-size) * 1.25);
|
||||
--font-size-2xl: calc(var(--content-font-size) * 1.5);
|
||||
--font-size-3xl: calc(var(--content-font-size) * 1.875);
|
||||
--font-size-4xl: calc(var(--content-font-size) * 2.25);
|
||||
--font-size-5xl: calc(var(--content-font-size) * 3);
|
||||
--font-size-6xl: calc(var(--content-font-size) * 3.75);
|
||||
--font-size-7xl: calc(var(--content-font-size) * 4.5);
|
||||
--font-size-8xl: calc(var(--content-font-size) * 6);
|
||||
--font-size-9xl: calc(var(--content-font-size) * 8);
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-ring: var(--ring);
|
||||
--color-input: var(--input);
|
||||
--color-border: var(--border);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-card: var(--card);
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
--radius-xl: calc(var(--radius) + 4px);
|
||||
}
|
||||
|
||||
:root {
|
||||
--radius: 0.625rem;
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0 0);
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: oklch(0.97 0 0);
|
||||
--secondary-foreground: oklch(0.205 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--accent-foreground: oklch(0.205 0 0);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
--chart-1: oklch(0.646 0.222 41.116);
|
||||
--chart-2: oklch(0.6 0.118 184.704);
|
||||
--chart-3: oklch(0.398 0.07 227.392);
|
||||
--chart-4: oklch(0.828 0.189 84.429);
|
||||
--chart-5: oklch(0.769 0.188 70.08);
|
||||
--sidebar: oklch(0.985 0 0);
|
||||
--sidebar-foreground: oklch(0.145 0 0);
|
||||
--sidebar-primary: oklch(0.205 0 0);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
--content-font-size: 14px;
|
||||
--radius: 0.625rem;
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0 0);
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: oklch(0.97 0 0);
|
||||
--secondary-foreground: oklch(0.205 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--accent-foreground: oklch(0.205 0 0);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
--chart-1: oklch(0.646 0.222 41.116);
|
||||
--chart-2: oklch(0.6 0.118 184.704);
|
||||
--chart-3: oklch(0.398 0.07 227.392);
|
||||
--chart-4: oklch(0.828 0.189 84.429);
|
||||
--chart-5: oklch(0.769 0.188 70.08);
|
||||
--sidebar: oklch(0.985 0 0);
|
||||
--sidebar-foreground: oklch(0.145 0 0);
|
||||
--sidebar-primary: oklch(0.205 0 0);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
--content-font-size: 14px;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: oklch(0.145 0 0);
|
||||
--foreground: oklch(0.985 0 0);
|
||||
--card: oklch(0.205 0 0);
|
||||
--card-foreground: oklch(0.985 0 0);
|
||||
--popover: oklch(0.205 0 0);
|
||||
--popover-foreground: oklch(0.985 0 0);
|
||||
--primary: oklch(0.922 0 0);
|
||||
--primary-foreground: oklch(0.205 0 0);
|
||||
--secondary: oklch(0.269 0 0);
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.269 0 0);
|
||||
--muted-foreground: oklch(0.708 0 0);
|
||||
--accent: oklch(0.269 0 0);
|
||||
--accent-foreground: oklch(0.985 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--border: oklch(1 0 0 / 10%);
|
||||
--input: oklch(1 0 0 / 15%);
|
||||
--ring: oklch(0.556 0 0);
|
||||
--chart-1: oklch(0.488 0.243 264.376);
|
||||
--chart-2: oklch(0.696 0.17 162.48);
|
||||
--chart-3: oklch(0.769 0.188 70.08);
|
||||
--chart-4: oklch(0.627 0.265 303.9);
|
||||
--chart-5: oklch(0.645 0.246 16.439);
|
||||
--sidebar: oklch(0.205 0 0);
|
||||
--sidebar-foreground: oklch(0.985 0 0);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.269 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(1 0 0 / 10%);
|
||||
--sidebar-ring: oklch(0.556 0 0);
|
||||
--background: oklch(0.145 0 0);
|
||||
--foreground: oklch(0.985 0 0);
|
||||
--card: oklch(0.205 0 0);
|
||||
--card-foreground: oklch(0.985 0 0);
|
||||
--popover: oklch(0.205 0 0);
|
||||
--popover-foreground: oklch(0.985 0 0);
|
||||
--primary: oklch(0.922 0 0);
|
||||
--primary-foreground: oklch(0.205 0 0);
|
||||
--secondary: oklch(0.269 0 0);
|
||||
--secondary-foreground: oklch(0.985 0 0);
|
||||
--muted: oklch(0.269 0 0);
|
||||
--muted-foreground: oklch(0.708 0 0);
|
||||
--accent: oklch(0.269 0 0);
|
||||
--accent-foreground: oklch(0.985 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--border: oklch(1 0 0 / 10%);
|
||||
--input: oklch(1 0 0 / 15%);
|
||||
--ring: oklch(0.556 0 0);
|
||||
--chart-1: oklch(0.488 0.243 264.376);
|
||||
--chart-2: oklch(0.696 0.17 162.48);
|
||||
--chart-3: oklch(0.769 0.188 70.08);
|
||||
--chart-4: oklch(0.627 0.265 303.9);
|
||||
--chart-5: oklch(0.645 0.246 16.439);
|
||||
--sidebar: oklch(0.205 0 0);
|
||||
--sidebar-foreground: oklch(0.985 0 0);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.269 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(1 0 0 / 10%);
|
||||
--sidebar-ring: oklch(0.556 0 0);
|
||||
}
|
||||
|
||||
.bg-excel {
|
||||
@@ -127,80 +141,21 @@
|
||||
background-color: var(--color-blue-700);
|
||||
}
|
||||
|
||||
/* 배율별 유틸 클래스 */
|
||||
.content-text-xs {
|
||||
font-size: calc(var(--content-font-size) * 0.75);
|
||||
}
|
||||
|
||||
.content-text-sm {
|
||||
font-size: calc(var(--content-font-size) * 0.875);
|
||||
}
|
||||
|
||||
.content-text-base {
|
||||
font-size: var(--content-font-size);
|
||||
}
|
||||
|
||||
.content-text-lg {
|
||||
font-size: calc(var(--content-font-size) * 1.125);
|
||||
}
|
||||
|
||||
.content-text-xl {
|
||||
font-size: calc(var(--content-font-size) * 1.25);
|
||||
}
|
||||
|
||||
.content-text-2xl {
|
||||
font-size: calc(var(--content-font-size) * 1.5);
|
||||
}
|
||||
|
||||
.content-text-3xl {
|
||||
font-size: calc(var(--content-font-size) * 1.875);
|
||||
}
|
||||
|
||||
.content-text-4xl {
|
||||
font-size: calc(var(--content-font-size) * 2.25);
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
.placeholder-content-text-xs::placeholder {
|
||||
font-size: calc(var(--content-font-size) * 0.75);
|
||||
}
|
||||
|
||||
.placeholder-content-text-sm::placeholder {
|
||||
font-size: calc(var(--content-font-size) * 0.875);
|
||||
}
|
||||
|
||||
.placeholder-content-text-base::placeholder {
|
||||
font-size: var(--content-font-size);
|
||||
}
|
||||
|
||||
.placeholder-content-text-lg::placeholder {
|
||||
font-size: calc(var(--content-font-size) * 1.125);
|
||||
}
|
||||
|
||||
.placeholder-content-text-xl::placeholder {
|
||||
font-size: calc(var(--content-font-size) * 1.25);
|
||||
}
|
||||
|
||||
.placeholder-content-text-2xl::placeholder {
|
||||
font-size: calc(var(--content-font-size) * 1.5);
|
||||
}
|
||||
|
||||
.placeholder-content-text-3xl::placeholder {
|
||||
font-size: calc(var(--content-font-size) * 1.875);
|
||||
}
|
||||
|
||||
.placeholder-content-text-4xl::placeholder {
|
||||
font-size: calc(var(--content-font-size) * 2.25);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* [제거됨] .content-text-* / .placeholder-content-text-*
|
||||
* --font-size-* 를 @theme inline 에 등록했기 때문에
|
||||
* 기본 text-xs ~ text-4xl 유틸이 이미 --content-font-size 배율을 반영합니다.
|
||||
* placeholder 스타일도 Tailwind 기본 placeholder: variant로 대체 가능합니다.
|
||||
* 예) placeholder-content-text-sm -> placeholder:text-sm
|
||||
*/
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border outline-ring/50;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
* {
|
||||
@apply border-border outline-ring/50;
|
||||
}
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************TipTap 이미지 Resize Node*******************************/
|
||||
@@ -266,4 +221,4 @@
|
||||
/* 리사이즈 중인 상태를 잡고 싶으면 */
|
||||
.ProseMirror [data-resize-container][data-resize-state="resizing"] {
|
||||
outline: 1px dashed #0ea5e9;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user