style: ajust dark theme

This commit is contained in:
jialin
2025-04-28 10:05:06 +08:00
parent 60d0750695
commit 3fb3381a19
26 changed files with 275 additions and 222 deletions
+3 -3
View File
@@ -29,8 +29,8 @@
}
&.success {
border: 1px solid var(--color-progress-green);
color: var(--color-progress-green);
border: 1px solid var(--ant-color-success);
color: var(--ant-color-success);
background: var(--ant-color-success-bg);
.content.success {
@@ -61,7 +61,7 @@
}
&.success {
color: var(--color-progress-green);
color: var(--ant-color-success);
}
}
+36 -28
View File
@@ -25,34 +25,31 @@ const BarChart: React.FC<ChartProps> = (props) => {
yAxis
} = useChartConfig();
const options = {
title: {
text: ''
},
grid,
tooltip: {
...tooltip
// axisPointer: {
// type: 'shadow'
// }
},
xAxis: {
...xAxis,
axisLabel: {
...xAxis.axisLabel,
formatter: labelFormatter
},
data: []
},
yAxis,
legend: {
...legend,
data: []
},
series: []
};
const dataOptions = useMemo((): any => {
const options = {
title: {
text: ''
},
grid,
tooltip: {
...tooltip
},
xAxis: {
...xAxis,
axisLabel: {
...xAxis.axisLabel,
formatter: labelFormatter
},
data: []
},
yAxis,
legend: {
...legend,
data: []
},
series: []
};
const data = _.map(seriesData, (item: any) => {
return {
...item,
@@ -79,7 +76,18 @@ const BarChart: React.FC<ChartProps> = (props) => {
},
series: data
};
}, [seriesData, xAxisData, title]);
}, [
seriesData,
xAxisData,
title,
labelFormatter,
tooltip,
grid,
xAxis,
yAxis,
legend,
barItemConfig
]);
return (
<>
+4 -5
View File
@@ -29,8 +29,7 @@ export const grid = {
export default function useChartConfig() {
const { userSettings, isDarkTheme } = useUserSettings();
const { useToken } = theme;
const { token, hashId } = useToken();
console.log('token+++++++++++++++', token, hashId);
const { token } = useToken();
const chartColorMap = useMemo(() => {
return {
@@ -39,13 +38,13 @@ export default function useChartConfig() {
tickLineColor: token.colorSplit,
axislabelColor: token.colorTextTertiary,
gaugeSplitLineColor: 'rgba(255, 255, 255, 0.38)',
colorBgBase: token.colorBgBase
colorBgContainerHover: isDarkTheme ? '#424242' : '#fff'
};
}, [userSettings.theme]);
}, [userSettings.theme, isDarkTheme]);
const tooltip = {
trigger: 'axis',
backgroundColor: chartColorMap.colorBgBase,
backgroundColor: chartColorMap.colorBgContainerHover,
borderColor: 'transparent',
formatter(params: any, callback?: (val: any) => any) {
let result = `<span class="tooltip-x-name">${params[0].axisValue}</span>`;
+35 -26
View File
@@ -24,32 +24,31 @@ const BarChart: React.FC<ChartProps> = (props) => {
yAxis
} = useChartConfig();
const options = {
title: {
...titleConfig,
left: 'start'
},
grid,
tooltip: {
...tooltip
},
xAxis: {
...xAxis,
axisLabel: {
...xAxis.axisLabel,
formatter: labelFormatter
}
},
yAxis,
legend: {
...legend,
data: []
},
series: []
};
const dataOptions = useMemo((): any => {
const options = {
title: {
...titleConfig,
left: 'start'
},
grid,
tooltip: {
...tooltip
},
xAxis: {
...xAxis,
axisLabel: {
...xAxis.axisLabel,
formatter: labelFormatter
}
},
yAxis,
legend: {
...legend,
data: []
},
series: []
};
const data = _.map(seriesData, (item: any) => {
return {
...item,
@@ -103,7 +102,17 @@ const BarChart: React.FC<ChartProps> = (props) => {
},
series: data
};
}, [seriesData, xAxisData, title]);
}, [
seriesData,
xAxisData,
title,
labelFormatter,
tooltip,
grid,
xAxis,
yAxis,
legend
]);
return (
<>
+1 -1
View File
@@ -2,7 +2,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
// import './iconfont/iconfont.js';
const IconFont = createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/c/font_4613488_uw2djf1vxgf.js'
scriptUrl: '//at.alicdn.com/t/c/font_4613488_dy3zc0nrfgk.js'
});
export default IconFont;
+2 -2
View File
@@ -1,5 +1,5 @@
import { Progress, Tooltip } from 'antd';
import { memo, useMemo } from 'react';
import React, { memo, useMemo } from 'react';
const RenderProgress = memo(
(props: {
@@ -19,7 +19,7 @@ const RenderProgress = memo(
}
if (percent <= 50) {
return 'var(--color-progress-green)';
return 'var(--ant-color-success)';
}
if (percent <= 80) {
return 'var(--ant-color-warning)';
@@ -6,6 +6,9 @@ const SliderWrapper = styled.div`
height: 100%;
justify-content: center;
}
.borderless {
background-color: transparent;
}
padding-block: 0;
padding-inline: 2px;
input.ant-input-number-input {
+1 -1
View File
@@ -41,7 +41,7 @@
position: relative;
z-index: 10;
// color: var(--ant-color-text);
color: var(--color-progress-green);
color: var(--ant-color-success);
}
}