Пример #1
0
        protected override async Task OnInitializedAsync()
        {
            functionId = base.Options;

            functionEntity = await functionService.FindAsync(functionId);

            await base.OnInitializedAsync();
        }
Пример #2
0
        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);
        }
Пример #3
0
        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();
        }
Пример #4
0
        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]或未找到上级数据");
            }
        }