aldehyde 0.2.503 → 0.2.504

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 (113) hide show
  1. package/lib/controls/action/index.d.ts +3 -1
  2. package/lib/controls/action/index.d.ts.map +1 -1
  3. package/lib/controls/action/index.js +17 -1
  4. package/lib/controls/action/index.js.map +1 -1
  5. package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +99 -99
  6. package/lib/draw-canvas-edit/components/asset-bar/index.less +35 -35
  7. package/lib/draw-canvas-edit/components/main-header/index.less +23 -23
  8. package/lib/lowcode-components/base-table/index.less +61 -61
  9. package/lib/lowcode-components/column-3d-chart/index.d.ts +1 -0
  10. package/lib/lowcode-components/column-3d-chart/index.d.ts.map +1 -1
  11. package/lib/lowcode-components/column-3d-chart/index.js +3 -1
  12. package/lib/lowcode-components/column-3d-chart/index.js.map +1 -1
  13. package/lib/lowcode-components/column-chart/index.d.ts +1 -0
  14. package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
  15. package/lib/lowcode-components/column-chart/index.js +3 -1
  16. package/lib/lowcode-components/column-chart/index.js.map +1 -1
  17. package/lib/lowcode-components/data-number/index.less +10 -10
  18. package/lib/lowcode-components/date-time/index.less +4 -4
  19. package/lib/lowcode-components/four-angle-glow-border/index.less +49 -49
  20. package/lib/lowcode-components/line-bar-chart/index.d.ts +1 -0
  21. package/lib/lowcode-components/line-bar-chart/index.d.ts.map +1 -1
  22. package/lib/lowcode-components/line-bar-chart/index.js +3 -1
  23. package/lib/lowcode-components/line-bar-chart/index.js.map +1 -1
  24. package/lib/lowcode-components/line-chart/index.d.ts +1 -0
  25. package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
  26. package/lib/lowcode-components/line-chart/index.js +3 -1
  27. package/lib/lowcode-components/line-chart/index.js.map +1 -1
  28. package/lib/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
  29. package/lib/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
  30. package/lib/lowcode-components/lowcode-view/index.d.ts.map +1 -1
  31. package/lib/lowcode-components/lowcode-view/index.js +8 -0
  32. package/lib/lowcode-components/lowcode-view/index.js.map +1 -1
  33. package/lib/lowcode-components/text-scroller/index.less +28 -28
  34. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  35. package/lib/module/dtmpl-edit-page.js +7 -7
  36. package/lib/module/dtmpl-edit-page.js.map +1 -1
  37. package/lib/table/act-table.d.ts.map +1 -1
  38. package/lib/table/act-table.js +6 -6
  39. package/lib/table/act-table.js.map +1 -1
  40. package/lib/table/column/column-builder.d.ts +1 -0
  41. package/lib/table/column/column-builder.d.ts.map +1 -1
  42. package/lib/table/column/column-builder.js +25 -16
  43. package/lib/table/column/column-builder.js.map +1 -1
  44. package/lib/table/column/index.less +8 -8
  45. package/lib/table/report-table.d.ts.map +1 -1
  46. package/lib/table/report-table.js +3 -3
  47. package/lib/table/report-table.js.map +1 -1
  48. package/lib/tmpl/interface.d.ts +7 -0
  49. package/lib/tmpl/interface.d.ts.map +1 -1
  50. package/lib/tmpl/interface.js.map +1 -1
  51. package/package.json +1 -1
  52. package/src/aldehyde/controls/action/index.tsx +33 -2
  53. package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +99 -99
  54. package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.json +156 -156
  55. package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.less +35 -35
  56. package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.tsx +110 -110
  57. package/src/aldehyde/draw-canvas-edit/components/main-header/index.less +23 -23
  58. package/src/aldehyde/draw-canvas-edit/components/main-header/index.tsx +263 -263
  59. package/src/aldehyde/draw-canvas-edit/components/render/draws/index.ts +7 -7
  60. package/src/aldehyde/draw-canvas-edit/components/render/graphs/base-graph.ts +241 -241
  61. package/src/aldehyde/draw-canvas-edit/components/render/graphs/circle.ts +699 -699
  62. package/src/aldehyde/draw-canvas-edit/components/render/graphs/curve.ts +500 -500
  63. package/src/aldehyde/draw-canvas-edit/components/render/graphs/index.ts +5 -5
  64. package/src/aldehyde/draw-canvas-edit/components/render/graphs/line.ts +493 -493
  65. package/src/aldehyde/draw-canvas-edit/components/render/graphs/rect.ts +680 -680
  66. package/src/aldehyde/draw-canvas-edit/components/render/handlers/drag-handlers.ts +68 -68
  67. package/src/aldehyde/draw-canvas-edit/components/render/handlers/graph-handlers.ts +113 -113
  68. package/src/aldehyde/draw-canvas-edit/components/render/handlers/index.ts +9 -9
  69. package/src/aldehyde/draw-canvas-edit/components/render/handlers/key-move-handlers.ts +49 -49
  70. package/src/aldehyde/draw-canvas-edit/components/render/handlers/link-handlers.ts +45 -45
  71. package/src/aldehyde/draw-canvas-edit/components/render/handlers/shutcut-handlers.ts +45 -45
  72. package/src/aldehyde/draw-canvas-edit/components/render/handlers/text-handlers.ts +81 -81
  73. package/src/aldehyde/draw-canvas-edit/components/render/handlers/zoom-handlers.ts +59 -59
  74. package/src/aldehyde/draw-canvas-edit/components/render/tools/align-tool.ts +89 -89
  75. package/src/aldehyde/draw-canvas-edit/components/render/tools/asset-tool.ts +154 -154
  76. package/src/aldehyde/draw-canvas-edit/components/render/tools/link-tool.ts +222 -222
  77. package/src/aldehyde/draw-canvas-edit/components/render/tools/z-index-tool.ts +224 -224
  78. package/src/aldehyde/draw-canvas-edit/components/render/utils/a-star.ts +116 -116
  79. package/src/aldehyde/draw-canvas-edit/components/render/utils/bezier-scene-func.ts +72 -72
  80. package/src/aldehyde/draw-canvas-edit/components/setting-form/imag-upload.tsx +119 -119
  81. package/src/aldehyde/layout4/imgs/user.svg +26 -26
  82. package/src/aldehyde/lowcode-components/base-color-block/index.tsx +31 -31
  83. package/src/aldehyde/lowcode-components/base-table/index.less +61 -61
  84. package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +3 -1
  85. package/src/aldehyde/lowcode-components/column-chart/index.tsx +3 -1
  86. package/src/aldehyde/lowcode-components/data-number/index.less +10 -10
  87. package/src/aldehyde/lowcode-components/date-time/index.less +4 -4
  88. package/src/aldehyde/lowcode-components/date-time/index.tsx +64 -64
  89. package/src/aldehyde/lowcode-components/four-angle-glow-border/index.less +49 -49
  90. package/src/aldehyde/lowcode-components/four-angle-glow-border/index.tsx +53 -53
  91. package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +3 -1
  92. package/src/aldehyde/lowcode-components/line-chart/index.tsx +3 -1
  93. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-controller.ts +64 -64
  94. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-definition.ts +77 -77
  95. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-designer-loader.ts +36 -36
  96. package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +144 -144
  97. package/src/aldehyde/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
  98. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/controller.ts +36 -36
  99. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/definition.ts +53 -53
  100. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/index.tsx +15 -15
  101. package/src/aldehyde/lowcode-components/lowcode-view/component/layer-builder.tsx +98 -98
  102. package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
  103. package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +121 -121
  104. package/src/aldehyde/lowcode-components/lowcode-view/index.tsx +9 -0
  105. package/src/aldehyde/lowcode-components/placeholder-component/index.tsx +81 -81
  106. package/src/aldehyde/lowcode-components/text-scroller/index.less +28 -28
  107. package/src/aldehyde/lowcode-components/text-scroller/index.tsx +173 -173
  108. package/src/aldehyde/module/dtmpl-edit-page.tsx +10 -10
  109. package/src/aldehyde/table/act-table.tsx +6 -6
  110. package/src/aldehyde/table/column/column-builder.tsx +26 -36
  111. package/src/aldehyde/table/column/index.less +8 -8
  112. package/src/aldehyde/table/report-table.tsx +3 -2
  113. package/src/aldehyde/tmpl/interface.tsx +7 -0
@@ -1,73 +1,73 @@
1
- import Konva from 'konva';
2
-
3
- function rotatePoint(x1: number, y1: number, x2: number, y2: number, angleInDegrees: number) {
4
- const radians = angleInDegrees * (Math.PI / 180);
5
- const cosTheta = Math.cos(radians);
6
- const sinTheta = Math.sin(radians);
7
-
8
- // Translate point (x2, y2) to be relative to (x1, y1)
9
- const x = x2 - x1;
10
- const y = y2 - y1;
11
-
12
- // Rotate point
13
- const xPrime = cosTheta * x - sinTheta * y;
14
- const yPrime = sinTheta * x + cosTheta * y;
15
-
16
- // Translate back
17
- const xNew = xPrime + x1;
18
- const yNew = yPrime + y1;
19
-
20
- return { x: xNew, y: yNew };
21
- }
22
-
23
- function drawPointer(ctx: Konva.Context, shape: Konva.Shape, startX: number, startY: number, ctrlX: number, ctrlY: number) {
24
- const x2 = startX + 12;
25
- const y2 = startY - 6;
26
- const x3 = startX + 12;
27
- const y3 = startY + 6;
28
- const angle = (Math.atan2(ctrlY - startY, ctrlX - startX) * 180) / Math.PI;
29
- const p2 = rotatePoint(startX, startY, x2, y2, angle);
30
- const p3 = rotatePoint(startX, startY, x3, y3, angle);
31
- ctx.beginPath();
32
- ctx.moveTo(startX, startY);
33
- ctx.lineTo(p2.x, p2.y);
34
- ctx.lineTo(p3.x, p3.y);
35
- ctx.lineTo(startX, startY);
36
- ctx.lineTo(p2.x, p2.y);
37
- ctx.strokeShape(shape);
38
- ctx.fillShape(shape);
39
- }
40
-
41
- export function BezierSceneFunc(ctx: Konva.Context, shape: Konva.Shape) {
42
- if (shape instanceof Konva.Arrow) {
43
- const ps = shape.points();
44
- if (ps.length / 2 === 4) {
45
- // 三次
46
- ctx.beginPath();
47
- ctx.moveTo(ps[0], ps[1]);
48
- ctx.bezierCurveTo(ps[2], ps[3], ps[4], ps[5], ps[6], ps[7]);
49
- ctx.strokeShape(shape);
50
- ctx.closePath();
51
- shape.pointerAtBeginning() && drawPointer(ctx, shape, ps[0], ps[1], ps[2], ps[3]);
52
- shape.pointerAtEnding() && drawPointer(ctx, shape, ps[6], ps[7], ps[4], ps[5]);
53
- } else if (ps.length / 2 === 3) {
54
- // 二次
55
- ctx.beginPath();
56
- ctx.moveTo(ps[0], ps[1]);
57
- ctx.quadraticCurveTo(ps[2], ps[3], ps[4], ps[5]);
58
- ctx.strokeShape(shape);
59
- ctx.closePath();
60
- shape.pointerAtBeginning() && drawPointer(ctx, shape, ps[0], ps[1], ps[2], ps[3]);
61
- shape.pointerAtEnding() && drawPointer(ctx, shape, ps[4], ps[5], ps[2], ps[3]);
62
- } else {
63
- // 直线
64
- ctx.beginPath();
65
- ctx.moveTo(ps[0], ps[1]);
66
- ctx.lineTo(ps[2], ps[3]);
67
- ctx.strokeShape(shape);
68
- ctx.closePath();
69
- shape.pointerAtBeginning() && drawPointer(ctx, shape, ps[0], ps[1], ps[2], ps[3]);
70
- shape.pointerAtEnding() && drawPointer(ctx, shape, ps[2], ps[3], ps[0], ps[1]);
71
- }
72
- }
1
+ import Konva from 'konva';
2
+
3
+ function rotatePoint(x1: number, y1: number, x2: number, y2: number, angleInDegrees: number) {
4
+ const radians = angleInDegrees * (Math.PI / 180);
5
+ const cosTheta = Math.cos(radians);
6
+ const sinTheta = Math.sin(radians);
7
+
8
+ // Translate point (x2, y2) to be relative to (x1, y1)
9
+ const x = x2 - x1;
10
+ const y = y2 - y1;
11
+
12
+ // Rotate point
13
+ const xPrime = cosTheta * x - sinTheta * y;
14
+ const yPrime = sinTheta * x + cosTheta * y;
15
+
16
+ // Translate back
17
+ const xNew = xPrime + x1;
18
+ const yNew = yPrime + y1;
19
+
20
+ return { x: xNew, y: yNew };
21
+ }
22
+
23
+ function drawPointer(ctx: Konva.Context, shape: Konva.Shape, startX: number, startY: number, ctrlX: number, ctrlY: number) {
24
+ const x2 = startX + 12;
25
+ const y2 = startY - 6;
26
+ const x3 = startX + 12;
27
+ const y3 = startY + 6;
28
+ const angle = (Math.atan2(ctrlY - startY, ctrlX - startX) * 180) / Math.PI;
29
+ const p2 = rotatePoint(startX, startY, x2, y2, angle);
30
+ const p3 = rotatePoint(startX, startY, x3, y3, angle);
31
+ ctx.beginPath();
32
+ ctx.moveTo(startX, startY);
33
+ ctx.lineTo(p2.x, p2.y);
34
+ ctx.lineTo(p3.x, p3.y);
35
+ ctx.lineTo(startX, startY);
36
+ ctx.lineTo(p2.x, p2.y);
37
+ ctx.strokeShape(shape);
38
+ ctx.fillShape(shape);
39
+ }
40
+
41
+ export function BezierSceneFunc(ctx: Konva.Context, shape: Konva.Shape) {
42
+ if (shape instanceof Konva.Arrow) {
43
+ const ps = shape.points();
44
+ if (ps.length / 2 === 4) {
45
+ // 三次
46
+ ctx.beginPath();
47
+ ctx.moveTo(ps[0], ps[1]);
48
+ ctx.bezierCurveTo(ps[2], ps[3], ps[4], ps[5], ps[6], ps[7]);
49
+ ctx.strokeShape(shape);
50
+ ctx.closePath();
51
+ shape.pointerAtBeginning() && drawPointer(ctx, shape, ps[0], ps[1], ps[2], ps[3]);
52
+ shape.pointerAtEnding() && drawPointer(ctx, shape, ps[6], ps[7], ps[4], ps[5]);
53
+ } else if (ps.length / 2 === 3) {
54
+ // 二次
55
+ ctx.beginPath();
56
+ ctx.moveTo(ps[0], ps[1]);
57
+ ctx.quadraticCurveTo(ps[2], ps[3], ps[4], ps[5]);
58
+ ctx.strokeShape(shape);
59
+ ctx.closePath();
60
+ shape.pointerAtBeginning() && drawPointer(ctx, shape, ps[0], ps[1], ps[2], ps[3]);
61
+ shape.pointerAtEnding() && drawPointer(ctx, shape, ps[4], ps[5], ps[2], ps[3]);
62
+ } else {
63
+ // 直线
64
+ ctx.beginPath();
65
+ ctx.moveTo(ps[0], ps[1]);
66
+ ctx.lineTo(ps[2], ps[3]);
67
+ ctx.strokeShape(shape);
68
+ ctx.closePath();
69
+ shape.pointerAtBeginning() && drawPointer(ctx, shape, ps[0], ps[1], ps[2], ps[3]);
70
+ shape.pointerAtEnding() && drawPointer(ctx, shape, ps[2], ps[3], ps[0], ps[1]);
71
+ }
72
+ }
73
73
  }
@@ -1,119 +1,119 @@
1
- import React, { useEffect, useState } from "react";
2
- import { Upload as AntdUpLoad, UploadFile, message } from "antd";
3
- import { RcFile } from "antd/es/upload";
4
- import { PlusOutlined } from "@ant-design/icons";
5
- import { HydrocarbonService, Superagent, ProgramConfig } from "../../../index";
6
- import { fileUpload } from "../../constant";
7
- import { useLocale } from "../../../locale/useLocale";
8
-
9
- const { sourceId, serverKey } = fileUpload;
10
-
11
- // 本地文件上传,处理url
12
- const handleImgUrl = (basePath: string) => {
13
- if (basePath.startsWith("http")) {
14
- return basePath;
15
- }
16
- const url = encodeURI(ProgramConfig.joinPath(
17
- ProgramConfig.joinPath(ProgramConfig.api(), "/v3/files"),
18
- basePath
19
- )) +
20
- `?@token=${ProgramConfig.hydrocarbonToken()}&@programToken=${ProgramConfig.programCode(serverKey)}&@applicationToken=${ProgramConfig.applicationCode(serverKey)}`;
21
- return url;
22
- }
23
-
24
- const fileInfo = {
25
- uid: '-1',
26
- name: 'image.png',
27
- status: 'done',
28
- };
29
-
30
- export interface CommonFilePath {
31
- fileName?: string;
32
- contentType?: string;//文件类型
33
- path?: string;
34
- iconPath?: string;
35
- valid?: string;
36
- baseType?: string;
37
- basePath?: string;
38
- };
39
-
40
-
41
- export interface UploadProps {
42
- accept?: string;
43
- size?: number;
44
- onChange?: (data: { src: string, code: string }) => void;
45
- value?: { src: string, code: string };
46
- recordCode?: string; // 当前画面关联数据code,用于图片命名区分
47
- }
48
-
49
- const ImageUpload: React.FC<UploadProps> = (props) => {
50
- const { onChange, accept, size, recordCode, value } = props;
51
- const [fileList, setFileList] = useState([]);
52
- const [imgCode, setImgCode] = useState<string>(); // 本地图片code
53
- const { translate } = useLocale();
54
-
55
- useEffect(() => {
56
- setFileList(value?.src ? [{ ...fileInfo, url: handleImgUrl(value?.src) }] : []);
57
- setImgCode(value?.code);
58
- }, [value]);
59
-
60
- const beforeUpload = async (file: RcFile) => {
61
- if (size && file.size > size * 1024 * 1024) {
62
- message.warning(translate("${文件大小不能超过}") + `${size}M`);
63
- return false;
64
- }
65
- return true;
66
- }
67
-
68
- const handleChange = async (info) => {
69
- if (info.file.status == "done") {
70
- const fileKey = info.file.response.fileKey;
71
- const fileName = info.file.name;
72
- const data = { valid: "new", fileKey, fileName };
73
- const result = { 描述: `${recordCode || ""}-${fileName}`, 文件: JSON.stringify(data) };
74
- const { code } = await HydrocarbonService.postMstrucDtmplData(serverKey, sourceId, result, message);
75
- setImgCode(code);
76
- const imgData = await HydrocarbonService.requestMstrucDtmplData(serverKey, sourceId, code, null);
77
- const basePath = JSON.parse(imgData.fieldMap["文件"] || "{}").base?.path;
78
- if (basePath) {
79
- const url = handleImgUrl(basePath);
80
- setFileList([{ ...info.file, url }]);
81
- // onChange?.(url);
82
- onChange?.({ src: basePath, code });
83
- } else {
84
- setFileList([...info.fileList]);
85
- }
86
- } else {
87
- setFileList([...info.fileList]);
88
- }
89
- };
90
-
91
- const handleDelete = async () => {
92
- await HydrocarbonService.deleteByCode(serverKey, sourceId, [imgCode]);
93
- setFileList([]);
94
- onChange?.(null);
95
- };
96
-
97
- return (
98
- <AntdUpLoad
99
- action={(file) => HydrocarbonService.postFileAction(serverKey, file)}
100
- headers={Superagent.getHeaderObj(serverKey)}
101
- name={'file'}
102
- beforeUpload={beforeUpload}
103
- listType={'picture-card'}
104
- fileList={fileList?.length ? fileList as Array<UploadFile> : undefined}
105
- accept={accept}
106
- onChange={handleChange}
107
- onRemove={handleDelete}
108
- onPreview={() => window.open(fileList[0].url)}
109
- styles={{ root: { overflow: "hidden" } }}
110
- >
111
- {fileList.length > 0 ? null : <div className={'upload-btn'}>
112
- <PlusOutlined />
113
- <div style={{ marginTop: 8 }}>{translate("${上传图片}")}</div>
114
- </div>}
115
- </AntdUpLoad>
116
- )
117
- };
118
-
119
- export default ImageUpload;
1
+ import React, { useEffect, useState } from "react";
2
+ import { Upload as AntdUpLoad, UploadFile, message } from "antd";
3
+ import { RcFile } from "antd/es/upload";
4
+ import { PlusOutlined } from "@ant-design/icons";
5
+ import { HydrocarbonService, Superagent, ProgramConfig } from "../../../index";
6
+ import { fileUpload } from "../../constant";
7
+ import { useLocale } from "../../../locale/useLocale";
8
+
9
+ const { sourceId, serverKey } = fileUpload;
10
+
11
+ // 本地文件上传,处理url
12
+ const handleImgUrl = (basePath: string) => {
13
+ if (basePath.startsWith("http")) {
14
+ return basePath;
15
+ }
16
+ const url = encodeURI(ProgramConfig.joinPath(
17
+ ProgramConfig.joinPath(ProgramConfig.api(), "/v3/files"),
18
+ basePath
19
+ )) +
20
+ `?@token=${ProgramConfig.hydrocarbonToken()}&@programToken=${ProgramConfig.programCode(serverKey)}&@applicationToken=${ProgramConfig.applicationCode(serverKey)}`;
21
+ return url;
22
+ }
23
+
24
+ const fileInfo = {
25
+ uid: '-1',
26
+ name: 'image.png',
27
+ status: 'done',
28
+ };
29
+
30
+ export interface CommonFilePath {
31
+ fileName?: string;
32
+ contentType?: string;//文件类型
33
+ path?: string;
34
+ iconPath?: string;
35
+ valid?: string;
36
+ baseType?: string;
37
+ basePath?: string;
38
+ };
39
+
40
+
41
+ export interface UploadProps {
42
+ accept?: string;
43
+ size?: number;
44
+ onChange?: (data: { src: string, code: string }) => void;
45
+ value?: { src: string, code: string };
46
+ recordCode?: string; // 当前画面关联数据code,用于图片命名区分
47
+ }
48
+
49
+ const ImageUpload: React.FC<UploadProps> = (props) => {
50
+ const { onChange, accept, size, recordCode, value } = props;
51
+ const [fileList, setFileList] = useState([]);
52
+ const [imgCode, setImgCode] = useState<string>(); // 本地图片code
53
+ const { translate } = useLocale();
54
+
55
+ useEffect(() => {
56
+ setFileList(value?.src ? [{ ...fileInfo, url: handleImgUrl(value?.src) }] : []);
57
+ setImgCode(value?.code);
58
+ }, [value]);
59
+
60
+ const beforeUpload = async (file: RcFile) => {
61
+ if (size && file.size > size * 1024 * 1024) {
62
+ message.warning(translate("${文件大小不能超过}") + `${size}M`);
63
+ return false;
64
+ }
65
+ return true;
66
+ }
67
+
68
+ const handleChange = async (info) => {
69
+ if (info.file.status == "done") {
70
+ const fileKey = info.file.response.fileKey;
71
+ const fileName = info.file.name;
72
+ const data = { valid: "new", fileKey, fileName };
73
+ const result = { 描述: `${recordCode || ""}-${fileName}`, 文件: JSON.stringify(data) };
74
+ const { code } = await HydrocarbonService.postMstrucDtmplData(serverKey, sourceId, result, message);
75
+ setImgCode(code);
76
+ const imgData = await HydrocarbonService.requestMstrucDtmplData(serverKey, sourceId, code, null);
77
+ const basePath = JSON.parse(imgData.fieldMap["文件"] || "{}").base?.path;
78
+ if (basePath) {
79
+ const url = handleImgUrl(basePath);
80
+ setFileList([{ ...info.file, url }]);
81
+ // onChange?.(url);
82
+ onChange?.({ src: basePath, code });
83
+ } else {
84
+ setFileList([...info.fileList]);
85
+ }
86
+ } else {
87
+ setFileList([...info.fileList]);
88
+ }
89
+ };
90
+
91
+ const handleDelete = async () => {
92
+ await HydrocarbonService.deleteByCode(serverKey, sourceId, [imgCode]);
93
+ setFileList([]);
94
+ onChange?.(null);
95
+ };
96
+
97
+ return (
98
+ <AntdUpLoad
99
+ action={(file) => HydrocarbonService.postFileAction(serverKey, file)}
100
+ headers={Superagent.getHeaderObj(serverKey)}
101
+ name={'file'}
102
+ beforeUpload={beforeUpload}
103
+ listType={'picture-card'}
104
+ fileList={fileList?.length ? fileList as Array<UploadFile> : undefined}
105
+ accept={accept}
106
+ onChange={handleChange}
107
+ onRemove={handleDelete}
108
+ onPreview={() => window.open(fileList[0].url)}
109
+ styles={{ root: { overflow: "hidden" } }}
110
+ >
111
+ {fileList.length > 0 ? null : <div className={'upload-btn'}>
112
+ <PlusOutlined />
113
+ <div style={{ marginTop: 8 }}>{translate("${上传图片}")}</div>
114
+ </div>}
115
+ </AntdUpLoad>
116
+ )
117
+ };
118
+
119
+ export default ImageUpload;
@@ -1,27 +1,27 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="75px" height="50px" viewBox="0 0 75 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <title>编组 28@2x</title>
4
- <defs>
5
- <linearGradient x1="56.7868058%" y1="100%" x2="56.7868058%" y2="0%" id="linearGradient-1">
6
- <stop stop-color="#90DCFE" offset="0%"></stop>
7
- <stop stop-color="#141F34" offset="100%"></stop>
8
- </linearGradient>
9
- <radialGradient cx="50%" cy="30.3951181%" fx="50%" fy="30.3951181%" r="135.534427%" gradientTransform="translate(0.500000,0.303951),scale(0.171272,1.000000),rotate(90.000000),scale(1.000000,2.145743),translate(-0.500000,-0.303951)" id="radialGradient-2">
10
- <stop stop-color="#ACF4F7" offset="0%"></stop>
11
- <stop stop-color="#96EEF2" stop-opacity="0.600017604" offset="75.2832594%"></stop>
12
- <stop stop-color="#74E5EB" stop-opacity="0" offset="100%"></stop>
13
- </radialGradient>
14
- </defs>
15
- <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
16
- <g id="2025-02-28-西安航天-导航" transform="translate(-1816.000000, -11.000000)">
17
- <g id="编组-28" transform="translate(1816.900000, 11.000000)">
18
- <rect id="矩形" fill="url(#linearGradient-1)" opacity="0.586283366" x="0" y="0" width="74" height="46" rx="23"></rect>
19
- <path d="M52,44.0516405 L52,46.0516405 L40.137,46.0516405 L37,49.1897883 L33.862,46.0516405 L22,46.0516405 L22,44.0516405 L52,44.0516405 Z" id="形状结合" fill="url(#radialGradient-2)" fill-rule="nonzero"></path>
20
- <g id="账号中心-账号管理" transform="translate(22.939298, 9.939298)" fill="#FFFFFF" fill-rule="nonzero">
21
- <rect id="矩形" opacity="0" x="0" y="0" width="28.121403" height="28.121403"></rect>
22
- <path d="M14.6998318,15.2110976 C16.6171677,14.0607015 17.8954283,12.0155285 17.8954283,9.71468147 C17.8954283,6.13560131 14.9554784,3.19565143 11.3763982,3.19565143 C7.79731808,3.19565143 4.60169411,6.13557384 4.60169411,9.71465401 C4.60169411,12.0155011 5.87992722,14.0607015 7.79729061,15.211125 C4.34604749,16.4893581 1.91736339,19.8128191 1.91736339,23.7753555 C1.91736339,24.4144858 2.42865664,24.925779 3.06778692,24.925779 C3.70691721,24.925779 4.21821045,24.4144858 4.21821045,23.775383 C4.21821045,19.9406287 7.41383441,16.7450322 11.2485612,16.7450322 C15.2110976,16.7450322 18.278912,19.9406287 18.278912,23.775383 C18.278912,24.4144858 18.7902052,24.925779 19.429308,24.925779 C20.0684108,24.925779 20.579759,24.4144858 20.579759,23.775383 C20.579759,19.9406287 18.1510749,16.6171952 14.6998043,15.211125 L14.6998318,15.2110976 Z M11.2485612,14.0607015 C8.81990456,14.0607015 6.90251371,12.1433381 6.90251371,9.71465401 C6.90251371,7.28596991 8.81990456,5.36863398 11.2485612,5.36863398 C13.6772178,5.36863398 15.5946087,7.28599737 15.5946087,9.71465401 C15.5946087,12.1433106 13.6772178,14.0607015 11.2485612,14.0607015 Z M20.9632152,9.45900739 L25.1814257,9.45900739 C25.8205559,9.45900739 26.2040396,8.94771414 26.2040396,8.4364209 C26.2040396,7.79729061 25.6927464,7.41383441 25.1814257,7.41383441 L20.9632152,7.41383441 C20.3241124,7.41383441 19.9406287,7.92512766 19.9406287,8.4364209 C19.8128191,8.94771414 20.3241124,9.45900739 20.9632152,9.45900739 Z M25.1814257,11.3763982 L19.8128191,11.3763982 C19.1736889,11.3763982 18.7902052,11.8876915 18.7902052,12.3989847 C18.7902052,13.038115 19.3014984,13.4215712 19.8128191,13.4215712 L25.1814257,13.4215712 C25.8205559,13.4215712 26.2040396,12.910278 26.2040396,12.3989847 C26.2040396,11.8876915 25.6927464,11.3763982 25.1814257,11.3763982 Z M25.1814257,15.4667717 L20.9632152,15.4667717 C20.3241124,15.4667717 19.9406287,15.9780649 19.9406287,16.4893581 C19.9406287,17.1284884 20.451922,17.5119721 20.9632152,17.5119721 L25.1814257,17.5119721 C25.8205559,17.5119721 26.2040396,17.0006788 26.2040396,16.4893581 C26.2040396,15.9780374 25.6927464,15.4667717 25.1814257,15.4667717 Z" id="形状"></path>
23
- </g>
24
- </g>
25
- </g>
26
- </g>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="75px" height="50px" viewBox="0 0 75 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>编组 28@2x</title>
4
+ <defs>
5
+ <linearGradient x1="56.7868058%" y1="100%" x2="56.7868058%" y2="0%" id="linearGradient-1">
6
+ <stop stop-color="#90DCFE" offset="0%"></stop>
7
+ <stop stop-color="#141F34" offset="100%"></stop>
8
+ </linearGradient>
9
+ <radialGradient cx="50%" cy="30.3951181%" fx="50%" fy="30.3951181%" r="135.534427%" gradientTransform="translate(0.500000,0.303951),scale(0.171272,1.000000),rotate(90.000000),scale(1.000000,2.145743),translate(-0.500000,-0.303951)" id="radialGradient-2">
10
+ <stop stop-color="#ACF4F7" offset="0%"></stop>
11
+ <stop stop-color="#96EEF2" stop-opacity="0.600017604" offset="75.2832594%"></stop>
12
+ <stop stop-color="#74E5EB" stop-opacity="0" offset="100%"></stop>
13
+ </radialGradient>
14
+ </defs>
15
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
16
+ <g id="2025-02-28-西安航天-导航" transform="translate(-1816.000000, -11.000000)">
17
+ <g id="编组-28" transform="translate(1816.900000, 11.000000)">
18
+ <rect id="矩形" fill="url(#linearGradient-1)" opacity="0.586283366" x="0" y="0" width="74" height="46" rx="23"></rect>
19
+ <path d="M52,44.0516405 L52,46.0516405 L40.137,46.0516405 L37,49.1897883 L33.862,46.0516405 L22,46.0516405 L22,44.0516405 L52,44.0516405 Z" id="形状结合" fill="url(#radialGradient-2)" fill-rule="nonzero"></path>
20
+ <g id="账号中心-账号管理" transform="translate(22.939298, 9.939298)" fill="#FFFFFF" fill-rule="nonzero">
21
+ <rect id="矩形" opacity="0" x="0" y="0" width="28.121403" height="28.121403"></rect>
22
+ <path d="M14.6998318,15.2110976 C16.6171677,14.0607015 17.8954283,12.0155285 17.8954283,9.71468147 C17.8954283,6.13560131 14.9554784,3.19565143 11.3763982,3.19565143 C7.79731808,3.19565143 4.60169411,6.13557384 4.60169411,9.71465401 C4.60169411,12.0155011 5.87992722,14.0607015 7.79729061,15.211125 C4.34604749,16.4893581 1.91736339,19.8128191 1.91736339,23.7753555 C1.91736339,24.4144858 2.42865664,24.925779 3.06778692,24.925779 C3.70691721,24.925779 4.21821045,24.4144858 4.21821045,23.775383 C4.21821045,19.9406287 7.41383441,16.7450322 11.2485612,16.7450322 C15.2110976,16.7450322 18.278912,19.9406287 18.278912,23.775383 C18.278912,24.4144858 18.7902052,24.925779 19.429308,24.925779 C20.0684108,24.925779 20.579759,24.4144858 20.579759,23.775383 C20.579759,19.9406287 18.1510749,16.6171952 14.6998043,15.211125 L14.6998318,15.2110976 Z M11.2485612,14.0607015 C8.81990456,14.0607015 6.90251371,12.1433381 6.90251371,9.71465401 C6.90251371,7.28596991 8.81990456,5.36863398 11.2485612,5.36863398 C13.6772178,5.36863398 15.5946087,7.28599737 15.5946087,9.71465401 C15.5946087,12.1433106 13.6772178,14.0607015 11.2485612,14.0607015 Z M20.9632152,9.45900739 L25.1814257,9.45900739 C25.8205559,9.45900739 26.2040396,8.94771414 26.2040396,8.4364209 C26.2040396,7.79729061 25.6927464,7.41383441 25.1814257,7.41383441 L20.9632152,7.41383441 C20.3241124,7.41383441 19.9406287,7.92512766 19.9406287,8.4364209 C19.8128191,8.94771414 20.3241124,9.45900739 20.9632152,9.45900739 Z M25.1814257,11.3763982 L19.8128191,11.3763982 C19.1736889,11.3763982 18.7902052,11.8876915 18.7902052,12.3989847 C18.7902052,13.038115 19.3014984,13.4215712 19.8128191,13.4215712 L25.1814257,13.4215712 C25.8205559,13.4215712 26.2040396,12.910278 26.2040396,12.3989847 C26.2040396,11.8876915 25.6927464,11.3763982 25.1814257,11.3763982 Z M25.1814257,15.4667717 L20.9632152,15.4667717 C20.3241124,15.4667717 19.9406287,15.9780649 19.9406287,16.4893581 C19.9406287,17.1284884 20.451922,17.5119721 20.9632152,17.5119721 L25.1814257,17.5119721 C25.8205559,17.5119721 26.2040396,17.0006788 26.2040396,16.4893581 C26.2040396,15.9780374 25.6927464,15.4667717 25.1814257,15.4667717 Z" id="形状"></path>
23
+ </g>
24
+ </g>
25
+ </g>
26
+ </g>
27
27
  </svg>
@@ -1,32 +1,32 @@
1
- import React, { ForwardedRef, forwardRef, useImperativeHandle, useState } from 'react';
2
-
3
- export interface BaseColorBlockComponentStyle {
4
- borderRadius?: number;
5
- borderWidth?: number;
6
- borderColor?: string;
7
- borderStyle?: string;
8
- background?: string;
9
- }
10
-
11
- export interface BaseColorBlockComponentProps {
12
- style?: BaseColorBlockComponentStyle;
13
- }
14
-
15
- export interface BaseColorBlockComponentRef {
16
- updateConfig: (newConfig: BaseColorBlockComponentProps) => void;
17
- }
18
-
19
- const BaseColorBlockComponent = forwardRef((props: BaseColorBlockComponentProps, ref: ForwardedRef<BaseColorBlockComponentRef>) => {
20
- const [config, setConfig] = useState<BaseColorBlockComponentProps>({ ...props });
21
-
22
- useImperativeHandle(ref, () => ({
23
- updateConfig: (newConfig) => setConfig({ ...newConfig }),
24
- }));
25
-
26
-
27
- return (
28
- <div style={{ ...{ height: '100%', display: 'flex' }, ...(config?.style || {}) }} />
29
- );
30
- });
31
-
1
+ import React, { ForwardedRef, forwardRef, useImperativeHandle, useState } from 'react';
2
+
3
+ export interface BaseColorBlockComponentStyle {
4
+ borderRadius?: number;
5
+ borderWidth?: number;
6
+ borderColor?: string;
7
+ borderStyle?: string;
8
+ background?: string;
9
+ }
10
+
11
+ export interface BaseColorBlockComponentProps {
12
+ style?: BaseColorBlockComponentStyle;
13
+ }
14
+
15
+ export interface BaseColorBlockComponentRef {
16
+ updateConfig: (newConfig: BaseColorBlockComponentProps) => void;
17
+ }
18
+
19
+ const BaseColorBlockComponent = forwardRef((props: BaseColorBlockComponentProps, ref: ForwardedRef<BaseColorBlockComponentRef>) => {
20
+ const [config, setConfig] = useState<BaseColorBlockComponentProps>({ ...props });
21
+
22
+ useImperativeHandle(ref, () => ({
23
+ updateConfig: (newConfig) => setConfig({ ...newConfig }),
24
+ }));
25
+
26
+
27
+ return (
28
+ <div style={{ ...{ height: '100%', display: 'flex' }, ...(config?.style || {}) }} />
29
+ );
30
+ });
31
+
32
32
  export default BaseColorBlockComponent;
@@ -1,62 +1,62 @@
1
- .base-table {
2
- width: 100%;
3
- height: 100%;
4
- overflow: hidden;
5
-
6
- .base-table-empty {
7
- width: 100%;
8
- height: 100%;
9
- display: flex;
10
- justify-content: center;
11
- align-items: center;
12
- }
13
-
14
- table {
15
- width: 100%;
16
- text-align: center;
17
- table-layout: fixed;
18
- /* 关键:合并相邻边框,消除双线 */
19
- border-collapse: collapse;
20
- margin-top: -2px;
21
-
22
- thead {
23
- position: relative;
24
- z-index: 1;
25
-
26
- th {
27
- padding: 0 4px;
28
- }
29
- }
30
-
31
-
32
- .scroll-body {
33
- overflow: hidden;
34
- animation: scroll 10s linear infinite;
35
-
36
- td {
37
- padding: 0 4px;
38
- overflow: hidden;
39
- white-space: nowrap;
40
- text-overflow: ellipsis;
41
- }
42
- }
43
- }
44
-
45
- table:hover {
46
- .scroll-body {
47
- animation-play-state: paused !important;
48
- }
49
- }
50
-
51
- }
52
-
53
-
54
- @keyframes scroll {
55
- 0% {
56
- transform: translateY(0);
57
- }
58
-
59
- 100% {
60
- transform: translateY(-100%);
61
- }
1
+ .base-table {
2
+ width: 100%;
3
+ height: 100%;
4
+ overflow: hidden;
5
+
6
+ .base-table-empty {
7
+ width: 100%;
8
+ height: 100%;
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: center;
12
+ }
13
+
14
+ table {
15
+ width: 100%;
16
+ text-align: center;
17
+ table-layout: fixed;
18
+ /* 关键:合并相邻边框,消除双线 */
19
+ border-collapse: collapse;
20
+ margin-top: -2px;
21
+
22
+ thead {
23
+ position: relative;
24
+ z-index: 1;
25
+
26
+ th {
27
+ padding: 0 4px;
28
+ }
29
+ }
30
+
31
+
32
+ .scroll-body {
33
+ overflow: hidden;
34
+ animation: scroll 10s linear infinite;
35
+
36
+ td {
37
+ padding: 0 4px;
38
+ overflow: hidden;
39
+ white-space: nowrap;
40
+ text-overflow: ellipsis;
41
+ }
42
+ }
43
+ }
44
+
45
+ table:hover {
46
+ .scroll-body {
47
+ animation-play-state: paused !important;
48
+ }
49
+ }
50
+
51
+ }
52
+
53
+
54
+ @keyframes scroll {
55
+ 0% {
56
+ transform: translateY(0);
57
+ }
58
+
59
+ 100% {
60
+ transform: translateY(-100%);
61
+ }
62
62
  }
@@ -133,6 +133,7 @@ export interface ComponentStyle {
133
133
  renderer?: "canvas" | "svg";
134
134
  dataZoom?: boolean;
135
135
  slider?: boolean; // 区域缩放是否显示滑动条
136
+ groupType?: string; // 图表分组类型(用于图表联动)
136
137
  }
137
138
 
138
139
  export interface ComponentProps {
@@ -286,7 +287,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
286
287
  }, [searchParams, initSearchParams]);
287
288
 
288
289
  const renderChart = () => {
289
- const { grid, barWidth, legend, tooltip, color, xAxis, yAxis, isBackground, dataZoom, slider } = config;
290
+ const { grid, barWidth, legend, tooltip, color, xAxis, yAxis, isBackground, dataZoom, slider, groupType } = config;
290
291
  const option = _.cloneDeep(defOption);
291
292
  // 编辑态无数据显示默认数据
292
293
  const temData = isDesignMode && !data?.length ? defData : data;
@@ -416,6 +417,7 @@ const Index = forwardRef((props: ComponentProps, ref: ForwardedRef<ComponentRef>
416
417
  },
417
418
  data: temData
418
419
  }];
420
+ if (groupType) chart.current.group = groupType;
419
421
  chart.current.setOption(option, true);
420
422
  }
421
423
  useEffect(() => {