任务视图增加系统视图

This commit is contained in:
whyour
2022-11-26 20:34:07 +08:00
parent 799cda1e3e
commit 1446e925ec
7 changed files with 58 additions and 16 deletions
+3 -7
View File
@@ -857,7 +857,7 @@ const Crontab = () => {
useEffect(() => {
if (viewConf && enabledCronViews && enabledCronViews.length > 0) {
const view = enabledCronViews.slice(2).find((x) => x.id === viewConf.id);
const view = enabledCronViews.slice(4).find((x) => x.id === viewConf.id);
setMoreMenuActive(!!view);
}
}, [viewConf, enabledCronViews]);
@@ -894,7 +894,7 @@ const Crontab = () => {
viewAction(key);
}}
items={[
...[...enabledCronViews].slice(2).map((x) => ({
...[...enabledCronViews].slice(4).map((x) => ({
label: (
<Space style={{ display: 'flex', justifyContent: 'space-between' }}>
<span>{x.name}</span>
@@ -990,11 +990,7 @@ const Crontab = () => {
}
onTabClick={tabClick}
items={[
{
key: 'all',
label: '全部任务',
},
...[...enabledCronViews].slice(0, 2).map((x) => ({
...[...enabledCronViews].slice(0, 4).map((x) => ({
key: x.id,
label: x.name,
})),
+14 -2
View File
@@ -81,6 +81,16 @@ const ViewManageModal = ({
dataIndex: 'name',
key: 'name',
align: 'center' as const,
render: (text) => (
<div style={{ textAlign: 'left', paddingLeft: 30 }}>{text}</div>
),
},
{
title: '类型',
dataIndex: 'type',
key: 'type',
align: 'center' as const,
render: (v) => (v === 1 ? '系统' : '个人'),
},
{
title: '显示',
@@ -100,10 +110,10 @@ const ViewManageModal = ({
{
title: '操作',
key: 'action',
width: 140,
width: 100,
align: 'center' as const,
render: (text: string, record: any, index: number) => {
return (
return record.type !== 1 ? (
<Space size="middle">
<a onClick={() => editView(record, index)}>
<EditOutlined />
@@ -112,6 +122,8 @@ const ViewManageModal = ({
<DeleteOutlined />
</a>
</Space>
) : (
'-'
);
},
},