com-angel-authorization 1.0.24 → 1.0.26
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 -1
- package/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +37 -14
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +4 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +37 -14
- package/dist/react/index.js.map +1 -1
- package/dist/vue/index.cjs +36 -12
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +4 -0
- package/dist/vue/index.d.ts +4 -0
- package/dist/vue/index.js +36 -12
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
package/dist/vue/index.cjs
CHANGED
|
@@ -623,6 +623,9 @@ function mapMenuResource(item) {
|
|
|
623
623
|
const depth = Number.isFinite(parsedDepth) && parsedDepth > 0 ? Math.floor(parsedDepth) : parentId ? ROOT_MENU_DEPTH + 1 : ROOT_MENU_DEPTH;
|
|
624
624
|
const rawLeaf = row.leaf;
|
|
625
625
|
const leaf = rawLeaf === true || rawLeaf === 1 || rawLeaf === "1" || String(rawLeaf).toLowerCase() === "true" ? MENU_LEAF_YES : Number(rawLeaf) === MENU_LEAF_YES ? MENU_LEAF_YES : 0;
|
|
626
|
+
const rawSort = row.sort ?? row.order ?? row.sortOrder ?? row.sort_order;
|
|
627
|
+
const parsedSort = Number(rawSort);
|
|
628
|
+
const sort = Number.isFinite(parsedSort) ? Math.floor(parsedSort) : 0;
|
|
626
629
|
return {
|
|
627
630
|
resourceId: String(resourceId),
|
|
628
631
|
parentId,
|
|
@@ -633,7 +636,8 @@ function mapMenuResource(item) {
|
|
|
633
636
|
identification: String(row.identification ?? row.identity ?? row.path ?? ""),
|
|
634
637
|
permissionPointIds,
|
|
635
638
|
permissionPointNames,
|
|
636
|
-
status: toResourceStatus(row.status)
|
|
639
|
+
status: toResourceStatus(row.status),
|
|
640
|
+
sort
|
|
637
641
|
};
|
|
638
642
|
}
|
|
639
643
|
function isMenuLeaf(row) {
|
|
@@ -687,7 +691,8 @@ function buildCreateMenuBody(values, resourceId = getAppClientId()) {
|
|
|
687
691
|
name: values.name.trim(),
|
|
688
692
|
identification: values.identification.trim(),
|
|
689
693
|
permissionPointIds: [...values.permissionPointIds],
|
|
690
|
-
status: values.status
|
|
694
|
+
status: values.status,
|
|
695
|
+
sort: Number.isFinite(Number(values.sort)) ? Math.floor(Number(values.sort)) : 0
|
|
691
696
|
};
|
|
692
697
|
}
|
|
693
698
|
function buildUpdateMenuBody(values) {
|
|
@@ -699,7 +704,8 @@ function buildUpdateMenuBody(values) {
|
|
|
699
704
|
name: values.name.trim(),
|
|
700
705
|
identification: values.identification.trim(),
|
|
701
706
|
permissionPointIds: [...values.permissionPointIds],
|
|
702
|
-
status: values.status
|
|
707
|
+
status: values.status,
|
|
708
|
+
sort: Number.isFinite(Number(values.sort)) ? Math.floor(Number(values.sort)) : 0
|
|
703
709
|
};
|
|
704
710
|
}
|
|
705
711
|
function createAuthorizationResourceApi(request) {
|
|
@@ -1509,7 +1515,8 @@ function emptyForm2() {
|
|
|
1509
1515
|
name: "",
|
|
1510
1516
|
identification: "",
|
|
1511
1517
|
permissionPointIds: [],
|
|
1512
|
-
status: RESOURCE_STATUS_ENABLED
|
|
1518
|
+
status: RESOURCE_STATUS_ENABLED,
|
|
1519
|
+
sort: 0
|
|
1513
1520
|
};
|
|
1514
1521
|
}
|
|
1515
1522
|
var s2 = {
|
|
@@ -1734,6 +1741,11 @@ var s2 = {
|
|
|
1734
1741
|
boxSizing: "border-box",
|
|
1735
1742
|
width: "100%"
|
|
1736
1743
|
},
|
|
1744
|
+
inputReadonly: {
|
|
1745
|
+
backgroundColor: "#f9fafb",
|
|
1746
|
+
color: "#667085",
|
|
1747
|
+
cursor: "not-allowed"
|
|
1748
|
+
},
|
|
1737
1749
|
control: {
|
|
1738
1750
|
width: "16px",
|
|
1739
1751
|
height: "16px",
|
|
@@ -1933,7 +1945,8 @@ var MenuManager = (0, import_vue4.defineComponent)({
|
|
|
1933
1945
|
name: row.name,
|
|
1934
1946
|
identification: row.identification,
|
|
1935
1947
|
permissionPointIds: [...row.permissionPointIds],
|
|
1936
|
-
status: row.status
|
|
1948
|
+
status: row.status,
|
|
1949
|
+
sort: Number.isFinite(row.sort) ? row.sort : 0
|
|
1937
1950
|
});
|
|
1938
1951
|
dialogOpen.value = true;
|
|
1939
1952
|
void loadPermissionPoints();
|
|
@@ -2209,14 +2222,10 @@ var MenuManager = (0, import_vue4.defineComponent)({
|
|
|
2209
2222
|
(0, import_vue4.h)(
|
|
2210
2223
|
"select",
|
|
2211
2224
|
{
|
|
2212
|
-
style: s2.input,
|
|
2225
|
+
style: { ...s2.input, ...s2.inputReadonly },
|
|
2213
2226
|
value: form.parentId ?? ROOT_PARENT_ID,
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
const parentId = value ? value : null;
|
|
2217
|
-
form.parentId = parentId;
|
|
2218
|
-
form.depth = resolveMenuDepth(parentId, allKnownMenus.value);
|
|
2219
|
-
}
|
|
2227
|
+
disabled: true,
|
|
2228
|
+
"aria-readonly": "true"
|
|
2220
2229
|
},
|
|
2221
2230
|
[
|
|
2222
2231
|
(0, import_vue4.h)("option", { value: ROOT_PARENT_ID }, "\u65E0"),
|
|
@@ -2263,6 +2272,21 @@ var MenuManager = (0, import_vue4.defineComponent)({
|
|
|
2263
2272
|
}
|
|
2264
2273
|
})
|
|
2265
2274
|
]),
|
|
2275
|
+
(0, import_vue4.h)("label", { style: s2.field }, [
|
|
2276
|
+
(0, import_vue4.h)("span", { style: s2.label }, "\u663E\u793A\u6392\u5E8F"),
|
|
2277
|
+
(0, import_vue4.h)("input", {
|
|
2278
|
+
style: s2.input,
|
|
2279
|
+
type: "number",
|
|
2280
|
+
value: form.sort,
|
|
2281
|
+
placeholder: "\u6570\u503C\u8D8A\u5C0F\u8D8A\u9760\u524D",
|
|
2282
|
+
onInput: (e) => {
|
|
2283
|
+
const value = Number(
|
|
2284
|
+
e.target.value
|
|
2285
|
+
);
|
|
2286
|
+
form.sort = Number.isFinite(value) ? Math.floor(value) : 0;
|
|
2287
|
+
}
|
|
2288
|
+
})
|
|
2289
|
+
]),
|
|
2266
2290
|
(0, import_vue4.h)("label", { style: s2.field }, [
|
|
2267
2291
|
(0, import_vue4.h)("span", { style: s2.label }, "\u8BF7\u6C42\u5730\u5740"),
|
|
2268
2292
|
(0, import_vue4.h)("input", {
|