Uh oh!
There was an error while loading. Please reload this page.
fix(grid): 批量编辑弹窗补齐多选/日期控件 + 确认展示与必填校验 (#2185) - #2186
Merged
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
baozhoutao added a commit
to objectstack-ai/objectstack
that referenced
this pull request
Jul 3, 2026
* demo(app-showcase): bulk multi-select edit on the Project grid (#2185) Exercises the objectui BulkActionDialog multi-select fix (objectstack-ai/objectui#2186) end-to-end in a real running app: - project.object.ts: add `labels` (multiselect, fixed options) and `team_members` (multi-user) — the two shapes the bulk dialog could not set before #2185 (its picker collapsed to a single value / overwrote the array). - project.view.ts: add the two columns and three `bulkActionDefs`: • set_labels → multi-select on a `select` param (array patch) • assign_team → multi-select on a `lookup` param (sys_user) • reschedule → the new `date` control + a single-select Verified in objectstack dev: select rows → each action writes an array (or date) patch to all selected records; labels/team_members/end_date persist server-side. * demo(app-showcase): add single-lookup bulk action (reassign_account) Exercises the searchable single-lookup picker (objectui#2186): a `lookup` param with no `multiple` now renders a searchable reference combobox over showcase_account, not a bare dropdown. Verified in objectstack dev — select rows → Reassign Account → search/pick one → every selected project's `account` is set to the single chosen id.
BulkActionDialog 的参数控件此前只有 6 种单值控件,导致: - 多选人员/关联字段(如 executors)只能选 1 个,且写回把数组覆盖成单值 - date/datetime 声明了却退化成纯文本框 - 数组值在确认页显示成 a,b / [object Object] - 空数组能通过必填校验 改动(向后兼容,不设 multiple 时行为不变): - BulkActionParam 增加 multiple / labelField - select/lookup 支持多选(Popover+Command,值为数组),buildPatch 无需改 - 补 date/datetime 原生日期选择器 - 确认页按选项 label 解析并 join 数组值 - 空数组视为未填,拦住多选必填 - lookup 选项 label 可经 labelField 配置 后续单独处理:lookup 200 上限 + 远程搜索/分页(需服务端 search API)。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#2185
背景
grid/list 批量操作弹窗(
BulkActionDialog)的参数控件(ParamField)是个 MVP,只实现了 6 种单值控件。真实场景下会踩到:date/datetime:类型声明了,但 switch 无分支 → 退化成纯文本框,只能手打字符串。a,b或[object Object]。[]能通过必填校验。数据链路层本就 OK:
useBulkExecutor.buildPatch直接 spread params,数组值{ executors: [id1,id2] }天然能写进 patch。缺口纯在 UI 控件层。改动(向后兼容 — 不设
multiple时行为完全不变)BulkActionParam新增multiple?: boolean与labelField?: string。select/lookup支持多选:multiple时渲染 Popover + Command 多选控件(带本地搜索、Badge 展示已选),值为字符串数组;buildPatch无需改动。date/datetime控件(原生日期选择器),替代退化文本框。[object Object]),并显示 param.label。paramsValid:空数组视为未填,多选必填能拦住。labelField配置(此前写死 name/full_name/email/id)。formatValue辅助函数。后续(单独 issue,本 PR 不含)
用法示例
验证
bulkActionDialogParams.test.tsx:多选 select 端到端(必填空数组拦截 → 选多项 → 确认页显示 label → Run 断言 patch 为数组{ tags: ['red','blue'] })+ date 控件渲染。@object-ui/plugin-grid全量测试:22 files / 171 passed。packages/plugin-grid(BulkActionDialog.tsx)+packages/types(BulkActionParam)。