ss-component-new 1.2.3 → 1.2.4
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/dist/{OrbitControls-C0QRmW6_.js → OrbitControls-DA4VpOM_.js} +1 -1
- package/dist/{STLLoader-CiUjaQtA.js → STLLoader-DmGTF0Nv.js} +1 -1
- package/dist/{animationData-8FTxP8vs.js → animationData-9n1X4UvO.js} +14 -14
- package/dist/animationData-CfT99nMO.cjs +1 -0
- package/dist/array-BPHS7JFA.cjs +11 -0
- package/dist/array-pg68Qbs1.js +1207 -0
- package/dist/config.js +1 -1
- package/dist/{iconfont-pt17sMx3.js → iconfont-ljBfzBSE.js} +2 -2
- package/dist/{index-DnDcbPOW.js → index---6UATT0.js} +5 -5
- package/dist/{index-D4F0CrLQ.cjs → index-1DtctdYW.cjs} +1 -1
- package/dist/index-5hLZZ6t-.cjs +1 -0
- package/dist/{index-CEdmOpLw.js → index-8CcD03tl.js} +6 -6
- package/dist/{index-BkoHg0EZ.js → index-B5gNufYw.js} +5 -5
- package/dist/{index-CwFSFQX2.js → index-B5srJr0o.js} +6 -6
- package/dist/{index-Kn3M4A0O.cjs → index-B5vIeQUq.cjs} +1 -1
- package/dist/{index-CSeo-uxt.cjs → index-B8J_v2Ky.cjs} +1 -1
- package/dist/{index-CgqgVzlH.cjs → index-B9nZeing.cjs} +1 -1
- package/dist/{index-CH7Xo-Sp.js → index-BAj0dyBF.js} +3 -3
- package/dist/{index-BileCy93.js → index-BEJOd_29.js} +4 -4
- package/dist/{index-kGrlXtNc.cjs → index-BKhDFqMM.cjs} +1 -1
- package/dist/{index-CfduEaC5.js → index-BNNxPuEV.js} +1 -1
- package/dist/{index-CoR64Xpr.cjs → index-BOVdAFDH.cjs} +1 -1
- package/dist/{index-BS8EpPTs.cjs → index-Bi7yv8jC.cjs} +1 -1
- package/dist/{index-Be9Zt5tl.js → index-BjXcyVvp.js} +2 -2
- package/dist/{index-CxnH4vfV.cjs → index-BrsIZVyD.cjs} +1 -1
- package/dist/index-Bsdjuxq1.cjs +1 -0
- package/dist/{index-CvrTrN91.js → index-BuKHInQb.js} +1 -1
- package/dist/{index-DeuO5bnv.cjs → index-Bx4qIiIa.cjs} +1 -1
- package/dist/{index-CpaF7pM_.cjs → index-C-AOuDkl.cjs} +1 -1
- package/dist/{index-DJ40Hyyr.cjs → index-C0HHmjrg.cjs} +1 -1
- package/dist/{index-sB_mbukA.js → index-C1lB8apW.js} +4 -4
- package/dist/{index-C_AbUtWk.cjs → index-CAHYTZ1Q.cjs} +1 -1
- package/dist/{index-Ct9LJbIa.cjs → index-CCIJ-P3X.cjs} +1 -1
- package/dist/{index-hOfuCmcV.js → index-CCsSOTaB.js} +2 -2
- package/dist/{index-CjqqJUqa.js → index-CDXq3gs4.js} +1013 -1010
- package/dist/{index-BAkiJ74E.cjs → index-CK_O7QdV.cjs} +1 -1
- package/dist/{index-D6k9CkOL.js → index-CLtFz5gE.js} +13 -13
- package/dist/{index-DyLtJwnU.cjs → index-CMlYJD5U.cjs} +1 -1
- package/dist/index-CdPbJekh.js +7294 -0
- package/dist/{index-CjI5pDiU.cjs → index-CmlXlH2b.cjs} +1 -1
- package/dist/{index-BcyUCzHm.js → index-CpE8hbs0.js} +6 -6
- package/dist/{index-7XENlCpz.cjs → index-CxNBcsll.cjs} +1 -1
- package/dist/{index-ClODZ600.js → index-CyP2hcVu.js} +6 -6
- package/dist/{index-flJIivzF.cjs → index-D-r_YKrq.cjs} +13 -13
- package/dist/{index-CElxXJY-.js → index-D0_4keB8.js} +7 -7
- package/dist/index-DBScQH7L.js +2643 -0
- package/dist/{index-BNO8srTI.cjs → index-DCf7Tz40.cjs} +1 -1
- package/dist/{index-Da8foj5C.js → index-DEwcUkb-.js} +5 -5
- package/dist/{index-Bfs3oOac.js → index-DFg-bhPI.js} +1 -1
- package/dist/{index-BqB108UB.cjs → index-DJ1PTHpx.cjs} +1 -1
- package/dist/{index-BGr_ESuH.cjs → index-DOlPMLvf.cjs} +1 -1
- package/dist/{index-BnGZhWPa.cjs → index-DPaTtF3h.cjs} +1 -1
- package/dist/{index-Bzf_z3RK.cjs → index-DPyzaxnq.cjs} +1 -1
- package/dist/{index-DkcEb3i0.js → index-DS5z17Mc.js} +2123 -2130
- package/dist/{index-D7Z7_kkD.js → index-DSsZtYMz.js} +2 -2
- package/dist/{index-hm9E8BQd.js → index-Dk8D9SRm.js} +1 -1
- package/dist/{index-CDcMFEYg.js → index-DsHRVZ0E.js} +2 -2
- package/dist/{index-ZP8xxEio.cjs → index-DszzdQnM.cjs} +1 -1
- package/dist/{index-CKHNyMzP.js → index-FxX6NP0J.js} +1 -1
- package/dist/{index-BhmbDqk0.cjs → index-LXb5DfDE.cjs} +1 -1
- package/dist/{index-BFjyLFP1.cjs → index-NFCeQcv4.cjs} +1 -1
- package/dist/{index-BCqSX1fo.js → index-PIEkAjRf.js} +12 -12
- package/dist/{index-DbzvXPKu.js → index-UN4JU0ly.js} +176 -176
- package/dist/{index-Bry_sSrG.js → index-Y7MUJdPv.js} +4 -4
- package/dist/{index-CISjtweI.js → index-bj8hK6Pe.js} +24 -24
- package/dist/{index-1z9RrjZc.cjs → index-d6tSWKtY.cjs} +1 -1
- package/dist/{index-CiktIOnl.cjs → index-nUEWiqy9.cjs} +1 -1
- package/dist/{index-Bmv3M7uZ.js → index-pLeOyTaj.js} +6 -6
- package/dist/{index-D0FR_AhB.js → index-xHEf6hcO.js} +2 -2
- package/dist/index-zQVJFawn.cjs +1 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BnK7zR_5.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BTu7I4mn.js} +10362 -10383
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C5Xqazal.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cmc1oALS.cjs} +123 -123
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Bu0MMp-F.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Bg_c-oAL.js} +6 -6
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-D-u_Cg-8.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-C795GAHK.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-9kDr7Iek.js +37436 -0
- package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-Bn5qXF4J.cjs +56 -0
- package/dist/{index.vue_vue_type_style_index_1_lang-Ca71BDvm.cjs → index.vue_vue_type_style_index_1_lang-Bn7P4fYM.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-DMTvCBLP.js → index.vue_vue_type_style_index_1_lang-D1n_3_F6.js} +5 -5
- package/dist/index.vue_vue_type_style_index_1_lang-Exyt6qTf.js +7798 -0
- package/dist/index.vue_vue_type_style_index_1_lang-zN5mc8b0.cjs +32 -0
- package/dist/{isString-CZMLuMzD.js → isString-BAN9KLwf.js} +1 -1
- package/dist/{isString-BmAegMGI.cjs → isString-ChvWbctO.cjs} +1 -1
- package/dist/{main-gNJqytEB.cjs → main-BUEuCNq-.cjs} +1 -1
- package/dist/{main-Dji-qcpb.js → main-Dk3BZDsa.js} +5 -5
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/{three-viewport-gizmo-CkQ98n-T.js → three-viewport-gizmo-BHznJ6W3.js} +2 -2
- package/dist/{threeLatheView-BmVBnC8n.js → threeLatheView-DcuDjVv0.js} +4 -4
- package/dist/{threeLatheView-CZdorls1.cjs → threeLatheView-DfSxRY8B.cjs} +1 -1
- package/dist/{threeModel-AI7JwNc8.cjs → threeModel-DjjtL0-a.cjs} +1 -1
- package/dist/{threeModel-ejibS2N7.js → threeModel-YRFvkgXU.js} +5 -5
- package/dist/{threePreview-C_mY_TBC.cjs → threePreview-ByUYJkts.cjs} +1 -1
- package/dist/{threePreview-CYX5wKoL.js → threePreview-CyYfnbB6.js} +4 -4
- package/dist/threeSceneView-mhrcH0WG.cjs +5 -0
- package/dist/threeSceneView-zvyCHrp1.js +1469 -0
- package/dist/{threeSceneViewForCPMPIP-OOuWUtK1.cjs → threeSceneViewForCPMPIP-DA-twBdG.cjs} +3 -3
- package/dist/{threeSceneViewForCPMPIP-CDxxtlbo.js → threeSceneViewForCPMPIP-axjwKt9X.js} +85 -86
- package/dist/threeViewerHost-B02OtfCk.cjs +1 -0
- package/dist/{threeViewerHost-DTgKwwlG.js → threeViewerHost-D7L1FW__.js} +65 -78
- package/dist/{useRayCaster-5KTcOfSB.js → useRayCaster-CAqupK7D.js} +5 -5
- package/dist/useRayCaster-ClcofJkf.cjs +1 -0
- package/package.json +1 -1
- package/public/config.js +1 -1
- package/dist/animationData-C3K2hxaU.cjs +0 -1
- package/dist/array-B-rkzr_a.js +0 -1142
- package/dist/array-DRbhAcfX.cjs +0 -11
- package/dist/index-0Pm0ddJB.cjs +0 -1
- package/dist/index-8qtn1JAM.cjs +0 -1
- package/dist/index-BTh-u_yw.js +0 -3370
- package/dist/index-CYNps_oO.js +0 -7210
- package/dist/index-DlDK9CYq.cjs +0 -1
- package/dist/index-HrI-8Xdy.cjs +0 -1
- package/dist/index-hol6Hhnu.js +0 -2567
- package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-BDNNr7wB.cjs +0 -56
- package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-BqbQkXoK.js +0 -34117
- package/dist/index.vue_vue_type_style_index_1_lang-BayGiM6k.cjs +0 -32
- package/dist/index.vue_vue_type_style_index_1_lang-bErlZPyW.js +0 -8085
- package/dist/isUndefined-ClRzgwTy.cjs +0 -1
- package/dist/isUndefined-chfCDxUU.js +0 -84
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/dist/threeSceneView-BO8STZl6.js +0 -1472
- package/dist/threeSceneView-CXqoIpeL.cjs +0 -5
- package/dist/threeViewerHost-ChVCHaag.cjs +0 -1
- package/dist/useRayCaster-C428LZl9.cjs +0 -1
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,46 +1,34 @@
|
|
|
1
|
-
import { computed as _, defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { u as H } from "./index.vue_vue_type_style_index_1_lang-
|
|
4
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
import { computed as _, defineComponent as z, defineAsyncComponent as S, ref as A, watch as G, createElementBlock as M, openBlock as E, normalizeClass as j, createBlock as b, createCommentVNode as B, unref as P } from "vue";
|
|
2
|
+
import { a as L, b$ as Y, p as I, s as O } from "./index-UN4JU0ly.js";
|
|
3
|
+
import { u as H } from "./index.vue_vue_type_style_index_1_lang-Exyt6qTf.js";
|
|
4
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BTu7I4mn.js";
|
|
5
5
|
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
function se(
|
|
7
|
-
const
|
|
8
|
-
return
|
|
6
|
+
function se(u) {
|
|
7
|
+
const d = sessionStorage.getItem("loginToken") ?? "123456";
|
|
8
|
+
return L({
|
|
9
9
|
url: "/api/sysFile/uploadFile",
|
|
10
10
|
method: "post",
|
|
11
|
-
data:
|
|
11
|
+
data: u,
|
|
12
12
|
headers: {
|
|
13
|
-
Authorization:
|
|
13
|
+
Authorization: d,
|
|
14
14
|
"Content-Type": "multipart/form-data"
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
function J(
|
|
19
|
-
const
|
|
20
|
-
return
|
|
18
|
+
function J(u) {
|
|
19
|
+
const d = sessionStorage.getItem("loginToken") ?? "123456";
|
|
20
|
+
return L({
|
|
21
21
|
url: "/api/sysFile/downloadFile",
|
|
22
22
|
method: "post",
|
|
23
|
-
data:
|
|
23
|
+
data: u,
|
|
24
24
|
headers: {
|
|
25
|
-
Authorization:
|
|
25
|
+
Authorization: d,
|
|
26
26
|
Accept: "application/octet-stream"
|
|
27
27
|
// 明确要求返回二进制流
|
|
28
28
|
},
|
|
29
29
|
responseType: "blob"
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function ie(c) {
|
|
33
|
-
const f = sessionStorage.getItem("loginToken") ?? "123456";
|
|
34
|
-
return R({
|
|
35
|
-
url: "/api/sysFile/uploadFiles",
|
|
36
|
-
method: "post",
|
|
37
|
-
data: c,
|
|
38
|
-
headers: {
|
|
39
|
-
Authorization: f,
|
|
40
|
-
"Content-Type": "multipart/form-data"
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
32
|
const K = Y("threeState", {
|
|
45
33
|
state: () => ({
|
|
46
34
|
data: {
|
|
@@ -52,8 +40,8 @@ const K = Y("threeState", {
|
|
|
52
40
|
}
|
|
53
41
|
}),
|
|
54
42
|
actions: {
|
|
55
|
-
setData(
|
|
56
|
-
this.data =
|
|
43
|
+
setData(u) {
|
|
44
|
+
this.data = u;
|
|
57
45
|
},
|
|
58
46
|
getData() {
|
|
59
47
|
return this.data;
|
|
@@ -61,47 +49,47 @@ const K = Y("threeState", {
|
|
|
61
49
|
}
|
|
62
50
|
});
|
|
63
51
|
function Q() {
|
|
64
|
-
const
|
|
52
|
+
const u = H(I), { platform: d } = O(u), h = K(I), D = _(() => {
|
|
65
53
|
var e;
|
|
66
54
|
return (e = h == null ? void 0 : h.data) == null ? void 0 : e.extension;
|
|
67
|
-
}),
|
|
68
|
-
if (!
|
|
55
|
+
}), f = ["uv", "cpt", "cyd"], T = ["urdf"], o = ["obj", "stl"], n = [...f, ...T, ...o], U = (e) => {
|
|
56
|
+
if (!y())
|
|
69
57
|
throw new Error("不是三维系统");
|
|
70
58
|
h.setData(e);
|
|
71
|
-
},
|
|
59
|
+
}, p = () => h.getData(), y = () => d.value === "three", c = (e) => {
|
|
72
60
|
const s = e == null ? void 0 : e.toLowerCase(), i = s == null ? void 0 : s.lastIndexOf(".");
|
|
73
|
-
let
|
|
74
|
-
return i >= 0 && (
|
|
75
|
-
},
|
|
61
|
+
let m = s;
|
|
62
|
+
return i >= 0 && (m = m == null ? void 0 : m.slice(i + 1)), m;
|
|
63
|
+
}, w = (e) => {
|
|
76
64
|
if (!e)
|
|
77
65
|
return !1;
|
|
78
|
-
const s =
|
|
66
|
+
const s = c(e);
|
|
79
67
|
return n == null ? void 0 : n.includes(s);
|
|
80
68
|
};
|
|
81
69
|
return {
|
|
82
|
-
getData:
|
|
83
|
-
setData:
|
|
84
|
-
isThreeSystem:
|
|
70
|
+
getData: p,
|
|
71
|
+
setData: U,
|
|
72
|
+
isThreeSystem: y,
|
|
85
73
|
isUrdf: (e) => {
|
|
86
74
|
if (!e)
|
|
87
75
|
return !1;
|
|
88
|
-
const s =
|
|
76
|
+
const s = c(e);
|
|
89
77
|
return T == null ? void 0 : T.includes(s);
|
|
90
78
|
},
|
|
91
79
|
isGeneralFile: (e) => {
|
|
92
80
|
if (!e)
|
|
93
81
|
return !1;
|
|
94
|
-
const s =
|
|
82
|
+
const s = c(e);
|
|
95
83
|
return o == null ? void 0 : o.includes(s);
|
|
96
84
|
},
|
|
97
85
|
isTrackPathFile: (e) => {
|
|
98
86
|
if (!e)
|
|
99
87
|
return !1;
|
|
100
|
-
const s =
|
|
101
|
-
return
|
|
88
|
+
const s = c(e);
|
|
89
|
+
return f == null ? void 0 : f.includes(s);
|
|
102
90
|
},
|
|
103
|
-
isThreeFile:
|
|
104
|
-
isUseBackdrop: (e) =>
|
|
91
|
+
isThreeFile: w,
|
|
92
|
+
isUseBackdrop: (e) => y() && w(e),
|
|
105
93
|
initTrackFileType: (e) => {
|
|
106
94
|
if (!e)
|
|
107
95
|
return {
|
|
@@ -109,21 +97,21 @@ function Q() {
|
|
|
109
97
|
isCyd: !1,
|
|
110
98
|
isUv: !1
|
|
111
99
|
};
|
|
112
|
-
const s =
|
|
100
|
+
const s = c(e), i = f == null ? void 0 : f.find((k) => k === s);
|
|
113
101
|
return {
|
|
114
102
|
isCpt: i === "cpt",
|
|
115
103
|
isCyd: i === "cyd",
|
|
116
104
|
isUv: i === "uv"
|
|
117
105
|
};
|
|
118
106
|
},
|
|
119
|
-
getFileExtension:
|
|
120
|
-
extraExtension:
|
|
107
|
+
getFileExtension: c,
|
|
108
|
+
extraExtension: D
|
|
121
109
|
};
|
|
122
110
|
}
|
|
123
111
|
const X = {
|
|
124
112
|
key: 4,
|
|
125
113
|
class: "loading"
|
|
126
|
-
}, Z = /* @__PURE__ */
|
|
114
|
+
}, Z = /* @__PURE__ */ z({
|
|
127
115
|
__name: "threeViewerHost",
|
|
128
116
|
props: {
|
|
129
117
|
fileUrls: { default: () => [] },
|
|
@@ -136,8 +124,8 @@ const X = {
|
|
|
136
124
|
componentType: {}
|
|
137
125
|
},
|
|
138
126
|
emits: ["getThreeData"],
|
|
139
|
-
setup(
|
|
140
|
-
const h = S(() => import("./threeSceneView-
|
|
127
|
+
setup(u, { emit: d }) {
|
|
128
|
+
const h = S(() => import("./threeSceneView-zvyCHrp1.js")), D = S(() => import("./threePreview-CyYfnbB6.js")), f = S(() => import("./threeLatheView-DcuDjVv0.js")), T = S(() => import("./threeSceneViewForCPMPIP-axjwKt9X.js")), o = {
|
|
141
129
|
ROBOT_SCENE: "robot",
|
|
142
130
|
// 机器人场景
|
|
143
131
|
LATHE_SCENE: "latheScene",
|
|
@@ -146,7 +134,7 @@ const X = {
|
|
|
146
134
|
// 重大专项场景
|
|
147
135
|
PREVIEW: "preview"
|
|
148
136
|
// 预览模式
|
|
149
|
-
}, n =
|
|
137
|
+
}, n = u, U = H(I), { platName: p } = O(U), { isGeneralFile: y, isUrdf: c, isTrackPathFile: w, extraExtension: R } = Q(), F = _(() => (n == null ? void 0 : n.extension) || R.value), g = _(() => {
|
|
150
138
|
var t, r;
|
|
151
139
|
return (r = (t = n == null ? void 0 : n.threeData) == null ? void 0 : t.data) == null ? void 0 : r.trackFileType;
|
|
152
140
|
}), v = _(() => {
|
|
@@ -163,24 +151,24 @@ const X = {
|
|
|
163
151
|
return o.PREVIEW;
|
|
164
152
|
}
|
|
165
153
|
const t = (r = n == null ? void 0 : n.fileUrls) == null ? void 0 : r[0];
|
|
166
|
-
return
|
|
167
|
-
}), N =
|
|
154
|
+
return y(t) ? o.PREVIEW : (p == null ? void 0 : p.value) === "CPMPIP" && (c(t) || c(F.value)) ? o.CPMPIP_SCENE : (p == null ? void 0 : p.value) === "SFRTubeBend" && (c(t) || c(F.value)) ? o.ROBOT_SCENE : w(F.value) && g.value ? o.LATHE_SCENE : o.PREVIEW;
|
|
155
|
+
}), N = d, e = A([]), s = A(!1);
|
|
168
156
|
function i(t) {
|
|
169
157
|
try {
|
|
170
|
-
const r = new URL(t).pathname,
|
|
171
|
-
return decodeURIComponent(
|
|
158
|
+
const r = new URL(t).pathname, l = r.substring(r.lastIndexOf("/") + 1);
|
|
159
|
+
return decodeURIComponent(l);
|
|
172
160
|
} catch (r) {
|
|
173
161
|
return console.error("无法解析URL以提取文件名:", t, r), "未知文件名";
|
|
174
162
|
}
|
|
175
163
|
}
|
|
176
|
-
async function
|
|
177
|
-
let r,
|
|
164
|
+
async function m(t) {
|
|
165
|
+
let r, l;
|
|
178
166
|
if (/^https?:\/\//.test(t))
|
|
179
167
|
try {
|
|
180
168
|
const a = await fetch(t);
|
|
181
169
|
if (!a.ok)
|
|
182
170
|
throw new Error(`下载文件失败: ${a.statusText} (URL: ${t})`);
|
|
183
|
-
r = await a.blob(),
|
|
171
|
+
r = await a.blob(), l = i(t);
|
|
184
172
|
} catch (a) {
|
|
185
173
|
throw console.error("使用 fetch 下载文件时出错:", a), a;
|
|
186
174
|
}
|
|
@@ -190,11 +178,11 @@ const X = {
|
|
|
190
178
|
if (a.status !== 200)
|
|
191
179
|
throw new Error(`下载失败: ${a.status}`);
|
|
192
180
|
const C = a.headers["content-disposition"];
|
|
193
|
-
|
|
181
|
+
l = k(C) || "无文件名", r = a.data;
|
|
194
182
|
} catch (a) {
|
|
195
183
|
throw console.error("通过 API 下载文件时出错:", a), a;
|
|
196
184
|
}
|
|
197
|
-
return new File([r],
|
|
185
|
+
return new File([r], l, { type: r.type });
|
|
198
186
|
}
|
|
199
187
|
function k(t) {
|
|
200
188
|
if (!t) return;
|
|
@@ -218,9 +206,9 @@ const X = {
|
|
|
218
206
|
return a;
|
|
219
207
|
}
|
|
220
208
|
}
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
return
|
|
209
|
+
const l = t.match(/filename\s*=\s*("?)([^";]+)\1/i);
|
|
210
|
+
if (l)
|
|
211
|
+
return l[2].trim();
|
|
224
212
|
}
|
|
225
213
|
async function x(t) {
|
|
226
214
|
if (!t || !t.length) {
|
|
@@ -229,7 +217,7 @@ const X = {
|
|
|
229
217
|
}
|
|
230
218
|
s.value = !0;
|
|
231
219
|
try {
|
|
232
|
-
const r = await Promise.all(t.map((
|
|
220
|
+
const r = await Promise.all(t.map((l) => m(l)));
|
|
233
221
|
e.value = r;
|
|
234
222
|
} catch (r) {
|
|
235
223
|
console.error("文件下载时发生错误:", r), e.value = [];
|
|
@@ -237,7 +225,7 @@ const X = {
|
|
|
237
225
|
s.value = !1;
|
|
238
226
|
}
|
|
239
227
|
}
|
|
240
|
-
const
|
|
228
|
+
const $ = () => {
|
|
241
229
|
N("getThreeData");
|
|
242
230
|
};
|
|
243
231
|
return G(
|
|
@@ -246,33 +234,33 @@ const X = {
|
|
|
246
234
|
await x(t ?? []);
|
|
247
235
|
},
|
|
248
236
|
{ immediate: !0, deep: !0 }
|
|
249
|
-
), (t, r) => (
|
|
237
|
+
), (t, r) => (E(), M("div", {
|
|
250
238
|
class: j([n.host === "electron" ? "mv-electron" : "mv-inline", "three-platform"])
|
|
251
239
|
}, [
|
|
252
|
-
v.value === o.ROBOT_SCENE ? (
|
|
240
|
+
v.value === o.ROBOT_SCENE ? (E(), b(P(h), {
|
|
253
241
|
key: 0,
|
|
254
242
|
"file-blobs": e.value,
|
|
255
243
|
"animation-data": t.animationData,
|
|
256
|
-
onGetThreeData:
|
|
244
|
+
onGetThreeData: $,
|
|
257
245
|
threeData: n.threeData
|
|
258
|
-
}, null, 8, ["file-blobs", "animation-data", "threeData"])) : v.value === o.LATHE_SCENE ? (
|
|
246
|
+
}, null, 8, ["file-blobs", "animation-data", "threeData"])) : v.value === o.LATHE_SCENE ? (E(), b(P(f), {
|
|
259
247
|
key: 1,
|
|
260
248
|
fileUrls: t.fileUrls,
|
|
261
249
|
threeData: n.threeData,
|
|
262
|
-
trackFileType:
|
|
263
|
-
}, null, 8, ["fileUrls", "threeData", "trackFileType"])) : v.value === o.CPMPIP_SCENE ? (
|
|
250
|
+
trackFileType: g.value
|
|
251
|
+
}, null, 8, ["fileUrls", "threeData", "trackFileType"])) : v.value === o.CPMPIP_SCENE ? (E(), b(P(T), {
|
|
264
252
|
key: 2,
|
|
265
253
|
"file-blobs": e.value,
|
|
266
254
|
threeData: n.threeData
|
|
267
|
-
}, null, 8, ["file-blobs", "threeData"])) : v.value === o.PREVIEW ? (
|
|
255
|
+
}, null, 8, ["file-blobs", "threeData"])) : v.value === o.PREVIEW ? (E(), b(P(D), {
|
|
268
256
|
key: 3,
|
|
269
257
|
"file-blobs": e.value,
|
|
270
258
|
"animation-data": t.animationData
|
|
271
|
-
}, null, 8, ["file-blobs", "animation-data"])) :
|
|
272
|
-
s.value ? (
|
|
259
|
+
}, null, 8, ["file-blobs", "animation-data"])) : B("", !0),
|
|
260
|
+
s.value ? (E(), M("div", X, " 文件下载中,请稍候... ")) : B("", !0)
|
|
273
261
|
], 2));
|
|
274
262
|
}
|
|
275
|
-
}), ee = /* @__PURE__ */ q(Z, [["__scopeId", "data-v-5e37b1fe"]]),
|
|
263
|
+
}), ee = /* @__PURE__ */ q(Z, [["__scopeId", "data-v-5e37b1fe"]]), ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
276
264
|
__proto__: null,
|
|
277
265
|
default: ee
|
|
278
266
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -280,8 +268,7 @@ export {
|
|
|
280
268
|
ee as T,
|
|
281
269
|
Q as a,
|
|
282
270
|
se as b,
|
|
283
|
-
ie as c,
|
|
284
271
|
J as d,
|
|
285
|
-
|
|
272
|
+
ie as t,
|
|
286
273
|
K as u
|
|
287
274
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var de = Object.defineProperty;
|
|
2
2
|
var me = (n, s, t) => s in n ? de(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t;
|
|
3
3
|
var x = (n, s, t) => me(n, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
import { U as pe } from "./index.vue_vue_type_style_index_1_lang-
|
|
5
|
-
import { S as ve, M as fe, O as be } from "./STLLoader-
|
|
6
|
-
import { ay as we,
|
|
4
|
+
import { U as pe } from "./index.vue_vue_type_style_index_1_lang-D1n_3_F6.js";
|
|
5
|
+
import { S as ve, M as fe, O as be } from "./STLLoader-DmGTF0Nv.js";
|
|
6
|
+
import { ay as we, o as E, h as he, e as _e, B as ge, V as z, Q as Me, E as ye, az as Re, J as Se } from "./three-viewport-gizmo-BHznJ6W3.js";
|
|
7
7
|
import { defineComponent as $e, ref as V, computed as D, watch as ue, resolveComponent as J, createElementBlock as j, openBlock as I, createVNode as F, createElementVNode as c, withCtx as L, createTextVNode as U, toDisplayString as C } from "vue";
|
|
8
8
|
import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const ct = {
|
|
10
|
-
SINGLE: "
|
|
11
|
-
DOUBLE: "
|
|
10
|
+
SINGLE: "单机",
|
|
11
|
+
DOUBLE: "双机"
|
|
12
12
|
}, dt = {
|
|
13
13
|
ROBOT: 1,
|
|
14
14
|
PIPECOMPARSION: 2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var te=Object.defineProperty;var oe=(r,i,o)=>i in r?te(r,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[i]=o;var D=(r,i,o)=>oe(r,typeof i!="symbol"?i+"":i,o);const se=require("./index.vue_vue_type_style_index_1_lang-Bn7P4fYM.cjs"),C=require("./STLLoader-RU7KqloS.cjs"),R=require("./three-viewport-gizmo-BV37JzRa.cjs"),e=require("vue"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le={SINGLE:"单机",DOUBLE:"双机"},ne={ROBOT:1,PIPECOMPARSION:2},re="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function x(r){if(r==null||!isFinite(r))return"";const i=r/(1024*1024);if(i>=1)return`${i.toFixed(1)} MB`;const o=r/1024;return o>=1?`${o.toFixed(1)} KB`:`${r} B`}function ee(r){try{const i=r.split("?")[0].split("#")[0];return i.substring(i.lastIndexOf("/")+1)||i}catch{return r}}function ae(r){const{manager:i,baseFolderUrl:o,onFileProgress:l}=r,m=new se.URDFLoader(i);return m.packages=n=>`${o.endsWith("/")?o:o+"/"}${n}/`,m.loadMeshCb=(n,N,h)=>{const g=(()=>{const _=n.split("?")[0].split("#")[0],u=_.lastIndexOf(".");return u>=0?_.slice(u+1).toLowerCase():void 0})();switch(g){case"obj":{const _=(()=>{try{return new URL(".",n).toString()}catch{const c=n.lastIndexOf("/");return c>=0?n.slice(0,c+1):n}})(),u=(()=>{var v;return(((v=n.split("/").pop())==null?void 0:v.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${_}${u}.mtl`,E=c=>{const v=new C.OBJLoader(N);c&&v.setMaterials(c),v.load(n,b=>h(b),b=>l==null?void 0:l(n,b==null?void 0:b.loaded,b==null?void 0:b.total),b=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${n}`,b),h(new R.Group)})},w=new C.MTLLoader(N);w.setResourcePath(_),w.load(f,c=>{try{c.preload()}catch{}E(c)},c=>l==null?void 0:l(f,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),E(void 0)});break}case"stl":{new C.STLLoader(N).load(n,u=>{const f=new R.MeshPhongMaterial({color:12303291,shininess:30}),E=new R.Mesh(u,f);E.castShadow=!0,E.receiveShadow=!0,h(E)},u=>l==null?void 0:l(n,u==null?void 0:u.loaded,u==null?void 0:u.total),u=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${n}`,u),h(new R.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${n})`),h(new R.Group)}},m}function ce(r,i,o,l){return{loadSceneFromFile:n=>new Promise((N,h)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,_=0,u=null;const f=new R.LoadingManager;f.onStart=(w,c,v)=>{g=v||0,_=c||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(w,c,v)=>{_=c,g=v;const b=`正在加载 ${c} / ${v} 个文件: ${ee(w)}`;l.value=b,c===v&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(u){u.updateMatrixWorld(!0);const p=new R.Box3().setFromObject(u);p.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),u.userData.boundingBox=p,u.traverse(d=>{d.isMesh&&(d.castShadow=!0,d.receiveShadow=!0)}),N(u)}else h(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=w=>{console.warn(`LoadingManager 报告一个资源加载失败: ${w}。加载流程将继续。`)};const E=(w,c,v)=>{const b=ee(w);let p;v&&v>0?p=`${b}(${x(c)} / ${x(v)})`:c&&c>0?p=`${b}(已下载 ${x(c)})`:p=`${b}`,l.value=`正在下载第 ${_+1} / ${g} 个文件: ${p}`};try{const w=URL.createObjectURL(n);ae({manager:f,baseFolderUrl:re,onFileProgress:E}).load(w,v=>{u=v},void 0,v=>{console.error(`加载 URDF 文件 (${n.name}) 时发生致命错误:`,v),l.value="URDF 文件解析失败",o.value=!1,h(new Error(`加载 URDF 文件失败: ${n.name}`,{cause:v}))})}catch(w){console.error("初始化 URDF 加载时发生致命错误:",w),l.value="模型加载失败",o.value=!1,h(w)}})}}class ue{constructor(i){D(this,"robot");D(this,"movableJoints");this.robot=i,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(i=>i.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(i=>i.name)}setJointAngle(i,o){const l=this.robot.joints[i];if(!l||l.jointType==="fixed")return console.warn(`关节 ${i} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${i} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(i){Object.entries(i).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const i={};return this.movableJoints.forEach(o=>{i[o.name]=o.angle||0}),i}resetToZero(){this.movableJoints.forEach(i=>{i.setJointValue(0)})}getJointLimits(i){const o=this.robot.joints[i];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(i,o=1e3,l){const m=this.getCurrentJointStates(),n=Date.now();return new Promise(N=>{const h=()=>{const g=Date.now()-n,_=Math.min(g/o,1),u=this.easeInOutCubic(_),f={};Object.keys(i).forEach(E=>{const w=m[E]||0,c=i[E];f[E]=w+(c-w)*u}),this.setJointAngles(f),l&&l(_),_<1?requestAnimationFrame(h):N()};h()})}easeInOutCubic(i){return i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2}async playSequence(i,o=1e3,l){for(let m=0;m<i.length;m++)await this.animateToState(i[m],o,n=>{l&&l(m,n)})}}const de=(r,i="YZX")=>{const o=new R.Vector3,l=new R.Quaternion,m=new R.Vector3,n=new R.Euler;r.getWorldPosition(o),r.getWorldQuaternion(l),r.getWorldScale(m),n.setFromQuaternion(l,i);const N={x:r.rotation.x*180/Math.PI,y:r.rotation.y*180/Math.PI,z:r.rotation.z*180/Math.PI},h={x:n.x*180/Math.PI,y:n.y*180/Math.PI,z:n.z*180/Math.PI};return{position:r.position,rotation:N,scale:r.scale,worldPosition:o,worldRotation:h,worldScale:m}},me=(r,i,o)=>{const l=parseFloat(o);isNaN(l)||(r.position[i]=l,r.updateMatrixWorld(!0))},pe=(r,i,o)=>{const l=parseFloat(o);isNaN(l)||(r.rotation[i]=l*Math.PI/180,r.updateMatrixWorld(!0))},ve={class:"panel-content"},fe={class:"obj"},we={key:0,class:"obj-base"},be=["title"],he=["title"],Ve={key:1},_e={class:"obj-position"},Ee={class:"coord-item"},Ne={class:"coord-item"},ge={class:"coord-item"},ye={class:"obj-rotation"},Re={class:"coord-item"},Se={class:"coord-item"},Me={class:"coord-item"},De={class:"world"},Ce={class:"coord-line"},xe={class:"coord-text"},Fe={class:"world-position-item"},$e={class:"world-position-item"},Le={class:"world-position-item"},Oe={class:"coord-line"},Ue={class:"coord-text"},je={class:"world-rotation-item"},Je={class:"world-rotation-item"},ke={class:"world-rotation-item"},Ie=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(r,{emit:i}){const o=r,l=i,m=e.ref([]),n=e.ref({}),N=(t,s=0)=>{const V=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(a=>{if(!(a!=null&&a.isMesh)){const y={name:a==null?void 0:a.name,label:(a==null?void 0:a.name)||(a==null?void 0:a.type),show:!0,level:s+1,isPenultimate:!1,type:a==null?void 0:a.type,id:a==null?void 0:a.id,limit:(a==null?void 0:a.limit)??"",children:N(a==null?void 0:a.children,s+1),path:a==null?void 0:a.name};V.push(y)}}),V},h=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level:1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:N(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const V=[],a=[...t];for(;a.length>0&&V.length<s;){const y=a.shift();y.children&&y.children.length>0&&(V.push(y.id),a.push(...y.children))}return V},_=(t,s)=>{const V=[];return t.forEach(a=>{if(a.children&&a.children.length>0){V.push(a.id);const y=a.children.filter(M=>M.children&&M.children.length>0).slice(0,s).map(M=>M.id);V.push(...y)}}),V.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?_(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const u=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,E=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},w=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},c=t=>{l("visibleChange",t)},v=e.computed(()=>o!=null&&o.model?h(o.model):[]),b=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),p=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),d=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(n.value=de(o.model))},{deep:!0,immediate:!0}),e.watch(v,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var M,F,$,L,O,U,j,J,k,I,T,P,z,B,A,W,q,G,Q,X,Y,Z,K,H;const V=e.resolveComponent("el-divider"),a=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(V,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",fe,[o.model?(e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",{class:"obj-name",title:b.value},e.toDisplayString(b.value),9,be),e.createElementVNode("div",{class:"obj-type",title:p.value},"["+e.toDisplayString(p.value)+"]",9,he)])):(e.openBlock(),e.createElementBlock("div",Ve,"空")),e.createVNode(a,{"model-value":d.value,onChange:c},null,8,["model-value"])]),e.createVNode(V,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",_e,[e.createElementVNode("div",Ee,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":u((F=(M=n.value)==null?void 0:M.position)==null?void 0:F.x),onChange:s[0]||(s[0]=S=>E(S,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":u((L=($=n.value)==null?void 0:$.position)==null?void 0:L.y),onChange:s[1]||(s[1]=S=>E(S,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ge,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":u((U=(O=n.value)==null?void 0:O.position)==null?void 0:U.z),onChange:s[2]||(s[2]=S=>E(S,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(V,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",ye,[e.createElementVNode("div",Re,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((J=(j=n.value)==null?void 0:j.rotation)==null?void 0:J.x),onChange:s[3]||(s[3]=S=>w(S,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Se,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((I=(k=n.value)==null?void 0:k.rotation)==null?void 0:I.y),onChange:s[4]||(s[4]=S=>w(S,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Me,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((P=(T=n.value)==null?void 0:T.rotation)==null?void 0:P.z),onChange:s[5]||(s[5]=S=>w(S,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(V,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",De,[e.createElementVNode("div",Ce,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",xe,[e.createElementVNode("div",Fe,e.toDisplayString(u((B=(z=n.value)==null?void 0:z.worldPosition)==null?void 0:B.x))+", ",1),e.createElementVNode("div",$e,e.toDisplayString(u((W=(A=n.value)==null?void 0:A.worldPosition)==null?void 0:W.y))+", ",1),e.createElementVNode("div",Le,e.toDisplayString(u((G=(q=n.value)==null?void 0:q.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Oe,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Ue,[e.createElementVNode("div",je,e.toDisplayString(f((X=(Q=n.value)==null?void 0:Q.worldRotation)==null?void 0:X.x))+"°, ",1),e.createElementVNode("div",Je,e.toDisplayString(f((Z=(Y=n.value)==null?void 0:Y.worldRotation)==null?void 0:Z.y))+"°, ",1),e.createElementVNode("div",ke,e.toDisplayString(f((H=(K=n.value)==null?void 0:K.worldRotation)==null?void 0:H.z))+"° ",1)])])])])}}}),Te=ie._export_sfc(Ie,[["__scopeId","data-v-00d48931"]]);function Pe(r,i,o,l=["URDFVisual"]){let m=null;const n=e.ref(null),N=new R.Raycaster,h=new R.Vector2,g=new Map;function _(){o.value.forEach(p=>{p.traverse(d=>{l!=null&&l.includes(d.type)&&g.set(d.id,{obj:d,axis:d.axis||new R.Vector3(1,0,0),limits:d.limits})})})}function u(p){n.value&&n.value.obj.traverse(d=>{var t;d.material&&((t=d.material.emissive)==null||t.set(0))}),n.value=p,p.obj.traverse(d=>{var t;d.material&&((t=d.material.emissive)==null||t.set(65280))})}function f(p){const d=r.value.getBoundingClientRect();h.x=(p.clientX-d.left)/d.width*2-1,h.y=-((p.clientY-d.top)/d.height)*2+1,N.setFromCamera(h,m);const t=N.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,V=null;for(;s;){if(g.has(s.id)){V=g.get(s.id);break}s=s.parent}V&&u(V)}function E(){r.value&&r.value.removeEventListener("click",f,!1)}function w(){const{scene:p,camera:d}=i();m=d,_(),r.value&&r.value.addEventListener("click",f,!1)}function c(p){n.value&&(n.value.obj.visible=p)}function v(p){var s;const{axis:d,value:t}=p;me((s=n.value)==null?void 0:s.obj,d,t)}function b(p){var s;const{axis:d,value:t}=p;pe((s=n.value)==null?void 0:s.obj,d,t)}return{initRaycaster:w,dispose:E,selectedObject3D:n,setSelectedObjVisible:c,updatePosition:v,updateRotation:b}}exports.URDFRobotController=ue;exports.WorkpieceTreePanel=Te;exports.robotMode=le;exports.sceneType=ne;exports.useRaycaster=Pe;exports.useUrdfLoader=ce;
|
package/package.json
CHANGED
package/public/config.js
CHANGED
|
@@ -4,7 +4,7 @@ window.__env__ = {
|
|
|
4
4
|
"VITE_OPEN_CDN": "false",
|
|
5
5
|
"VITE_PUBLIC_PATH": "",
|
|
6
6
|
"VITE_SM_PUBLIC_KEY": "0484C7466D950E120E5ECE5DD85D0C90EAA85081A3A2BD7C57AE6DC822EFCCBD66620C67B0103FC8DD280E36C3B282977B722AAEC3C56518EDCEBAFB72C5A05312",
|
|
7
|
-
"VITE_API_URL": "http://222.92.178.198:
|
|
7
|
+
"VITE_API_URL": "http://222.92.178.198:62009",
|
|
8
8
|
"VITE_DEFAULT_USER": "",
|
|
9
9
|
"VITE_DEFAULT_USER_PASSWORD": ""
|
|
10
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const y=require("./index.vue_vue_type_style_index_1_lang-BayGiM6k.cjs"),I=require("./index.vue_vue_type_style_index_1_lang-Ca71BDvm.cjs"),U=require("./threeViewerHost-ChVCHaag.cjs"),T=require("./index-1z9RrjZc.cjs");function P(r){try{const c=new URL(r).pathname,i=c.substring(c.lastIndexOf("/")+1);return decodeURIComponent(i)}catch(c){return console.error("无法解析URL以提取文件名:",r,c),"未知文件名"}}function S(r){if(!r)return;const c=r.match(/filename\*\s*=\s*([^;]+)/i);if(c){let n=c[1].trim();n=n.replace(/^"(.*)"$/,"$1");const h=n.split("''");if(h.length===2){const m=h[0].toUpperCase(),f=h[1];try{if(m==="UTF-8")return decodeURIComponent(f)}catch{}return f}try{return decodeURIComponent(n)}catch{return n}}const i=r.match(/filename\s*=\s*("?)([^";]+)\1/i);if(i)return i[2].trim()}async function K(r){let c,i;if(/^https?:\/\//.test(r))try{const n=await fetch(r,{method:"GET",cache:"no-store"});if(!n.ok)throw new Error(`下载文件失败: ${n.statusText} (URL: ${r})`);c=await n.blob(),i=P(r)}catch(n){throw console.error("使用 fetch 下载文件时出错:",n),n}else try{const n=await U.downloadAvatarApi({url:r});if(n.status!==200)throw new Error(`下载失败: ${n.status}`);const h=n.headers["content-disposition"];i=S(h)||"无文件名",c=n.data}catch(n){throw console.error("通过 API 下载文件时出错:",n),n}return new File([c],i,{type:c.type})}function N(r){return new Promise((c,i)=>{const n=new FileReader;n.onload=h=>{var m;try{const f=(m=h.target)==null?void 0:m.result,u=I.readSync(f,{type:"array"}),F=u.Sheets[u.SheetNames[0]],E=I.utils.sheet_to_json(F);c(E)}catch(f){i(f)}},n.readAsArrayBuffer(r)})}const V=async()=>{const r="弯管仿真加工分析";let c={};const i=sessionStorage.getItem("systemKey"),n=await y.getItemData(`${r}/管件解析`,i,"");let h=["管长","外径"],m={};n==null||n.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{h.includes(a==null?void 0:a.key)&&(m[a.key]=a.value)}))}))});const f=m.管长,u=m.外径;console.log("管长",f,"外径",u,m);const F=f,E=u/2,d=await y.getItemData(`${r}/加工位姿生成`,i,"");let $=["夹持长度"],g={};d==null||d.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{$.includes(a==null?void 0:a.key)&&(g[a.key]=a.value)}))}))});const k=g.夹持长度;console.log("夹持长度",k,g);const x=Number(k),w={},b=await y.getItemData(`${r}/仿真动画生成`,i,"");b==null||b.forEach(e=>{var s,o,l,a,_,R;if((e==null?void 0:e.comp)==="Table"){let L=[],D=(l=(o=(s=e==null?void 0:e.compData)==null?void 0:s.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:o.contents)==null?void 0:l.map(t=>t==null?void 0:t.label),C=(R=(_=(a=e==null?void 0:e.compData)==null?void 0:a.find(t=>(t==null?void 0:t.key)==="tableContents"))==null?void 0:_.contents)==null?void 0:R.map(t=>(t=t==null?void 0:t.filter(p=>!(p!=null&&p.id)),t));C==null||C.forEach(t=>{L.push(y.getValueToObjectValue(t,D==null?void 0:D.filter(p=>p!=="操作")))}),w[e.name]=L,w[e.name+"Content"]=e}});const A=T.cloneDeep(w);return c={initialPipeLength:F,pipeRadius:E,clampLength:x,animationData:A},c},q=async()=>{const r="双弯管仿真加工分析";let c={};const i=sessionStorage.getItem("systemKey"),n=await y.getItemData(`${r}/管件解析`,i,"");let h=["管长","外径"],m={};n==null||n.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{h.includes(a==null?void 0:a.key)&&(m[a.key]=a.value)}))}))});const f=m.管长,u=m.外径;console.log("管长",f,"外径",u,m);const F=f,E=u/2,d=await y.getItemData(`${r}/加工工艺生成`,i,"");let $=["夹持位置"],g={};d==null||d.forEach(e=>{var s;(e==null?void 0:e.comp)==="Form"&&((s=e==null?void 0:e.compData)==null||s.forEach(o=>{var l;(o==null?void 0:o.key)==="formContent"&&((l=o==null?void 0:o.contents)==null||l.forEach(a=>{$.includes(a==null?void 0:a.key)&&(g[a.key]=a.value)}))}))});const k=g.夹持位置;console.log("夹持长度",k,g);const x=Number(k),w={},b=await y.getItemData(`${r}/仿真动画生成`,i,"");b==null||b.forEach(e=>{var s,o,l,a,_,R;if((e==null?void 0:e.comp)==="Table"){let L=[],D=(l=(o=(s=e==null?void 0:e.compData)==null?void 0:s.find(t=>(t==null?void 0:t.key)==="header"))==null?void 0:o.contents)==null?void 0:l.map(t=>t==null?void 0:t.label),C=(R=(_=(a=e==null?void 0:e.compData)==null?void 0:a.find(t=>(t==null?void 0:t.key)==="tableContents"))==null?void 0:_.contents)==null?void 0:R.map(t=>(t=t==null?void 0:t.filter(p=>!(p!=null&&p.id)),t));C==null||C.forEach(t=>{L.push(y.getValueToObjectValue(t,D==null?void 0:D.filter(p=>p!=="操作")))}),w[e.name]=L,w[e.name+"Content"]=e}});const A=T.cloneDeep(w);return c={initialPipeLength:F,pipeRadius:E,clampLength:x,animationData:A},c},B=async r=>await K(r),j=async r=>await N(r),X=async r=>{const c=await B(r);return await j(c)};exports.fetchDoubleRobotAnimationData=q;exports.fetchSingleRobotAnimationData=V;exports.initXYZBCList=X;
|