feat: Excel batch registration (equipment + employees)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Users } from 'lucide-react';
|
||||
import ExcelUploader from '@/components/ui/ExcelUploader';
|
||||
import { useAuthStore } from '@/stores';
|
||||
|
||||
export default function BatchEmployeesPage() {
|
||||
const router = useRouter();
|
||||
const { user } = useAuthStore();
|
||||
const [checked, setChecked] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (user?.roleCode !== 'ADMIN') {
|
||||
router.push('/403');
|
||||
} else {
|
||||
setChecked(true);
|
||||
}
|
||||
}, [user, router]);
|
||||
|
||||
if (!checked) return null;
|
||||
if (user?.roleCode !== 'ADMIN') return null;
|
||||
|
||||
return (
|
||||
<div className="p-4 sm:p-6 lg:p-8">
|
||||
<div className="max-w-7xl mx-auto">
|
||||
<div className="flex items-center gap-3 mb-6">
|
||||
<Users className="w-6 h-6 text-primary" />
|
||||
<div>
|
||||
<h1 className="font-outfit text-2xl font-semibold text-text-main tracking-tight">직원 일괄 등록</h1>
|
||||
<p className="text-text-muted text-sm">엑셀 파일로 여러 직원 계정을 한 번에 등록합니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ExcelUploader
|
||||
title="직원 일괄 등록"
|
||||
description="템플릿을 다운로드하여 직원 정보를 작성한 후 업로드하세요."
|
||||
templateUrl="/api/v1/employees/batch/template"
|
||||
uploadUrl="/api/v1/employees/batch"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user