build-dxf 0.1.8 → 0.1.10
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/package.json +1 -1
- package/src/build.d.ts +1 -0
- package/src/build.js +3869 -4858
- package/src/index.css +1 -1
- package/src/index.js +10 -10
- package/src/index2.js +4 -352
- package/src/index3.js +5000 -134
- package/src/{DomEventRegister.js → index4.js} +380 -247
- package/src/utils/DxfSystem/DxfSystem.d.ts +0 -3
- package/src/utils/DxfSystem/components/CorrectionDxf.d.ts +5 -111
- package/src/utils/DxfSystem/components/DoorsAnalysis.d.ts +1 -4
- package/src/utils/DxfSystem/components/Dxf.d.ts +67 -122
- package/src/utils/DxfSystem/components/DxfOld.d.ts +183 -0
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/WhiteModel.d.ts +0 -2
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/index.d.ts +0 -1
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/index.d.ts +0 -1
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/index.d.ts +0 -2
- package/src/utils/DxfSystem/plugin/RenderPlugin/index.d.ts +0 -2
- package/src/utils/DxfSystem/utils/CAD.d.ts +1 -0
- package/src/utils/DxfSystem/utils/LineGroupType.d.ts +1 -1
- package/src/utils/modelScenario/SceneAutoGenerat.d.ts +7 -1
- package/src/components/Card.vue.d.ts +0 -9
- package/src/utils/DxfSystem/components/LineAnalysis.d.ts +0 -77
- package/src/utils/DxfSystem/plugin/ModelDataPlugin/components/DetailsPoint.d.ts +0 -39
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/DetailsPointRender.d.ts +0 -48
- package/src/utils/DxfSystem/plugin/RenderPlugin/components/OriginalLineRender.d.ts +0 -16
|
@@ -7,8 +7,44 @@ import { CSS3DObject, CSS3DSprite, CSS3DRenderer } from "three/addons/renderers/
|
|
|
7
7
|
import { CSS2DObject, CSS2DRenderer } from "three/addons/renderers/CSS2DRenderer.js";
|
|
8
8
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
|
9
9
|
import * as TWEEN from "@tweenjs/tween.js";
|
|
10
|
-
import { C as Component,
|
|
10
|
+
import { C as Component, a as Point, V as Variable } from "./build.js";
|
|
11
11
|
import { getCurrentInstance, inject, ref, computed, unref, shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, onMounted, nextTick, isRef, warn, provide, defineComponent, createElementBlock, openBlock, mergeProps, renderSlot, createElementVNode, watch, toRef, onUnmounted, useSlots, Text, createBlock, resolveDynamicComponent, withCtx, createCommentVNode, Fragment, normalizeClass, reactive, toRaw, withDirectives, withModifiers, vModelCheckbox, createTextVNode, toDisplayString, normalizeStyle, toRefs } from "vue";
|
|
12
|
+
class DomContainer extends Component {
|
|
13
|
+
static name = "DomContainer";
|
|
14
|
+
domElement = document.createElement("div");
|
|
15
|
+
canvas = document.createElement("canvas");
|
|
16
|
+
html2DRenderer = document.createElement("div");
|
|
17
|
+
html3DRenderer = document.createElement("div");
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.domElement.id = "build-dxf-container";
|
|
21
|
+
this.domElement.appendChild(this.canvas);
|
|
22
|
+
this.domElement.appendChild(this.html3DRenderer);
|
|
23
|
+
this.domElement.appendChild(this.html2DRenderer);
|
|
24
|
+
Object.assign(this.domElement.style, {
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "100%",
|
|
27
|
+
position: "relative",
|
|
28
|
+
userSelect: "none"
|
|
29
|
+
});
|
|
30
|
+
Object.assign(this.html3DRenderer.style, {
|
|
31
|
+
position: "absolute",
|
|
32
|
+
left: 0,
|
|
33
|
+
top: 0,
|
|
34
|
+
// zIndex: 9,
|
|
35
|
+
width: "100%",
|
|
36
|
+
height: "100%"
|
|
37
|
+
});
|
|
38
|
+
Object.assign(this.html2DRenderer.style, {
|
|
39
|
+
position: "absolute",
|
|
40
|
+
left: 0,
|
|
41
|
+
top: 0,
|
|
42
|
+
// zIndex: 10,
|
|
43
|
+
width: "100%",
|
|
44
|
+
height: "100%"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
12
48
|
const circlePng = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wgaExY5fZXYlgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAASFUlEQVR42u1bS48bR5KOR2ZV8dHsh97WeD2Y82IxEI996YMAw/9jftb8j8ECPVgBgz74QP+AgS0YMNAtW61+kyxWZkbsIbPIYrHYLcmaxQK7BFJksyiy4osvIiPjAfD/j//bD/ySX/aXv/wFW9+LD6zmQxvP9y3461//qv+rAGgJXi96YDVBaAoo96z6OnwpMPALCl4Lxem1Sa9N6zWn1WZBLWQAAN94br6ur0sTtN8DAn4hjVNDMNtYWWvZw/HYQrHDvZ5h8IBgADx4BQ/inPNlWfrJZOIAwAFA1XiuXzdBCb8XCPwdwjfpbJLAeVoFABRjgN7O0VGR93qFZVswY27IZMhoAMEg4NIEFDSogBcJVQihEucWpXPl5eW8nExO5gBQprVIqwYptEzkk8wCP0N4bFDdNDTdS2tweHg4GI6GwyIrBsbagWHuE1GPiQogyhAxIwRGQEp3KqoaVNWpqhORUkTKEPxcJEzdwk1nZTm9PD6eTgCmADADgHkComowogbio0HAzxCeGlSvBe8DwPDo8Gg03B+OcpuPTGZGhs0OMw+JaYCEPSIuECAnjAyAyAAEAFHQAAJeQSsRXajKXCTMQpBp8OHOeXfjnLspp+XNf16e38JkcgsrMGog1sziY0DAzxDeJMHzJPjOeHw4evFitJ/n/b3M2n02Zt8Ys8tEO0g8JMI+EfUQMUdECwAGERkBUREAVFUVBEB9YkGlqqWqzIPoVEK4CyFce++vnXNXVbW4nE5nV8fHx1cAcAsAd4kRVcMsPgoE/AThuSF8DwAGALD7+vXr/cFg56Ao8kfWms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 0, 1);
|
|
14
50
|
const circleTexture = new THREE.TextureLoader().load(circlePng);
|
|
@@ -242,6 +278,192 @@ __publicField(_Renderer, "Line", THREE.Line);
|
|
|
242
278
|
__publicField(_Renderer, "LineSegments", THREE.LineSegments);
|
|
243
279
|
__publicField(_Renderer, "Points", THREE.Points);
|
|
244
280
|
let Renderer = _Renderer;
|
|
281
|
+
class DomEventRegister extends Component {
|
|
282
|
+
static name = "DomEventRegister";
|
|
283
|
+
cancelDefaultBehaviorList = [];
|
|
284
|
+
pointer = new Vector2();
|
|
285
|
+
_isMouseEnter = false;
|
|
286
|
+
set isMouseEnter(isMouseEnter) {
|
|
287
|
+
if (this._isMouseEnter === isMouseEnter) return;
|
|
288
|
+
this._isMouseEnter = isMouseEnter;
|
|
289
|
+
}
|
|
290
|
+
get isMouseEnter() {
|
|
291
|
+
return this._isMouseEnter;
|
|
292
|
+
}
|
|
293
|
+
_mouseMoveEventProxylock = false;
|
|
294
|
+
set mouseMoveEventProxylock(lock) {
|
|
295
|
+
this._mouseMoveEventProxylock = lock;
|
|
296
|
+
if (lock) {
|
|
297
|
+
this._isMouseEnter = false;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
get mouseMoveEventProxylock() {
|
|
301
|
+
return this._mouseMoveEventProxylock;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* 组件被添加到父组件上时调用
|
|
305
|
+
*/
|
|
306
|
+
onAddFromParent() {
|
|
307
|
+
this.initMouseMoveEventProxy();
|
|
308
|
+
this.initKeyEvent();
|
|
309
|
+
this.initWheelEvent();
|
|
310
|
+
this.autoBodyCursor();
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* 初始化鼠标事件代理(判断鼠标是否在domElement上)
|
|
314
|
+
*/
|
|
315
|
+
initMouseMoveEventProxy() {
|
|
316
|
+
const domContainer = this.parent?.findComponentByType(DomContainer), domElement = domContainer.domElement, variable = this.parent?.findComponentByType(Variable), globalMousemoveFun = (e) => {
|
|
317
|
+
if (this._mouseMoveEventProxylock) return;
|
|
318
|
+
const rect = domElement.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;
|
|
319
|
+
if (offsetX >= 0 && offsetY >= 0 && offsetX <= rect.width && offsetY <= rect.height) {
|
|
320
|
+
this.pointer.set(offsetX, offsetY);
|
|
321
|
+
this.dispatchEvent({
|
|
322
|
+
type: "mousemove",
|
|
323
|
+
x: offsetX,
|
|
324
|
+
y: offsetY,
|
|
325
|
+
moveX: e.movementX,
|
|
326
|
+
moveY: e.movementY
|
|
327
|
+
});
|
|
328
|
+
this.isMouseEnter = true;
|
|
329
|
+
} else {
|
|
330
|
+
this.isMouseEnter = false;
|
|
331
|
+
}
|
|
332
|
+
}, globalMousedownFun = (e) => {
|
|
333
|
+
if (!this.isMouseEnter) return;
|
|
334
|
+
const rect = domElement.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;
|
|
335
|
+
this.pointer.set(offsetX, offsetY);
|
|
336
|
+
variable.set("currentMouseDown", "mouse_" + e.button);
|
|
337
|
+
this.dispatchEvent({
|
|
338
|
+
type: "mousedown",
|
|
339
|
+
x: offsetX,
|
|
340
|
+
y: offsetY
|
|
341
|
+
});
|
|
342
|
+
}, globalMouseupFun = (e) => {
|
|
343
|
+
if (!this.isMouseEnter) return;
|
|
344
|
+
variable.set("currentMouseUp", "mouse_" + e.button);
|
|
345
|
+
};
|
|
346
|
+
document.addEventListener("mousemove", globalMousemoveFun);
|
|
347
|
+
document.addEventListener("mousedown", globalMousedownFun);
|
|
348
|
+
document.addEventListener("mouseup", globalMouseupFun);
|
|
349
|
+
this.addEventRecord("destory", () => {
|
|
350
|
+
document.removeEventListener("mousemove", globalMousemoveFun);
|
|
351
|
+
document.removeEventListener("mousedown", globalMousedownFun);
|
|
352
|
+
document.removeEventListener("mouseup", globalMouseupFun);
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* 初始化键盘事件
|
|
357
|
+
*/
|
|
358
|
+
initKeyEvent() {
|
|
359
|
+
const variable = this.parent?.findComponentByType(Variable);
|
|
360
|
+
document.body.tabIndex = 1;
|
|
361
|
+
const onKeyup = (e) => {
|
|
362
|
+
if (!this.isMouseEnter) return;
|
|
363
|
+
const key = e.key.toLocaleLowerCase();
|
|
364
|
+
variable.set("currentKeyUp", key);
|
|
365
|
+
for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
|
|
366
|
+
const element = this.cancelDefaultBehaviorList[i];
|
|
367
|
+
if (element(e)) e.preventDefault();
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
document.body.addEventListener("keyup", onKeyup);
|
|
371
|
+
const onKeydown = (e) => {
|
|
372
|
+
if (!this.isMouseEnter) return;
|
|
373
|
+
const key = e.key.toLocaleLowerCase();
|
|
374
|
+
variable.set("currentKeyDown", key);
|
|
375
|
+
for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
|
|
376
|
+
const element = this.cancelDefaultBehaviorList[i];
|
|
377
|
+
if (element(e)) e.preventDefault();
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
document.body.addEventListener("keydown", onKeydown);
|
|
381
|
+
const onFocus = () => variable.set("focus", true);
|
|
382
|
+
document.body.addEventListener("focus", onFocus);
|
|
383
|
+
const onBlur = () => variable.set("focus", false);
|
|
384
|
+
document.body.addEventListener("blur", onBlur);
|
|
385
|
+
this.addEventRecord("destory", () => {
|
|
386
|
+
document.body.removeEventListener("keyup", onKeyup);
|
|
387
|
+
document.body.removeEventListener("keydown", onKeydown);
|
|
388
|
+
document.body.removeEventListener("focus", onFocus);
|
|
389
|
+
document.body.removeEventListener("blur", onBlur);
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* 初始化滚轮事件
|
|
394
|
+
*/
|
|
395
|
+
initWheelEvent() {
|
|
396
|
+
const variable = this.parent?.findComponentByType(Variable);
|
|
397
|
+
const onWheel = (e) => variable.set("currentWheel", e.wheelDelta);
|
|
398
|
+
document.body.addEventListener("wheel", onWheel);
|
|
399
|
+
this.addEventRecord("destory", () => {
|
|
400
|
+
document.body.removeEventListener("wheel", onWheel);
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* 根据domElement的cursor自动设置body的cursor
|
|
405
|
+
*/
|
|
406
|
+
autoBodyCursor() {
|
|
407
|
+
const domContainer = this.parent?.findComponentByType(DomContainer), domElement = domContainer.domElement;
|
|
408
|
+
let bodyCursor = null;
|
|
409
|
+
this.addEventListener("update", () => {
|
|
410
|
+
if (this._mouseMoveEventProxylock) return;
|
|
411
|
+
if (this.isMouseEnter) {
|
|
412
|
+
if (bodyCursor === null) {
|
|
413
|
+
bodyCursor = document.body.style.cursor;
|
|
414
|
+
}
|
|
415
|
+
document.body.style.cursor = domElement.style.cursor;
|
|
416
|
+
} else {
|
|
417
|
+
if (bodyCursor !== null) {
|
|
418
|
+
document.body.style.cursor = bodyCursor;
|
|
419
|
+
bodyCursor = null;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
this.addEventRecord("destory", () => {
|
|
424
|
+
document.body.style.cursor = bodyCursor ?? "";
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
*
|
|
429
|
+
* @param callBack
|
|
430
|
+
*/
|
|
431
|
+
addCancelDefaultBehavior(callBack) {
|
|
432
|
+
this.cancelDefaultBehaviorList.push(callBack);
|
|
433
|
+
return this;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
*
|
|
437
|
+
* @param el
|
|
438
|
+
* @param callBack
|
|
439
|
+
* @param offset
|
|
440
|
+
* @param condition
|
|
441
|
+
*/
|
|
442
|
+
static dragMoveHelper(el, callBack, offset = { x: 0, y: 0 }, condition = () => true) {
|
|
443
|
+
function onMousedown() {
|
|
444
|
+
if (!condition()) return;
|
|
445
|
+
const move = (e) => {
|
|
446
|
+
offset.x += e.movementX;
|
|
447
|
+
offset.y += e.movementY;
|
|
448
|
+
callBack({ ...offset }, e.movementX, e.movementY);
|
|
449
|
+
};
|
|
450
|
+
const end = () => {
|
|
451
|
+
document.removeEventListener("mousemove", move);
|
|
452
|
+
document.removeEventListener("mouseup", end);
|
|
453
|
+
};
|
|
454
|
+
document.addEventListener("mousemove", move);
|
|
455
|
+
document.addEventListener("mouseup", end);
|
|
456
|
+
}
|
|
457
|
+
el.addEventListener("mousedown", onMousedown);
|
|
458
|
+
callBack({ ...offset }, 0, 0);
|
|
459
|
+
return () => {
|
|
460
|
+
el.removeEventListener("mousedown", onMousedown);
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
destroy() {
|
|
464
|
+
this.canceEventRecord("destory");
|
|
465
|
+
}
|
|
466
|
+
}
|
|
245
467
|
const configProviderContextKey = Symbol();
|
|
246
468
|
const defaultNamespace = "el";
|
|
247
469
|
const statePrefix = "is-";
|
|
@@ -1383,7 +1605,7 @@ const isClient = typeof window !== "undefined";
|
|
|
1383
1605
|
const isString = (val) => typeof val === "string";
|
|
1384
1606
|
const noop = () => {
|
|
1385
1607
|
};
|
|
1386
|
-
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
1608
|
+
const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
1387
1609
|
function resolveUnref(r) {
|
|
1388
1610
|
return typeof r === "function" ? r() : unref(r);
|
|
1389
1611
|
}
|
|
@@ -1812,6 +2034,7 @@ const mergeConfig = (a, b) => {
|
|
|
1812
2034
|
};
|
|
1813
2035
|
const UPDATE_MODEL_EVENT = "update:modelValue";
|
|
1814
2036
|
const CHANGE_EVENT = "change";
|
|
2037
|
+
const INPUT_EVENT = "input";
|
|
1815
2038
|
var _export_sfc = (sfc, props) => {
|
|
1816
2039
|
const target = sfc.__vccOpts || sfc;
|
|
1817
2040
|
for (const [key, val] of props) {
|
|
@@ -1828,6 +2051,15 @@ function addUnit(value, defaultUnit = "px") {
|
|
|
1828
2051
|
return value;
|
|
1829
2052
|
}
|
|
1830
2053
|
}
|
|
2054
|
+
class ElementPlusError extends Error {
|
|
2055
|
+
constructor(m) {
|
|
2056
|
+
super(m);
|
|
2057
|
+
this.name = "ElementPlusError";
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
function throwError(scope, m) {
|
|
2061
|
+
throw new ElementPlusError(`[${scope}] ${m}`);
|
|
2062
|
+
}
|
|
1831
2063
|
function debugWarn(scope, message) {
|
|
1832
2064
|
}
|
|
1833
2065
|
const withInstall = (main, extra) => {
|
|
@@ -1894,6 +2126,40 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1894
2126
|
var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "icon.vue"]]);
|
|
1895
2127
|
const ElIcon = withInstall(Icon);
|
|
1896
2128
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
2129
|
+
var _sfc_main6 = /* @__PURE__ */ defineComponent({
|
|
2130
|
+
name: "ArrowDown",
|
|
2131
|
+
__name: "arrow-down",
|
|
2132
|
+
setup(__props) {
|
|
2133
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
2134
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2135
|
+
viewBox: "0 0 1024 1024"
|
|
2136
|
+
}, [
|
|
2137
|
+
createElementVNode("path", {
|
|
2138
|
+
fill: "currentColor",
|
|
2139
|
+
d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
|
|
2140
|
+
})
|
|
2141
|
+
]));
|
|
2142
|
+
}
|
|
2143
|
+
}), arrow_down_default = _sfc_main6;
|
|
2144
|
+
var _sfc_main49 = /* @__PURE__ */ defineComponent({
|
|
2145
|
+
name: "CircleCheck",
|
|
2146
|
+
__name: "circle-check",
|
|
2147
|
+
setup(__props) {
|
|
2148
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
2149
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2150
|
+
viewBox: "0 0 1024 1024"
|
|
2151
|
+
}, [
|
|
2152
|
+
createElementVNode("path", {
|
|
2153
|
+
fill: "currentColor",
|
|
2154
|
+
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
|
|
2155
|
+
}),
|
|
2156
|
+
createElementVNode("path", {
|
|
2157
|
+
fill: "currentColor",
|
|
2158
|
+
d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"
|
|
2159
|
+
})
|
|
2160
|
+
]));
|
|
2161
|
+
}
|
|
2162
|
+
}), circle_check_default = _sfc_main49;
|
|
1897
2163
|
var _sfc_main50 = /* @__PURE__ */ defineComponent({
|
|
1898
2164
|
name: "CircleCloseFilled",
|
|
1899
2165
|
__name: "circle-close-filled",
|
|
@@ -1909,6 +2175,25 @@ var _sfc_main50 = /* @__PURE__ */ defineComponent({
|
|
|
1909
2175
|
]));
|
|
1910
2176
|
}
|
|
1911
2177
|
}), circle_close_filled_default = _sfc_main50;
|
|
2178
|
+
var _sfc_main51 = /* @__PURE__ */ defineComponent({
|
|
2179
|
+
name: "CircleClose",
|
|
2180
|
+
__name: "circle-close",
|
|
2181
|
+
setup(__props) {
|
|
2182
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
2183
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2184
|
+
viewBox: "0 0 1024 1024"
|
|
2185
|
+
}, [
|
|
2186
|
+
createElementVNode("path", {
|
|
2187
|
+
fill: "currentColor",
|
|
2188
|
+
d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
|
|
2189
|
+
}),
|
|
2190
|
+
createElementVNode("path", {
|
|
2191
|
+
fill: "currentColor",
|
|
2192
|
+
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
|
|
2193
|
+
})
|
|
2194
|
+
]));
|
|
2195
|
+
}
|
|
2196
|
+
}), circle_close_default = _sfc_main51;
|
|
1912
2197
|
var _sfc_main56 = /* @__PURE__ */ defineComponent({
|
|
1913
2198
|
name: "Close",
|
|
1914
2199
|
__name: "close",
|
|
@@ -1924,6 +2209,25 @@ var _sfc_main56 = /* @__PURE__ */ defineComponent({
|
|
|
1924
2209
|
]));
|
|
1925
2210
|
}
|
|
1926
2211
|
}), close_default = _sfc_main56;
|
|
2212
|
+
var _sfc_main133 = /* @__PURE__ */ defineComponent({
|
|
2213
|
+
name: "Hide",
|
|
2214
|
+
__name: "hide",
|
|
2215
|
+
setup(__props) {
|
|
2216
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
2217
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2218
|
+
viewBox: "0 0 1024 1024"
|
|
2219
|
+
}, [
|
|
2220
|
+
createElementVNode("path", {
|
|
2221
|
+
fill: "currentColor",
|
|
2222
|
+
d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"
|
|
2223
|
+
}),
|
|
2224
|
+
createElementVNode("path", {
|
|
2225
|
+
fill: "currentColor",
|
|
2226
|
+
d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"
|
|
2227
|
+
})
|
|
2228
|
+
]));
|
|
2229
|
+
}
|
|
2230
|
+
}), hide_default = _sfc_main133;
|
|
1927
2231
|
var _sfc_main143 = /* @__PURE__ */ defineComponent({
|
|
1928
2232
|
name: "InfoFilled",
|
|
1929
2233
|
__name: "info-filled",
|
|
@@ -1969,6 +2273,21 @@ var _sfc_main249 = /* @__PURE__ */ defineComponent({
|
|
|
1969
2273
|
]));
|
|
1970
2274
|
}
|
|
1971
2275
|
}), success_filled_default = _sfc_main249;
|
|
2276
|
+
var _sfc_main283 = /* @__PURE__ */ defineComponent({
|
|
2277
|
+
name: "View",
|
|
2278
|
+
__name: "view",
|
|
2279
|
+
setup(__props) {
|
|
2280
|
+
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
2281
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2282
|
+
viewBox: "0 0 1024 1024"
|
|
2283
|
+
}, [
|
|
2284
|
+
createElementVNode("path", {
|
|
2285
|
+
fill: "currentColor",
|
|
2286
|
+
d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
|
|
2287
|
+
})
|
|
2288
|
+
]));
|
|
2289
|
+
}
|
|
2290
|
+
}), view_default = _sfc_main283;
|
|
1972
2291
|
var _sfc_main287 = /* @__PURE__ */ defineComponent({
|
|
1973
2292
|
name: "WarningFilled",
|
|
1974
2293
|
__name: "warning-filled",
|
|
@@ -1999,6 +2318,11 @@ const TypeComponentsMap = {
|
|
|
1999
2318
|
error: circle_close_filled_default,
|
|
2000
2319
|
info: info_filled_default
|
|
2001
2320
|
};
|
|
2321
|
+
const ValidateComponentsMap = {
|
|
2322
|
+
validating: loading_default,
|
|
2323
|
+
success: circle_check_default,
|
|
2324
|
+
error: circle_close_default
|
|
2325
|
+
};
|
|
2002
2326
|
const ariaProps = buildProps({
|
|
2003
2327
|
ariaLabel: String,
|
|
2004
2328
|
ariaOrientation: {
|
|
@@ -3869,260 +4193,69 @@ const ElCheckbox = withInstall(Checkbox, {
|
|
|
3869
4193
|
});
|
|
3870
4194
|
withNoopInstall(CheckboxButton);
|
|
3871
4195
|
withNoopInstall(CheckboxGroup);
|
|
3872
|
-
class DomContainer extends Component {
|
|
3873
|
-
static name = "DomContainer";
|
|
3874
|
-
domElement = document.createElement("div");
|
|
3875
|
-
canvas = document.createElement("canvas");
|
|
3876
|
-
html2DRenderer = document.createElement("div");
|
|
3877
|
-
html3DRenderer = document.createElement("div");
|
|
3878
|
-
constructor() {
|
|
3879
|
-
super();
|
|
3880
|
-
this.domElement.id = "build-dxf-container";
|
|
3881
|
-
this.domElement.appendChild(this.canvas);
|
|
3882
|
-
this.domElement.appendChild(this.html3DRenderer);
|
|
3883
|
-
this.domElement.appendChild(this.html2DRenderer);
|
|
3884
|
-
Object.assign(this.domElement.style, {
|
|
3885
|
-
width: "100%",
|
|
3886
|
-
height: "100%",
|
|
3887
|
-
position: "relative",
|
|
3888
|
-
userSelect: "none"
|
|
3889
|
-
});
|
|
3890
|
-
Object.assign(this.html3DRenderer.style, {
|
|
3891
|
-
position: "absolute",
|
|
3892
|
-
left: 0,
|
|
3893
|
-
top: 0,
|
|
3894
|
-
// zIndex: 9,
|
|
3895
|
-
width: "100%",
|
|
3896
|
-
height: "100%"
|
|
3897
|
-
});
|
|
3898
|
-
Object.assign(this.html2DRenderer.style, {
|
|
3899
|
-
position: "absolute",
|
|
3900
|
-
left: 0,
|
|
3901
|
-
top: 0,
|
|
3902
|
-
// zIndex: 10,
|
|
3903
|
-
width: "100%",
|
|
3904
|
-
height: "100%"
|
|
3905
|
-
});
|
|
3906
|
-
}
|
|
3907
|
-
}
|
|
3908
|
-
class DomEventRegister extends Component {
|
|
3909
|
-
static name = "DomEventRegister";
|
|
3910
|
-
cancelDefaultBehaviorList = [];
|
|
3911
|
-
pointer = new Vector2();
|
|
3912
|
-
_isMouseEnter = false;
|
|
3913
|
-
set isMouseEnter(isMouseEnter) {
|
|
3914
|
-
if (this._isMouseEnter === isMouseEnter) return;
|
|
3915
|
-
this._isMouseEnter = isMouseEnter;
|
|
3916
|
-
}
|
|
3917
|
-
get isMouseEnter() {
|
|
3918
|
-
return this._isMouseEnter;
|
|
3919
|
-
}
|
|
3920
|
-
_mouseMoveEventProxylock = false;
|
|
3921
|
-
set mouseMoveEventProxylock(lock) {
|
|
3922
|
-
this._mouseMoveEventProxylock = lock;
|
|
3923
|
-
if (lock) {
|
|
3924
|
-
this._isMouseEnter = false;
|
|
3925
|
-
}
|
|
3926
|
-
}
|
|
3927
|
-
get mouseMoveEventProxylock() {
|
|
3928
|
-
return this._mouseMoveEventProxylock;
|
|
3929
|
-
}
|
|
3930
|
-
/**
|
|
3931
|
-
* 组件被添加到父组件上时调用
|
|
3932
|
-
*/
|
|
3933
|
-
onAddFromParent() {
|
|
3934
|
-
this.initMouseMoveEventProxy();
|
|
3935
|
-
this.initKeyEvent();
|
|
3936
|
-
this.initWheelEvent();
|
|
3937
|
-
this.autoBodyCursor();
|
|
3938
|
-
}
|
|
3939
|
-
/**
|
|
3940
|
-
* 初始化鼠标事件代理(判断鼠标是否在domElement上)
|
|
3941
|
-
*/
|
|
3942
|
-
initMouseMoveEventProxy() {
|
|
3943
|
-
const domContainer = this.parent?.findComponentByType(DomContainer), domElement = domContainer.domElement, variable = this.parent?.findComponentByType(Variable), globalMousemoveFun = (e) => {
|
|
3944
|
-
if (this._mouseMoveEventProxylock) return;
|
|
3945
|
-
const rect = domElement.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;
|
|
3946
|
-
if (offsetX >= 0 && offsetY >= 0 && offsetX <= rect.width && offsetY <= rect.height) {
|
|
3947
|
-
this.pointer.set(offsetX, offsetY);
|
|
3948
|
-
this.dispatchEvent({
|
|
3949
|
-
type: "mousemove",
|
|
3950
|
-
x: offsetX,
|
|
3951
|
-
y: offsetY,
|
|
3952
|
-
moveX: e.movementX,
|
|
3953
|
-
moveY: e.movementY
|
|
3954
|
-
});
|
|
3955
|
-
this.isMouseEnter = true;
|
|
3956
|
-
} else {
|
|
3957
|
-
this.isMouseEnter = false;
|
|
3958
|
-
}
|
|
3959
|
-
}, globalMousedownFun = (e) => {
|
|
3960
|
-
if (!this.isMouseEnter) return;
|
|
3961
|
-
const rect = domElement.getBoundingClientRect(), offsetX = e.clientX - rect.left, offsetY = e.clientY - rect.top;
|
|
3962
|
-
this.pointer.set(offsetX, offsetY);
|
|
3963
|
-
variable.set("currentMouseDown", "mouse_" + e.button);
|
|
3964
|
-
this.dispatchEvent({
|
|
3965
|
-
type: "mousedown",
|
|
3966
|
-
x: offsetX,
|
|
3967
|
-
y: offsetY
|
|
3968
|
-
});
|
|
3969
|
-
}, globalMouseupFun = (e) => {
|
|
3970
|
-
if (!this.isMouseEnter) return;
|
|
3971
|
-
variable.set("currentMouseUp", "mouse_" + e.button);
|
|
3972
|
-
};
|
|
3973
|
-
document.addEventListener("mousemove", globalMousemoveFun);
|
|
3974
|
-
document.addEventListener("mousedown", globalMousedownFun);
|
|
3975
|
-
document.addEventListener("mouseup", globalMouseupFun);
|
|
3976
|
-
this.addEventRecord("destory", () => {
|
|
3977
|
-
document.removeEventListener("mousemove", globalMousemoveFun);
|
|
3978
|
-
document.removeEventListener("mousedown", globalMousedownFun);
|
|
3979
|
-
document.removeEventListener("mouseup", globalMouseupFun);
|
|
3980
|
-
});
|
|
3981
|
-
}
|
|
3982
|
-
/**
|
|
3983
|
-
* 初始化键盘事件
|
|
3984
|
-
*/
|
|
3985
|
-
initKeyEvent() {
|
|
3986
|
-
const variable = this.parent?.findComponentByType(Variable);
|
|
3987
|
-
document.body.tabIndex = 1;
|
|
3988
|
-
const onKeyup = (e) => {
|
|
3989
|
-
if (!this.isMouseEnter) return;
|
|
3990
|
-
const key = e.key.toLocaleLowerCase();
|
|
3991
|
-
variable.set("currentKeyUp", key);
|
|
3992
|
-
for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
|
|
3993
|
-
const element = this.cancelDefaultBehaviorList[i];
|
|
3994
|
-
if (element(e)) e.preventDefault();
|
|
3995
|
-
}
|
|
3996
|
-
};
|
|
3997
|
-
document.body.addEventListener("keyup", onKeyup);
|
|
3998
|
-
const onKeydown = (e) => {
|
|
3999
|
-
if (!this.isMouseEnter) return;
|
|
4000
|
-
const key = e.key.toLocaleLowerCase();
|
|
4001
|
-
variable.set("currentKeyDown", key);
|
|
4002
|
-
for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
|
|
4003
|
-
const element = this.cancelDefaultBehaviorList[i];
|
|
4004
|
-
if (element(e)) e.preventDefault();
|
|
4005
|
-
}
|
|
4006
|
-
};
|
|
4007
|
-
document.body.addEventListener("keydown", onKeydown);
|
|
4008
|
-
const onFocus = () => variable.set("focus", true);
|
|
4009
|
-
document.body.addEventListener("focus", onFocus);
|
|
4010
|
-
const onBlur = () => variable.set("focus", false);
|
|
4011
|
-
document.body.addEventListener("blur", onBlur);
|
|
4012
|
-
this.addEventRecord("destory", () => {
|
|
4013
|
-
document.body.removeEventListener("keyup", onKeyup);
|
|
4014
|
-
document.body.removeEventListener("keydown", onKeydown);
|
|
4015
|
-
document.body.removeEventListener("focus", onFocus);
|
|
4016
|
-
document.body.removeEventListener("blur", onBlur);
|
|
4017
|
-
});
|
|
4018
|
-
}
|
|
4019
|
-
/**
|
|
4020
|
-
* 初始化滚轮事件
|
|
4021
|
-
*/
|
|
4022
|
-
initWheelEvent() {
|
|
4023
|
-
const variable = this.parent?.findComponentByType(Variable);
|
|
4024
|
-
const onWheel = (e) => variable.set("currentWheel", e.wheelDelta);
|
|
4025
|
-
document.body.addEventListener("wheel", onWheel);
|
|
4026
|
-
this.addEventRecord("destory", () => {
|
|
4027
|
-
document.body.removeEventListener("wheel", onWheel);
|
|
4028
|
-
});
|
|
4029
|
-
}
|
|
4030
|
-
/**
|
|
4031
|
-
* 根据domElement的cursor自动设置body的cursor
|
|
4032
|
-
*/
|
|
4033
|
-
autoBodyCursor() {
|
|
4034
|
-
const domContainer = this.parent?.findComponentByType(DomContainer), domElement = domContainer.domElement;
|
|
4035
|
-
let bodyCursor = null;
|
|
4036
|
-
this.addEventListener("update", () => {
|
|
4037
|
-
if (this._mouseMoveEventProxylock) return;
|
|
4038
|
-
if (this.isMouseEnter) {
|
|
4039
|
-
if (bodyCursor === null) {
|
|
4040
|
-
bodyCursor = document.body.style.cursor;
|
|
4041
|
-
}
|
|
4042
|
-
document.body.style.cursor = domElement.style.cursor;
|
|
4043
|
-
} else {
|
|
4044
|
-
if (bodyCursor !== null) {
|
|
4045
|
-
document.body.style.cursor = bodyCursor;
|
|
4046
|
-
bodyCursor = null;
|
|
4047
|
-
}
|
|
4048
|
-
}
|
|
4049
|
-
});
|
|
4050
|
-
this.addEventRecord("destory", () => {
|
|
4051
|
-
document.body.style.cursor = bodyCursor ?? "";
|
|
4052
|
-
});
|
|
4053
|
-
}
|
|
4054
|
-
/**
|
|
4055
|
-
*
|
|
4056
|
-
* @param callBack
|
|
4057
|
-
*/
|
|
4058
|
-
addCancelDefaultBehavior(callBack) {
|
|
4059
|
-
this.cancelDefaultBehaviorList.push(callBack);
|
|
4060
|
-
return this;
|
|
4061
|
-
}
|
|
4062
|
-
/**
|
|
4063
|
-
*
|
|
4064
|
-
* @param el
|
|
4065
|
-
* @param callBack
|
|
4066
|
-
* @param offset
|
|
4067
|
-
* @param condition
|
|
4068
|
-
*/
|
|
4069
|
-
static dragMoveHelper(el, callBack, offset = { x: 0, y: 0 }, condition = () => true) {
|
|
4070
|
-
function onMousedown() {
|
|
4071
|
-
if (!condition()) return;
|
|
4072
|
-
const move = (e) => {
|
|
4073
|
-
offset.x += e.movementX;
|
|
4074
|
-
offset.y += e.movementY;
|
|
4075
|
-
callBack({ ...offset }, e.movementX, e.movementY);
|
|
4076
|
-
};
|
|
4077
|
-
const end = () => {
|
|
4078
|
-
document.removeEventListener("mousemove", move);
|
|
4079
|
-
document.removeEventListener("mouseup", end);
|
|
4080
|
-
};
|
|
4081
|
-
document.addEventListener("mousemove", move);
|
|
4082
|
-
document.addEventListener("mouseup", end);
|
|
4083
|
-
}
|
|
4084
|
-
el.addEventListener("mousedown", onMousedown);
|
|
4085
|
-
callBack({ ...offset }, 0, 0);
|
|
4086
|
-
return () => {
|
|
4087
|
-
el.removeEventListener("mousedown", onMousedown);
|
|
4088
|
-
};
|
|
4089
|
-
}
|
|
4090
|
-
destroy() {
|
|
4091
|
-
this.canceEventRecord("destory");
|
|
4092
|
-
}
|
|
4093
|
-
}
|
|
4094
4196
|
export {
|
|
4095
|
-
|
|
4096
|
-
|
|
4197
|
+
useId as $,
|
|
4198
|
+
hide_default as A,
|
|
4199
|
+
isNil as B,
|
|
4200
|
+
debugWarn as C,
|
|
4097
4201
|
DomEventRegister as D,
|
|
4098
4202
|
ElButton as E,
|
|
4203
|
+
ElIcon as F,
|
|
4204
|
+
circle_close_default as G,
|
|
4205
|
+
isObject$1 as H,
|
|
4206
|
+
CHANGE_EVENT as I,
|
|
4207
|
+
INPUT_EVENT as J,
|
|
4208
|
+
withInstall as K,
|
|
4209
|
+
throwError as L,
|
|
4210
|
+
addUnit as M,
|
|
4211
|
+
NOOP as N,
|
|
4212
|
+
isElement as O,
|
|
4213
|
+
useZIndex as P,
|
|
4214
|
+
formItemContextKey as Q,
|
|
4099
4215
|
Renderer as R,
|
|
4100
|
-
|
|
4216
|
+
buildProp as S,
|
|
4217
|
+
isBoolean as T,
|
|
4218
|
+
UPDATE_MODEL_EVENT as U,
|
|
4219
|
+
ValidateComponentsMap as V,
|
|
4220
|
+
isArray$1 as W,
|
|
4221
|
+
useGetDerivedNamespace as X,
|
|
4222
|
+
useIdInjection as Y,
|
|
4223
|
+
computedEager as Z,
|
|
4101
4224
|
_export_sfc as _,
|
|
4102
4225
|
DomContainer as a,
|
|
4226
|
+
useEmptyValuesProps as a0,
|
|
4227
|
+
provideGlobalConfig as a1,
|
|
4228
|
+
arrow_down_default as a2,
|
|
4229
|
+
useLocale as a3,
|
|
4230
|
+
withNoopInstall as a4,
|
|
4231
|
+
useGlobalComponentSettings as a5,
|
|
4232
|
+
TypeComponentsMap as a6,
|
|
4233
|
+
TypeComponents as a7,
|
|
4234
|
+
useTimeoutFn as a8,
|
|
4235
|
+
withInstallFunction as a9,
|
|
4103
4236
|
ElCheckbox as b,
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4237
|
+
isString as c,
|
|
4238
|
+
isClient as d,
|
|
4239
|
+
tryOnMounted as e,
|
|
4240
|
+
isIOS as f,
|
|
4241
|
+
identity as g,
|
|
4242
|
+
buildProps as h,
|
|
4243
|
+
isArray as i,
|
|
4244
|
+
isNumber as j,
|
|
4245
|
+
isString$1 as k,
|
|
4246
|
+
definePropType as l,
|
|
4114
4247
|
iconPropType as m,
|
|
4115
4248
|
noop as n,
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4249
|
+
useSizeProp as o,
|
|
4250
|
+
fromPairs as p,
|
|
4251
|
+
isFunction$1 as q,
|
|
4119
4252
|
resolveUnref as r,
|
|
4120
|
-
|
|
4253
|
+
useNamespace as s,
|
|
4121
4254
|
tryOnScopeDispose as t,
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4255
|
+
useAriaProps as u,
|
|
4256
|
+
useFormSize as v,
|
|
4257
|
+
useFormDisabled as w,
|
|
4258
|
+
useFormItem as x,
|
|
4259
|
+
useFormItemInputId as y,
|
|
4260
|
+
view_default as z
|
|
4128
4261
|
};
|