build-dxf 0.0.20-11 → 0.0.20-12
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/src/index3.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import * as m from "three";
|
|
2
|
-
import { i as dt, n as lt, r as $e, t as He, c as Le, d as ct, e as mt, f as _e, g as B, _ as qe, u as ht, h as me, j as Pe, w as ut, k as pt, l as vt, p as
|
|
3
|
-
import { C as ye, L as ne, P as A, B as We, E as Ue, b as
|
|
2
|
+
import { i as dt, n as lt, r as $e, t as He, c as Le, d as ct, e as mt, f as _e, g as B, _ as qe, u as ht, h as me, j as Pe, w as ut, k as pt, l as vt, p as ft, m as gt, o as yt, T as Ie, q as Se, s as wt, v as bt, x as Ne, y as Ee, z as Ce, A as xt, B as Ct, L as he, D as Mt, b as Oe, E as pe, S as Et } from "./selectLocalFile.js";
|
|
3
|
+
import { C as ye, L as ne, P as A, B as We, E as Ue, b as Re, Q as ze, W as Lt } from "./build.js";
|
|
4
4
|
import "clipper-lib";
|
|
5
5
|
import "dxf-writer";
|
|
6
6
|
import "three/addons/controls/OrbitControls.js";
|
|
7
|
-
import { watch as V, ref as
|
|
7
|
+
import { watch as V, ref as E, defineComponent as oe, computed as _, createElementBlock as S, openBlock as M, normalizeClass as O, unref as v, renderSlot as fe, createVNode as z, Transition as ge, withCtx as F, withDirectives as Qe, createElementVNode as x, normalizeStyle as De, createTextVNode as le, toDisplayString as J, vShow as Ye, shallowReactive as _t, onMounted as Ze, createBlock as de, createCommentVNode as $, resolveDynamicComponent as Dt, Fragment as ce, withModifiers as kt, nextTick as ve, isVNode as Xe, render as Be, toRaw as Pt, onUnmounted as It, renderList as Me, createStaticVNode as St, TransitionGroup as Nt, createApp as Ot } from "vue";
|
|
8
8
|
function Je(r) {
|
|
9
9
|
var e;
|
|
10
10
|
const t = $e(r);
|
|
11
11
|
return (e = t?.$el) != null ? e : t;
|
|
12
12
|
}
|
|
13
13
|
const et = Le ? window : void 0;
|
|
14
|
-
function
|
|
14
|
+
function Rt(...r) {
|
|
15
15
|
let e, t, n, o;
|
|
16
16
|
if (dt(r[0]) || Array.isArray(r[0]) ? ([t, n, o] = r, e = et) : [e, t, n, o] = r, !e)
|
|
17
17
|
return lt;
|
|
18
18
|
Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
19
19
|
const s = [], a = () => {
|
|
20
20
|
s.forEach((c) => c()), s.length = 0;
|
|
21
|
-
}, i = (c, h, w,
|
|
22
|
-
a(), c && s.push(...t.flatMap((w) => n.map((
|
|
21
|
+
}, i = (c, h, w, f) => (c.addEventListener(h, w, f), () => c.removeEventListener(h, w, f)), d = V(() => [Je(e), $e(o)], ([c, h]) => {
|
|
22
|
+
a(), c && s.push(...t.flatMap((w) => n.map((f) => i(c, w, f, h))));
|
|
23
23
|
}, { immediate: !0, flush: "post" }), l = () => {
|
|
24
24
|
d(), a();
|
|
25
25
|
};
|
|
26
26
|
return He(l), l;
|
|
27
27
|
}
|
|
28
28
|
function zt(r, e = !1) {
|
|
29
|
-
const t =
|
|
29
|
+
const t = E(), n = () => t.value = !!r();
|
|
30
30
|
return n(), ct(n, e), t;
|
|
31
31
|
}
|
|
32
32
|
const Fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ke = "__vueuse_ssr_handlers__";
|
|
@@ -135,7 +135,7 @@ const Ht = (r) => r, qt = {
|
|
|
135
135
|
...Ut,
|
|
136
136
|
props: Wt,
|
|
137
137
|
setup(r, { expose: e }) {
|
|
138
|
-
const t = r, n = ht("badge"), o =
|
|
138
|
+
const t = r, n = ht("badge"), o = _(() => t.isDot ? "" : me(t.value) && me(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = _(() => {
|
|
139
139
|
var a, i, d, l, c;
|
|
140
140
|
return [
|
|
141
141
|
{
|
|
@@ -148,31 +148,31 @@ const Ht = (r) => r, qt = {
|
|
|
148
148
|
});
|
|
149
149
|
return e({
|
|
150
150
|
content: o
|
|
151
|
-
}), (a, i) => (
|
|
152
|
-
class:
|
|
151
|
+
}), (a, i) => (M(), S("div", {
|
|
152
|
+
class: O(v(n).b())
|
|
153
153
|
}, [
|
|
154
|
-
|
|
155
|
-
z(
|
|
156
|
-
name: `${
|
|
154
|
+
fe(a.$slots, "default"),
|
|
155
|
+
z(ge, {
|
|
156
|
+
name: `${v(n).namespace.value}-zoom-in-center`,
|
|
157
157
|
persisted: ""
|
|
158
158
|
}, {
|
|
159
159
|
default: F(() => [
|
|
160
160
|
Qe(x("sup", {
|
|
161
|
-
class:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
class: O([
|
|
162
|
+
v(n).e("content"),
|
|
163
|
+
v(n).em("content", a.type),
|
|
164
|
+
v(n).is("fixed", !!a.$slots.default),
|
|
165
|
+
v(n).is("dot", a.isDot),
|
|
166
|
+
v(n).is("hide-zero", !a.showZero && t.value === 0),
|
|
167
167
|
a.badgeClass
|
|
168
168
|
]),
|
|
169
|
-
style: De(
|
|
169
|
+
style: De(v(s))
|
|
170
170
|
}, [
|
|
171
|
-
|
|
172
|
-
le(J(
|
|
171
|
+
fe(a.$slots, "content", { value: v(o) }, () => [
|
|
172
|
+
le(J(v(o)), 1)
|
|
173
173
|
])
|
|
174
174
|
], 6), [
|
|
175
|
-
[Ye, !a.hidden && (
|
|
175
|
+
[Ye, !a.hidden && (v(o) || a.isDot || a.$slots.content)]
|
|
176
176
|
])
|
|
177
177
|
]),
|
|
178
178
|
_: 3
|
|
@@ -223,11 +223,11 @@ oe({
|
|
|
223
223
|
name: "ElConfigProvider",
|
|
224
224
|
props: Xt,
|
|
225
225
|
setup(r, { slots: e }) {
|
|
226
|
-
const t =
|
|
226
|
+
const t = ft(r);
|
|
227
227
|
return V(() => r.message, (n) => {
|
|
228
228
|
var o, s;
|
|
229
229
|
Object.assign(N, (s = (o = t?.value) == null ? void 0 : o.message) != null ? s : {}, n ?? {});
|
|
230
|
-
}, { immediate: !0, deep: !0 }), () =>
|
|
230
|
+
}, { immediate: !0, deep: !0 }), () => fe(e, "default", { config: t?.value });
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
const tt = [
|
|
@@ -266,7 +266,7 @@ const tt = [
|
|
|
266
266
|
default: I.duration
|
|
267
267
|
},
|
|
268
268
|
icon: {
|
|
269
|
-
type:
|
|
269
|
+
type: gt,
|
|
270
270
|
default: I.icon
|
|
271
271
|
},
|
|
272
272
|
id: {
|
|
@@ -330,44 +330,44 @@ const tt = [
|
|
|
330
330
|
props: Jt,
|
|
331
331
|
emits: en,
|
|
332
332
|
setup(r, { expose: e, emit: t }) {
|
|
333
|
-
const n = r, { Close: o } = wt, s =
|
|
334
|
-
let
|
|
335
|
-
const
|
|
333
|
+
const n = r, { Close: o } = wt, s = E(!1), { ns: a, zIndex: i } = yt("message"), { currentZIndex: d, nextZIndex: l } = i, c = E(), h = E(!1), w = E(0);
|
|
334
|
+
let f;
|
|
335
|
+
const C = _(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), b = _(() => {
|
|
336
336
|
const y = n.type;
|
|
337
337
|
return { [a.bm("icon", y)]: y && Ie[y] };
|
|
338
|
-
}), P =
|
|
338
|
+
}), P = _(() => n.icon || Ie[n.type] || ""), D = _(() => nn(n.id)), j = _(() => on(n.id, n.offset) + D.value), se = _(() => w.value + j.value), ue = _(() => ({
|
|
339
339
|
top: `${j.value}px`,
|
|
340
340
|
zIndex: d.value
|
|
341
341
|
}));
|
|
342
342
|
function X() {
|
|
343
|
-
n.duration !== 0 && ({ stop:
|
|
344
|
-
|
|
343
|
+
n.duration !== 0 && ({ stop: f } = bt(() => {
|
|
344
|
+
L();
|
|
345
345
|
}, n.duration));
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
|
|
347
|
+
function R() {
|
|
348
|
+
f?.();
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function L() {
|
|
351
351
|
h.value = !1, ve(() => {
|
|
352
352
|
var y;
|
|
353
353
|
s.value || ((y = n.onClose) == null || y.call(n), t("destroy"));
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
356
|
function H({ code: y }) {
|
|
357
|
-
y === qt.esc &&
|
|
357
|
+
y === qt.esc && L();
|
|
358
358
|
}
|
|
359
359
|
return Ze(() => {
|
|
360
360
|
X(), l(), h.value = !0;
|
|
361
361
|
}), V(() => n.repeatNum, () => {
|
|
362
|
-
|
|
363
|
-
}),
|
|
362
|
+
R(), X();
|
|
363
|
+
}), Rt(document, "keydown", H), Tt(c, () => {
|
|
364
364
|
w.value = c.value.getBoundingClientRect().height;
|
|
365
365
|
}), e({
|
|
366
366
|
visible: h,
|
|
367
367
|
bottom: se,
|
|
368
|
-
close:
|
|
369
|
-
}), (y, we) => (
|
|
370
|
-
name:
|
|
368
|
+
close: L
|
|
369
|
+
}), (y, we) => (M(), de(ge, {
|
|
370
|
+
name: v(a).b("fade"),
|
|
371
371
|
onBeforeEnter: (ae) => s.value = !0,
|
|
372
372
|
onBeforeLeave: y.onClose,
|
|
373
373
|
onAfterLeave: (ae) => y.$emit("destroy"),
|
|
@@ -378,52 +378,52 @@ const tt = [
|
|
|
378
378
|
id: y.id,
|
|
379
379
|
ref_key: "messageRef",
|
|
380
380
|
ref: c,
|
|
381
|
-
class:
|
|
382
|
-
|
|
383
|
-
{ [
|
|
384
|
-
|
|
385
|
-
|
|
381
|
+
class: O([
|
|
382
|
+
v(a).b(),
|
|
383
|
+
{ [v(a).m(y.type)]: y.type },
|
|
384
|
+
v(a).is("closable", y.showClose),
|
|
385
|
+
v(a).is("plain", y.plain),
|
|
386
386
|
y.customClass
|
|
387
387
|
]),
|
|
388
|
-
style: De(
|
|
388
|
+
style: De(v(ue)),
|
|
389
389
|
role: "alert",
|
|
390
|
-
onMouseenter:
|
|
390
|
+
onMouseenter: R,
|
|
391
391
|
onMouseleave: X
|
|
392
392
|
}, [
|
|
393
|
-
y.repeatNum > 1 ? (
|
|
393
|
+
y.repeatNum > 1 ? (M(), de(v(Zt), {
|
|
394
394
|
key: 0,
|
|
395
395
|
value: y.repeatNum,
|
|
396
|
-
type:
|
|
397
|
-
class:
|
|
396
|
+
type: v(C),
|
|
397
|
+
class: O(v(a).e("badge"))
|
|
398
398
|
}, null, 8, ["value", "type", "class"])) : $("v-if", !0),
|
|
399
|
-
|
|
399
|
+
v(P) ? (M(), de(v(Se), {
|
|
400
400
|
key: 1,
|
|
401
|
-
class:
|
|
401
|
+
class: O([v(a).e("icon"), v(b)])
|
|
402
402
|
}, {
|
|
403
403
|
default: F(() => [
|
|
404
|
-
(
|
|
404
|
+
(M(), de(Dt(v(P))))
|
|
405
405
|
]),
|
|
406
406
|
_: 1
|
|
407
407
|
}, 8, ["class"])) : $("v-if", !0),
|
|
408
|
-
|
|
409
|
-
y.dangerouslyUseHTMLString ? (
|
|
408
|
+
fe(y.$slots, "default", {}, () => [
|
|
409
|
+
y.dangerouslyUseHTMLString ? (M(), S(ce, { key: 1 }, [
|
|
410
410
|
$(" Caution here, message could've been compromised, never use user's input as message "),
|
|
411
411
|
x("p", {
|
|
412
|
-
class:
|
|
412
|
+
class: O(v(a).e("content")),
|
|
413
413
|
innerHTML: y.message
|
|
414
414
|
}, null, 10, ["innerHTML"])
|
|
415
|
-
], 2112)) : (
|
|
415
|
+
], 2112)) : (M(), S("p", {
|
|
416
416
|
key: 0,
|
|
417
|
-
class:
|
|
417
|
+
class: O(v(a).e("content"))
|
|
418
418
|
}, J(y.message), 3))
|
|
419
419
|
]),
|
|
420
|
-
y.showClose ? (
|
|
420
|
+
y.showClose ? (M(), de(v(Se), {
|
|
421
421
|
key: 2,
|
|
422
|
-
class:
|
|
423
|
-
onClick: kt(
|
|
422
|
+
class: O(v(a).e("closeBtn")),
|
|
423
|
+
onClick: kt(L, ["stop"])
|
|
424
424
|
}, {
|
|
425
425
|
default: F(() => [
|
|
426
|
-
z(
|
|
426
|
+
z(v(o))
|
|
427
427
|
]),
|
|
428
428
|
_: 1
|
|
429
429
|
}, 8, ["class", "onClick"])) : $("v-if", !0)
|
|
@@ -514,7 +514,7 @@ function mn(r) {
|
|
|
514
514
|
}
|
|
515
515
|
te.closeAll = mn;
|
|
516
516
|
te._context = null;
|
|
517
|
-
const
|
|
517
|
+
const k = Ct(te, "$message");
|
|
518
518
|
class T extends ye {
|
|
519
519
|
_renderer;
|
|
520
520
|
get renderer() {
|
|
@@ -633,11 +633,11 @@ class hn extends T {
|
|
|
633
633
|
this.addEventRecord(
|
|
634
634
|
"clear",
|
|
635
635
|
t.addEventListener("pointerPositionChange", () => {
|
|
636
|
-
const { point: w, find:
|
|
637
|
-
if (this.dispatchEvent({ type: "pointerMove", point: w }),
|
|
636
|
+
const { point: w, find: f } = t.renderManager.adsorption();
|
|
637
|
+
if (this.dispatchEvent({ type: "pointerMove", point: w }), f ? (a.position.set(w.x, w.y, 0), this.container.add(a), i.style.cursor = "none") : (a.removeFromParent(), i.style.cursor = "crosshair"), h.copy(w), !!(n && o)) {
|
|
638
638
|
if (t.eventInput.isKeyDown("shift")) {
|
|
639
|
-
const
|
|
640
|
-
|
|
639
|
+
const C = Math.abs(t.pointerPosition.x - n.x), b = Math.abs(t.pointerPosition.y - n.y);
|
|
640
|
+
C > b ? o.set(t.pointerPosition.x, n.y, 0) : o.set(n.x, t.pointerPosition.y, 0), c(), h.copy(o);
|
|
641
641
|
return;
|
|
642
642
|
}
|
|
643
643
|
o.set(t.pointerPosition.x, t.pointerPosition.y, 0), c();
|
|
@@ -758,32 +758,32 @@ class ke extends ye {
|
|
|
758
758
|
opacity: 0.5
|
|
759
759
|
});
|
|
760
760
|
const c = () => {
|
|
761
|
-
const
|
|
762
|
-
|
|
761
|
+
const f = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), D = [
|
|
762
|
+
f,
|
|
763
763
|
P,
|
|
764
764
|
0,
|
|
765
|
-
|
|
765
|
+
C,
|
|
766
766
|
b,
|
|
767
767
|
0,
|
|
768
|
-
|
|
768
|
+
C,
|
|
769
769
|
P,
|
|
770
770
|
0,
|
|
771
|
-
|
|
771
|
+
f,
|
|
772
772
|
P,
|
|
773
773
|
0,
|
|
774
|
-
|
|
774
|
+
f,
|
|
775
775
|
b,
|
|
776
776
|
0,
|
|
777
|
-
|
|
777
|
+
C,
|
|
778
778
|
b,
|
|
779
779
|
0
|
|
780
780
|
];
|
|
781
|
-
l.geometry = e.renderManager.createGeometry({ position:
|
|
781
|
+
l.geometry = e.renderManager.createGeometry({ position: D }, D.length / 3);
|
|
782
782
|
}, h = () => {
|
|
783
783
|
d.copy(e.pointerPosition), c();
|
|
784
784
|
}, w = () => {
|
|
785
785
|
document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", w), l.removeFromParent();
|
|
786
|
-
const
|
|
786
|
+
const f = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), D = new We(f, C, b, P), j = e.renderManager.quadtree.queryBox(D);
|
|
787
787
|
this.removeSelectLineAll(), j.forEach((se) => this.addSelectLine(se.line)), this.updateSelectLinesGeometry();
|
|
788
788
|
};
|
|
789
789
|
document.addEventListener("mousemove", h), document.addEventListener("mouseup", w);
|
|
@@ -823,6 +823,8 @@ class un extends Ue {
|
|
|
823
823
|
list = [];
|
|
824
824
|
rollbacklist = [];
|
|
825
825
|
revokeRollbacklist = [];
|
|
826
|
+
// 是否写入操作记录
|
|
827
|
+
writeOperationList = !0;
|
|
826
828
|
/**
|
|
827
829
|
*
|
|
828
830
|
* @param operation
|
|
@@ -907,7 +909,7 @@ class pn extends Ue {
|
|
|
907
909
|
} catch (s) {
|
|
908
910
|
console.error(s);
|
|
909
911
|
} finally {
|
|
910
|
-
this.abortController && !this.abortController.signal.aborted && (o.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0), this.lock = !1, this.abortController = null, this.currentName = null, o.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
|
|
912
|
+
this.abortController && !this.abortController.signal.aborted && (o.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), o.writeOperationList && (this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0)), this.lock = !1, this.abortController = null, this.currentName = null, o.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
|
|
911
913
|
}
|
|
912
914
|
return t;
|
|
913
915
|
}
|
|
@@ -950,12 +952,12 @@ class pn extends Ue {
|
|
|
950
952
|
}
|
|
951
953
|
}
|
|
952
954
|
}
|
|
953
|
-
const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e",
|
|
955
|
+
const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e", fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
954
956
|
__proto__: null,
|
|
955
957
|
default: vn
|
|
956
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
958
|
+
}, Symbol.toStringTag, { value: "Module" })), gn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e", yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
957
959
|
__proto__: null,
|
|
958
|
-
default:
|
|
960
|
+
default: gn
|
|
959
961
|
}, Symbol.toStringTag, { value: "Module" })), wn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
960
962
|
__proto__: null,
|
|
961
963
|
default: wn
|
|
@@ -977,9 +979,9 @@ const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version=
|
|
|
977
979
|
}, Symbol.toStringTag, { value: "Module" })), Sn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201048%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M310.04722%20451.334244A49.95122%2049.95122%200%200%201%20239.416195%20521.990244L27.473171%20310.04722a49.95122%2049.95122%200%200%201%200-70.631025L239.416195%2027.473171a49.95122%2049.95122%200%200%201%2070.631025%2070.631024l-126.651318%20126.626342L649.365854%20224.780488c220.709463%200%20399.609756%20178.900293%20399.609756%20399.609756s-178.900293%20399.609756-399.609756%20399.609756H124.878049a49.95122%2049.95122%200%201%201%200-99.902439h524.487805c165.513366%200%20299.707317-134.193951%20299.707317-299.707317s-134.193951-299.707317-299.707317-299.707317H183.395902l126.651318%20126.651317z'%3e%3c/path%3e%3c/svg%3e", Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
978
980
|
__proto__: null,
|
|
979
981
|
default: Sn
|
|
980
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
982
|
+
}, Symbol.toStringTag, { value: "Module" })), On = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e", Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
981
983
|
__proto__: null,
|
|
982
|
-
default:
|
|
984
|
+
default: On
|
|
983
985
|
}, Symbol.toStringTag, { value: "Module" })), zn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e", Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
984
986
|
__proto__: null,
|
|
985
987
|
default: zn
|
|
@@ -994,7 +996,7 @@ class An extends ye {
|
|
|
994
996
|
static name = "RenderManager";
|
|
995
997
|
container = new m.Group();
|
|
996
998
|
lines = [];
|
|
997
|
-
pointVirtualGrid = new
|
|
999
|
+
pointVirtualGrid = new Re();
|
|
998
1000
|
quadtree = new ze(new We());
|
|
999
1001
|
actionHistory = /* @__PURE__ */ new Set();
|
|
1000
1002
|
onAddFromParent() {
|
|
@@ -1016,7 +1018,7 @@ class An extends ye {
|
|
|
1016
1018
|
return;
|
|
1017
1019
|
} else
|
|
1018
1020
|
this.updatedMode = "dxf";
|
|
1019
|
-
this.pointVirtualGrid = new
|
|
1021
|
+
this.pointVirtualGrid = new Re();
|
|
1020
1022
|
const e = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
|
|
1021
1023
|
(e.width === 0 || e.height === 0) && e.set(-200, -200, 200, 200), this.quadtree = new ze(e), this.lines.length = 0, this.dxf.lineSegments.forEach((t) => {
|
|
1022
1024
|
t.userData.isDoor && !t.userData.doorDirectConnection || this.addLine(t.clone());
|
|
@@ -1359,7 +1361,9 @@ class ee extends T {
|
|
|
1359
1361
|
onAddFromParent(e) {
|
|
1360
1362
|
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1361
1363
|
const t = this.commandManager.addCommandFlow(ee.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1362
|
-
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)),
|
|
1364
|
+
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), t.addEventListener("started", () => {
|
|
1365
|
+
!this.eventInput.isOnlyKeyDowns(this.shortcutKeys) && !this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !1);
|
|
1366
|
+
}), this.eventInput.addEventListener("codeChange", async () => {
|
|
1363
1367
|
this.eventInput.isOnlyKeyDowns(this.shortcutKeys) ? (this.recursion = !1, this.commandManager.start(ee.commandName, [...this.default.selectLines])) : this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !0, this.commandManager.start(ee.commandName, [...this.default.selectLines]));
|
|
1364
1368
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys) || this.eventInput.isOnlyKeyDowns(this.shortcutKeys2));
|
|
1365
1369
|
}
|
|
@@ -1367,7 +1371,7 @@ class ee extends T {
|
|
|
1367
1371
|
* 进入命令约束
|
|
1368
1372
|
*/
|
|
1369
1373
|
constraint(e, t) {
|
|
1370
|
-
Array.isArray(t) ? t.length !== 1 ? (
|
|
1374
|
+
Array.isArray(t) ? t.length !== 1 ? (k({ message: "请选择一条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1371
1375
|
}
|
|
1372
1376
|
/**
|
|
1373
1377
|
* 线段是否为结尾线段
|
|
@@ -1418,8 +1422,8 @@ class ee extends T {
|
|
|
1418
1422
|
const c = e.start.equal(a.start) || e.start.equal(a.end) ? e.start : e.end, h = a.start.equal(e.start) || a.start.equal(e.end) ? a.end : a.start, w = new ne(
|
|
1419
1423
|
h.clone().add(s.clone().multiplyScalar(1)),
|
|
1420
1424
|
h.clone().add(s.clone().multiplyScalar(-1))
|
|
1421
|
-
),
|
|
1422
|
-
|
|
1425
|
+
), f = w.projectPoint(c, !1);
|
|
1426
|
+
f && t.push(this.getSamePointAll(h, f));
|
|
1423
1427
|
} else
|
|
1424
1428
|
console.log("交点");
|
|
1425
1429
|
}), this.recursion && o.forEach((a) => this.correction(a, t, n)), t;
|
|
@@ -1475,7 +1479,7 @@ class q extends T {
|
|
|
1475
1479
|
* 进入命令约束
|
|
1476
1480
|
*/
|
|
1477
1481
|
constraint(e, t) {
|
|
1478
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1482
|
+
Array.isArray(t) ? t.length !== 2 ? (k({ message: "未执行线段合并,请选择两条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1479
1483
|
}
|
|
1480
1484
|
/** 开始
|
|
1481
1485
|
* @param next
|
|
@@ -1489,11 +1493,11 @@ class q extends T {
|
|
|
1489
1493
|
const d = o.points[i];
|
|
1490
1494
|
if (a.equal(d)) {
|
|
1491
1495
|
const l = n.points[(s + 1) % 2], c = o.points[(i + 1) % 2], h = new ne(l, c);
|
|
1492
|
-
return e({ line1: n, line2: o, newLine: h }),
|
|
1496
|
+
return e({ line1: n, line2: o, newLine: h }), k({ message: "已合并", type: "success" });
|
|
1493
1497
|
}
|
|
1494
1498
|
}
|
|
1495
1499
|
}
|
|
1496
|
-
|
|
1500
|
+
k({ message: "合并失败,两条线未找到共用点", type: "warning" }), this.commandManager.cancel();
|
|
1497
1501
|
}
|
|
1498
1502
|
/** 执行完成
|
|
1499
1503
|
* @param data
|
|
@@ -1528,13 +1532,13 @@ class W extends T {
|
|
|
1528
1532
|
* 进入命令约束
|
|
1529
1533
|
*/
|
|
1530
1534
|
constraint(e, t) {
|
|
1531
|
-
Array.isArray(t) ? e(t) : (
|
|
1535
|
+
Array.isArray(t) ? e(t) : (k({ message: "请选择线段", type: "warning" }), this.cancel());
|
|
1532
1536
|
}
|
|
1533
1537
|
/** 开始
|
|
1534
1538
|
* @param next
|
|
1535
1539
|
*/
|
|
1536
1540
|
delete(e, t) {
|
|
1537
|
-
t.forEach((n) => this.renderManager.removeLine(n)),
|
|
1541
|
+
t.forEach((n) => this.renderManager.removeLine(n)), k({ message: "删除成功", type: "success" }), e(t);
|
|
1538
1542
|
}
|
|
1539
1543
|
/** 回滚操作
|
|
1540
1544
|
* @param data
|
|
@@ -1565,7 +1569,7 @@ class U extends T {
|
|
|
1565
1569
|
* 进入命令约束
|
|
1566
1570
|
*/
|
|
1567
1571
|
constraint(e, t) {
|
|
1568
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1572
|
+
Array.isArray(t) ? t.length !== 2 ? (k({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1569
1573
|
}
|
|
1570
1574
|
/** 连接
|
|
1571
1575
|
* @param next
|
|
@@ -1579,7 +1583,7 @@ class U extends T {
|
|
|
1579
1583
|
}
|
|
1580
1584
|
if (n && o) {
|
|
1581
1585
|
const a = new ne(n.clone(), o.clone());
|
|
1582
|
-
e(a),
|
|
1586
|
+
e(a), k({ message: "连接成功", type: "success" });
|
|
1583
1587
|
} else this.cancel();
|
|
1584
1588
|
}
|
|
1585
1589
|
/** 成功
|
|
@@ -1618,7 +1622,7 @@ class Q extends T {
|
|
|
1618
1622
|
* 进入命令约束
|
|
1619
1623
|
*/
|
|
1620
1624
|
constraint(e, t) {
|
|
1621
|
-
Array.isArray(t) ? t.length !== 2 ? (
|
|
1625
|
+
Array.isArray(t) ? t.length !== 2 ? (k({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1622
1626
|
}
|
|
1623
1627
|
/** 开始
|
|
1624
1628
|
* @param next
|
|
@@ -1629,7 +1633,7 @@ class Q extends T {
|
|
|
1629
1633
|
const a = n.points.map((c) => c.clone()), i = o.points.map((c) => c.clone());
|
|
1630
1634
|
n.start.distance(s) < n.end.distance(s) ? n.start.copy(s) : n.end.copy(s), o.start.distance(s) < o.end.distance(s) ? o.start.copy(s) : o.end.copy(s);
|
|
1631
1635
|
const d = n.points.map((c) => c.clone()), l = o.points.map((c) => c.clone());
|
|
1632
|
-
e({ line1: n, line2: o, oldLine1: a, oldLine2: i, newLine1: d, newLine2: l }),
|
|
1636
|
+
e({ line1: n, line2: o, oldLine1: a, oldLine2: i, newLine1: d, newLine2: l }), k({ message: "连接成功", type: "success" });
|
|
1633
1637
|
}
|
|
1634
1638
|
/** 执行完成
|
|
1635
1639
|
* @param next
|
|
@@ -1668,7 +1672,7 @@ class Y extends T {
|
|
|
1668
1672
|
* 进入命令约束
|
|
1669
1673
|
*/
|
|
1670
1674
|
constraint(e, t) {
|
|
1671
|
-
Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (
|
|
1675
|
+
Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (k({ message: "请选择有窗户线段", type: "warning" }), this.cancel()) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
|
|
1672
1676
|
}
|
|
1673
1677
|
/** 开始
|
|
1674
1678
|
* @param next
|
|
@@ -1680,7 +1684,7 @@ class Y extends T {
|
|
|
1680
1684
|
line: s,
|
|
1681
1685
|
drawDoorData: s.userData.drawDoorData
|
|
1682
1686
|
}), n = !0);
|
|
1683
|
-
}), n &&
|
|
1687
|
+
}), n && k({ message: "删除窗户成功", type: "success" }), e(o);
|
|
1684
1688
|
}
|
|
1685
1689
|
/**
|
|
1686
1690
|
* 完成
|
|
@@ -1718,7 +1722,7 @@ class Z extends T {
|
|
|
1718
1722
|
onAddFromParent(e) {
|
|
1719
1723
|
super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
|
|
1720
1724
|
const t = this.commandManager.addCommandFlow(Z.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
|
|
1721
|
-
t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(Z.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1725
|
+
t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(Z.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
|
|
1722
1726
|
this.eventInput.isKeyCombination(Z.commandName) && await this.commandManager.start(Z.commandName);
|
|
1723
1727
|
}), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
|
|
1724
1728
|
}
|
|
@@ -1769,45 +1773,45 @@ const $n = {
|
|
|
1769
1773
|
permission: {}
|
|
1770
1774
|
},
|
|
1771
1775
|
setup(r) {
|
|
1772
|
-
function e(
|
|
1773
|
-
const re =
|
|
1774
|
-
|
|
1776
|
+
function e(g, u, p = h.value.getBoundingClientRect(), G = w.value.getBoundingClientRect()) {
|
|
1777
|
+
const re = p.width - G.width, ie = 0, xe = p.height - G.height;
|
|
1778
|
+
g = Math.max(0, Math.min(g, re)), u = Math.max(ie, Math.min(u, xe)), R.value = { left: g, top: u };
|
|
1775
1779
|
}
|
|
1776
|
-
function t(
|
|
1777
|
-
|
|
1780
|
+
function t(g) {
|
|
1781
|
+
C.value === g.command || C.value !== "default" || D.commandManager.start(g.command);
|
|
1778
1782
|
}
|
|
1779
|
-
function n(
|
|
1780
|
-
if (
|
|
1781
|
-
localStorage.setItem("lines", JSON.stringify(
|
|
1783
|
+
function n(g) {
|
|
1784
|
+
if (g) {
|
|
1785
|
+
localStorage.setItem("lines", JSON.stringify(g));
|
|
1782
1786
|
try {
|
|
1783
|
-
b.Dxf.set(
|
|
1787
|
+
b.Dxf.set(g), b.Dxf.lineOffset();
|
|
1784
1788
|
} catch (u) {
|
|
1785
1789
|
console.log(u);
|
|
1786
1790
|
}
|
|
1787
1791
|
}
|
|
1788
1792
|
}
|
|
1789
1793
|
async function o() {
|
|
1790
|
-
const
|
|
1791
|
-
Array.isArray(
|
|
1794
|
+
const g = await Et.json();
|
|
1795
|
+
Array.isArray(g) && (localStorage.removeItem("orbitControls"), n(g));
|
|
1792
1796
|
}
|
|
1793
|
-
function s({ offsetX:
|
|
1797
|
+
function s({ offsetX: g, offsetY: u }) {
|
|
1794
1798
|
P.mouseMoveEventProxylock = !0;
|
|
1795
|
-
const
|
|
1799
|
+
const p = document.body.style.cursor;
|
|
1796
1800
|
document.body.style.cursor = "move";
|
|
1797
1801
|
const G = (re) => {
|
|
1798
1802
|
const ie = h.value.getBoundingClientRect(), xe = w.value.getBoundingClientRect();
|
|
1799
1803
|
e(
|
|
1800
|
-
re.pageX - ie.left -
|
|
1804
|
+
re.pageX - ie.left - g,
|
|
1801
1805
|
re.pageY - ie.top - u,
|
|
1802
1806
|
ie,
|
|
1803
1807
|
xe
|
|
1804
1808
|
), re.stopPropagation(), document.body.style.cursor = "move";
|
|
1805
1809
|
}, be = () => {
|
|
1806
|
-
document.body.removeEventListener("mousemove", G), document.removeEventListener("mouseup", be), document.body.style.cursor =
|
|
1810
|
+
document.body.removeEventListener("mousemove", G), document.removeEventListener("mouseup", be), document.body.style.cursor = p, P.mouseMoveEventProxylock = !1;
|
|
1807
1811
|
};
|
|
1808
1812
|
document.body.addEventListener("mousemove", G), document.addEventListener("mouseup", be);
|
|
1809
1813
|
}
|
|
1810
|
-
const a = r, i =
|
|
1814
|
+
const a = r, i = E(!0), d = E(!0), l = E(!0), c = E(!1), h = E(), w = E(), f = E(!0), C = E(""), b = Pt(a.dxfSystem), P = b.findComponentByType(Mt), D = b.findComponentByType(ot), j = b.findComponentByType(ke), se = b.findComponentByType(Lt), ue = E(0), X = E(0), R = E({ left: 10, top: 10 }), L = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": fn, "./assets/images/deleteSelectLine.svg": yn, "./assets/images/deleteSelectWindow.svg": bn, "./assets/images/door.svg": Cn, "./assets/images/intersectionConnection.svg": En, "./assets/images/line.svg": _n, "./assets/images/mergeLine.svg": kn, "./assets/images/revokeRollback.svg": In, "./assets/images/rollback.svg": Nn, "./assets/images/selectAll.svg": Rn, "./assets/images/selectPoint.svg": Bn, "./assets/images/verticalCorrection.svg": Kn, "./assets/images/window.svg": Vn }), H = E(!1), y = E(0), we = E(!1), ae = new ResizeObserver(() => e(R.value.left, R.value.top)), st = [
|
|
1811
1815
|
{ name: "开启绘制线段命令", shortcut: "Ctrl + L" },
|
|
1812
1816
|
{ name: "开启绘制门线命令", shortcut: "Ctrl + M" },
|
|
1813
1817
|
{ name: "开启绘制窗户线命令", shortcut: "Ctrl + Q" },
|
|
@@ -1837,7 +1841,7 @@ const $n = {
|
|
|
1837
1841
|
{
|
|
1838
1842
|
command: "draw-line",
|
|
1839
1843
|
name: "绘制线段",
|
|
1840
|
-
src:
|
|
1844
|
+
src: L["./assets/images/line.svg"].default,
|
|
1841
1845
|
show: !0,
|
|
1842
1846
|
shortcut: "Ctrl + L"
|
|
1843
1847
|
},
|
|
@@ -1845,133 +1849,133 @@ const $n = {
|
|
|
1845
1849
|
command: "draw-door-line",
|
|
1846
1850
|
name: "绘制门线",
|
|
1847
1851
|
show: !0,
|
|
1848
|
-
src:
|
|
1852
|
+
src: L["./assets/images/door.svg"].default,
|
|
1849
1853
|
shortcut: "Ctrl + M"
|
|
1850
1854
|
},
|
|
1851
1855
|
{
|
|
1852
1856
|
command: "draw-window-line",
|
|
1853
1857
|
name: "绘制窗户线",
|
|
1854
1858
|
show: !0,
|
|
1855
|
-
src:
|
|
1859
|
+
src: L["./assets/images/window.svg"].default,
|
|
1856
1860
|
shortcut: "Ctrl + Q"
|
|
1857
1861
|
},
|
|
1858
1862
|
{
|
|
1859
1863
|
command: "point",
|
|
1860
1864
|
name: "点修改",
|
|
1861
1865
|
show: !0,
|
|
1862
|
-
src:
|
|
1866
|
+
src: L["./assets/images/selectPoint.svg"].default,
|
|
1863
1867
|
shortcut: "Ctrl + P"
|
|
1864
1868
|
}
|
|
1865
1869
|
], rt = [
|
|
1866
1870
|
{
|
|
1867
1871
|
command: "",
|
|
1868
1872
|
name: "操作回滚",
|
|
1869
|
-
src:
|
|
1870
|
-
show:
|
|
1873
|
+
src: L["./assets/images/rollback.svg"].default,
|
|
1874
|
+
show: _(() => ue.value !== 0),
|
|
1871
1875
|
shortcut: "Ctrl + Z",
|
|
1872
1876
|
action() {
|
|
1873
|
-
|
|
1877
|
+
D.commandManager.rollback();
|
|
1874
1878
|
}
|
|
1875
1879
|
},
|
|
1876
1880
|
{
|
|
1877
1881
|
command: "",
|
|
1878
1882
|
name: "撤销操作回滚",
|
|
1879
|
-
src:
|
|
1880
|
-
show:
|
|
1883
|
+
src: L["./assets/images/revokeRollback.svg"].default,
|
|
1884
|
+
show: _(() => X.value !== 0),
|
|
1881
1885
|
shortcut: "Ctrl + Y",
|
|
1882
1886
|
class: "rotateY-[180deg]",
|
|
1883
1887
|
action() {
|
|
1884
|
-
|
|
1888
|
+
D.commandManager.revokeRollback();
|
|
1885
1889
|
}
|
|
1886
1890
|
},
|
|
1887
1891
|
{
|
|
1888
1892
|
command: q.commandName,
|
|
1889
1893
|
name: "合并",
|
|
1890
|
-
src:
|
|
1891
|
-
show:
|
|
1894
|
+
src: L["./assets/images/mergeLine.svg"].default,
|
|
1895
|
+
show: _(() => y.value === 2),
|
|
1892
1896
|
shortcut: "Ctrl + G"
|
|
1893
1897
|
},
|
|
1894
1898
|
{
|
|
1895
1899
|
command: U.commandName,
|
|
1896
1900
|
name: "两点连接",
|
|
1897
|
-
show:
|
|
1898
|
-
src:
|
|
1901
|
+
show: _(() => y.value === 2),
|
|
1902
|
+
src: L["./assets/images/connection.svg"].default,
|
|
1899
1903
|
shortcut: "Shift + L"
|
|
1900
1904
|
},
|
|
1901
1905
|
{
|
|
1902
1906
|
command: Q.commandName,
|
|
1903
1907
|
name: "延长线交点连接",
|
|
1904
|
-
show:
|
|
1905
|
-
src:
|
|
1908
|
+
show: _(() => y.value === 2),
|
|
1909
|
+
src: L["./assets/images/intersectionConnection.svg"].default,
|
|
1906
1910
|
shortcut: "Ctrl + Shift + L"
|
|
1907
1911
|
},
|
|
1908
1912
|
{
|
|
1909
1913
|
command: ee.commandName,
|
|
1910
1914
|
name: "线段垂直纠正",
|
|
1911
|
-
show:
|
|
1912
|
-
src:
|
|
1915
|
+
show: _(() => y.value === 1),
|
|
1916
|
+
src: L["./assets/images/verticalCorrection.svg"].default,
|
|
1913
1917
|
shortcut: "Ctrl + C 或 Ctrl + Shift + C"
|
|
1914
1918
|
},
|
|
1915
1919
|
{
|
|
1916
1920
|
command: Z.commandName,
|
|
1917
1921
|
name: "全选",
|
|
1918
|
-
show:
|
|
1919
|
-
src:
|
|
1922
|
+
show: _(() => y.value !== D.renderManager.lines.length),
|
|
1923
|
+
src: L["./assets/images/selectAll.svg"].default,
|
|
1920
1924
|
shortcut: "Ctrl + A"
|
|
1921
1925
|
},
|
|
1922
1926
|
{
|
|
1923
1927
|
command: Y.commandName,
|
|
1924
1928
|
name: "清除窗户",
|
|
1925
|
-
show:
|
|
1926
|
-
src:
|
|
1929
|
+
show: _(() => we.value),
|
|
1930
|
+
src: L["./assets/images/deleteSelectWindow.svg"].default,
|
|
1927
1931
|
shortcut: "Q + Delete"
|
|
1928
1932
|
},
|
|
1929
1933
|
{
|
|
1930
1934
|
command: W.commandName,
|
|
1931
1935
|
name: "删除",
|
|
1932
|
-
show:
|
|
1933
|
-
src:
|
|
1936
|
+
show: _(() => y.value > 0),
|
|
1937
|
+
src: L["./assets/images/deleteSelectLine.svg"].default,
|
|
1934
1938
|
shortcut: "Delete"
|
|
1935
1939
|
}
|
|
1936
1940
|
];
|
|
1937
|
-
V(
|
|
1938
|
-
localStorage.setItem("toolBarExpand",
|
|
1939
|
-
}), V(i, () => b.Variable.set("originalLineVisible", i.value)), V(d, () => b.Variable.set("dxfVisible", d.value)), V(l, () => b.Variable.set("whiteModelVisible", l.value)), b.Variable.addEventListener("isLook", (
|
|
1940
|
-
const it =
|
|
1941
|
-
|
|
1941
|
+
V(R, () => localStorage.setItem("editorToolPosition", JSON.stringify(R.value))), V(H, () => localStorage.setItem("showShortcutKey", H.value + "")), V(f, () => {
|
|
1942
|
+
localStorage.setItem("toolBarExpand", f.value + ""), f.value && ve(() => e(R.value.left, R.value.top));
|
|
1943
|
+
}), V(i, () => b.Variable.set("originalLineVisible", i.value)), V(d, () => b.Variable.set("dxfVisible", d.value)), V(l, () => b.Variable.set("whiteModelVisible", l.value)), b.Variable.addEventListener("isLook", (g) => c.value = g.value), b.Variable.addEventListener("originalLineVisible", (g) => i.value = g.value), b.Variable.addEventListener("dxfVisible", (g) => d.value = g.value), b.Variable.addEventListener("whiteModelVisible", (g) => l.value = g.value);
|
|
1944
|
+
const it = D.commandManager.addEventListener("started", (g) => {
|
|
1945
|
+
C.value = g.name;
|
|
1942
1946
|
});
|
|
1943
|
-
return localStorage.getItem("showShortcutKey") && (H.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (
|
|
1947
|
+
return localStorage.getItem("showShortcutKey") && (H.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (f.value = localStorage.getItem("toolBarExpand") === "true"), Ze(() => {
|
|
1944
1948
|
w.value.style.display = "none", setTimeout(() => {
|
|
1945
1949
|
if (w.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
|
|
1946
|
-
const { left:
|
|
1947
|
-
e(
|
|
1950
|
+
const { left: g, top: u } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
|
|
1951
|
+
e(g, u), ve(() => ae.observe(h.value));
|
|
1948
1952
|
} else
|
|
1949
1953
|
ve(() => ae.observe(h.value));
|
|
1950
1954
|
}, 100), j.addEventListener("selectLineChange", () => {
|
|
1951
|
-
y.value = j.selectLines.length, we.value = j.selectLines.some((
|
|
1952
|
-
}), ["rollback", "completed", "revokeRollback"].forEach((
|
|
1953
|
-
|
|
1955
|
+
y.value = j.selectLines.length, we.value = j.selectLines.some((g) => g.userData.isWindow);
|
|
1956
|
+
}), ["rollback", "completed", "revokeRollback"].forEach((g) => {
|
|
1957
|
+
D.commandManager.addEventListener(g, () => {
|
|
1954
1958
|
setTimeout(() => {
|
|
1955
|
-
ue.value =
|
|
1959
|
+
ue.value = D.commandManager.operationList.length, X.value = D.commandManager.rollbackList.length;
|
|
1956
1960
|
});
|
|
1957
1961
|
});
|
|
1958
1962
|
});
|
|
1959
1963
|
}), It(() => {
|
|
1960
1964
|
P.mouseMoveEventProxylock = !1, it(), ae.disconnect();
|
|
1961
|
-
}), (
|
|
1965
|
+
}), (g, u) => (M(), S("div", {
|
|
1962
1966
|
ref_key: "elRef",
|
|
1963
1967
|
ref: h,
|
|
1964
1968
|
class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
|
|
1965
1969
|
}, [
|
|
1966
|
-
z(
|
|
1970
|
+
z(ge, null, {
|
|
1967
1971
|
default: F(() => [
|
|
1968
|
-
H.value ? (
|
|
1969
|
-
(
|
|
1972
|
+
H.value ? (M(), S("div", $n, [
|
|
1973
|
+
(M(), S(ce, null, Me(st, (p) => x("div", {
|
|
1970
1974
|
class: "p-[4px_0px] flex justify-between text-right border-b-1 border-b-[rgba(255,255,255,0.1)] last-of-type:border-b-0",
|
|
1971
|
-
key:
|
|
1975
|
+
key: p.name
|
|
1972
1976
|
}, [
|
|
1973
|
-
x("p", Hn, J(
|
|
1974
|
-
x("span", qn, J(
|
|
1977
|
+
x("p", Hn, J(p.name), 1),
|
|
1978
|
+
x("span", qn, J(p.shortcut), 1)
|
|
1975
1979
|
])), 64))
|
|
1976
1980
|
])) : $("", !0)
|
|
1977
1981
|
]),
|
|
@@ -1980,23 +1984,23 @@ const $n = {
|
|
|
1980
1984
|
x("div", {
|
|
1981
1985
|
ref_key: "toolBarRef",
|
|
1982
1986
|
ref: w,
|
|
1983
|
-
style: De({ left:
|
|
1984
|
-
class:
|
|
1985
|
-
onMousedown: u[8] || (u[8] = (
|
|
1987
|
+
style: De({ left: R.value.left + "px", top: R.value.top + "px" }),
|
|
1988
|
+
class: O(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": f.value }]),
|
|
1989
|
+
onMousedown: u[8] || (u[8] = (p) => p.stopPropagation())
|
|
1986
1990
|
}, [
|
|
1987
1991
|
x("div", {
|
|
1988
1992
|
onMousedown: s,
|
|
1989
|
-
class:
|
|
1993
|
+
class: O([{ "border-b-[#eee] border-b-1": f.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
|
|
1990
1994
|
}, [
|
|
1991
|
-
u[10] || (u[10] = St('<div class="flex flex-row" data-v-
|
|
1995
|
+
u[10] || (u[10] = St('<div class="flex flex-row" data-v-fb4f87a4><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-fb4f87a4><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-fb4f87a4><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-fb4f87a4></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-fb4f87a4>绘制工具</h5></div>', 1)),
|
|
1992
1996
|
x("div", {
|
|
1993
|
-
onMousedown: u[0] || (u[0] = (
|
|
1994
|
-
onClick: u[1] || (u[1] = (
|
|
1997
|
+
onMousedown: u[0] || (u[0] = (p) => p.stopPropagation()),
|
|
1998
|
+
onClick: u[1] || (u[1] = (p) => f.value = !f.value),
|
|
1995
1999
|
class: "cursor-pointer flex items-center p-[0px_5px]"
|
|
1996
2000
|
}, [
|
|
1997
|
-
(
|
|
2001
|
+
(M(), S("svg", {
|
|
1998
2002
|
fill: "#666",
|
|
1999
|
-
class:
|
|
2003
|
+
class: O([{ "rotate-90": f.value }, "transition-all"]),
|
|
2000
2004
|
viewBox: "0 0 1024 1024",
|
|
2001
2005
|
version: "1.1",
|
|
2002
2006
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2007,32 +2011,35 @@ const $n = {
|
|
|
2007
2011
|
]), 2))
|
|
2008
2012
|
], 32)
|
|
2009
2013
|
], 34),
|
|
2010
|
-
|
|
2014
|
+
f.value ? (M(), S("div", Wn, [
|
|
2011
2015
|
x("ul", Un, [
|
|
2012
|
-
(
|
|
2013
|
-
key:
|
|
2016
|
+
(M(), S(ce, null, Me(at, (p) => (M(), S(ce, {
|
|
2017
|
+
key: p.command
|
|
2014
2018
|
}, [
|
|
2015
|
-
|
|
2019
|
+
p.show ? (M(), S("li", {
|
|
2016
2020
|
key: 0,
|
|
2017
|
-
onClick: (G) => t(
|
|
2018
|
-
class:
|
|
2021
|
+
onClick: (G) => t(p),
|
|
2022
|
+
class: O([{
|
|
2023
|
+
"!bg-[var(--primary-color)] text-[#fff]": C.value === p.command,
|
|
2024
|
+
"!cursor-no-drop": C.value !== p.command && C.value !== "default"
|
|
2025
|
+
}, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
|
|
2019
2026
|
}, [
|
|
2020
2027
|
x("div", Yn, [
|
|
2021
2028
|
x("div", Zn, [
|
|
2022
2029
|
x("img", {
|
|
2023
2030
|
class: "size-[14px]",
|
|
2024
|
-
src:
|
|
2031
|
+
src: p.src,
|
|
2025
2032
|
alt: "",
|
|
2026
2033
|
srcset: ""
|
|
2027
2034
|
}, null, 8, Xn)
|
|
2028
2035
|
]),
|
|
2029
|
-
x("span", Jn, J(
|
|
2036
|
+
x("span", Jn, J(p.name), 1)
|
|
2030
2037
|
]),
|
|
2031
|
-
|
|
2038
|
+
C.value === p.command ? (M(), S("div", {
|
|
2032
2039
|
key: 0,
|
|
2033
2040
|
title: "取消命令(Esc)",
|
|
2034
2041
|
class: "active:scale-[0.7] transition-all",
|
|
2035
|
-
onClick: u[2] || (u[2] = (G) => (
|
|
2042
|
+
onClick: u[2] || (u[2] = (G) => (v(D).cancelCommand(), G.stopPropagation()))
|
|
2036
2043
|
}, u[11] || (u[11] = [
|
|
2037
2044
|
x("svg", {
|
|
2038
2045
|
fill: "#fff",
|
|
@@ -2045,26 +2052,26 @@ const $n = {
|
|
|
2045
2052
|
x("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
|
|
2046
2053
|
x("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
|
|
2047
2054
|
], -1)
|
|
2048
|
-
]))) :
|
|
2055
|
+
]))) : p.shortcut ? (M(), S("div", eo, J(p.shortcut), 1)) : $("", !0)
|
|
2049
2056
|
], 10, Qn)) : $("", !0)
|
|
2050
2057
|
], 64))), 64))
|
|
2051
2058
|
]),
|
|
2052
2059
|
x("div", to, [
|
|
2053
|
-
z(
|
|
2060
|
+
z(v(Oe), {
|
|
2054
2061
|
size: "small",
|
|
2055
2062
|
modelValue: H.value,
|
|
2056
|
-
"onUpdate:modelValue": u[3] || (u[3] = (
|
|
2063
|
+
"onUpdate:modelValue": u[3] || (u[3] = (p) => H.value = p),
|
|
2057
2064
|
label: "快捷键提示"
|
|
2058
2065
|
}, null, 8, ["modelValue"]),
|
|
2059
|
-
z(
|
|
2066
|
+
z(v(Oe), {
|
|
2060
2067
|
size: "small",
|
|
2061
2068
|
modelValue: d.value,
|
|
2062
|
-
"onUpdate:modelValue": u[4] || (u[4] = (
|
|
2069
|
+
"onUpdate:modelValue": u[4] || (u[4] = (p) => d.value = p),
|
|
2063
2070
|
label: "dxf"
|
|
2064
2071
|
}, null, 8, ["modelValue"])
|
|
2065
2072
|
]),
|
|
2066
|
-
|
|
2067
|
-
z(
|
|
2073
|
+
g.permission === "admin" ? (M(), S("div", no, [
|
|
2074
|
+
z(v(pe), {
|
|
2068
2075
|
style: { padding: "5px", "font-size": "10px" },
|
|
2069
2076
|
size: "small",
|
|
2070
2077
|
type: "success",
|
|
@@ -2076,11 +2083,11 @@ const $n = {
|
|
|
2076
2083
|
_: 1,
|
|
2077
2084
|
__: [12]
|
|
2078
2085
|
}),
|
|
2079
|
-
z(
|
|
2086
|
+
z(v(pe), {
|
|
2080
2087
|
style: { padding: "5px", "font-size": "10px" },
|
|
2081
2088
|
size: "small",
|
|
2082
2089
|
type: "primary",
|
|
2083
|
-
onClick: u[5] || (u[5] = (
|
|
2090
|
+
onClick: u[5] || (u[5] = (p) => console.log(v(b).Dxf.originalData))
|
|
2084
2091
|
}, {
|
|
2085
2092
|
default: F(() => u[13] || (u[13] = [
|
|
2086
2093
|
le(" 打印Json ", -1)
|
|
@@ -2088,11 +2095,11 @@ const $n = {
|
|
|
2088
2095
|
_: 1,
|
|
2089
2096
|
__: [13]
|
|
2090
2097
|
}),
|
|
2091
|
-
z(
|
|
2098
|
+
z(v(pe), {
|
|
2092
2099
|
style: { padding: "5px", "font-size": "10px" },
|
|
2093
2100
|
size: "small",
|
|
2094
2101
|
type: "primary",
|
|
2095
|
-
onClick: u[6] || (u[6] = (
|
|
2102
|
+
onClick: u[6] || (u[6] = (p) => v(b).Dxf.download("test.dxf"))
|
|
2096
2103
|
}, {
|
|
2097
2104
|
default: F(() => u[14] || (u[14] = [
|
|
2098
2105
|
le(" 下载DXF ", -1)
|
|
@@ -2100,11 +2107,11 @@ const $n = {
|
|
|
2100
2107
|
_: 1,
|
|
2101
2108
|
__: [14]
|
|
2102
2109
|
}),
|
|
2103
|
-
z(
|
|
2110
|
+
z(v(pe), {
|
|
2104
2111
|
style: { padding: "5px", "font-size": "10px" },
|
|
2105
2112
|
size: "small",
|
|
2106
2113
|
type: "primary",
|
|
2107
|
-
onClick: u[7] || (u[7] = (
|
|
2114
|
+
onClick: u[7] || (u[7] = (p) => v(se).downloadGltf("test.glb", !0))
|
|
2108
2115
|
}, {
|
|
2109
2116
|
default: F(() => u[15] || (u[15] = [
|
|
2110
2117
|
le(" 下载白膜 ", -1)
|
|
@@ -2113,20 +2120,23 @@ const $n = {
|
|
|
2113
2120
|
__: [15]
|
|
2114
2121
|
})
|
|
2115
2122
|
])) : $("", !0),
|
|
2116
|
-
z(
|
|
2123
|
+
z(ge, null, {
|
|
2117
2124
|
default: F(() => [
|
|
2118
2125
|
x("div", oo, [
|
|
2119
2126
|
z(Nt, null, {
|
|
2120
2127
|
default: F(() => [
|
|
2121
|
-
(
|
|
2122
|
-
onClick: (G) =>
|
|
2123
|
-
title: `${
|
|
2124
|
-
class:
|
|
2125
|
-
|
|
2128
|
+
(M(), S(ce, null, Me(rt, (p) => x("div", {
|
|
2129
|
+
onClick: (G) => p.show.value && C.value === "default" && (p.action ? p.action() : v(D).commandManager.start(p.command, [...v(j).selectLines])),
|
|
2130
|
+
title: `${p.name}(${p.shortcut})`,
|
|
2131
|
+
class: O(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
|
|
2132
|
+
"opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !p.show.value || C.value !== "default",
|
|
2133
|
+
[p.class ?? ""]: !0
|
|
2134
|
+
}]),
|
|
2135
|
+
key: p.command
|
|
2126
2136
|
}, [
|
|
2127
2137
|
x("img", {
|
|
2128
2138
|
class: "size-[14px]",
|
|
2129
|
-
src:
|
|
2139
|
+
src: p.src
|
|
2130
2140
|
}, null, 8, ao)
|
|
2131
2141
|
], 10, so)), 64))
|
|
2132
2142
|
]),
|
|
@@ -2145,7 +2155,7 @@ const $n = {
|
|
|
2145
2155
|
for (const [n, o] of e)
|
|
2146
2156
|
t[n] = o;
|
|
2147
2157
|
return t;
|
|
2148
|
-
}, lo = /* @__PURE__ */ io(ro, [["__scopeId", "data-v-
|
|
2158
|
+
}, lo = /* @__PURE__ */ io(ro, [["__scopeId", "data-v-fb4f87a4"]]);
|
|
2149
2159
|
let ot = class extends ye {
|
|
2150
2160
|
static name = "Editor";
|
|
2151
2161
|
container = new m.Group();
|
|
@@ -2186,7 +2196,7 @@ let ot = class extends ye {
|
|
|
2186
2196
|
this.domContainer.domElement.parentElement && (this.domContainer.domElement.parentElement.appendChild(this.domElement), t());
|
|
2187
2197
|
});
|
|
2188
2198
|
setTimeout(() => {
|
|
2189
|
-
this.app =
|
|
2199
|
+
this.app = Ot(lo, { dxfSystem: this.parent, permission: this.viewPermission }), this.app.mount(this.domElement);
|
|
2190
2200
|
});
|
|
2191
2201
|
}
|
|
2192
2202
|
/**
|
|
@@ -2206,18 +2216,18 @@ let ot = class extends ye {
|
|
|
2206
2216
|
openEdit() {
|
|
2207
2217
|
const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, i = e.camera.position.clone(), d = o?.target?.clone(), l = new m.Vector2(), c = new m.Raycaster(), h = this.coords, w = this.pointerPosition;
|
|
2208
2218
|
this.container.position.z = n.originalZAverage, e.scene.add(this.container), o && (s.position.set(a.x, a.y, 15), o.target.set(a.x, a.y, 0), o.enableRotate = !1);
|
|
2209
|
-
const
|
|
2219
|
+
const f = () => {
|
|
2210
2220
|
e.renderer.getSize(l);
|
|
2211
|
-
const
|
|
2212
|
-
h.set(
|
|
2221
|
+
const C = t.pointer.x / l.x * 2 - 1, b = -(t.pointer.y / l.y * 2 - 1);
|
|
2222
|
+
h.set(C, b), c.setFromCamera(h, e.camera.children.length ? e.camera.children[0] : e.camera);
|
|
2213
2223
|
const P = c.intersectObject(this.plane);
|
|
2214
2224
|
P.length && (w.copy(P[0].point), this.dispatchEvent({
|
|
2215
2225
|
type: "pointerPositionChange",
|
|
2216
2226
|
position: w
|
|
2217
2227
|
}));
|
|
2218
2228
|
};
|
|
2219
|
-
t.addEventListener("mousemove",
|
|
2220
|
-
t.removeEventListener("mousemove",
|
|
2229
|
+
t.addEventListener("mousemove", f), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
|
|
2230
|
+
t.removeEventListener("mousemove", f), o && (s.position.copy(i), o.enableRotate = !0, o.target.copy(d));
|
|
2221
2231
|
};
|
|
2222
2232
|
}
|
|
2223
2233
|
/**
|