Feat: add agent share team viewer (#6222)

### What problem does this PR solve?
Allow member view agent  
#  Canvas editor

![image](https://github.com/user-attachments/assets/042af36d-5fd1-43e2-acf7-05869220a1c1)
# List agent

![image](https://github.com/user-attachments/assets/8b9c7376-780b-47ff-8f5c-6c0e7358158d)
# Setting 

![image](https://github.com/user-attachments/assets/6cb7d12a-7a66-4dd7-9acc-5b53ff79a10a)
 
_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

---------

Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
so95
2025-03-19 18:04:13 +07:00
committed by GitHub
parent d17ec26c56
commit 344727f9ba
18 changed files with 1665 additions and 1164 deletions

View File

@ -171,6 +171,27 @@ export const useFetchFlow = (): {
return { data, loading, refetch };
};
export const useSettingFlow = () => {
const {
data,
isPending: loading,
mutateAsync,
} = useMutation({
mutationKey: ['SettingFlow'],
mutationFn: async (params: any) => {
const ret = await flowService.settingCanvas(params);
if (ret?.data?.code === 0) {
message.success('success');
} else {
message.error(ret?.data?.data);
}
return ret;
},
});
return { data, loading, settingFlow: mutateAsync };
};
export const useFetchFlowSSE = (): {
data: IFlow;
loading: boolean;
@ -244,7 +265,9 @@ export const useDeleteFlow = () => {
mutationFn: async (canvasIds: string[]) => {
const { data } = await flowService.removeCanvas({ canvasIds });
if (data.code === 0) {
queryClient.invalidateQueries({ queryKey: ['fetchFlowList'] });
queryClient.invalidateQueries({
queryKey: ['infiniteFetchFlowListTeam'],
});
}
return data?.data ?? [];
},