From 81f6f84891c7efef9b0ced4c6ee0a39e74294f6d Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 23 Nov 2025 18:37:29 +0800 Subject: [PATCH] fix scenario style --- src/pages/scenario/index.less | 2 - src/pages/scenario/index.tsx | 101 +++++++++++++++++----------------- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/src/pages/scenario/index.less b/src/pages/scenario/index.less index d61f192e..9eba0207 100644 --- a/src/pages/scenario/index.less +++ b/src/pages/scenario/index.less @@ -1,12 +1,10 @@ .scenario-page { background: white; - padding: 16px; border-radius: 2px; } .scenario-toolbar { display: flex; - justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; diff --git a/src/pages/scenario/index.tsx b/src/pages/scenario/index.tsx index 9441aca5..fc9c2248 100644 --- a/src/pages/scenario/index.tsx +++ b/src/pages/scenario/index.tsx @@ -28,11 +28,14 @@ import { Scenario, WorkflowGraph } from './type'; import ScenarioModal from './modal'; import WorkflowEditorModal from './workflowEditorModal'; import './index.less'; +import { useOutletContext } from '@umijs/max'; +import { SharedContext } from '@/layouts'; const { Search } = Input; const { Text } = Typography; const ScenarioPage: React.FC = () => { + const { headerStyle } = useOutletContext(); const [scenarios, setScenarios] = useState([]); const [loading, setLoading] = useState(false); const [searchValue, setSearchValue] = useState(''); @@ -218,9 +221,9 @@ const ScenarioPage: React.FC = () => { title: intl.get('状态'), dataIndex: 'status', key: 'status', - width: 100, + width: 120, render: (status: number) => ( - + {status === 1 ? intl.get('已启用') : intl.get('已禁用')} ), @@ -229,7 +232,7 @@ const ScenarioPage: React.FC = () => { title: intl.get('工作流'), dataIndex: 'workflowGraph', key: 'workflowGraph', - width: 120, + width: 150, render: (graph: WorkflowGraph) => ( {graph?.nodes?.length || 0} {intl.get('节点')} @@ -240,14 +243,14 @@ const ScenarioPage: React.FC = () => { title: intl.get('创建时间'), dataIndex: 'createdAt', key: 'createdAt', - width: 180, + width: 200, render: (date: string) => date ? new Date(date).toLocaleString() : '-', }, { title: intl.get('操作'), key: 'action', - width: 180, + width: 200, render: (_: any, record: Scenario) => ( , + ]} >
-
- + {selectedRowKeys.length > 0 && ( +
- {selectedRowKeys.length > 0 && ( - <> - - - - - )} - - { - setSearchValue(value); - fetchScenarios(value); - }} - allowClear - /> -
+ + +
+ )}