perf: work order tip (#3874)

This commit is contained in:
Archer
2025-02-24 20:26:15 +08:00
committed by GitHub
parent fb6dbaf2d6
commit 4f0dd96699
9 changed files with 82 additions and 28 deletions

View File

@@ -42,6 +42,8 @@ import AccountContainer from '@/pageComponents/account/AccountContainer';
import { serviceSideProps } from '@fastgpt/web/common/system/nextjs';
import { useRouter } from 'next/router';
import TeamSelector from '@/pageComponents/account/TeamSelector';
import { getWorkorderURL } from '@/web/common/workorder/api';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
const StandDetailModal = dynamic(
() => import('@/pageComponents/account/info/standardDetailModal'),
@@ -580,9 +582,19 @@ const ButtonStyles = {
};
const Other = ({ onOpenContact }: { onOpenContact: () => void }) => {
const { feConfigs } = useSystemStore();
const { teamPlanStatus } = useUserStore();
const { t } = useTranslation();
const { isPc } = useSystem();
const { runAsync: onFeedback } = useRequest2(getWorkorderURL, {
manual: true,
onSuccess(data) {
if (data) {
window.open(data.redirectUrl);
}
}
});
return (
<Box>
<Grid gridGap={4} mt={3}>
@@ -619,6 +631,16 @@ const Other = ({ onOpenContact }: { onOpenContact: () => void }) => {
</Box>
</Flex>
)}
{feConfigs?.show_workorder &&
teamPlanStatus &&
teamPlanStatus.standard?.currentSubLevel !== StandardSubLevelEnum.free && (
<Flex onClick={onFeedback} {...ButtonStyles}>
<MyIcon name={'feedback'} w={'18px'} color={'myGray.600'} />
<Box ml={2} flex={1}>
{t('common:question_feedback')}
</Box>
</Flex>
)}
</Grid>
</Box>
);