|
@@ -1,6 +1,6 @@
|
|
|
import {useContextSection} from '@hooks';
|
|
|
import {context} from '../context';
|
|
|
-import {TabPaneProps, TabsProps} from 'antd';
|
|
|
+import {Modal, TabPaneProps, TabsProps} from 'antd';
|
|
|
import {ReactNode} from 'react';
|
|
|
import css from './index.module.css';
|
|
|
import {useStore} from 'zustand';
|
|
@@ -22,7 +22,11 @@ export function useTabItems() {
|
|
|
closable: tab.key !== '-1',
|
|
|
animated: true,
|
|
|
children: (
|
|
|
- <iframe src={`http://${host}${tab.url}`} className={css.iframe} />
|
|
|
+ <iframe
|
|
|
+ src={`http://${host}${tab.url}`}
|
|
|
+ className={css.iframe}
|
|
|
+ data-url={tab.url}
|
|
|
+ />
|
|
|
),
|
|
|
};
|
|
|
});
|
|
@@ -34,7 +38,13 @@ export function useTabActive() {
|
|
|
const {key: activeKey, dispatch: setActiveKey} = useStore(tabStore);
|
|
|
|
|
|
function onClear() {
|
|
|
- dispatch({type: 'CLEAR'});
|
|
|
+ Modal.confirm({
|
|
|
+ title: '清除标签页',
|
|
|
+ content: '你确定要关闭所有标签页吗?',
|
|
|
+ onOk() {
|
|
|
+ dispatch({type: 'CLEAR'});
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
const onEdit: TabsProps['onEdit'] = function (target, action) {
|