com-angel-authorization 1.0.31 → 1.0.33

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.
@@ -225,6 +225,8 @@ type UpdateAuthorizationResourceBody = Partial<AuthorizationResourceFormValues>
225
225
  type?: ApiResourceType;
226
226
  };
227
227
  type FetchAuthorizationResourcesParams = {
228
+ /** 按名称 / 标识搜索 */
229
+ keyword?: string;
228
230
  pagination?: ListPaginationParams;
229
231
  };
230
232
  type AuthorizationResourceListResult = {
@@ -225,6 +225,8 @@ type UpdateAuthorizationResourceBody = Partial<AuthorizationResourceFormValues>
225
225
  type?: ApiResourceType;
226
226
  };
227
227
  type FetchAuthorizationResourcesParams = {
228
+ /** 按名称 / 标识搜索 */
229
+ keyword?: string;
228
230
  pagination?: ListPaginationParams;
229
231
  };
230
232
  type AuthorizationResourceListResult = {
package/dist/vue/index.js CHANGED
@@ -594,6 +594,7 @@ function buildListUrl(type, params) {
594
594
  if (params?.depth !== void 0 && params?.depth !== null && String(params.depth) !== "") {
595
595
  appendQueryParam(parts, "depth", String(params.depth));
596
596
  }
597
+ appendQueryParam(parts, "keyword", params?.keyword ?? "");
597
598
  appendQueryParam(parts, "page-token", params?.pagination?.pageToken ?? "");
598
599
  appendQueryParam(parts, "page-size", params?.pagination?.pageSize ?? "20");
599
600
  appendQueryParam(parts, "page-direction", params?.pagination?.pageDirection ?? "current");
@@ -1783,6 +1784,7 @@ var MenuManager = defineComponent3({
1783
1784
  const deletingRow = ref2(null);
1784
1785
  const deleting = ref2(false);
1785
1786
  const permissionKeyword = ref2("");
1787
+ const permissionLoading = ref2(false);
1786
1788
  const permissionNameMap = computed3(() => {
1787
1789
  const map = /* @__PURE__ */ new Map();
1788
1790
  permissionPoints.value.forEach(
@@ -1790,13 +1792,6 @@ var MenuManager = defineComponent3({
1790
1792
  );
1791
1793
  return map;
1792
1794
  });
1793
- const filteredPermissionPoints = computed3(() => {
1794
- const kw = permissionKeyword.value.trim().toLowerCase();
1795
- if (!kw) return permissionPoints.value;
1796
- return permissionPoints.value.filter(
1797
- (p) => p.name.toLowerCase().includes(kw) || p.identification.toLowerCase().includes(kw)
1798
- );
1799
- });
1800
1795
  const allKnownMenus = computed3(() => {
1801
1796
  const map = /* @__PURE__ */ new Map();
1802
1797
  records.value.forEach((row) => map.set(row.resourceId, row));
@@ -1868,13 +1863,23 @@ var MenuManager = defineComponent3({
1868
1863
  loading.value = false;
1869
1864
  }
1870
1865
  }
1871
- async function loadPermissionPoints() {
1866
+ async function loadPermissionPoints(keyword = "", signal) {
1867
+ permissionLoading.value = true;
1872
1868
  try {
1873
- const result = await props.api.listPermissionPoints({
1874
- pagination: { pageSize: "200", pageDirection: "current" }
1875
- });
1876
- permissionPoints.value = result.records;
1869
+ const result = await props.api.listPermissionPoints(
1870
+ {
1871
+ keyword: keyword.trim() || void 0,
1872
+ pagination: { pageSize: "200", pageDirection: "current" }
1873
+ },
1874
+ signal
1875
+ );
1876
+ if (!signal?.aborted) {
1877
+ permissionPoints.value = result.records;
1878
+ }
1877
1879
  } catch {
1880
+ if (signal?.aborted) return;
1881
+ } finally {
1882
+ if (!signal?.aborted) permissionLoading.value = false;
1878
1883
  }
1879
1884
  }
1880
1885
  async function toggleExpand(row) {
@@ -1913,7 +1918,6 @@ var MenuManager = defineComponent3({
1913
1918
  Object.assign(form, emptyForm2());
1914
1919
  }
1915
1920
  dialogOpen.value = true;
1916
- void loadPermissionPoints();
1917
1921
  }
1918
1922
  function openEdit(row) {
1919
1923
  const parentId = resolveRowParentId(row);
@@ -1930,7 +1934,6 @@ var MenuManager = defineComponent3({
1930
1934
  sort: Number.isFinite(row.sort) ? row.sort : 0
1931
1935
  });
1932
1936
  dialogOpen.value = true;
1933
- void loadPermissionPoints();
1934
1937
  }
1935
1938
  function closeDialog() {
1936
1939
  if (!saving.value) {
@@ -1996,7 +1999,6 @@ var MenuManager = defineComponent3({
1996
1999
  }
1997
2000
  onMounted2(() => {
1998
2001
  void loadList("current", "");
1999
- void loadPermissionPoints();
2000
2002
  });
2001
2003
  watch2(
2002
2004
  () => [props.api, pageSize.value],
@@ -2005,6 +2007,20 @@ var MenuManager = defineComponent3({
2005
2007
  void loadList("current", "");
2006
2008
  }
2007
2009
  );
2010
+ let permissionSearchTimer = null;
2011
+ let permissionAbort = null;
2012
+ watch2(
2013
+ () => [dialogOpen.value, permissionKeyword.value],
2014
+ ([open, keyword]) => {
2015
+ if (permissionSearchTimer) clearTimeout(permissionSearchTimer);
2016
+ permissionAbort?.abort();
2017
+ if (!open) return;
2018
+ permissionSearchTimer = setTimeout(() => {
2019
+ permissionAbort = new AbortController();
2020
+ void loadPermissionPoints(keyword, permissionAbort.signal);
2021
+ }, 300);
2022
+ }
2023
+ );
2008
2024
  return () => h2("div", { style: s2.root }, [
2009
2025
  h2("div", { style: s2.toolbar }, [
2010
2026
  h2("h2", { style: s2.title }, props.title),
@@ -2286,31 +2302,29 @@ var MenuManager = defineComponent3({
2286
2302
  ]),
2287
2303
  h2("fieldset", { style: s2.fieldset }, [
2288
2304
  h2("legend", { style: s2.label }, "\u6743\u9650\u6807\u8BC6"),
2289
- permissionPoints.value.length > 0 ? [
2290
- h2("input", {
2291
- style: { ...s2.input, marginBottom: "8px" },
2292
- value: permissionKeyword.value,
2293
- placeholder: "\u641C\u7D22\u6743\u9650\u540D\u79F0 / \u6807\u8BC6",
2294
- onInput: (e) => {
2295
- permissionKeyword.value = e.target.value;
2296
- }
2297
- }),
2298
- h2(
2299
- "div",
2300
- { style: s2.hint },
2301
- permissionKeyword.value.trim() ? `\u5DF2\u9009 ${form.permissionPointIds.length} \u9879 \xB7 \u5339\u914D ${filteredPermissionPoints.value.length} / ${permissionPoints.value.length}` : `\u5DF2\u9009 ${form.permissionPointIds.length} \u9879 \xB7 \u5171 ${permissionPoints.value.length} \u9879`
2302
- )
2303
- ] : null,
2305
+ h2("input", {
2306
+ style: { ...s2.input, marginBottom: "8px" },
2307
+ value: permissionKeyword.value,
2308
+ placeholder: "\u641C\u7D22\u6743\u9650\u540D\u79F0 / \u6807\u8BC6",
2309
+ onInput: (e) => {
2310
+ permissionKeyword.value = e.target.value;
2311
+ }
2312
+ }),
2313
+ h2(
2314
+ "div",
2315
+ { style: s2.hint },
2316
+ permissionLoading.value ? `\u5DF2\u9009 ${form.permissionPointIds.length} \u9879 \xB7 \u641C\u7D22\u4E2D\u2026` : permissionKeyword.value.trim() ? `\u5DF2\u9009 ${form.permissionPointIds.length} \u9879 \xB7 \u8FD4\u56DE ${permissionPoints.value.length} \u9879` : `\u5DF2\u9009 ${form.permissionPointIds.length} \u9879 \xB7 \u5171 ${permissionPoints.value.length} \u9879`
2317
+ ),
2304
2318
  h2(
2305
2319
  "div",
2306
2320
  { style: s2.multiSelect },
2307
- permissionPoints.value.length === 0 ? [
2321
+ permissionLoading.value && permissionPoints.value.length === 0 ? [h2("div", { style: s2.hint }, "\u52A0\u8F7D\u4E2D\u2026")] : permissionPoints.value.length === 0 ? [
2308
2322
  h2(
2309
2323
  "div",
2310
2324
  { style: s2.hint },
2311
- "\u6682\u65E0\u6743\u9650\u70B9\uFF0C\u8BF7\u5148\u5728\u6743\u9650\u70B9\u7BA1\u7406\u4E2D\u65B0\u589E"
2325
+ permissionKeyword.value.trim() ? "\u65E0\u5339\u914D\u6743\u9650\u70B9" : "\u6682\u65E0\u6743\u9650\u70B9\uFF0C\u8BF7\u5148\u5728\u6743\u9650\u70B9\u7BA1\u7406\u4E2D\u65B0\u589E"
2312
2326
  )
2313
- ] : filteredPermissionPoints.value.length === 0 ? [h2("div", { style: s2.hint }, "\u65E0\u5339\u914D\u6743\u9650\u70B9")] : filteredPermissionPoints.value.map(
2327
+ ] : permissionPoints.value.map(
2314
2328
  (p) => h2(
2315
2329
  "label",
2316
2330
  { key: p.resourceId, style: s2.checkItem },
@@ -4442,7 +4456,10 @@ var UserManager = defineComponent5({
4442
4456
  [
4443
4457
  formError.value ? h4("div", { style: s4.error }, formError.value) : null,
4444
4458
  h4("label", { style: s4.field }, [
4445
- h4("span", { style: s4.label }, "\u8D26\u53F7"),
4459
+ h4("span", { style: s4.label }, [
4460
+ "\u8D26\u53F7 ",
4461
+ h4("span", { style: s4.required }, "*")
4462
+ ]),
4446
4463
  h4("input", {
4447
4464
  style: s4.input,
4448
4465
  value: form.username,
@@ -4454,7 +4471,10 @@ var UserManager = defineComponent5({
4454
4471
  })
4455
4472
  ]),
4456
4473
  h4("label", { style: s4.field }, [
4457
- h4("span", { style: s4.label }, "\u7528\u6237\u540D"),
4474
+ h4("span", { style: s4.label }, [
4475
+ "\u7528\u6237\u540D ",
4476
+ h4("span", { style: s4.required }, "*")
4477
+ ]),
4458
4478
  h4("input", {
4459
4479
  style: s4.input,
4460
4480
  value: form.name,
@@ -4465,24 +4485,23 @@ var UserManager = defineComponent5({
4465
4485
  }
4466
4486
  })
4467
4487
  ]),
4468
- h4("label", { style: s4.field }, [
4469
- h4(
4470
- "span",
4471
- { style: s4.label },
4472
- editing.value ? "\u5BC6\u7801\uFF08\u7559\u7A7A\u5219\u4E0D\u4FEE\u6539\uFF09" : "\u521D\u59CB\u5BC6\u7801"
4473
- ),
4488
+ !editing.value ? h4("label", { style: s4.field }, [
4489
+ h4("span", { style: s4.label }, [
4490
+ "\u521D\u59CB\u5BC6\u7801 ",
4491
+ h4("span", { style: s4.required }, "*")
4492
+ ]),
4474
4493
  h4("input", {
4475
4494
  style: s4.input,
4476
4495
  type: "password",
4477
4496
  value: form.password,
4478
- placeholder: editing.value ? "\u7559\u7A7A\u8868\u793A\u4E0D\u4FEE\u6539\u5BC6\u7801" : "\u8BF7\u8F93\u5165\u521D\u59CB\u5BC6\u7801",
4479
- required: !editing.value,
4497
+ placeholder: "\u8BF7\u8F93\u5165\u521D\u59CB\u5BC6\u7801",
4498
+ required: true,
4480
4499
  autocomplete: "new-password",
4481
4500
  onInput: (e) => {
4482
4501
  form.password = e.target.value;
4483
4502
  }
4484
4503
  })
4485
- ]),
4504
+ ]) : null,
4486
4505
  h4("fieldset", { style: s4.fieldset }, [
4487
4506
  h4("legend", { style: s4.label }, [
4488
4507
  "\u5F52\u5C5E\u90E8\u95E8 ",