feat: 用户管理新增批量创建用户(逐行解析、失败跳过并汇总展示)
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { Plus } from "lucide-react";
|
||||
import { ListPlus, Plus } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DataTable } from "@/components/data-table";
|
||||
import { useFetchList } from "./-hooks/useFetchList";
|
||||
import { useState } from "react";
|
||||
import { EditUserDialog } from "./-components/EditUserDialog";
|
||||
import { BatchCreateUserDialog } from "./-components/BatchCreateUserDialog";
|
||||
import { CancelUserConfirmDialog } from "./-components/CancelUserConfirmDialog";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Pagination } from "@/components/pagination";
|
||||
@@ -133,6 +134,10 @@ export function useColumns({
|
||||
function RouteComponent() {
|
||||
const [currentEntity, setCurrentEntity] = useState<any>(null);
|
||||
|
||||
// 批量创建用户
|
||||
const [openBatchCreateUserDialog, setOpenBatchCreateUserDialog] =
|
||||
useState(false);
|
||||
|
||||
// 修改用户
|
||||
const [openEditUserDialog, setOpenEditUserDialog] = useState(false);
|
||||
const handleEditUser = (record?: any) => {
|
||||
@@ -179,6 +184,11 @@ function RouteComponent() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<BatchCreateUserDialog
|
||||
open={openBatchCreateUserDialog}
|
||||
setOpen={setOpenBatchCreateUserDialog}
|
||||
refetch={query?.refetch}
|
||||
/>
|
||||
<EditUserDialog
|
||||
open={openEditUserDialog}
|
||||
setOpen={setOpenEditUserDialog}
|
||||
@@ -207,6 +217,13 @@ function RouteComponent() {
|
||||
<Plus />
|
||||
新增
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => setOpenBatchCreateUserDialog(true)}
|
||||
>
|
||||
<ListPlus />
|
||||
批量创建
|
||||
</Button>
|
||||
</div>
|
||||
<div className="relative overflow-hidden">
|
||||
<DataTable table={table} query={query} />
|
||||
|
||||
Reference in New Issue
Block a user