- {orgs
- .filter((org) => org.path === currentPath.path)
- .map((org) => (
-
-
- setCurrentOrg(org)}>
-
- {org.members.length}
-
-
- |
+ {orgList.map((org) => (
+
+
+ setCurrentOrg(org)}>
+
+ {org.count}
+
+
+ |
-
-
+ |
+
+ }
+ menuList={[
+ {
+ children: [
+ {
+ icon: 'edit',
+ label: t('account_team:edit_info'),
+ onClick: () => setEditOrg(org)
+ },
+ {
+ icon: 'common/file/move',
+ label: t('common:Move'),
+ onClick: () => setMovingOrg(org)
+ },
+ {
+ icon: 'delete',
+ label: t('account_team:delete'),
+ type: 'danger',
+ onClick: () => deleteOrgHandler(org._id)
+ }
+ ]
}
- menuList={[
- {
- children: [
- {
- icon: 'edit',
- label: t('account_team:edit_info'),
- onClick: () => {
- setEditOrg(org);
- }
- },
- {
- icon: 'common/file/move',
- label: t('common:Move'),
- onClick: () => {
- // TODO
- console.log(org._id);
- }
- },
- {
- icon: 'delete',
- label: t('account_team:delete'),
- type: 'danger',
- onClick: () => deleteOrgHandler(org._id)
- }
- ]
- }
- ]}
- />
- |
-
- ))}
+ ]}
+ />
+
+
+ ))}
{currentOrg?.members.map((member) => {
const memberInfo = members.find((m) => m.tmbId === member.tmbId);
if (!memberInfo) return null;
@@ -215,43 +240,46 @@ function MemberTable() {
-
- }
- menuList={[
- {
- children: [
- {
- icon: 'edit',
- label: t('account_team:remark'),
- onClick: () => {
- // TODO
- console.log(member.tmbId);
- }
- },
- {
- icon: 'common/file/move',
- label: t('common:Move'),
- onClick: () => {
- // TODO
- console.log(member.tmbId);
- }
- },
- {
- icon: 'delete',
- label: t('account_team:delete'),
- type: 'danger',
- onClick: () => {
- // TODO
- console.log(member.tmbId);
- }
- }
- ]
+ {member.role !== 'owner' && (
+
}
- ]}
- />
+ menuList={[
+ {
+ children: [
+ // {
+ // icon: 'edit',
+ // label: t('account_team:remark'),
+ // onClick: () => {
+ // // TODO
+ // console.log(member.tmbId);
+ // }
+ // },
+ {
+ icon: 'common/file/move',
+ label: t('common:Move'),
+ onClick: () =>
+ setMovingTmb({ tmbId: member.tmbId, orgId: currentOrg!._id })
+ },
+ {
+ icon: 'delete',
+ label: t('account_team:delete'),
+ type: 'danger',
+ onClick: () => deleteMemberHandler(currentOrg!._id, member.tmbId)
+ }
+ ]
+ }
+ ]}
+ />
+ )}
|
);
@@ -299,20 +327,14 @@ function MemberTable() {
{
- // TODO
- console.log('manage member');
- }}
+ onClick={() => setEditMemberOrgId(currentOrg?._id)}
/>
{currentOrg?.path !== '' && (
<>
{
- // TODO
- console.log('move org');
- }}
+ onClick={() => setMovingOrg(currentOrg)}
/>
-
+ {
+ setMovingOrg(undefined);
+ setMovingTmb(undefined);
+ }}
+ onSuccess={() => {
+ refetchOrgs();
+ refetchMembers();
+ }}
+ />
+ setEditMemberOrgId(undefined)} />
+
);
}
diff --git a/projects/app/src/web/support/user/team/org/api.ts b/projects/app/src/web/support/user/team/org/api.ts
index 1c0cc79b57b4..a8b2fbc74327 100644
--- a/projects/app/src/web/support/user/team/org/api.ts
+++ b/projects/app/src/web/support/user/team/org/api.ts
@@ -1,11 +1,10 @@
import { DELETE, GET, POST, PUT } from '@/web/common/api/request';
-import { OrgType } from '@fastgpt/global/support/user/team/org/type';
-import {
+import type {
postCreateOrgData,
putUpdateOrgData,
- putUpdateOrgMembersData,
- putChnageOrgOwnerData
+ putUpdateOrgMembersData
} from '@fastgpt/global/support/user/team/org/api';
+import type { OrgType } from '@fastgpt/global/support/user/team/org/type';
export const getOrgList = () => GET('/proApi/support/user/team/org/list');
@@ -15,14 +14,20 @@ export const postCreateOrg = (data: postCreateOrgData) =>
export const deleteOrg = (orgId: string) =>
DELETE('/proApi/support/user/team/org/delete', { orgId });
+export const deleteOrgMember = (orgId: string, tmbId: string) =>
+ DELETE('/proApi/support/user/team/org/deleteMember', { orgId, tmbId });
+
export const putMoveOrg = (orgId: string, parentId: string) =>
PUT('/proApi/support/user/team/org/move', { orgId, parentId });
+export const putMoveOrgMember = (orgId: string, tmbId: string, newOrgId: string) =>
+ PUT('/proApi/support/user/team/org/moveMember', { orgId, tmbId, newOrgId });
+
export const putUpdateOrg = (data: putUpdateOrgData) =>
PUT('/proApi/support/user/team/org/update', data);
export const putUpdateOrgMembers = (data: putUpdateOrgMembersData) =>
PUT('/proApi/support/user/team/org/updateMembers', data);
-export const putChnageOrgOwner = (data: putChnageOrgOwnerData) =>
- PUT('/proApi/support/user/team/org/changeOwner', data);
+// export const putChnageOrgOwner = (data: putChnageOrgOwnerData) =>
+// PUT('/proApi/support/user/team/org/changeOwner', data);