ss-component-new 1.3.682 → 1.3.684

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.
Files changed (58) hide show
  1. package/dist/{MTLLoader-qT5QxtXm.js → MTLLoader-DzMo1SNe.js} +86 -86
  2. package/dist/{URDFLoader-D3eMTiZb.js → URDFLoader-BAROJ9ka.js} +112 -112
  3. package/dist/{animationData-DBAbHIow.js → animationData-CTWTDXsQ.js} +7 -7
  4. package/dist/{array-jRfpOka6.js → array-CRYq9Jxn.js} +4 -4
  5. package/dist/{clone-epSiajPW.js → clone-sAhQxdz5.js} +1 -1
  6. package/dist/{eleIcon-BWVKfp5t.js → eleIcon-6RTuwqdk.js} +1 -1
  7. package/dist/fileUtil-UOt_otFo.js +20 -0
  8. package/dist/{iconfont-DsSG_70z.js → iconfont-TorEaqH3.js} +49 -49
  9. package/dist/{index-Bvvz41NY.js → index--N4l6N1w.js} +1 -1
  10. package/dist/{index-Bmk-CXy5.js → index-2gwwCj6d.js} +2 -2
  11. package/dist/{index-BLAPVSLU.js → index-9UYMNDVY.js} +25949 -25999
  12. package/dist/{index-CH8pGxiX.js → index-B0BoH4wm.js} +8 -8
  13. package/dist/{index-XGieOXX9.js → index-B30aeKGM.js} +2 -2
  14. package/dist/{index-BkChdIqr.js → index-B4nNFQS-.js} +22 -22
  15. package/dist/{index-C-Cstw1x.js → index-B8_ZqXDA.js} +10 -10
  16. package/dist/{index--PjD6UIW.js → index-BCmMcLum.js} +5 -5
  17. package/dist/{index-D_kI6aHR.js → index-BKMAFsRN.js} +2 -2
  18. package/dist/{index-SjNcMhxZ.js → index-BRQACLz0.js} +5 -5
  19. package/dist/{index-D1o4d6gh.js → index-BZg5q_rs.js} +2 -2
  20. package/dist/{index-BLnbN_F-.js → index-Bkg9CQm3.js} +1 -1
  21. package/dist/{index-DVURXaLH.js → index-Bywqjsvo.js} +11810 -11450
  22. package/dist/{index-CmRnsU1X.js → index-BzT9veMM.js} +4 -4
  23. package/dist/{index-B4vESlof.js → index-C06Ba2iF.js} +2 -2
  24. package/dist/{index-CNydoPVR.js → index-C8LpAkhu.js} +6 -6
  25. package/dist/{index-FNOjQQWl.js → index-C9_Pcose.js} +2 -2
  26. package/dist/index-CGzlH16h.js +331 -0
  27. package/dist/{index-BpGFvMaU.js → index-COBZQS9O.js} +2 -2
  28. package/dist/{index-kmuFWiAq.js → index-COV5ar9Q.js} +4 -4
  29. package/dist/{index-YVR3acYT.js → index-CvOCu8lX.js} +1 -1
  30. package/dist/{index-C5r4GvjQ.js → index-D-YGtSgX.js} +5 -5
  31. package/dist/{index-CfHObnEf.js → index-D-_Ie1fO.js} +1 -1
  32. package/dist/{index-CUJOuk-t.js → index-D2g9hX2c.js} +4 -4
  33. package/dist/{index-CPRVBnQZ.js → index-DUPQ7Cfd.js} +3 -3
  34. package/dist/{index-DT2KzAmL.js → index-D_f48W32.js} +4 -4
  35. package/dist/{index-3va3ENB8.js → index-DyoKmN7k.js} +2 -2
  36. package/dist/{index-B-oUd2b-.js → index-G2ZhOQG1.js} +6 -6
  37. package/dist/{index-Bto8e0_l.js → index-TpycHQ-H.js} +3 -3
  38. package/dist/{index-Bd9AU0ks.js → index-dcW2d4Zs.js} +1 -1
  39. package/dist/{index-CWCQy24b.js → index-hGjbrq0G.js} +2 -2
  40. package/dist/{index-Lc7md2MS.js → index-tLigeTzl.js} +10 -9
  41. package/dist/{index.vue_vue_type_style_index_0_scoped_83e6d490_lang-QPys2KyW.js → index.vue_vue_type_style_index_0_scoped_83e6d490_lang-LGVq0cuS.js} +13581 -13407
  42. package/dist/{isString-CoCw_sp3.js → isString-DzMmG8uL.js} +1 -1
  43. package/dist/{main-Bgh_Vl8E.js → main-B27LAY78.js} +4 -4
  44. package/dist/{menuIndex-B7ZUahFp.js → menuIndex-C_G8igKy.js} +1 -1
  45. package/dist/{request-DiogHwkN.js → request-CllqY4TP.js} +1 -0
  46. package/dist/ss-component.css +2 -2
  47. package/dist/ss-component.js +12 -12
  48. package/dist/ss-component2.js +13 -13
  49. package/dist/{threeModel-DF67wAtc.js → threeModel-vX7holAy.js} +5 -5
  50. package/dist/{threePreview-CQQPm2oj.js → threePreview-0iSlhKYj.js} +5 -5
  51. package/dist/{threeSceneView-MukJjphg.js → threeSceneView-D1dS9xmL.js} +12 -12
  52. package/dist/{threeSceneViewForCPMPIP-Cmw3lxMx.js → threeSceneViewForCPMPIP-DWvkVqSw.js} +9 -9
  53. package/dist/{threeTrackPathView-d9QnH6pv.js → threeTrackPathView-BzrYvQKg.js} +87 -87
  54. package/dist/{threeViewerHost-CxKP0BGS.js → threeViewerHost-BA3W7FKF.js} +3 -3
  55. package/dist/{urdfTree-BMwSzHf8.js → urdfTree-CZeEnUnE.js} +1 -1
  56. package/dist/{workpieceTreePanel-DTFfwsXF.js → workpieceTreePanel-BLWHbILu.js} +32 -32
  57. package/package.json +1 -1
  58. package/dist/index-CN6F4ryE.js +0 -342
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as U, defineAsyncComponent as b, computed as I, ref as R, watch as H, openBlock as T, createElementBlock as N, createElementVNode as K, renderSlot as u, unref as m, createBlock as B, withCtx as d, createCommentVNode as V } from "vue";
2
- import { a0 as W, u as A, p as D, s as $ } from "./index-DT2KzAmL.js";
3
- import { g as j, q as M, r as L } from "./index.vue_vue_type_style_index_0_scoped_83e6d490_lang-QPys2KyW.js";
2
+ import { a0 as W, u as A, p as D, s as $ } from "./index-D_f48W32.js";
3
+ import { g as j, q as M, r as L } from "./index.vue_vue_type_style_index_0_scoped_83e6d490_lang-LGVq0cuS.js";
4
4
  import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const re = {
6
6
  SINGLE: "单机",
@@ -112,7 +112,7 @@ const Y = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
112
112
  height: { default: "100%" }
113
113
  },
114
114
  setup(E) {
115
- const O = b(() => import("./threeSceneView-MukJjphg.js")), y = b(() => import("./threePreview-CQQPm2oj.js")), i = b(() => import("./threeTrackPathView-d9QnH6pv.js")), p = b(() => import("./threeSceneViewForCPMPIP-Cmw3lxMx.js")), n = E, P = A(D), { platName: f } = $(P), { isUrdf: _, isTrackPathFile: g } = z(), c = I(() => {
115
+ const O = b(() => import("./threeSceneView-D1dS9xmL.js")), y = b(() => import("./threePreview-0iSlhKYj.js")), i = b(() => import("./threeTrackPathView-BzrYvQKg.js")), p = b(() => import("./threeSceneViewForCPMPIP-DWvkVqSw.js")), n = E, P = A(D), { platName: f } = $(P), { isUrdf: _, isTrackPathFile: g } = z(), c = I(() => {
116
116
  var t;
117
117
  return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
118
118
  const { url: e, name: r } = s;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as I, ref as F, watch as M, onMounted as C, onUnmounted as E, openBlock as m, createElementBlock as f, Fragment as P, renderList as T, createElementVNode as d, toDisplayString as h, createCommentVNode as U, computed as L, resolveComponent as S, createVNode as A } from "vue";
2
- import { h as V } from "./index.vue_vue_type_style_index_0_scoped_83e6d490_lang-QPys2KyW.js";
2
+ import { h as V } from "./index.vue_vue_type_style_index_0_scoped_83e6d490_lang-LGVq0cuS.js";
3
3
  import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  const D = (i, a) => {
5
5
  if (!a)
@@ -1,11 +1,11 @@
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-D3eMTiZb.js";
5
- import { S as ve, M as pe, O as fe } from "./MTLLoader-qT5QxtXm.js";
6
- import { b2 as be, b3 as re, s as O, k as we, h as he, b4 as E, B as ge, b5 as _e, ap as je, V as ye } from "./index.vue_vue_type_style_index_0_scoped_83e6d490_lang-QPys2KyW.js";
4
+ import { U as me } from "./URDFLoader-BAROJ9ka.js";
5
+ import { S as ve, M as pe, O as fe } from "./MTLLoader-DzMo1SNe.js";
6
+ import { bb as be, bc as re, s as O, k as we, h as he, bd as E, B as ge, be as _e, ay as ye, V as je } from "./index.vue_vue_type_style_index_0_scoped_83e6d490_lang-LGVq0cuS.js";
7
7
  import { ref as T, defineComponent as Le, computed as M, watch as ue, resolveComponent as x, openBlock as k, createElementBlock as V, createVNode as U, withCtx as F, createTextVNode as D, createElementVNode as c, toDisplayString as C } from "vue";
8
- import { c as Re, e as Ue, g as $e } from "./iconfont-DsSG_70z.js";
8
+ import { c as Re, e as Ue, g as $e } from "./iconfont-TorEaqH3.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
11
  function Me(b) {
@@ -19,11 +19,11 @@ function Fe(b) {
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 y = (() => {
22
+ const j = (() => {
23
23
  const g = i.split("?")[0].split("#")[0], r = g.lastIndexOf(".");
24
24
  return r >= 0 ? g.slice(r + 1).toLowerCase() : void 0;
25
25
  })();
26
- switch (y) {
26
+ switch (j) {
27
27
  // OBJ+MTL
28
28
  case "obj": {
29
29
  const g = (() => {
@@ -81,21 +81,21 @@ function De(b) {
81
81
  break;
82
82
  }
83
83
  default:
84
- console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${y} (路径: ${i})`), v(new O());
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 y = 0, g = 0, r = null;
91
+ let j = 0, g = 0, r = null;
92
92
  const f = new be();
93
- f.onStart = (n, u, j) => {
94
- y = j || 0, g = u || 0, s.value = y > 0 ? `开始下载资源: 0 / ${y}` : "开始下载资源...", t.value = !0;
95
- }, f.onProgress = (n, u, j) => {
96
- g = u, y = j;
97
- const $ = `正在加载 ${u} / ${j} 个文件: ${re(n)}`;
98
- s.value = $, u === j && (s.value = "资源加载完成,正在处理模型...", setTimeout(() => {
93
+ f.onStart = (n, u, y) => {
94
+ j = y || 0, g = u || 0, s.value = j > 0 ? `开始下载资源: 0 / ${j}` : "开始下载资源...", t.value = !0;
95
+ }, f.onProgress = (n, u, y) => {
96
+ g = 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 ge().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 _ = (n, u, j) => {
114
+ const _ = (n, u, y) => {
115
115
  const $ = re(n);
116
116
  let p;
117
- j && j > 0 ? p = `${$}(${E(u)} / ${E(j)})` : u && u > 0 ? p = `${$}(已下载 ${E(u)})` : p = `${$}`, s.value = `正在下载第 ${g + 1} / ${y} 个文件: ${p}`;
117
+ y && y > 0 ? p = `${$}(${E(u)} / ${E(y)})` : u && u > 0 ? p = `${$}(已下载 ${E(u)})` : p = `${$}`, s.value = `正在下载第 ${g + 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: _
125
125
  }).load(
126
126
  n,
127
- (j) => {
128
- r = j;
127
+ (y) => {
128
+ r = y;
129
129
  },
130
130
  void 0,
131
- (j) => {
132
- console.error(`加载 URDF 文件 (${i.name}) 时发生致命错误:`, j), s.value = "URDF 文件解析失败", t.value = !1, v(new 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 _e(), v = new je(), y = /* @__PURE__ */ new Map();
142
+ const i = T(null), h = new _e(), v = new ye(), j = /* @__PURE__ */ new Map();
143
143
  function g() {
144
144
  t.value.forEach((p) => {
145
145
  p.traverse((d) => {
146
- s != null && s.includes(d.type) && y.set(d.id, {
146
+ s != null && s.includes(d.type) && j.set(d.id, {
147
147
  obj: d,
148
- axis: d.axis || new ye(1, 0, 0),
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 (y.has(o.id)) {
172
- w = y.get(o.id);
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 j(p) {
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: _,
202
202
  selectedObject3D: i,
203
203
  setSelectedObjVisible: u,
204
- updatePosition: j,
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 y = Date.now() - i, g = Math.min(y / t, 1), r = this.easeInOutCubic(g), f = {};
282
+ const j = Date.now() - i, g = Math.min(j / t, 1), r = this.easeInOutCubic(g), f = {};
283
283
  Object.keys(l).forEach((_) => {
284
284
  const n = m[_] || 0, u = l[_];
285
285
  f[_] = n + (u - n) * r;
@@ -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
- }] : [], y = (e, o) => {
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
- M(() => !m.value || m.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? g(m.value, t.maxExpandCount) : y(m.value, t.maxExpandCount));
366
+ M(() => !m.value || m.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? g(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, _ = (e, o) => {
368
368
  s("updatePosition", {
369
369
  obj: t.model,
@@ -378,7 +378,7 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
378
378
  });
379
379
  }, u = (e) => {
380
380
  s("visibleChange", e);
381
- }, j = M(() => t != null && t.model ? v(t.model) : []), $ = M(() => {
381
+ }, y = M(() => t != null && t.model ? v(t.model) : []), $ = M(() => {
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
384
  }), p = M(() => {
@@ -394,7 +394,7 @@ const Je = { class: "panel-content" }, Oe = { class: "obj" }, Ee = {
394
394
  deep: !0,
395
395
  immediate: !0
396
396
  }), ue(
397
- j,
397
+ y,
398
398
  (e) => {
399
399
  m.value = JSON.parse(JSON.stringify(e));
400
400
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ss-component-new",
3
3
  "private": false,
4
- "version": "1.3.682",
4
+ "version": "1.3.684",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -1,342 +0,0 @@
1
- import { watch as Ie, ref as w, computed as we } from "vue";
2
- import { p as E, k as A, w as Le } from "./index-CPRVBnQZ.js";
3
- import { s as Te, b as V, p as C, u as Re, A as De, c as B, J as N, E as Ee, q as Ae, aZ as Be, a_ as Pe, a$ as Ue, b0 as xe, b1 as Se, b2 as ke } from "./index-DT2KzAmL.js";
4
- import { s as z } from "./request-DiogHwkN.js";
5
- const qe = V(C), { systemUrl: f } = Te(qe);
6
- let P = f.value === "" || !f.value ? "http://222.92.178.198:63002" : f.value;
7
- Ie(
8
- () => f.value,
9
- () => {
10
- P = f.value === "" || !f.value ? "http://222.92.178.198:63002" : f.value;
11
- },
12
- { deep: !0, immediate: !0 }
13
- );
14
- function Ne(s) {
15
- return z({
16
- url: `${P}/platform/import_data`,
17
- method: "post",
18
- data: s
19
- });
20
- }
21
- function Fe(s) {
22
- return z({
23
- url: `${P}/platform/export_data`,
24
- method: "post",
25
- data: s,
26
- responseType: "blob"
27
- });
28
- }
29
- function Ve(s = "") {
30
- const r = s.match(/filename\*=UTF-8''([^;]+)/i);
31
- if (r)
32
- return decodeURIComponent(r[1]);
33
- const i = s.match(/filename=["']?([^"';]+)["']?/);
34
- return i ? i[1] : "download.xlsx";
35
- }
36
- const Ce = (s) => {
37
- var b, g;
38
- const r = ((b = s == null ? void 0 : s.headers) == null ? void 0 : b["content-type"]) || "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", i = new Blob([s.data], { type: r }), L = (g = s == null ? void 0 : s.headers) == null ? void 0 : g["content-disposition"], h = Ve(L) || "数据.xlsx", c = window.URL.createObjectURL(i), u = document.createElement("a");
39
- u.href = c, u.setAttribute("download", h), document.body.appendChild(u), u.click(), document.body.removeChild(u), window.URL.revokeObjectURL(c);
40
- }, Je = [
41
- {
42
- label: "编辑",
43
- value: "edit"
44
- },
45
- {
46
- label: "删除",
47
- value: "delete"
48
- }
49
- ], F = "role", m = {
50
- ENABLE: {
51
- value: "enable",
52
- label: "启用",
53
- tag: "primary"
54
- },
55
- DISABLED: {
56
- value: "disabled",
57
- label: "禁用",
58
- tag: "info"
59
- }
60
- }, d = {
61
- EDITABLE: {
62
- value: "editable",
63
- label: "可编辑",
64
- tag: "primary"
65
- },
66
- DISABLED: {
67
- value: "disabled",
68
- label: "不可编辑",
69
- tag: "info"
70
- }
71
- }, ze = {
72
- TABLE: {
73
- value: "Table"
74
- }
75
- }, Oe = ["查看", "查看三维模型", "导出paraform", "导出", "导出全部", "导出选中"], Ke = () => {
76
- const s = V(), r = Re(C), { isSuperAdmin: i, userId: L, userName: h, platId: c } = De(), u = w([]), b = (t) => {
77
- const { propertyType: e } = t || {};
78
- return e === ze.TABLE.value;
79
- }, g = w({}), O = we(() => {
80
- var e;
81
- return i.value ? !0 : ((e = g.value) == null ? void 0 : e.status) === d.EDITABLE.value;
82
- }), $ = (t) => {
83
- var o, l;
84
- const e = N(Date.now()), { id: a = 0 } = s.loginUserInfo || {}, n = B(t);
85
- return n.update_user_id = a, n.update_user_name = h.value, n.update_time = e, n.checked_ids = ((l = (o = n == null ? void 0 : n.main_ids) == null ? void 0 : o.map) == null ? void 0 : l.call(o, (p) => {
86
- const { id: _ } = p;
87
- return _;
88
- })) || [], n;
89
- }, U = (t) => {
90
- let e = [];
91
- return t.forEach((a) => {
92
- var n;
93
- if (a.isPropertyLeaf) {
94
- const o = B(a);
95
- e.push(o);
96
- }
97
- a.children && ((n = a.children) == null ? void 0 : n.length) > 0 && (e = e.concat(U(a.children)));
98
- }), e;
99
- }, x = (t = []) => {
100
- let e = [];
101
- for (let a = 0; a < t.length; a++) {
102
- const n = t[a], o = n.children || [];
103
- delete n.children, e.push(n), o && o.length > 0 && (e = e.concat(x(o)));
104
- }
105
- return e;
106
- }, G = (t) => {
107
- let e = [];
108
- return t.forEach((a) => {
109
- if (a.isPropertyLeaf) {
110
- const n = x(a.params);
111
- e = e.concat(n);
112
- }
113
- }), e;
114
- }, S = (t, e) => {
115
- const a = s.loginUserInfo, { id: n = 0 } = a || {}, o = N(Date.now());
116
- let l = {
117
- name: "",
118
- code: "",
119
- order_no: 1,
120
- data_scope: 1,
121
- remark: "",
122
- tenant_id: "",
123
- create_time: o,
124
- update_time: o,
125
- create_user_id: n,
126
- create_user_name: h.value,
127
- update_user_id: n,
128
- update_user_name: h.value,
129
- status: m.ENABLE.value,
130
- main_ids: [],
131
- checked_ids: [],
132
- params: []
133
- };
134
- const { checkAll: p, tree: _ } = e || {};
135
- if (p && _) {
136
- const v = U(_), be = v.map((D) => ({
137
- ...D,
138
- department_scope: "unlimited"
139
- }));
140
- l.main_ids = be, l.checked_ids = v.map((D) => D.id), l.params = G(v);
141
- }
142
- if (t) {
143
- const v = $(t);
144
- l = {
145
- ...l,
146
- ...v
147
- };
148
- }
149
- return l;
150
- }, T = (t) => {
151
- const e = [t];
152
- return {
153
- platId: c.value,
154
- changeRoleData: e
155
- };
156
- }, M = async (t) => await Se({
157
- platId: t
158
- }), j = async () => {
159
- var e;
160
- r.setImportLoading(!0);
161
- const t = await M(c.value).finally(() => {
162
- r.setImportLoading(!1);
163
- });
164
- return (e = t == null ? void 0 : t.data) == null ? void 0 : e.result;
165
- }, k = () => ({
166
- name: ""
167
- }), I = w(k()), H = () => {
168
- I.value = k();
169
- }, y = w({
170
- pageNum: 1,
171
- pageSize: 10,
172
- total: 0,
173
- pageSizes: [5, 10, 20, 50, 100]
174
- }), Q = (t) => {
175
- y.value.pageNum = t;
176
- }, J = (t) => {
177
- y.value.pageSize = t;
178
- }, K = () => ({
179
- platId: c.value,
180
- pageNum: y.value.pageNum,
181
- pageSize: y.value.pageSize,
182
- filter: {
183
- ...I.value
184
- }
185
- }), W = async (t) => {
186
- var a;
187
- const e = await ke(t);
188
- return (a = e == null ? void 0 : e.data) == null ? void 0 : a.result;
189
- }, Z = async () => {
190
- const t = K(), e = await W(t), { total: a } = e || {};
191
- return y.value.total = a, e || {};
192
- }, X = async (t) => {
193
- delete t.role_id;
194
- const e = T(t);
195
- await xe(e);
196
- }, Y = async (t) => {
197
- r.setImportLoading(!0), await X(t).finally(() => {
198
- r.setImportLoading(!1);
199
- });
200
- }, ee = async (t) => {
201
- const e = T(t);
202
- await Ue(e);
203
- }, te = async (t) => {
204
- r.setImportLoading(!0), await ee(t).finally(() => {
205
- r.setImportLoading(!1);
206
- });
207
- }, ae = async (t) => {
208
- const { role_id: e } = t, a = {
209
- platId: c.value,
210
- role_id: [e]
211
- };
212
- await Pe(a);
213
- }, ne = async (t) => {
214
- await Ee.confirm("是否确认要删除", "", {
215
- showClose: !1,
216
- confirmButtonText: "确认",
217
- cancelButtonText: "取消",
218
- type: "warning",
219
- modalClass: "delete-role-message-modal",
220
- confirmButtonClass: "delete-role-confirm"
221
- }), r.setImportLoading(!0), await ae(t).finally(() => {
222
- r.setImportLoading(!1);
223
- });
224
- }, oe = (t) => {
225
- const e = t.toUpperCase(), a = m == null ? void 0 : m[e];
226
- return (a == null ? void 0 : a.label) || t;
227
- }, se = (t) => {
228
- const e = t.toUpperCase(), a = m == null ? void 0 : m[e];
229
- return (a == null ? void 0 : a.tag) || "info";
230
- }, re = async (t) => {
231
- var a;
232
- const e = await Be(t);
233
- return ((a = e == null ? void 0 : e.data) == null ? void 0 : a.result) || [];
234
- }, le = async (t) => {
235
- const e = {
236
- platId: c.value,
237
- includeHidden: !0,
238
- roleIds: t
239
- };
240
- r.setImportLoading(!0);
241
- const a = await re(e).finally(() => {
242
- r.setImportLoading(!1);
243
- });
244
- u.value = a;
245
- }, ce = (t = "") => {
246
- const e = t.toUpperCase(), a = d == null ? void 0 : d[e];
247
- return (a == null ? void 0 : a.label) || t;
248
- }, ie = (t = "") => {
249
- const e = t.toUpperCase(), a = d == null ? void 0 : d[e];
250
- return (a == null ? void 0 : a.tag) || "info";
251
- }, R = (t) => t === d.EDITABLE.value, ue = (t, e) => {
252
- const { status: a } = t || {}, { tableOperate: n } = e || {};
253
- return !!(R(a) || n && Oe.includes(n));
254
- }, pe = (t, e) => {
255
- const { status: a } = t || {};
256
- return R(a);
257
- }, de = (t, e) => {
258
- if (i.value)
259
- return !0;
260
- const { type: a } = e || {};
261
- if (E.TABLE === a)
262
- return ue(t, e);
263
- if (E.FORM === a)
264
- return pe(t);
265
- const { status: n } = t || {};
266
- return R(n);
267
- }, me = async () => {
268
- var n, o;
269
- const e = {
270
- pageName: "系统管理/角色管理",
271
- platId: c.value,
272
- userId: L.value
273
- }, a = await Ae(e);
274
- return (o = (n = a == null ? void 0 : a.data) == null ? void 0 : n.result) == null ? void 0 : o[0];
275
- }, fe = async () => {
276
- if (!i.value)
277
- return g.value = await me(), g;
278
- }, q = (t) => {
279
- const e = B(t);
280
- for (let a = 0; a < e.length; a++) {
281
- const n = e == null ? void 0 : e[a], { id: o, prop: l, children: p } = n || {};
282
- n.uniqueKey = `${o}_${l}`, p && (n.children = q(p));
283
- }
284
- return e;
285
- }, ge = async (t) => {
286
- var a;
287
- const e = await Ne(t);
288
- return (a = e == null ? void 0 : e.data) == null ? void 0 : a.result;
289
- }, ye = async (t) => {
290
- const e = new FormData(), a = S(), { create_user_id: n, update_user_id: o, create_user_name: l, update_user_name: p } = a;
291
- return e.set("platId", c.value), e.set("file", t), e.set("tableType", F), e.set("create_user_id", n), e.set("update_user_id", o), e.set("create_user_name", l), e.set("update_user_name", p), await ge(e);
292
- }, he = async (t) => await Fe(t), _e = async () => {
293
- const t = {
294
- platId: c.value,
295
- tableType: F,
296
- filter: I.value
297
- }, e = await he(t);
298
- return Ce(e), e;
299
- }, ve = [["名称", "编码", "备注", "状态"]];
300
- return {
301
- compType: E,
302
- isTableFeature: b,
303
- queryInfo: I,
304
- resetQuery: H,
305
- pageInfo: y,
306
- setPageNum: Q,
307
- setPageSize: J,
308
- initGetByPage: Z,
309
- initRoleList: j,
310
- initCreate: Y,
311
- initUpdate: te,
312
- initDelete: ne,
313
- initRoleRequestData: T,
314
- initPropertyAuthTree: le,
315
- propertyAuthTree: u,
316
- initRoleItem: S,
317
- isSuperAdmin: i,
318
- getStatusLabelByValue: oe,
319
- getStatusTagByValue: se,
320
- getFeatureStatusLabelByValue: ce,
321
- getFeatureStatusTagByValue: ie,
322
- hasEditable: de,
323
- initRoleConfig: fe,
324
- hasRoleEditAuth: O,
325
- buildParamAuthTree: q,
326
- initImport: ye,
327
- initExport: _e,
328
- exportTemplate: async () => {
329
- const t = A.aoa_to_sheet(ve), e = A.book_new();
330
- A.book_append_sheet(e, t, "角色"), Le(e, "角色模板.xlsx");
331
- }
332
- };
333
- };
334
- export {
335
- Ne as a,
336
- Fe as e,
337
- d as f,
338
- Ce as i,
339
- Je as o,
340
- m as s,
341
- Ke as u
342
- };