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/react/index.d.cts
CHANGED
|
@@ -198,6 +198,8 @@ type MenuResource = {
|
|
|
198
198
|
/** 关联权限点名称(列表展示用,后端可能返回) */
|
|
199
199
|
permissionPointNames?: string[];
|
|
200
200
|
status: ResourceStatus;
|
|
201
|
+
/** 显示排序,数值越小越靠前 */
|
|
202
|
+
sort: number;
|
|
201
203
|
};
|
|
202
204
|
type MenuResourceFormValues = {
|
|
203
205
|
/** 上级菜单 ID;选择「无」时为 null */
|
|
@@ -209,6 +211,8 @@ type MenuResourceFormValues = {
|
|
|
209
211
|
identification: string;
|
|
210
212
|
permissionPointIds: string[];
|
|
211
213
|
status: ResourceStatus;
|
|
214
|
+
/** 显示排序 */
|
|
215
|
+
sort: number;
|
|
212
216
|
};
|
|
213
217
|
type CreateMenuResourceBody = MenuResourceFormValues & {
|
|
214
218
|
resourceId: string;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -198,6 +198,8 @@ type MenuResource = {
|
|
|
198
198
|
/** 关联权限点名称(列表展示用,后端可能返回) */
|
|
199
199
|
permissionPointNames?: string[];
|
|
200
200
|
status: ResourceStatus;
|
|
201
|
+
/** 显示排序,数值越小越靠前 */
|
|
202
|
+
sort: number;
|
|
201
203
|
};
|
|
202
204
|
type MenuResourceFormValues = {
|
|
203
205
|
/** 上级菜单 ID;选择「无」时为 null */
|
|
@@ -209,6 +211,8 @@ type MenuResourceFormValues = {
|
|
|
209
211
|
identification: string;
|
|
210
212
|
permissionPointIds: string[];
|
|
211
213
|
status: ResourceStatus;
|
|
214
|
+
/** 显示排序 */
|
|
215
|
+
sort: number;
|
|
212
216
|
};
|
|
213
217
|
type CreateMenuResourceBody = MenuResourceFormValues & {
|
|
214
218
|
resourceId: string;
|
package/dist/react/index.js
CHANGED
|
@@ -464,6 +464,9 @@ function mapMenuResource(item) {
|
|
|
464
464
|
const depth = Number.isFinite(parsedDepth) && parsedDepth > 0 ? Math.floor(parsedDepth) : parentId ? ROOT_MENU_DEPTH + 1 : ROOT_MENU_DEPTH;
|
|
465
465
|
const rawLeaf = row.leaf;
|
|
466
466
|
const leaf = rawLeaf === true || rawLeaf === 1 || rawLeaf === "1" || String(rawLeaf).toLowerCase() === "true" ? MENU_LEAF_YES : Number(rawLeaf) === MENU_LEAF_YES ? MENU_LEAF_YES : 0;
|
|
467
|
+
const rawSort = row.sort ?? row.order ?? row.sortOrder ?? row.sort_order;
|
|
468
|
+
const parsedSort = Number(rawSort);
|
|
469
|
+
const sort = Number.isFinite(parsedSort) ? Math.floor(parsedSort) : 0;
|
|
467
470
|
return {
|
|
468
471
|
resourceId: String(resourceId),
|
|
469
472
|
parentId,
|
|
@@ -474,7 +477,8 @@ function mapMenuResource(item) {
|
|
|
474
477
|
identification: String(row.identification ?? row.identity ?? row.path ?? ""),
|
|
475
478
|
permissionPointIds,
|
|
476
479
|
permissionPointNames,
|
|
477
|
-
status: toResourceStatus(row.status)
|
|
480
|
+
status: toResourceStatus(row.status),
|
|
481
|
+
sort
|
|
478
482
|
};
|
|
479
483
|
}
|
|
480
484
|
function isMenuLeaf(row) {
|
|
@@ -528,7 +532,8 @@ function buildCreateMenuBody(values, resourceId = getAppClientId()) {
|
|
|
528
532
|
name: values.name.trim(),
|
|
529
533
|
identification: values.identification.trim(),
|
|
530
534
|
permissionPointIds: [...values.permissionPointIds],
|
|
531
|
-
status: values.status
|
|
535
|
+
status: values.status,
|
|
536
|
+
sort: Number.isFinite(Number(values.sort)) ? Math.floor(Number(values.sort)) : 0
|
|
532
537
|
};
|
|
533
538
|
}
|
|
534
539
|
function buildUpdateMenuBody(values) {
|
|
@@ -540,7 +545,8 @@ function buildUpdateMenuBody(values) {
|
|
|
540
545
|
name: values.name.trim(),
|
|
541
546
|
identification: values.identification.trim(),
|
|
542
547
|
permissionPointIds: [...values.permissionPointIds],
|
|
543
|
-
status: values.status
|
|
548
|
+
status: values.status,
|
|
549
|
+
sort: Number.isFinite(Number(values.sort)) ? Math.floor(Number(values.sort)) : 0
|
|
544
550
|
};
|
|
545
551
|
}
|
|
546
552
|
function createAuthorizationResourceApi(request) {
|
|
@@ -1221,7 +1227,8 @@ var emptyForm2 = () => ({
|
|
|
1221
1227
|
name: "",
|
|
1222
1228
|
identification: "",
|
|
1223
1229
|
permissionPointIds: [],
|
|
1224
|
-
status: RESOURCE_STATUS_ENABLED
|
|
1230
|
+
status: RESOURCE_STATUS_ENABLED,
|
|
1231
|
+
sort: 0
|
|
1225
1232
|
});
|
|
1226
1233
|
function MenuManager({
|
|
1227
1234
|
api,
|
|
@@ -1365,7 +1372,8 @@ function MenuManager({
|
|
|
1365
1372
|
name: row.name,
|
|
1366
1373
|
identification: row.identification,
|
|
1367
1374
|
permissionPointIds: [...row.permissionPointIds],
|
|
1368
|
-
status: row.status
|
|
1375
|
+
status: row.status,
|
|
1376
|
+
sort: Number.isFinite(row.sort) ? row.sort : 0
|
|
1369
1377
|
});
|
|
1370
1378
|
setDialogOpen(true);
|
|
1371
1379
|
void loadPermissionPoints();
|
|
@@ -1563,16 +1571,10 @@ function MenuManager({
|
|
|
1563
1571
|
/* @__PURE__ */ jsxs2(
|
|
1564
1572
|
"select",
|
|
1565
1573
|
{
|
|
1566
|
-
style: styles2.input,
|
|
1574
|
+
style: { ...styles2.input, ...styles2.inputReadonly },
|
|
1567
1575
|
value: form.parentId ?? ROOT_PARENT_ID,
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
setForm((prev) => ({
|
|
1571
|
-
...prev,
|
|
1572
|
-
parentId,
|
|
1573
|
-
depth: resolveMenuDepth(parentId, allKnownMenus)
|
|
1574
|
-
}));
|
|
1575
|
-
},
|
|
1576
|
+
disabled: true,
|
|
1577
|
+
"aria-readonly": "true",
|
|
1576
1578
|
children: [
|
|
1577
1579
|
/* @__PURE__ */ jsx3("option", { value: ROOT_PARENT_ID, children: "\u65E0" }),
|
|
1578
1580
|
parentOptions.map((opt) => /* @__PURE__ */ jsx3("option", { value: opt.value, children: opt.label }, opt.value))
|
|
@@ -1612,6 +1614,22 @@ function MenuManager({
|
|
|
1612
1614
|
}
|
|
1613
1615
|
)
|
|
1614
1616
|
] }),
|
|
1617
|
+
/* @__PURE__ */ jsxs2("label", { style: styles2.field, children: [
|
|
1618
|
+
/* @__PURE__ */ jsx3("span", { style: styles2.label, children: "\u663E\u793A\u6392\u5E8F" }),
|
|
1619
|
+
/* @__PURE__ */ jsx3(
|
|
1620
|
+
"input",
|
|
1621
|
+
{
|
|
1622
|
+
style: styles2.input,
|
|
1623
|
+
type: "number",
|
|
1624
|
+
value: form.sort,
|
|
1625
|
+
onChange: (e) => setForm((prev) => ({
|
|
1626
|
+
...prev,
|
|
1627
|
+
sort: Number.isFinite(Number(e.target.value)) ? Math.floor(Number(e.target.value)) : 0
|
|
1628
|
+
})),
|
|
1629
|
+
placeholder: "\u6570\u503C\u8D8A\u5C0F\u8D8A\u9760\u524D"
|
|
1630
|
+
}
|
|
1631
|
+
)
|
|
1632
|
+
] }),
|
|
1615
1633
|
/* @__PURE__ */ jsxs2("label", { style: styles2.field, children: [
|
|
1616
1634
|
/* @__PURE__ */ jsx3("span", { style: styles2.label, children: "\u8BF7\u6C42\u5730\u5740" }),
|
|
1617
1635
|
/* @__PURE__ */ jsx3(
|
|
@@ -1922,6 +1940,11 @@ var styles2 = {
|
|
|
1922
1940
|
boxSizing: "border-box",
|
|
1923
1941
|
width: "100%"
|
|
1924
1942
|
},
|
|
1943
|
+
inputReadonly: {
|
|
1944
|
+
backgroundColor: "#f9fafb",
|
|
1945
|
+
color: "#667085",
|
|
1946
|
+
cursor: "not-allowed"
|
|
1947
|
+
},
|
|
1925
1948
|
control: {
|
|
1926
1949
|
width: 16,
|
|
1927
1950
|
height: 16,
|