ss-component-new 1.3.74 → 1.3.76
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/{MTLLoader-BmVWiY_L.cjs → MTLLoader-D1uo8mcW.cjs} +1 -1
- package/dist/{MTLLoader-BnW0QbvD.js → MTLLoader-DYLUvPra.js} +43 -43
- package/dist/{OrbitControls-DT_fJft5.cjs → OrbitControls-B4mz4dJ8.cjs} +1 -1
- package/dist/{OrbitControls-aj7APKeL.js → OrbitControls-Cd9ZVfIV.js} +1 -1
- package/dist/{URDFLoader-DwZ7u4OY.js → URDFLoader-BfRhERaC.js} +195 -195
- package/dist/{URDFLoader-DJRlNIJX.cjs → URDFLoader-BnH2w4x6.cjs} +1 -1
- package/dist/{animationData-CjkMBYd2.js → animationData-CO_7EKV4.js} +12 -12
- package/dist/{animationData-G7GPUUPU.cjs → animationData-CjVloDDN.cjs} +1 -1
- package/dist/array-DtmeNOPn.cjs +1 -0
- package/dist/{array-sJwvZynh.js → array-Xb-5MHCa.js} +19 -18
- package/dist/{iconfont-CKL4t_qj.js → iconfont-CD3omIZU.js} +2 -2
- package/dist/{iconfont-BQYJXZ0j.cjs → iconfont-CkpU7gNh.cjs} +1 -1
- package/dist/{index-BKQu8b42.js → index--D0Thf0J.js} +1 -1
- package/dist/{index-DtWkoC81.js → index-0HSo1RHX.js} +5 -5
- package/dist/{index-BPPcQ4_M.cjs → index-5dvr_F6Q.cjs} +1 -1
- package/dist/index-B-A_4_n_.cjs +1 -0
- package/dist/{index-Ceiu-jba.cjs → index-B-nrai8J.cjs} +1 -1
- package/dist/{index-Dyhg1YNv.js → index-B5i-XCGU.js} +1 -1
- package/dist/{index-Cr4PDNa4.js → index-BFtGkyJf.js} +4729 -4660
- package/dist/index-BGuyjj26.cjs +1 -0
- package/dist/{index-CYAEfACa.js → index-BLeSUjbB.js} +4 -4
- package/dist/{index-oa1r-ylv.js → index-BLqnYCsi.js} +2 -2
- package/dist/{index-B_j1sFJ7.cjs → index-BQEvzo4s.cjs} +1 -1
- package/dist/{index-DFZOCQ_1.cjs → index-BRyE_Lab.cjs} +1 -1
- package/dist/index-BYyFrGfX.js +7962 -0
- package/dist/{index-int00xes.cjs → index-B_kCqo4M.cjs} +1 -1
- package/dist/{index-CnmkPahV.js → index-B_uWA5AJ.js} +1 -1
- package/dist/index-BfOeLrc4.cjs +36 -0
- package/dist/{index-CD4F-OmC.js → index-BkipVGFw.js} +4 -4
- package/dist/{index-CIqvcKX_.js → index-BrLLsp39.js} +11 -11
- package/dist/{index-CjXOUGmo.cjs → index-BulgFj9c.cjs} +1 -1
- package/dist/{index-BkEcW47y.js → index-C-iUVY59.js} +1971 -1871
- package/dist/{index-BDPv6PGL.js → index-C3gtImRs.js} +2 -2
- package/dist/{index-DlhGQC5h.js → index-C55GyDvp.js} +2 -2
- package/dist/index-C5WqP8vL.cjs +1 -0
- package/dist/{index-5MpPq33s.cjs → index-CAD9KqHl.cjs} +1 -1
- package/dist/{index-DolfKJiF.cjs → index-CFCn1Gpd.cjs} +1 -1
- package/dist/index-CI_UVQ4Z.js +476 -0
- package/dist/index-CLTriF5O.cjs +11 -0
- package/dist/{index-Ct1Ul4ea.js → index-CMdeEau9.js} +4 -4
- package/dist/{index-BKKLS83Q.js → index-COyNONVE.js} +10 -10
- package/dist/{index-DwTVLqfZ.js → index-CSUpvfmH.js} +4745 -4671
- package/dist/{index-C036vLtM.cjs → index-CVCJuzlD.cjs} +1 -1
- package/dist/{index-Cf0Y4zav.cjs → index-CW-lwsDk.cjs} +1 -1
- package/dist/index-CcJb2uXu.js +8191 -0
- package/dist/{index-C3qSTp9J.cjs → index-CeXyg5Rl.cjs} +1 -1
- package/dist/{index-gHhE4tiq.js → index-Cfzc5_ZK.js} +4 -4
- package/dist/{index-COtwZu5v.js → index-ChBgkXqb.js} +17 -17
- package/dist/{index-D3QoZ29d.cjs → index-D03MbrNK.cjs} +1 -1
- package/dist/{index-9KGs7whM.cjs → index-DJg5d7ei.cjs} +1 -1
- package/dist/{index-tEu4f9lM.js → index-DMfz6Qrm.js} +2 -2
- package/dist/{index-B_vXxIGd.cjs → index-DPjDv9Ws.cjs} +13 -13
- package/dist/{index-SHqJ0cwG.js → index-DYqVJN3W.js} +2 -2
- package/dist/index-DbFGGKSI.cjs +1 -0
- package/dist/index-Dc6Q0f3F.cjs +11 -0
- package/dist/{index-DHdrBDP4.cjs → index-DcqWejmU.cjs} +1 -1
- package/dist/{index-D8f_yaYM.cjs → index-DhSdgyHz.cjs} +1 -1
- package/dist/{index-iIWkjzE_.cjs → index-DtJC43XK.cjs} +1 -1
- package/dist/{index-N83NRi2K.js → index-DxGZaHuy.js} +6 -6
- package/dist/{index-CM8QEOIe.js → index-Dysx8GkS.js} +3 -3
- package/dist/index-HCKkRTvn.cjs +19 -0
- package/dist/{index-Cwb3YO5-.cjs → index-IYg_iR8H.cjs} +1 -1
- package/dist/{index-DZAoe0YQ.js → index-X_HnLtRC.js} +1 -1
- package/dist/{index-DRIJn74B.cjs → index-j1S7YTh5.cjs} +1 -1
- package/dist/{index-CbNN_p1y.js → index-jiFqoYN9.js} +8 -8
- package/dist/{index-K1n-pA4G.js → index-jkHlUTog.js} +2616 -2545
- package/dist/{index-BHrQS0PO.js → index-lz-ekKYh.js} +1 -1
- package/dist/{index-C0ar9TXN.js → index-mdJtPr2-.js} +1 -1
- package/dist/{index-V5cMOBtr.cjs → index-nlfIt66y.cjs} +1 -1
- package/dist/index-pWdzgg-b.cjs +1 -0
- package/dist/{index-Cwmin1ye.js → index-sHmgudEg.js} +1 -1
- package/dist/{index-BQu6Fpbk.cjs → index-u7JCx5KX.cjs} +1 -1
- package/dist/{index-BbREGM4J.js → index-vURW-4ky.js} +16 -13
- package/dist/{index-M1TyGRiF.cjs → index-wv1wwLNX.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-5bWuAGGO.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CU0erI7U.js} +12433 -12426
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CcGgDB4E.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dj8zYuMh.cjs} +335 -335
- package/dist/{index.vue_vue_type_style_index_1_lang-C9ZWGOE_.js → index.vue_vue_type_style_index_1_lang-CCQPqKHr.js} +17 -17
- package/dist/{index.vue_vue_type_style_index_1_lang-DVJ-x-dv.cjs → index.vue_vue_type_style_index_1_lang-DsZZR0tg.cjs} +1 -1
- package/dist/{isString-D4Yi9bDE.js → isString-Bn5VcA2n.js} +1 -1
- package/dist/{isString-Cdf6R00a.cjs → isString-DhPkQDQg.cjs} +1 -1
- package/dist/{main-BKdjwR7r.js → main-BLk4Mfi1.js} +4 -4
- package/dist/{main-CyV6vjiF.cjs → main-j2YKSWX-.cjs} +1 -1
- package/dist/{menuIndex-19Ruf69F.js → menuIndex-BJ1CSzli.js} +1 -1
- package/dist/{menuIndex-BtkpgAAq.cjs → menuIndex-D332F0dw.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +20 -20
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +18 -18
- package/dist/{threeModel-DJuzBw05.cjs → threeModel-C3N_ghfY.cjs} +1 -1
- package/dist/{threeModel-DFNXfXRG.js → threeModel-v33sxEBl.js} +6 -6
- package/dist/{threePreview-D_Wos3LS.js → threePreview-DNw547cG.js} +5 -5
- package/dist/{threePreview-BrZjF4eC.cjs → threePreview-Dif-1kRY.cjs} +1 -1
- package/dist/{threeSceneView-DpTiFJaa.js → threeSceneView-BkGy9bnz.js} +39 -39
- package/dist/{threeSceneView-BEYAcypx.cjs → threeSceneView-iXMcW_Z9.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-BxeILghC.cjs → threeSceneViewForCPMPIP-Bjimwk9q.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-CISy1L0U.js → threeSceneViewForCPMPIP-qP-6IJzE.js} +9 -9
- package/dist/{threeTrackPathView-B3Pv2bdS.cjs → threeTrackPathView-Cqrx2pEK.cjs} +1 -1
- package/dist/{threeTrackPathView-DMVNt168.js → threeTrackPathView-wK0hwn3B.js} +59 -59
- package/dist/{threeViewerHost-ATO1eJ5g.js → threeViewerHost-B2fHt8c2.js} +10 -10
- package/dist/{threeViewerHost-DPRAryxf.cjs → threeViewerHost-RuZpxQGN.cjs} +1 -1
- package/dist/{urdfTree-BFkOOnWh.cjs → urdfTree-CnVw_qic.cjs} +1 -1
- package/dist/{urdfTree-_wSayOr_.js → urdfTree-i-8eGN0m.js} +1 -1
- package/dist/{workpieceTreePanel-CFmrXk2r.js → workpieceTreePanel-Cy1eCrLl.js} +58 -58
- package/dist/{workpieceTreePanel-D_VSdlXy.cjs → workpieceTreePanel-auNIy7t8.cjs} +1 -1
- package/package.json +1 -1
- package/dist/array-Dh-A7jle.cjs +0 -1
- package/dist/index-BPIqIM_a.cjs +0 -1
- package/dist/index-BjRRaKW2.js +0 -5817
- package/dist/index-C5pQXH0_.cjs +0 -11
- package/dist/index-CEJJB1_A.js +0 -24
- package/dist/index-CEyDjpWD.cjs +0 -1
- package/dist/index-Cn7cuOeM.js +0 -465
- package/dist/index-Cp68Aa8G.cjs +0 -11
- package/dist/index-D0hhR7_L.js +0 -10434
- package/dist/index-DievuDNj.cjs +0 -1
- package/dist/index-Dkb93gli.cjs +0 -13
- package/dist/index-DtvBUVyE.cjs +0 -1
- package/dist/index-Lx9WVRw6.cjs +0 -42
- package/dist/index-VZzCfKCC.cjs +0 -1
- package/dist/index-ciCCkZew.cjs +0 -1
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
var ce = Object.defineProperty;
|
|
2
2
|
var de = (b, l, t) => l in b ? ce(b, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : b[l] = t;
|
|
3
3
|
var J = (b, l, t) => de(b, typeof l != "symbol" ? l + "" : l, t);
|
|
4
|
-
import { U as me } from "./URDFLoader-
|
|
5
|
-
import { S as ve, M as pe, O as fe } from "./MTLLoader-
|
|
6
|
-
import {
|
|
7
|
-
import { ref as T, defineComponent as Le, computed as
|
|
8
|
-
import { c as Re, e as Ue, g as $e } from "./iconfont-
|
|
4
|
+
import { U as me } from "./URDFLoader-BfRhERaC.js";
|
|
5
|
+
import { S as ve, M as pe, O as fe } from "./MTLLoader-DYLUvPra.js";
|
|
6
|
+
import { bF as be, bG as re, ay as O, a2 as we, Z as he, bH as E, K as _e, bI as ge, b0 as ye, V as je } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CU0erI7U.js";
|
|
7
|
+
import { ref as T, defineComponent as Le, computed as F, watch as ue, resolveComponent as x, createElementBlock as k, openBlock as V, createVNode as U, createElementVNode as c, withCtx as M, createTextVNode as D, toDisplayString as C } from "vue";
|
|
8
|
+
import { c as Re, e as Ue, g as $e } from "./iconfont-CD3omIZU.js";
|
|
9
9
|
import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Se = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
|
|
11
|
-
function
|
|
11
|
+
function Fe(b) {
|
|
12
12
|
const { mtlUrl: l, manager: t, resourcePath: s, onLoad: m, onProgress: i, onError: h } = b, v = new pe(t);
|
|
13
13
|
return s && v.setResourcePath(s), v.load(l, m, i, h), v;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Me(b) {
|
|
16
16
|
const { objUrl: l, manager: t, materials: s, onLoad: m, onProgress: i, onError: h } = b, v = new fe(t);
|
|
17
17
|
return s && v.setMaterials(s), v.load(l, m, i, h), v;
|
|
18
18
|
}
|
|
19
19
|
function De(b) {
|
|
20
20
|
const { manager: l, baseFolderUrl: t, onFileProgress: s } = b, m = new me(l);
|
|
21
21
|
return m.packages = (i) => `${t.endsWith("/") ? t : t + "/"}${i}/`, m.loadMeshCb = (i, h, v) => {
|
|
22
|
-
const
|
|
22
|
+
const j = (() => {
|
|
23
23
|
const _ = i.split("?")[0].split("#")[0], r = _.lastIndexOf(".");
|
|
24
24
|
return r >= 0 ? _.slice(r + 1).toLowerCase() : void 0;
|
|
25
25
|
})();
|
|
26
|
-
switch (
|
|
26
|
+
switch (j) {
|
|
27
27
|
// OBJ+MTL
|
|
28
28
|
case "obj": {
|
|
29
29
|
const _ = (() => {
|
|
@@ -37,7 +37,7 @@ function De(b) {
|
|
|
37
37
|
var u;
|
|
38
38
|
return (((u = i.split("/").pop()) == null ? void 0 : u.split("?")[0].split("#")[0]) ?? "").replace(/\.[^/.?#]+$/, "");
|
|
39
39
|
})(), f = `${_}${r}.mtl`, g = (n) => {
|
|
40
|
-
|
|
40
|
+
Me({
|
|
41
41
|
objUrl: i,
|
|
42
42
|
manager: h,
|
|
43
43
|
materials: n,
|
|
@@ -48,7 +48,7 @@ function De(b) {
|
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
Fe({
|
|
52
52
|
mtlUrl: f,
|
|
53
53
|
manager: h,
|
|
54
54
|
resourcePath: _,
|
|
@@ -81,21 +81,21 @@ function De(b) {
|
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
default:
|
|
84
|
-
console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${
|
|
84
|
+
console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${j} (路径: ${i})`), v(new O());
|
|
85
85
|
}
|
|
86
86
|
}, m;
|
|
87
87
|
}
|
|
88
88
|
function dt(b, l, t, s) {
|
|
89
89
|
return { loadSceneFromFile: (i) => new Promise((h, v) => {
|
|
90
90
|
t.value = !0, s.value = "正在初始化 URDF 加载器...";
|
|
91
|
-
let
|
|
91
|
+
let j = 0, _ = 0, r = null;
|
|
92
92
|
const f = new be();
|
|
93
|
-
f.onStart = (n, u,
|
|
94
|
-
|
|
95
|
-
}, f.onProgress = (n, u,
|
|
96
|
-
_ = u,
|
|
97
|
-
const $ = `正在加载 ${u} / ${
|
|
98
|
-
s.value = $, u ===
|
|
93
|
+
f.onStart = (n, u, y) => {
|
|
94
|
+
j = y || 0, _ = u || 0, s.value = j > 0 ? `开始下载资源: 0 / ${j}` : "开始下载资源...", t.value = !0;
|
|
95
|
+
}, f.onProgress = (n, u, y) => {
|
|
96
|
+
_ = u, j = y;
|
|
97
|
+
const $ = `正在加载 ${u} / ${y} 个文件: ${re(n)}`;
|
|
98
|
+
s.value = $, u === y && (s.value = "资源加载完成,正在处理模型...", setTimeout(() => {
|
|
99
99
|
if (r) {
|
|
100
100
|
r.updateMatrixWorld(!0);
|
|
101
101
|
const p = new _e().setFromObject(r);
|
|
@@ -111,10 +111,10 @@ function dt(b, l, t, s) {
|
|
|
111
111
|
}, f.onError = (n) => {
|
|
112
112
|
console.warn(`LoadingManager 报告一个资源加载失败: ${n}。加载流程将继续。`);
|
|
113
113
|
};
|
|
114
|
-
const g = (n, u,
|
|
114
|
+
const g = (n, u, y) => {
|
|
115
115
|
const $ = re(n);
|
|
116
116
|
let p;
|
|
117
|
-
|
|
117
|
+
y && y > 0 ? p = `${$}(${E(u)} / ${E(y)})` : u && u > 0 ? p = `${$}(已下载 ${E(u)})` : p = `${$}`, s.value = `正在下载第 ${_ + 1} / ${j} 个文件: ${p}`;
|
|
118
118
|
};
|
|
119
119
|
try {
|
|
120
120
|
const n = URL.createObjectURL(i);
|
|
@@ -124,12 +124,12 @@ function dt(b, l, t, s) {
|
|
|
124
124
|
onFileProgress: g
|
|
125
125
|
}).load(
|
|
126
126
|
n,
|
|
127
|
-
(
|
|
128
|
-
r =
|
|
127
|
+
(y) => {
|
|
128
|
+
r = y;
|
|
129
129
|
},
|
|
130
130
|
void 0,
|
|
131
|
-
(
|
|
132
|
-
console.error(`加载 URDF 文件 (${i.name}) 时发生致命错误:`,
|
|
131
|
+
(y) => {
|
|
132
|
+
console.error(`加载 URDF 文件 (${i.name}) 时发生致命错误:`, y), s.value = "URDF 文件解析失败", t.value = !1, v(new Error(`加载 URDF 文件失败: ${i.name}`));
|
|
133
133
|
}
|
|
134
134
|
);
|
|
135
135
|
} catch (n) {
|
|
@@ -139,13 +139,13 @@ function dt(b, l, t, s) {
|
|
|
139
139
|
}
|
|
140
140
|
function mt(b, l, t, s = ["URDFVisual"]) {
|
|
141
141
|
let m = null;
|
|
142
|
-
const i = T(null), h = new ge(), v = new
|
|
142
|
+
const i = T(null), h = new ge(), v = new ye(), j = /* @__PURE__ */ new Map();
|
|
143
143
|
function _() {
|
|
144
144
|
t.value.forEach((p) => {
|
|
145
145
|
p.traverse((d) => {
|
|
146
|
-
s != null && s.includes(d.type) &&
|
|
146
|
+
s != null && s.includes(d.type) && j.set(d.id, {
|
|
147
147
|
obj: d,
|
|
148
|
-
axis: d.axis || new
|
|
148
|
+
axis: d.axis || new je(1, 0, 0),
|
|
149
149
|
// URDF 里的 <axis>
|
|
150
150
|
limits: d.limits
|
|
151
151
|
});
|
|
@@ -168,8 +168,8 @@ function mt(b, l, t, s = ["URDFVisual"]) {
|
|
|
168
168
|
if (e.length === 0) return;
|
|
169
169
|
let o = e[0].object, w = null;
|
|
170
170
|
for (; o; ) {
|
|
171
|
-
if (
|
|
172
|
-
w =
|
|
171
|
+
if (j.has(o.id)) {
|
|
172
|
+
w = j.get(o.id);
|
|
173
173
|
break;
|
|
174
174
|
}
|
|
175
175
|
o = o.parent;
|
|
@@ -186,7 +186,7 @@ function mt(b, l, t, s = ["URDFVisual"]) {
|
|
|
186
186
|
function u(p) {
|
|
187
187
|
i.value && (i.value.obj.visible = p);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function y(p) {
|
|
190
190
|
var o;
|
|
191
191
|
const { axis: d, value: e } = p;
|
|
192
192
|
Ue((o = i.value) == null ? void 0 : o.obj, d, e);
|
|
@@ -201,7 +201,7 @@ function mt(b, l, t, s = ["URDFVisual"]) {
|
|
|
201
201
|
dispose: g,
|
|
202
202
|
selectedObject3D: i,
|
|
203
203
|
setSelectedObjVisible: u,
|
|
204
|
-
updatePosition:
|
|
204
|
+
updatePosition: y,
|
|
205
205
|
updateRotation: $
|
|
206
206
|
};
|
|
207
207
|
}
|
|
@@ -279,7 +279,7 @@ class vt {
|
|
|
279
279
|
const m = this.getCurrentJointStates(), i = Date.now();
|
|
280
280
|
return new Promise((h) => {
|
|
281
281
|
const v = () => {
|
|
282
|
-
const
|
|
282
|
+
const j = Date.now() - i, _ = Math.min(j / t, 1), r = this.easeInOutCubic(_), f = {};
|
|
283
283
|
Object.keys(l).forEach((g) => {
|
|
284
284
|
const n = m[g] || 0, u = l[g];
|
|
285
285
|
f[g] = n + (u - n) * r;
|
|
@@ -307,7 +307,7 @@ class vt {
|
|
|
307
307
|
const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
308
308
|
key: 0,
|
|
309
309
|
class: "obj-base"
|
|
310
|
-
}, xe = ["title"],
|
|
310
|
+
}, xe = ["title"], ke = ["title"], Ve = { key: 1 }, Te = { class: "obj-position" }, ze = { class: "coord-item" }, Pe = { class: "coord-item" }, Ae = { class: "coord-item" }, Ie = { class: "obj-rotation" }, Be = { class: "coord-item" }, Ne = { class: "coord-item" }, We = { class: "coord-item" }, Ze = { class: "world" }, qe = { class: "coord-line" }, Ke = { class: "coord-text" }, Xe = { class: "world-position-item" }, Ye = { class: "world-position-item" }, Ge = { class: "world-position-item" }, He = { class: "coord-line" }, Qe = { class: "coord-text" }, et = { class: "world-rotation-item" }, tt = { class: "world-rotation-item" }, ot = { class: "world-rotation-item" }, st = /* @__PURE__ */ Le({
|
|
311
311
|
__name: "workpieceTreePanel",
|
|
312
312
|
props: {
|
|
313
313
|
model: {},
|
|
@@ -346,7 +346,7 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
346
346
|
limit: (e == null ? void 0 : e.limit) ?? "",
|
|
347
347
|
children: h(e == null ? void 0 : e.children, 1),
|
|
348
348
|
path: e == null ? void 0 : e.name
|
|
349
|
-
}] : [],
|
|
349
|
+
}] : [], j = (e, o) => {
|
|
350
350
|
const w = [], a = [...e];
|
|
351
351
|
for (; a.length > 0 && w.length < o; ) {
|
|
352
352
|
const L = a.shift();
|
|
@@ -363,7 +363,7 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
363
363
|
}
|
|
364
364
|
}), w.slice(0, o + 1);
|
|
365
365
|
};
|
|
366
|
-
|
|
366
|
+
F(() => !m.value || m.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? _(m.value, t.maxExpandCount) : j(m.value, t.maxExpandCount));
|
|
367
367
|
const r = (e) => e ? parseFloat(e.toFixed(3)) : 0, f = (e) => e ? parseFloat(e.toFixed(1)) : 0, g = (e, o) => {
|
|
368
368
|
s("updatePosition", {
|
|
369
369
|
obj: t.model,
|
|
@@ -378,13 +378,13 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
378
378
|
});
|
|
379
379
|
}, u = (e) => {
|
|
380
380
|
s("visibleChange", e);
|
|
381
|
-
},
|
|
381
|
+
}, y = F(() => t != null && t.model ? v(t.model) : []), $ = F(() => {
|
|
382
382
|
var e, o;
|
|
383
383
|
return ((e = t == null ? void 0 : t.model) == null ? void 0 : e.name) || ((o = t == null ? void 0 : t.model) == null ? void 0 : o.type);
|
|
384
|
-
}), p =
|
|
384
|
+
}), p = F(() => {
|
|
385
385
|
var e;
|
|
386
386
|
return (e = t == null ? void 0 : t.model) == null ? void 0 : e.type;
|
|
387
|
-
}), d =
|
|
387
|
+
}), d = F(() => {
|
|
388
388
|
var e;
|
|
389
389
|
return (e = t == null ? void 0 : t.model) == null ? void 0 : e.visible;
|
|
390
390
|
});
|
|
@@ -394,24 +394,24 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
394
394
|
deep: !0,
|
|
395
395
|
immediate: !0
|
|
396
396
|
}), ue(
|
|
397
|
-
|
|
397
|
+
y,
|
|
398
398
|
(e) => {
|
|
399
399
|
m.value = JSON.parse(JSON.stringify(e));
|
|
400
400
|
},
|
|
401
401
|
{ immediate: !0 }
|
|
402
402
|
), (e, o) => {
|
|
403
|
-
var S, z, P, A, I, B,
|
|
403
|
+
var S, z, P, A, I, B, N, W, Z, q, K, X, Y, G, H, Q, ee, te, oe, se, ie, le, ae, ne;
|
|
404
404
|
const w = x("el-divider"), a = x("el-switch"), L = x("el-input-number");
|
|
405
|
-
return
|
|
405
|
+
return V(), k("div", Je, [
|
|
406
406
|
U(w, null, {
|
|
407
|
-
default:
|
|
407
|
+
default: M(() => o[6] || (o[6] = [
|
|
408
408
|
D("对象")
|
|
409
409
|
])),
|
|
410
410
|
_: 1,
|
|
411
411
|
__: [6]
|
|
412
412
|
}),
|
|
413
413
|
c("div", Oe, [
|
|
414
|
-
t.model ? (
|
|
414
|
+
t.model ? (V(), k("div", Ee, [
|
|
415
415
|
c("div", {
|
|
416
416
|
class: "obj-name",
|
|
417
417
|
title: $.value
|
|
@@ -419,15 +419,15 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
419
419
|
c("div", {
|
|
420
420
|
class: "obj-type",
|
|
421
421
|
title: p.value
|
|
422
|
-
}, "[" + C(p.value) + "]", 9,
|
|
423
|
-
])) : (
|
|
422
|
+
}, "[" + C(p.value) + "]", 9, ke)
|
|
423
|
+
])) : (V(), k("div", Ve, "空")),
|
|
424
424
|
U(a, {
|
|
425
425
|
"model-value": d.value,
|
|
426
426
|
onChange: u
|
|
427
427
|
}, null, 8, ["model-value"])
|
|
428
428
|
]),
|
|
429
429
|
U(w, null, {
|
|
430
|
-
default:
|
|
430
|
+
default: M(() => o[7] || (o[7] = [
|
|
431
431
|
D("相对位置")
|
|
432
432
|
])),
|
|
433
433
|
_: 1,
|
|
@@ -475,7 +475,7 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
475
475
|
])
|
|
476
476
|
]),
|
|
477
477
|
U(w, null, {
|
|
478
|
-
default:
|
|
478
|
+
default: M(() => o[11] || (o[11] = [
|
|
479
479
|
D("相对旋转")
|
|
480
480
|
])),
|
|
481
481
|
_: 1,
|
|
@@ -485,7 +485,7 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
485
485
|
c("div", Be, [
|
|
486
486
|
o[12] || (o[12] = c("span", { class: "axis-label" }, "X°", -1)),
|
|
487
487
|
U(L, {
|
|
488
|
-
"model-value": f((
|
|
488
|
+
"model-value": f((W = (N = i.value) == null ? void 0 : N.rotation) == null ? void 0 : W.x),
|
|
489
489
|
onChange: o[3] || (o[3] = (R) => n(R, "x")),
|
|
490
490
|
size: "small",
|
|
491
491
|
class: "coord-input-compact",
|
|
@@ -495,10 +495,10 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
495
495
|
"controls-position": "right"
|
|
496
496
|
}, null, 8, ["model-value"])
|
|
497
497
|
]),
|
|
498
|
-
c("div",
|
|
498
|
+
c("div", Ne, [
|
|
499
499
|
o[13] || (o[13] = c("span", { class: "axis-label" }, "Y°", -1)),
|
|
500
500
|
U(L, {
|
|
501
|
-
"model-value": f((
|
|
501
|
+
"model-value": f((q = (Z = i.value) == null ? void 0 : Z.rotation) == null ? void 0 : q.y),
|
|
502
502
|
onChange: o[4] || (o[4] = (R) => n(R, "y")),
|
|
503
503
|
size: "small",
|
|
504
504
|
class: "coord-input-compact",
|
|
@@ -508,10 +508,10 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
508
508
|
"controls-position": "right"
|
|
509
509
|
}, null, 8, ["model-value"])
|
|
510
510
|
]),
|
|
511
|
-
c("div",
|
|
511
|
+
c("div", We, [
|
|
512
512
|
o[14] || (o[14] = c("span", { class: "axis-label" }, "Z°", -1)),
|
|
513
513
|
U(L, {
|
|
514
|
-
"model-value": f((
|
|
514
|
+
"model-value": f((X = (K = i.value) == null ? void 0 : K.rotation) == null ? void 0 : X.z),
|
|
515
515
|
onChange: o[5] || (o[5] = (R) => n(R, "z")),
|
|
516
516
|
size: "small",
|
|
517
517
|
class: "coord-input-compact",
|
|
@@ -523,17 +523,17 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
|
|
|
523
523
|
])
|
|
524
524
|
]),
|
|
525
525
|
U(w, null, {
|
|
526
|
-
default:
|
|
526
|
+
default: M(() => o[15] || (o[15] = [
|
|
527
527
|
D("世界信息")
|
|
528
528
|
])),
|
|
529
529
|
_: 1,
|
|
530
530
|
__: [15]
|
|
531
531
|
}),
|
|
532
|
-
c("div",
|
|
533
|
-
c("div",
|
|
532
|
+
c("div", Ze, [
|
|
533
|
+
c("div", qe, [
|
|
534
534
|
o[16] || (o[16] = c("span", { class: "coord-label" }, "世界位置:", -1)),
|
|
535
|
-
c("span",
|
|
536
|
-
c("div",
|
|
535
|
+
c("span", Ke, [
|
|
536
|
+
c("div", Xe, C(r((G = (Y = i.value) == null ? void 0 : Y.worldPosition) == null ? void 0 : G.x)) + ", ", 1),
|
|
537
537
|
c("div", Ye, C(r((Q = (H = i.value) == null ? void 0 : H.worldPosition) == null ? void 0 : Q.y)) + ", ", 1),
|
|
538
538
|
c("div", Ge, C(r((te = (ee = i.value) == null ? void 0 : ee.worldPosition) == null ? void 0 : te.z)), 1)
|
|
539
539
|
])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ee=Object.defineProperty;var te=(b,i,o)=>i in b?ee(b,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[i]=o;var C=(b,i,o)=>te(b,typeof i!="symbol"?i+"":i,o);const oe=require("./URDFLoader-DJRlNIJX.cjs"),S=require("./MTLLoader-BmVWiY_L.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CcGgDB4E.cjs"),e=require("vue"),D=require("./iconfont-BQYJXZ0j.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function re(b){const{mtlUrl:i,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.MTLLoader(o);return l&&p.setResourcePath(l),p.load(i,m,r,_),p}function ie(b){const{objUrl:i,manager:o,materials:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.OBJLoader(o);return l&&p.setMaterials(l),p.load(i,m,r,_),p}function ne(b){const{manager:i,baseFolderUrl:o,onFileProgress:l}=b,m=new oe.URDFLoader(i);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,_,p)=>{const g=(()=>{const h=r.split("?")[0].split("#")[0],c=h.lastIndexOf(".");return c>=0?h.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const h=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${h}${c}.mtl`,V=a=>{ie({objUrl:r,manager:_,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new N.Group)}})};re({mtlUrl:f,manager:_,resourcePath:h,onLoad:a=>{try{a.preload()}catch{}V(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),V(void 0)}});break}case"stl":{new S.STLLoader(_).load(r,c=>{const f=new N.MeshPhongMaterial({color:12303291,shininess:30}),V=new N.Mesh(c,f);V.castShadow=!0,V.receiveShadow=!0,p(V)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new N.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new N.Group)}},m}function ae(b,i,o,l){return{loadSceneFromFile:r=>new Promise((_,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,h=0,c=null;const f=new N.LoadingManager;f.onStart=(a,d,E)=>{g=E||0,h=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,E)=>{h=d,g=E;const R=`正在加载 ${d} / ${E} 个文件: ${N.getFilenameFromUrl(a)}`;l.value=R,d===E&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new N.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),_(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const V=(a,d,E)=>{const R=N.getFilenameFromUrl(a);let v;E&&E>0?v=`${R}(${N.formatBytes(d)} / ${N.formatBytes(E)})`:d&&d>0?v=`${R}(已下载 ${N.formatBytes(d)})`:v=`${R}`,l.value=`正在下载第 ${h+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ne({manager:f,baseFolderUrl:le,onFileProgress:V}).load(a,E=>{c=E},void 0,E=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,E),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ce(b,i,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),_=new N.Raycaster,p=new N.Vector2,g=new Map;function h(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new N.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,_.setFromCamera(p,m);const t=_.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,w=null;for(;s;){if(g.has(s.id)){w=g.get(s.id);break}s=s.parent}w&&c(w)}function V(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=i();m=u,h(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function E(v){var s;const{axis:u,value:t}=v;D.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function R(v){var s;const{axis:u,value:t}=v;D.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:V,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:E,updateRotation:R}}class de{constructor(i){C(this,"robot");C(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(),r=Date.now();return new Promise(_=>{const p=()=>{const g=Date.now()-r,h=Math.min(g/o,1),c=this.easeInOutCubic(h),f={};Object.keys(i).forEach(V=>{const a=m[V]||0,d=i[V];f[V]=a+(d-a)*c}),this.setJointAngles(f),l&&l(h),h<1?requestAnimationFrame(p):_()};p()})}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,r=>{l&&l(m,r)})}}const ue={class:"panel-content"},me={class:"obj"},pe={key:0,class:"obj-base"},ve=["title"],fe=["title"],be={key:1},we={class:"obj-position"},_e={class:"coord-item"},he={class:"coord-item"},Ve={class:"coord-item"},Ee={class:"obj-rotation"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"world"},Re={class:"coord-line"},je={class:"coord-text"},Ce={class:"world-position-item"},De={class:"world-position-item"},Se={class:"world-position-item"},Ue={class:"coord-line"},Fe={class:"coord-text"},$e={class:"world-rotation-item"},Me={class:"world-rotation-item"},xe={class:"world-rotation-item"},Je=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:i}){const o=b,l=i,m=e.ref([]),r=e.ref({}),_=(t,s=0)=>{const w=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(n=>{if(!(n!=null&&n.isMesh)){const y={name:n==null?void 0:n.name,label:(n==null?void 0:n.name)||(n==null?void 0:n.type),show:!0,level:s+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:_(n==null?void 0:n.children,s+1),path:n==null?void 0:n.name};w.push(y)}}),w},p=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:_(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const w=[],n=[...t];for(;n.length>0&&w.length<s;){const y=n.shift();y.children&&y.children.length>0&&(w.push(y.id),n.push(...y.children))}return w},h=(t,s)=>{const w=[];return t.forEach(n=>{if(n.children&&n.children.length>0){w.push(n.id);const y=n.children.filter(j=>j.children&&j.children.length>0).slice(0,s).map(j=>j.id);w.push(...y)}}),w.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?h(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,V=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},E=e.computed(()=>o!=null&&o.model?p(o.model):[]),R=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)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=D.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(E,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var j,U,F,$,M,x,J,O,k,T,P,z,B,A,q,I,W,G,X,Y,Z,K,H,Q;const w=e.resolveComponent("el-divider"),n=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",me,[o.model?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",{class:"obj-name",title:R.value},e.toDisplayString(R.value),9,ve),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,fe)])):(e.openBlock(),e.createElementBlock("div",be,"空")),e.createVNode(n,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(w,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",we,[e.createElementVNode("div",_e,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(j=r.value)==null?void 0:j.position)==null?void 0:U.x),onChange:s[0]||(s[0]=L=>V(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",he,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c(($=(F=r.value)==null?void 0:F.position)==null?void 0:$.y),onChange:s[1]||(s[1]=L=>V(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ve,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c((x=(M=r.value)==null?void 0:M.position)==null?void 0:x.z),onChange:s[2]||(s[2]=L=>V(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Ee,[e.createElementVNode("div",ge,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((O=(J=r.value)==null?void 0:J.rotation)==null?void 0:O.x),onChange:s[3]||(s[3]=L=>a(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((T=(k=r.value)==null?void 0:k.rotation)==null?void 0:T.y),onChange:s[4]||(s[4]=L=>a(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((z=(P=r.value)==null?void 0:P.rotation)==null?void 0:z.z),onChange:s[5]||(s[5]=L=>a(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",je,[e.createElementVNode("div",Ce,e.toDisplayString(c((A=(B=r.value)==null?void 0:B.worldPosition)==null?void 0:A.x))+", ",1),e.createElementVNode("div",De,e.toDisplayString(c((I=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:I.y))+", ",1),e.createElementVNode("div",Se,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Ue,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Fe,[e.createElementVNode("div",$e,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Me,e.toDisplayString(f((K=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:K.y))+"°, ",1),e.createElementVNode("div",xe,e.toDisplayString(f((Q=(H=r.value)==null?void 0:H.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Oe=se._export_sfc(Je,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=de;exports.WorkpieceTreePanel=Oe;exports.useRaycaster=ce;exports.useUrdfLoader=ae;
|
|
1
|
+
"use strict";var ee=Object.defineProperty;var te=(b,i,o)=>i in b?ee(b,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[i]=o;var C=(b,i,o)=>te(b,typeof i!="symbol"?i+"":i,o);const oe=require("./URDFLoader-BnH2w4x6.cjs"),S=require("./MTLLoader-D1uo8mcW.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dj8zYuMh.cjs"),e=require("vue"),D=require("./iconfont-CkpU7gNh.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function re(b){const{mtlUrl:i,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.MTLLoader(o);return l&&p.setResourcePath(l),p.load(i,m,r,_),p}function ie(b){const{objUrl:i,manager:o,materials:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.OBJLoader(o);return l&&p.setMaterials(l),p.load(i,m,r,_),p}function ne(b){const{manager:i,baseFolderUrl:o,onFileProgress:l}=b,m=new oe.URDFLoader(i);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,_,p)=>{const g=(()=>{const h=r.split("?")[0].split("#")[0],c=h.lastIndexOf(".");return c>=0?h.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const h=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${h}${c}.mtl`,V=a=>{ie({objUrl:r,manager:_,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new N.Group)}})};re({mtlUrl:f,manager:_,resourcePath:h,onLoad:a=>{try{a.preload()}catch{}V(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),V(void 0)}});break}case"stl":{new S.STLLoader(_).load(r,c=>{const f=new N.MeshPhongMaterial({color:12303291,shininess:30}),V=new N.Mesh(c,f);V.castShadow=!0,V.receiveShadow=!0,p(V)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new N.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new N.Group)}},m}function ae(b,i,o,l){return{loadSceneFromFile:r=>new Promise((_,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,h=0,c=null;const f=new N.LoadingManager;f.onStart=(a,d,E)=>{g=E||0,h=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,E)=>{h=d,g=E;const R=`正在加载 ${d} / ${E} 个文件: ${N.getFilenameFromUrl(a)}`;l.value=R,d===E&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new N.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),_(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const V=(a,d,E)=>{const R=N.getFilenameFromUrl(a);let v;E&&E>0?v=`${R}(${N.formatBytes(d)} / ${N.formatBytes(E)})`:d&&d>0?v=`${R}(已下载 ${N.formatBytes(d)})`:v=`${R}`,l.value=`正在下载第 ${h+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ne({manager:f,baseFolderUrl:le,onFileProgress:V}).load(a,E=>{c=E},void 0,E=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,E),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ce(b,i,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),_=new N.Raycaster,p=new N.Vector2,g=new Map;function h(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new N.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,_.setFromCamera(p,m);const t=_.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,w=null;for(;s;){if(g.has(s.id)){w=g.get(s.id);break}s=s.parent}w&&c(w)}function V(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=i();m=u,h(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function E(v){var s;const{axis:u,value:t}=v;D.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function R(v){var s;const{axis:u,value:t}=v;D.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:V,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:E,updateRotation:R}}class de{constructor(i){C(this,"robot");C(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(),r=Date.now();return new Promise(_=>{const p=()=>{const g=Date.now()-r,h=Math.min(g/o,1),c=this.easeInOutCubic(h),f={};Object.keys(i).forEach(V=>{const a=m[V]||0,d=i[V];f[V]=a+(d-a)*c}),this.setJointAngles(f),l&&l(h),h<1?requestAnimationFrame(p):_()};p()})}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,r=>{l&&l(m,r)})}}const ue={class:"panel-content"},me={class:"obj"},pe={key:0,class:"obj-base"},ve=["title"],fe=["title"],be={key:1},we={class:"obj-position"},_e={class:"coord-item"},he={class:"coord-item"},Ve={class:"coord-item"},Ee={class:"obj-rotation"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"world"},Re={class:"coord-line"},je={class:"coord-text"},Ce={class:"world-position-item"},De={class:"world-position-item"},Se={class:"world-position-item"},Ue={class:"coord-line"},Fe={class:"coord-text"},$e={class:"world-rotation-item"},Me={class:"world-rotation-item"},xe={class:"world-rotation-item"},Je=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:i}){const o=b,l=i,m=e.ref([]),r=e.ref({}),_=(t,s=0)=>{const w=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(n=>{if(!(n!=null&&n.isMesh)){const y={name:n==null?void 0:n.name,label:(n==null?void 0:n.name)||(n==null?void 0:n.type),show:!0,level:s+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:_(n==null?void 0:n.children,s+1),path:n==null?void 0:n.name};w.push(y)}}),w},p=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:_(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const w=[],n=[...t];for(;n.length>0&&w.length<s;){const y=n.shift();y.children&&y.children.length>0&&(w.push(y.id),n.push(...y.children))}return w},h=(t,s)=>{const w=[];return t.forEach(n=>{if(n.children&&n.children.length>0){w.push(n.id);const y=n.children.filter(j=>j.children&&j.children.length>0).slice(0,s).map(j=>j.id);w.push(...y)}}),w.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?h(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,V=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},E=e.computed(()=>o!=null&&o.model?p(o.model):[]),R=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)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=D.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(E,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var j,U,F,$,M,x,J,O,k,T,P,z,B,A,q,I,W,G,X,Y,Z,K,H,Q;const w=e.resolveComponent("el-divider"),n=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",me,[o.model?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",{class:"obj-name",title:R.value},e.toDisplayString(R.value),9,ve),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,fe)])):(e.openBlock(),e.createElementBlock("div",be,"空")),e.createVNode(n,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(w,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",we,[e.createElementVNode("div",_e,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(j=r.value)==null?void 0:j.position)==null?void 0:U.x),onChange:s[0]||(s[0]=L=>V(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",he,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c(($=(F=r.value)==null?void 0:F.position)==null?void 0:$.y),onChange:s[1]||(s[1]=L=>V(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ve,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c((x=(M=r.value)==null?void 0:M.position)==null?void 0:x.z),onChange:s[2]||(s[2]=L=>V(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Ee,[e.createElementVNode("div",ge,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((O=(J=r.value)==null?void 0:J.rotation)==null?void 0:O.x),onChange:s[3]||(s[3]=L=>a(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((T=(k=r.value)==null?void 0:k.rotation)==null?void 0:T.y),onChange:s[4]||(s[4]=L=>a(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((z=(P=r.value)==null?void 0:P.rotation)==null?void 0:z.z),onChange:s[5]||(s[5]=L=>a(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",je,[e.createElementVNode("div",Ce,e.toDisplayString(c((A=(B=r.value)==null?void 0:B.worldPosition)==null?void 0:A.x))+", ",1),e.createElementVNode("div",De,e.toDisplayString(c((I=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:I.y))+", ",1),e.createElementVNode("div",Se,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Ue,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Fe,[e.createElementVNode("div",$e,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Me,e.toDisplayString(f((K=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:K.y))+"°, ",1),e.createElementVNode("div",xe,e.toDisplayString(f((Q=(H=r.value)==null?void 0:H.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Oe=se._export_sfc(Je,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=de;exports.WorkpieceTreePanel=Oe;exports.useRaycaster=ce;exports.useUrdfLoader=ae;
|
package/package.json
CHANGED
package/dist/array-Dh-A7jle.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),K=require("./index-Cp68Aa8G.cjs"),v=require("./index-Lx9WVRw6.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=require("./index-BVaHwt5f.cjs"),Ie=require("./index-B_vXxIGd.cjs"),Re=require("./index-5MpPq33s.cjs"),Le=require("./index-C5pQXH0_.cjs"),Me={class:"type-select"},$e={class:"group-label"},Fe={class:"group-items"},He=["onDragstart"],Oe={__name:"index",props:{compContainerRef:Object},emits:[""],setup(l,{emit:n}){const d=v.useModelComp(v.pinia),{itemData:r,activeItemIndex:y}=v.storeToRefs(d),c=n,w=e.ref(null),h=e.computed(()=>{var P,O,$;const I={label:"布局",items:["TABS","LAYOUT"]},E={label:"常用",items:["FORM","TABLE"]},S={label:"高级",items:["STEP","TIMELINE","CHART","SIGNATURE","AVATAR","FOLD"]},b=(P=K.slotContent.value)==null?void 0:P.filter(R=>{var i,o;return(o=I==null?void 0:I.items)==null?void 0:o.includes((i=R==null?void 0:R.type)==null?void 0:i.toUpperCase())}),j=(O=K.slotContent.value)==null?void 0:O.filter(R=>{var i,o;return(o=E==null?void 0:E.items)==null?void 0:o.includes((i=R==null?void 0:R.type)==null?void 0:i.toUpperCase())}),N=($=K.slotContent.value)==null?void 0:$.filter(R=>{var i,o;return(o=S==null?void 0:S.items)==null?void 0:o.includes((i=R==null?void 0:R.type)==null?void 0:i.toUpperCase())});return[{...I,items:b},{...E,items:j},{...S,items:N}]}),V=(I,E)=>{try{I.dataTransfer.clearData();const S={...E,timestamp:Date.now()};I.dataTransfer.setData("application/json",JSON.stringify(S)),I.dataTransfer.effectAllowed="copyMove",I.target.classList.add("dragging"),c("handleDragStart",E)}catch(S){console.error("Drag start error:",S)}};return(I,E)=>{const S=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("div",{class:"group-item",key:b==null?void 0:b.label},[e.createElementVNode("div",$e,e.toDisplayString(b==null?void 0:b.label),1),e.createElementVNode("div",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b==null?void 0:b.items,(j,N)=>(e.openBlock(),e.createElementBlock("div",{class:"type-list",title:"鼠标拖动",ref_for:!0,ref_key:"dragItem",ref:w,key:N,draggable:!0,onDragstart:P=>V(P,j)},[e.createVNode(S,{name:j.icon,style:{width:"15px",height:"15px"}},null,8,["name"]),e.createElementVNode("div",null,e.toDisplayString(j.name),1)],40,He))),128))])]))),128))])}}},Ae=oe._export_sfc(Oe,[["__scopeId","data-v-951fb5b4"]]),le=v.useModelComp(v.pinia),{pageMapState:Ue}=v.storeToRefs(le),qe=v.useMenuState(),{activeMenuPath:Z}=v.storeToRefs(qe),q=e.ref([]),W=e.ref([]),ze=e.computed(()=>[{label:"任务配置",name:"任务配置",component:{comp:"Table",name:"任务配置",isShow:!0,compData:[{key:"header",contents:[{prop:"任务名称",align:"center",isRun:!1,label:"任务名称",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{prop:"任务关键词",align:"center",isRun:!1,label:"任务关键词",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{prop:"执行任务",align:"center",isRun:!1,label:"执行任务",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{prop:"执行交互",align:"center",isRun:!1,label:"执行交互",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{prop:"任务状态",align:"center",isRun:!1,label:"任务状态",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{prop:"创建时间",align:"center",isRun:!1,label:"创建时间",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{label:"操作"}]},{key:"rowButton",contents:[{label:"访问"},{label:"删除"}]},{key:"extraButton",contents:[{label:"创建"},{label:"批量删除"}]},{key:"tableFilter",contents:[]},{key:"tableContents",contents:q.value}]}},{label:"任务关联",name:"任务关联",component:{comp:"Table",name:"任务关联",isShow:!0,compData:[{key:"header",contents:[{prop:"关联名称",align:"center",isRun:!1,label:"关联名称",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{prop:"关联形式",align:"center",isRun:!1,label:"关联形式",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{prop:"关联任务集合",align:"center",isRun:!1,label:"关联任务集合",isRoute:!1,isTableColHidden:!0,isFormColHidden:!1},{prop:"关联状态",align:"center",isRun:!1,label:"关联状态",isRoute:!1,isTableColHidden:!1,isFormColHidden:!1},{label:"操作"}]},{key:"rowButton",contents:[{label:"访问"},{label:"删除"}]},{key:"extraButton",contents:[{label:"创建"},{label:"批量删除"}]},{key:"tableFilter",contents:[]},{key:"tableContents",contents:W.value}]}}]),M=e.ref([]),Ve=e.computed(()=>{var l;return(l=M.value)==null?void 0:l.map((n,d)=>({value:n==null?void 0:n.id,label:n==null?void 0:n.name}))}),te=e.ref("data"),Y=e.ref("任务配置"),Q=e.ref({}),z=e.ref(null),A=e.reactive({width:"30%",title:"任务配置",type:"创建",show:!1}),Ge=()=>{A.show=!1},Ke=(l,n)=>{var r,y,c,w,h,V,I,E,S;if(Q.value=v.cloneDeep(n),l==="删除")return Y.value==="任务配置"?q.value=(r=q.value)==null?void 0:r.filter(b=>(b==null?void 0:b.id)!==(n==null?void 0:n.id)):Y.value==="任务关联"&&(W.value=(y=W.value)==null?void 0:y.filter(b=>(b==null?void 0:b.id)!==(n==null?void 0:n.id))),le.setItemExtendData({任务配置:{pageKey:Z.value,compId:(c=z.value)==null?void 0:c.id,results:q.value},任务关联:{pageKey:Z.value,compId:(w=z.value)==null?void 0:w.id,results:W.value}});const d=n?(h=Object.keys(n))==null?void 0:h[1]:"";Y.value==="任务配置"?A.title=`当前配置:${(V=z.value)==null?void 0:V.name}>任务配置>【${(n==null?void 0:n[d])||l}】`:Y.value==="任务关联"&&(A.title=`当前配置:${(I=z.value)==null?void 0:I.name}>任务关联>【${(n==null?void 0:n[d])||l}】`),A.type=typeof((E=Q.value)==null?void 0:E.id)=="string"||!((S=Q.value)!=null&&S.id)?"创建":"编辑",A.show=l==="创建"||l==="访问"},je=l=>{var n;typeof l=="number"&&(z.value=(n=M.value)==null?void 0:n[l],Je()),te.value="data"},Pe=l=>{},We=l=>{var n,d;switch(Y.value){case"任务配置":A.type==="创建"?q.value.push(l==null?void 0:l.data):q.value=(n=q.value)==null?void 0:n.map(r=>{var y;return(r==null?void 0:r.id)===((y=l==null?void 0:l.data)==null?void 0:y.id)?{...r,...l==null?void 0:l.data}:r});break;case"任务关联":A.type==="创建"?W.value.push(l==null?void 0:l.data):W.value=(d=W.value)==null?void 0:d.map(r=>{var y;return(r==null?void 0:r.id)===((y=l==null?void 0:l.data)==null?void 0:y.id)?{...r,...l==null?void 0:l.data}:r});break}console.log("handleTableData:",q.value,l,A.type),le.setItemExtendData({任务配置:{pageKey:Z.value,compId:l==null?void 0:l.compId,results:q.value},任务关联:{pageKey:Z.value,compId:l==null?void 0:l.compId,results:W.value}}),A.show=!1},Ye=l=>{var n,d;if((l==null?void 0:l.buttonName)==="取消")A.show=!1;else if((l==null?void 0:l.buttonName)==="保存"){const r={compId:(n=z.value)==null?void 0:n.id,data:{...l==null?void 0:l.content,id:(d=Q.value)==null?void 0:d.id}};We(r)}},Ne=(l,n)=>{var c,w;const{target:d,styleConfigs:r}=l;if(!r)return;const y=r==null?void 0:r.reduce((h,V)=>(h[V.prop]=V.value,h),{});n?M.value=(w=M.value)==null?void 0:w.map(h=>(h==null?void 0:h.id)===(n==null?void 0:n.id)?{...h,...y}:h):M.value=(c=M.value)==null?void 0:c.map(h=>({...h,...y})),le.setItemData(M.value)},Te=l=>{},Ee=(l,n)=>{var d;return(d=l==null?void 0:l.filter(r=>{var y,c,w,h,V;return((c=(y=r==null?void 0:r.key)==null?void 0:y.relatedInfo)==null?void 0:c.target)===n&&((h=(w=r==null?void 0:r.key)==null?void 0:w.relatedInfo)==null?void 0:h.compId)===((V=z.value)==null?void 0:V.id)}))==null?void 0:d.map(r=>{var y;return{...(y=r==null?void 0:r.value)==null?void 0:y.tableData,id:r==null?void 0:r.id}})},Je=()=>{var n,d;const l=(d=(n=Ue.value)==null?void 0:n[Z.value])==null?void 0:d.filter(r=>{var y;return((y=r==null?void 0:r.key)==null?void 0:y.type)==="extend"});(l==null?void 0:l.length)!==0&&(q.value=Ee(l,"任务配置"),W.value=Ee(l,"任务关联"))},Xe={class:"fill-content"},Qe={class:"overall-config-wrapper"},Ze={class:"operate-content"},et=["onClick"],tt={class:"collapse-title-item",title:"编辑"},lt={key:1},at=["onClick"],ot={class:"icon-content"},nt={key:0,class:"edit-content"},st=["onClick"],rt={title:"设置"},ct=["onClick"],ut={class:"parent-main"},it={style:{display:"flex","justify-content":"space-between"}},dt={title:"样式"},pt={title:"交互"},vt={title:"扩展"},ft={style:{width:"100%","max-height":"500px",overflow:"auto"}},ht={__name:"index",setup(l){const n=v.useModelComp(v.pinia),{itemData:d,originalData:r}=v.storeToRefs(n),y=v.useMenuState(),{activeMenuPath:c}=v.storeToRefs(y);e.ref([]);const w=e.ref([]),h=e.ref([]),V=e.ref([]),I=e.computed(()=>{var i,o,g,f;return((i=M.value)==null?void 0:i.length)>0&&(o=M.value)!=null&&o.every(m=>{var L,F;return(m==null?void 0:m.comp)===((F=(L=M.value)==null?void 0:L[0])==null?void 0:F.comp)})?(f=(g=M.value)==null?void 0:g[0])==null?void 0:f.comp:null}),E=i=>{var g;let o=(g=v.cloneDeep(h.value))==null?void 0:g.map((f,m)=>(i===m&&(f.content=!0),f));h.value=o},S=i=>{var g;let o=(g=v.cloneDeep(h.value))==null?void 0:g.map((f,m)=>(i===m&&(f.content=!1),f));h.value=o,M.value=v.cloneDeep(d.value)},b=(i,o)=>{var L;let g=(L=v.cloneDeep(h.value))==null?void 0:L.map((F,u)=>(i===u&&(F.content=!1),F));h.value=g;const f=v.cloneDeep(d.value),m=f==null?void 0:f.filter((F,u)=>(u===i&&(F.name=o),F));n.setOriginalData(m),n.setItemData(m)},j=i=>{const o=v.cloneDeep(d.value),g=o==null?void 0:o.map((f,m)=>((f==null?void 0:f.name)===(i==null?void 0:i.name)?f.isShow=!(i!=null&&i.isShow):f.isShow=f.isShow,f));d.value=g};e.watch(()=>d.value,()=>{var i,o,g,f;!d.value||((i=d.value)==null?void 0:i.length)===0?M.value=[]:M.value=(o=d.value)==null?void 0:o.filter(m=>(m==null?void 0:m.comp)!=="methodButton"),w.value=M.value,h.value=(g=v.cloneDeep(w.value))==null?void 0:g.map((m,L)=>({id:L,content:!1})),V.value=(f=v.cloneDeep(w.value))==null?void 0:f.map((m,L)=>({id:L,isShow:m==null?void 0:m.isShow}))},{deep:!0,immediate:!0});const N=i=>K.getComponent(i),P=(i,o,g,f)=>{var L,F;if(!i)return;let m=v.cloneDeep(d.value);m=(L=m==null?void 0:m.map((u,_)=>{if(f&&_===g){const{compData:p,itemChildData:U}=i;return u.compData=p,u.itemChildData=U,u}return _===g&&(u.compData=i),u}))==null?void 0:L.filter(u=>(u==null?void 0:u.comp)!=="methodButton"),h.value=(F=v.cloneDeep(m))==null?void 0:F.map((u,_)=>({id:_,content:!1})),n.setOriginalData(m),n.setItemData(m)},O=e.ref(null),$=(i,o)=>{if(!o){n.setActiveItemIndex(i);return}n.setActiveItemIndex(-1)},R=i=>{v.ElMessageBox.confirm("是否确认要删除","",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{const o=v.cloneDeep(d.value),g=o==null?void 0:o.filter((f,m)=>m!==i);n.setOriginalData(g),n.setItemData(g),n.setActiveItemIndex(-1),Le.ElMessage({type:"success",message:"删除成功"})}).catch(()=>{})};return(i,o)=>{var F;const g=e.resolveComponent("svg-icon"),f=e.resolveComponent("el-tab-pane"),m=e.resolveComponent("el-card"),L=e.resolveComponent("el-tabs");return e.openBlock(),e.createElementBlock("div",Xe,[o[10]||(o[10]=e.createElementVNode("div",{class:"fill-operate"},"操作栏",-1)),e.createElementVNode("div",Qe,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(I.value+"style")),{target:"overall",optionItems:e.unref(Ve),compType:I.value,comp:(F=e.unref(M))==null?void 0:F[0],onChange:e.unref(Ne)},null,40,["optionItems","compType","comp","onChange"]))]),e.createElementVNode("div",Ze,[e.createVNode(Se.default,{class:"collapse-content",collapseContents:e.unref(M),accordion:!0,onChange:e.unref(je),ref_key:"ssCollapseRef",ref:O},{title:e.withCtx(({item:u,index:_,isActive:p})=>{var U,T,H,a,s,C,D,k,G,J;return[e.createElementVNode("div",{class:"collapse-title-content",onClick:x=>$(_,p)},[e.createElementVNode("div",tt,[(T=(U=h.value)==null?void 0:U.find(x=>x.id===_))!=null&&T.content?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"collapse-title",style:e.normalizeStyle({marginRight:u.name&&u.name!==""?"8px":"0px"})},e.toDisplayString(u.name),5)),(a=(H=h.value)==null?void 0:H.find(x=>x.id===_))!=null&&a.content?(e.openBlock(),e.createElementBlock("div",lt,[e.createVNode(Ie._sfc_main$2,{modelValue:u.name,"onUpdate:modelValue":x=>u.name=x,onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),(C=(s=h.value)==null?void 0:s.find(x=>x.id===_))!=null&&C.content?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,onClick:e.withModifiers(x=>E(_),["stop"]),class:"icon-content"},[e.createVNode(g,{name:"Edit",style:{width:"13px",height:"13px"}})],8,at))]),e.createElementVNode("div",ot,[(k=(D=h.value)==null?void 0:D.find(x=>x.id===_))!=null&&k.content?(e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(g,{name:"Cancel",style:{width:"16px",height:"16px"},class:"icon-content",onClick:e.withModifiers(x=>S(_),["stop"])},null,8,["onClick"]),e.createVNode(g,{name:"Save",onClick:e.withModifiers(x=>b(_,u.name),["stop"]),style:{width:"16px",height:"16px",fill:"var(--ssComponent-primary-color)"},class:"icon-content"},null,8,["onClick"])])):e.createCommentVNode("",!0),(J=(G=h.value)==null?void 0:G.find(x=>x.id===_))!=null&&J.content?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:e.withModifiers(x=>R(_),["stop"]),class:"icon-content"},[e.createVNode(g,{name:"Delete",style:{width:"16px",height:"16px"}})],8,st))])],8,et)]}),content:e.withCtx(({item:u,index:_})=>[e.createVNode(L,{modelValue:e.unref(te),"onUpdate:modelValue":o[2]||(o[2]=p=>e.isRef(te)?te.value=p:null),class:"config-tabs",onTabClick:$},{default:e.withCtx(()=>[e.createVNode(f,{label:"设置",name:"data"},{label:e.withCtx(()=>[e.createElementVNode("span",rt,[e.createVNode(g,{name:"LowCodeSetting",style:{width:"15px",height:"15px","margin-right":"5px"}}),o[3]||(o[3]=e.createTextVNode("设置"))])]),default:e.withCtx(()=>{var p,U;return[e.createElementVNode("div",{class:"comp-child",onClick:T=>$(_)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(u.comp+"Operate")),{itemContents:u==null?void 0:u.compData,originalItemContents:(U=(p=w.value)==null?void 0:p.find((T,H)=>H===_))==null?void 0:U.compData,itemChildData:u==null?void 0:u.itemChildData,onChange:(T,H)=>P(T,u,_,H)},null,40,["itemContents","originalItemContents","itemChildData","onChange"]))],8,ct),e.createElementVNode("div",ut,[o[5]||(o[5]=e.createElementVNode("div",{class:"operate-title"},[e.createElementVNode("div",null,e.toDisplayString("显隐控制"))],-1)),e.createElementVNode("div",it,[o[4]||(o[4]=e.createElementVNode("div",{class:"operate-center-content"},e.toDisplayString("是否显示"),-1)),e.createVNode(Ie._sfc_main$1,{value:V.value.find(T=>T.id===_).isShow,"onUpdate:value":T=>V.value.find(H=>H.id===_).isShow=T,onClick:T=>j(u)},null,8,["value","onUpdate:value","onClick"])])])]}),_:2},1024),e.createVNode(f,{label:"样式",name:"style"},{label:e.withCtx(()=>[e.createElementVNode("span",dt,[e.createVNode(g,{name:"LowCodeStyle",style:{width:"15px",height:"15px","margin-right":"5px"}}),o[6]||(o[6]=e.createTextVNode("样式"))])]),default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N((u==null?void 0:u.comp)+"style")),{target:"alone",compType:u==null?void 0:u.comp,comp:u,optionItems:e.unref(Ve),onChange:p=>e.unref(Ne)(p,u)},null,40,["compType","comp","optionItems","onChange"]))]),_:2},1024),e.createVNode(f,{label:"交互",name:"event"},{label:e.withCtx(()=>[e.createElementVNode("span",pt,[e.createVNode(g,{name:"LowCodeEvent",style:{width:"15px",height:"15px","margin-right":"5px"}}),o[7]||(o[7]=e.createTextVNode("交互"))])]),default:e.withCtx(()=>[o[8]||(o[8]=e.createTextVNode(" 交互 "))]),_:1,__:[8]}),e.createVNode(f,{label:"扩展",name:"extend"},{label:e.withCtx(()=>[e.createElementVNode("span",vt,[e.createVNode(g,{name:"LowCodeExtend",style:{width:"15px",height:"15px","margin-right":"5px"}}),o[9]||(o[9]=e.createTextVNode("扩展"))])]),default:e.withCtx(()=>[e.createVNode(L,{"tab-position":"left",modelValue:e.unref(Y),"onUpdate:modelValue":o[1]||(o[1]=p=>e.isRef(Y)?Y.value=p:null),class:"extend-tabs",onTabChange:e.unref(Pe)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ze),(p,U)=>(e.openBlock(),e.createBlock(f,{key:p==null?void 0:p.name,label:p==null?void 0:p.label,name:p==null?void 0:p.name},{default:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>{var T,H,a;return[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N((T=p==null?void 0:p.component)==null?void 0:T.comp)),{compItem:p==null?void 0:p.component,itemData:(H=p==null?void 0:p.component)==null?void 0:H.compData,childItemData:(a=p==null?void 0:p.component)==null?void 0:a.itemChildData,key:U,level:1,onChange:e.unref(Te),onOnButtonClick:e.unref(Ke)},null,40,["compItem","itemData","childItemData","onChange","onOnButtonClick"]))]}),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue","onTabChange"])]),_:1})]),_:2},1032,["modelValue"])]),_:1},8,["collapseContents","onChange"])]),e.createVNode(Re.ssDialog,{class:"task-dialog-wrapper",visible:e.unref(A).show,title:e.unref(A).title,dialogWidth:e.unref(A).width,onBeforeDestroy:e.unref(Ge)},{default:e.withCtx(()=>{var u,_;return[e.createElementVNode("div",ft,[e.unref(z)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(((u=e.unref(z))==null?void 0:u.comp)+"extend")),{key:0,target:"alone",comp:e.unref(z),extendItem:e.unref(Q),compType:(_=e.unref(z))==null?void 0:_.comp,activeTabName:e.unref(Y),relatedData:e.unref(q),onChange:e.unref(Te),onOnButtonClick:e.unref(Ye)},null,40,["comp","extendItem","compType","activeTabName","relatedData","onChange","onOnButtonClick"])):e.createCommentVNode("",!0)])]}),_:1},8,["visible","title","dialogWidth","onBeforeDestroy"])])}}},mt=oe._export_sfc(ht,[["__scopeId","data-v-0ecba574"]]),gt={style:{display:"flex"}},Ct={style:{display:"flex"}},kt={key:2},yt={key:4,style:{"margin-top":"30px"}},_t={__name:"index",setup(l){const n=v.useModelComp(v.pinia),{itemData:d,activeItemIndex:r,pageMapState:y}=v.storeToRefs(n),c=e.ref([]),w=e.ref(0),h=e.ref(""),V=v.useMenuState(v.pinia),{activeMenuPath:I}=v.storeToRefs(V),E=e.ref(null),S=e.ref(null),b=e.ref(24),j=e.ref(2),N=e.ref([]),P=e.ref([]),O=e.computed(()=>{var a,s,C;return{default:!i.value&&!R.value&&$.value==="vertical"&&((a=c.value)==null?void 0:a.length)>0,grid:i.value&&!R.value&&$.value==="vertical",tab:$.value==="horizontal"&&((s=c.value)==null?void 0:s.length)>0,step:R.value&&$.value==="vertical"&&((C=c.value)==null?void 0:C.length)>0}}),$=e.computed(()=>{var a,s,C,D;return((a=c.value)==null?void 0:a.length)>0&&((s=c.value)!=null&&s.every(k=>k==null?void 0:k.layout))?(D=(C=c.value)==null?void 0:C[0])==null?void 0:D.layout:"vertical"}),R=e.computed(()=>{var a,s;return(s=(a=c.value)==null?void 0:a[0])==null?void 0:s.isStepLayout}),i=e.computed(()=>{var a,s;return(s=(a=c.value)==null?void 0:a[0])==null?void 0:s.isGridLayout}),o=e.ref(null),g=e.computed(()=>{var a,s,C;return((a=c.value)==null?void 0:a.length)>0&&$.value==="horizontal"?(C=(s=c.value)==null?void 0:s[0])==null?void 0:C.name:""}),f=(a,s)=>{w.value=s,o.value=a},m=a=>{var k;if(!a)return;let s=null;const C=v.cloneDeep(c.value);if(r.value>=0&&(s=C==null?void 0:C[r.value]),s&&s.comp==="Layout"){const{compData:G=[]}=s;((k=G==null?void 0:G.find(x=>{const{key:ee}=x;return ee==="children"}))==null?void 0:k.contents).push({comp:a.comp,name:a.name,compData:[]}),n.setItemData(C);return}const D=v.cloneDeep(c.value);D.push({comp:a.comp,name:a.name,compData:[]}),n.setItemData(D),T(D)},L=a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy"},F=async a=>{try{const s=a.dataTransfer.getData("application/json");if(!s)return;const C=JSON.parse(s),D=await u(a),k=_(C,D);await e.nextTick(),p(k),m(JSON.parse(s||"")),console.log("drop"),U()}catch(s){console.error("Drop error:",s),U()}},u=async a=>E.value?new Promise(s=>{requestAnimationFrame(()=>{const C=E.value.getBoundingClientRect(),D=a.clientX-C.left,k=a.clientY,G=Math.floor(D/(C.width/b.value)),J=Math.floor(k/(C.width/b.value));s({x:Math.max(0,G),y:Math.max(0,J),w:b.value,h:j.value})})}):{x:0,y:0},_=(a,s)=>{var D,k;const C=`item_${Date.now()}_${(k=(D=Math.random())==null?void 0:D.toString(36))==null?void 0:k.substring(2,9)}`;return{i:C,id:C,x:s.x,y:s.y,w:s.w,h:s.h,component:a,minW:2,minH:2}},p=a=>{T([...N.value,a],!0)},U=()=>{document.querySelectorAll(".dragging").forEach(a=>{a.classList.remove("dragging")})},T=(a,s)=>{N.value=s?a:K.generateLayouts(a),n.setItemGridData({pageKey:I.value,results:N.value}),V.setContentLoading(!1)};e.watch(()=>O.value.step,a=>{var s;a&&f((s=c.value)==null?void 0:s[0],1)},{immediate:!0}),e.watch(()=>O.value.grid,a=>{var s,C;!a&&((s=N.value)==null?void 0:s.length)>0&&n.setItemGridData({pageKey:I.value,results:(C=N.value)==null?void 0:C.map(D=>D==null?void 0:D.id),isDelete:!0})},{immediate:!0}),e.watch(()=>d.value,a=>{var s,C,D;V.setContentLoading(!0),c.value=!a||(a==null?void 0:a.length)===0?[]:(s=v.cloneDeep(a))==null?void 0:s.filter(k=>!(k!=null&&k.affix)||(k==null?void 0:k.affix)==="default"),P.value=!a||(a==null?void 0:a.length)===0?[]:(C=v.cloneDeep(a))==null?void 0:C.filter(k=>(k==null?void 0:k.affix)&&(k==null?void 0:k.affix)!=="default"),(D=O.value)!=null&&D.grid&&T(c.value)},{deep:!0,immediate:!0});const H=a=>K.getComponent(a);return(a,s)=>{var J,x,ee,ne,se,re,ce,ue,ie,de,pe,ve;const C=e.resolveComponent("el-tab-pane"),D=e.resolveComponent("el-tabs"),k=e.resolveComponent("el-step"),G=e.resolveComponent("el-steps");return e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:E,class:"low-code-wrapper",onDragover:L,onDrop:F},[(J=O.value)!=null&&J.default?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value,(t,B)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:B},[e.createElementVNode("div",gt,e.toDisplayString(t.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(H(t.comp)),{itemData:t==null?void 0:t.compData,childItemData:t==null?void 0:t.itemChildData,key:B,config:{showIndex:t==null?void 0:t.showIndex,allowMove:t==null?void 0:t.allowMove,viewport:t==null?void 0:t.viewport},pageLayout:$.value,parentTableId:t==null?void 0:t.tableId,children:t==null?void 0:t.children,level:1},null,8,["itemData","childItemData","config","pageLayout","parentTableId","children"]))]))),128)):e.createCommentVNode("",!0),(x=O.value)!=null&&x.grid?(e.openBlock(),e.createBlock(e.unref(K.De),{key:1,ref_key:"gridLayoutRef",ref:S,layout:N.value,"onUpdate:layout":s[0]||(s[0]=t=>N.value=t),"prevent-collision":!1,"is-draggable":!0,"is-resizable":!0,responsive:!1,"col-num":24,margin:[8,16]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(t,B)=>{var ae,fe;return e.openBlock(),e.createBlock(e.unref(K.st),{key:t.i,x:t.x,y:t.y,"min-h":t.minH,"max-h":t.maxH,"min-w":t.minW,w:t.w,h:e.unref(K.verifyButton)((ae=c.value[B])==null?void 0:ae.comp)?0:t.h,i:t.i,class:e.normalizeClass(e.unref(K.verifyButton)((fe=c.value[B])==null?void 0:fe.comp)?"grid-method-button":"")},{default:e.withCtx(()=>{var he,me,ge,Ce,ke,ye,_e,be,De,we,xe,Be;return[e.createElementVNode("div",{class:e.normalizeClass((me=P.value)!=null&&me.includes((he=t==null?void 0:t.component)==null?void 0:he.id)?"comp-wrapper affix-content":"comp-wrapper")},[e.createElementVNode("div",Ct,e.toDisplayString((ge=c.value[B])==null?void 0:ge.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(H((Ce=c.value[B])==null?void 0:Ce.comp)),{pageLayout:$.value,itemData:(ke=c.value[B])==null?void 0:ke.compData,childItemData:(ye=c.value[B])==null?void 0:ye.itemChildData,index:((_e=c.value[B])==null?void 0:_e.id)??B,parentTableId:(be=c.value[B])==null?void 0:be.tableId,children:(De=c.value[B])==null?void 0:De.children,level:1,config:{showIndex:(we=c.value[B])==null?void 0:we.showIndex,allowMove:(xe=c.value[B])==null?void 0:xe.allowMove,viewport:(Be=c.value[B])==null?void 0:Be.viewport}},null,8,["pageLayout","itemData","childItemData","index","parentTableId","children","config"]))],2)]}),_:2},1032,["x","y","min-h","max-h","min-w","w","h","i","class"])}),128))]),_:1},8,["layout"])):e.createCommentVNode("",!0),(ee=O.value)!=null&&ee.tab?(e.openBlock(),e.createElementBlock("div",kt,[e.createVNode(D,{modelValue:g.value,"onUpdate:modelValue":s[1]||(s[1]=t=>g.value=t),type:"card",class:"display-tabs"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(t,B)=>(e.openBlock(),e.createBlock(C,{key:t.i,label:t==null?void 0:t.name,name:t==null?void 0:t.name},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(H(t==null?void 0:t.comp)),{pageLayout:$.value,itemData:t==null?void 0:t.compData,childItemData:t==null?void 0:t.itemChildData,key:B,config:{showIndex:t==null?void 0:t.showIndex,allowMove:t==null?void 0:t.allowMove,viewport:t==null?void 0:t.viewport}},null,8,["pageLayout","itemData","childItemData","config"]))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),(ne=O.value)!=null&&ne.step?(e.openBlock(),e.createBlock(G,{key:3,direction:"horizontal",active:w.value,"align-center":!0,class:"display-steps"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(t,B)=>(e.openBlock(),e.createBlock(k,{key:B,class:"step-item",status:h.value,onClick:ae=>f(t,B+1)},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t==null?void 0:t.name),1)]),_:2},1032,["status","onClick"]))),128))]),_:1},8,["active"])):e.createCommentVNode("",!0),(se=O.value)!=null&&se.step?(e.openBlock(),e.createElementBlock("div",yt,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(H((re=o.value)==null?void 0:re.comp)),{pageLayout:$.value,itemData:(ce=o.value)==null?void 0:ce.compData,childItemData:(ue=o.value)==null?void 0:ue.itemChildData,key:(ie=o.value)==null?void 0:ie.id,config:{showIndex:(de=o.value)==null?void 0:de.showIndex,allowMove:(pe=o.value)==null?void 0:pe.allowMove,viewport:(ve=o.value)==null?void 0:ve.viewport}},null,8,["pageLayout","itemData","childItemData","config"]))])):e.createCommentVNode("",!0)],544)}}},bt=oe._export_sfc(_t,[["__scopeId","data-v-fda67a9b"]]),X=e.ref(0),Dt=l=>l.reduce((d,r)=>{var c,w;const y=Object.values(d);return(((c=Object.keys(d))==null?void 0:c.length)===0||y[y.length-1].length>=(r==null?void 0:r.width))&&(d[X.value]=[],X.value++),d[X.value-1].push(r),((w=Object.keys(d))==null?void 0:w.length)===(r==null?void 0:r.width)&&(d[X.value]=[],X.value++),d},{});exports.arrayToNumberArray=Dt;exports.modelFill=mt;exports.modelSelect=Ae;exports.modelShow=bt;
|
package/dist/index-BPIqIM_a.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("./index-Dkb93gli.cjs"),d=require("./index-Lx9WVRw6.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),B={class:"routerPage-wrapper"},w={class:"role-dialog-header"},N=["title"],b={title:"更多"},D={class:"dialog-footer"},y=e.defineComponent({__name:"index",setup(M){const g=d.useMenuState(),{menus:_,activeMenuPath:C}=d.storeToRefs(g),o=e.reactive({...d.State$1}),{treeRef:k}=d.State$1;e.onMounted(async()=>{await o.getActivePageStructureId(C.value)});const u=i=>i==null?void 0:i.map(t=>{var c,s,h;return t!=null&&t.childMenus&&((c=t==null?void 0:t.childMenus)==null?void 0:c.length)>0?{...t,childMenus:[],children:u(t==null?void 0:t.childMenus)}:{...t,childMenus:[],path:(s=t==null?void 0:t.path)!=null&&s.startsWith("/")?(h=t==null?void 0:t.path)==null?void 0:h.substring(1):t.path}});return e.watch(()=>_.value,i=>{e.nextTick(()=>{const t=d.cloneDeep(i),c=u(t);o.tempSysMenus=o.handleAddSysMenusButtons(c,"系统维护",["查看"]),o.menuData=o.addButtonsToTree(c,o.structureButtons)})},{immediate:!0,deep:!0}),(i,t)=>{const c=e.resolveComponent("el-checkbox"),s=e.resolveComponent("el-checkbox-group"),h=e.resolveComponent("svg-icon"),x=e.resolveComponent("el-popover"),f=e.resolveComponent("el-tree"),p=e.resolveComponent("el-button"),m=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",B,[e.createVNode(v.ssTable,{index:o.structureId,compName:o.compName,itemData:o.pageDataFiltered,changedContent:o.changedRow,onChange:o.handleItemDataChange,onOnButtonClick:o.clickRowButton},null,8,["index","compName","itemData","changedContent","onChange","onOnButtonClick"]),e.createVNode(m,{modelValue:o.authorizeDialog.show,"onUpdate:modelValue":t[0]||(t[0]=a=>o.authorizeDialog.show=a),width:o.authorizeDialog.width,draggable:o.authorizeDialog.draggable,"before-close":o.closeAuthorizeDialog,class:"role-dialog"},{header:e.withCtx(()=>[e.createElementVNode("div",w,e.toDisplayString(o.authorizeDialog.title),1)]),footer:e.withCtx(()=>[e.createElementVNode("div",D,[e.createVNode(p,{id:"themeBorderButton",onClick:o.closeAuthorizeDialog},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("取消")])),_:1,__:[1]},8,["onClick"]),e.createVNode(p,{id:"themeButton",onClick:o.clickSubmitAuthority},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode(" 确认 ")])),_:1,__:[2]},8,["onClick"])])]),default:e.withCtx(()=>[e.createVNode(f,{class:"role-tree",ref_key:"treeRef",ref:k,data:o.menuData,"expand-on-click-node":!1,"node-key":"path",props:{children:"children",label:"title",path:"path"},"highlight-current":"","default-expand-all":"","check-on-click-leaf":!1,"show-checkbox":"",onCheckChange:o.handleNodeCheckChange,style:{height:"500px","overflow-y":"auto"}},{default:e.withCtx(({node:a,data:n})=>[e.createElementVNode("span",{class:"node-text",title:a==null?void 0:a.label},e.toDisplayString(a==null?void 0:a.label),9,N),e.createVNode(s,{modelValue:n.checkedButtons,"onUpdate:modelValue":l=>n.checkedButtons=l,onChange:l=>o.handleNodeBtnChange(l,n),class:"node-buttons"},{default:e.withCtx(()=>{var l;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((l=n.renderButtons)==null?void 0:l.slice(0,2),r=>(e.openBlock(),e.createBlock(c,{key:r.title,label:r.title,value:r.path},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.title),1)]),_:2},1032,["label","value"]))),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),e.createVNode(x,{title:a==null?void 0:a.label,placement:"right-start"},{reference:e.withCtx(()=>{var l;return[e.createElementVNode("span",b,[e.withDirectives(e.createVNode(h,{name:"treeMore",class:"node-trigger"},null,512),[[e.vShow,((l=n.renderButtons)==null?void 0:l.length)>0]])])]}),default:e.withCtx(()=>[e.createVNode(s,{modelValue:n.checkedButtons,"onUpdate:modelValue":l=>n.checkedButtons=l,onChange:l=>o.handleNodeBtnChange(l,n),class:"node-buttons"},{default:e.withCtx(()=>{var l;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((l=n.renderButtons)==null?void 0:l.slice(2),r=>(e.openBlock(),e.createBlock(c,{key:r.title,label:r.title,value:r.path},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.title),1)]),_:2},1032,["label","value"]))),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1032,["title"])]),_:1},8,["data","onCheckChange"])]),_:1},8,["modelValue","width","draggable","before-close"])])}}}),S=V._export_sfc(y,[["__scopeId","data-v-78a46dd8"]]);exports.default=S;
|