|
@@ -4,7 +4,6 @@ import { format } from 'date-fns';
|
|
|
import { Plus, Search, Edit, Trash2, Filter, X } from 'lucide-react';
|
|
import { Plus, Search, Edit, Trash2, Filter, X } from 'lucide-react';
|
|
|
import { userClient, userClientManager } from '../api/userClient';
|
|
import { userClient, userClientManager } from '../api/userClient';
|
|
|
import type { InferRequestType, InferResponseType } from 'hono/client';
|
|
import type { InferRequestType, InferResponseType } from 'hono/client';
|
|
|
-import { z } from 'zod';
|
|
|
|
|
import { Button } from '@d8d/shared-ui-components/components/ui/button';
|
|
import { Button } from '@d8d/shared-ui-components/components/ui/button';
|
|
|
import { Input } from '@d8d/shared-ui-components/components/ui/input';
|
|
import { Input } from '@d8d/shared-ui-components/components/ui/input';
|
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@d8d/shared-ui-components/components/ui/card';
|
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@d8d/shared-ui-components/components/ui/card';
|
|
@@ -17,7 +16,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|
|
import { toast } from 'sonner';
|
|
import { toast } from 'sonner';
|
|
|
import { Skeleton } from '@d8d/shared-ui-components/components/ui/skeleton';
|
|
import { Skeleton } from '@d8d/shared-ui-components/components/ui/skeleton';
|
|
|
import { Switch } from '@d8d/shared-ui-components/components/ui/switch';
|
|
import { Switch } from '@d8d/shared-ui-components/components/ui/switch';
|
|
|
-import { CreateUserDtoMt, UpdateUserDtoMt, RoleSchemaMt } from '@d8d/user-module-mt/schemas';
|
|
|
|
|
|
|
+import { CreateUserDtoMt, UpdateUserDtoMt } from '@d8d/user-module-mt/schemas';
|
|
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@d8d/shared-ui-components/components/ui/select';
|
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@d8d/shared-ui-components/components/ui/select';
|
|
|
import { Popover, PopoverContent, PopoverTrigger } from '@d8d/shared-ui-components/components/ui/popover';
|
|
import { Popover, PopoverContent, PopoverTrigger } from '@d8d/shared-ui-components/components/ui/popover';
|
|
|
import { Calendar } from '@d8d/shared-ui-components/components/ui/calendar';
|
|
import { Calendar } from '@d8d/shared-ui-components/components/ui/calendar';
|
|
@@ -38,10 +37,10 @@ const updateUserFormSchema = UpdateUserDtoMt;
|
|
|
type CreateUserFormData = CreateUserRequest;
|
|
type CreateUserFormData = CreateUserRequest;
|
|
|
type UpdateUserFormData = UpdateUserRequest;
|
|
type UpdateUserFormData = UpdateUserRequest;
|
|
|
// 适配后端返回的字符串日期格式
|
|
// 适配后端返回的字符串日期格式
|
|
|
-type Role = Omit<z.infer<typeof RoleSchemaMt>, 'createdAt' | 'updatedAt'> & {
|
|
|
|
|
- createdAt: string;
|
|
|
|
|
- updatedAt: string;
|
|
|
|
|
-};
|
|
|
|
|
|
|
+// type Role = Omit<z.infer<typeof RoleSchemaMt>, 'createdAt' | 'updatedAt'> & {
|
|
|
|
|
+// createdAt: string;
|
|
|
|
|
+// updatedAt: string;
|
|
|
|
|
+// };
|
|
|
|
|
|
|
|
|
|
|
|
|
export const UserManagement = () => {
|
|
export const UserManagement = () => {
|