feat: 机构账号页新增重置密码;弹窗组件兼容 userId/id 行结构;代理切回公司地址
This commit is contained in:
@@ -16,6 +16,7 @@ import { Pagination } from "@/components/pagination";
|
||||
import { useFetchList } from "./-hooks/useFetchList";
|
||||
import { useUserStatusActions } from "@/hooks/use-user-status-actions";
|
||||
import { UserActionConfirmDialog } from "./-components/UserActionConfirmDialog";
|
||||
import { ResetUserPasswordDialog } from "@/components/reset-user-password-dialog";
|
||||
import { useUserStore } from "@/stores/user";
|
||||
import { DateRangePicker } from "@/components/date-range-picker";
|
||||
|
||||
@@ -38,6 +39,7 @@ export function useColumns({
|
||||
handleEnable,
|
||||
handleDisable,
|
||||
handleCancelUser,
|
||||
handleResetPassword,
|
||||
}: any) {
|
||||
const currentUserId = useUserStore((state: any) => state.user?.id);
|
||||
return [
|
||||
@@ -131,6 +133,13 @@ export function useColumns({
|
||||
}
|
||||
return (
|
||||
<div className="space-x-2">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={() => handleResetPassword(record)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
{record.enabled ? (
|
||||
<Button
|
||||
size="sm"
|
||||
@@ -189,11 +198,20 @@ function RouteComponent() {
|
||||
setOpenConfirmDialog(true);
|
||||
};
|
||||
|
||||
// 重置密码
|
||||
const [openResetPasswordDialog, setOpenResetPasswordDialog] =
|
||||
useState(false);
|
||||
const handleResetPassword = (record: any) => {
|
||||
setCurrentEntity(record);
|
||||
setOpenResetPasswordDialog(true);
|
||||
};
|
||||
|
||||
const { table, query, search } = useFetchList(() =>
|
||||
useColumns({
|
||||
handleEnable,
|
||||
handleDisable,
|
||||
handleCancelUser,
|
||||
handleResetPassword,
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -229,6 +247,11 @@ function RouteComponent() {
|
||||
data={currentEntity}
|
||||
refetch={query?.refetch}
|
||||
/>
|
||||
<ResetUserPasswordDialog
|
||||
open={openResetPasswordDialog}
|
||||
setOpen={setOpenResetPasswordDialog}
|
||||
data={currentEntity}
|
||||
/>
|
||||
<div className="p-4 box-border min-h-full space-y-4">
|
||||
<div>
|
||||
<div className="text-lg">机构账号</div>
|
||||
|
||||
Reference in New Issue
Block a user