@yqg/permission 1.3.0-alpha.0 → 1.3.0-alpha.10

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.
@@ -1,4 +1,4 @@
1
- import { F as Ce, i as Fn, C as Eu, T as hs, p as Se, c as b, a as ue, r as L, d as N, u as J, s as z, w as q, g as Ro, b as je, o as Le, t as hu, e as v, h as jt, f as jn, j as vu, k as At, l as Oe, m as vs, n as Lt, q as be, v as ko, x as CA, y as Iu, z as No, A as ni, B as mu, D as Is, E as ms, G as Ne, H as Qs, I as Qu, J as wu, K as st, L as oi, M as lt, N as ge, O as yu, P as ln, Q as bu, R as $e, S as Gn, U as ar, V as Pu } from "./index-wLkVeDMW.js";
1
+ import { F as Ce, i as Fn, C as Eu, T as hs, p as Se, c as b, a as ue, r as L, d as N, u as J, s as z, w as q, g as Ro, b as je, o as Le, t as hu, e as v, h as jt, f as jn, j as vu, k as At, l as Oe, m as vs, n as Lt, q as be, v as ko, x as CA, y as Iu, z as No, A as ni, B as mu, D as Is, E as ms, G as Ne, H as Qs, I as Qu, J as wu, K as st, L as oi, M as lt, N as ge, O as yu, P as ln, Q as bu, R as $e, S as Gn, U as ar, V as Pu } from "./index-XvlOgi6s.js";
2
2
  function Qn(e) {
3
3
  "@babel/helpers - typeof";
4
4
  return Qn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
@@ -14399,8 +14399,8 @@ const Cn = "/crane", e0 = {
14399
14399
  categoryTips: "当前您所拥有的数据范围如下:",
14400
14400
  empty: "空",
14401
14401
  category: "数据权限",
14402
- categotySelectTips: "上方选中的权限包含数据权限,请根据实际工作需要申请/更改数据范围",
14403
- categoryChangeTips: "提醒:您选择的数据权限范围较大!请确认实际工作场景是否需要全量「部门」权限,并在申请理由中写明,避免审批不通过!",
14402
+ categotySelectTips: "上方选中的权限包含数据权限,请根据实际工作需要申请/更改数据范围。",
14403
+ categoryChangeTips: "提醒:您选择的数据权限范围较大!请确认实际工作场景是否需要全量「{category}」权限,并在申请理由中写明,避免审批不通过!",
14404
14404
  availiables: {
14405
14405
  SEVEN_DAYS: "7天",
14406
14406
  THIRTY_DAYS: "30天",
@@ -14428,7 +14428,7 @@ const Cn = "/crane", e0 = {
14428
14428
  "zh-CN": n0,
14429
14429
  "en-US": t0
14430
14430
  }, Me = (e, t) => {
14431
- const n = localStorage.getItem("permission_locale") || "en-US", o = e.split(".");
14431
+ const n = localStorage.getItem("permission_locale") || "zh-CN", o = e.split(".");
14432
14432
  let r = Es[n] || Es["en-US"];
14433
14433
  for (let A = 0; A < o.length; A++)
14434
14434
  r = r[o[A]];
@@ -14548,9 +14548,7 @@ const a0 = {
14548
14548
  };
14549
14549
  function s0(e) {
14550
14550
  function t(i, a, l) {
14551
- return i.sort((s, c) => (a.get(s.businessApplyType) ?? 0) - (a.get(c.businessApplyType) ?? 0) || (l.get(s.securityLevel) ?? 0) - (l.get(c.securityLevel) ?? 0)), i.forEach((s) => {
14552
- s.key = s.feature, s.desc = "ddddd", s.children || (s.categoryVOS = (s.categoryVOS || []).filter((c) => c.configWay !== a0.AUTO), [ft.NO].includes(s.businessApplyType) && (s.disabled = !0), [ft.OWNER, ft.PENDING].includes(s.businessApplyType) && !s.categoryVOS.length && (s.disabled = !0)), s.children && s.children.length > 0 && t(s.children, a, l);
14553
- }), i;
14551
+ return i.map((s) => (s.key = s.feature, !s.children || s.children.length === 0 ? (s.categoryVOS = (s.categoryVOS || []).filter((c) => c.configWay !== a0.AUTO), [ft.NO, ft.PENDING].includes(s.businessApplyType) && (s.disabled = !0), [ft.OWNER].includes(s.businessApplyType) && !s.categoryVOS.length && (s.disabled = !0)) : (s.children = t(s.children, a, l), s.children.every((c) => c.disabled) && (s.disabled = !0)), s)).sort((s, c) => (a.get(s.businessApplyType) ?? 0) - (a.get(c.businessApplyType) ?? 0) || (l.get(s.securityLevel) ?? 0) - (l.get(c.securityLevel) ?? 0));
14554
14552
  }
14555
14553
  const n = [null, ft.TEMP_OWNER, ft.PENDING, ft.OWNER, ft.NO], o = [null, "L1", "L2", "L3"], r = new Map(n.map((i, a) => [i, a])), A = new Map(o.map((i, a) => [i, a]));
14556
14554
  return t(e, r, A);
@@ -14599,37 +14597,36 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14599
14597
  CUSTOM: "custom"
14600
14598
  };
14601
14599
  Ge.config({ prefixCls: "yqg-permission-message" });
14602
- const r = Pu(() => import("./apply-modal-CpmDDWWV.js").then((m) => m.k)), A = t, i = e, a = L(!1), l = L(), s = L(!1);
14600
+ const r = Pu(() => import("./apply-modal-Ct9rKeUf.js").then((h) => h.k)), A = t, i = e, a = L(!1), l = L(), s = L(!1);
14603
14601
  let c = L([]), u = L({
14604
14602
  imageUrl: Bo,
14605
14603
  status: ""
14606
14604
  });
14607
14605
  const g = b(() => {
14608
- var m, w;
14609
- return c.value = [], Array.isArray(i.permissions) ? i.permissions.filter((P) => P.trim()) : ((w = (m = i.permissions) == null ? void 0 : m.split(",")) == null ? void 0 : w.filter((P) => P.trim())) || [];
14610
- }), d = b(() => {
14611
- const m = g.value[0] || "";
14612
- return m ? m.split(".")[0] : "";
14613
- }), f = () => {
14614
- var w;
14615
- const m = (w = l.value) == null ? void 0 : w.oaFlowUrl;
14616
- m && window.open(m, "_blank");
14617
- }, p = async () => {
14618
- const { workNumber: m } = i, w = g.value;
14619
- if (!(w != null && w.length) || !m) return;
14620
- const P = {
14621
- workNumber: m,
14622
- features: w.toString()
14606
+ var h, m;
14607
+ return c.value = [], Array.isArray(i.permissions) ? i.permissions.filter((w) => w.trim()) : ((m = (h = i.permissions) == null ? void 0 : h.split(",")) == null ? void 0 : m.filter((w) => w.trim())) || [];
14608
+ }), d = () => {
14609
+ var m;
14610
+ const h = (m = l.value) == null ? void 0 : m.oaFlowUrl;
14611
+ h && window.open(h, "_blank");
14612
+ }, f = async () => {
14613
+ const { workNumber: h } = i, m = g.value;
14614
+ if (!(m != null && m.length) || !h) return;
14615
+ const w = {
14616
+ workNumber: h,
14617
+ features: m.toString()
14623
14618
  };
14624
14619
  s.value = !0;
14625
- const D = await e0.getPermissions(P);
14626
- c.value = s0(D.body || []), u.value = i0(c.value, l), s.value = !1;
14627
- }, B = () => {
14628
- p(), a.value = !a.value;
14629
- }, { currentTop: E, dragElement: h } = r0(i, B);
14630
- return je(p), q(() => i.locale, (m, w) => {
14631
- m !== w && localStorage.setItem("permission_locale", i.locale);
14632
- }, { immediate: !0 }), (m, w) => (st(), oi(J(Ft), {
14620
+ const P = await e0.getPermissions(w);
14621
+ c.value = s0(P.body || []), u.value = i0(c.value, l), s.value = !1;
14622
+ }, p = () => {
14623
+ a.value = !a.value, f();
14624
+ }, { currentTop: B, dragElement: E } = r0(i, p);
14625
+ return je(() => {
14626
+ i.type === o.DEFAULT && f();
14627
+ }), q(() => i.locale, (h, m) => {
14628
+ h !== m && localStorage.setItem("permission_locale", i.locale);
14629
+ }, { immediate: !0 }), (h, m) => (st(), oi(J(Ft), {
14633
14630
  prefixCls: "yqg-permission",
14634
14631
  theme: {
14635
14632
  token: {
@@ -14642,12 +14639,12 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14642
14639
  [o.FLOATBUTTON, o.TEXT].includes(e.type) ? (st(), oi(J(ot), {
14643
14640
  key: 0,
14644
14641
  ref_key: "dragElement",
14645
- ref: h,
14642
+ ref: E,
14646
14643
  type: "primary",
14647
14644
  tooltip: J(Me)("clickToApply"),
14648
14645
  style: yu({
14649
14646
  right: I0,
14650
- top: J(E)
14647
+ top: J(B)
14651
14648
  })
14652
14649
  }, {
14653
14650
  icon: lt(() => [
@@ -14660,9 +14657,9 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14660
14657
  _: 1
14661
14658
  }, 8, ["tooltip", "style"])) : e.type === o.CUSTOM ? (st(), ln("div", {
14662
14659
  key: 1,
14663
- onClick: B
14660
+ onClick: p
14664
14661
  }, [
14665
- bu(m.$slots, "custom", {}, void 0, !0)
14662
+ bu(h.$slots, "custom", {}, void 0, !0)
14666
14663
  ])) : (st(), ln(Ce, { key: 2 }, [
14667
14664
  J(u).status === n.DEFAULT ? (st(), ln(Ce, { key: 0 }, [
14668
14665
  ge("img", {
@@ -14675,7 +14672,7 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14675
14672
  ge("div", null, [
14676
14673
  v(J(Qt), {
14677
14674
  type: "primary",
14678
- onClick: B
14675
+ onClick: p
14679
14676
  }, {
14680
14677
  default: lt(() => [
14681
14678
  Gn("+ " + $e(J(Me)("applyPermission")), 1)
@@ -14702,7 +14699,7 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14702
14699
  ge("div", null, [
14703
14700
  v(J(Qt), {
14704
14701
  class: "crane-margin-right10",
14705
- onClick: f
14702
+ onClick: d
14706
14703
  }, {
14707
14704
  default: lt(() => [
14708
14705
  Gn($e(J(Me)("viewApprovalDetail")), 1)
@@ -14711,7 +14708,7 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14711
14708
  }),
14712
14709
  v(J(Qt), {
14713
14710
  type: "primary",
14714
- onClick: B
14711
+ onClick: p
14715
14712
  }, {
14716
14713
  default: lt(() => [
14717
14714
  Gn("+ " + $e(J(Me)("applyMore")), 1)
@@ -14744,14 +14741,13 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14744
14741
  ]),
14745
14742
  v(J(r), {
14746
14743
  modelValue: a.value,
14747
- "onUpdate:modelValue": w[0] || (w[0] = (P) => a.value = P),
14744
+ "onUpdate:modelValue": m[0] || (m[0] = (w) => a.value = w),
14748
14745
  permissionList: J(c),
14749
14746
  spining: s.value,
14750
14747
  workNumber: e.workNumber,
14751
- businessCode: d.value,
14752
- onOnSuccess: w[1] || (w[1] = () => A("onSuccess")),
14753
- onOnSubmit: p
14754
- }, null, 8, ["modelValue", "permissionList", "spining", "workNumber", "businessCode"])
14748
+ onOnSuccess: m[1] || (m[1] = () => A("onSuccess")),
14749
+ onOnSubmit: f
14750
+ }, null, 8, ["modelValue", "permissionList", "spining", "workNumber"])
14755
14751
  ]),
14756
14752
  _: 3
14757
14753
  }, 8, ["theme"]));
@@ -14761,7 +14757,7 @@ const l0 = { class: "crane-wraper" }, c0 = ["src"], u0 = ["src"], g0 = { class:
14761
14757
  for (const [o, r] of t)
14762
14758
  n[o] = r;
14763
14759
  return n;
14764
- }, w0 = /* @__PURE__ */ Q0(m0, [["__scopeId", "data-v-5b58dd59"]]), F0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14760
+ }, w0 = /* @__PURE__ */ Q0(m0, [["__scopeId", "data-v-1b3b9804"]]), F0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14765
14761
  __proto__: null,
14766
14762
  default: w0
14767
14763
  }, Symbol.toStringTag, { value: "Module" }));
@@ -14822,9 +14818,9 @@ export {
14822
14818
  bl as aN,
14823
14819
  ci as aO,
14824
14820
  Me as aP,
14825
- Q0 as aQ,
14826
- jA as aR,
14827
- vv as aS,
14821
+ jA as aQ,
14822
+ vv as aR,
14823
+ Q0 as aS,
14828
14824
  o0 as aT,
14829
14825
  e0 as aU,
14830
14826
  N0 as aV,