protected override async Task OnInitializedAsync() { functionId = base.Options; functionEntity = await functionService.FindAsync(functionId); await base.OnInitializedAsync(); }
private MenuDataItem CreateMenuItem(SFunctionEntity f) { MenuDataItem m = new MenuDataItem(); m.Key = f.Id; m.Name = f.Name; m.Path = f.Path; m.Icon = f.Icon; return(m); }
protected override async Task OnInitializedAsync() { functionId = base.Options ?? null; if (StringUtils.IsBlank(functionId)) { functionEntity = new SFunctionEntity { Parent = "0" }; } else { functionEntity = await functionService.FindCloneAsync(functionId); } await base.OnInitializedAsync(); }
private async Task ValidatorByParent(EditContext editContext) { if (StringUtils.IsBlank(functionEntity.Parent)) { functionEntity.Parent = "0"; } else if (StringUtils.IsEqual("0", functionEntity.Parent)) { return; } SFunctionEntity other = await this.functionService.FindAsync(functionEntity.Parent); if (other == null) { messageStore.Add(editContext.Field("Parent"), "上级代码必须为[0]或未找到上级数据"); } }