@tsingroc/tsingroc-components 5.0.0-alpha.21 → 5.0.0-alpha.23
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.
- package/dist/components/Calendar.js +8 -4
- package/dist/components/ECharts.d.ts +1 -1
- package/dist/components/Header.d.ts +1 -1
- package/dist/components/Header.js +3 -1
- package/dist/components/LineChartEditor.js +3 -3
- package/dist/components/LineChartTable.js +319 -123
- package/dist/components/LinkedLineChart.js +3 -3
- package/dist/components/QuickDateRangePicker.d.ts +1 -1
- package/dist/components/QuickDateRangePicker.js +2 -3
- package/dist/components/Sidebar.d.ts +1 -1
- package/dist/components/Sidebar.js +4 -5
- package/dist/components/TsingrocDatePicker.d.ts +2 -2
- package/dist/components/TsingrocDatePicker.js +6 -7
- package/dist/components/UserButton.d.ts +1 -1
- package/dist/components/UserButton.js +24 -18
- package/dist/components/WeatherMap.js +1 -1
- package/dist/components/auth/AuthProvider.d.ts +35 -0
- package/dist/components/auth/AuthProvider.js +147 -0
- package/dist/components/auth/AuthService.d.ts +30 -0
- package/dist/components/auth/AuthService.js +1 -0
- package/dist/components/auth/CasdoorAuth.d.ts +152 -0
- package/dist/components/auth/CasdoorAuth.js +180 -0
- package/dist/components/auth/EmbeddedAuth.d.ts +38 -0
- package/dist/components/auth/EmbeddedAuth.js +205 -0
- package/dist/components/auth/Fetcher.d.ts +38 -0
- package/dist/components/auth/Fetcher.js +142 -0
- package/dist/components/auth/LocalAuth.d.ts +90 -0
- package/dist/components/auth/LocalAuth.js +111 -0
- package/dist/components/auth/LoginCheck.d.ts +17 -0
- package/dist/components/auth/LoginCheck.js +58 -0
- package/dist/components/auth/SessionStore.d.ts +69 -0
- package/dist/components/auth/SessionStore.js +194 -0
- package/dist/deckgl/TiandituLayer.d.ts +1 -1
- package/dist/deckgl/TiandituLayer.js +1 -1
- package/dist/deckgl/WeatherData.d.ts +1 -1
- package/dist/echarts/series/maxBarSeries.d.ts +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +7 -1
- package/package.json +34 -50
- package/dist/components/Auth.d.ts +0 -314
- package/dist/components/Auth.js +0 -296
|
@@ -78,9 +78,9 @@ function Calendar(props) {
|
|
|
78
78
|
cx,
|
|
79
79
|
styles
|
|
80
80
|
} = useStyles();
|
|
81
|
-
const [selected, setSelected] = propsSelected === undefined
|
|
81
|
+
const [selected, setSelected] = propsSelected === undefined
|
|
82
82
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
83
|
-
useState() : [propsSelected, () => {}];
|
|
83
|
+
? useState() : [propsSelected, () => {}];
|
|
84
84
|
const monthStart = month.startOf("month");
|
|
85
85
|
const calendarStart = monthStart.startOf("week");
|
|
86
86
|
const monthEnd = month.endOf("month");
|
|
@@ -93,7 +93,10 @@ function Calendar(props) {
|
|
|
93
93
|
className: cx(styles.calendar, className),
|
|
94
94
|
children: [/*#__PURE__*/_jsx("thead", {
|
|
95
95
|
children: /*#__PURE__*/_jsx("tr", {
|
|
96
|
-
children: weekdays.map((name, weekday) =>
|
|
96
|
+
children: weekdays.map((name, weekday) =>
|
|
97
|
+
/*#__PURE__*/
|
|
98
|
+
// oxlint-disable-next-line react/no-children-prop
|
|
99
|
+
_jsx("th", {
|
|
97
100
|
children: name,
|
|
98
101
|
...thProps?.(weekday)
|
|
99
102
|
}, weekday))
|
|
@@ -104,13 +107,14 @@ function Calendar(props) {
|
|
|
104
107
|
}, (_, week) => /*#__PURE__*/_jsx("tr", {
|
|
105
108
|
children: Array(7).fill(null).map((_, weekday) => {
|
|
106
109
|
const date = calendarStart.add(week * 7 + weekday, "day");
|
|
107
|
-
const fade = fadeAdjacentDays && date.month()
|
|
110
|
+
const fade = fadeAdjacentDays && date.month() !== monthStart.month();
|
|
108
111
|
const isSelected = Math.floor(selected?.diff(date, "day", true) ?? NaN) === 0;
|
|
109
112
|
const {
|
|
110
113
|
className,
|
|
111
114
|
...props
|
|
112
115
|
} = tdProps?.(date, false) ?? {};
|
|
113
116
|
return /*#__PURE__*/_jsx("td", {
|
|
117
|
+
// oxlint-disable-next-line react/no-children-prop
|
|
114
118
|
children: date.date(),
|
|
115
119
|
onClick: () => {
|
|
116
120
|
setSelected(date);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EChartsOption } from "echarts";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ECharts as EChartsInstance, EChartsCoreOption, EChartsInitOpts, SetOptionOpts } from "echarts/core";
|
|
3
3
|
import { type ComponentType, type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
4
4
|
export interface EChartsProps<Option extends EChartsCoreOption = EChartsOption> extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
@@ -53,7 +53,7 @@ export interface HeaderProps extends MenuProps {
|
|
|
53
53
|
/**
|
|
54
54
|
* 顶栏组件。该组件需要放置在 [Ant Design 的 `Layout` 组件][1]内部才能正常工作。
|
|
55
55
|
* 如果没有指定 {@linkcode HeaderProps.rightEnd | rightEnd} 属性,
|
|
56
|
-
* 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode
|
|
56
|
+
* 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode LoginCheck} 验证后
|
|
57
57
|
* 才能正常显示顶栏右端的用户信息按钮。
|
|
58
58
|
*
|
|
59
59
|
* 一般来说,使用该组件时至少需要提供 `logo`、`items` 和 `onSelect` 三个属性,具体用法请参照范例。
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { Flex, Layout, Menu, theme } from "antd";
|
|
3
3
|
import UserButton from "./UserButton";
|
|
4
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
7
|
/**
|
|
6
8
|
* 顶栏组件。该组件需要放置在 [Ant Design 的 `Layout` 组件][1]内部才能正常工作。
|
|
7
9
|
* 如果没有指定 {@linkcode HeaderProps.rightEnd | rightEnd} 属性,
|
|
8
|
-
* 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode
|
|
10
|
+
* 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode LoginCheck} 验证后
|
|
9
11
|
* 才能正常显示顶栏右端的用户信息按钮。
|
|
10
12
|
*
|
|
11
13
|
* 一般来说,使用该组件时至少需要提供 `logo`、`items` 和 `onSelect` 三个属性,具体用法请参照范例。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button, ConfigProvider, Flex, Input, Modal, Table, message, theme } from "antd";
|
|
2
2
|
import { createStyles } from "antd-style";
|
|
3
|
-
import {
|
|
3
|
+
import { use, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import * as echarts from "../echarts";
|
|
5
5
|
import ECharts from "./ECharts";
|
|
6
6
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -38,7 +38,7 @@ function LineChartEditor(props) {
|
|
|
38
38
|
styles,
|
|
39
39
|
theme: token
|
|
40
40
|
} = useStyles();
|
|
41
|
-
const isDark =
|
|
41
|
+
const isDark = use(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
|
|
42
42
|
const [modal, modalContextHolder] = Modal.useModal();
|
|
43
43
|
const [messageApi, messageContextHolder] = message.useMessage();
|
|
44
44
|
const [newData, setNewData] = useState(origData);
|
|
@@ -238,7 +238,7 @@ function LineChartEditor(props) {
|
|
|
238
238
|
}], [xName, origName, newName, adjustStep, unitString, token]);
|
|
239
239
|
const onRow = useCallback((data, index) => {
|
|
240
240
|
if (index === undefined) return {};
|
|
241
|
-
const modified = data.orig
|
|
241
|
+
const modified = data.orig !== data.new;
|
|
242
242
|
const selected = index === selectedIndex;
|
|
243
243
|
return {
|
|
244
244
|
className: cx(styles.editableRow, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import { ConfigProvider, Flex, Table, theme } from "antd";
|
|
2
3
|
import { createStyles } from "antd-style";
|
|
3
|
-
import {
|
|
4
|
+
import { use, useEffect, useMemo, useRef, useState } from "react";
|
|
4
5
|
import * as echarts from "../echarts";
|
|
5
6
|
import ECharts from "./ECharts";
|
|
6
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -14,26 +15,56 @@ const EMPTY = [];
|
|
|
14
15
|
* [1]: https://ant-design.antgroup.com/components/flex-cn#api
|
|
15
16
|
*/
|
|
16
17
|
function LineChartTable(props) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
const $ = _c(63);
|
|
19
|
+
let rest;
|
|
20
|
+
let t0;
|
|
21
|
+
let t1;
|
|
22
|
+
let t2;
|
|
23
|
+
let t3;
|
|
24
|
+
let xData;
|
|
25
|
+
let yUnit;
|
|
26
|
+
if ($[0] !== props) {
|
|
27
|
+
({
|
|
28
|
+
xData,
|
|
29
|
+
xName: t0,
|
|
30
|
+
yName: t1,
|
|
31
|
+
yUnit,
|
|
32
|
+
series: t2,
|
|
33
|
+
chartHeight: t3,
|
|
34
|
+
...rest
|
|
35
|
+
} = props);
|
|
36
|
+
$[0] = props;
|
|
37
|
+
$[1] = rest;
|
|
38
|
+
$[2] = t0;
|
|
39
|
+
$[3] = t1;
|
|
40
|
+
$[4] = t2;
|
|
41
|
+
$[5] = t3;
|
|
42
|
+
$[6] = xData;
|
|
43
|
+
$[7] = yUnit;
|
|
44
|
+
} else {
|
|
45
|
+
rest = $[1];
|
|
46
|
+
t0 = $[2];
|
|
47
|
+
t1 = $[3];
|
|
48
|
+
t2 = $[4];
|
|
49
|
+
t3 = $[5];
|
|
50
|
+
xData = $[6];
|
|
51
|
+
yUnit = $[7];
|
|
52
|
+
}
|
|
53
|
+
const xName = t0 === undefined ? "\u65F6\u95F4" : t0;
|
|
54
|
+
const yName = t1 === undefined ? "\u6570\u503C" : t1;
|
|
55
|
+
const series = t2 === undefined ? [] : t2;
|
|
56
|
+
const chartHeight = t3 === undefined ? 175 : t3;
|
|
27
57
|
const unitString = yUnit !== undefined ? `(${yUnit})` : "";
|
|
28
58
|
const {
|
|
29
59
|
cx,
|
|
30
60
|
styles,
|
|
31
61
|
theme: token
|
|
32
62
|
} = useStyles();
|
|
33
|
-
const isDark =
|
|
63
|
+
const isDark = use(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
|
|
34
64
|
const echartsRef = useRef(null);
|
|
35
65
|
const tableRef = useRef(null);
|
|
36
|
-
const [
|
|
66
|
+
const [t4, setHover] = useState(EMPTY);
|
|
67
|
+
const [hoverSource, hoverXIndex, hoverY] = t4;
|
|
37
68
|
let closestYIndex;
|
|
38
69
|
let closestY;
|
|
39
70
|
if (hoverXIndex !== undefined && hoverY !== undefined) {
|
|
@@ -72,9 +103,9 @@ function LineChartTable(props) {
|
|
|
72
103
|
status: closestY !== undefined ? "show" : "hide"
|
|
73
104
|
}
|
|
74
105
|
},
|
|
75
|
-
series: series.map(
|
|
106
|
+
series: series.map(_temp)
|
|
76
107
|
}), echarts.legend({
|
|
77
|
-
data: series.map(
|
|
108
|
+
data: series.map(_temp2),
|
|
78
109
|
option: {
|
|
79
110
|
right: 42
|
|
80
111
|
}
|
|
@@ -89,137 +120,302 @@ function LineChartTable(props) {
|
|
|
89
120
|
filterMode: "empty"
|
|
90
121
|
}]
|
|
91
122
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
setHover(EMPTY);
|
|
123
|
+
let t5;
|
|
124
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
125
|
+
t5 = index_0 => {
|
|
126
|
+
const table = tableRef.current?.nativeElement;
|
|
127
|
+
if (table) {
|
|
128
|
+
const header = table.getElementsByTagName("thead")[0];
|
|
129
|
+
const row = table.getElementsByTagName("tr")[index_0];
|
|
130
|
+
table.scrollTo({
|
|
131
|
+
top: row.offsetTop + row.offsetHeight / 2 - (table.offsetHeight - header.offsetHeight) / 2,
|
|
132
|
+
behavior: "smooth"
|
|
133
|
+
});
|
|
104
134
|
}
|
|
105
135
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
136
|
+
$[8] = t5;
|
|
137
|
+
} else {
|
|
138
|
+
t5 = $[8];
|
|
139
|
+
}
|
|
140
|
+
const tableScrollTo = t5;
|
|
141
|
+
let t6;
|
|
142
|
+
if ($[9] !== setHover) {
|
|
143
|
+
t6 = () => {
|
|
144
|
+
const inst = echartsRef.current?.instance?.getZr();
|
|
145
|
+
if (!inst) {
|
|
146
|
+
return _temp3;
|
|
147
|
+
}
|
|
148
|
+
const onMousemove = event => {
|
|
149
|
+
const inst_0 = echartsRef.current?.instance;
|
|
150
|
+
if (!inst_0) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const coord = [event.offsetX, event.offsetY];
|
|
154
|
+
if (inst_0.containPixel("grid", coord)) {
|
|
155
|
+
const [x, y_0] = inst_0.convertFromPixel("grid", coord);
|
|
156
|
+
setHover(["chart", x, y_0]);
|
|
157
|
+
} else {
|
|
158
|
+
setHover(EMPTY);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const onGlobalout = () => setHover(EMPTY);
|
|
162
|
+
inst.on("mousemove", onMousemove);
|
|
163
|
+
inst.on("globalout", onGlobalout);
|
|
164
|
+
return () => {
|
|
165
|
+
inst.off("mousemove", onMousemove);
|
|
166
|
+
inst.off("globalout", onGlobalout);
|
|
167
|
+
};
|
|
112
168
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
169
|
+
$[9] = setHover;
|
|
170
|
+
$[10] = t6;
|
|
171
|
+
} else {
|
|
172
|
+
t6 = $[10];
|
|
173
|
+
}
|
|
174
|
+
let t7;
|
|
175
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
176
|
+
t7 = [];
|
|
177
|
+
$[11] = t7;
|
|
178
|
+
} else {
|
|
179
|
+
t7 = $[11];
|
|
180
|
+
}
|
|
181
|
+
useEffect(t6, t7);
|
|
182
|
+
let t8;
|
|
183
|
+
if ($[12] !== closestYIndex || $[13] !== hoverSource || $[14] !== hoverXIndex) {
|
|
184
|
+
t8 = () => {
|
|
185
|
+
const inst_1 = echartsRef.current?.instance;
|
|
186
|
+
if (!inst_1) {
|
|
187
|
+
return;
|
|
126
188
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
189
|
+
if (hoverXIndex !== undefined) {
|
|
190
|
+
inst_1.dispatchAction({
|
|
191
|
+
type: "highlight",
|
|
192
|
+
seriesIndex: closestYIndex,
|
|
193
|
+
dataIndex: hoverXIndex
|
|
194
|
+
});
|
|
195
|
+
if (hoverSource === "chart") {
|
|
196
|
+
tableScrollTo(hoverXIndex);
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
inst_1.dispatchAction({
|
|
200
|
+
type: "downplay"
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
$[12] = closestYIndex;
|
|
205
|
+
$[13] = hoverSource;
|
|
206
|
+
$[14] = hoverXIndex;
|
|
207
|
+
$[15] = t8;
|
|
208
|
+
} else {
|
|
209
|
+
t8 = $[15];
|
|
210
|
+
}
|
|
211
|
+
let t9;
|
|
212
|
+
if ($[16] !== closestYIndex || $[17] !== hoverSource || $[18] !== hoverXIndex) {
|
|
213
|
+
t9 = [hoverSource, hoverXIndex, closestYIndex];
|
|
214
|
+
$[16] = closestYIndex;
|
|
215
|
+
$[17] = hoverSource;
|
|
216
|
+
$[18] = hoverXIndex;
|
|
217
|
+
$[19] = t9;
|
|
218
|
+
} else {
|
|
219
|
+
t9 = $[19];
|
|
220
|
+
}
|
|
221
|
+
useEffect(t8, t9);
|
|
222
|
+
let data;
|
|
223
|
+
if ($[20] !== series || $[21] !== xData) {
|
|
224
|
+
data = xData.map(_temp4);
|
|
138
225
|
series.forEach(series_3 => series_3.data.forEach((y_1, i_0) => data[i_0][`y${series_3.name}`] = y_1));
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
226
|
+
$[20] = series;
|
|
227
|
+
$[21] = xData;
|
|
228
|
+
$[22] = data;
|
|
229
|
+
} else {
|
|
230
|
+
data = $[22];
|
|
231
|
+
}
|
|
232
|
+
const tableDataWithoutHover = data;
|
|
233
|
+
closestYIndex;
|
|
234
|
+
let t10;
|
|
235
|
+
if (hoverSource === "chart" && hoverXIndex !== undefined) {
|
|
236
|
+
let data_0;
|
|
237
|
+
if ($[23] !== closestYIndex || $[24] !== hoverXIndex || $[25] !== tableDataWithoutHover) {
|
|
238
|
+
data_0 = [...tableDataWithoutHover];
|
|
144
239
|
data_0[hoverXIndex] = {
|
|
145
240
|
...data_0[hoverXIndex],
|
|
146
241
|
hover: closestYIndex ?? true
|
|
147
242
|
};
|
|
148
|
-
|
|
243
|
+
$[23] = closestYIndex;
|
|
244
|
+
$[24] = hoverXIndex;
|
|
245
|
+
$[25] = tableDataWithoutHover;
|
|
246
|
+
$[26] = data_0;
|
|
149
247
|
} else {
|
|
150
|
-
|
|
248
|
+
data_0 = $[26];
|
|
151
249
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
250
|
+
t10 = data_0;
|
|
251
|
+
} else {
|
|
252
|
+
t10 = tableDataWithoutHover;
|
|
253
|
+
}
|
|
254
|
+
const tableData = t10;
|
|
255
|
+
const columnWidth = `${100 / series.length}%`;
|
|
256
|
+
let t11;
|
|
257
|
+
if ($[27] !== cx || $[28] !== setHover || $[29] !== styles) {
|
|
258
|
+
t11 = (data_1, index_1) => ({
|
|
259
|
+
className: cx({
|
|
260
|
+
[styles.rowHovered]: data_1.hover !== undefined
|
|
261
|
+
}),
|
|
262
|
+
onMouseEnter: () => setHover(["table", index_1]),
|
|
263
|
+
onMouseLeave: () => setHover(EMPTY)
|
|
264
|
+
});
|
|
265
|
+
$[27] = cx;
|
|
266
|
+
$[28] = setHover;
|
|
267
|
+
$[29] = styles;
|
|
268
|
+
$[30] = t11;
|
|
269
|
+
} else {
|
|
270
|
+
t11 = $[30];
|
|
271
|
+
}
|
|
272
|
+
let t12;
|
|
273
|
+
if ($[31] !== t11 || $[32] !== xName) {
|
|
274
|
+
t12 = {
|
|
156
275
|
key: "x",
|
|
157
276
|
dataIndex: "x",
|
|
158
277
|
title: xName,
|
|
159
|
-
onCell:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const header = table.getElementsByTagName("thead")[0];
|
|
185
|
-
const row = table.getElementsByTagName("tr")[index_1];
|
|
186
|
-
table.scrollTo({
|
|
187
|
-
top: row.offsetTop + row.offsetHeight / 2 - (table.offsetHeight - header.offsetHeight) / 2,
|
|
188
|
-
behavior: "smooth"
|
|
278
|
+
onCell: t11
|
|
279
|
+
};
|
|
280
|
+
$[31] = t11;
|
|
281
|
+
$[32] = xName;
|
|
282
|
+
$[33] = t12;
|
|
283
|
+
} else {
|
|
284
|
+
t12 = $[33];
|
|
285
|
+
}
|
|
286
|
+
let t13;
|
|
287
|
+
if ($[34] !== columnWidth || $[35] !== cx || $[36] !== series || $[37] !== setHover || $[38] !== styles || $[39] !== t12 || $[40] !== unitString) {
|
|
288
|
+
let t14;
|
|
289
|
+
if ($[42] !== columnWidth || $[43] !== cx || $[44] !== setHover || $[45] !== styles || $[46] !== unitString) {
|
|
290
|
+
t14 = (series_4, yIndex) => ({
|
|
291
|
+
key: `y${series_4.name}`,
|
|
292
|
+
dataIndex: `y${series_4.name}`,
|
|
293
|
+
title: series_4.name + unitString,
|
|
294
|
+
width: columnWidth,
|
|
295
|
+
onCell: (data_2, xIndex) => ({
|
|
296
|
+
className: cx(styles.cell, {
|
|
297
|
+
[styles.rowHovered]: data_2.hover !== undefined,
|
|
298
|
+
[styles.cellHovered]: data_2.hover === yIndex
|
|
299
|
+
}),
|
|
300
|
+
onMouseEnter: () => setHover(["table", xIndex, data_2[`y${series_4.name}`]]),
|
|
301
|
+
onMouseLeave: () => setHover(EMPTY)
|
|
302
|
+
})
|
|
189
303
|
});
|
|
304
|
+
$[42] = columnWidth;
|
|
305
|
+
$[43] = cx;
|
|
306
|
+
$[44] = setHover;
|
|
307
|
+
$[45] = styles;
|
|
308
|
+
$[46] = unitString;
|
|
309
|
+
$[47] = t14;
|
|
310
|
+
} else {
|
|
311
|
+
t14 = $[47];
|
|
190
312
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
313
|
+
t13 = [t12, ...series.map(t14)];
|
|
314
|
+
$[34] = columnWidth;
|
|
315
|
+
$[35] = cx;
|
|
316
|
+
$[36] = series;
|
|
317
|
+
$[37] = setHover;
|
|
318
|
+
$[38] = styles;
|
|
319
|
+
$[39] = t12;
|
|
320
|
+
$[40] = unitString;
|
|
321
|
+
$[41] = t13;
|
|
322
|
+
} else {
|
|
323
|
+
t13 = $[41];
|
|
324
|
+
}
|
|
325
|
+
const tableColumns = t13;
|
|
326
|
+
const t14 = isDark ? "dark" : undefined;
|
|
327
|
+
let t15;
|
|
328
|
+
if ($[48] !== chartHeight) {
|
|
329
|
+
t15 = {
|
|
330
|
+
height: chartHeight,
|
|
331
|
+
flexShrink: 0
|
|
332
|
+
};
|
|
333
|
+
$[48] = chartHeight;
|
|
334
|
+
$[49] = t15;
|
|
335
|
+
} else {
|
|
336
|
+
t15 = $[49];
|
|
337
|
+
}
|
|
338
|
+
let t16;
|
|
339
|
+
if ($[50] !== option || $[51] !== t14 || $[52] !== t15) {
|
|
340
|
+
t16 = /*#__PURE__*/_jsx(ECharts, {
|
|
197
341
|
ref: echartsRef,
|
|
198
342
|
option: option,
|
|
199
|
-
theme:
|
|
200
|
-
style:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
343
|
+
theme: t14,
|
|
344
|
+
style: t15
|
|
345
|
+
});
|
|
346
|
+
$[50] = option;
|
|
347
|
+
$[51] = t14;
|
|
348
|
+
$[52] = t15;
|
|
349
|
+
$[53] = t16;
|
|
350
|
+
} else {
|
|
351
|
+
t16 = $[53];
|
|
352
|
+
}
|
|
353
|
+
let t17;
|
|
354
|
+
if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
|
|
355
|
+
t17 = {
|
|
356
|
+
flexBasis: "100%",
|
|
357
|
+
overflowY: "auto"
|
|
358
|
+
};
|
|
359
|
+
$[54] = t17;
|
|
360
|
+
} else {
|
|
361
|
+
t17 = $[54];
|
|
362
|
+
}
|
|
363
|
+
let t18;
|
|
364
|
+
if ($[55] !== tableColumns || $[56] !== tableData) {
|
|
365
|
+
t18 = /*#__PURE__*/_jsx(Table, {
|
|
205
366
|
ref: tableRef,
|
|
206
367
|
dataSource: tableData,
|
|
207
368
|
columns: tableColumns,
|
|
208
369
|
size: "small",
|
|
209
370
|
pagination: false,
|
|
210
|
-
style:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
371
|
+
style: t17,
|
|
372
|
+
onHeaderRow: _temp5
|
|
373
|
+
});
|
|
374
|
+
$[55] = tableColumns;
|
|
375
|
+
$[56] = tableData;
|
|
376
|
+
$[57] = t18;
|
|
377
|
+
} else {
|
|
378
|
+
t18 = $[57];
|
|
379
|
+
}
|
|
380
|
+
let t19;
|
|
381
|
+
if ($[58] !== rest || $[59] !== t16 || $[60] !== t18 || $[61] !== token.marginXS) {
|
|
382
|
+
t19 = /*#__PURE__*/_jsxs(Flex, {
|
|
383
|
+
vertical: true,
|
|
384
|
+
gap: token.marginXS,
|
|
385
|
+
...rest,
|
|
386
|
+
children: [t16, t18]
|
|
387
|
+
});
|
|
388
|
+
$[58] = rest;
|
|
389
|
+
$[59] = t16;
|
|
390
|
+
$[60] = t18;
|
|
391
|
+
$[61] = token.marginXS;
|
|
392
|
+
$[62] = t19;
|
|
393
|
+
} else {
|
|
394
|
+
t19 = $[62];
|
|
395
|
+
}
|
|
396
|
+
return t19;
|
|
397
|
+
}
|
|
398
|
+
function _temp5() {
|
|
399
|
+
return {
|
|
400
|
+
style: {
|
|
401
|
+
position: "sticky",
|
|
402
|
+
top: 0,
|
|
403
|
+
zIndex: 1
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function _temp4(x_0, i) {
|
|
408
|
+
return {
|
|
409
|
+
key: i,
|
|
410
|
+
x: x_0
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function _temp3() {}
|
|
414
|
+
function _temp2(series_2) {
|
|
415
|
+
return series_2.name;
|
|
416
|
+
}
|
|
417
|
+
function _temp(series_1) {
|
|
418
|
+
return echarts.lineSeries(series_1);
|
|
223
419
|
}
|
|
224
420
|
export default LineChartTable;
|
|
225
421
|
const useStyles = createStyles(({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { ConfigProvider, theme } from "antd";
|
|
3
|
-
import { createContext,
|
|
3
|
+
import { createContext, use } from "react";
|
|
4
4
|
import * as echarts from "../echarts";
|
|
5
5
|
import ConnectedECharts, { EChartsConnector } from "./ConnectedECharts";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -79,11 +79,11 @@ function LinkedLineChart(props) {
|
|
|
79
79
|
const series = t1 === undefined ? [] : t1;
|
|
80
80
|
const dataZoom = t2 === undefined ? true : t2;
|
|
81
81
|
const unitString = yUnit !== undefined ? `(${yUnit})` : "";
|
|
82
|
-
const isDark =
|
|
82
|
+
const isDark = use(ConfigProvider.ConfigContext).theme?.algorithm === theme.darkAlgorithm;
|
|
83
83
|
const {
|
|
84
84
|
xData,
|
|
85
85
|
xName
|
|
86
|
-
} =
|
|
86
|
+
} = use(LineChartLinkContext);
|
|
87
87
|
const option = echarts.buildEChartsOption({
|
|
88
88
|
backgroundColor: "transparent"
|
|
89
89
|
}, echarts.useGrid({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ButtonProps, type SpaceProps } from "antd";
|
|
2
2
|
import type { RangePickerProps } from "antd/es/date-picker";
|
|
3
3
|
import { type Dayjs } from "dayjs";
|
|
4
|
-
import type { NoUndefinedRangeValueType } from "rc-picker/lib/PickerInput/RangePicker";
|
|
5
4
|
export interface QuickDateRangePickerProps extends Omit<SpaceProps, "onChange"> {
|
|
6
5
|
/** 一个二元组 `[start, end]`,表示时间段的开始和结束。*/
|
|
7
6
|
value?: NoUndefinedRangeValueType<Dayjs>;
|
|
@@ -19,6 +18,7 @@ export interface QuickDateRangePickerProps extends Omit<SpaceProps, "onChange">
|
|
|
19
18
|
*/
|
|
20
19
|
pickerProps?: RangePickerProps;
|
|
21
20
|
}
|
|
21
|
+
type NoUndefinedRangeValueType<T> = [T, T];
|
|
22
22
|
/**
|
|
23
23
|
* 带有快速选择最近 3/5/7 天功能的日期范围选择器。
|
|
24
24
|
*
|
|
@@ -12,7 +12,6 @@ const QUICK_PICK_RANGES = [{
|
|
|
12
12
|
value: 7,
|
|
13
13
|
label: "最近 7 天"
|
|
14
14
|
}];
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* 带有快速选择最近 3/5/7 天功能的日期范围选择器。
|
|
18
17
|
*
|
|
@@ -28,9 +27,9 @@ function QuickDateRangePicker(props) {
|
|
|
28
27
|
pickerProps,
|
|
29
28
|
...rest
|
|
30
29
|
} = props;
|
|
31
|
-
const [range, setRange] = value === undefined
|
|
30
|
+
const [range, setRange] = value === undefined
|
|
32
31
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
33
|
-
useState(undefined) : [value, () => {}];
|
|
32
|
+
? useState(undefined) : [value, () => {}];
|
|
34
33
|
function quickPick(value) {
|
|
35
34
|
const end = dayjs();
|
|
36
35
|
const start = end.subtract(value - 1, "day");
|
|
@@ -65,7 +65,7 @@ export interface SidebarProps extends MenuProps {
|
|
|
65
65
|
/**
|
|
66
66
|
* 出自 TMS 系统的侧边栏组件。该组件需要放置在 [Ant Design 的 `Layout` 组件][1]内部才能正常工作。
|
|
67
67
|
* 如果没有指定 {@linkcode SidebarProps.footer | footer} 属性,
|
|
68
|
-
* 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode
|
|
68
|
+
* 那么还需要包裹在 {@linkcode AuthProvider} 内,并且经过 {@linkcode LoginCheck} 验证后
|
|
69
69
|
* 才能正常显示边栏底部的用户信息按钮。
|
|
70
70
|
*
|
|
71
71
|
* 一般来说,使用该组件时至少需要提供 `logo`、`items` 和 `onSelect` 三个属性,具体用法请参照范例。
|