@vsleem-realsee-viewer/projection-plugin 2.0.19 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.internal.md +13 -15
- package/dist/{BimControl-BYQqyAys.mjs → BimControl-DO9t2rzj.mjs} +5 -5
- package/dist/CadControl-0efKtQaH.mjs +554 -0
- package/dist/GeoControl-DypSZU9l.mjs +7998 -0
- package/dist/{ScaleControl-BBfh0U7x.mjs → ScaleControl-CaebPLA_.mjs} +11 -11
- package/dist/api/index.d.ts +2 -3
- package/dist/components/GeoControl.vue.d.ts +7 -7
- package/dist/components/ModelPicker.vue.d.ts +1 -3
- package/dist/components/ProjectionViewer.vue.d.ts +30 -54
- package/dist/components/SpaceBindViewer.vue.d.ts +0 -1
- package/dist/components/SpaceMapViewer.vue.d.ts +6 -10
- package/dist/components/TitleControl.vue.d.ts +0 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/en-US-BvTnnpjN.mjs +23 -0
- package/dist/{index-D2EgGPM7.mjs → index-CgqxI5qL.mjs} +3273 -3277
- package/dist/index-DSggKI_y.mjs +96 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +16 -7
- package/dist/index.mjs +5 -2
- package/dist/index.umd.js +65 -62
- package/dist/ja-JP-CLUMBD9N.mjs +23 -0
- package/dist/{ja_JP-m01VWQoj.mjs → ja_JP-CssBzvno.mjs} +1 -1
- package/dist/locales/lang/en-US.json.d.ts +6 -5
- package/dist/locales/lang/ja-JP.json.d.ts +6 -5
- package/dist/locales/lang/zh-CN.json.d.ts +6 -5
- package/dist/settings/index.d.ts +43 -0
- package/dist/types/antd.d.ts +10 -0
- package/dist/types/index.d.ts +3 -50
- package/dist/types/map.d.ts +19 -0
- package/dist/types/projection.d.ts +37 -0
- package/package.json +3 -3
- package/dist/CadControl-BwM8s7Ih.mjs +0 -528
- package/dist/GeoControl-CvXbmvsE.mjs +0 -1668
- package/dist/en-US-CKEx0UKy.mjs +0 -23
- package/dist/ja-JP-D43LFHQZ.mjs +0 -23
- package/dist/resize-C-M2BSbN.mjs +0 -123
package/README.internal.md
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
### 1.1.1 坐标系枚举
|
|
10
10
|
|
|
11
11
|
- **空间坐标系** (参考`CoordinateLevel`枚举):
|
|
12
|
-
-
|
|
13
|
-
-
|
|
12
|
+
- 地图空间
|
|
13
|
+
- 总平面空间(施工场部图)
|
|
14
14
|
- 建筑
|
|
15
15
|
- 楼层
|
|
16
16
|
- **模型坐标系** (参考`CoordinateModelType`枚举):
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
17
|
+
- 地图模型
|
|
18
|
+
- 图纸模型
|
|
19
|
+
- BIM模型
|
|
20
20
|
|
|
21
21
|
### 1.1.2 核心功能
|
|
22
22
|
|
|
@@ -33,15 +33,13 @@
|
|
|
33
33
|
|
|
34
34
|
## 1.2 参数说明
|
|
35
35
|
|
|
36
|
-
| 属性
|
|
37
|
-
|
|
|
38
|
-
| `projectId`
|
|
39
|
-
| `bindModelId?`
|
|
40
|
-
| `srcCoordinateId?`
|
|
41
|
-
| `dstCoordinateId?`
|
|
42
|
-
| `
|
|
43
|
-
| `enabledDstModelType?` | `number` | - | 控制目标坐标系树的模型启用类型 |
|
|
44
|
-
| `appSetting?` | `AppSetting` | - | 高级应用配置项 |
|
|
36
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
37
|
+
| ------------------ | ------------ | ------ | ------------------------------------------------------------------------------ |
|
|
38
|
+
| `projectId` | `number` | - | 项目Id符 |
|
|
39
|
+
| `bindModelId?` | `number` | - | 需要绑定模型时提供的模型Id |
|
|
40
|
+
| `srcCoordinateId?` | `number` | - | 源坐标系Id:<br>• 模型映射 → 图纸/Bimface的Id<br>• 空间映射 → 建筑/场部图的Id |
|
|
41
|
+
| `dstCoordinateId?` | `number` | - | 目标坐标系Id:<br>• 模型映射 → 楼层/场部图的Id<br>• 空间映射 → 场部图/地图的Id |
|
|
42
|
+
| `appSetting?` | `AppSetting` | - | 高级应用配置项 |
|
|
45
43
|
|
|
46
44
|
## 1.3 事件说明
|
|
47
45
|
|
|
@@ -90,7 +88,7 @@ enum CoordinateModelType {
|
|
|
90
88
|
BimfaceModel = 6, //bimface模型
|
|
91
89
|
ForgeModel = 7, //forge模型
|
|
92
90
|
ThreeDModel = 8, //3d模型
|
|
93
|
-
|
|
91
|
+
GeoModel = 9, //地图模型
|
|
94
92
|
}
|
|
95
93
|
```
|
|
96
94
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as v, ref as _, computed as P, watch as B, createElementBlock as w, openBlock as h, renderSlot as
|
|
1
|
+
import { defineComponent as v, ref as _, computed as P, watch as B, createElementBlock as w, openBlock as h, renderSlot as C, normalizeProps as g, guardReactiveProps as x } from "vue";
|
|
2
2
|
import { Point as i } from "@vsleem-realsee-viewer/shared";
|
|
3
|
-
import {
|
|
3
|
+
import { D as y } from "./index-CgqxI5qL.mjs";
|
|
4
4
|
const M = { class: "vsleem-bim-control" }, b = /* @__PURE__ */ v({
|
|
5
5
|
name: "BimControl",
|
|
6
6
|
__name: "BimControl",
|
|
@@ -38,10 +38,10 @@ const M = { class: "vsleem-bim-control" }, b = /* @__PURE__ */ v({
|
|
|
38
38
|
return c({
|
|
39
39
|
getData: f
|
|
40
40
|
}), (e, n) => (h(), w("div", M, [
|
|
41
|
-
|
|
41
|
+
C(e.$slots, "bimViewer", g(x(a.value)), void 0, !0)
|
|
42
42
|
]));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), z = /* @__PURE__ */ y(b, [["__scopeId", "data-v-86c694e2"]]);
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
z as default
|
|
47
47
|
};
|
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
import { defineComponent as en, shallowRef as dn, watch as V, onBeforeUnmount as pn, createVNode as f, isVNode as j, cloneVNode as K, ref as z, watchEffect as mn, unref as E, onUnmounted as tn, reactive as vn, onMounted as fn, createElementBlock as U, openBlock as G, createBlock as gn, createCommentVNode as q, createElementVNode as P, withModifiers as hn, withCtx as H, createTextVNode as J, toDisplayString as L } from "vue";
|
|
2
|
+
import { utils as N, CanvasElement as Sn, CanvasPointElement as W, Point as Y, CanvasImageElement as yn, DataHelper as wn } from "@vsleem-realsee-viewer/shared";
|
|
3
|
+
import { E as Cn, G as bn, _ as Q, H as Dn, K as on, J as $n, d as xn, b as Z, f as zn, P as k, L as In, x as _n, n as nn, D as En } from "./index-CgqxI5qL.mjs";
|
|
4
|
+
import { S as Tn } from "./index-DSggKI_y.mjs";
|
|
5
|
+
function Mn(n, l, p) {
|
|
6
|
+
var i = p || {}, e = i.noTrailing, r = e === void 0 ? !1 : e, c = i.noLeading, s = c === void 0 ? !1 : c, m = i.debounceMode, o = m === void 0 ? void 0 : m, a, t = !1, u = 0;
|
|
7
|
+
function C() {
|
|
8
|
+
a && clearTimeout(a);
|
|
9
|
+
}
|
|
10
|
+
function M(b) {
|
|
11
|
+
var D = b || {}, y = D.upcomingOnly, T = y === void 0 ? !1 : y;
|
|
12
|
+
C(), t = !T;
|
|
13
|
+
}
|
|
14
|
+
function I() {
|
|
15
|
+
for (var b = arguments.length, D = new Array(b), y = 0; y < b; y++)
|
|
16
|
+
D[y] = arguments[y];
|
|
17
|
+
var T = this, g = Date.now() - u;
|
|
18
|
+
if (t)
|
|
19
|
+
return;
|
|
20
|
+
function w() {
|
|
21
|
+
u = Date.now(), l.apply(T, D);
|
|
22
|
+
}
|
|
23
|
+
function h() {
|
|
24
|
+
a = void 0;
|
|
25
|
+
}
|
|
26
|
+
!s && o && !a && w(), C(), o === void 0 && g > n ? s ? (u = Date.now(), r || (a = setTimeout(o ? h : w, n))) : w() : r !== !0 && (a = setTimeout(o ? h : w, o === void 0 ? n - g : n));
|
|
27
|
+
}
|
|
28
|
+
return I.cancel = M, I;
|
|
29
|
+
}
|
|
30
|
+
function Pn(n, l, p) {
|
|
31
|
+
var i = {}, e = i.atBegin, r = e === void 0 ? !1 : e;
|
|
32
|
+
return Mn(n, l, {
|
|
33
|
+
debounceMode: r !== !1
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const Nn = new on("antSpinMove", {
|
|
37
|
+
to: {
|
|
38
|
+
opacity: 1
|
|
39
|
+
}
|
|
40
|
+
}), On = new on("antRotate", {
|
|
41
|
+
to: {
|
|
42
|
+
transform: "rotate(405deg)"
|
|
43
|
+
}
|
|
44
|
+
}), Rn = (n) => ({
|
|
45
|
+
[`${n.componentCls}`]: Q(Q({}, Dn(n)), {
|
|
46
|
+
position: "absolute",
|
|
47
|
+
display: "none",
|
|
48
|
+
color: n.colorPrimary,
|
|
49
|
+
textAlign: "center",
|
|
50
|
+
verticalAlign: "middle",
|
|
51
|
+
opacity: 0,
|
|
52
|
+
transition: `transform ${n.motionDurationSlow} ${n.motionEaseInOutCirc}`,
|
|
53
|
+
"&-spinning": {
|
|
54
|
+
position: "static",
|
|
55
|
+
display: "inline-block",
|
|
56
|
+
opacity: 1
|
|
57
|
+
},
|
|
58
|
+
"&-nested-loading": {
|
|
59
|
+
position: "relative",
|
|
60
|
+
[`> div > ${n.componentCls}`]: {
|
|
61
|
+
position: "absolute",
|
|
62
|
+
top: 0,
|
|
63
|
+
insetInlineStart: 0,
|
|
64
|
+
zIndex: 4,
|
|
65
|
+
display: "block",
|
|
66
|
+
width: "100%",
|
|
67
|
+
height: "100%",
|
|
68
|
+
maxHeight: n.contentHeight,
|
|
69
|
+
[`${n.componentCls}-dot`]: {
|
|
70
|
+
position: "absolute",
|
|
71
|
+
top: "50%",
|
|
72
|
+
insetInlineStart: "50%",
|
|
73
|
+
margin: -n.spinDotSize / 2
|
|
74
|
+
},
|
|
75
|
+
[`${n.componentCls}-text`]: {
|
|
76
|
+
position: "absolute",
|
|
77
|
+
top: "50%",
|
|
78
|
+
width: "100%",
|
|
79
|
+
paddingTop: (n.spinDotSize - n.fontSize) / 2 + 2,
|
|
80
|
+
textShadow: `0 1px 2px ${n.colorBgContainer}`
|
|
81
|
+
// FIXME: shadow
|
|
82
|
+
},
|
|
83
|
+
[`&${n.componentCls}-show-text ${n.componentCls}-dot`]: {
|
|
84
|
+
marginTop: -(n.spinDotSize / 2) - 10
|
|
85
|
+
},
|
|
86
|
+
"&-sm": {
|
|
87
|
+
[`${n.componentCls}-dot`]: {
|
|
88
|
+
margin: -n.spinDotSizeSM / 2
|
|
89
|
+
},
|
|
90
|
+
[`${n.componentCls}-text`]: {
|
|
91
|
+
paddingTop: (n.spinDotSizeSM - n.fontSize) / 2 + 2
|
|
92
|
+
},
|
|
93
|
+
[`&${n.componentCls}-show-text ${n.componentCls}-dot`]: {
|
|
94
|
+
marginTop: -(n.spinDotSizeSM / 2) - 10
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"&-lg": {
|
|
98
|
+
[`${n.componentCls}-dot`]: {
|
|
99
|
+
margin: -(n.spinDotSizeLG / 2)
|
|
100
|
+
},
|
|
101
|
+
[`${n.componentCls}-text`]: {
|
|
102
|
+
paddingTop: (n.spinDotSizeLG - n.fontSize) / 2 + 2
|
|
103
|
+
},
|
|
104
|
+
[`&${n.componentCls}-show-text ${n.componentCls}-dot`]: {
|
|
105
|
+
marginTop: -(n.spinDotSizeLG / 2) - 10
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
[`${n.componentCls}-container`]: {
|
|
110
|
+
position: "relative",
|
|
111
|
+
transition: `opacity ${n.motionDurationSlow}`,
|
|
112
|
+
"&::after": {
|
|
113
|
+
position: "absolute",
|
|
114
|
+
top: 0,
|
|
115
|
+
insetInlineEnd: 0,
|
|
116
|
+
bottom: 0,
|
|
117
|
+
insetInlineStart: 0,
|
|
118
|
+
zIndex: 10,
|
|
119
|
+
width: "100%",
|
|
120
|
+
height: "100%",
|
|
121
|
+
background: n.colorBgContainer,
|
|
122
|
+
opacity: 0,
|
|
123
|
+
transition: `all ${n.motionDurationSlow}`,
|
|
124
|
+
content: '""',
|
|
125
|
+
pointerEvents: "none"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
[`${n.componentCls}-blur`]: {
|
|
129
|
+
clear: "both",
|
|
130
|
+
opacity: 0.5,
|
|
131
|
+
userSelect: "none",
|
|
132
|
+
pointerEvents: "none",
|
|
133
|
+
"&::after": {
|
|
134
|
+
opacity: 0.4,
|
|
135
|
+
pointerEvents: "auto"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
// tip
|
|
140
|
+
// ------------------------------
|
|
141
|
+
"&-tip": {
|
|
142
|
+
color: n.spinDotDefault
|
|
143
|
+
},
|
|
144
|
+
// dots
|
|
145
|
+
// ------------------------------
|
|
146
|
+
[`${n.componentCls}-dot`]: {
|
|
147
|
+
position: "relative",
|
|
148
|
+
display: "inline-block",
|
|
149
|
+
fontSize: n.spinDotSize,
|
|
150
|
+
width: "1em",
|
|
151
|
+
height: "1em",
|
|
152
|
+
"&-item": {
|
|
153
|
+
position: "absolute",
|
|
154
|
+
display: "block",
|
|
155
|
+
width: (n.spinDotSize - n.marginXXS / 2) / 2,
|
|
156
|
+
height: (n.spinDotSize - n.marginXXS / 2) / 2,
|
|
157
|
+
backgroundColor: n.colorPrimary,
|
|
158
|
+
borderRadius: "100%",
|
|
159
|
+
transform: "scale(0.75)",
|
|
160
|
+
transformOrigin: "50% 50%",
|
|
161
|
+
opacity: 0.3,
|
|
162
|
+
animationName: Nn,
|
|
163
|
+
animationDuration: "1s",
|
|
164
|
+
animationIterationCount: "infinite",
|
|
165
|
+
animationTimingFunction: "linear",
|
|
166
|
+
animationDirection: "alternate",
|
|
167
|
+
"&:nth-child(1)": {
|
|
168
|
+
top: 0,
|
|
169
|
+
insetInlineStart: 0
|
|
170
|
+
},
|
|
171
|
+
"&:nth-child(2)": {
|
|
172
|
+
top: 0,
|
|
173
|
+
insetInlineEnd: 0,
|
|
174
|
+
animationDelay: "0.4s"
|
|
175
|
+
},
|
|
176
|
+
"&:nth-child(3)": {
|
|
177
|
+
insetInlineEnd: 0,
|
|
178
|
+
bottom: 0,
|
|
179
|
+
animationDelay: "0.8s"
|
|
180
|
+
},
|
|
181
|
+
"&:nth-child(4)": {
|
|
182
|
+
bottom: 0,
|
|
183
|
+
insetInlineStart: 0,
|
|
184
|
+
animationDelay: "1.2s"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"&-spin": {
|
|
188
|
+
transform: "rotate(45deg)",
|
|
189
|
+
animationName: On,
|
|
190
|
+
animationDuration: "1.2s",
|
|
191
|
+
animationIterationCount: "infinite",
|
|
192
|
+
animationTimingFunction: "linear"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
// Sizes
|
|
196
|
+
// ------------------------------
|
|
197
|
+
// small
|
|
198
|
+
[`&-sm ${n.componentCls}-dot`]: {
|
|
199
|
+
fontSize: n.spinDotSizeSM,
|
|
200
|
+
i: {
|
|
201
|
+
width: (n.spinDotSizeSM - n.marginXXS / 2) / 2,
|
|
202
|
+
height: (n.spinDotSizeSM - n.marginXXS / 2) / 2
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
// large
|
|
206
|
+
[`&-lg ${n.componentCls}-dot`]: {
|
|
207
|
+
fontSize: n.spinDotSizeLG,
|
|
208
|
+
i: {
|
|
209
|
+
width: (n.spinDotSizeLG - n.marginXXS) / 2,
|
|
210
|
+
height: (n.spinDotSizeLG - n.marginXXS) / 2
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
[`&${n.componentCls}-show-text ${n.componentCls}-text`]: {
|
|
214
|
+
display: "block"
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
}), Bn = Cn("Spin", (n) => {
|
|
218
|
+
const l = bn(n, {
|
|
219
|
+
spinDotDefault: n.colorTextDescription,
|
|
220
|
+
spinDotSize: n.controlHeightLG / 2,
|
|
221
|
+
spinDotSizeSM: n.controlHeightLG * 0.35,
|
|
222
|
+
spinDotSizeLG: n.controlHeight
|
|
223
|
+
});
|
|
224
|
+
return [Rn(l)];
|
|
225
|
+
}, {
|
|
226
|
+
contentHeight: 400
|
|
227
|
+
});
|
|
228
|
+
var Ln = function(n, l) {
|
|
229
|
+
var p = {};
|
|
230
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && l.indexOf(i) < 0 && (p[i] = n[i]);
|
|
231
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var e = 0, i = Object.getOwnPropertySymbols(n); e < i.length; e++)
|
|
232
|
+
l.indexOf(i[e]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[e]) && (p[i[e]] = n[i[e]]);
|
|
233
|
+
return p;
|
|
234
|
+
};
|
|
235
|
+
const Xn = () => ({
|
|
236
|
+
prefixCls: String,
|
|
237
|
+
spinning: {
|
|
238
|
+
type: Boolean,
|
|
239
|
+
default: void 0
|
|
240
|
+
},
|
|
241
|
+
size: String,
|
|
242
|
+
wrapperClassName: String,
|
|
243
|
+
tip: k.any,
|
|
244
|
+
delay: Number,
|
|
245
|
+
indicator: k.any
|
|
246
|
+
});
|
|
247
|
+
let X = null;
|
|
248
|
+
function An(n, l) {
|
|
249
|
+
return !!n && !!l && !isNaN(Number(l));
|
|
250
|
+
}
|
|
251
|
+
function Gn(n) {
|
|
252
|
+
const l = n.indicator;
|
|
253
|
+
X = typeof l == "function" ? l : () => f(l, null, null);
|
|
254
|
+
}
|
|
255
|
+
const O = en({
|
|
256
|
+
compatConfig: {
|
|
257
|
+
MODE: 3
|
|
258
|
+
},
|
|
259
|
+
name: "ASpin",
|
|
260
|
+
inheritAttrs: !1,
|
|
261
|
+
props: $n(Xn(), {
|
|
262
|
+
size: "default",
|
|
263
|
+
spinning: !0,
|
|
264
|
+
wrapperClassName: ""
|
|
265
|
+
}),
|
|
266
|
+
setup(n, l) {
|
|
267
|
+
let {
|
|
268
|
+
attrs: p,
|
|
269
|
+
slots: i
|
|
270
|
+
} = l;
|
|
271
|
+
const {
|
|
272
|
+
prefixCls: e,
|
|
273
|
+
size: r,
|
|
274
|
+
direction: c
|
|
275
|
+
} = xn("spin", n), [s, m] = Bn(e), o = dn(n.spinning && !An(n.spinning, n.delay));
|
|
276
|
+
let a;
|
|
277
|
+
return V([() => n.spinning, () => n.delay], () => {
|
|
278
|
+
a?.cancel(), a = Pn(n.delay, () => {
|
|
279
|
+
o.value = n.spinning;
|
|
280
|
+
}), a?.();
|
|
281
|
+
}, {
|
|
282
|
+
immediate: !0,
|
|
283
|
+
flush: "post"
|
|
284
|
+
}), pn(() => {
|
|
285
|
+
a?.cancel();
|
|
286
|
+
}), () => {
|
|
287
|
+
var t, u;
|
|
288
|
+
const {
|
|
289
|
+
class: C
|
|
290
|
+
} = p, M = Ln(p, ["class"]), {
|
|
291
|
+
tip: I = (t = i.tip) === null || t === void 0 ? void 0 : t.call(i)
|
|
292
|
+
} = n, b = (u = i.default) === null || u === void 0 ? void 0 : u.call(i), D = {
|
|
293
|
+
[m.value]: !0,
|
|
294
|
+
[e.value]: !0,
|
|
295
|
+
[`${e.value}-sm`]: r.value === "small",
|
|
296
|
+
[`${e.value}-lg`]: r.value === "large",
|
|
297
|
+
[`${e.value}-spinning`]: o.value,
|
|
298
|
+
[`${e.value}-show-text`]: !!I,
|
|
299
|
+
[`${e.value}-rtl`]: c.value === "rtl",
|
|
300
|
+
[C]: !!C
|
|
301
|
+
};
|
|
302
|
+
function y(g) {
|
|
303
|
+
const w = `${g}-dot`;
|
|
304
|
+
let h = In(i, n, "indicator");
|
|
305
|
+
return h === null ? null : (Array.isArray(h) && (h = h.length === 1 ? h[0] : h), j(h) ? K(h, {
|
|
306
|
+
class: w
|
|
307
|
+
}) : X && j(X()) ? K(X(), {
|
|
308
|
+
class: w
|
|
309
|
+
}) : f("span", {
|
|
310
|
+
class: `${w} ${g}-dot-spin`
|
|
311
|
+
}, [f("i", {
|
|
312
|
+
class: `${g}-dot-item`
|
|
313
|
+
}, null), f("i", {
|
|
314
|
+
class: `${g}-dot-item`
|
|
315
|
+
}, null), f("i", {
|
|
316
|
+
class: `${g}-dot-item`
|
|
317
|
+
}, null), f("i", {
|
|
318
|
+
class: `${g}-dot-item`
|
|
319
|
+
}, null)]));
|
|
320
|
+
}
|
|
321
|
+
const T = f("div", Z(Z({}, M), {}, {
|
|
322
|
+
class: D,
|
|
323
|
+
"aria-live": "polite",
|
|
324
|
+
"aria-busy": o.value
|
|
325
|
+
}), [y(e.value), I ? f("div", {
|
|
326
|
+
class: `${e.value}-text`
|
|
327
|
+
}, [I]) : null]);
|
|
328
|
+
if (b && zn(b).length) {
|
|
329
|
+
const g = {
|
|
330
|
+
[`${e.value}-container`]: !0,
|
|
331
|
+
[`${e.value}-blur`]: o.value
|
|
332
|
+
};
|
|
333
|
+
return s(f("div", {
|
|
334
|
+
class: [`${e.value}-nested-loading`, n.wrapperClassName, m.value]
|
|
335
|
+
}, [o.value && f("div", {
|
|
336
|
+
key: "loading"
|
|
337
|
+
}, [T]), f("div", {
|
|
338
|
+
class: g,
|
|
339
|
+
key: "container"
|
|
340
|
+
}, [b])]));
|
|
341
|
+
}
|
|
342
|
+
return s(T);
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
O.setDefaultIndicator = Gn;
|
|
347
|
+
O.install = function(n) {
|
|
348
|
+
return n.component(O.name, O), n;
|
|
349
|
+
};
|
|
350
|
+
function Hn(n, l, p = {}) {
|
|
351
|
+
const i = z(0), e = z(0);
|
|
352
|
+
let r = null, c = null;
|
|
353
|
+
const s = () => {
|
|
354
|
+
r && (r.disconnect(), r = null), c && (cancelAnimationFrame(c), c = null);
|
|
355
|
+
}, m = (t) => {
|
|
356
|
+
i.value = t.contentRect.width, e.value = t.contentRect.height;
|
|
357
|
+
}, o = (t) => {
|
|
358
|
+
const u = t[0];
|
|
359
|
+
p.debounce || p.throttle ? (c && cancelAnimationFrame(c), c = requestAnimationFrame(() => {
|
|
360
|
+
m(u), l?.(t);
|
|
361
|
+
})) : (m(u), l?.(t));
|
|
362
|
+
}, a = (t) => {
|
|
363
|
+
s(), r = new ResizeObserver(o), r.observe(t, {
|
|
364
|
+
box: p.box || "content-box"
|
|
365
|
+
});
|
|
366
|
+
};
|
|
367
|
+
return mn(() => {
|
|
368
|
+
const t = E(n);
|
|
369
|
+
t && a(t);
|
|
370
|
+
}), tn(s), {
|
|
371
|
+
width: i,
|
|
372
|
+
height: e,
|
|
373
|
+
stop: s
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
const Vn = { class: "vsleem-cad-control" }, Fn = { class: "tool-button" }, jn = {
|
|
377
|
+
key: 0,
|
|
378
|
+
class: "distance"
|
|
379
|
+
}, Kn = /* @__PURE__ */ en({
|
|
380
|
+
name: "CadControl",
|
|
381
|
+
__name: "CadControl",
|
|
382
|
+
props: {
|
|
383
|
+
currentModel: {},
|
|
384
|
+
points: {},
|
|
385
|
+
connected: { type: Boolean }
|
|
386
|
+
},
|
|
387
|
+
emits: ["change"],
|
|
388
|
+
setup(n, { expose: l, emit: p }) {
|
|
389
|
+
const i = p, e = n, [r] = _n("CadControl"), c = z(!0), s = z(0), m = z(), o = z(), a = z([]), t = z(), u = vn({ x: 0, y: 0, scale: 1 }), C = z([]), M = z(0), I = N.debounce(y, 300);
|
|
390
|
+
V(() => e.currentModel?.id, I), V(() => e.points, w), fn(() => {
|
|
391
|
+
Hn(m, I);
|
|
392
|
+
}), tn(() => {
|
|
393
|
+
b();
|
|
394
|
+
});
|
|
395
|
+
function b() {
|
|
396
|
+
o.value && (o.value.unBindEvent(), o.value = void 0);
|
|
397
|
+
}
|
|
398
|
+
function D(S) {
|
|
399
|
+
return ["#5bb36f", "#ff4d4f", "rgba(91, 179, 111, 0.8)"][S];
|
|
400
|
+
}
|
|
401
|
+
async function y() {
|
|
402
|
+
try {
|
|
403
|
+
E(m) && (await T(), await g(), await w()), s.value = 0;
|
|
404
|
+
} finally {
|
|
405
|
+
c.value = !1;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function T() {
|
|
409
|
+
const S = m.value?.getBoundingClientRect(), { width: v, height: _ } = S;
|
|
410
|
+
o.value?.unBindEvent(), o.value = new Sn({
|
|
411
|
+
container: m.value,
|
|
412
|
+
width: v,
|
|
413
|
+
height: _,
|
|
414
|
+
isDrawAssist: !0,
|
|
415
|
+
onClick(d, $) {
|
|
416
|
+
const x = new W({
|
|
417
|
+
x: d,
|
|
418
|
+
y: $,
|
|
419
|
+
text: s.value + 1,
|
|
420
|
+
backgroundColor: D(s.value)
|
|
421
|
+
});
|
|
422
|
+
a.value[s.value] = x, o.value?.draw();
|
|
423
|
+
const { x: A, y: R } = x, B = N.toModelCoord(A, R, u);
|
|
424
|
+
C.value[s.value] = new Y(B), rn(), i("change", F());
|
|
425
|
+
},
|
|
426
|
+
draw(d) {
|
|
427
|
+
if (t.value?.draw(d), e.connected && a.value.length === 2) {
|
|
428
|
+
const [$, x] = a.value;
|
|
429
|
+
d.lineWidth = 2 / (o.value?.scale ?? 1), d.beginPath(), d.moveTo(x.x, x.y), d.lineTo($.x, $.y), d.strokeStyle = D(2), d.stroke();
|
|
430
|
+
}
|
|
431
|
+
a.value.forEach(($) => {
|
|
432
|
+
o.value && $.draw(d, o.value);
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
function g() {
|
|
438
|
+
return new Promise((S, v) => {
|
|
439
|
+
if (!e.currentModel?.modelValue)
|
|
440
|
+
return t.value = void 0, S(void 0);
|
|
441
|
+
c.value = !0;
|
|
442
|
+
const _ = m.value?.getBoundingClientRect(), { width: d, height: $ } = _;
|
|
443
|
+
t.value = new yn({
|
|
444
|
+
src: e.currentModel?.modelValue,
|
|
445
|
+
onload(x) {
|
|
446
|
+
if (!t.value) return;
|
|
447
|
+
const { scale: A, x: R, y: B, sw: cn, sh: un } = N.getImageTransform(
|
|
448
|
+
d,
|
|
449
|
+
$,
|
|
450
|
+
x.width,
|
|
451
|
+
x.height
|
|
452
|
+
);
|
|
453
|
+
t.value.width = cn, t.value.height = un, t.value.x = R, t.value.y = B, u.x = R, u.y = B, u.scale = A, S(t.value);
|
|
454
|
+
},
|
|
455
|
+
onerror() {
|
|
456
|
+
c.value = !1, v("image error");
|
|
457
|
+
},
|
|
458
|
+
redraw: () => o.value?.draw()
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
async function w() {
|
|
463
|
+
C.value = [...N.cloneDeep(e.points || [])], await h(), await an(), o.value?.draw();
|
|
464
|
+
}
|
|
465
|
+
function h() {
|
|
466
|
+
a.value = C.value.map((S, v) => {
|
|
467
|
+
const { x: _, y: d } = S, { x: $, y: x } = N.toCanvasCoord(_, d, u);
|
|
468
|
+
return new W({
|
|
469
|
+
x: $,
|
|
470
|
+
y: x,
|
|
471
|
+
text: v + 1,
|
|
472
|
+
backgroundColor: D(v)
|
|
473
|
+
});
|
|
474
|
+
}), o.value?.draw();
|
|
475
|
+
}
|
|
476
|
+
function an() {
|
|
477
|
+
if (e.points?.length === 2) {
|
|
478
|
+
const S = e.currentModel, v = S?.findParentSpace();
|
|
479
|
+
if (S && v) {
|
|
480
|
+
const _ = wn.srcPointToDstPoint(e.points, S, v);
|
|
481
|
+
if (_.length === 2) {
|
|
482
|
+
const d = Y.distXY(_[0], _[1]);
|
|
483
|
+
M.value = parseFloat((d / 1e3).toFixed(2));
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
function ln() {
|
|
489
|
+
s.value = 0;
|
|
490
|
+
}
|
|
491
|
+
function sn() {
|
|
492
|
+
s.value = 1;
|
|
493
|
+
}
|
|
494
|
+
function rn() {
|
|
495
|
+
s.value = s.value === 0 ? 1 : 0;
|
|
496
|
+
}
|
|
497
|
+
function F() {
|
|
498
|
+
return {
|
|
499
|
+
points: C.value
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
return l({
|
|
503
|
+
getData: F
|
|
504
|
+
}), (S, v) => (G(), U("div", Vn, [
|
|
505
|
+
c.value ? (G(), gn(E(O), {
|
|
506
|
+
key: 0,
|
|
507
|
+
class: "cad-spin"
|
|
508
|
+
})) : q("", !0),
|
|
509
|
+
P("canvas", {
|
|
510
|
+
ref_key: "canvasElRef",
|
|
511
|
+
ref: m,
|
|
512
|
+
class: "cad-wrapper",
|
|
513
|
+
onSelectstart: v[0] || (v[0] = hn(() => {
|
|
514
|
+
}, ["prevent"]))
|
|
515
|
+
}, null, 544),
|
|
516
|
+
P("div", Fn, [
|
|
517
|
+
f(E(Tn), null, {
|
|
518
|
+
default: H(() => [
|
|
519
|
+
f(E(nn), {
|
|
520
|
+
type: "primary",
|
|
521
|
+
ghost: s.value !== 0,
|
|
522
|
+
onClick: ln
|
|
523
|
+
}, {
|
|
524
|
+
default: H(() => [
|
|
525
|
+
J(L(E(r)?.locationPoint1), 1)
|
|
526
|
+
]),
|
|
527
|
+
_: 1
|
|
528
|
+
}, 8, ["ghost"]),
|
|
529
|
+
M.value ? (G(), U("div", jn, [
|
|
530
|
+
P("div", null, L(E(r)?.distance), 1),
|
|
531
|
+
v[1] || (v[1] = P("div", { class: "divider" }, null, -1)),
|
|
532
|
+
P("div", null, L(M.value) + " m", 1)
|
|
533
|
+
])) : q("", !0),
|
|
534
|
+
f(E(nn), {
|
|
535
|
+
type: "primary",
|
|
536
|
+
danger: "",
|
|
537
|
+
ghost: s.value != 1,
|
|
538
|
+
onClick: sn
|
|
539
|
+
}, {
|
|
540
|
+
default: H(() => [
|
|
541
|
+
J(L(E(r)?.locationPoint2), 1)
|
|
542
|
+
]),
|
|
543
|
+
_: 1
|
|
544
|
+
}, 8, ["ghost"])
|
|
545
|
+
]),
|
|
546
|
+
_: 1
|
|
547
|
+
})
|
|
548
|
+
])
|
|
549
|
+
]));
|
|
550
|
+
}
|
|
551
|
+
}), Yn = /* @__PURE__ */ En(Kn, [["__scopeId", "data-v-32a688f7"]]);
|
|
552
|
+
export {
|
|
553
|
+
Yn as default
|
|
554
|
+
};
|