com-angel-authorization 1.0.27 → 1.0.28

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.
@@ -1330,11 +1330,19 @@ function MenuManager({
1330
1330
  const [saving, setSaving] = (0, import_react3.useState)(false);
1331
1331
  const [deletingRow, setDeletingRow] = (0, import_react3.useState)(null);
1332
1332
  const [deleting, setDeleting] = (0, import_react3.useState)(false);
1333
+ const [permissionKeyword, setPermissionKeyword] = (0, import_react3.useState)("");
1333
1334
  const permissionNameMap = (0, import_react3.useMemo)(() => {
1334
1335
  const map = /* @__PURE__ */ new Map();
1335
1336
  permissionPoints.forEach((p) => map.set(p.resourceId, p.name || p.identification));
1336
1337
  return map;
1337
1338
  }, [permissionPoints]);
1339
+ const filteredPermissionPoints = (0, import_react3.useMemo)(() => {
1340
+ const kw = permissionKeyword.trim().toLowerCase();
1341
+ if (!kw) return permissionPoints;
1342
+ return permissionPoints.filter(
1343
+ (p) => p.name.toLowerCase().includes(kw) || p.identification.toLowerCase().includes(kw)
1344
+ );
1345
+ }, [permissionPoints, permissionKeyword]);
1338
1346
  const allKnownMenus = (0, import_react3.useMemo)(() => {
1339
1347
  const map = /* @__PURE__ */ new Map();
1340
1348
  records.forEach((row) => map.set(row.resourceId, row));
@@ -1448,6 +1456,7 @@ function MenuManager({
1448
1456
  }, [api, pageSize]);
1449
1457
  const openCreate = (parent) => {
1450
1458
  setEditing(null);
1459
+ setPermissionKeyword("");
1451
1460
  if (parent) {
1452
1461
  setForm({
1453
1462
  ...emptyForm2(),
@@ -1463,6 +1472,7 @@ function MenuManager({
1463
1472
  const openEdit = (row) => {
1464
1473
  const parentId = resolveRowParentId(row);
1465
1474
  setEditing(row);
1475
+ setPermissionKeyword("");
1466
1476
  setForm({
1467
1477
  parentId,
1468
1478
  depth: row.depth > 0 ? row.depth : resolveMenuDepth(parentId, allKnownMenus),
@@ -1479,6 +1489,7 @@ function MenuManager({
1479
1489
  const closeDialog = () => {
1480
1490
  if (saving) return;
1481
1491
  setDialogOpen(false);
1492
+ setPermissionKeyword("");
1482
1493
  };
1483
1494
  const handleSubmit = async (event) => {
1484
1495
  event.preventDefault();
@@ -1742,7 +1753,24 @@ function MenuManager({
1742
1753
  ] }),
1743
1754
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { style: styles2.fieldset, children: [
1744
1755
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("legend", { style: styles2.label, children: "\u6743\u9650\u6807\u8BC6" }),
1745
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: styles2.multiSelect, children: permissionPoints.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: styles2.hint, children: "\u6682\u65E0\u6743\u9650\u70B9\uFF0C\u8BF7\u5148\u5728\u6743\u9650\u70B9\u7BA1\u7406\u4E2D\u65B0\u589E" }) : permissionPoints.map((p) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { style: styles2.checkItem, children: [
1756
+ permissionPoints.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1757
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1758
+ "input",
1759
+ {
1760
+ style: { ...styles2.input, marginBottom: 8 },
1761
+ value: permissionKeyword,
1762
+ onChange: (e) => setPermissionKeyword(e.target.value),
1763
+ placeholder: "\u641C\u7D22\u6743\u9650\u540D\u79F0 / \u6807\u8BC6"
1764
+ }
1765
+ ),
1766
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: styles2.hint, children: [
1767
+ "\u5DF2\u9009 ",
1768
+ form.permissionPointIds.length,
1769
+ " \u9879",
1770
+ permissionKeyword.trim() ? ` \xB7 \u5339\u914D ${filteredPermissionPoints.length} / ${permissionPoints.length}` : ` \xB7 \u5171 ${permissionPoints.length} \u9879`
1771
+ ] })
1772
+ ] }) : null,
1773
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: styles2.multiSelect, children: permissionPoints.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: styles2.hint, children: "\u6682\u65E0\u6743\u9650\u70B9\uFF0C\u8BF7\u5148\u5728\u6743\u9650\u70B9\u7BA1\u7406\u4E2D\u65B0\u589E" }) : filteredPermissionPoints.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: styles2.hint, children: "\u65E0\u5339\u914D\u6743\u9650\u70B9" }) : filteredPermissionPoints.map((p) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { style: styles2.checkItem, children: [
1746
1774
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1747
1775
  "input",
1748
1776
  {