com-angel-authorization 1.0.7 → 1.0.8

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.
@@ -369,7 +369,7 @@ var MENU_TYPE_PAGE = "page";
369
369
  var MENU_TYPE_MENU = "menu";
370
370
  var MENU_TYPE_BUTTON = "button";
371
371
  var MENU_LIST_TYPE_PARAM = "page,menu,button";
372
- var ROOT_PARENT_ID = "0";
372
+ var ROOT_PARENT_ID = "";
373
373
  var RESOURCE_STATUS_ENABLED = 1;
374
374
  var RESOURCE_STATUS_DISABLED = 0;
375
375
  var RESOURCE_STATUS_OPTIONS = [
@@ -586,10 +586,11 @@ function mapMenuResource(item) {
586
586
  );
587
587
  const permissionNamesRaw = row.permissionPointNames ?? row.permission_point_names ?? row.permissionNames;
588
588
  const permissionPointNames = Array.isArray(permissionNamesRaw) ? permissionNamesRaw.map((n) => String(n ?? "")).filter(Boolean) : void 0;
589
- const parentId = row.parentId ?? row.parent_id ?? ROOT_PARENT_ID;
589
+ const rawParentId = row.parentId ?? row.parent_id;
590
+ const parentId = rawParentId === void 0 || rawParentId === null || rawParentId === "" || String(rawParentId) === "0" ? null : String(rawParentId);
590
591
  return {
591
592
  resourceId: String(resourceId),
592
- parentId: parentId === void 0 || parentId === null ? ROOT_PARENT_ID : String(parentId),
593
+ parentId,
593
594
  type: toMenuType(row.type),
594
595
  name: String(row.name ?? ""),
595
596
  identification: String(row.identification ?? row.identity ?? row.path ?? ""),
@@ -630,7 +631,7 @@ function buildUpdateBody(values) {
630
631
  function buildCreateMenuBody(values, resourceId = getAppClientId()) {
631
632
  return {
632
633
  resourceId,
633
- parentId: values.parentId || ROOT_PARENT_ID,
634
+ parentId: values.parentId ? values.parentId : null,
634
635
  type: values.type,
635
636
  name: values.name.trim(),
636
637
  identification: values.identification.trim(),
@@ -640,7 +641,7 @@ function buildCreateMenuBody(values, resourceId = getAppClientId()) {
640
641
  }
641
642
  function buildUpdateMenuBody(values) {
642
643
  return {
643
- parentId: values.parentId || ROOT_PARENT_ID,
644
+ parentId: values.parentId ? values.parentId : null,
644
645
  type: values.type,
645
646
  name: values.name.trim(),
646
647
  identification: values.identification.trim(),
@@ -1438,7 +1439,7 @@ var import_vue4 = require("vue");
1438
1439
  var PAGE_SIZE_OPTIONS2 = ["10", "20", "50", "100"];
1439
1440
  function emptyForm2() {
1440
1441
  return {
1441
- parentId: ROOT_PARENT_ID,
1442
+ parentId: null,
1442
1443
  type: MENU_TYPE_MENU,
1443
1444
  name: "",
1444
1445
  identification: "",
@@ -1759,7 +1760,7 @@ var MenuManager = (0, import_vue4.defineComponent)({
1759
1760
  function openEdit(row) {
1760
1761
  editing.value = row;
1761
1762
  Object.assign(form, {
1762
- parentId: row.parentId || ROOT_PARENT_ID,
1763
+ parentId: row.parentId ?? null,
1763
1764
  type: row.type,
1764
1765
  name: row.name,
1765
1766
  identification: row.identification,
@@ -2004,13 +2005,14 @@ var MenuManager = (0, import_vue4.defineComponent)({
2004
2005
  "select",
2005
2006
  {
2006
2007
  style: s2.input,
2007
- value: form.parentId,
2008
+ value: form.parentId ?? ROOT_PARENT_ID,
2008
2009
  onChange: (e) => {
2009
- form.parentId = e.target.value;
2010
+ const value = e.target.value;
2011
+ form.parentId = value ? value : null;
2010
2012
  }
2011
2013
  },
2012
2014
  [
2013
- (0, import_vue4.h)("option", { value: ROOT_PARENT_ID }, "\u6839\u76EE\u5F55"),
2015
+ (0, import_vue4.h)("option", { value: ROOT_PARENT_ID }, "\u65E0"),
2014
2016
  ...parentOptions.value.map(
2015
2017
  (opt) => (0, import_vue4.h)(
2016
2018
  "option",