fl-web-component 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -24
- package/dist/fl-web-component.common.js +27308 -65
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/dist/fl-web-component.umd.js +27308 -65
- package/dist/fl-web-component.umd.js.map +1 -1
- package/dist/fl-web-component.umd.min.js +13 -1
- package/dist/fl-web-component.umd.min.js.map +1 -1
- package/package.json +80 -47
- package/packages/components/button/index.vue +16 -12
- package/packages/components/com-card/card-page.vue +102 -0
- package/packages/components/com-card/index.vue +53 -0
- package/packages/components/com-dialogWrapper/Readme.md +53 -0
- package/packages/components/com-dialogWrapper/index.vue +98 -0
- package/packages/components/com-flcanvas/components/bspline.js +91 -0
- package/packages/components/com-flcanvas/components/entityFormatting.js +503 -0
- package/packages/components/com-flcanvas/components/round10.js +24 -0
- package/packages/components/com-flcanvas/index.vue +259 -0
- package/packages/components/com-formDialog/Readme.md +409 -0
- package/packages/components/com-formDialog/index.vue +471 -0
- package/packages/components/com-graphics/index.vue +1073 -0
- package/packages/components/com-graphics/per-control.vue +109 -0
- package/packages/components/com-graphics/pid.vue +168 -0
- package/packages/components/com-page/index.vue +101 -0
- package/packages/components/com-selectTree/Readme.md +17 -0
- package/packages/components/com-selectTree/index.vue +236 -0
- package/packages/components/com-table/column-default.vue +71 -0
- package/packages/components/com-table/column-dynamic.vue +36 -0
- package/packages/components/com-table/column-menu.vue +71 -0
- package/packages/components/com-table/column-slot.vue +53 -0
- package/packages/components/com-table/column.vue +41 -0
- package/packages/components/com-table/config.js +21 -0
- package/packages/components/com-table/index.vue +281 -0
- package/packages/components/com-table/table-page.vue +106 -0
- package/packages/components/com-tabs/index.vue +50 -0
- package/packages/components/com-treeDynamic/Readme.md +271 -0
- package/packages/components/com-treeDynamic/index.vue +207 -0
- package/packages/components/model/api/index.js +59 -67
- package/packages/components/model/api/mock/detecttree.js +38 -38
- package/packages/components/model/api/mock/getmodel-line.js +15830 -79332
- package/packages/components/model/api/mock/init.js +1 -1
- package/packages/components/model/api/mock/pbstree.js +486 -495
- package/packages/components/model/components/TextOverTooltip/index.vue +3 -3
- package/packages/components/model/components/annotation-toolbar.vue +4 -19
- package/packages/components/model/components/check-proofing-model.vue +26 -29
- package/packages/components/model/components/clipping-type.vue +22 -14
- package/packages/components/model/components/com-dialogWrapper/index.vue +22 -25
- package/packages/components/model/components/detect-panel.vue +38 -26
- package/packages/components/model/components/detect-tree.vue +9 -24
- package/packages/components/model/components/firstPer-panel.vue +23 -25
- package/packages/components/model/components/header-button.vue +31 -107
- package/packages/components/model/components/imageViewer/index.vue +34 -35
- package/packages/components/model/components/import-model.vue +127 -127
- package/packages/components/model/components/location-panel.vue +25 -29
- package/packages/components/model/components/measure-type.vue +15 -15
- package/packages/components/model/components/pbs-tree.vue +139 -144
- package/packages/components/model/components/proof-config.vue +2 -10
- package/packages/components/model/components/proof-for-pc.vue +35 -32
- package/packages/components/model/components/proof-history.vue +136 -154
- package/packages/components/model/components/proof-panel-detail.vue +166 -165
- package/packages/components/model/components/proof-panel.vue +281 -205
- package/packages/components/model/components/proof-project-user.vue +13 -50
- package/packages/components/model/components/proof-publish.vue +130 -130
- package/packages/components/model/components/proof-role.vue +93 -124
- package/packages/components/model/components/props-panel.vue +63 -54
- package/packages/components/model/index.vue +3225 -3213
- package/packages/components/model/utils/annotation-tool.js +75 -82
- package/packages/components/model/utils/cursor.js +15 -10
- package/packages/components/model/utils/detect-v1.js +23 -35
- package/packages/components/model/utils/index.js +25 -25
- package/packages/components/model/utils/threejs/measure-angle.js +180 -180
- package/packages/components/model/utils/threejs/measure-area.js +196 -184
- package/packages/components/model/utils/threejs/measure-distance.js +154 -152
- package/packages/components/model/utils/threejs/measure-volume.js +64 -61
- package/patches/camera-controls+2.9.0.patch +63 -0
- package/src/assets/test.png +0 -0
- package/src/assets/worker.glb +0 -0
- package/src/main.js +27 -0
- package/src/utils/flgltf-parser.js +141 -0
- package/src/utils/instance-parser.js +402 -0
- package/src/utils/mock.js +84746 -0
- package/src/utils/threejs/measure-angle.js +240 -0
- package/src/utils/threejs/measure-area.js +249 -0
- package/src/utils/threejs/measure-distance.js +195 -0
- package/packages/index.js +0 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Konva from
|
|
2
|
-
const className =
|
|
1
|
+
import Konva from 'konva';
|
|
2
|
+
const className = 'annotation-shape';
|
|
3
3
|
var _that = null;
|
|
4
|
-
const AnnotationTool = function(stage, layer, type, strokeWidth = 1) {
|
|
4
|
+
const AnnotationTool = function (stage, layer, type, strokeWidth = 1) {
|
|
5
5
|
this.stage = stage;
|
|
6
6
|
this.layer = layer;
|
|
7
7
|
this.type = type;
|
|
@@ -13,14 +13,14 @@ const AnnotationTool = function(stage, layer, type, strokeWidth = 1) {
|
|
|
13
13
|
this.annotationList = [];
|
|
14
14
|
this.linePoints = [];
|
|
15
15
|
this.isInput = false;
|
|
16
|
-
this.color =
|
|
16
|
+
this.color = '#FF3B2F';
|
|
17
17
|
};
|
|
18
18
|
AnnotationTool.prototype = {
|
|
19
19
|
start() {
|
|
20
20
|
_that = this;
|
|
21
|
-
this.stage.on(
|
|
22
|
-
this.stage.on(
|
|
23
|
-
this.stage.on(
|
|
21
|
+
this.stage.on('mousedown', this.stageMouseDown, false);
|
|
22
|
+
this.stage.on('mousemove', this.stageMouseMove, false);
|
|
23
|
+
this.stage.on('mouseup', this.stageMouseUp, false);
|
|
24
24
|
},
|
|
25
25
|
updateType(val) {
|
|
26
26
|
const { type, strokeWidth } = val;
|
|
@@ -32,7 +32,7 @@ AnnotationTool.prototype = {
|
|
|
32
32
|
},
|
|
33
33
|
stageMouseDown(e) {
|
|
34
34
|
// _that.currentObj = null
|
|
35
|
-
if (e.attrs.name ===
|
|
35
|
+
if (e.attrs.name === 'annotation-shape' || _that.isInput) return;
|
|
36
36
|
// 左键开始
|
|
37
37
|
const mousePos = _that.stage.getPointerPosition();
|
|
38
38
|
const x = (mousePos.x - _that.stage.getX()) / _that.stage.scaleX();
|
|
@@ -40,7 +40,7 @@ AnnotationTool.prototype = {
|
|
|
40
40
|
_that.startPoints.push(x);
|
|
41
41
|
_that.startPoints.push(y);
|
|
42
42
|
switch (_that.type) {
|
|
43
|
-
case
|
|
43
|
+
case 'Rect':
|
|
44
44
|
const rect = new Konva.Rect({
|
|
45
45
|
type: _that.type,
|
|
46
46
|
name: className,
|
|
@@ -50,17 +50,17 @@ AnnotationTool.prototype = {
|
|
|
50
50
|
height: 0,
|
|
51
51
|
stroke: _that.color,
|
|
52
52
|
strokeWidth: _that.strokeWidth,
|
|
53
|
-
draggable: true
|
|
53
|
+
draggable: true,
|
|
54
54
|
});
|
|
55
|
-
rect.on(
|
|
55
|
+
rect.on('mousedown', (e) => {
|
|
56
56
|
e.cancelBubble = true;
|
|
57
57
|
});
|
|
58
58
|
// rect.on('mouseup', (e) => {
|
|
59
59
|
// e.cancelBubble = true;
|
|
60
60
|
// })
|
|
61
|
-
rect.on(
|
|
61
|
+
rect.on('click', (e) => {
|
|
62
62
|
e.cancelBubble = true;
|
|
63
|
-
if (_that.type ===
|
|
63
|
+
if (_that.type === 'Rubber') {
|
|
64
64
|
_that.rubberRemove(rect._id);
|
|
65
65
|
rect.destroy();
|
|
66
66
|
}
|
|
@@ -69,7 +69,7 @@ AnnotationTool.prototype = {
|
|
|
69
69
|
_that.layer.add(rect);
|
|
70
70
|
_that.isDrawing = true;
|
|
71
71
|
break;
|
|
72
|
-
case
|
|
72
|
+
case 'Circle':
|
|
73
73
|
const circle = new Konva.Circle({
|
|
74
74
|
type: _that.type,
|
|
75
75
|
name: className,
|
|
@@ -78,17 +78,17 @@ AnnotationTool.prototype = {
|
|
|
78
78
|
radius: 0,
|
|
79
79
|
stroke: _that.color,
|
|
80
80
|
strokeWidth: _that.strokeWidth,
|
|
81
|
-
draggable: true
|
|
81
|
+
draggable: true,
|
|
82
82
|
});
|
|
83
83
|
// circle.on('mouseup', (e) => {
|
|
84
84
|
// e.cancelBubble = true;
|
|
85
85
|
// })
|
|
86
|
-
circle.on(
|
|
86
|
+
circle.on('mousedown', (e) => {
|
|
87
87
|
e.cancelBubble = true;
|
|
88
88
|
});
|
|
89
|
-
circle.on(
|
|
89
|
+
circle.on('click', (e) => {
|
|
90
90
|
e.cancelBubble = true;
|
|
91
|
-
if (_that.type ===
|
|
91
|
+
if (_that.type === 'Rubber') {
|
|
92
92
|
_that.rubberRemove(circle._id);
|
|
93
93
|
circle.destroy();
|
|
94
94
|
}
|
|
@@ -97,7 +97,7 @@ AnnotationTool.prototype = {
|
|
|
97
97
|
_that.layer.add(circle);
|
|
98
98
|
_that.isDrawing = true;
|
|
99
99
|
break;
|
|
100
|
-
case
|
|
100
|
+
case 'Line':
|
|
101
101
|
_that.linePoints = _that.linePoints.concat(_that.startPoints);
|
|
102
102
|
const line = new Konva.Line({
|
|
103
103
|
name: className,
|
|
@@ -105,19 +105,19 @@ AnnotationTool.prototype = {
|
|
|
105
105
|
points: [x, y],
|
|
106
106
|
stroke: _that.color,
|
|
107
107
|
strokeWidth: _that.strokeWidth,
|
|
108
|
-
lineCap:
|
|
109
|
-
lineJoin:
|
|
110
|
-
draggable: true
|
|
108
|
+
lineCap: 'round',
|
|
109
|
+
lineJoin: 'round',
|
|
110
|
+
draggable: true,
|
|
111
111
|
});
|
|
112
112
|
// line.on('mouseup', (e) => {
|
|
113
113
|
// e.cancelBubble = true;
|
|
114
114
|
// })
|
|
115
|
-
line.on(
|
|
115
|
+
line.on('mousedown', (e) => {
|
|
116
116
|
e.cancelBubble = true;
|
|
117
117
|
});
|
|
118
|
-
line.on(
|
|
118
|
+
line.on('click', (e) => {
|
|
119
119
|
e.cancelBubble = true;
|
|
120
|
-
if (_that.type ===
|
|
120
|
+
if (_that.type === 'Rubber') {
|
|
121
121
|
_that.rubberRemove(line._id);
|
|
122
122
|
line.destroy();
|
|
123
123
|
}
|
|
@@ -126,27 +126,27 @@ AnnotationTool.prototype = {
|
|
|
126
126
|
_that.layer.add(line);
|
|
127
127
|
_that.isDrawing = true;
|
|
128
128
|
break;
|
|
129
|
-
case
|
|
129
|
+
case 'Text':
|
|
130
130
|
const textNode = new Konva.Text({
|
|
131
131
|
name: className,
|
|
132
132
|
type: _that.type,
|
|
133
133
|
x: x,
|
|
134
134
|
y: y,
|
|
135
135
|
width: 200,
|
|
136
|
-
text:
|
|
137
|
-
fontSize: 13 +
|
|
136
|
+
text: '',
|
|
137
|
+
fontSize: 13 + 3 * _that.strokeWidth,
|
|
138
138
|
fill: _that.color,
|
|
139
|
-
draggable: true
|
|
139
|
+
draggable: true,
|
|
140
140
|
});
|
|
141
141
|
// textNode.on('mouseup', (e) => {
|
|
142
142
|
// e.cancelBubble = true;
|
|
143
143
|
// })
|
|
144
|
-
textNode.on(
|
|
144
|
+
textNode.on('mousedown', (e) => {
|
|
145
145
|
e.cancelBubble = true;
|
|
146
146
|
});
|
|
147
|
-
textNode.on(
|
|
147
|
+
textNode.on('click', (e) => {
|
|
148
148
|
e.cancelBubble = true;
|
|
149
|
-
if (_that.type ===
|
|
149
|
+
if (_that.type === 'Rubber') {
|
|
150
150
|
_that.rubberRemove(textNode._id);
|
|
151
151
|
textNode.destroy();
|
|
152
152
|
}
|
|
@@ -154,7 +154,7 @@ AnnotationTool.prototype = {
|
|
|
154
154
|
_that.annotationList.push(textNode);
|
|
155
155
|
_that.layer.add(textNode);
|
|
156
156
|
_that.isDrawing = true;
|
|
157
|
-
textNode.on(
|
|
157
|
+
textNode.on('dblclick', () => {
|
|
158
158
|
e.cancelBubble = true;
|
|
159
159
|
_that.isInput = true;
|
|
160
160
|
textNode.hide();
|
|
@@ -162,49 +162,46 @@ AnnotationTool.prototype = {
|
|
|
162
162
|
var stageBox = _that.stage.container().getBoundingClientRect();
|
|
163
163
|
var areaPosition = {
|
|
164
164
|
x: stageBox.left + textPosition.x,
|
|
165
|
-
y: stageBox.top + textPosition.y
|
|
165
|
+
y: stageBox.top + textPosition.y,
|
|
166
166
|
};
|
|
167
|
-
var textarea = document.createElement(
|
|
167
|
+
var textarea = document.createElement('textarea');
|
|
168
168
|
document.body.appendChild(textarea);
|
|
169
169
|
textarea.value = textNode.text();
|
|
170
|
-
textarea.style.position =
|
|
171
|
-
textarea.style.top = areaPosition.y +
|
|
172
|
-
textarea.style.left = areaPosition.x +
|
|
173
|
-
textarea.style.width =
|
|
174
|
-
|
|
175
|
-
textarea.style.
|
|
176
|
-
|
|
177
|
-
textarea.style.
|
|
178
|
-
textarea.style.
|
|
179
|
-
textarea.style.
|
|
180
|
-
textarea.style.
|
|
181
|
-
textarea.style.
|
|
182
|
-
textarea.style.
|
|
183
|
-
textarea.style.outline = "none";
|
|
184
|
-
textarea.style.resize = "none";
|
|
170
|
+
textarea.style.position = 'absolute';
|
|
171
|
+
textarea.style.top = areaPosition.y + 'px';
|
|
172
|
+
textarea.style.left = areaPosition.x + 'px';
|
|
173
|
+
textarea.style.width = textNode.width() - textNode.padding() * 2 + 'px';
|
|
174
|
+
textarea.style.height = textNode.height() - textNode.padding() * 2 + 5 + 'px';
|
|
175
|
+
textarea.style.fontSize = '16px'; // textNode.fontSize() + 'px'
|
|
176
|
+
textarea.style.border = '1px solid ' + _that.color;
|
|
177
|
+
textarea.style.padding = '5px';
|
|
178
|
+
textarea.style.margin = '0px';
|
|
179
|
+
textarea.style.overflow = 'hidden';
|
|
180
|
+
textarea.style.background = 'none';
|
|
181
|
+
textarea.style.outline = 'none';
|
|
182
|
+
textarea.style.resize = 'none';
|
|
185
183
|
textarea.style.lineHeight = textNode.lineHeight();
|
|
186
184
|
textarea.style.fontFamily = textNode.fontFamily();
|
|
187
|
-
textarea.style.transformOrigin =
|
|
185
|
+
textarea.style.transformOrigin = 'left top';
|
|
188
186
|
textarea.style.textAlign = textNode.align();
|
|
189
187
|
textarea.style.color = textNode.fill();
|
|
190
188
|
var rotation = textNode.rotation();
|
|
191
189
|
var transform;
|
|
192
190
|
if (rotation) {
|
|
193
|
-
transform +=
|
|
191
|
+
transform += 'rotateZ(' + rotation + 'deg)';
|
|
194
192
|
}
|
|
195
193
|
var px = 0;
|
|
196
|
-
var isFirefox =
|
|
197
|
-
navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
|
|
194
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
198
195
|
if (isFirefox) {
|
|
199
196
|
px += 2 + Math.round(20 / 20); // textNode.fontSize()
|
|
200
197
|
}
|
|
201
|
-
transform +=
|
|
198
|
+
transform += 'translateY(-' + px + 'px)';
|
|
202
199
|
textarea.style.transform = transform;
|
|
203
|
-
textarea.style.height = textarea.scrollHeight + 3 +
|
|
200
|
+
textarea.style.height = textarea.scrollHeight + 3 + 'px';
|
|
204
201
|
textarea.focus();
|
|
205
202
|
function removeTextarea() {
|
|
206
203
|
textarea.parentNode.removeChild(textarea);
|
|
207
|
-
window.removeEventListener(
|
|
204
|
+
window.removeEventListener('click', handleOutsideClick);
|
|
208
205
|
textNode.show();
|
|
209
206
|
_that.layer.draw();
|
|
210
207
|
}
|
|
@@ -214,23 +211,19 @@ AnnotationTool.prototype = {
|
|
|
214
211
|
newWidth = textNode.placeholder.length * textNode.fontSize();
|
|
215
212
|
}
|
|
216
213
|
// some extra fixes on different browsers
|
|
217
|
-
var isSafari = /^((?!chrome|android).)*safari/i.test(
|
|
218
|
-
|
|
219
|
-
);
|
|
220
|
-
var isFirefox =
|
|
221
|
-
navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
|
|
214
|
+
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
215
|
+
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
222
216
|
if (isSafari || isFirefox) {
|
|
223
217
|
newWidth = Math.ceil(newWidth);
|
|
224
218
|
}
|
|
225
219
|
|
|
226
|
-
var isEdge =
|
|
227
|
-
document.documentMode || /Edge/.test(navigator.userAgent);
|
|
220
|
+
var isEdge = document.documentMode || /Edge/.test(navigator.userAgent);
|
|
228
221
|
if (isEdge) {
|
|
229
222
|
newWidth += 1;
|
|
230
223
|
}
|
|
231
|
-
textarea.style.width = newWidth +
|
|
224
|
+
textarea.style.width = newWidth + 'px';
|
|
232
225
|
}
|
|
233
|
-
textarea.addEventListener(
|
|
226
|
+
textarea.addEventListener('keydown', function (e) {
|
|
234
227
|
if (e.code === 13 && !e.shiftKey) {
|
|
235
228
|
textNode.text(textarea.value);
|
|
236
229
|
removeTextarea();
|
|
@@ -256,7 +249,7 @@ AnnotationTool.prototype = {
|
|
|
256
249
|
}
|
|
257
250
|
}
|
|
258
251
|
setTimeout(() => {
|
|
259
|
-
window.addEventListener(
|
|
252
|
+
window.addEventListener('click', handleOutsideClick);
|
|
260
253
|
});
|
|
261
254
|
});
|
|
262
255
|
break;
|
|
@@ -269,26 +262,26 @@ AnnotationTool.prototype = {
|
|
|
269
262
|
const y = (mousePos.y - _that.stage.getY()) / _that.stage.scaleY();
|
|
270
263
|
const currentObj = _that.annotationList[_that.annotationList.length - 1];
|
|
271
264
|
switch (currentObj.className) {
|
|
272
|
-
case
|
|
265
|
+
case 'Rect':
|
|
273
266
|
currentObj.setAttrs({
|
|
274
267
|
width: x - _that.startPoints[0],
|
|
275
|
-
height: y - _that.startPoints[1]
|
|
268
|
+
height: y - _that.startPoints[1],
|
|
276
269
|
});
|
|
277
270
|
break;
|
|
278
|
-
case
|
|
271
|
+
case 'Circle':
|
|
279
272
|
let radius = 0;
|
|
280
273
|
let width = x - _that.startPoints[0] < 0 ? 0 : x - _that.startPoints[0];
|
|
281
|
-
let height = y - _that.startPoints[1] < 0? 0 : y - _that.startPoints[1];
|
|
274
|
+
let height = y - _that.startPoints[1] < 0 ? 0 : y - _that.startPoints[1];
|
|
282
275
|
if (width === height) {
|
|
283
276
|
radius = width / 2;
|
|
284
277
|
} else {
|
|
285
278
|
radius = Math.max(width, height) / 2;
|
|
286
279
|
}
|
|
287
280
|
currentObj.setAttrs({
|
|
288
|
-
radius: radius
|
|
281
|
+
radius: radius,
|
|
289
282
|
});
|
|
290
283
|
break;
|
|
291
|
-
case
|
|
284
|
+
case 'Line':
|
|
292
285
|
_that.linePoints.push(x);
|
|
293
286
|
_that.linePoints.push(y);
|
|
294
287
|
const points = [].concat(_that.linePoints);
|
|
@@ -304,7 +297,7 @@ AnnotationTool.prototype = {
|
|
|
304
297
|
_that.isInput = false;
|
|
305
298
|
},
|
|
306
299
|
clear() {
|
|
307
|
-
this.annotationList.forEach(item => {
|
|
300
|
+
this.annotationList.forEach((item) => {
|
|
308
301
|
item.destroy();
|
|
309
302
|
});
|
|
310
303
|
this.annotationList.splice(0);
|
|
@@ -324,17 +317,17 @@ AnnotationTool.prototype = {
|
|
|
324
317
|
}
|
|
325
318
|
},
|
|
326
319
|
destroy() {
|
|
327
|
-
this.annotationList.forEach(item => {
|
|
328
|
-
item.off(
|
|
320
|
+
this.annotationList.forEach((item) => {
|
|
321
|
+
item.off('mousedown');
|
|
329
322
|
// item.off('mouseup')
|
|
330
|
-
item.off(
|
|
323
|
+
item.off('mousemove');
|
|
331
324
|
item.destroy();
|
|
332
325
|
});
|
|
333
|
-
this.stage.off(
|
|
334
|
-
this.stage.off(
|
|
335
|
-
this.stage.off(
|
|
336
|
-
}
|
|
326
|
+
this.stage.off('mousedown');
|
|
327
|
+
this.stage.off('mouseup');
|
|
328
|
+
this.stage.off('mousemove');
|
|
329
|
+
},
|
|
337
330
|
};
|
|
338
331
|
export default {
|
|
339
|
-
AnnotationTool
|
|
332
|
+
AnnotationTool,
|
|
340
333
|
};
|
|
@@ -5,14 +5,19 @@
|
|
|
5
5
|
* @Description:
|
|
6
6
|
* @FilePath: \dmp-ui\src\views\system\drawing-display\components\cursor.js
|
|
7
7
|
*/
|
|
8
|
-
let cursors={
|
|
9
|
-
pen:'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACd0lEQVRYR+2WT2gTQRTGv7eb9JLkmPoHvHkQLy2i94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hrq9U6n5XwoH1jjAUYB7DGzOf6BfgF4DiAZWa+NgiA1nqFiKYA/GbmE4MCrDDz9CEBfjLz7qvoXmke2L2CtPJlQRljMjVymVBExqIosi0297KNyfO87wObUGs9S0SvncATZr6TOzsA3/efikjFPeMgDMOkoe2TyWpEn12f7yilppvN5vs8EK4bLieNqFgsXqjX6+2+PGAPG2N8AE0XuK2UCrIgXPI3AE65OM3MrV7gmcPIGFMDMOcEbEt+LiK1bk8cNIzs+A7DcDGtapkA1WpVra6uPgAw3yVkm4w1ZjKObcP5t2zyiYmJ+4cex4mi1lorpWr2RaT+I6J1EZlLK/s+0DymSs5UKpXC1taWBjATx/FlpdTuJ1kcx5tKqY9EFBWLxVYvw/Vtwn7gBj2b6YFBhfPGDQGGFfgLW7AHMIfxtKYAAAAASUVORK5CYII=',
|
|
13
|
+
trangle:
|
|
14
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAl0lEQVRYR+2WsQ2DMBBF/w1BaLIIW/gKGJIU31uwCJUzhFGKVIAEjiUr0nd/95+f5DsbGh9rnA8ByIAMnBoIISQz62o805zzO8b4OOp1CuDuuUb4twfJw6wrACuApRBmAPD81P4C8CI5lQC4+wxgFIAMyIAM/L2B5qO4ZArvam7vgprrGEAi2d9ax1WufaGJvmQyIAPNDWzonXsh3WqxKQAAAABJRU5ErkJggg==',
|
|
15
|
+
eraser:
|
|
16
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA1hJREFUWEfFl09oXUUUxr/vPkzARRFcumhdVGgV8t7MJBFaaC30z0YQMW1AUWyhXVWlYmm7aLWbtiQNFboqoqUFgy1VFBcuuhDRJu2bM0kIRsFkJS7ctC9dNLwQ7pGBtDxe3p9734t04G7uPef7fvfMzJl7iac82I2/c25nzPfe/9ypTscAxphxksOrxlfTNB2ZmpqaywvSEYAx5n2SX9aZVUiOViqV0fn5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
import * as THREE from
|
|
1
|
+
import * as THREE from 'three';
|
|
2
2
|
|
|
3
3
|
class CollisionSystem {
|
|
4
4
|
/**
|
|
@@ -32,7 +32,7 @@ class CollisionSystem {
|
|
|
32
32
|
// 收集实体(模拟C++的GetIdsUnderCurWorkSpace)
|
|
33
33
|
collectEntities() {
|
|
34
34
|
return this.scene.children[0].children.filter((obj) => {
|
|
35
|
-
return obj.name?.indexOf(
|
|
35
|
+
return obj.name?.indexOf('MODELELEM') != -1;
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -54,7 +54,7 @@ class CollisionSystem {
|
|
|
54
54
|
// tightBox: this.getTightBox(obj),
|
|
55
55
|
majorType: obj.userData.tags,
|
|
56
56
|
connectedIds: connectedIds,
|
|
57
|
-
isWeld: obj.userData.tags?.includes(
|
|
57
|
+
isWeld: obj.userData.tags?.includes('PIPE_PIPEWELD'),
|
|
58
58
|
tightBoxList: tightBoxList,
|
|
59
59
|
};
|
|
60
60
|
this.entityMap.set(obj.id, entity);
|
|
@@ -90,7 +90,7 @@ class CollisionSystem {
|
|
|
90
90
|
*/
|
|
91
91
|
parseVector3(str) {
|
|
92
92
|
// 将字符串按逗号分割成数组,并将每个元素转换为数字,然后传递给 THREE.Vector3 构造函数
|
|
93
|
-
return new THREE.Vector3(...str.split(
|
|
93
|
+
return new THREE.Vector3(...str.split(',').map(Number));
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// 碰撞检测主逻辑(双层过滤)
|
|
@@ -134,8 +134,8 @@ class CollisionSystem {
|
|
|
134
134
|
// 排除焊点、垫片等
|
|
135
135
|
return (
|
|
136
136
|
entity.isWeld ||
|
|
137
|
-
entity.obj.userData.tags.includes(
|
|
138
|
-
entity.obj.userData.tags.includes(
|
|
137
|
+
entity.obj.userData.tags.includes('GASK') ||
|
|
138
|
+
entity.obj.userData.tags.includes('FLAN')
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -154,43 +154,38 @@ class CollisionSystem {
|
|
|
154
154
|
const { majorType: bType } = entityB;
|
|
155
155
|
|
|
156
156
|
//先判断两个实体是否是自己或者互相连接的且垫片不单独参与碰撞
|
|
157
|
-
if (aType.includes(
|
|
157
|
+
if (aType.includes('GASK') || bType.includes('GASK')) return true;
|
|
158
158
|
|
|
159
|
-
if (bType.includes(
|
|
159
|
+
if (bType.includes('PIPE_PIPEWELD')) return true;
|
|
160
160
|
|
|
161
|
-
if (bType ===
|
|
161
|
+
if (bType === '') return true;
|
|
162
162
|
|
|
163
163
|
// 设备专业特殊规则
|
|
164
164
|
//设备不和管线等专业碰撞 但是管线和设备碰撞
|
|
165
|
-
if (
|
|
166
|
-
aType.includes("TAG_MAJOR_DEVICE") &&
|
|
167
|
-
!bType.includes("TAG_MAJOR_DEVICE")
|
|
168
|
-
)
|
|
169
|
-
return true;
|
|
165
|
+
if (aType.includes('TAG_MAJOR_DEVICE') && !bType.includes('TAG_MAJOR_DEVICE')) return true;
|
|
170
166
|
|
|
171
167
|
// 管线专业只与设备和管线碰撞
|
|
172
168
|
//piping只能和设备以及piping专业碰撞
|
|
173
169
|
if (
|
|
174
|
-
aType.includes(
|
|
175
|
-
!bType.includes(
|
|
176
|
-
!bType.includes(
|
|
170
|
+
aType.includes('TAG_MAJOR_PIPINIG') &&
|
|
171
|
+
!bType.includes('TAG_MAJOR_DEVICE') &&
|
|
172
|
+
!bType.includes('TAG_MAJOR_PIPINIG')
|
|
177
173
|
)
|
|
178
174
|
return true;
|
|
179
175
|
|
|
180
176
|
// 土建专业特殊规则
|
|
181
177
|
//土建专业只和piping和设备专业碰撞
|
|
182
178
|
if (
|
|
183
|
-
aType.includes(
|
|
184
|
-
(bType.includes(
|
|
185
|
-
(!bType.includes(
|
|
186
|
-
!bType.includes("TAG_MAJOR_DEVICE")))
|
|
179
|
+
aType.includes('TAG_MAJOR_ARCH') &&
|
|
180
|
+
(bType.includes('TAG_MAJOR_ARCH') ||
|
|
181
|
+
(!bType.includes('TAG_MAJOR_PIPINIG') && !bType.includes('TAG_MAJOR_DEVICE')))
|
|
187
182
|
)
|
|
188
183
|
return true;
|
|
189
184
|
|
|
190
185
|
if (
|
|
191
|
-
bType.includes(
|
|
192
|
-
!aType.includes(
|
|
193
|
-
!aType.includes(
|
|
186
|
+
bType.includes('TAG_MAJOR_ARCH') &&
|
|
187
|
+
!aType.includes('TAG_MAJOR_PIPINIG') &&
|
|
188
|
+
!aType.includes('TAG_MAJOR_DEVICE')
|
|
194
189
|
)
|
|
195
190
|
return true;
|
|
196
191
|
|
|
@@ -235,9 +230,7 @@ class CollisionSystem {
|
|
|
235
230
|
* @returns {Array<THREE.Vector3>} - 包含三个半向量的数组,分别对应 X、Y 和 Z 轴方向。
|
|
236
231
|
*/
|
|
237
232
|
getHalfVectors({ m_box, m_coord }) {
|
|
238
|
-
const halfSize = new THREE.Vector3()
|
|
239
|
-
.subVectors(m_box.max, m_box.min)
|
|
240
|
-
.multiplyScalar(0.5);
|
|
233
|
+
const halfSize = new THREE.Vector3().subVectors(m_box.max, m_box.min).multiplyScalar(0.5);
|
|
241
234
|
|
|
242
235
|
return [
|
|
243
236
|
m_coord.dirX.clone().multiplyScalar(halfSize.x),
|
|
@@ -258,9 +251,7 @@ class CollisionSystem {
|
|
|
258
251
|
getCenter(m_box) {
|
|
259
252
|
// 将包围盒的最大点和最小点相加
|
|
260
253
|
// 然后将结果乘以 0.5,得到中心点的坐标
|
|
261
|
-
return new THREE.Vector3()
|
|
262
|
-
.addVectors(m_box.max, m_box.min)
|
|
263
|
-
.multiplyScalar(0.5);
|
|
254
|
+
return new THREE.Vector3().addVectors(m_box.max, m_box.min).multiplyScalar(0.5);
|
|
264
255
|
}
|
|
265
256
|
|
|
266
257
|
/**
|
|
@@ -271,10 +262,7 @@ class CollisionSystem {
|
|
|
271
262
|
* @returns {boolean} - 如果两个包围盒相交返回 true,否则返回 false
|
|
272
263
|
*/
|
|
273
264
|
collIntersect(box1, box2, distEpsilon = 0) {
|
|
274
|
-
const v_center = new THREE.Vector3().subVectors(
|
|
275
|
-
this.centerPt(box2),
|
|
276
|
-
this.centerPt(box1)
|
|
277
|
-
);
|
|
265
|
+
const v_center = new THREE.Vector3().subVectors(this.centerPt(box2), this.centerPt(box1));
|
|
278
266
|
|
|
279
267
|
const axes = [...this.getHalfVectors(box1), ...this.getHalfVectors(box2)];
|
|
280
268
|
|
|
@@ -333,7 +321,7 @@ class CollisionSystem {
|
|
|
333
321
|
|
|
334
322
|
const formatCollisionResults = Object.values(groupMap);
|
|
335
323
|
|
|
336
|
-
console.log(
|
|
324
|
+
console.log('碰撞结果', formatCollisionResults);
|
|
337
325
|
return formatCollisionResults;
|
|
338
326
|
}
|
|
339
327
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Loading } from 'element-ui'
|
|
2
|
-
var loadingInstance = {}
|
|
1
|
+
import { Loading } from 'element-ui';
|
|
2
|
+
var loadingInstance = {};
|
|
3
3
|
export function dateFormat(dateData) {
|
|
4
|
-
var date = new Date(dateData)
|
|
5
|
-
var y = date.getFullYear()
|
|
6
|
-
var m = date.getMonth() + 1
|
|
7
|
-
m = m < 10 ?
|
|
8
|
-
var d = date.getDate()
|
|
9
|
-
d = d < 10 ?
|
|
10
|
-
const time = y + '-' + m + '-' + d
|
|
11
|
-
return time
|
|
4
|
+
var date = new Date(dateData);
|
|
5
|
+
var y = date.getFullYear();
|
|
6
|
+
var m = date.getMonth() + 1;
|
|
7
|
+
m = m < 10 ? '0' + m : m;
|
|
8
|
+
var d = date.getDate();
|
|
9
|
+
d = d < 10 ? '0' + d : d;
|
|
10
|
+
const time = y + '-' + m + '-' + d;
|
|
11
|
+
return time;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function getItem(key) {
|
|
15
|
-
let item = localStorage.getItem(key)
|
|
15
|
+
let item = localStorage.getItem(key);
|
|
16
16
|
if (item) {
|
|
17
|
-
return JSON.parse(item)
|
|
17
|
+
return JSON.parse(item);
|
|
18
18
|
}
|
|
19
|
-
return null
|
|
19
|
+
return null;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function loading(tips = '拼命加载中...') {
|
|
@@ -25,24 +25,24 @@ export function loading(tips = '拼命加载中...') {
|
|
|
25
25
|
fullscreen: true,
|
|
26
26
|
text: tips,
|
|
27
27
|
spinner: 'el-icon-loading',
|
|
28
|
-
background: 'rgba(255, 255, 255, 0.5)'
|
|
29
|
-
})
|
|
28
|
+
background: 'rgba(255, 255, 255, 0.5)',
|
|
29
|
+
});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export function loadingClose() {
|
|
33
|
-
loadingInstance.close()
|
|
33
|
+
loadingInstance.close();
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// 节流 fn要防抖的函数 t是时间
|
|
37
37
|
export function debounce(fn, t) {
|
|
38
|
-
const delay = t || 500
|
|
39
|
-
let timer
|
|
40
|
-
return function() {
|
|
41
|
-
const args = arguments
|
|
42
|
-
if (timer) clearTimeout(timer)
|
|
38
|
+
const delay = t || 500;
|
|
39
|
+
let timer;
|
|
40
|
+
return function () {
|
|
41
|
+
const args = arguments;
|
|
42
|
+
if (timer) clearTimeout(timer);
|
|
43
43
|
timer = setTimeout(() => {
|
|
44
|
-
timer = null
|
|
45
|
-
fn.apply(this, args)
|
|
46
|
-
}, delay)
|
|
47
|
-
}
|
|
44
|
+
timer = null;
|
|
45
|
+
fn.apply(this, args);
|
|
46
|
+
}, delay);
|
|
47
|
+
};
|
|
48
48
|
}
|