fix: block body scroll when view version
This commit is contained in:
@@ -1,13 +1,7 @@
|
|||||||
import { INPUT_WIDTH } from '@/constants';
|
import { INPUT_WIDTH } from '@/constants';
|
||||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
import { Form, InputNumber, Slider, type SliderSingleProps } from 'antd';
|
||||||
import {
|
|
||||||
Form,
|
|
||||||
InputNumber,
|
|
||||||
Slider,
|
|
||||||
Tooltip,
|
|
||||||
type SliderSingleProps
|
|
||||||
} from 'antd';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import LabelInfo from './components/label-info';
|
||||||
import FieldWrapper from './field-wrapper';
|
import FieldWrapper from './field-wrapper';
|
||||||
import SliderStyles from './styles/slider.less';
|
import SliderStyles from './styles/slider.less';
|
||||||
|
|
||||||
@@ -61,16 +55,7 @@ const SealSlider: React.FC<SealSliderProps> = (props) => {
|
|||||||
style={{ width: labelWidth || INPUT_WIDTH.mini }}
|
style={{ width: labelWidth || INPUT_WIDTH.mini }}
|
||||||
>
|
>
|
||||||
<span className="text">
|
<span className="text">
|
||||||
{description ? (
|
<LabelInfo label={label} description={description}></LabelInfo>
|
||||||
<Tooltip title={description}>
|
|
||||||
<span> {label}</span>
|
|
||||||
<span className="m-l-5">
|
|
||||||
<InfoCircleOutlined />
|
|
||||||
</span>
|
|
||||||
</Tooltip>
|
|
||||||
) : (
|
|
||||||
<span>{label}</span>
|
|
||||||
)}
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{inputnumber ? (
|
{inputnumber ? (
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import ShortCuts, {
|
|||||||
} from '@/components/short-cuts';
|
} from '@/components/short-cuts';
|
||||||
import VersionInfo, { modalConfig } from '@/components/version-info';
|
import VersionInfo, { modalConfig } from '@/components/version-info';
|
||||||
import routeCachekey from '@/config/route-cachekey';
|
import routeCachekey from '@/config/route-cachekey';
|
||||||
|
import useBodyScroll from '@/hooks/use-body-scroll';
|
||||||
import useOverlayScroller from '@/hooks/use-overlay-scroller';
|
import useOverlayScroller from '@/hooks/use-overlay-scroller';
|
||||||
import { logout } from '@/pages/login/apis';
|
import { logout } from '@/pages/login/apis';
|
||||||
import { useAccessMarkedRoutes } from '@@/plugin-access';
|
import { useAccessMarkedRoutes } from '@@/plugin-access';
|
||||||
@@ -97,6 +98,7 @@ export default (props: any) => {
|
|||||||
const { initialize: initialize } = useOverlayScroller({
|
const { initialize: initialize } = useOverlayScroller({
|
||||||
defer: false
|
defer: false
|
||||||
});
|
});
|
||||||
|
const { saveScrollHeight, restoreScrollHeight } = useBodyScroll();
|
||||||
const { initialize: initializeMenu } = useOverlayScroller();
|
const { initialize: initializeMenu } = useOverlayScroller();
|
||||||
const [userInfo] = useAtom(userAtom);
|
const [userInfo] = useAtom(userAtom);
|
||||||
const [routeCache] = useAtom(routeCacheAtom);
|
const [routeCache] = useAtom(routeCacheAtom);
|
||||||
@@ -127,10 +129,12 @@ export default (props: any) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const showVersion = () => {
|
const showVersion = () => {
|
||||||
|
saveScrollHeight();
|
||||||
Modal.info({
|
Modal.info({
|
||||||
...modalConfig,
|
...modalConfig,
|
||||||
width: 460,
|
width: 460,
|
||||||
content: <VersionInfo intl={intl} />
|
content: <VersionInfo intl={intl} />,
|
||||||
|
onCancel: restoreScrollHeight
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user