com-angel-authorization 1.0.22 → 1.0.23

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.
@@ -1342,9 +1342,17 @@ function MenuManager({
1342
1342
  void loadList("current", "");
1343
1343
  void loadPermissionPoints();
1344
1344
  }, [api, pageSize]);
1345
- const openCreate = () => {
1345
+ const openCreate = (parent) => {
1346
1346
  setEditing(null);
1347
- setForm(emptyForm2());
1347
+ if (parent) {
1348
+ setForm({
1349
+ ...emptyForm2(),
1350
+ parentId: parent.resourceId,
1351
+ depth: resolveMenuDepth(parent.resourceId, allKnownMenus)
1352
+ });
1353
+ } else {
1354
+ setForm(emptyForm2());
1355
+ }
1348
1356
  setDialogOpen(true);
1349
1357
  void loadPermissionPoints();
1350
1358
  };
@@ -1427,7 +1435,7 @@ function MenuManager({
1427
1435
  /* @__PURE__ */ jsx3("h2", { style: styles2.title, children: title }),
1428
1436
  /* @__PURE__ */ jsxs2("div", { style: styles2.toolbarRight, children: [
1429
1437
  toolbarExtra,
1430
- /* @__PURE__ */ jsx3("button", { type: "button", style: styles2.primaryBtn, onClick: openCreate, children: "\u65B0\u589E" })
1438
+ /* @__PURE__ */ jsx3("button", { type: "button", style: styles2.primaryBtn, onClick: () => openCreate(), children: "\u65B0\u589E" })
1431
1439
  ] })
1432
1440
  ] }),
1433
1441
  error ? /* @__PURE__ */ jsx3("div", { style: styles2.error, children: error }) : null,
@@ -1438,7 +1446,7 @@ function MenuManager({
1438
1446
  /* @__PURE__ */ jsx3("th", { style: { ...styles2.th, width: 90 }, children: "\u7C7B\u578B" }),
1439
1447
  /* @__PURE__ */ jsx3("th", { style: { ...styles2.th, width: 80 }, children: "\u53EF\u89C1" }),
1440
1448
  /* @__PURE__ */ jsx3("th", { style: styles2.th, children: "\u6743\u9650\u6807\u8BC6" }),
1441
- /* @__PURE__ */ jsx3("th", { style: { ...styles2.th, width: 140 }, children: "\u64CD\u4F5C" })
1449
+ /* @__PURE__ */ jsx3("th", { style: { ...styles2.th, width: 180 }, children: "\u64CD\u4F5C" })
1442
1450
  ] }) }),
1443
1451
  /* @__PURE__ */ jsx3("tbody", { children: loading ? /* @__PURE__ */ jsx3("tr", { children: /* @__PURE__ */ jsx3("td", { colSpan: 6, style: styles2.empty, children: "\u52A0\u8F7D\u4E2D\u2026" }) }) : flatRows.length === 0 ? /* @__PURE__ */ jsx3("tr", { children: /* @__PURE__ */ jsx3("td", { colSpan: 6, style: styles2.empty, children: "\u6682\u65E0\u6570\u636E" }) }) : flatRows.map((row) => {
1444
1452
  const leaf = isMenuLeaf(row);
@@ -1475,6 +1483,15 @@ function MenuManager({
1475
1483
  ) }),
1476
1484
  /* @__PURE__ */ jsx3("td", { style: styles2.td, children: renderPermissionLabels(row) }),
1477
1485
  /* @__PURE__ */ jsxs2("td", { style: styles2.td, children: [
1486
+ /* @__PURE__ */ jsx3(
1487
+ "button",
1488
+ {
1489
+ type: "button",
1490
+ style: styles2.linkBtn,
1491
+ onClick: () => openCreate(row),
1492
+ children: "\u65B0\u589E"
1493
+ }
1494
+ ),
1478
1495
  /* @__PURE__ */ jsx3("button", { type: "button", style: styles2.linkBtn, onClick: () => openEdit(row), children: "\u7F16\u8F91" }),
1479
1496
  /* @__PURE__ */ jsx3(
1480
1497
  "button",