mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00
fix: load member list (#2536)
* fix: load member list * fix: extract field type error * fix: workflow runtime error * fix: ts
This commit is contained in:
@@ -26,7 +26,6 @@ import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useUserStore } from '@/web/support/user/useUserStore';
|
||||
import { getTeamMembers } from '@/web/support/user/team/api';
|
||||
import Avatar from '@fastgpt/web/components/common/Avatar';
|
||||
import MySelect from '@fastgpt/web/components/common/MySelect';
|
||||
import { formatNumber } from '@fastgpt/global/common/math/tools';
|
||||
@@ -43,7 +42,7 @@ const UsageTable = () => {
|
||||
});
|
||||
const [usageSource, setUsageSource] = useState<UsageSourceEnum | ''>('');
|
||||
const { isPc } = useSystem();
|
||||
const { userInfo } = useUserStore();
|
||||
const { userInfo, loadAndGetTeamMembers } = useUserStore();
|
||||
const [usageDetail, setUsageDetail] = useState<UsageItemType>();
|
||||
|
||||
const sourceList = useMemo(
|
||||
@@ -64,7 +63,7 @@ const UsageTable = () => {
|
||||
const [selectTmbId, setSelectTmbId] = useState(userInfo?.team?.tmbId);
|
||||
const { data: members = [] } = useQuery(['getMembers', userInfo?.team?.teamId], () => {
|
||||
if (!userInfo?.team?.teamId) return [];
|
||||
return getTeamMembers();
|
||||
return loadAndGetTeamMembers();
|
||||
});
|
||||
const tmbList = useMemo(
|
||||
() =>
|
||||
|
@@ -20,7 +20,7 @@ import FormLabel from '@fastgpt/web/components/common/MyBox/FormLabel';
|
||||
import { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants';
|
||||
|
||||
export const defaultField: ContextExtractAgentItemType = {
|
||||
valueType: 'string',
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
required: false,
|
||||
defaultValue: '',
|
||||
desc: '',
|
||||
|
@@ -198,7 +198,7 @@ const NodeExtract = ({ data }: NodeProps<FlowNodeItemType>) => {
|
||||
id: getNanoid(),
|
||||
key: data.key,
|
||||
label: `${t('common:extraction_results')}-${data.desc}`,
|
||||
valueType: WorkflowIOValueTypeEnum.string,
|
||||
valueType: data.valueType || WorkflowIOValueTypeEnum.string,
|
||||
type: FlowNodeOutputTypeEnum.static
|
||||
};
|
||||
|
||||
@@ -215,7 +215,8 @@ const NodeExtract = ({ data }: NodeProps<FlowNodeItemType>) => {
|
||||
key: data.key,
|
||||
value: {
|
||||
...output,
|
||||
label: `${t('common:extraction_results')}-${data.desc}`
|
||||
valueType: newOutput.valueType,
|
||||
label: newOutput.label
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
@@ -6,7 +6,6 @@ import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
|
||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||
import Avatar from '@fastgpt/web/components/common/Avatar';
|
||||
import PermissionIconText from '@/components/support/permission/IconText';
|
||||
import { useI18n } from '@/web/context/I18n';
|
||||
import EmptyTip from '@fastgpt/web/components/common/EmptyTip';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import MyBox from '@fastgpt/web/components/common/MyBox';
|
||||
@@ -35,19 +34,19 @@ const ConfigPerModal = dynamic(() => import('@/components/support/permission/Con
|
||||
|
||||
import type { EditHttpPluginProps } from './HttpPluginEditModal';
|
||||
import { postCopyApp } from '@/web/core/app/api/app';
|
||||
import { getTeamMembers } from '@/web/support/user/team/api';
|
||||
import { formatTimeToChatTime } from '@fastgpt/global/common/string/time';
|
||||
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
import { useChatStore } from '@/web/core/chat/context/storeChat';
|
||||
import { useUserStore } from '@/web/support/user/useUserStore';
|
||||
const HttpEditModal = dynamic(() => import('./HttpPluginEditModal'));
|
||||
|
||||
const ListItem = () => {
|
||||
const { t } = useTranslation();
|
||||
const { appT, commonT } = useI18n();
|
||||
const router = useRouter();
|
||||
const { parentId = null } = router.query;
|
||||
const { isPc } = useSystem();
|
||||
|
||||
const { loadAndGetTeamMembers } = useUserStore();
|
||||
const { lastChatAppId, setLastChatAppId } = useChatStore();
|
||||
|
||||
const { myApps, loadMyApps, onUpdateApp, setMoveAppId, folderDetail } = useContextSelector(
|
||||
@@ -59,7 +58,6 @@ const ListItem = () => {
|
||||
const [editedApp, setEditedApp] = useState<EditResourceInfoFormType>();
|
||||
const [editHttpPlugin, setEditHttpPlugin] = useState<EditHttpPluginProps>();
|
||||
const [editPerAppIndex, setEditPerAppIndex] = useState<number>();
|
||||
const { feConfigs } = useSystemStore();
|
||||
|
||||
const editPerApp = useMemo(
|
||||
() => (editPerAppIndex !== undefined ? myApps[editPerAppIndex] : undefined),
|
||||
@@ -100,18 +98,18 @@ const ListItem = () => {
|
||||
);
|
||||
|
||||
const { openConfirm: openConfirmCopy, ConfirmModal: ConfirmCopyModal } = useConfirm({
|
||||
content: appT('confirm_copy_app_tip')
|
||||
content: t('app:confirm_copy_app_tip')
|
||||
});
|
||||
const { runAsync: onclickCopy } = useRequest2(postCopyApp, {
|
||||
onSuccess({ appId }) {
|
||||
router.push(`/app/detail?appId=${appId}`);
|
||||
loadMyApps();
|
||||
},
|
||||
successToast: appT('create_copy_success')
|
||||
successToast: t('app:create_copy_success')
|
||||
});
|
||||
|
||||
const { data: members = [] } = useRequest2(getTeamMembers, {
|
||||
manual: !feConfigs.isPlus
|
||||
const { data: members = [] } = useRequest2(loadAndGetTeamMembers, {
|
||||
manual: false
|
||||
});
|
||||
|
||||
const { runAsync: onResumeInheritPermission } = useRequest2(
|
||||
@@ -120,7 +118,7 @@ const ListItem = () => {
|
||||
},
|
||||
{
|
||||
manual: true,
|
||||
errorToast: commonT('permission.Resume InheritPermission Failed'),
|
||||
errorToast: t('common:permission.Resume InheritPermission Failed'),
|
||||
onSuccess() {
|
||||
loadMyApps();
|
||||
}
|
||||
@@ -267,7 +265,7 @@ const ListItem = () => {
|
||||
children: [
|
||||
{
|
||||
icon: 'core/chat/chatLight',
|
||||
label: appT('go_to_chat'),
|
||||
label: t('app:go_to_chat'),
|
||||
onClick: () => {
|
||||
router.push(`/chat?appId=${app._id}`);
|
||||
}
|
||||
@@ -282,7 +280,7 @@ const ListItem = () => {
|
||||
children: [
|
||||
{
|
||||
icon: 'core/chat/chatLight',
|
||||
label: appT('go_to_run'),
|
||||
label: t('app:go_to_run'),
|
||||
onClick: () => {
|
||||
router.push(`/chat?appId=${app._id}`);
|
||||
}
|
||||
@@ -342,7 +340,7 @@ const ListItem = () => {
|
||||
children: [
|
||||
{
|
||||
icon: 'copy',
|
||||
label: appT('copy_one_app'),
|
||||
label: t('app:copy_one_app'),
|
||||
onClick: () =>
|
||||
openConfirmCopy(() => onclickCopy({ appId: app._id }))()
|
||||
}
|
||||
@@ -363,8 +361,8 @@ const ListItem = () => {
|
||||
() => onclickDelApp(app._id),
|
||||
undefined,
|
||||
app.type === AppTypeEnum.folder
|
||||
? appT('confirm_delete_folder_tip')
|
||||
: appT('confirm_del_app_tip')
|
||||
? t('app:confirm_delete_folder_tip')
|
||||
: t('app:confirm_del_app_tip')
|
||||
)()
|
||||
}
|
||||
]
|
||||
|
Reference in New Issue
Block a user