@tsingroc/tsingroc-components 5.0.2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/components/BarLineChart/BarLineChart.module.css +10 -0
  2. package/dist/components/BarLineChart/index.d.ts +66 -0
  3. package/dist/components/BarLineChart/index.js +590 -0
  4. package/dist/components/BaseBarChart/BaseBarChart.module.css +12 -0
  5. package/dist/components/BaseBarChart/index.d.ts +33 -0
  6. package/dist/components/BaseBarChart/index.js +121 -0
  7. package/dist/components/DataCellNumber/DataCellNumber.module.css +20 -0
  8. package/dist/components/DataCellNumber/index.d.ts +14 -0
  9. package/dist/components/DataCellNumber/index.js +142 -0
  10. package/dist/components/FlexColLayout/index.d.ts +6 -0
  11. package/dist/components/FlexColLayout/index.js +40 -0
  12. package/dist/components/FlexRowLayout/index.d.ts +5 -0
  13. package/dist/components/FlexRowLayout/index.js +45 -0
  14. package/dist/components/HighlightSyncedECharts/index.d.ts +47 -0
  15. package/dist/components/HighlightSyncedECharts/index.js +260 -0
  16. package/dist/components/HighlightSyncedTable/index.d.ts +8 -0
  17. package/dist/components/HighlightSyncedTable/index.js +183 -0
  18. package/dist/components/LoadingSection/index.d.ts +41 -0
  19. package/dist/components/LoadingSection/index.js +183 -0
  20. package/dist/components/LoadingSkeleton/index.d.ts +42 -0
  21. package/dist/components/LoadingSkeleton/index.js +634 -0
  22. package/dist/components/ScrollableTable/ScrollableTable.module.css +21 -0
  23. package/dist/components/ScrollableTable/index.d.ts +13 -0
  24. package/dist/components/ScrollableTable/index.js +29 -0
  25. package/dist/components/TsingrocTable/TsingrocTable.module.css +32 -0
  26. package/dist/components/TsingrocTable/index.d.ts +12 -0
  27. package/dist/components/TsingrocTable/index.js +23 -0
  28. package/dist/components/TsingrocTheme/index.js +3 -3
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.js +4 -0
  31. package/dist/pages/DayAheadReviewPage/components/PricePlot/index.d.ts +7 -0
  32. package/dist/pages/DayAheadReviewPage/components/PricePlot/index.js +136 -0
  33. package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/ProfitBarChart.module.css +13 -0
  34. package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/index.d.ts +17 -0
  35. package/dist/pages/DayAheadReviewPage/components/ProfitBarChart/index.js +278 -0
  36. package/dist/pages/DayAheadReviewPage/components/RevenueCard/RevenueCard.module.css +40 -0
  37. package/dist/pages/DayAheadReviewPage/components/RevenueCard/index.d.ts +9 -0
  38. package/dist/pages/DayAheadReviewPage/components/RevenueCard/index.js +195 -0
  39. package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/RevenueSummaryCard.module.css +38 -0
  40. package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/index.d.ts +10 -0
  41. package/dist/pages/DayAheadReviewPage/components/RevenueSummaryCard/index.js +117 -0
  42. package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/ReviewLineChart.module.css +11 -0
  43. package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/index.d.ts +53 -0
  44. package/dist/pages/DayAheadReviewPage/components/ReviewLineChart/index.js +398 -0
  45. package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/ReviewSummaryTable.module.css +33 -0
  46. package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/index.d.ts +17 -0
  47. package/dist/pages/DayAheadReviewPage/components/ReviewSummaryTable/index.js +187 -0
  48. package/dist/pages/DayAheadReviewPage/components/StrategyPlot/index.d.ts +10 -0
  49. package/dist/pages/DayAheadReviewPage/components/StrategyPlot/index.js +223 -0
  50. package/dist/pages/DayAheadReviewPage/components/SummaryTable/index.d.ts +7 -0
  51. package/dist/pages/DayAheadReviewPage/components/SummaryTable/index.js +39 -0
  52. package/dist/pages/DayAheadReviewPage/components/SummaryTable/useTableColumns.d.ts +10 -0
  53. package/dist/pages/DayAheadReviewPage/components/SummaryTable/useTableColumns.js +307 -0
  54. package/dist/pages/DayAheadReviewPage/hook/useDayAheadReviewDate.d.ts +137 -0
  55. package/dist/pages/DayAheadReviewPage/hook/useDayAheadReviewDate.js +252 -0
  56. package/dist/pages/DayAheadReviewPage/index.d.ts +149 -0
  57. package/dist/pages/DayAheadReviewPage/index.js +259 -0
  58. package/dist/pages/DayAheadReviewPage/layout/LeftChartContainer.d.ts +12 -0
  59. package/dist/pages/DayAheadReviewPage/layout/LeftChartContainer.js +236 -0
  60. package/dist/pages/DayAheadReviewPage/layout/ReviewPageLayout.d.ts +4 -0
  61. package/dist/pages/DayAheadReviewPage/layout/ReviewPageLayout.js +32 -0
  62. package/dist/pages/DayAheadReviewPage/layout/RightSummaryContainer.d.ts +14 -0
  63. package/dist/pages/DayAheadReviewPage/layout/RightSummaryContainer.js +199 -0
  64. package/dist/pages/DayAheadReviewPage/layout/TopDayReviewHeader.d.ts +9 -0
  65. package/dist/pages/DayAheadReviewPage/layout/TopDayReviewHeader.js +115 -0
  66. package/dist/pages/DayAheadReviewPage/types/dayahead.d.ts +172 -0
  67. package/dist/pages/DayAheadReviewPage/types/dayahead.js +1 -0
  68. package/dist/utils/accessibility.d.ts +114 -0
  69. package/dist/utils/accessibility.js +214 -0
  70. package/dist/utils/constants.d.ts +18 -0
  71. package/dist/utils/constants.js +34 -0
  72. package/dist/utils/export.d.ts +10 -0
  73. package/dist/utils/export.js +72 -0
  74. package/dist/utils/formatters.d.ts +46 -0
  75. package/dist/utils/formatters.js +84 -0
  76. package/dist/utils/index.d.ts +1 -0
  77. package/dist/utils/index.js +1 -0
  78. package/dist/utils/presenters.d.ts +24 -0
  79. package/dist/utils/presenters.js +48 -0
  80. package/dist/utils/ui.d.ts +116 -0
  81. package/dist/utils/ui.js +171 -0
  82. package/package.json +27 -25
@@ -0,0 +1,32 @@
1
+ @layer tsingroc-components {
2
+ .root {
3
+ table {
4
+ border-collapse: separate;
5
+ border-spacing: 8px 4px;
6
+ /* 消除外部多余的空白 */
7
+ margin: -4px -8px;
8
+ width: calc(100% + 16px);
9
+ }
10
+
11
+ /* 对于可滚动的表格,若宽度过大会导致不必要的横向滚动 */
12
+ :global(.ant-table-body) table {
13
+ width: calc(100% + 8px);
14
+ }
15
+
16
+ th {
17
+ border-radius: 6px;
18
+ background-color: var(--ant-color-bg-layout);
19
+ font-weight: normal;
20
+ }
21
+
22
+ :global(.ant-table-cell-row-hover) {
23
+ background-color: color-mix(in hwb, var(--ant-color-primary), white 92%);
24
+ }
25
+
26
+ td {
27
+ border: 1px solid var(--ant-color-border);
28
+ border-radius: 6px;
29
+ font-variant-numeric: tabular-nums;
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,12 @@
1
+ import { type TableProps } from "antd";
2
+ /**
3
+ * 清鹏定制表格样式,出自 TMS 系统。
4
+ *
5
+ * 调用接口与 [Ant Design 的 Table](https://ant-design.antgroup.com/components/table-cn) 完全一致。
6
+ *
7
+ * 该组件实际上只在 Table 基础上添加了 CSS 样式并修改了默认值。你可以通过 `TsingrocTable.style` 取得该组件的 CSS 类名。
8
+ */
9
+ declare const _default: (<DataType extends Record<string, any>>({ className, ...props }: TableProps<DataType>) => import("react/jsx-runtime").JSX.Element) & {
10
+ style: string | undefined;
11
+ };
12
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import { Table } from "antd";
2
+ import styles from "./TsingrocTable.module.css";
3
+
4
+ /**
5
+ * 清鹏定制表格样式,出自 TMS 系统。
6
+ *
7
+ * 调用接口与 [Ant Design 的 Table](https://ant-design.antgroup.com/components/table-cn) 完全一致。
8
+ *
9
+ * 该组件实际上只在 Table 基础上添加了 CSS 样式并修改了默认值。你可以通过 `TsingrocTable.style` 取得该组件的 CSS 类名。
10
+ */
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ export default Object.assign(function TsingrocTable({
13
+ className,
14
+ ...props
15
+ }) {
16
+ return /*#__PURE__*/_jsx(Table, {
17
+ size: "small",
18
+ className: styles.root + " " + (className ?? ""),
19
+ ...props
20
+ });
21
+ }, {
22
+ style: styles.root
23
+ });
@@ -33,9 +33,9 @@ function TsingrocTheme(props) {
33
33
  colorInfo: "#9b5efd",
34
34
  colorSuccess: "#1ac489"
35
35
  } : {
36
- colorPrimary: "#5200d7",
37
- colorInfo: "#5200d7",
38
- colorSuccess: "#1ac489"
36
+ colorPrimary: "#85008C",
37
+ colorBgLayout: "#F2F0F7",
38
+ borderRadius: 8
39
39
  };
40
40
  $[3] = props.dark;
41
41
  $[4] = t0;
package/dist/index.d.ts CHANGED
@@ -12,6 +12,8 @@ export { default as CircularProgress, type CircularProgressProps, } from "./comp
12
12
  export { default as ConnectedECharts, EChartsConnector, withConnector, } from "./components/ConnectedECharts";
13
13
  export { default as ECharts, type EChartsProps, type EChartsRef, type EChartsComponentType, type EChartsHOCType, } from "./components/ECharts";
14
14
  export { default as Header, type HeaderProps } from "./components/Header";
15
+ export { default as HighlightSyncedECharts, HighlightProvider, useHighlight, HighlightConsumer, withHighlightSync, type Highlight, } from "./components/HighlightSyncedECharts";
16
+ export { default as HighlightSyncedTable } from "./components/HighlightSyncedTable";
15
17
  export { default as ImageBackground, type ImageBackgroundProps, } from "./components/ImageBackground";
16
18
  export { default as IndicatorLight, type IndicatorLightProps, } from "./components/IndicatorLight";
17
19
  export { default as LeftAlignedECharts, EChartsLeftAligner, withLeftAlign, } from "./components/LeftAlignedECharts";
@@ -19,9 +21,11 @@ export { default as LineChartEditor, type LineChartEditorProps, } from "./compon
19
21
  export { default as LineChartTable, type LineChartTableProps, } from "./components/LineChartTable";
20
22
  export { default as LinkedLineChart, LineChartLinkProvider, type LinkedLineChartProps, type LineChartLinkProviderProps, } from "./components/LinkedLineChart";
21
23
  export { default as QuickDateRangePicker, type QuickDateRangePickerProps, } from "./components/QuickDateRangePicker";
24
+ export { default as ScrollableTable } from "./components/ScrollableTable";
22
25
  export { default as SegmentedButtons, TimeUnitSwitcher, type TimeUnitSwitcherProps, } from "./components/SegmentedButtons";
23
26
  export { withSelectable, type SelectableEChartsProps, } from "./components/SelectableECharts";
24
27
  export { default as Sidebar, type SidebarProps } from "./components/Sidebar";
25
28
  export { default as TsingrocDatePicker, type DatePickerProps, } from "./components/TsingrocDatePicker";
29
+ export { default as TsingrocTable } from "./components/TsingrocTable";
26
30
  export { default as TsingrocTheme, type TsingrocThemeProps, } from "./components/TsingrocTheme";
27
31
  export { default as UserButton, type UserButtonProps, } from "./components/UserButton";
package/dist/index.js CHANGED
@@ -11,6 +11,8 @@ export { default as CircularProgress } from "./components/CircularProgress";
11
11
  export { default as ConnectedECharts, EChartsConnector, withConnector } from "./components/ConnectedECharts";
12
12
  export { default as ECharts } from "./components/ECharts";
13
13
  export { default as Header } from "./components/Header";
14
+ export { default as HighlightSyncedECharts, HighlightProvider, useHighlight, HighlightConsumer, withHighlightSync } from "./components/HighlightSyncedECharts";
15
+ export { default as HighlightSyncedTable } from "./components/HighlightSyncedTable";
14
16
  export { default as ImageBackground } from "./components/ImageBackground";
15
17
  export { default as IndicatorLight } from "./components/IndicatorLight";
16
18
  export { default as LeftAlignedECharts, EChartsLeftAligner, withLeftAlign } from "./components/LeftAlignedECharts";
@@ -18,9 +20,11 @@ export { default as LineChartEditor } from "./components/LineChartEditor";
18
20
  export { default as LineChartTable } from "./components/LineChartTable";
19
21
  export { default as LinkedLineChart, LineChartLinkProvider } from "./components/LinkedLineChart";
20
22
  export { default as QuickDateRangePicker } from "./components/QuickDateRangePicker";
23
+ export { default as ScrollableTable } from "./components/ScrollableTable";
21
24
  export { default as SegmentedButtons, TimeUnitSwitcher } from "./components/SegmentedButtons";
22
25
  export { withSelectable } from "./components/SelectableECharts";
23
26
  export { default as Sidebar } from "./components/Sidebar";
24
27
  export { default as TsingrocDatePicker } from "./components/TsingrocDatePicker";
28
+ export { default as TsingrocTable } from "./components/TsingrocTable";
25
29
  export { default as TsingrocTheme } from "./components/TsingrocTheme";
26
30
  export { default as UserButton } from "./components/UserButton";
@@ -0,0 +1,7 @@
1
+ import type { PricePlotValue } from "../../types/dayahead";
2
+ type PricePlotProps = {
3
+ data: PricePlotValue[];
4
+ };
5
+ declare const PricePlot: ({ data }: PricePlotProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default PricePlot;
7
+ export type { PricePlotValue };
@@ -0,0 +1,136 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { COLOR_PRICE_DAY_AHEAD, COLOR_PRICE_REALTIME } from "#src/utils/constants";
3
+ import ReviewLineChart from "../ReviewLineChart";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const TIME_INTERVAL_MIN = 15;
6
+ const PricePlot = t0 => {
7
+ const $ = _c(19);
8
+ const {
9
+ data
10
+ } = t0;
11
+ let t1;
12
+ if ($[0] !== data) {
13
+ t1 = data.map(_temp);
14
+ $[0] = data;
15
+ $[1] = t1;
16
+ } else {
17
+ t1 = $[1];
18
+ }
19
+ let t2;
20
+ if ($[2] !== data) {
21
+ t2 = data.map(_temp2);
22
+ $[2] = data;
23
+ $[3] = t2;
24
+ } else {
25
+ t2 = $[3];
26
+ }
27
+ let t3;
28
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
29
+ t3 = {
30
+ color: COLOR_PRICE_DAY_AHEAD,
31
+ smooth: false,
32
+ tooltip: {
33
+ valueFormatter: _temp3
34
+ }
35
+ };
36
+ $[4] = t3;
37
+ } else {
38
+ t3 = $[4];
39
+ }
40
+ let t4;
41
+ if ($[5] !== t2) {
42
+ t4 = {
43
+ name: "\u65E5\u524D\u4EF7\u683C",
44
+ data: t2,
45
+ option: t3
46
+ };
47
+ $[5] = t2;
48
+ $[6] = t4;
49
+ } else {
50
+ t4 = $[6];
51
+ }
52
+ let t5;
53
+ if ($[7] !== data) {
54
+ t5 = data.map(_temp4);
55
+ $[7] = data;
56
+ $[8] = t5;
57
+ } else {
58
+ t5 = $[8];
59
+ }
60
+ let t6;
61
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
62
+ t6 = {
63
+ color: COLOR_PRICE_REALTIME,
64
+ smooth: false,
65
+ tooltip: {
66
+ valueFormatter: _temp5
67
+ }
68
+ };
69
+ $[9] = t6;
70
+ } else {
71
+ t6 = $[9];
72
+ }
73
+ let t7;
74
+ if ($[10] !== t5) {
75
+ t7 = {
76
+ name: "\u5B9E\u65F6\u4EF7\u683C",
77
+ data: t5,
78
+ option: t6
79
+ };
80
+ $[10] = t5;
81
+ $[11] = t7;
82
+ } else {
83
+ t7 = $[11];
84
+ }
85
+ let t8;
86
+ if ($[12] !== t4 || $[13] !== t7) {
87
+ t8 = [t4, t7];
88
+ $[12] = t4;
89
+ $[13] = t7;
90
+ $[14] = t8;
91
+ } else {
92
+ t8 = $[14];
93
+ }
94
+ let t9;
95
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
96
+ t9 = ["\u65E5\u524D\u4EF7\u683C", "\u5B9E\u65F6\u4EF7\u683C"];
97
+ $[15] = t9;
98
+ } else {
99
+ t9 = $[15];
100
+ }
101
+ let t10;
102
+ if ($[16] !== t1 || $[17] !== t8) {
103
+ t10 = /*#__PURE__*/_jsx(ReviewLineChart, {
104
+ title: "\u4EF7\u683C\u5BF9\u6BD4\u56FE",
105
+ xAxisData: t1,
106
+ timeIntervalMinutes: TIME_INTERVAL_MIN,
107
+ useUtc: false,
108
+ yAxisName: "\u4EF7\u683C\uFF08\u5143\uFF09",
109
+ series: t8,
110
+ legendData: t9,
111
+ showTitle: true
112
+ });
113
+ $[16] = t1;
114
+ $[17] = t8;
115
+ $[18] = t10;
116
+ } else {
117
+ t10 = $[18];
118
+ }
119
+ return t10;
120
+ };
121
+ export default PricePlot;
122
+ function _temp(v) {
123
+ return v.time;
124
+ }
125
+ function _temp2(v_0) {
126
+ return v_0.dayAheadPrice;
127
+ }
128
+ function _temp3(v_1) {
129
+ return v_1 != null ? `¥${Number(v_1).toFixed(3)}` : "-";
130
+ }
131
+ function _temp4(v_2) {
132
+ return v_2.realTimePrice;
133
+ }
134
+ function _temp5(v_3) {
135
+ return v_3 != null ? `¥${Number(v_3).toFixed(3)}` : "-";
136
+ }
@@ -0,0 +1,13 @@
1
+ .profit-bar-chart {
2
+ min-height: 0;
3
+ height: 100%;
4
+ width: 100%;
5
+ border: 0px;
6
+ /* border-bottom: 1px solid var(--ant-color-border); */
7
+ border-radius: 0px;
8
+ }
9
+
10
+ .profit-bar-chart__chart-container {
11
+ height: 100%;
12
+ width: 100%;
13
+ }
@@ -0,0 +1,17 @@
1
+ import type { FilterOption, ProfitPlotValue as DayAheadProfitPlotValue } from "../../types/dayahead";
2
+ type ProfitPlotValue = DayAheadProfitPlotValue;
3
+ type ProfitPlotProps = {
4
+ agent_data: ProfitPlotValue[];
5
+ manual_data: ProfitPlotValue[];
6
+ hasManualData: boolean;
7
+ useUtc?: boolean;
8
+ filterValue?: FilterOption;
9
+ gridOption?: {
10
+ left?: string | number;
11
+ right?: string | number;
12
+ top?: string | number;
13
+ bottom?: string | number;
14
+ };
15
+ };
16
+ declare const ProfitBarChart: ({ agent_data, manual_data, hasManualData, useUtc, filterValue, gridOption, }: ProfitPlotProps) => import("react/jsx-runtime").JSX.Element;
17
+ export default ProfitBarChart;
@@ -0,0 +1,278 @@
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import dayjs from "dayjs";
3
+ import utc from "dayjs/plugin/utc";
4
+ import { useMemo } from "react";
5
+ import BarLineChart from "#src/components/BarLineChart";
6
+ import BaseBarChart from "#src/components/BaseBarChart";
7
+ import { COLOR_PROFIT_MANUAL, COLOR_PROFIT_TSINGROC } from "#src/utils/constants";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ dayjs.extend(utc);
10
+ const ProfitBarChart = t0 => {
11
+ const $ = _c(41);
12
+ const {
13
+ agent_data,
14
+ manual_data,
15
+ hasManualData,
16
+ useUtc: t1,
17
+ filterValue: t2,
18
+ gridOption
19
+ } = t0;
20
+ const useUtc = t1 === undefined ? true : t1;
21
+ const filterValue = t2 === undefined ? "all" : t2;
22
+ const hasData = agent_data.length > 0 || manual_data.length > 0;
23
+ let agent_profitData;
24
+ let effectiveFilter;
25
+ let formattedTimeData;
26
+ let showAgent;
27
+ let showManual;
28
+ let t3;
29
+ let t4;
30
+ if ($[0] !== agent_data || $[1] !== filterValue || $[2] !== gridOption || $[3] !== hasData || $[4] !== hasManualData || $[5] !== manual_data || $[6] !== useUtc) {
31
+ t4 = Symbol.for("react.early_return_sentinel");
32
+ bb0: {
33
+ const timeData = hasData ? agent_data.length >= manual_data.length ? agent_data.map(_temp) : manual_data.map(_temp2) : Array.from({
34
+ length: 24
35
+ }, (_, i) => useUtc ? dayjs.utc().startOf("day").add(i, "hour").toISOString() : dayjs().startOf("day").add(i, "hour").format("YYYY-MM-DDTHH:mm:ss+08:00"));
36
+ let t5;
37
+ if ($[14] !== useUtc) {
38
+ t5 = timeStr => {
39
+ const parsed = useUtc ? dayjs.utc(timeStr) : dayjs(timeStr);
40
+ return parsed.format("HH:mm");
41
+ };
42
+ $[14] = useUtc;
43
+ $[15] = t5;
44
+ } else {
45
+ t5 = $[15];
46
+ }
47
+ formattedTimeData = timeData.map(t5).concat("24:00");
48
+ const isDayAhead = agent_data.some(_temp3);
49
+ let t6;
50
+ bb1: {
51
+ if (filterValue === "manual" && !hasManualData) {
52
+ t6 = "agent";
53
+ break bb1;
54
+ }
55
+ t6 = filterValue;
56
+ }
57
+ effectiveFilter = t6;
58
+ showAgent = effectiveFilter === "all" || effectiveFilter === "agent";
59
+ showManual = hasManualData && (effectiveFilter === "all" || effectiveFilter === "manual");
60
+ if (isDayAhead && showAgent) {
61
+ let t7;
62
+ if ($[16] !== agent_data) {
63
+ t7 = (_timeStr, index) => {
64
+ const dataPoint = agent_data[index];
65
+ return dataPoint?.agentStrategyAdd ?? 0;
66
+ };
67
+ $[16] = agent_data;
68
+ $[17] = t7;
69
+ } else {
70
+ t7 = $[17];
71
+ }
72
+ const strategyAddData = timeData.map(t7);
73
+ let t8;
74
+ if ($[18] !== agent_data) {
75
+ t8 = (_timeStr_0, index_0) => {
76
+ const dataPoint_0 = agent_data[index_0];
77
+ return dataPoint_0?.agentPredictBaseline ?? 0;
78
+ };
79
+ $[18] = agent_data;
80
+ $[19] = t8;
81
+ } else {
82
+ t8 = $[19];
83
+ }
84
+ const predictBaselineData = timeData.map(t8);
85
+ let t9;
86
+ if ($[20] !== manual_data) {
87
+ t9 = (_timeStr_1, index_1) => {
88
+ const dataPoint_1 = manual_data[index_1];
89
+ return dataPoint_1?.manualProfit ?? 0;
90
+ };
91
+ $[20] = manual_data;
92
+ $[21] = t9;
93
+ } else {
94
+ t9 = $[21];
95
+ }
96
+ const manual_profitData = timeData.map(t9);
97
+ const barSeries = [{
98
+ name: "\u7B56\u7565\u589E\u76CA",
99
+ data: strategyAddData,
100
+ option: {
101
+ color: COLOR_PROFIT_TSINGROC,
102
+ tooltip: {
103
+ valueFormatter: _temp4
104
+ }
105
+ }
106
+ }, ...(showManual ? [{
107
+ name: "\u4EBA\u5DE5\u6536\u76CA",
108
+ data: manual_profitData,
109
+ option: {
110
+ color: COLOR_PROFIT_MANUAL,
111
+ tooltip: {
112
+ valueFormatter: _temp5
113
+ }
114
+ }
115
+ }] : [])];
116
+ const lineSeries = [{
117
+ name: "\u9884\u6D4B\u57FA\u7EBF",
118
+ data: predictBaselineData,
119
+ option: {
120
+ color: COLOR_PROFIT_TSINGROC,
121
+ smooth: true,
122
+ lineStyle: {
123
+ width: 2,
124
+ type: "dashed"
125
+ },
126
+ tooltip: {
127
+ valueFormatter: _temp6
128
+ }
129
+ }
130
+ }];
131
+ t4 = /*#__PURE__*/_jsx(BarLineChart, {
132
+ title: "\u6536\u76CA\u5206\u5E03\u56FE",
133
+ xAxisData: timeData,
134
+ xAxisFormat: "time",
135
+ xAxisInterval: 7,
136
+ useUtc: useUtc,
137
+ barSeries: barSeries,
138
+ lineSeries: lineSeries,
139
+ barYAxisName: "\u6536\u76CA\uFF08\u5143\uFF09",
140
+ lineYAxisName: "\u6536\u76CA\uFF08\u5143\uFF09",
141
+ gridOption: gridOption
142
+ });
143
+ break bb0;
144
+ }
145
+ let t7;
146
+ if ($[22] !== agent_data) {
147
+ t7 = (_timeStr_2, index_2) => {
148
+ const dataPoint_2 = agent_data[index_2];
149
+ return dataPoint_2?.agentProfit ?? 0;
150
+ };
151
+ $[22] = agent_data;
152
+ $[23] = t7;
153
+ } else {
154
+ t7 = $[23];
155
+ }
156
+ agent_profitData = timeData.map(t7);
157
+ let t8;
158
+ if ($[24] !== manual_data) {
159
+ t8 = (_timeStr_3, index_3) => {
160
+ const dataPoint_3 = manual_data[index_3];
161
+ return dataPoint_3?.manualProfit ?? 0;
162
+ };
163
+ $[24] = manual_data;
164
+ $[25] = t8;
165
+ } else {
166
+ t8 = $[25];
167
+ }
168
+ t3 = timeData.map(t8);
169
+ }
170
+ $[0] = agent_data;
171
+ $[1] = filterValue;
172
+ $[2] = gridOption;
173
+ $[3] = hasData;
174
+ $[4] = hasManualData;
175
+ $[5] = manual_data;
176
+ $[6] = useUtc;
177
+ $[7] = agent_profitData;
178
+ $[8] = effectiveFilter;
179
+ $[9] = formattedTimeData;
180
+ $[10] = showAgent;
181
+ $[11] = showManual;
182
+ $[12] = t3;
183
+ $[13] = t4;
184
+ } else {
185
+ agent_profitData = $[7];
186
+ effectiveFilter = $[8];
187
+ formattedTimeData = $[9];
188
+ showAgent = $[10];
189
+ showManual = $[11];
190
+ t3 = $[12];
191
+ t4 = $[13];
192
+ }
193
+ if (t4 !== Symbol.for("react.early_return_sentinel")) {
194
+ return t4;
195
+ }
196
+ const manual_profitData_0 = t3;
197
+ let t5;
198
+ if ($[26] !== agent_profitData || $[27] !== showAgent) {
199
+ t5 = showAgent ? [{
200
+ name: "\u667A\u80FD\u4F53\u6536\u76CA",
201
+ data: agent_profitData,
202
+ color: COLOR_PROFIT_TSINGROC
203
+ }] : [];
204
+ $[26] = agent_profitData;
205
+ $[27] = showAgent;
206
+ $[28] = t5;
207
+ } else {
208
+ t5 = $[28];
209
+ }
210
+ let t6;
211
+ if ($[29] !== manual_profitData_0 || $[30] !== showManual) {
212
+ t6 = showManual ? [{
213
+ name: "\u4EBA\u5DE5\u6536\u76CA",
214
+ data: manual_profitData_0,
215
+ color: COLOR_PROFIT_MANUAL
216
+ }] : [];
217
+ $[29] = manual_profitData_0;
218
+ $[30] = showManual;
219
+ $[31] = t6;
220
+ } else {
221
+ t6 = $[31];
222
+ }
223
+ let t7;
224
+ if ($[32] !== t5 || $[33] !== t6) {
225
+ t7 = [...t5, ...t6];
226
+ $[32] = t5;
227
+ $[33] = t6;
228
+ $[34] = t7;
229
+ } else {
230
+ t7 = $[34];
231
+ }
232
+ const series = t7;
233
+ const chartKey = `${effectiveFilter}-${series.length}`;
234
+ let t8;
235
+ if ($[35] !== chartKey || $[36] !== formattedTimeData || $[37] !== gridOption || $[38] !== hasData || $[39] !== series) {
236
+ t8 = /*#__PURE__*/_jsx(BaseBarChart, {
237
+ title: "\u6536\u76CA\u5206\u5E03\u56FE",
238
+ categories: formattedTimeData,
239
+ series: series,
240
+ yAxisName: "\u6536\u76CA\uFF08\u5143\uFF09",
241
+ tooltipValueFormatter: _temp7,
242
+ showLegend: true,
243
+ showSplitLine: hasData,
244
+ gridOption: gridOption
245
+ }, chartKey);
246
+ $[35] = chartKey;
247
+ $[36] = formattedTimeData;
248
+ $[37] = gridOption;
249
+ $[38] = hasData;
250
+ $[39] = series;
251
+ $[40] = t8;
252
+ } else {
253
+ t8 = $[40];
254
+ }
255
+ return t8;
256
+ };
257
+ export default ProfitBarChart;
258
+ function _temp(v) {
259
+ return v.time;
260
+ }
261
+ function _temp2(v_0) {
262
+ return v_0.time;
263
+ }
264
+ function _temp3(d) {
265
+ return "agentStrategyAdd" in d && d.agentStrategyAdd !== undefined;
266
+ }
267
+ function _temp4(v_1) {
268
+ return `¥${Number(v_1).toFixed(2)}`;
269
+ }
270
+ function _temp5(v_2) {
271
+ return `¥${Number(v_2).toFixed(2)}`;
272
+ }
273
+ function _temp6(v_3) {
274
+ return `¥${Number(v_3).toFixed(2)}`;
275
+ }
276
+ function _temp7(v_4) {
277
+ return `¥${v_4.toFixed(2)}`;
278
+ }
@@ -0,0 +1,40 @@
1
+ /* Block: revenue-summary-card */
2
+ .revenue-summary-container {
3
+ border: 0px;
4
+ }
5
+
6
+ .revenue-summary-container__header {
7
+ display: flex;
8
+ justify-content: space-between;
9
+ align-items: center;
10
+ }
11
+
12
+ .revenue-summary-container__title {
13
+ font-size: 1.25rem;
14
+ }
15
+
16
+ .revenue-summary-container__cards-container {
17
+ display: flex;
18
+ flex-direction: row;
19
+ gap: 16px;
20
+ width: 100%;
21
+ }
22
+
23
+ .revenue-summary-container__card {
24
+ flex: 1;
25
+ }
26
+
27
+ .revenue-summary-container__card-icon {
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ border-radius: 20px;
32
+ background-color: white;
33
+ }
34
+
35
+ /* Hide icon on smaller screens */
36
+ @media (max-width: 700px) {
37
+ .revenue-summary-container__card :global(.ant-card-meta-avatar) {
38
+ display: none;
39
+ }
40
+ }
@@ -0,0 +1,9 @@
1
+ export type RevenueCardProps = {
2
+ title: string;
3
+ num: number;
4
+ bgColour: string;
5
+ fontColor: string;
6
+ circleSize?: number;
7
+ secondaryText?: string;
8
+ };
9
+ export declare function RevenueCard({ title, num, bgColour, fontColor, circleSize, secondaryText, }: RevenueCardProps): import("react/jsx-runtime").JSX.Element;