fix: delete worker

This commit is contained in:
jialin
2024-07-10 17:14:55 +08:00
parent 0ed7568859
commit 8607815240
14 changed files with 129 additions and 16 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ const CopyButton: React.FC<CopyButtonProps> = ({
>
{copied ? (
<CheckCircleFilled
style={{ color: 'var(--ant-color-primary)', fontSize: '14px' }}
style={{ color: 'var(--ant-color-success)', fontSize: '14px' }}
/>
) : (
<CopyOutlined
+9 -2
View File
@@ -1,3 +1,4 @@
import { isFunction } from 'lodash';
const chartColorMap = {
tickLineColor: 'rgba(217,217,217,0.5)',
axislabelColor: 'rgba(0, 0, 0, 0.4)'
@@ -8,15 +9,18 @@ export const tooltip = {
// axisPointer: {
// type: 'shadow'
// }
formatter(params: any) {
formatter(params: any, callback?: (val: any) => any) {
let result = `<span class="tooltip-x-name">${params[0].axisValue}</span>`;
params.forEach((item: any) => {
let value = isFunction(callback)
? callback?.(item.data.value)
: item.data.value;
result += `<span class="tooltip-item">
<span class="tooltip-item-name">
<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:${item.color};"></span>
<span class="tooltip-title">${item.seriesName}</span>:
</span>
<span class="tooltip-value">${item.data.value}</span>
<span class="tooltip-value">${value}</span>
</span>`;
});
return `<div class="tooltip-wrapper">${result}</div>`;
@@ -55,6 +59,9 @@ export const xAxis = {
export const yAxis = {
// max: 100,
// min: 0,
nameTextStyle: {
padding: [0, 0, 0, -25]
},
splitLine: {
show: true,
lineStyle: {
+10 -2
View File
@@ -17,9 +17,11 @@ const LineChart: React.FC<ChartProps> = (props) => {
const {
seriesData,
xAxisData,
yAxisName,
height,
width,
labelFormatter,
tooltipValueFormatter = null,
legendData = [],
smooth,
title
@@ -34,7 +36,12 @@ const LineChart: React.FC<ChartProps> = (props) => {
},
grid,
tooltip: {
...tooltip
...tooltip,
formatter(params: any) {
return tooltipValueFormatter
? tooltip.formatter(params, tooltipValueFormatter)
: tooltip.formatter(params);
}
},
xAxis: {
...xAxis,
@@ -76,7 +83,8 @@ const LineChart: React.FC<ChartProps> = (props) => {
text: title
},
yAxis: {
...options.yAxis
...options.yAxis,
name: yAxisName
},
xAxis: {
...options.xAxis,
+2
View File
@@ -3,12 +3,14 @@ export interface ChartProps {
xAxisData: string[];
legendData?: string[];
labelFormatter?: (val?: any) => string;
tooltipValueFormatter?: (val?: any) => string;
height: string | number;
width?: string | number;
title?: string;
value?: number;
smooth?: boolean;
color?: string;
yAxisName?: string;
}
export interface AreaChartItemProps {
@@ -170,8 +170,6 @@ const TableRow: React.FC<
useEffect(() => {
if (!firstLoad && expanded) {
createChunkRequest();
} else {
chunkRequestRef.current?.current?.cancel?.();
}
return () => {
chunkRequestRef.current?.current?.cancel?.();
+13 -1
View File
@@ -1,5 +1,7 @@
import { StatusColorMap } from '@/config';
import { StatusType } from '@/config/types';
import { InfoCircleOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd';
import classNames from 'classnames';
import { useEffect, useState } from 'react';
import './index.less';
@@ -16,6 +18,7 @@ type StatusTagProps = {
statusValue: {
status: StatusType;
text: string;
message?: string;
};
download?: {
percent: number;
@@ -56,7 +59,16 @@ const StatusTag: React.FC<StatusTagProps> = ({ statusValue, download }) => {
border: `1px solid ${statusColor?.text}`
}}
>
{renderContent()}
{statusValue.message ? (
<Tooltip title={statusValue.message}>
<span className="m-r-5">
<InfoCircleOutlined />
</span>
{renderContent()}
</Tooltip>
) : (
renderContent()
)}
</span>
);
};