From 0f2251b8d0a464c9e8c05c784ed1551ba5675cc6 Mon Sep 17 00:00:00 2001 From: goodmice Date: Wed, 28 Dec 2022 12:19:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D0=B0=20=D0=94=D0=B0=D1=88=D0=B1=D0=BE=D1=80=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=9D=D0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/widgets/BaseWidget.tsx | 6 +++--- src/pages/Well/Telemetry/DashboardNNB/index.jsx | 11 ++++++----- src/styles/include/antd_theme.less | 8 ++++++++ src/styles/widgets/base.less | 4 ++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/components/widgets/BaseWidget.tsx b/src/components/widgets/BaseWidget.tsx index e3463ec..d3fc149 100644 --- a/src/components/widgets/BaseWidget.tsx +++ b/src/components/widgets/BaseWidget.tsx @@ -28,9 +28,9 @@ export const defaultSettings: WidgetSettings = { label: 'Виджет', formatter: defaultFormatter, - labelColor: '#000000', - valueColor: '#000000', - backgroundColor: '#f6f6f6', + labelColor: '#FFFFFF', + valueColor: '#FFFFFF', + backgroundColor: '#2F2F2F', unitColor: '#a0a0a0', } diff --git a/src/pages/Well/Telemetry/DashboardNNB/index.jsx b/src/pages/Well/Telemetry/DashboardNNB/index.jsx index 22ff620..0622f37 100644 --- a/src/pages/Well/Telemetry/DashboardNNB/index.jsx +++ b/src/pages/Well/Telemetry/DashboardNNB/index.jsx @@ -118,15 +118,16 @@ const DashboardNNB = memo(({ enableEditing = false }) => { const navigate = useNavigate() const selectedGroup = getTabname() - if (!selectedGroup && groups?.length > 0) - navigate(`${rootPath}/${groups[0].id}`) - - const group = useMemo(() => ({ editable: true, ...groups.find(({ id }) => `${id}` === selectedGroup), }), [groups, selectedGroup]) + useEffect(() => { + if (!selectedGroup && groups?.length > 0) + navigate(`${rootPath}/${groups[0].id}`) + }, [selectedGroup, groups, rootPath, navigate]) + useEffect(() => { invokeWebApiWrapperAsync( async () => { @@ -249,7 +250,7 @@ const DashboardNNB = memo(({ enableEditing = false }) => { /> ))} setSelectedSettings(null)} settings={selectedSettings} onEdit={onEdit} diff --git a/src/styles/include/antd_theme.less b/src/styles/include/antd_theme.less index 1bfd7a0..6709e69 100644 --- a/src/styles/include/antd_theme.less +++ b/src/styles/include/antd_theme.less @@ -68,3 +68,11 @@ @alert-error-border-color: @error; @alert-error-bg-color: darken(@error, 20%); @alert-error-icon-color: @error; + +.ant-menu-item:active, .ant-menu-submenu-title:active { + background-color: darken(@primary, 10%); +} + +.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected { + background-color: @primary; +} diff --git a/src/styles/widgets/base.less b/src/styles/widgets/base.less index 5a1988d..8038e46 100644 --- a/src/styles/widgets/base.less +++ b/src/styles/widgets/base.less @@ -7,8 +7,8 @@ align-items: stretch; margin: 10px; padding: 5px 10px; - border-radius: 5px; - background: #00000009; + border-radius: 6px; + background: #2F2F2F; height: @size; min-width: @size * 1.75;