mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 15:43:24 +08:00
定时任务视图tab高亮
This commit is contained in:
parent
e5d8adf955
commit
4e389865b5
|
@ -124,6 +124,26 @@
|
||||||
width: 50px;
|
width: 50px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: #1890ff;
|
||||||
|
|
||||||
|
.ant-tabs-ink-bar {
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.more-active {
|
||||||
|
.ant-tabs-nav-list {
|
||||||
|
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
|
||||||
|
color: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-tabs-ink-bar {
|
||||||
|
width: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import {
|
||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
UnorderedListOutlined,
|
UnorderedListOutlined,
|
||||||
|
CheckOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import config from '@/utils/config';
|
import config from '@/utils/config';
|
||||||
import { PageContainer } from '@ant-design/pro-layout';
|
import { PageContainer } from '@ant-design/pro-layout';
|
||||||
|
@ -370,6 +371,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
useState(false);
|
useState(false);
|
||||||
const [cronViews, setCronViews] = useState<any[]>([]);
|
const [cronViews, setCronViews] = useState<any[]>([]);
|
||||||
const [enabledCronViews, setEnabledCronViews] = useState<any[]>([]);
|
const [enabledCronViews, setEnabledCronViews] = useState<any[]>([]);
|
||||||
|
const [moreMenuActive, setMoreMenuActive] = useState(false);
|
||||||
|
|
||||||
const goToScriptManager = (record: any) => {
|
const goToScriptManager = (record: any) => {
|
||||||
const cmd = record.command.split(' ') as string[];
|
const cmd = record.command.split(' ') as string[];
|
||||||
|
@ -836,6 +838,10 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
if (pageConf.page && pageConf.size) {
|
if (pageConf.page && pageConf.size) {
|
||||||
getCrons();
|
getCrons();
|
||||||
}
|
}
|
||||||
|
if (viewConf) {
|
||||||
|
const view = enabledCronViews.slice(2).find((x) => x.id === viewConf.id);
|
||||||
|
setMoreMenuActive(!!view);
|
||||||
|
}
|
||||||
}, [pageConf, viewConf]);
|
}, [pageConf, viewConf]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -965,7 +971,14 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
}}
|
}}
|
||||||
items={[
|
items={[
|
||||||
...[...enabledCronViews].slice(2).map((x) => ({
|
...[...enabledCronViews].slice(2).map((x) => ({
|
||||||
label: x.name,
|
label: (
|
||||||
|
<Space style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
|
<span>{x.name}</span>
|
||||||
|
{viewConf?.id === x.id && (
|
||||||
|
<CheckOutlined style={{ color: '#1890ff' }} />
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
key: x.id,
|
key: x.id,
|
||||||
icon: <UnorderedListOutlined />,
|
icon: <UnorderedListOutlined />,
|
||||||
})),
|
})),
|
||||||
|
@ -1031,14 +1044,14 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => {
|
||||||
defaultActiveKey="all"
|
defaultActiveKey="all"
|
||||||
size="small"
|
size="small"
|
||||||
tabPosition="top"
|
tabPosition="top"
|
||||||
className="crontab-view"
|
className={`crontab-view ${moreMenuActive ? 'more-active' : ''}`}
|
||||||
tabBarExtraContent={
|
tabBarExtraContent={
|
||||||
<Dropdown
|
<Dropdown
|
||||||
overlay={menu}
|
overlay={menu}
|
||||||
trigger={['click']}
|
trigger={['click']}
|
||||||
overlayStyle={{ minWidth: 200 }}
|
overlayStyle={{ minWidth: 200 }}
|
||||||
>
|
>
|
||||||
<div className="view-more">
|
<div className={`view-more ${moreMenuActive ? 'active' : ''}`}>
|
||||||
<Space>
|
<Space>
|
||||||
更多
|
更多
|
||||||
<DownOutlined />
|
<DownOutlined />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user