Skip to content

feat(table):新增KeepAdding参数,用来处理连续新增 - #8506

Open
Tony-ST0754 wants to merge 1 commit into
mainfrom
feat-table-KeepAdding
Open

Tony-ST0754 wants to merge 1 commit into
mainfrom
feat-table-KeepAdding

Conversation

@Tony-ST0754

Copy link
Copy Markdown
Collaborator
  • 1、给Table组件新增参数KeepAdding,用来处理新增数据时是否能连续新增,即编辑弹窗不关闭连续新增
  • 2、在连续新增时,如果需要全部保留或部分保留上一轮的信息,可通过组件中OnAddAsync回调来处理
  • 3、由于要在不关闭编辑弹窗的情况下继续新增数据,因此,在弹窗中Popup、Drawer模式中,既要考虑下一轮新增时编辑弹窗中的绑定验证的模型是否成功创建或创建异常,还要考虑弹窗关闭时的清理问题,整体对Popup、Drawer模式的弹窗改动比较大
  • 3.1、给ITableEditDialogOption及相应的...DialogOption新增KeepOpenAfterSave参数,用来告知编辑弹窗保存成功后是否继续保存弹窗为打开状态,新增CreateNextModelAsync回调供弹窗内部配合KeepOpenAfterSave参数使用,作用为连续新增时创建新的绑定模型
  • 3.2、新增DialogCloseContext类,用来负责弹窗关闭相关的职责处理,Popup、Drawer模式,使用统一关闭状态;关闭检查按所属窗口执行,逐个等待回调并尊重否决结要,避免重复关闭及旧窗口清理误伤新窗口
  • 3.3、关闭状态、检查和收尾按当前展示实例管理,保存后的回调或刷新失败时,显示错误并禁止重复保存当前记录,同时不允许初始化下一条记录。
  • 3.4、编辑弹窗的关闭逻辑,由原来的直接关闭,变更为判断是否允许关闭
  • 3.5、连续新增时,保存成功后创建下一条模型,重建表单状态;正文、编辑项和Footer使用同一当前模型
  • 3.6、保存、创建下一条期间禁止重复提交和关闭;忽略旧表单、旧展示及组件销毁后的异步提交
  • 3.7、保存未成功时允许重试;已实际保存、但后续处理失败时阻止重复保存。下一条初始化失败会提示错误,允许正常关闭并清理。

Link issues

fixes #8489

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

1、给`Table`组件新增参数`KeepAdding`,用来处理新增数据时是否能连续新增,即编辑弹窗不关闭连续新增
2、在连续新增时,如果需要全部保留或部分保留上一轮的信息,可通过组件中`OnAddAsync`回调来处理
3、由于要在不关闭编辑弹窗的情况下继续新增数据,因此,在弹窗中`Popup`、`Drawer`模式中,既要考虑下一轮新增时编辑弹窗中的绑定验证的模型是否成功创建或创建异常,还要考虑弹窗关闭时的清理问题,整体对`Popup`、`Drawer`模式的弹窗改动比较大
3.1、给`ITableEditDialogOption`及相应的`...DialogOption`新增`KeepOpenAfterSave`参数,用来告知编辑弹窗保存成功后是否继续保存弹窗为打开状态,新增`CreateNextModelAsync`回调供弹窗内部配合`KeepOpenAfterSave`参数使用,作用为连续新增时创建新的绑定模型
3.2、新增`DialogCloseContext`类,用来负责弹窗关闭相关的职责处理,`Popup`、`Drawer`模式,使用统一关闭状态;关闭检查按所属窗口执行,逐个等待回调并尊重否决结要,避免重复关闭及旧窗口清理误伤新窗口
3.3、关闭状态、检查和收尾按当前展示实例管理,保存后的回调或刷新失败时,显示错误并禁止重复保存当前记录,同时不允许初始化下一条记录。
3.4、编辑弹窗的关闭逻辑,由原来的直接关闭,变更为判断是否允许关闭
3.5、连续新增时,保存成功后创建下一条模型,重建表单状态;正文、编辑项和Footer使用同一当前模型
3.6、保存、创建下一条期间禁止重复提交和关闭;忽略旧表单、旧展示及组件销毁后的异步提交
3.7、保存未成功时允许重试;已实际保存、但后续处理失败时阻止重复保存。下一条初始化失败会提示错误,允许正常关闭并清理。
@bb-auto

bb-auto Bot commented Oct 9, 2026

Copy link
Copy Markdown

Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Sorry @Tony-ST0754, your pull request is larger than the review limit of 150,000 diff characters

@bb-auto
bb-auto Bot requested a review from ArgoZhang October 9, 2026 10:14
@bb-auto bb-auto Bot added the bug Something isn't working label Oct 9, 2026
@bb-auto bb-auto Bot added this to the v10.10.0 milestone Oct 9, 2026
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.93460% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.96%. Comparing base (ec57b09) to head (8d7b3ef).

Files with missing lines Patch % Lines
...tstrapBlazor/Components/Dialog/EditDialog.razor.cs 96.42% 5 Missing ⚠️
.../BootstrapBlazor/Components/Dialog/Dialog.razor.cs 94.28% 2 Missing ⚠️
...strapBlazor/Components/Modal/DialogCloseContext.cs 96.77% 2 Missing ⚠️
...trapBlazor/Components/Table/Table.razor.Toolbar.cs 97.84% 2 Missing ⚠️
...rc/BootstrapBlazor/Components/Modal/Modal.razor.cs 98.70% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #8506      +/-   ##
===========================================
- Coverage   100.00%   99.96%   -0.04%     
===========================================
  Files          777      778       +1     
  Lines        35175    35583     +408     
  Branches         0        1       +1     
===========================================
+ Hits         35175    35571     +396     
- Misses           0       12      +12     
Flag Coverage Δ
BB 99.96% <97.93%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(Table): 使用 EditFooterTemplate 实现再来一单功能

2 participants