dcim-topology2d 2.2.4 → 2.2.5
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/chart-diagram/src/utils/conversion.js +9 -1
- package/core/src/activeLayer.d.ts +1 -1
- package/core/src/activeLayer.js +13 -5
- package/core/src/common.d.ts +2 -2
- package/core/src/common.js +8 -15
- package/core/src/core.d.ts +2 -2
- package/core/src/core.js +236 -179
- package/core/src/healps/changeData.d.ts +0 -1
- package/core/src/healps/changeData.js +0 -4
- package/core/src/middles/default.js +8 -3
- package/core/src/middles/nodes/{arbitrarygraph.anchor.d.ts → basic/arbitrarygraph.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{arbitrarygraph.anchor.js → basic/arbitrarygraph.anchor.js} +1 -1
- package/core/src/middles/nodes/{arbitrarygraph.d.ts → basic/arbitrarygraph.d.ts} +1 -1
- package/core/src/middles/nodes/{arrow.anchor.d.ts → basic/arrow.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{arrow.anchor.js → basic/arrow.anchor.js} +2 -2
- package/core/src/middles/nodes/{arrow.d.ts → basic/arrow.d.ts} +1 -1
- package/core/src/middles/nodes/{arrow.rect.d.ts → basic/arrow.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{arrow.rect.js → basic/arrow.rect.js} +1 -1
- package/core/src/middles/nodes/{circle.anchor.d.ts → basic/circle.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{circle.anchor.js → basic/circle.anchor.js} +2 -2
- package/core/src/middles/nodes/{circle.d.ts → basic/circle.d.ts} +1 -1
- package/core/src/middles/nodes/{circle.rect.d.ts → basic/circle.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{circle.rect.js → basic/circle.rect.js} +1 -1
- package/core/src/middles/nodes/{cloud.anchor.d.ts → basic/cloud.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{cloud.anchor.js → basic/cloud.anchor.js} +2 -2
- package/core/src/middles/nodes/{cloud.d.ts → basic/cloud.d.ts} +1 -1
- package/core/src/middles/nodes/{cloud.rect.d.ts → basic/cloud.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{cloud.rect.js → basic/cloud.rect.js} +1 -1
- package/core/src/middles/nodes/{cube.anchor.d.ts → basic/cube.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{cube.anchor.js → basic/cube.anchor.js} +2 -2
- package/core/src/middles/nodes/{cube.d.ts → basic/cube.d.ts} +1 -1
- package/core/src/middles/nodes/{cube.model.d.ts → basic/cube.model.d.ts} +2 -2
- package/core/src/middles/nodes/{cube.model.js → basic/cube.model.js} +2 -2
- package/core/src/middles/nodes/{cube.rect.d.ts → basic/cube.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{cube.rect.js → basic/cube.rect.js} +1 -1
- package/core/src/middles/nodes/{diamond.d.ts → basic/diamond.d.ts} +1 -1
- package/core/src/middles/nodes/{diamond.rect.d.ts → basic/diamond.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{diamond.rect.js → basic/diamond.rect.js} +1 -1
- package/core/src/middles/nodes/{file.d.ts → basic/file.d.ts} +1 -1
- package/core/src/middles/nodes/{iframe.d.ts → basic/iframe.d.ts} +1 -1
- package/core/src/middles/nodes/{iframe.js → basic/iframe.js} +3 -3
- package/core/src/middles/nodes/{image.anchor.d.ts → basic/image.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{image.anchor.js → basic/image.anchor.js} +2 -2
- package/core/src/middles/nodes/{image.rect.d.ts → basic/image.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{image.rect.js → basic/image.rect.js} +1 -1
- package/core/src/middles/nodes/{line.anchor.d.ts → basic/line.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{line.anchor.js → basic/line.anchor.js} +2 -2
- package/core/src/middles/nodes/{line.d.ts → basic/line.d.ts} +1 -1
- package/core/src/middles/nodes/{line.rect.d.ts → basic/line.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{line.rect.js → basic/line.rect.js} +1 -1
- package/core/src/middles/nodes/{message.anchor.d.ts → basic/message.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{message.anchor.js → basic/message.anchor.js} +2 -2
- package/core/src/middles/nodes/{message.d.ts → basic/message.d.ts} +1 -1
- package/core/src/middles/nodes/{message.rect.d.ts → basic/message.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{message.rect.js → basic/message.rect.js} +1 -1
- package/core/src/middles/nodes/{pentagon.anchor.d.ts → basic/pentagon.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{pentagon.anchor.js → basic/pentagon.anchor.js} +2 -2
- package/core/src/middles/nodes/{pentagon.d.ts → basic/pentagon.d.ts} +1 -1
- package/core/src/middles/nodes/{pentagon.rect.d.ts → basic/pentagon.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{pentagon.rect.js → basic/pentagon.rect.js} +1 -1
- package/core/src/middles/nodes/{pentagram.anchor.d.ts → basic/pentagram.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{pentagram.anchor.js → basic/pentagram.anchor.js} +2 -2
- package/core/src/middles/nodes/{pentagram.d.ts → basic/pentagram.d.ts} +1 -1
- package/core/src/middles/nodes/{pentagram.rect.d.ts → basic/pentagram.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{pentagram.rect.js → basic/pentagram.rect.js} +1 -1
- package/core/src/middles/nodes/{people.d.ts → basic/people.d.ts} +1 -1
- package/core/src/middles/nodes/{people.rect.d.ts → basic/people.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{people.rect.js → basic/people.rect.js} +1 -1
- package/core/src/middles/nodes/{rectangle.d.ts → basic/rectangle.d.ts} +1 -1
- package/core/src/middles/nodes/{rectangle.js → basic/rectangle.js} +1 -1
- package/core/src/middles/nodes/{rectangle.rect.d.ts → basic/rectangle.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{rectangle.rect.js → basic/rectangle.rect.js} +1 -1
- package/core/src/middles/nodes/{text.d.ts → basic/text.d.ts} +2 -2
- package/core/src/middles/nodes/{triangle.anchor.d.ts → basic/triangle.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{triangle.anchor.js → basic/triangle.anchor.js} +2 -2
- package/core/src/middles/nodes/{triangle.d.ts → basic/triangle.d.ts} +1 -1
- package/core/src/middles/nodes/{triangle.rect.d.ts → basic/triangle.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{triangle.rect.js → basic/triangle.rect.js} +1 -1
- package/core/src/middles/nodes/custom/humiture.d.ts +2 -0
- package/core/src/middles/nodes/custom/humiture.js +24 -0
- package/core/src/middles/nodes/{hexagon.anchor.d.ts → flow/hexagon.anchor.d.ts} +1 -1
- package/core/src/middles/nodes/{hexagon.anchor.js → flow/hexagon.anchor.js} +2 -2
- package/core/src/middles/nodes/{hexagon.d.ts → flow/hexagon.d.ts} +1 -1
- package/core/src/middles/nodes/{hexagon.rect.d.ts → flow/hexagon.rect.d.ts} +1 -1
- package/core/src/middles/nodes/{hexagon.rect.js → flow/hexagon.rect.js} +1 -1
- package/core/src/middles/nodes/form/formDatePicker.d.ts +2 -0
- package/core/src/middles/nodes/{formDatePicker.js → form/formDatePicker.js} +5 -5
- package/core/src/middles/nodes/{formoverflow.js → form/formoverflow.js} +2 -2
- package/core/src/middles/nodes/{formselect.d.ts → form/formselect.d.ts} +1 -1
- package/core/src/middles/nodes/{formselect.js → form/formselect.js} +6 -7
- package/core/src/middles/nodes/{formtable.d.ts → form/formtable.d.ts} +1 -1
- package/core/src/middles/nodes/{progress.d.ts → form/progress.d.ts} +1 -1
- package/core/src/middles/nodes/{tablePagination.d.ts → form/tablePagination.d.ts} +1 -1
- package/core/src/middles/nodes/{time.d.ts → form/time.d.ts} +1 -1
- package/core/src/middles/nodes/icon/echartLine.d.ts +2 -0
- package/core/src/middles/nodes/icon/echartLine.js +99 -0
- package/core/src/middles/nodes/index.d.ts +54 -52
- package/core/src/middles/nodes/index.js +54 -53
- package/core/src/models/line.js +1 -1
- package/core/src/models/node.js +7 -6
- package/core/src/models/pen.d.ts +6 -0
- package/core/src/models/rect.d.ts +1 -0
- package/core/src/models/rect.js +13 -7
- package/core/src/options.js +2 -1
- package/core/src/preview.js +11 -12
- package/core/src/utils/assignment.js +41 -43
- package/core/src/utils/construction.d.ts +17 -3
- package/core/src/utils/construction.js +22 -2
- package/core/src/utils/conversion.d.ts +5 -7
- package/core/src/utils/conversion.js +185 -10
- package/core/src/utils/math.d.ts +0 -1
- package/core/src/utils/math.js +0 -11
- package/core/src/utils/params.js +1 -0
- package/myShape-diagram/index.js +1 -2
- package/package.json +1 -1
- package/static/icon.js +10 -0
- package/static/index.js +2 -1
- package/store/actions.js +14 -1
- package/store/clear.js +8 -2
- package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
- /package/core/src/middles/nodes/{arbitrarygraph.js → basic/arbitrarygraph.js} +0 -0
- /package/core/src/middles/nodes/{arrow.anchor.js.map → basic/arrow.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{arrow.js → basic/arrow.js} +0 -0
- /package/core/src/middles/nodes/{arrow.js.map → basic/arrow.js.map} +0 -0
- /package/core/src/middles/nodes/{arrow.rect.js.map → basic/arrow.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{circle.anchor.js.map → basic/circle.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{circle.js → basic/circle.js} +0 -0
- /package/core/src/middles/nodes/{circle.js.map → basic/circle.js.map} +0 -0
- /package/core/src/middles/nodes/{circle.rect.js.map → basic/circle.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{cloud.anchor.js.map → basic/cloud.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{cloud.js → basic/cloud.js} +0 -0
- /package/core/src/middles/nodes/{cloud.js.map → basic/cloud.js.map} +0 -0
- /package/core/src/middles/nodes/{cloud.rect.js.map → basic/cloud.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{cube.anchor.js.map → basic/cube.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{cube.js → basic/cube.js} +0 -0
- /package/core/src/middles/nodes/{cube.js.map → basic/cube.js.map} +0 -0
- /package/core/src/middles/nodes/{cube.model.js.map → basic/cube.model.js.map} +0 -0
- /package/core/src/middles/nodes/{cube.rect.js.map → basic/cube.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{diamond.js → basic/diamond.js} +0 -0
- /package/core/src/middles/nodes/{diamond.js.map → basic/diamond.js.map} +0 -0
- /package/core/src/middles/nodes/{diamond.rect.js.map → basic/diamond.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{file.js → basic/file.js} +0 -0
- /package/core/src/middles/nodes/{file.js.map → basic/file.js.map} +0 -0
- /package/core/src/middles/nodes/{image.anchor.js.map → basic/image.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{image.rect.js.map → basic/image.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{line.anchor.js.map → basic/line.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{line.js → basic/line.js} +0 -0
- /package/core/src/middles/nodes/{line.js.map → basic/line.js.map} +0 -0
- /package/core/src/middles/nodes/{line.rect.js.map → basic/line.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{message.anchor.js.map → basic/message.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{message.js → basic/message.js} +0 -0
- /package/core/src/middles/nodes/{message.js.map → basic/message.js.map} +0 -0
- /package/core/src/middles/nodes/{message.rect.js.map → basic/message.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{pentagon.anchor.js.map → basic/pentagon.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{pentagon.js → basic/pentagon.js} +0 -0
- /package/core/src/middles/nodes/{pentagon.js.map → basic/pentagon.js.map} +0 -0
- /package/core/src/middles/nodes/{pentagon.rect.js.map → basic/pentagon.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{pentagram.anchor.js.map → basic/pentagram.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{pentagram.js → basic/pentagram.js} +0 -0
- /package/core/src/middles/nodes/{pentagram.js.map → basic/pentagram.js.map} +0 -0
- /package/core/src/middles/nodes/{pentagram.rect.js.map → basic/pentagram.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{people.js → basic/people.js} +0 -0
- /package/core/src/middles/nodes/{people.js.map → basic/people.js.map} +0 -0
- /package/core/src/middles/nodes/{people.rect.js.map → basic/people.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{rectangle.js.map → basic/rectangle.js.map} +0 -0
- /package/core/src/middles/nodes/{rectangle.rect.js.map → basic/rectangle.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{text.js → basic/text.js} +0 -0
- /package/core/src/middles/nodes/{text.js.map → basic/text.js.map} +0 -0
- /package/core/src/middles/nodes/{triangle.anchor.js.map → basic/triangle.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{triangle.js → basic/triangle.js} +0 -0
- /package/core/src/middles/nodes/{triangle.js.map → basic/triangle.js.map} +0 -0
- /package/core/src/middles/nodes/{triangle.rect.js.map → basic/triangle.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{hexagon.anchor.js.map → flow/hexagon.anchor.js.map} +0 -0
- /package/core/src/middles/nodes/{hexagon.js → flow/hexagon.js} +0 -0
- /package/core/src/middles/nodes/{hexagon.js.map → flow/hexagon.js.map} +0 -0
- /package/core/src/middles/nodes/{hexagon.rect.js.map → flow/hexagon.rect.js.map} +0 -0
- /package/core/src/middles/nodes/{formtable.js → form/formtable.js} +0 -0
- /package/core/src/middles/nodes/{progress.js → form/progress.js} +0 -0
- /package/core/src/middles/nodes/{progress.js.map → form/progress.js.map} +0 -0
- /package/core/src/middles/nodes/{switchs.d.ts → form/switchs.d.ts} +0 -0
- /package/core/src/middles/nodes/{switchs.js → form/switchs.js} +0 -0
- /package/core/src/middles/nodes/{tablePagination.js → form/tablePagination.js} +0 -0
- /package/core/src/middles/nodes/{time.js → form/time.js} +0 -0
- /package/static/{echartsDefaultData.js → echarts.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Node } from "
|
|
1
|
+
import { Node } from "../../../models";
|
|
2
2
|
export default function progress(ctx: CanvasRenderingContext2D, node: Node): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Node } from '
|
|
1
|
+
import { Node } from '../../../models';
|
|
2
2
|
export declare function tablePagination(ctx: CanvasRenderingContext2D, node: Node): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Node } from '
|
|
1
|
+
import { Node } from '../../../models';
|
|
2
2
|
export declare function time(ctx: CanvasRenderingContext2D, node: Node): void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {svgPathInstance} from "../../../../../store";
|
|
2
|
+
|
|
3
|
+
export function svgEchartsLine(ctx, node) {
|
|
4
|
+
// 将 SVG 中的路径坐标等比缩放到相应尺寸的画布上
|
|
5
|
+
// SVG 范围: x: 0~1024, y: 0~1024
|
|
6
|
+
try {
|
|
7
|
+
let path1 = null;
|
|
8
|
+
let path2 = null;
|
|
9
|
+
if(svgPathInstance.has(node.id)) {
|
|
10
|
+
const pathData = svgPathInstance.get(node.id);
|
|
11
|
+
path1 = pathData.path1;
|
|
12
|
+
path2 = pathData.path2;
|
|
13
|
+
}else {
|
|
14
|
+
// 创建两个 Path2D 对象
|
|
15
|
+
path1 = new Path2D(node.path[0]);
|
|
16
|
+
path2 = new Path2D(node.path[1]);
|
|
17
|
+
svgPathInstance.set(node.id, {
|
|
18
|
+
path1,
|
|
19
|
+
path2
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
//console.log('path1====', path1, path2)
|
|
23
|
+
// 保存当前状态
|
|
24
|
+
ctx.save();
|
|
25
|
+
ctx.translate(node.rect.x, node.rect.y);
|
|
26
|
+
// 应用缩放变换: 将 SVG 坐标系 (0~1024) 缩放到 canvas 上
|
|
27
|
+
ctx.scale(node.rect.width / 1024, node.rect.height / 1024);
|
|
28
|
+
// 绘制第一个路径 (坐标轴)
|
|
29
|
+
ctx.fillStyle = node.strokeStyle; // 双坐标轴颜色
|
|
30
|
+
ctx.lineWidth = node.lineWidth;
|
|
31
|
+
ctx.fill(path1);
|
|
32
|
+
// 绘制第二个路径 (折线趋势)
|
|
33
|
+
ctx.fillStyle = node.strokeStyle; // 折线颜色
|
|
34
|
+
ctx.lineWidth = node.lineWidth;
|
|
35
|
+
ctx.fill(path2);
|
|
36
|
+
// 恢复变换
|
|
37
|
+
ctx.restore();
|
|
38
|
+
} catch (error) {
|
|
39
|
+
// 降级方案 手动绘制相似形状 (确保兼容性)
|
|
40
|
+
//console.info('Path2D 解析失败,使用备用手动绘制>>>', error);
|
|
41
|
+
ctx.save();
|
|
42
|
+
ctx.beginPath();
|
|
43
|
+
ctx.strokeStyle = node.strokeStyle;
|
|
44
|
+
ctx.lineWidth = node.lineWidth;
|
|
45
|
+
ctx.lineCap = 'round';
|
|
46
|
+
|
|
47
|
+
// X轴 (水平)
|
|
48
|
+
ctx.moveTo(node.rect.x, node.rect.y + node.rect.height);
|
|
49
|
+
ctx.lineTo(node.rect.x + node.rect.width, node.rect.y + node.rect.height);
|
|
50
|
+
ctx.stroke();
|
|
51
|
+
|
|
52
|
+
// Y轴 (垂直)
|
|
53
|
+
ctx.moveTo(node.rect.x, node.rect.y + node.rect.height / 5);
|
|
54
|
+
ctx.lineTo(node.rect.x, node.rect.y + node.rect.height);
|
|
55
|
+
ctx.stroke();
|
|
56
|
+
|
|
57
|
+
// 起点坐标
|
|
58
|
+
const startX = node.rect.x + node.rect.width / 10;
|
|
59
|
+
const startY = node.rect.y + node.rect.height * (5/6);
|
|
60
|
+
|
|
61
|
+
// 第一个折角
|
|
62
|
+
const x2 = node.rect.x + node.rect.width / 4 ;
|
|
63
|
+
const y2 = startY - node.rect.height / 3;
|
|
64
|
+
|
|
65
|
+
// 第二个折点: 离X轴的距离
|
|
66
|
+
const x3 = node.rect.x + node.rect.width * 3 / 5;
|
|
67
|
+
const y3 = node.rect.y + node.rect.height / 1.3;
|
|
68
|
+
|
|
69
|
+
// 终点: 在X轴末端附近,向上收尾
|
|
70
|
+
const xEnd = node.rect.x + node.rect.width;
|
|
71
|
+
const yEnd = startY - node.rect.height * 3 / 5;
|
|
72
|
+
|
|
73
|
+
// 收集所有点
|
|
74
|
+
const points = [
|
|
75
|
+
{ x: startX, y: startY },
|
|
76
|
+
{ x: x2, y: y2 },
|
|
77
|
+
{ x: x3, y: y3 },
|
|
78
|
+
{ x: xEnd, y: yEnd }
|
|
79
|
+
];
|
|
80
|
+
// 边界保护 (确保点在画布内)
|
|
81
|
+
for (let p of points) {
|
|
82
|
+
p.y = Math.min(node.rect.y + node.rect.height - 2, Math.max(node.rect.y + 2, p.y));
|
|
83
|
+
p.x = Math.min(node.rect.x + node.rect.width + 2, Math.max( node.rect.x - 2, p.x));
|
|
84
|
+
}
|
|
85
|
+
// ---------- 绘制折线 ----------
|
|
86
|
+
ctx.beginPath();
|
|
87
|
+
ctx.lineWidth = node.lineWidth;
|
|
88
|
+
ctx.strokeStyle = node.strokeStyle;
|
|
89
|
+
ctx.lineJoin = 'round';
|
|
90
|
+
ctx.lineCap = 'round';
|
|
91
|
+
|
|
92
|
+
ctx.moveTo(points[0].x, points[0].y);
|
|
93
|
+
for (let i = 1; i < points.length; i++) {
|
|
94
|
+
ctx.lineTo(points[i].x, points[i].y);
|
|
95
|
+
}
|
|
96
|
+
ctx.stroke();
|
|
97
|
+
ctx.restore();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -1,52 +1,54 @@
|
|
|
1
|
-
export * from './arbitrarygraph';
|
|
2
|
-
export * from './arbitrarygraph.anchor';
|
|
3
|
-
export * from './arrow';
|
|
4
|
-
export * from './arrow.rect';
|
|
5
|
-
export * from './arrow.anchor';
|
|
6
|
-
export * from './circle';
|
|
7
|
-
export * from './circle.rect';
|
|
8
|
-
export * from './circle.anchor';
|
|
9
|
-
export * from './cloud';
|
|
10
|
-
export * from './cloud.rect';
|
|
11
|
-
export * from './cloud.anchor';
|
|
12
|
-
export * from './cube';
|
|
13
|
-
export * from './cube.rect';
|
|
14
|
-
export * from './cube.anchor';
|
|
15
|
-
export * from './cube.model';
|
|
16
|
-
export * from './diamond';
|
|
17
|
-
export * from './diamond.rect';
|
|
18
|
-
export * from './file';
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
34
|
-
export * from './
|
|
35
|
-
export * from './
|
|
36
|
-
export * from './
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './
|
|
41
|
-
export * from './
|
|
42
|
-
export * from './
|
|
43
|
-
export * from './
|
|
44
|
-
export * from './
|
|
45
|
-
export * from './
|
|
46
|
-
export * from './
|
|
47
|
-
export * from './
|
|
48
|
-
export * from './
|
|
49
|
-
export * from './
|
|
50
|
-
export * from './
|
|
51
|
-
export * from './
|
|
52
|
-
export * from './
|
|
1
|
+
export * from './basic/arbitrarygraph';
|
|
2
|
+
export * from './basic/arbitrarygraph.anchor';
|
|
3
|
+
export * from './basic/arrow';
|
|
4
|
+
export * from './basic/arrow.rect';
|
|
5
|
+
export * from './basic/arrow.anchor';
|
|
6
|
+
export * from './basic/circle';
|
|
7
|
+
export * from './basic/circle.rect';
|
|
8
|
+
export * from './basic/circle.anchor';
|
|
9
|
+
export * from './basic/cloud';
|
|
10
|
+
export * from './basic/cloud.rect';
|
|
11
|
+
export * from './basic/cloud.anchor';
|
|
12
|
+
export * from './basic/cube';
|
|
13
|
+
export * from './basic/cube.rect';
|
|
14
|
+
export * from './basic/cube.anchor';
|
|
15
|
+
export * from './basic/cube.model';
|
|
16
|
+
export * from './basic/diamond';
|
|
17
|
+
export * from './basic/diamond.rect';
|
|
18
|
+
export * from './basic/file';
|
|
19
|
+
export * from './basic/image.rect';
|
|
20
|
+
export * from './basic/image.anchor';
|
|
21
|
+
export * from './basic/iframe';
|
|
22
|
+
export * from './basic/line';
|
|
23
|
+
export * from './basic/line.anchor';
|
|
24
|
+
export * from './basic/line.rect';
|
|
25
|
+
export * from './basic/message';
|
|
26
|
+
export * from './basic/message.anchor';
|
|
27
|
+
export * from './basic/message.rect';
|
|
28
|
+
export * from './basic/pentagon';
|
|
29
|
+
export * from './basic/pentagon.anchor';
|
|
30
|
+
export * from './basic/pentagon.rect';
|
|
31
|
+
export * from './basic/pentagram';
|
|
32
|
+
export * from './basic/pentagram.anchor';
|
|
33
|
+
export * from './basic/pentagram.rect';
|
|
34
|
+
export * from './basic/people';
|
|
35
|
+
export * from './basic/people.rect';
|
|
36
|
+
export * from './basic/rectangle';
|
|
37
|
+
export * from './basic/rectangle.rect';
|
|
38
|
+
export * from './basic/text';
|
|
39
|
+
export * from './basic/triangle';
|
|
40
|
+
export * from './basic/triangle.anchor';
|
|
41
|
+
export * from './basic/triangle.rect';
|
|
42
|
+
export * from './icon/echartLine';
|
|
43
|
+
export * from './flow/hexagon';
|
|
44
|
+
export * from './flow/hexagon.anchor';
|
|
45
|
+
export * from './flow/hexagon.rect';
|
|
46
|
+
export * from './form/formtable';
|
|
47
|
+
export * from './form/formselect';
|
|
48
|
+
export * from './form/tablePagination';
|
|
49
|
+
export * from './form/formoverflow';
|
|
50
|
+
export * from './form/time';
|
|
51
|
+
export * from './form/formDatePicker';
|
|
52
|
+
export * from './form/switchs';
|
|
53
|
+
export * from './form/progress';
|
|
54
|
+
export * from './custom/humiture';
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
export * from './arbitrarygraph';
|
|
2
|
-
export * from './arbitrarygraph.anchor';
|
|
3
|
-
export * from './arrow';
|
|
4
|
-
export * from './arrow.rect';
|
|
5
|
-
export * from './arrow.anchor';
|
|
6
|
-
export * from './circle';
|
|
7
|
-
export * from './circle.rect';
|
|
8
|
-
export * from './circle.anchor';
|
|
9
|
-
export * from './cloud';
|
|
10
|
-
export * from './cloud.rect';
|
|
11
|
-
export * from './cloud.anchor';
|
|
12
|
-
export * from './cube';
|
|
13
|
-
export * from './cube.rect';
|
|
14
|
-
export * from './cube.anchor';
|
|
15
|
-
export * from './cube.model';
|
|
16
|
-
export * from './diamond';
|
|
17
|
-
export * from './diamond.rect';
|
|
18
|
-
export * from './file';
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
34
|
-
export * from './
|
|
35
|
-
export * from './
|
|
36
|
-
export * from './
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './
|
|
39
|
-
export * from './
|
|
40
|
-
export * from './
|
|
41
|
-
export * from './
|
|
42
|
-
export * from './
|
|
43
|
-
export * from './
|
|
44
|
-
export * from './
|
|
45
|
-
export * from './
|
|
46
|
-
export * from './
|
|
47
|
-
export * from './
|
|
48
|
-
export * from './
|
|
49
|
-
export * from './
|
|
50
|
-
export * from './
|
|
51
|
-
export * from './
|
|
52
|
-
export * from './
|
|
53
|
-
|
|
1
|
+
export * from './basic/arbitrarygraph';
|
|
2
|
+
export * from './basic/arbitrarygraph.anchor';
|
|
3
|
+
export * from './basic/arrow';
|
|
4
|
+
export * from './basic/arrow.rect';
|
|
5
|
+
export * from './basic/arrow.anchor';
|
|
6
|
+
export * from './basic/circle';
|
|
7
|
+
export * from './basic/circle.rect';
|
|
8
|
+
export * from './basic/circle.anchor';
|
|
9
|
+
export * from './basic/cloud';
|
|
10
|
+
export * from './basic/cloud.rect';
|
|
11
|
+
export * from './basic/cloud.anchor';
|
|
12
|
+
export * from './basic/cube';
|
|
13
|
+
export * from './basic/cube.rect';
|
|
14
|
+
export * from './basic/cube.anchor';
|
|
15
|
+
export * from './basic/cube.model';
|
|
16
|
+
export * from './basic/diamond';
|
|
17
|
+
export * from './basic/diamond.rect';
|
|
18
|
+
export * from './basic/file';
|
|
19
|
+
export * from './basic/image.rect';
|
|
20
|
+
export * from './basic/image.anchor';
|
|
21
|
+
export * from './basic/iframe';
|
|
22
|
+
export * from './basic/line';
|
|
23
|
+
export * from './basic/line.anchor';
|
|
24
|
+
export * from './basic/line.rect';
|
|
25
|
+
export * from './basic/message';
|
|
26
|
+
export * from './basic/message.anchor';
|
|
27
|
+
export * from './basic/message.rect';
|
|
28
|
+
export * from './basic/pentagon';
|
|
29
|
+
export * from './basic/pentagon.anchor';
|
|
30
|
+
export * from './basic/pentagon.rect';
|
|
31
|
+
export * from './basic/pentagram';
|
|
32
|
+
export * from './basic/pentagram.anchor';
|
|
33
|
+
export * from './basic/pentagram.rect';
|
|
34
|
+
export * from './basic/people';
|
|
35
|
+
export * from './basic/people.rect';
|
|
36
|
+
export * from './basic/rectangle';
|
|
37
|
+
export * from './basic/rectangle.rect';
|
|
38
|
+
export * from './basic/text';
|
|
39
|
+
export * from './basic/triangle';
|
|
40
|
+
export * from './basic/triangle.anchor';
|
|
41
|
+
export * from './basic/triangle.rect';
|
|
42
|
+
export * from './icon/echartLine';
|
|
43
|
+
export * from './flow/hexagon';
|
|
44
|
+
export * from './flow/hexagon.anchor';
|
|
45
|
+
export * from './flow/hexagon.rect';
|
|
46
|
+
export * from './form/formtable';
|
|
47
|
+
export * from './form/formselect';
|
|
48
|
+
export * from './form/tablePagination';
|
|
49
|
+
export * from './form/formoverflow';
|
|
50
|
+
export * from './form/time';
|
|
51
|
+
export * from './form/formDatePicker';
|
|
52
|
+
export * from './form/switchs';
|
|
53
|
+
export * from './form/progress';
|
|
54
|
+
export * from './custom/humiture';
|
|
54
55
|
//# sourceMappingURL=index.js.map
|
package/core/src/models/line.js
CHANGED
|
@@ -17,7 +17,7 @@ import { drawLineFns, drawArrowFns } from '../middles';
|
|
|
17
17
|
import { getBezierPoint } from '../middles/lines/curve';
|
|
18
18
|
import { Store } from 'le5le-store';
|
|
19
19
|
import { lineLen, curveLen } from '../utils/canvas';
|
|
20
|
-
import { text } from '../middles/nodes/text';
|
|
20
|
+
import { text } from '../middles/nodes/basic/text';
|
|
21
21
|
import { Rect } from './rect';
|
|
22
22
|
import { abs } from '../utils/math';
|
|
23
23
|
var Line = /** @class */ (function (_super) {
|
package/core/src/models/node.js
CHANGED
|
@@ -90,6 +90,7 @@ var Node = /** @class */ (function (_super) {
|
|
|
90
90
|
_this.leakageStart = json.leakageStart || 0;
|
|
91
91
|
_this.leakageEnd = json.leakageEnd || 0;
|
|
92
92
|
_this.leakageFillStyle = json.leakageFillStyle || '#ff0000';
|
|
93
|
+
_this.lineOffsetSpeed = json.lineOffsetSpeed || 1;
|
|
93
94
|
_this.bindStaticId = json.bindStaticId || '';
|
|
94
95
|
//_this.buttonCheckSlide = json.buttonCheckSlide || '';
|
|
95
96
|
_this.visitStrokeStyle = json.visitStrokeStyle || '';
|
|
@@ -98,6 +99,7 @@ var Node = /** @class */ (function (_super) {
|
|
|
98
99
|
_this.focusFillStyle = json.focusFillStyle;
|
|
99
100
|
_this.hoverFillStyle = json.hoverFillStyle;
|
|
100
101
|
_this.defaultText = json.defaultText || json.text;
|
|
102
|
+
if(_this.name.startsWith('svg')) _this.path = json.path || [];
|
|
101
103
|
// 兼容老数据
|
|
102
104
|
if (json.children && json.children[0] && json.children[0].parentRect) {
|
|
103
105
|
_this.paddingLeft = json.children[0].parentRect.offsetX;
|
|
@@ -151,6 +153,7 @@ var Node = /** @class */ (function (_super) {
|
|
|
151
153
|
_this.time = json.time;
|
|
152
154
|
_this.isOpen = json.isOpen;
|
|
153
155
|
_this.isAlias = json.isAlias || false;
|
|
156
|
+
_this.isPointMonitor = json.isPointMonitor || false;
|
|
154
157
|
_this.isShowPercent = json.isShowPercent || false;
|
|
155
158
|
_this.maxValue = json.maxValue || 100;
|
|
156
159
|
_this.retationDecimalPlaces = json.retationDecimalPlaces;
|
|
@@ -334,9 +337,7 @@ var Node = /** @class */ (function (_super) {
|
|
|
334
337
|
}
|
|
335
338
|
};
|
|
336
339
|
Node.prototype.draw = function (ctx) {
|
|
337
|
-
if (!drawNodeFns[this.name])
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
+
if (!drawNodeFns[this.name]) return;
|
|
340
341
|
// DrawBk
|
|
341
342
|
switch (this.bkType) {
|
|
342
343
|
case 1:
|
|
@@ -682,17 +683,17 @@ var Node = /** @class */ (function (_super) {
|
|
|
682
683
|
// 线条左右流动动画
|
|
683
684
|
if ([animateType.LeftFlow, animateType.RightFlow].includes(this.animateType) && item.state.lineDashOffset) {
|
|
684
685
|
let o = item.state.lineDashOffset;
|
|
686
|
+
let s = this.lineOffsetSpeed;
|
|
685
687
|
switch (this.animateType) {
|
|
686
688
|
case animateType.LeftFlow:
|
|
687
689
|
o = Math.abs(o)
|
|
688
690
|
if (o > 100) o = 1;
|
|
689
|
-
o
|
|
690
|
-
|
|
691
|
+
o = o + 1*s
|
|
691
692
|
break;
|
|
692
693
|
case animateType.RightFlow:
|
|
693
694
|
o = Math.abs(o) * -1
|
|
694
695
|
if (o < -100) o = -1;
|
|
695
|
-
o
|
|
696
|
+
o = o - 1*s
|
|
696
697
|
break;
|
|
697
698
|
}
|
|
698
699
|
item.state.lineDashOffset = o
|
package/core/src/models/pen.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare abstract class Pen {
|
|
|
11
11
|
id: string;
|
|
12
12
|
type: PenType;
|
|
13
13
|
name: string;
|
|
14
|
+
subName: string;
|
|
14
15
|
tags: string[];
|
|
15
16
|
rect: Rect;
|
|
16
17
|
lineWidth: number;
|
|
@@ -67,6 +68,11 @@ export declare abstract class Pen {
|
|
|
67
68
|
value: string;
|
|
68
69
|
params: string;
|
|
69
70
|
name?: string;
|
|
71
|
+
data: {
|
|
72
|
+
name: string,
|
|
73
|
+
id: string,
|
|
74
|
+
type: number
|
|
75
|
+
}
|
|
70
76
|
}[];
|
|
71
77
|
private eventFns;
|
|
72
78
|
parentId: string;
|
package/core/src/models/rect.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Point } from './point';
|
|
2
2
|
import { pointInRect } from '../utils/canvas';
|
|
3
3
|
var Rect = /** @class */ (function () {
|
|
4
|
-
function Rect(x, y, width, height
|
|
4
|
+
function Rect(x, y, width, height) {
|
|
5
5
|
this.x = x;
|
|
6
6
|
this.y = y;
|
|
7
7
|
this.width = width;
|
|
8
8
|
this.height = height;
|
|
9
9
|
this.center = new Point(0, 0);
|
|
10
|
-
if (width < 0) {
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
if (height < 0) {
|
|
14
|
-
|
|
15
|
-
}
|
|
10
|
+
// if (width < 0) {
|
|
11
|
+
// this.width = 0;
|
|
12
|
+
// }
|
|
13
|
+
// if (height < 0) {
|
|
14
|
+
// this.height = 0;
|
|
15
|
+
// }
|
|
16
16
|
this.init();
|
|
17
17
|
}
|
|
18
18
|
Rect.prototype.init = function () {
|
|
@@ -20,6 +20,12 @@ var Rect = /** @class */ (function () {
|
|
|
20
20
|
this.ey = this.y + this.height;
|
|
21
21
|
this.calcCenter();
|
|
22
22
|
};
|
|
23
|
+
Rect.prototype.calcOffset = function () {
|
|
24
|
+
this.x = this.center.x - this.width / 2;
|
|
25
|
+
this.y = this.center.y - this.height / 2;
|
|
26
|
+
this.ex = this.x + this.width;
|
|
27
|
+
this.ey = this.y + this.height;
|
|
28
|
+
};
|
|
23
29
|
Rect.prototype.floor = function () {
|
|
24
30
|
this.x |= 0;
|
|
25
31
|
this.y |= 0;
|
package/core/src/options.js
CHANGED
package/core/src/preview.js
CHANGED
|
@@ -234,18 +234,17 @@ var Preview = (function (_super) {
|
|
|
234
234
|
_this.isResize = true;
|
|
235
235
|
clearTimeout(_this.pageResizeTim);
|
|
236
236
|
_this.pageResizeTim = setTimeout(() => {
|
|
237
|
-
if
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
237
|
+
if(!_this.isResize) return;
|
|
238
|
+
const pageZoom = 1 / zoom;
|
|
239
|
+
_this.store.data.pageZoom = zoom;
|
|
240
|
+
_this.store.parentElem.style.transform = `scale(${pageZoom})`;
|
|
241
|
+
_this.store.parentElem.style.transformOrigin = '0 0';
|
|
242
|
+
if(_this.store.parentElem.parentElement) _this.store.parentElem.parentElement.style.overflow = 'hidden';
|
|
243
|
+
_this.store.data.dataResize = 1;
|
|
244
|
+
_this.isResize = false;
|
|
245
|
+
Store.set('PAGE:zoom', zoom);
|
|
246
|
+
_this.fitView();
|
|
247
|
+
_this.render();
|
|
249
248
|
}, 1000);
|
|
250
249
|
}
|
|
251
250
|
};
|
|
@@ -17,7 +17,7 @@ export function setInitNodeDataValidat(node, TID, type, order, options) {
|
|
|
17
17
|
|
|
18
18
|
node.TID = TID;
|
|
19
19
|
|
|
20
|
-
if(options.pageId){
|
|
20
|
+
if(options && options.pageId){
|
|
21
21
|
// tabs页面元件偏移量计算
|
|
22
22
|
node.rect.x += options.x;
|
|
23
23
|
node.rect.y += options.y;
|
|
@@ -56,10 +56,8 @@ export function setInitNodeDataValidat(node, TID, type, order, options) {
|
|
|
56
56
|
// 初始化默认节点值
|
|
57
57
|
export function initDefaultValidat(node, retData) {
|
|
58
58
|
node.defaultFillStyle = node.fillStyle;
|
|
59
|
-
node.defaultFontColor = node.font.color;
|
|
60
|
-
|
|
61
|
-
node.defaultStrokeStyle = node.strokeStyle;
|
|
62
|
-
}
|
|
59
|
+
node.defaultFontColor = node.font && node.font.color;
|
|
60
|
+
node.defaultStrokeStyle = node.strokeStyle;
|
|
63
61
|
setPickerDateConnectData(node);
|
|
64
62
|
setVarBranchData(node, retData);
|
|
65
63
|
}
|
|
@@ -80,51 +78,51 @@ function setPickerDateConnectData(node) {
|
|
|
80
78
|
}
|
|
81
79
|
// 设置变量类型和支路地址的异步数据
|
|
82
80
|
function setVarBranchData(node, retData) {
|
|
83
|
-
if(!retData) return;
|
|
84
|
-
const componentData = retData.componentData;
|
|
85
|
-
let varData = null;
|
|
86
|
-
let branchNameData = null;
|
|
87
|
-
if(componentData && Object.keys(componentData).length) {
|
|
88
|
-
varData = componentData[node.id] || {};
|
|
89
|
-
branchNameData = componentData[node.id] || {};
|
|
90
|
-
}else {
|
|
91
|
-
varData = retData.varData;
|
|
92
|
-
branchNameData = retData.branchNameData;
|
|
93
|
-
}
|
|
94
|
-
const dataDictionary = {...varData, ...branchNameData};
|
|
81
|
+
if(!retData || !Array.isArray(node.data)) return;
|
|
95
82
|
// 变量类型数据展示,不需要实时更新
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
node.paddingTop = 0;
|
|
120
|
-
node.paddingTopNum = 0;
|
|
83
|
+
let varData = retData.varData || {};
|
|
84
|
+
let branchNameData = retData.branchNameData || {};
|
|
85
|
+
const dataDictionary = {...varData, ...branchNameData};
|
|
86
|
+
if(!Object.keys(dataDictionary).length) return;
|
|
87
|
+
let typeName = '';
|
|
88
|
+
let imgs = '';
|
|
89
|
+
const assetId = retData.asset && retData.asset.assetId;
|
|
90
|
+
node.data.forEach((vd) => {
|
|
91
|
+
const varNode = dataDictionary[vd.value] || dataDictionary[`${assetId}_${vd.value}`];
|
|
92
|
+
if(!varNode || !varNode.value || !['varValue', 'branchVal'].includes(vd.key)) return;
|
|
93
|
+
const showType = varNode.showType ? parseInt(varNode.showType) : 1;
|
|
94
|
+
if(showType === 1) {
|
|
95
|
+
|
|
96
|
+
typeName += typeName ? `,${varNode.value}` : varNode.value;
|
|
97
|
+
|
|
98
|
+
} else if(showType === 2) {
|
|
99
|
+
|
|
100
|
+
console.log('显示图标>>>');
|
|
101
|
+
|
|
102
|
+
} else if(showType === 3) {
|
|
103
|
+
|
|
104
|
+
imgs = `/dcim-api${varNode.value}`; //imgs += imgs ? `,${varData.value}` : varData.value;
|
|
105
|
+
|
|
121
106
|
}
|
|
107
|
+
});
|
|
108
|
+
if(typeName) node.text = typeName;
|
|
109
|
+
if(imgs) {
|
|
110
|
+
node.text = '';
|
|
111
|
+
node.image = imgs;
|
|
112
|
+
node.paddingBottom = 0;
|
|
113
|
+
node.paddingBottomNum = 0;
|
|
114
|
+
node.paddingLeft = 0;
|
|
115
|
+
node.paddingLeftNum = 0;
|
|
116
|
+
node.paddingRight = 0;
|
|
117
|
+
node.paddingRightNum = 0;
|
|
118
|
+
node.paddingTop = 0;
|
|
119
|
+
node.paddingTopNum = 0;
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
122
|
// 初始化mqtt实时值
|
|
125
123
|
export function setDefaultNodeValidat(node, retData) {
|
|
126
124
|
//const item = JSON.parse(JSON.stringify(node));
|
|
127
|
-
if (!node.events.length || !retData) return;
|
|
125
|
+
if (!node.events || !node.events.length || !retData) return;
|
|
128
126
|
//const node = detailData.length > 0 ? detailData : syncData
|
|
129
127
|
const functionData = node.events.filter((ev) => {
|
|
130
128
|
return ev.action === EventAction.Function
|