smart-web-ui 1.0.8 → 1.0.9

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.
@@ -59479,6 +59479,11 @@ const iae = { class: "building-list" }, oae = {
59479
59479
  type: Object,
59480
59480
  default: null
59481
59481
  },
59482
+ // 当前处于透明状态的楼层 guid
59483
+ activeTransparent: {
59484
+ type: [Object, String],
59485
+ default: void 0
59486
+ },
59482
59487
  // 加载状态
59483
59488
  loading: {
59484
59489
  type: Boolean,
@@ -59490,6 +59495,8 @@ const iae = { class: "building-list" }, oae = {
59490
59495
  // 更新高亮建筑
59491
59496
  "update:activeChild",
59492
59497
  // 更新高亮楼层
59498
+ "update:activeTransparent",
59499
+ // 更新透明楼层
59493
59500
  "select-build",
59494
59501
  // 点击建筑标题
59495
59502
  "reset-build",
@@ -59503,95 +59510,101 @@ const iae = { class: "building-list" }, oae = {
59503
59510
  "toggle-show",
59504
59511
  // 点击显示/隐藏图标
59505
59512
  "toggle-expand"
59506
- // 点击列表展开/折叠(可选,用于父组件监听UI状态)
59513
+ // 点击列表展开/折叠(可选,用于父组件监听 UI 状态)
59507
59514
  ],
59508
59515
  setup(r, { emit: e }) {
59509
- const t = r, n = e, a = Ae(/* @__PURE__ */ new Set()), i = Ae(/* @__PURE__ */ new Set()), o = (d, g) => d.guid ?? d.id ?? d.name ?? g, s = (d, g) => a.value.has(o(d, g)), l = (d, g) => i.value.has(o(d, g)), u = (d, g) => {
59510
- const A = o(d, g), y = !s(d, g);
59511
- let m = /* @__PURE__ */ new Set();
59512
- if (y ? m.add(A) : (m = new Set(a.value), m.delete(A)), a.value = m, n("toggle-expand", { buildItem: d, index: g, expanded: y }), !y && l(d, g)) {
59513
- const w = new Set(i.value);
59514
- w.delete(A), i.value = w, n("toggle-layer", { buildItem: d, index: g, willExpand: !1 });
59515
- }
59516
- }, f = (d, g) => {
59517
- n("update:activeBuild", d.guid), n("update:activeChild", null), n("select-build", { item: d, index: g });
59518
- }, c = (d, g) => {
59519
- if (n("update:activeBuild", d.guid), n("update:activeChild", null), n("reset-build", { item: d, index: g }), l(d, g)) {
59520
- const A = o(d, g);
59521
- n("toggle-layer", { item: d, index: g, willExpand: !1 });
59522
- const y = new Set(i.value);
59523
- y.delete(A), i.value = y;
59524
- }
59525
- }, h = (d, g) => {
59526
- const A = o(d, g), y = !l(d, g), m = new Set(i.value);
59527
- y ? m.add(A) : m.delete(A), i.value = m, n("toggle-layer", { buildItem: d, index: g, willExpand: y });
59528
- }, v = (d, g, A) => {
59529
- var y;
59530
- d.guid !== ((y = t.activeChild) == null ? void 0 : y.guid) && (n("update:activeBuild", A.guid), n("update:activeChild", d), n("toggle-show", { child: d, childArray: g, parentItem: A }));
59531
- }, p = (d, g, A) => {
59532
- var y;
59533
- d.guid !== ((y = t.activeChild) == null ? void 0 : y.guid) && (n("update:activeBuild", A.guid), n("update:activeChild", d), n("toggle-transparent", { child: d, childArray: g, parentItem: A }));
59516
+ const t = r, n = e, a = Ae(/* @__PURE__ */ new Set()), i = Ae(/* @__PURE__ */ new Set()), o = Ae(/* @__PURE__ */ new Set()), s = (m, w) => m.guid ?? m.id ?? m.name ?? w, l = (m, w) => a.value.has(s(m, w)), u = (m, w) => i.value.has(s(m, w)), f = (m) => m == null ? null : typeof m == "object" ? m.guid ?? m.id ?? null : m, c = () => t.activeTransparent !== void 0;
59517
+ de(
59518
+ () => t.activeTransparent,
59519
+ (m) => {
59520
+ if (!c()) return;
59521
+ const w = f(m);
59522
+ o.value = w ? /* @__PURE__ */ new Set([w]) : /* @__PURE__ */ new Set();
59523
+ },
59524
+ { immediate: !0 }
59525
+ );
59526
+ const h = (m, w) => {
59527
+ const C = s(m, w), S = !l(m, w);
59528
+ let b = /* @__PURE__ */ new Set();
59529
+ if (S ? b.add(C) : (b = new Set(a.value), b.delete(C)), a.value = b, n("toggle-expand", { buildItem: m, index: w, expanded: S }), !S && u(m, w)) {
59530
+ const x = new Set(i.value);
59531
+ x.delete(C), i.value = x, n("toggle-layer", { buildItem: m, index: w, willExpand: !1 });
59532
+ }
59533
+ }, v = (m, w) => {
59534
+ n("update:activeBuild", m.guid), n("update:activeChild", null), n("select-build", { item: m, index: w });
59535
+ }, p = (m) => m ? c() ? m.guid === f(t.activeTransparent) : typeof m.transparent == "boolean" ? m.transparent : typeof m.opacity == "number" ? m.opacity < 1 : o.value.has(m.guid) : !1, d = (m, w) => {
59536
+ if (n("update:activeBuild", m.guid), n("update:activeChild", null), n("reset-build", { item: m, index: w }), u(m, w)) {
59537
+ const C = s(m, w);
59538
+ n("toggle-layer", { item: m, index: w, willExpand: !1 });
59539
+ const S = new Set(i.value);
59540
+ S.delete(C), i.value = S;
59541
+ }
59542
+ }, g = (m, w) => {
59543
+ const C = s(m, w), S = !u(m, w), b = new Set(i.value);
59544
+ S ? b.add(C) : b.delete(C), i.value = b, n("toggle-layer", { buildItem: m, index: w, willExpand: S });
59545
+ }, A = (m, w, C) => {
59546
+ var S;
59547
+ m.guid !== ((S = t.activeChild) == null ? void 0 : S.guid) && (n("update:activeBuild", C.guid), n("update:activeChild", m), n("toggle-show", { child: m, childArray: w, parentItem: C }));
59548
+ }, y = (m, w, C) => {
59549
+ p(m) || (n("update:activeTransparent", m), o.value = /* @__PURE__ */ new Set([m.guid]), n("toggle-transparent", { child: m, childArray: w, parentItem: C, transparent: !0 }));
59534
59550
  };
59535
- return (d, g) => (Z(), K("div", iae, [
59536
- r.loading ? (Z(), K("div", oae, "加载中...")) : (Z(!0), K(Ut, { key: 1 }, _t(r.buildingList, (A, y) => (Z(), K("div", {
59537
- key: o(A, y),
59551
+ return (m, w) => (Z(), K("div", iae, [
59552
+ r.loading ? (Z(), K("div", oae, "加载中...")) : (Z(!0), K(Ut, { key: 1 }, _t(r.buildingList, (C, S) => (Z(), K("div", {
59553
+ key: s(C, S),
59538
59554
  class: "building-group"
59539
59555
  }, [
59540
59556
  X("div", {
59541
59557
  class: "building-group-title",
59542
- onClick: ys((m) => f(A, y), ["stop"])
59558
+ onClick: ys((b) => v(C, S), ["stop"])
59543
59559
  }, [
59544
59560
  X("div", {
59545
- class: st(["title-text", { active: A.guid === r.activeBuild }])
59546
- }, ze(A.name), 3),
59561
+ class: st(["title-text", { active: C.guid === r.activeBuild }])
59562
+ }, ze(C.name), 3),
59547
59563
  X("div", lae, [
59548
59564
  X("i", {
59549
59565
  class: "smart-ui-icons smart-ui-icon-building",
59550
59566
  title: "重置",
59551
- onClick: ys((m) => c(A, y), ["stop"])
59567
+ onClick: ys((b) => d(C, S), ["stop"])
59552
59568
  }, null, 8, uae),
59553
59569
  X("i", {
59554
59570
  class: "layer-icon smart-ui-icons smart-ui-icon-layer",
59555
- title: l(A, y) ? "折叠" : "展开",
59556
- onClick: ys((m) => h(A, y), ["stop"])
59571
+ title: u(C, S) ? "折叠" : "展开",
59572
+ onClick: ys((b) => g(C, S), ["stop"])
59557
59573
  }, null, 8, fae),
59558
- (A.childArray || []).length > 0 ? (Z(), K("i", {
59574
+ (C.childArray || []).length > 0 ? (Z(), K("i", {
59559
59575
  key: 0,
59560
- class: st(["toggle-icon smart-ui-icons smart-ui-icon-jiantou-you", { "is-expanded": s(A, y) }]),
59561
- onClick: ys((m) => u(A, y), ["stop"])
59576
+ class: st(["toggle-icon smart-ui-icons smart-ui-icon-jiantou-you", { "is-expanded": l(C, S) }]),
59577
+ onClick: ys((b) => h(C, S), ["stop"])
59562
59578
  }, null, 10, cae)) : Ve("", !0)
59563
59579
  ])
59564
59580
  ], 8, sae),
59565
- (Z(!0), K(Ut, null, _t(((A == null ? void 0 : A.childArray) || []).slice(1), (m) => {
59566
- var w, C, S, b, x;
59581
+ (Z(!0), K(Ut, null, _t(((C == null ? void 0 : C.childArray) || []).slice(1), (b) => {
59582
+ var x, D, P;
59567
59583
  return dI((Z(), K("div", {
59568
- key: m.guid,
59569
- class: st([
59570
- "building-item",
59571
- { active: m.guid === ((w = r.activeChild) == null ? void 0 : w.guid) }
59572
- ])
59584
+ key: b.guid,
59585
+ class: st(["building-item", { active: b.guid === ((x = r.activeChild) == null ? void 0 : x.guid) }])
59573
59586
  }, [
59574
- X("span", null, ze(m.name), 1),
59587
+ X("span", null, ze(b.name), 1),
59575
59588
  X("span", hae, [
59576
59589
  X("i", {
59577
- class: st(["smart-ui-icons", m.guid === ((C = r.activeChild) == null ? void 0 : C.guid) ? "smart-ui-icon-transparent" : "smart-ui-icon-no-transparent"]),
59578
- title: m.guid === ((S = r.activeChild) == null ? void 0 : S.guid) ? "透明" : "不透明",
59579
- onClick: ys((D) => p(m, (A == null ? void 0 : A.childArray) || [], A), ["stop"])
59590
+ class: st(["smart-ui-icons", p(b) ? "smart-ui-icon-transparent" : "smart-ui-icon-no-transparent"]),
59591
+ title: p(b) ? "" : "透明",
59592
+ onClick: ys((T) => y(b, (C == null ? void 0 : C.childArray) || [], C), ["stop"])
59580
59593
  }, null, 10, vae),
59581
59594
  X("i", {
59582
- class: st(["smart-ui-icons", m.guid === ((b = r.activeChild) == null ? void 0 : b.guid) ? "smart-ui-icon-yanjing-kai" : "smart-ui-icon-yanjing-bi"]),
59583
- title: m.guid === ((x = r.activeChild) == null ? void 0 : x.guid) ? "显示" : "隐藏",
59584
- onClick: ys((D) => v(m, (A == null ? void 0 : A.childArray) || [], A), ["stop"])
59595
+ class: st(["smart-ui-icons", b.guid === ((D = r.activeChild) == null ? void 0 : D.guid) ? "smart-ui-icon-yanjing-kai" : "smart-ui-icon-yanjing-bi"]),
59596
+ title: b.guid === ((P = r.activeChild) == null ? void 0 : P.guid) ? "" : "显示",
59597
+ onClick: ys((T) => A(b, (C == null ? void 0 : C.childArray) || [], C), ["stop"])
59585
59598
  }, null, 10, pae)
59586
59599
  ])
59587
59600
  ], 2)), [
59588
- [gI, s(A, y)]
59601
+ [gI, l(C, S)]
59589
59602
  ]);
59590
59603
  }), 128))
59591
59604
  ]))), 128))
59592
59605
  ]));
59593
59606
  }
59594
- }, O0 = /* @__PURE__ */ De(dae, [["__scopeId", "data-v-3bbbde29"]]);
59607
+ }, O0 = /* @__PURE__ */ De(dae, [["__scopeId", "data-v-f1f9b1f7"]]);
59595
59608
  O0.install = (r) => {
59596
59609
  r.component("BuildList", O0);
59597
59610
  };