fix: chat test overflow

This commit is contained in:
archer
2023-07-22 21:56:57 +08:00
parent e49a831cc4
commit f5fad6083a
5 changed files with 89 additions and 83 deletions

View File

@@ -161,6 +161,7 @@ const Settings = ({ appId }: { appId: string }) => {
borderRight={'1.5px solid'}
borderColor={'myGray.200'}
pt={4}
pl={4}
>
<Flex overflowY={'auto'} pr={4} justifyContent={'space-between'}>
<Box fontSize={['md', 'xl']} fontWeight={'bold'}>
@@ -482,8 +483,8 @@ const ChatTest = ({ appId }: { appId: string }) => {
}, [appDetail, resetChatBox]);
return (
<Flex flexDirection={'column'} h={'100%'} pl={4} py={4}>
<Flex>
<Flex flexDirection={'column'} h={'100%'} py={4} overflowX={'auto'}>
<Flex px={[2, 5]}>
<Box fontSize={['md', 'xl']} fontWeight={'bold'} flex={1}>
</Box>

View File

@@ -212,3 +212,5 @@ export const KbParamsModal = ({
</Modal>
);
};
export default KBSelectModal;

View File

@@ -49,7 +49,7 @@ const OverView = ({ appId }: { appId: string }) => {
}, [appDetail, setIsLoading, toast, router]);
// load app data
const { refetch } = useQuery([appId], () => loadAppDetail(appId, true), {
useQuery([appId], () => loadAppDetail(appId, true), {
enabled: false
});
@@ -142,7 +142,7 @@ const OverView = ({ appId }: { appId: string }) => {
</Flex>
</Grid>
<Box flex={'1 0 0'} h={0} mt={4} borderTop={theme.borders.base} px={[3, 5, 8]}>
<Box flex={'1 0 0'} h={0} mt={4} borderTop={theme.borders.base}>
<BasicEdit appId={appId} />
</Box>

View File

@@ -64,10 +64,13 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
);
useEffect(() => {
window.onbeforeunload = (e) => {
e.preventDefault();
e.returnValue = '内容已修改,确认离开页面吗?';
};
window.onbeforeunload =
process.env.NODE_ENV === 'production'
? (e) => {
e.preventDefault();
e.returnValue = '内容已修改,确认离开页面吗?';
}
: null;
return () => {
window.onbeforeunload = null;