Skip to content

bug(): EditorForm编辑框的问题 #4129

@youthalan

Description

@youthalan

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

编写正常的编辑框代码
`

<FieldItems>

    <EditorItem TValue="string" TModel="L1ShutDownEntity" @bind-Field="@context.PROD_SHIFT_NO">
        <EditTemplate Context="value">
            <div class="col-12">
                <h6>@Localizer["BasicInformation"]</h6>
            </div>
        </EditTemplate>
    </EditorItem>

    <EditorItem @bind-Field="@context.PROD_SHIFT_NO" />
    <EditorItem @bind-Field="@context.PROD_SHIFT_GROUP" />
    <EditorItem @bind-Field="@context.STOP_AREA" />
    <EditorItem @bind-Field="@context.ELAST_TIME" />
    <EditorItem @bind-Field="@context.STOP_REASON" />

</FieldItems>

`

调用的页面写上:
<EditTemplate Context="context" > <ShutDownEditComponent Model="context"/> </EditTemplate>

如果调用页面的后台没有定义以下代码:
[Inject] [NotNull] private IDispatchService<bool>? DispatchService { get; set; }//用于编辑框保存时编辑按钮刷新

`public void Dispose()
{
DispatchService.UnSubscribe(Notify);
}

protected override Task OnInitializedAsync()
{
DispatchService.Subscribe(Notify);
return base.OnInitializedAsync();
}

private async Task Notify(DispatchEntry entry)
{
//用于编辑框保存时编辑按钮刷新
await InvokeAsync(table.QueryAsync);
await InvokeAsync(StateHasChanged);
}
`

编辑按钮将不正常,表现为,当点编辑弹窗后,再点保存时,会让工具栏的编辑按钮状态不正常
这个应该在文档里面写清楚。

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

8.0.400

Anything else?

No response

Metadata

Metadata

Assignees

Labels

need-repro-projectNeed repro projectquestionQuestion that needs to be answered

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions