com-angel-authorization 1.0.28 → 1.0.30
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/README.md +2 -0
- package/dist/index.cjs +24 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +24 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +29 -9
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +8 -1
- package/dist/react/index.d.ts +8 -1
- package/dist/react/index.js +29 -9
- package/dist/react/index.js.map +1 -1
- package/dist/vue/index.cjs +29 -15
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +8 -1
- package/dist/vue/index.d.ts +8 -1
- package/dist/vue/index.js +29 -15
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
package/dist/vue/index.cjs
CHANGED
|
@@ -584,6 +584,23 @@ function toStringArray(value) {
|
|
|
584
584
|
}
|
|
585
585
|
return [];
|
|
586
586
|
}
|
|
587
|
+
function mapMenuPermissionPoints(value) {
|
|
588
|
+
if (!Array.isArray(value)) return void 0;
|
|
589
|
+
const points = value.map((item) => {
|
|
590
|
+
if (!item || typeof item !== "object") return null;
|
|
591
|
+
const row = item;
|
|
592
|
+
const name = String(row.name ?? "").trim();
|
|
593
|
+
if (!name) return null;
|
|
594
|
+
const resourceId = row.resourceId ?? row.resource_id ?? row.id;
|
|
595
|
+
const identification = row.identification ?? row.identity;
|
|
596
|
+
return {
|
|
597
|
+
...resourceId !== void 0 && resourceId !== null && resourceId !== "" ? { resourceId: String(resourceId) } : {},
|
|
598
|
+
name,
|
|
599
|
+
...identification !== void 0 && identification !== null && identification !== "" ? { identification: String(identification) } : {}
|
|
600
|
+
};
|
|
601
|
+
}).filter((item) => item !== null);
|
|
602
|
+
return points.length ? points : void 0;
|
|
603
|
+
}
|
|
587
604
|
function toMenuType(value) {
|
|
588
605
|
const v = String(value ?? "").toLowerCase();
|
|
589
606
|
if (v === MENU_TYPE_PAGE || v === MENU_TYPE_MENU || v === MENU_TYPE_BUTTON) {
|
|
@@ -611,11 +628,14 @@ function mapMenuResource(item) {
|
|
|
611
628
|
const row = item;
|
|
612
629
|
const resourceId = row.resourceId ?? row.resource_id ?? row.id;
|
|
613
630
|
if (resourceId === void 0 || resourceId === null || resourceId === "") return null;
|
|
631
|
+
const permissionPoints = mapMenuPermissionPoints(
|
|
632
|
+
row.permissionPoints ?? row.permission_points
|
|
633
|
+
);
|
|
614
634
|
const permissionPointIds = toStringArray(
|
|
615
|
-
row.permissionPointIds ?? row.permission_point_ids ??
|
|
635
|
+
row.permissionPointIds ?? row.permission_point_ids ?? (permissionPoints?.length ? permissionPoints.map((p) => p.resourceId).filter(Boolean) : void 0) ?? row.permissions
|
|
616
636
|
);
|
|
617
637
|
const permissionNamesRaw = row.permissionPointNames ?? row.permission_point_names ?? row.permissionNames;
|
|
618
|
-
const permissionPointNames = Array.isArray(permissionNamesRaw) ? permissionNamesRaw.map((n) => String(n ?? "")).filter(Boolean) :
|
|
638
|
+
const permissionPointNames = Array.isArray(permissionNamesRaw) ? permissionNamesRaw.map((n) => String(n ?? "")).filter(Boolean) : permissionPoints?.map((p) => p.name).filter(Boolean);
|
|
619
639
|
const rawParentId = row.parentId ?? row.parent_id ?? (row.parent && typeof row.parent === "object" ? row.parent.resourceId ?? row.parent.resource_id ?? row.parent.id : void 0);
|
|
620
640
|
const parentId = rawParentId === void 0 || rawParentId === null || rawParentId === "" || String(rawParentId) === "0" ? null : String(rawParentId);
|
|
621
641
|
const rawDepth = row.depth;
|
|
@@ -635,7 +655,8 @@ function mapMenuResource(item) {
|
|
|
635
655
|
name: String(row.name ?? ""),
|
|
636
656
|
identification: String(row.identification ?? row.identity ?? row.path ?? ""),
|
|
637
657
|
permissionPointIds,
|
|
638
|
-
|
|
658
|
+
permissionPoints,
|
|
659
|
+
permissionPointNames: permissionPointNames && permissionPointNames.length ? permissionPointNames : void 0,
|
|
639
660
|
status: toResourceStatus(row.status),
|
|
640
661
|
sort
|
|
641
662
|
};
|
|
@@ -2038,6 +2059,9 @@ var MenuManager = (0, import_vue4.defineComponent)({
|
|
|
2038
2059
|
form.permissionPointIds = exists ? form.permissionPointIds.filter((x) => x !== id) : [...form.permissionPointIds, id];
|
|
2039
2060
|
}
|
|
2040
2061
|
function renderPermissionLabels(row) {
|
|
2062
|
+
if (row.permissionPoints?.length) {
|
|
2063
|
+
return row.permissionPoints.map((p) => p.name).filter(Boolean).join("\u3001") || "\u2014";
|
|
2064
|
+
}
|
|
2041
2065
|
if (row.permissionPointNames?.length) {
|
|
2042
2066
|
return row.permissionPointNames.join("\u3001");
|
|
2043
2067
|
}
|
|
@@ -2219,15 +2243,14 @@ var MenuManager = (0, import_vue4.defineComponent)({
|
|
|
2219
2243
|
]),
|
|
2220
2244
|
dialogOpen.value ? (0, import_vue4.h)(
|
|
2221
2245
|
"div",
|
|
2222
|
-
{ style: s2.mask
|
|
2246
|
+
{ style: s2.mask },
|
|
2223
2247
|
[
|
|
2224
2248
|
(0, import_vue4.h)(
|
|
2225
2249
|
"div",
|
|
2226
2250
|
{
|
|
2227
2251
|
style: { ...s2.dialog, maxWidth: "520px" },
|
|
2228
2252
|
role: "dialog",
|
|
2229
|
-
"aria-modal": "true"
|
|
2230
|
-
onClick: (e) => e.stopPropagation()
|
|
2253
|
+
"aria-modal": "true"
|
|
2231
2254
|
},
|
|
2232
2255
|
[
|
|
2233
2256
|
(0, import_vue4.h)("div", { style: s2.dialogHeader }, [
|
|
@@ -2414,15 +2437,6 @@ var MenuManager = (0, import_vue4.defineComponent)({
|
|
|
2414
2437
|
)
|
|
2415
2438
|
]),
|
|
2416
2439
|
(0, import_vue4.h)("div", { style: s2.dialogFooter }, [
|
|
2417
|
-
(0, import_vue4.h)(
|
|
2418
|
-
"button",
|
|
2419
|
-
{
|
|
2420
|
-
type: "button",
|
|
2421
|
-
style: s2.secondaryBtn,
|
|
2422
|
-
onClick: closeDialog
|
|
2423
|
-
},
|
|
2424
|
-
"\u53D6\u6D88"
|
|
2425
|
-
),
|
|
2426
2440
|
(0, import_vue4.h)(
|
|
2427
2441
|
"button",
|
|
2428
2442
|
{
|