260115_02_ENH : 로그인 오류 수정 및 템플릿 생성 연동 완료

This commit is contained in:
2026-01-15 11:36:01 +09:00
parent 7e7b494389
commit 431513c195
34 changed files with 823 additions and 103 deletions

View File

@@ -0,0 +1,53 @@
import {ProjectInfo} from "@/types/project";
import {ColumnDef} from "@tanstack/react-table";
import {Badge} from "@/components/ui/badge";
import {cn, formatKst} from "@/lib/utils";
import {PROJECT_STATUS_CLASS, PROJECT_STATUS_LABEL} from "@/const/projectConst";
import {ItrntUserInfo} from "@/types/user";
export const getProjectColumns = (users:ItrntUserInfo[]): ColumnDef<ProjectInfo>[] => [
{
accessorKey: "prjctIdx",
header: "No",
enableSorting: true,
},
{
accessorKey: "prjctCd",
header: "프로젝트 코드",
enableSorting: true,
},
{
accessorKey: "prjctName",
header: "프로젝트 명",
enableSorting: true,
},
{
accessorKey: "prjctStatus",
header: "진행 상태",
cell: ({row}) => (
<Badge className={cn("w-15 h-7 my-1.5", PROJECT_STATUS_CLASS[row.original.prjctStatus])}>
{PROJECT_STATUS_LABEL[row.original.prjctStatus]}
</Badge>
) ,
enableSorting: true,
},
{
accessorKey: "ownerDept",
header: "담당 그룹",
enableSorting: true,
},
{
accessorKey: "ownerFw",
header: "담당 실사",
enableSorting: true,
cell: ({row}) => (
users.find(u => u.userId === row.original.ownerFw)?.userNm ?? ""
) ,
},
{
accessorKey: "regDt",
header: "등록일",
cell: ({row}) => (formatKst(row.original.regDt ?? "", "date")),
enableSorting: true,
}
];

View File

@@ -0,0 +1,80 @@
import {ColumnDef} from "@tanstack/react-table";
import {Button} from "@/components/ui/button";
import {Pencil, Trash2} from "lucide-react";
import {UserInfo} from "@/types/user";
import {formatKst} from "@/lib/utils";
import {MultiSelectOption} from "@/components/ui/multi-select";
export type UserColumnsActions = {
onEdit: (userId: string) => void
onDelete: (userId: string) => void
}
export const getUserColumns = (actions: UserColumnsActions, userRoleArray:MultiSelectOption[]): ColumnDef<UserInfo>[] => [
{
accessorKey: "userId",
header: "아이디",
enableSorting: true,
},
{
accessorKey: "userCmpn",
header: "소속",
enableSorting: true,
},
{
accessorKey: "userName",
header: "이름",
enableSorting: true,
},
{
accessorKey: "userRole",
header: "권한",
cell: ({row}) => {
const role = userRoleArray.filter((r) => r.value === String(row.original.userRole));
return role.length > 0 ? role[0].label : String(row.original.userRole);
},
enableSorting: true,
},
{
accessorKey: "regDt",
header: "등록일",
cell: ({row}) => (formatKst(row.original.regDt ?? "", "date")),
enableSorting: true,
},
{
accessorKey: "memo",
header: "메모",
enableSorting: false,
},
{
id: "actions",
header: "관리",
cell: ({ row }) => (
<div
className="flex items-center justify-center gap-2"
onClick={(e) => e.stopPropagation()}
onPointerDown={(e) => e.stopPropagation()}
>
<Button
variant="ghost"
size="icon"
onClick={() => actions.onEdit(row.original.userId)}
aria-label="수정"
>
<Pencil className="w-4 h-4" />
</Button>
<Button
variant="ghost"
size="icon"
onClick={() => actions.onDelete(row.original.userId)}
aria-label="삭제"
>
<Trash2 className="w-4 h-4 text-destructive" />
</Button>
</div>
),
enableSorting: false,
},
];