Commit b08715fd authored by drigle's avatar drigle

fix: 推送弹框用户搜索自动展开候选列表

parent 0c1be1bb
...@@ -15,9 +15,9 @@ function UserMultiSelect({ label, value, onChange }) { ...@@ -15,9 +15,9 @@ function UserMultiSelect({ label, value, onChange }) {
useEffect(() => { useEffect(() => {
let cancelled = false; let cancelled = false;
const timer = window.setTimeout(async () => {
setLoading(true); setLoading(true);
setError(''); setError('');
const timer = window.setTimeout(async () => {
try { try {
const text = query.trim(); const text = query.trim();
const filter = text ? { $or: [{ username: { $regex: text } }, { display_name: { $regex: text } }] } : {}; const filter = text ? { $or: [{ username: { $regex: text } }, { display_name: { $regex: text } }] } : {};
...@@ -40,8 +40,11 @@ function UserMultiSelect({ label, value, onChange }) { ...@@ -40,8 +40,11 @@ function UserMultiSelect({ label, value, onChange }) {
<div className="space-y-2"> <div className="space-y-2">
<Label>{label}</Label> <Label>{label}</Label>
<ComboBox <ComboBox
allowsEmptyCollection
fullWidth fullWidth
inputValue={query} inputValue={query}
// Remote results already match both username and display_name.
items={availableOptions}
menuTrigger="focus" menuTrigger="focus"
selectedKey={null} selectedKey={null}
onInputChange={setQuery} onInputChange={setQuery}
......
...@@ -131,6 +131,8 @@ Grid 视图配置示例(列举的是配置片段,修改时应保留完整原 ...@@ -131,6 +131,8 @@ Grid 视图配置示例(列举的是配置片段,修改时应保留完整原
入口:自查底稿填写表 -> “推送自查底稿填写表”。 入口:自查底稿填写表 -> “推送自查底稿填写表”。
1. 通过 HeroUI Modal 中的远程 ComboBox 搜索选择填报人和审核人;两组人员都不能为空,只保存用户 `_id[]`。 1. 通过 HeroUI Modal 中的远程 ComboBox 搜索选择填报人和审核人;两组人员都不能为空,只保存用户 `_id[]`。
- 聚焦或输入搜索词时自动展开候选列表,无需再次点击下拉按钮;按用户名或显示名进行远程搜索,直接展示接口返回的匹配用户,不再按显示名二次过滤。
- 搜索防抖等待和请求期间显示加载提示;无结果或请求失败时在下拉列表中显示对应提示。已选用户从候选列表中排除,避免重复添加。
2. 推送前逐条调用 `GET /record/:name` 读取所选底稿完整详情,从 `metadata.project_outcome` 提取并去重结果 ID;全部底稿通过非空校验后才执行写入。将填报人写入关联 `self_check_the_project_results.metadata.informant`,同时写入填写表 `metadata.editor`。 2. 推送前逐条调用 `GET /record/:name` 读取所选底稿完整详情,从 `metadata.project_outcome` 提取并去重结果 ID;全部底稿通过非空校验后才执行写入。将填报人写入关联 `self_check_the_project_results.metadata.informant`,同时写入填写表 `metadata.editor`。
3. 创建 `message_reference_id`,保存发送人、填报人、审核人、Subject、View、关联记录和限制条件。 3. 创建 `message_reference_id`,保存发送人、填报人、审核人、Subject、View、关联记录和限制条件。
4. 为每个填报人调用 `oa_notice:createProgress` 创建 OA 待办,并将任务 ID 写入 `metadata.progress_id_editor`。 4. 为每个填报人调用 `oa_notice:createProgress` 创建 OA 待办,并将任务 ID 写入 `metadata.progress_id_editor`。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment