ps-toolkit-ui 0.0.20 → 0.0.21

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.
@@ -801,13 +801,14 @@
801
801
  })(exports.ResultStatusEnum || (exports.ResultStatusEnum = {}));
802
802
  (function (PermissionTypeEnum) {
803
803
  PermissionTypeEnum[PermissionTypeEnum["Form"] = -1] = "Form";
804
- PermissionTypeEnum[PermissionTypeEnum["Access"] = 0] = "Access";
805
- PermissionTypeEnum[PermissionTypeEnum["OptionLink"] = 1] = "OptionLink";
806
- PermissionTypeEnum[PermissionTypeEnum["OptionLinkNewTab"] = 2] = "OptionLinkNewTab";
807
- PermissionTypeEnum[PermissionTypeEnum["OptionReport"] = 3] = "OptionReport";
808
- PermissionTypeEnum[PermissionTypeEnum["OptionFile"] = 4] = "OptionFile";
809
- PermissionTypeEnum[PermissionTypeEnum["OptionModal"] = 5] = "OptionModal";
810
- PermissionTypeEnum[PermissionTypeEnum["OptionConfirm"] = 6] = "OptionConfirm";
804
+ PermissionTypeEnum[PermissionTypeEnum["Item"] = 0] = "Item";
805
+ PermissionTypeEnum[PermissionTypeEnum["Access"] = 1] = "Access";
806
+ PermissionTypeEnum[PermissionTypeEnum["OptionLink"] = 2] = "OptionLink";
807
+ PermissionTypeEnum[PermissionTypeEnum["OptionLinkNewTab"] = 3] = "OptionLinkNewTab";
808
+ PermissionTypeEnum[PermissionTypeEnum["OptionReport"] = 4] = "OptionReport";
809
+ PermissionTypeEnum[PermissionTypeEnum["OptionFile"] = 5] = "OptionFile";
810
+ PermissionTypeEnum[PermissionTypeEnum["OptionModal"] = 6] = "OptionModal";
811
+ PermissionTypeEnum[PermissionTypeEnum["OptionConfirm"] = 7] = "OptionConfirm";
811
812
  })(exports.PermissionTypeEnum || (exports.PermissionTypeEnum = {}));
812
813
  (function (VehicleType) {
813
814
  VehicleType[VehicleType["Car"] = 1] = "Car";
@@ -2127,13 +2128,16 @@
2127
2128
  this.currentSidebar = this.getSidebarActive(this.sidebar, active);
2128
2129
  };
2129
2130
  SidebarComponent.prototype.ngOnInit = function () {
2131
+ this.sidebar = this.getSidebar();
2132
+ console.log(this.sidebar);
2133
+ this.setActive();
2134
+ };
2135
+ SidebarComponent.prototype.getSidebar = function (parentId) {
2130
2136
  var _this = this;
2131
- this.sidebar = this.permissions.map(function (s) {
2132
- return new SidebarClass(_this.l, s.Name, s.Controller, s.Action, s.Icon, s.Children ? s.Children.map(function (c) {
2133
- return new SidebarClass(_this.l, c.Name, c.Controller, c.Action, c.Icon, []);
2134
- }) : []);
2137
+ if (parentId === void 0) { parentId = null; }
2138
+ return this.permissions.filter(function (x) { return x.Type === exports.PermissionTypeEnum.Item && parentId === parentId; }).map(function (s) {
2139
+ return new SidebarClass(_this.l, s.Name, s.Controller, s.Action, s.Icon, _this.getSidebar(s.Id));
2135
2140
  });
2136
- this.setActive();
2137
2141
  };
2138
2142
  SidebarComponent.prototype.getSidebarActive = function (item, active) {
2139
2143
  var e_1, _a;