aldehyde 0.2.512 → 0.2.514
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/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +99 -99
- package/lib/draw-canvas-edit/components/asset-bar/index.less +35 -35
- package/lib/draw-canvas-edit/components/main-header/index.less +23 -23
- package/lib/lowcode-components/base-table/index.less +61 -61
- package/lib/lowcode-components/column-3d-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/column-3d-chart/index.js +8 -4
- package/lib/lowcode-components/column-3d-chart/index.js.map +1 -1
- package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/column-chart/index.js +8 -4
- package/lib/lowcode-components/column-chart/index.js.map +1 -1
- package/lib/lowcode-components/data-number/index.less +10 -10
- package/lib/lowcode-components/date-time/index.less +4 -4
- package/lib/lowcode-components/four-angle-glow-border/index.less +49 -49
- package/lib/lowcode-components/line-bar-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/line-bar-chart/index.js +8 -4
- package/lib/lowcode-components/line-bar-chart/index.js.map +1 -1
- package/lib/lowcode-components/line-chart/index.d.ts +1 -0
- package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
- package/lib/lowcode-components/line-chart/index.js +26 -3
- package/lib/lowcode-components/line-chart/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
- package/lib/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
- package/lib/lowcode-components/text-scroller/index.less +28 -28
- package/lib/table/act-table.js +1 -1
- package/lib/table/act-table.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +99 -99
- package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.json +156 -156
- package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.less +35 -35
- package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.tsx +110 -110
- package/src/aldehyde/draw-canvas-edit/components/main-header/index.less +23 -23
- package/src/aldehyde/draw-canvas-edit/components/main-header/index.tsx +263 -263
- package/src/aldehyde/draw-canvas-edit/components/render/draws/index.ts +7 -7
- package/src/aldehyde/draw-canvas-edit/components/render/graphs/base-graph.ts +241 -241
- package/src/aldehyde/draw-canvas-edit/components/render/graphs/circle.ts +699 -699
- package/src/aldehyde/draw-canvas-edit/components/render/graphs/curve.ts +500 -500
- package/src/aldehyde/draw-canvas-edit/components/render/graphs/index.ts +5 -5
- package/src/aldehyde/draw-canvas-edit/components/render/graphs/line.ts +493 -493
- package/src/aldehyde/draw-canvas-edit/components/render/graphs/rect.ts +680 -680
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/drag-handlers.ts +68 -68
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/graph-handlers.ts +113 -113
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/index.ts +9 -9
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/key-move-handlers.ts +49 -49
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/link-handlers.ts +45 -45
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/shutcut-handlers.ts +45 -45
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/text-handlers.ts +81 -81
- package/src/aldehyde/draw-canvas-edit/components/render/handlers/zoom-handlers.ts +59 -59
- package/src/aldehyde/draw-canvas-edit/components/render/tools/align-tool.ts +89 -89
- package/src/aldehyde/draw-canvas-edit/components/render/tools/asset-tool.ts +154 -154
- package/src/aldehyde/draw-canvas-edit/components/render/tools/link-tool.ts +222 -222
- package/src/aldehyde/draw-canvas-edit/components/render/tools/z-index-tool.ts +224 -224
- package/src/aldehyde/draw-canvas-edit/components/render/utils/a-star.ts +116 -116
- package/src/aldehyde/draw-canvas-edit/components/render/utils/bezier-scene-func.ts +72 -72
- package/src/aldehyde/draw-canvas-edit/components/setting-form/imag-upload.tsx +119 -119
- package/src/aldehyde/layout4/imgs/user.svg +26 -26
- package/src/aldehyde/lowcode-components/base-color-block/index.tsx +31 -31
- package/src/aldehyde/lowcode-components/base-table/index.less +61 -61
- package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +8 -4
- package/src/aldehyde/lowcode-components/column-chart/index.tsx +8 -4
- package/src/aldehyde/lowcode-components/data-number/index.less +10 -10
- package/src/aldehyde/lowcode-components/date-time/index.less +4 -4
- package/src/aldehyde/lowcode-components/date-time/index.tsx +64 -64
- package/src/aldehyde/lowcode-components/four-angle-glow-border/index.less +49 -49
- package/src/aldehyde/lowcode-components/four-angle-glow-border/index.tsx +53 -53
- package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +8 -5
- package/src/aldehyde/lowcode-components/line-chart/index.tsx +26 -3
- package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-controller.ts +64 -64
- package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-definition.ts +77 -77
- package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-designer-loader.ts +36 -36
- package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +144 -144
- package/src/aldehyde/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
- package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/controller.ts +36 -36
- package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/definition.ts +53 -53
- package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/index.tsx +15 -15
- package/src/aldehyde/lowcode-components/lowcode-view/component/layer-builder.tsx +98 -98
- package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
- package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +121 -121
- package/src/aldehyde/lowcode-components/placeholder-component/index.tsx +81 -81
- package/src/aldehyde/lowcode-components/text-scroller/index.less +28 -28
- package/src/aldehyde/lowcode-components/text-scroller/index.tsx +173 -173
- package/src/aldehyde/table/act-table.tsx +1 -1
|
@@ -5,7 +5,7 @@ import { Spin } from "antd";
|
|
|
5
5
|
import { useLocale } from "../../locale/useLocale";
|
|
6
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
7
7
|
import { DataConfigProps } from "../data";
|
|
8
|
-
import { handleTimeDataSort } from "../line-chart";
|
|
8
|
+
import { handleTimeDataSort, formatNumberUnit } from "../line-chart";
|
|
9
9
|
|
|
10
10
|
const defData = [["1990", 52], ["1991", 45], ["1992", 35], ["1993", 41], ["1994", 23], ["1995", 25], ["1996", 15]];
|
|
11
11
|
|
|
@@ -23,9 +23,11 @@ const defOption = {
|
|
|
23
23
|
type: 'category',
|
|
24
24
|
boundaryGap: true,
|
|
25
25
|
axisTick: { show: true },
|
|
26
|
+
axisLabel: {}
|
|
26
27
|
},
|
|
27
28
|
yAxis: {
|
|
28
|
-
type: 'value'
|
|
29
|
+
type: 'value',
|
|
30
|
+
axisLabel: {}
|
|
29
31
|
},
|
|
30
32
|
legend: { show: false },
|
|
31
33
|
dataZoom: [],
|
|
@@ -298,6 +300,8 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
298
300
|
const renderChart = () => {
|
|
299
301
|
const { grid, barWidth, legend, tooltip, color, xAxis, yAxis, isBackground, dataZoom, slider, groupType } = config;
|
|
300
302
|
const option = _.cloneDeep(defOption);
|
|
303
|
+
const yAxisLabel = yAxis?.axisLabel;
|
|
304
|
+
const xAxisLabel = xAxis?.axisLabel;
|
|
301
305
|
// 编辑态无数据显示默认数据
|
|
302
306
|
const temData = isDesignMode && !data?.length ? defData : data;
|
|
303
307
|
// 背景数据
|
|
@@ -310,8 +314,8 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
310
314
|
option.grid = grid;
|
|
311
315
|
option.legend = { ...legend, ...legends[legend?.position] };
|
|
312
316
|
option.tooltip = { trigger: "axis", ...tooltip };
|
|
313
|
-
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
314
|
-
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
317
|
+
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show }, axisLabel: xAxisLabel.numFormat && xAxis.type === "value" ? { ...xAxisLabel, formatter: formatNumberUnit } : xAxisLabel };
|
|
318
|
+
option.yAxis = { ...option.yAxis, ...yAxis, axisLabel: yAxisLabel.numFormat && yAxis.type === "value" ? { ...yAxisLabel, formatter: formatNumberUnit } : yAxisLabel };
|
|
315
319
|
option.dataZoom = dataZoom ? [slider ? { type: "slider" } : undefined, { type: "inside", disabled: false }].filter(Boolean) : [];
|
|
316
320
|
option.title.text = translate("${暂无数据}");
|
|
317
321
|
option.title.show = !temData?.length;
|
|
@@ -5,7 +5,7 @@ import { Spin } from "antd";
|
|
|
5
5
|
import { useLocale } from "../../locale/useLocale";
|
|
6
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
7
7
|
import { DataConfigProps } from "../data";
|
|
8
|
-
import { handleTimeDataSort } from "../line-chart";
|
|
8
|
+
import { handleTimeDataSort, formatNumberUnit } from "../line-chart";
|
|
9
9
|
|
|
10
10
|
const defColumnValue = [
|
|
11
11
|
{
|
|
@@ -47,9 +47,11 @@ const defOption = {
|
|
|
47
47
|
type: 'category',
|
|
48
48
|
boundaryGap: true,
|
|
49
49
|
axisTick: { show: true },
|
|
50
|
+
axisLabel: {}
|
|
50
51
|
},
|
|
51
52
|
yAxis: {
|
|
52
|
-
type: 'value'
|
|
53
|
+
type: 'value',
|
|
54
|
+
axisLabel: {}
|
|
53
55
|
},
|
|
54
56
|
dataZoom: [],
|
|
55
57
|
legend: { show: false },
|
|
@@ -284,14 +286,16 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
284
286
|
const renderChart = (tData) => {
|
|
285
287
|
const { grid, barMaxWidth, legend, tooltip, color, xAxis, yAxis, dataZoom, slider, markLineColor, groupType } = config
|
|
286
288
|
const option = _.cloneDeep(defOption);
|
|
289
|
+
const yAxisLabel = yAxis?.axisLabel;
|
|
290
|
+
const xAxisLabel = xAxis?.axisLabel;
|
|
287
291
|
// 编辑态无数据显示默认数据
|
|
288
292
|
const temData = isDesignMode && !tData?.length ? defDatas[componentType] || [] : tData;
|
|
289
293
|
option.barMaxWidth = barMaxWidth;
|
|
290
294
|
option.grid = grid;
|
|
291
295
|
option.legend = { ...legend, ...legends[legend?.position], data: temData?.filter((item: any) => !item.isMarkLine && item.name).map((r: any) => r.name) };
|
|
292
296
|
option.tooltip = { trigger: "axis", ...tooltip };
|
|
293
|
-
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
294
|
-
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
297
|
+
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show }, axisLabel: xAxisLabel.numFormat && xAxis.type === "value" ? { ...xAxisLabel, formatter: formatNumberUnit } : xAxisLabel };
|
|
298
|
+
option.yAxis = { ...option.yAxis, ...yAxis, axisLabel: yAxisLabel.numFormat && yAxis.type === "value" ? { ...yAxisLabel, formatter: formatNumberUnit } : yAxisLabel };
|
|
295
299
|
option.dataZoom = dataZoom ? [slider ? { type: "slider" } : undefined, { type: "inside", disabled: false }].filter(Boolean) : [];
|
|
296
300
|
option.title.text = translate("${暂无数据}");
|
|
297
301
|
option.title.show = !temData?.length;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.data-number-component {
|
|
2
|
-
--stroke-color: #000000;
|
|
3
|
-
--stroke-width: 0;
|
|
4
|
-
|
|
5
|
-
height: 100%;
|
|
6
|
-
display: flex;
|
|
7
|
-
-webkit-text-stroke-color: var(--stroke-color);
|
|
8
|
-
-webkit-text-stroke-width: var(--stroke-width);
|
|
9
|
-
stroke-color: var(--stroke-color);
|
|
10
|
-
stroke-width: var(--stroke-width);
|
|
1
|
+
.data-number-component {
|
|
2
|
+
--stroke-color: #000000;
|
|
3
|
+
--stroke-width: 0;
|
|
4
|
+
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
-webkit-text-stroke-color: var(--stroke-color);
|
|
8
|
+
-webkit-text-stroke-width: var(--stroke-width);
|
|
9
|
+
stroke-color: var(--stroke-color);
|
|
10
|
+
stroke-width: var(--stroke-width);
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
.date-time-component {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
1
|
+
.date-time-component {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
5
|
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
2
|
-
import dayjs from "dayjs";
|
|
3
|
-
import './index.less';
|
|
4
|
-
|
|
5
|
-
export interface DateTimeComponentStyle {
|
|
6
|
-
fontSize?: number;
|
|
7
|
-
color?: string;
|
|
8
|
-
fontFamily?: string;
|
|
9
|
-
fontWeight?: number;
|
|
10
|
-
alignItems?: string;
|
|
11
|
-
justifyContent?: string;
|
|
12
|
-
letterSpacing?: string;
|
|
13
|
-
formatType?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface DateTimeComponentProps {
|
|
17
|
-
style?: DateTimeComponentStyle;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface DateTimeComponentRef {
|
|
21
|
-
updateConfig: (newConfig: DateTimeComponentProps) => void;
|
|
22
|
-
setEventHandler: (eventMap: Record<string, Function>) => void;
|
|
23
|
-
destroy: () => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const defFormatType = "YYYY年MM月DD日 HH时mm分ss秒";
|
|
27
|
-
|
|
28
|
-
const DateTimeComponent = forwardRef((props: DateTimeComponentProps, ref: ForwardedRef<DateTimeComponentRef>) => {
|
|
29
|
-
const [config, setConfig] = useState<DateTimeComponentProps>({ ...props });
|
|
30
|
-
const [datetime, setDateTime] = useState<string>(dayjs().format(config.style?.formatType || defFormatType));
|
|
31
|
-
const timeRef = useRef<NodeJS.Timeout | null>(null);
|
|
32
|
-
const eventHandlerMap = useRef<Record<string, Function>>({});
|
|
33
|
-
|
|
34
|
-
const handleClearInterval = () => {
|
|
35
|
-
timeRef.current && clearInterval(timeRef.current);
|
|
36
|
-
timeRef.current = null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
timeRef.current = setInterval(() => {
|
|
41
|
-
setDateTime(dayjs().format(config.style?.formatType || defFormatType));
|
|
42
|
-
}, 1000);
|
|
43
|
-
return () => {
|
|
44
|
-
handleClearInterval();
|
|
45
|
-
}
|
|
46
|
-
}, []);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
useImperativeHandle(ref, () => ({
|
|
50
|
-
updateConfig: (newConfig) => setConfig({ ...newConfig }),
|
|
51
|
-
setEventHandler: (eventMap) => eventHandlerMap.current = eventMap,
|
|
52
|
-
destroy: () => {
|
|
53
|
-
handleClearInterval();
|
|
54
|
-
}
|
|
55
|
-
}));
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<div className="date-time-component" style={{ ...(config?.style || {}) }}>
|
|
60
|
-
{datetime}
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
});
|
|
64
|
-
|
|
1
|
+
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import './index.less';
|
|
4
|
+
|
|
5
|
+
export interface DateTimeComponentStyle {
|
|
6
|
+
fontSize?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
fontFamily?: string;
|
|
9
|
+
fontWeight?: number;
|
|
10
|
+
alignItems?: string;
|
|
11
|
+
justifyContent?: string;
|
|
12
|
+
letterSpacing?: string;
|
|
13
|
+
formatType?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface DateTimeComponentProps {
|
|
17
|
+
style?: DateTimeComponentStyle;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DateTimeComponentRef {
|
|
21
|
+
updateConfig: (newConfig: DateTimeComponentProps) => void;
|
|
22
|
+
setEventHandler: (eventMap: Record<string, Function>) => void;
|
|
23
|
+
destroy: () => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const defFormatType = "YYYY年MM月DD日 HH时mm分ss秒";
|
|
27
|
+
|
|
28
|
+
const DateTimeComponent = forwardRef((props: DateTimeComponentProps, ref: ForwardedRef<DateTimeComponentRef>) => {
|
|
29
|
+
const [config, setConfig] = useState<DateTimeComponentProps>({ ...props });
|
|
30
|
+
const [datetime, setDateTime] = useState<string>(dayjs().format(config.style?.formatType || defFormatType));
|
|
31
|
+
const timeRef = useRef<NodeJS.Timeout | null>(null);
|
|
32
|
+
const eventHandlerMap = useRef<Record<string, Function>>({});
|
|
33
|
+
|
|
34
|
+
const handleClearInterval = () => {
|
|
35
|
+
timeRef.current && clearInterval(timeRef.current);
|
|
36
|
+
timeRef.current = null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
timeRef.current = setInterval(() => {
|
|
41
|
+
setDateTime(dayjs().format(config.style?.formatType || defFormatType));
|
|
42
|
+
}, 1000);
|
|
43
|
+
return () => {
|
|
44
|
+
handleClearInterval();
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
useImperativeHandle(ref, () => ({
|
|
50
|
+
updateConfig: (newConfig) => setConfig({ ...newConfig }),
|
|
51
|
+
setEventHandler: (eventMap) => eventHandlerMap.current = eventMap,
|
|
52
|
+
destroy: () => {
|
|
53
|
+
handleClearInterval();
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div className="date-time-component" style={{ ...(config?.style || {}) }}>
|
|
60
|
+
{datetime}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
65
|
export default DateTimeComponent;
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
.four-angle-glow {
|
|
2
|
-
--fagb-color: #00ebff;
|
|
3
|
-
--fagb-width: 2px;
|
|
4
|
-
--fagb-length: 8px;
|
|
5
|
-
--fagb-radius: 3px;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
position: relative;
|
|
9
|
-
|
|
10
|
-
.angle {
|
|
11
|
-
position: absolute;
|
|
12
|
-
border: var(--fagb-width) solid var(--fagb-color);
|
|
13
|
-
width: var(--fagb-length);
|
|
14
|
-
height: var(--fagb-length);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.angle-tl {
|
|
18
|
-
margin: -1px 0 0 -1px;
|
|
19
|
-
border-right: 0;
|
|
20
|
-
border-bottom: 0;
|
|
21
|
-
border-top-left-radius: var(--fagb-radius);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.angle-tr {
|
|
25
|
-
top: 0;
|
|
26
|
-
right: 0;
|
|
27
|
-
border-left: 0;
|
|
28
|
-
border-bottom: 0;
|
|
29
|
-
margin: -1px -1px 0 0;
|
|
30
|
-
border-top-right-radius: var(--fagb-radius);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.angle-bl {
|
|
34
|
-
bottom: 0;
|
|
35
|
-
left: 0;
|
|
36
|
-
border-top: 0;
|
|
37
|
-
border-right: 0;
|
|
38
|
-
margin: 0 0 -1px -1px;
|
|
39
|
-
border-bottom-left-radius: var(--fagb-radius);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.angle-br {
|
|
43
|
-
bottom: 0;
|
|
44
|
-
right: 0;
|
|
45
|
-
border-left: 0;
|
|
46
|
-
border-top: 0;
|
|
47
|
-
margin: 0 -1px -1px 0;
|
|
48
|
-
border-bottom-right-radius: var(--fagb-radius);
|
|
49
|
-
}
|
|
1
|
+
.four-angle-glow {
|
|
2
|
+
--fagb-color: #00ebff;
|
|
3
|
+
--fagb-width: 2px;
|
|
4
|
+
--fagb-length: 8px;
|
|
5
|
+
--fagb-radius: 3px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
.angle {
|
|
11
|
+
position: absolute;
|
|
12
|
+
border: var(--fagb-width) solid var(--fagb-color);
|
|
13
|
+
width: var(--fagb-length);
|
|
14
|
+
height: var(--fagb-length);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.angle-tl {
|
|
18
|
+
margin: -1px 0 0 -1px;
|
|
19
|
+
border-right: 0;
|
|
20
|
+
border-bottom: 0;
|
|
21
|
+
border-top-left-radius: var(--fagb-radius);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.angle-tr {
|
|
25
|
+
top: 0;
|
|
26
|
+
right: 0;
|
|
27
|
+
border-left: 0;
|
|
28
|
+
border-bottom: 0;
|
|
29
|
+
margin: -1px -1px 0 0;
|
|
30
|
+
border-top-right-radius: var(--fagb-radius);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.angle-bl {
|
|
34
|
+
bottom: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
border-top: 0;
|
|
37
|
+
border-right: 0;
|
|
38
|
+
margin: 0 0 -1px -1px;
|
|
39
|
+
border-bottom-left-radius: var(--fagb-radius);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.angle-br {
|
|
43
|
+
bottom: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
border-left: 0;
|
|
46
|
+
border-top: 0;
|
|
47
|
+
margin: 0 -1px -1px 0;
|
|
48
|
+
border-bottom-right-radius: var(--fagb-radius);
|
|
49
|
+
}
|
|
50
50
|
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import './index.less';
|
|
2
|
-
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
3
|
-
|
|
4
|
-
export interface FourAngleGlowBorderStyle {
|
|
5
|
-
width?: number;
|
|
6
|
-
length?: number;
|
|
7
|
-
color?: string;
|
|
8
|
-
radius?: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface FourAngleGlowProps {
|
|
12
|
-
style?: FourAngleGlowBorderStyle;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface FourAngleGlowBorderRef {
|
|
16
|
-
updateConfig: (config: FourAngleGlowProps) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const FourAngleGlowBorder = forwardRef((props: FourAngleGlowProps, ref: ForwardedRef<FourAngleGlowBorderRef>) => {
|
|
20
|
-
const [config] = useState<FourAngleGlowProps>({ ...props });
|
|
21
|
-
const fourAngleGlowRef = useRef<HTMLDivElement | null>(null);
|
|
22
|
-
|
|
23
|
-
const updateStyle = (style: FourAngleGlowBorderStyle) => {
|
|
24
|
-
const dom = fourAngleGlowRef.current;
|
|
25
|
-
if (dom) {
|
|
26
|
-
dom.style.setProperty('--fagb-length', `${style?.length}px`);
|
|
27
|
-
dom.style.setProperty('--fagb-color', style?.color);
|
|
28
|
-
dom.style.setProperty('--fagb-radius', `${style?.radius}px`);
|
|
29
|
-
dom.style.setProperty('--fagb-width', `${style?.width}px`);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
useImperativeHandle(ref, () => ({
|
|
34
|
-
updateConfig: (newConfig) => updateStyle({ ...newConfig.style }),
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
updateStyle(config.style);
|
|
39
|
-
}, []);
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div className="four-angle-glow" ref={fourAngleGlowRef}>
|
|
43
|
-
<span className="angle angle-tl" />
|
|
44
|
-
<span className="angle angle-tr" />
|
|
45
|
-
<span className="angle angle-bl" />
|
|
46
|
-
<span className="angle angle-br" />
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
export default FourAngleGlowBorder;
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import './index.less';
|
|
2
|
+
import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
3
|
+
|
|
4
|
+
export interface FourAngleGlowBorderStyle {
|
|
5
|
+
width?: number;
|
|
6
|
+
length?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
radius?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface FourAngleGlowProps {
|
|
12
|
+
style?: FourAngleGlowBorderStyle;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface FourAngleGlowBorderRef {
|
|
16
|
+
updateConfig: (config: FourAngleGlowProps) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const FourAngleGlowBorder = forwardRef((props: FourAngleGlowProps, ref: ForwardedRef<FourAngleGlowBorderRef>) => {
|
|
20
|
+
const [config] = useState<FourAngleGlowProps>({ ...props });
|
|
21
|
+
const fourAngleGlowRef = useRef<HTMLDivElement | null>(null);
|
|
22
|
+
|
|
23
|
+
const updateStyle = (style: FourAngleGlowBorderStyle) => {
|
|
24
|
+
const dom = fourAngleGlowRef.current;
|
|
25
|
+
if (dom) {
|
|
26
|
+
dom.style.setProperty('--fagb-length', `${style?.length}px`);
|
|
27
|
+
dom.style.setProperty('--fagb-color', style?.color);
|
|
28
|
+
dom.style.setProperty('--fagb-radius', `${style?.radius}px`);
|
|
29
|
+
dom.style.setProperty('--fagb-width', `${style?.width}px`);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
useImperativeHandle(ref, () => ({
|
|
34
|
+
updateConfig: (newConfig) => updateStyle({ ...newConfig.style }),
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
updateStyle(config.style);
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className="four-angle-glow" ref={fourAngleGlowRef}>
|
|
43
|
+
<span className="angle angle-tl" />
|
|
44
|
+
<span className="angle angle-tr" />
|
|
45
|
+
<span className="angle angle-bl" />
|
|
46
|
+
<span className="angle angle-br" />
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
export default FourAngleGlowBorder;
|
|
52
|
+
|
|
53
|
+
|
|
@@ -5,8 +5,7 @@ import { Spin } from "antd";
|
|
|
5
5
|
import { useLocale } from "../../locale/useLocale";
|
|
6
6
|
import HydrocarbonService from "../../tmpl/hcservice-v3";
|
|
7
7
|
import { DataConfigProps } from "../data";
|
|
8
|
-
import { handleTimeDataSort } from "../line-chart";
|
|
9
|
-
|
|
8
|
+
import { handleTimeDataSort, formatNumberUnit } from "../line-chart";
|
|
10
9
|
|
|
11
10
|
const defOption = {
|
|
12
11
|
title: {
|
|
@@ -21,9 +20,11 @@ const defOption = {
|
|
|
21
20
|
type: 'category',
|
|
22
21
|
boundaryGap: true,
|
|
23
22
|
axisTick: { show: true },
|
|
23
|
+
axisLabel: {}
|
|
24
24
|
},
|
|
25
25
|
yAxis: {
|
|
26
|
-
type: 'value'
|
|
26
|
+
type: 'value',
|
|
27
|
+
axisLabel: {}
|
|
27
28
|
},
|
|
28
29
|
legend: { show: false },
|
|
29
30
|
barMaxWidth: 20,
|
|
@@ -276,14 +277,16 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
276
277
|
const renderChart = (tData) => {
|
|
277
278
|
const { grid, legend, tooltip, color, xAxis, yAxis, smooth, lineStyle, step, isArea, isGradient, areaStyle, barMaxWidth, symbol, dataZoom, slider, connectNulls, markLineColor, groupType } = config;
|
|
278
279
|
const option = _.cloneDeep(defOption);
|
|
280
|
+
const yAxisLabel = yAxis?.axisLabel;
|
|
281
|
+
const xAxisLabel = xAxis?.axisLabel;
|
|
279
282
|
// 编辑态无数据显示默认数据
|
|
280
283
|
const temData = isDesignMode && !tData?.length ? option.series : tData;
|
|
281
284
|
option.barMaxWidth = barMaxWidth;
|
|
282
285
|
option.grid = grid;
|
|
283
286
|
option.legend = { ...legend, ...legends[legend?.position], data: temData?.filter((item: any) => !item.isMarkLine && item.name).map((r: any) => r.name) };
|
|
284
287
|
option.tooltip = { trigger: "axis", ...tooltip };
|
|
285
|
-
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
286
|
-
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
288
|
+
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show }, axisLabel: xAxisLabel.numFormat && xAxis.type === "value" ? { ...xAxisLabel, formatter: formatNumberUnit } : xAxisLabel };
|
|
289
|
+
option.yAxis = { ...option.yAxis, ...yAxis, axisLabel: yAxisLabel.numFormat && yAxis.type === "value" ? { ...yAxisLabel, formatter: formatNumberUnit } : yAxisLabel };
|
|
287
290
|
option.dataZoom = dataZoom ? [slider ? { type: "slider" } : undefined, { type: "inside", disabled: false }].filter(Boolean) : [];
|
|
288
291
|
option.title.text = translate("${暂无数据}");
|
|
289
292
|
option.title.show = !temData?.length;
|
|
@@ -20,9 +20,11 @@ const defOption = {
|
|
|
20
20
|
type: 'category',
|
|
21
21
|
boundaryGap: true,
|
|
22
22
|
axisTick: { show: true },
|
|
23
|
+
axisLabel: {}
|
|
23
24
|
},
|
|
24
25
|
yAxis: {
|
|
25
|
-
type: 'value'
|
|
26
|
+
type: 'value',
|
|
27
|
+
axisLabel: {}
|
|
26
28
|
},
|
|
27
29
|
legend: { show: false },
|
|
28
30
|
dataZoom: [],
|
|
@@ -62,6 +64,25 @@ export const handleTimeDataSort = (data: { [key: string]: any }[], name: string,
|
|
|
62
64
|
return temData;
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
// 数值单位格式化
|
|
68
|
+
export const formatNumberUnit = (val: number | null | undefined, digit = 1) => {
|
|
69
|
+
if (val === null || val === undefined) return val;
|
|
70
|
+
const absVal = Math.abs(val);
|
|
71
|
+
// 阈值从大到小排序,新增单位直接在这里加
|
|
72
|
+
const units = [
|
|
73
|
+
{ threshold: 100000000, divisor: 100000000, label: '亿' },
|
|
74
|
+
{ threshold: 10000000, divisor: 10000000, label: '千万' },
|
|
75
|
+
{ threshold: 10000, divisor: 10000, label: '万' }
|
|
76
|
+
];
|
|
77
|
+
for (const u of units) {
|
|
78
|
+
if (absVal >= u.threshold) {
|
|
79
|
+
const numStr = parseFloat((val / u.divisor).toFixed(digit));
|
|
80
|
+
return numStr + " " + u.label;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return String(val);
|
|
84
|
+
}
|
|
85
|
+
|
|
65
86
|
// 处理数据格式 nullSetZero(是否空值置0)
|
|
66
87
|
const handleData = (data: { config: { [key: string]: string }, value: { [key: string]: any }[] }[], nullSetZero?: boolean) => {
|
|
67
88
|
if (!data?.length) {
|
|
@@ -288,13 +309,15 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
|
|
|
288
309
|
const { grid, legend, tooltip, color, xAxis, yAxis, smooth, connectNulls, lineStyle, step, isArea, isGradient, areaStyle, dataZoom, slider, symbol: configSymbol, markLineColor, groupType } = config;
|
|
289
310
|
const { itemStyle, ...symbol } = configSymbol || {};
|
|
290
311
|
const option = _.cloneDeep(defOption);
|
|
312
|
+
const yAxisLabel = yAxis?.axisLabel;
|
|
313
|
+
const xAxisLabel = xAxis?.axisLabel;
|
|
291
314
|
// 编辑态无数据显示默认数据
|
|
292
315
|
const temData = isDesignMode && !tData?.length ? option.series : tData;
|
|
293
316
|
option.grid = grid;
|
|
294
317
|
option.legend = { ...legend, ...legends[legend?.position], data: temData?.filter((item: any) => !item.isMarkLine && item.name).map((r: any) => r.name) };
|
|
295
318
|
option.tooltip = { trigger: "axis", ...tooltip };
|
|
296
|
-
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show } };
|
|
297
|
-
option.yAxis = { ...option.yAxis, ...yAxis };
|
|
319
|
+
option.xAxis = { ...option.xAxis, ...xAxis, axisTick: { show: xAxis?.axisLine?.show }, axisLabel: xAxisLabel.numFormat && xAxis.type === "value" ? { ...xAxisLabel, formatter: formatNumberUnit } : xAxisLabel };
|
|
320
|
+
option.yAxis = { ...option.yAxis, ...yAxis, axisLabel: yAxisLabel.numFormat && yAxis.type === "value" ? { ...yAxisLabel, formatter: formatNumberUnit } : yAxisLabel };
|
|
298
321
|
option.dataZoom = dataZoom ? [slider ? { type: "slider" } : undefined, { type: "inside", disabled: false }].filter(Boolean) : [];
|
|
299
322
|
option.title.text = translate("${暂无数据}");
|
|
300
323
|
option.title.show = !temData?.length;
|