@das-fed/upf-ui 6.4.0-dev.311 → 6.4.0-dev.312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/esm-map.json +2 -1
  2. package/front-end/i18n/front-end-page/dasui_en-US.js +9 -6
  3. package/front-end/i18n/front-end-page/dasui_zh-CN.js +9 -6
  4. package/front-end/i18n/front-end-page/dasui_zh-MO.js +9 -6
  5. package/package.json +7 -7
  6. package/packages/business-components/process-search-form/hooks/useSearchOptions.d.ts +2 -0
  7. package/packages/components/input/style.css +1 -1
  8. package/packages/components/input/style.css.gz +0 -0
  9. package/packages/components/search-form/i18n/index.d.ts +12 -0
  10. package/packages/components/search-form/index.d.ts +3 -0
  11. package/packages/components/search-form/index.js +1964 -1074
  12. package/packages/components/search-form/index.js.gz +0 -0
  13. package/packages/components/search-form/skills/DasSearchForm/345/215/207/347/272/247/346/214/207/345/215/227.md +141 -0
  14. package/packages/components/search-form/skills/das-search-form-toolbar-migration/SKILL.md +113 -0
  15. package/packages/components/search-form/skills/das-search-form-toolbar-migration//350/277/201/347/247/273/350/246/201/347/202/271/344/270/216/345/270/270/350/247/201/351/227/256/351/242/230.md +47 -0
  16. package/packages/components/search-form/src/Index.vue.d.ts +12 -50
  17. package/packages/components/search-form/src/Legacy.vue.d.ts +61 -0
  18. package/packages/components/search-form/src/SearchDateRange.vue.d.ts +5 -2
  19. package/packages/components/search-form/src/Toolbar.vue.d.ts +57 -0
  20. package/packages/components/search-form/src/api/park-space.d.ts +8 -0
  21. package/packages/components/search-form/src/hooks/common-query.d.ts +7 -0
  22. package/packages/components/search-form/src/hooks/searchFormItem.d.ts +16 -14
  23. package/packages/components/search-form/src/hooks/submission.d.ts +23 -0
  24. package/packages/components/search-form/src/hooks/toolbar-state.d.ts +22 -0
  25. package/packages/components/search-form/src/toolbar-types.d.ts +45 -0
  26. package/packages/components/search-form/style.css +1 -1
  27. package/packages/components/search-form/style.css.gz +0 -0
  28. package/packages/components/select/index.js +257 -233
  29. package/packages/components/select/index.js.gz +0 -0
  30. package/packages/components/select/src/type.d.ts +97 -97
  31. package/packages/components/select/style.css +1 -1
  32. package/packages/components/select/style.css.gz +0 -0
  33. package/packages/components/select-input/index.js +2 -2
  34. package/packages/components/select-input/index.js.gz +0 -0
  35. package/packages/components/select-input/style.css +1 -1
  36. package/packages/components/select-input/style.css.gz +0 -0
  37. package/packages/components/tree-select/index.js +125 -122
  38. package/packages/components/tree-select/index.js.gz +0 -0
  39. package/packages/components/tree-select/src/App.vue.d.ts +3 -2
  40. package/packages/components/tree-select/src/type.d.ts +115 -112
  41. package/packages/components/tree-v2/style.css +1 -1
  42. package/packages/components/tree-v2/style.css.gz +0 -0
  43. package/release-meta.json +4 -4
@@ -0,0 +1,141 @@
1
+ # DasSearchForm 升级指南
2
+
3
+ 本文以当前最新 `DasSearchForm` 实现为准,说明从旧版表单迁移到工具栏布局、接入园区/楼栋通用筛选,以及保证业务请求时序正确的完整方式。它不是某个业务页面的复制模板;示例中的 `options`、列表接口和业务字段必须替换为目标页面自己的实现。
4
+
5
+ ## 1. 这次改动解决了什么
6
+
7
+ 新版 toolbar 不只是换布局,核心变化是把多园区空间筛选抽离成公共能力,弥补之前的项目切换:
8
+
9
+ 1. 业务原本接口的请求参数保持不变。页面需要按空间过滤时才配置空间控件;不需要空间过滤时不配置,组件不会请求园区数据,也不会生成空间条件。
10
+ 2. 公共请求层会把 `park(园区)`、`building(园区下空间)` 提升到 URL query;后端统一从 query 读取,POST/GET 等请求保持同一约定。
11
+ 3. 园区变化时先清空旧楼栋和普通筛选状态,加载新园区对应空间数据后再提交查询;楼栋实际变化后提交一次最新查询。
12
+ 6. `spaceChange` 只用于通知空间状态变化,不应在其中再次请求业务列表;业务查询统一使用 `@confirm`。
13
+
14
+ ## 2. 迁移前后
15
+
16
+ ### 旧版
17
+
18
+ ```vue
19
+ <DasSearchForm ref="searchFormRef" :options="options" @confirm="searchData" />
20
+ ```
21
+
22
+ 旧版默认是 `legacy`,字段可能按历史配置自动触发查询。迁移前应盘点字段回调、日期/重复规则、弹窗提交、分页和导出的所有请求路径。
23
+
24
+ ### toolbar 版
25
+
26
+ ```vue
27
+ <DasSearchForm
28
+ ref="searchFormRef"
29
+ layout-mode="toolbar"
30
+ :options="options"
31
+ :space-config="{
32
+ visible: true,
33
+ showPark: true,
34
+ showBuilding: true,
35
+ defaultPark: true,
36
+ parkMultiple: true,
37
+ buildingMultiple: false,
38
+ }"
39
+ @confirm="searchData"
40
+ @reset="resetAuxiliary"
41
+ @space-change="handleSpaceChange"
42
+ @space-error="handleSpaceError"
43
+ />
44
+ ```
45
+
46
+ toolbar 中普通字段变化只更新字段并执行字段回调,不自动提交列表查询;点击查询、调用实例 `confirm()`,以及空间初始化/园区联动完成后的内部确认会触发 `confirm`。字段回调中不要保留会造成重复列表请求的逻辑。
47
+
48
+ ## 3. Props 与空间配置
49
+
50
+ 以下是 toolbar 相关公共 Props:
51
+
52
+ | Prop | 默认值 | 说明 |
53
+ | --- | --- | --- |
54
+ | `layoutMode` | `legacy` | 传 `toolbar` 启用新版;不传不改变旧页面。 |
55
+ | `options` | `[]` | 普通筛选字段配置,可为 `null`。为空时不渲染普通筛选区域及查询/重置按钮,但空间控件仍可独立显示。 |
56
+ | `spaceConfig` | `{}` | 控制园区/楼栋显示、选择模式、默认值和数据源。 |
57
+ | `spaceValue` | 空空间值 | 受控空间状态,结构为 `{ parkIds: [], buildingIds: [] }`;推荐使用 `v-model:space-value` 接收组件变更。 |
58
+ | `searchOrder` | `last` | toolbar 普通字段的排列策略,不改变请求参数。 |
59
+
60
+ ### `spaceConfig`
61
+
62
+ | 字段 | 默认值 | 行为 |
63
+ | --- | --- | --- |
64
+ | `visible` | `false` | 空间能力总开关。关闭时不显示内置控件、不加载默认园区数据,也不输出 `park/building`。 |
65
+ | `showPark` | 跟随 `visible` | 是否显示园区下拉;关闭时 `confirm` 不输出 `park`。 |
66
+ | `showBuilding` | 跟随 `visible` | 是否显示楼栋/空间树;关闭时 `confirm` 不输出 `building`。 |
67
+ | `defaultPark` | `true` | 园区列表加载后且外部没有有效园区值时,是否自动选中第一项。关闭时不补默认园区,但仍会完成空间初始化并提交一次不带默认 `park` 的首次查询。 |
68
+ | `parkMultiple` | `true` | 园区是否多选。多选时 `confirm.park` 为 ID 数组;单选时为单个 ID 或空字符串。 |
69
+ | `buildingMultiple` | `false` | 楼栋/空间是否多选。`confirm.building` 始终是 ID 数组。 |
70
+ | `size` | `small` | 同时控制园区和楼栋控件尺寸。 |
71
+ | `load` | 默认数据源 | 自定义 `(signal) => Promise<{ parks, buildings }>`,提供后替代默认空间请求;应遵守 `AbortSignal`。 |
72
+
73
+ ### 配置边界
74
+
75
+ - 只有 `visible=true` 且至少一个空间控件启用时,组件才需要完成空间初始化并建立首次查询。
76
+ - `visible=true, showPark=false, showBuilding=true` 时,默认楼栋树缺少当前园区上下文;需要业务通过 `load` 返回完整可用树,不能期待组件自动选择全部园区。
77
+ - 仅显示园区时仍会加载园区列表;不显示楼栋时不会请求楼栋详情或空间树。
78
+ - 没有任何空间控件时,组件不初始化园区数据,不影响普通业务查询的首次加载。
79
+
80
+ ## 4. confirm、spaceChange 与请求时序
81
+
82
+ ### `confirm(formValues, selectedSpace)`
83
+
84
+ `confirm` 是业务列表查询的唯一推荐入口:
85
+
86
+ - `formValues` 是当前提交快照,包含普通字段和当前可见空间字段。
87
+ - 园区控件显示时字段名为 `park`;多选为数组,单选为标量,无选择时分别为 `[]` 或 `''`。
88
+ - 楼栋控件显示时字段名为 `building`,值为楼栋/楼层/空间 ID 数组。
89
+ - 控件隐藏时对应字段被省略,不是 `undefined` 或空数组。
90
+ - `selectedSpace` 是内部空间状态快照,结构为 `parkIds/buildingIds`,主要用于受控同步和调试;业务请求优先读取第一个参数。
91
+
92
+ 组件保证以下时序:
93
+
94
+ 1. 空间初始化未完成时,查询按钮和 `confirm()` 都不会提交业务查询。
95
+ 2. 初始化完成后只提交一次首次查询;`defaultPark` 只决定是否补选第一项,不决定是否跳过首次查询。
96
+ 3. 园区切换会先发布新园区并清空楼栋,再加载新园区空间数据,最后用最新空间快照确认。
97
+ 4. 楼栋选择实际改变后确认一次;同一个值被控件重复回写时不会再次确认。
98
+ 5. 选择已加载节点不会额外请求业务列表以外的空间详情;展开未加载节点可能触发合法的楼栋子节点懒加载。
99
+
100
+ ### `spaceChange`
101
+
102
+ `spaceChange` 在空间状态实际变化时触发,参数是复制后的 `{ parkIds, buildingIds }`。它适合:
103
+
104
+ - 同步父组件的 `spaceValue`;
105
+ - 更新页面标题、权限或其它依赖空间的 UI 状态;
106
+
107
+ 不要在 `spaceChange` 中直接调用业务列表接口,也不要再手动调用 `confirm`。空间选择完成后的业务查询由组件统一触发 `confirm`。
108
+
109
+
110
+ ## 5. reset 与实例方法
111
+
112
+ `DasSearchForm` 对外转发以下实例方法:
113
+
114
+ | 方法 | 用途 |
115
+ | --- | --- |
116
+ | `confirm()` | 等待字段异步回调完成后提交当前查询快照。空间未初始化完成时不会提交。 |
117
+ | `resetSearch()` | 恢复 `options` 的初始值,触发一次 `reset`,随后提交一次确认;默认保留园区/楼栋。 |
118
+ | `closeSearch(target)` | 清理指定普通筛选字段并触发 `clearSearch`;不修改空间状态。 |
119
+ | `treeSelectResetLazyLoad(key)` | 重置指定普通树选择字段的懒加载状态。 |
120
+ | `getCollapseStatus()` | 读取 toolbar 展开/收起状态。 |
121
+
122
+
123
+ ## 6. 典型边界场景
124
+
125
+ | 场景 | 预期行为 |
126
+ | --- | --- |
127
+ | 无空间控件、无默认值 | 不请求园区数据;普通表单按业务自己的查询时机提交。 |
128
+ | 仅园区控件、`defaultPark=true` | 加载园区列表,自动选首项,初始化完成后查询一次,query 带 `park`。 |
129
+ | 仅园区控件、`defaultPark=false` | 加载园区列表但不选首项,初始化完成后查询一次,query 不带有效 `park`。 |
130
+ | 园区和楼栋控件、默认值开启 | 首园区确定、楼栋数据加载完成后才首次查询;不会先发空 `park` 请求。 |
131
+ | 园区和楼栋控件、默认值关闭 | 不补园区;仍完成初始化并首次查询一次,后续用户选择园区/楼栋再查询。 |
132
+ | 切换园区 | 清空旧楼栋和普通筛选,加载新空间后查询一次,query 使用新 `park`。 |
133
+ | 选择楼栋 | query 同时带稳定的 `park` 和最新 `building`;重复回写不重复请求。 |
134
+ | 未配置园区/楼栋但业务接口可用 | 不产生空间字段;后端按通用接口逻辑处理,不强行关联园区。 |
135
+
136
+ ## 7. 其他说明
137
+
138
+ - 未配置 `layout-mode` 的旧页面行为不变。
139
+ - `park/building` 只在对应控件显示且有配置时出现.
140
+ - Network 中业务接口的 `park/building` 在 query中包含这两个字段。
141
+
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: das-search-form-toolbar-migration
3
+ description: 将业务页面的 DasSearchForm 迁移到 toolbar 布局,并接入可选的园区/楼栋通用筛选,保证空间初始化、confirm 时序、query 参数和业务查询行为正确。适用于按页面逐项升级,不用于无关组件重构。
4
+ ---
5
+
6
+ # DasSearchForm Toolbar 迁移 Skill
7
+
8
+ ## 先理解公共契约
9
+
10
+ 本 Skill 的核心不是把 `legacy` 改成 `toolbar`,而是把空间筛选从业务请求参数中抽离:
11
+
12
+ - 业务 JSON payload 不定义 `park`、`building`;需要空间过滤时才配置空间控件。
13
+ - Toolbar 内部状态为 `parkIds`、`buildingIds`;`confirm` 对外映射为 `park`、`building`。
14
+ - `createService` 在发送前把这两个字段放进 query,并从 JSON body 删除;后端统一从 query 读取。
15
+ - `spaceChange` 只通知空间状态变化;业务列表请求只从 `@confirm` 触发。
16
+ - 空间初始化、园区切换和楼栋变化都必须保证 query 使用稳定的最新空间值,不能通过业务页面 watcher 另行补请求。
17
+
18
+ 源码和测试优先于本文档:
19
+
20
+ - 组件入口:`packages/das-ui/packages/components/search-form/src/Index.vue`
21
+ - toolbar 实现:`.../src/Toolbar.vue`
22
+ - 空间类型:`.../src/toolbar-types.ts`
23
+ - 空间值映射:`.../src/hooks/toolbar-state.ts`
24
+ - 默认空间 API:`.../src/api/park-space.ts`
25
+ - 主指南:`../DasSearchForm升级指南.md`
26
+
27
+ ## 迁移步骤
28
+
29
+ 1. 读取目标页面和真实 API,盘点普通字段、异步字段回调、分页、日期/重复规则、弹窗提交和所有列表请求路径。
30
+ 2. 确认页面是否需要空间筛选。无空间筛选时不要配置 `spaceConfig.visible`,也不要为通用接口强行补 `park/building`。
31
+ 3. 若需要空间筛选,逐项确认 `visible`、`showPark`、`showBuilding`、`defaultPark`、`parkMultiple`、`buildingMultiple` 和是否自定义 `load`。
32
+ 4. 显式设置 `layout-mode="toolbar"`,优先保留原 `options`、字段 key/value、业务 handler 和页面辅助状态。
33
+ 5. 在 `@confirm` 中读取快照;不要在 `spaceChange`、字段 `change` 回调或 `@reset` 中重复请求列表。
34
+ 6. 使用 `createService` 发送请求,不在业务 API 中手动拼 `park/building` query,也不保留旧 `parkIds/buildingIds` 兼容字段。
35
+ 7. 验证首次进入、默认值开关、园区切换、楼栋选择、重置、分页和快速重复操作的请求次数与参数。
36
+
37
+ ## 空间配置决策
38
+
39
+ | 配置 | 默认 | 关键含义 |
40
+ | --- | --- | --- |
41
+ | `visible` | `false` | 总开关;关闭时不加载默认园区数据。 |
42
+ | `showPark` | 跟随 `visible` | 显示园区并决定是否输出 `park`。 |
43
+ | `showBuilding` | 跟随 `visible` | 显示空间树并决定是否输出 `building`。 |
44
+ | `defaultPark` | `true` | 是否自动选中首园区;关闭不等于跳过首次查询。 |
45
+ | `parkMultiple` | `true` | 园区多选模式。 |
46
+ | `buildingMultiple` | `false` | 楼栋/空间多选模式。 |
47
+ | `size` | `small` | 空间控件尺寸。 |
48
+ | `load` | 默认数据源 | 返回 `{ parks, buildings }` 的自定义数据适配器。 |
49
+
50
+ 重要边界:
51
+
52
+ - 仅园区控件且 `defaultPark=true`:首项加载后查询一次并带 `park`。
53
+ - 仅园区控件且 `defaultPark=false`:仍加载园区并完成首次查询,但首次不带有效 `park`。
54
+ - 园区+楼栋控件:首次查询必须等待园区和楼栋数据初始化完成。
55
+ - `showPark=false, showBuilding=true`:默认数据源没有园区上下文;需要自定义 `load` 提供完整树。
56
+ - 无空间控件:不初始化空间数据,不改变普通业务首次请求。
57
+
58
+ ## 事件与方法
59
+
60
+ - `@confirm="searchData"`:唯一推荐的业务查询入口,参数为 `(formValues, selectedSpace)`。
61
+ - `@reset="resetAuxiliary"`:清理业务页面在组件外维护的辅助状态;组件随后自动确认一次。
62
+ - `@space-change="handleSpaceChange"`:接收 `{ parkIds, buildingIds }` 状态快照,只做同步或 UI 联动,不发列表请求。
63
+ - `@space-error="handleSpaceError"`:空间数据加载失败诊断入口;失败时组件不会拿空空间条件抢先查询。
64
+ - `v-model:space-value`:需要受控空间状态时使用,值结构为 `{ parkIds, buildingIds }`。
65
+ - `confirm()`:等待字段异步回调和空间门禁后提交查询。
66
+ - `resetSearch()`:恢复普通字段、触发 reset 并确认,默认保留空间值。
67
+ - `closeSearch(target)`:清理普通字段,不清理空间值。
68
+ - `treeSelectResetLazyLoad(key)`:重置普通树字段的懒加载。
69
+ - `getCollapseStatus()`:读取 toolbar 折叠状态。
70
+
71
+ ## 推荐接入
72
+
73
+ ```vue
74
+ <das-search-form
75
+ ref="searchFormRef"
76
+ layout-mode="toolbar"
77
+ :options="options"
78
+ :space-config="{
79
+ visible: true,
80
+ showPark: true,
81
+ showBuilding: true,
82
+ defaultPark: true,
83
+ parkMultiple: true,
84
+ buildingMultiple: false,
85
+ }"
86
+ @confirm="searchData"
87
+ @reset="resetAuxiliary"
88
+ @space-change="handleSpaceChange"
89
+ />
90
+ ```
91
+
92
+ ```ts
93
+ function searchData(values: Record<string, any>) {
94
+ const data = { ...mapBusinessFields(values) }
95
+ if (Object.prototype.hasOwnProperty.call(values, 'park')) data.park = values.park
96
+ if (Object.prototype.hasOwnProperty.call(values, 'building')) data.building = values.building
97
+
98
+ requestList({ params: { project: projectId }, data })
99
+ }
100
+ ```
101
+
102
+ `park` 单选是标量、多选是数组;`building` 是 ID 数组。不要在这里把字段改回 `parkIds/buildingIds`,也不要手动同时放入 query 和 body。
103
+
104
+ ## 验收清单
105
+
106
+ - 首次空间初始化只提交一次业务查询,且不会先发空 `park` 的请求。
107
+ - 园区切换后旧楼栋被清空;新空间数据完成后 query 使用新 `park`。
108
+ - 楼栋选择后 query 同时包含最新 `park` 和 `building`,相同值重复回写不重复请求。
109
+ - `park/building` 在 query,JSON body 不包含它们;未配置空间控件的业务不出现这些字段。
110
+ - reset、字段变化、分页和业务回调不会各自重复请求。
111
+ - `options=null/[]` 时普通过滤区域和按钮隐藏,但空间控件仍可独立工作。
112
+ - 运行定向测试、受影响包类型检查和真实页面 Chrome 验证;未验证项必须在结论中说明。
113
+
@@ -0,0 +1,47 @@
1
+ # DasSearchForm Toolbar 迁移要点与常见问题
2
+
3
+ ## 参数边界
4
+
5
+ `park`、`building` 是跨业务的通用 query 条件,不是业务 payload 字段。只有页面配置并展示对应空间控件时,`confirm` 才会输出对应字段;未配置时组件不请求园区数据,也不生成空字段。
6
+
7
+ 业务使用 `createService` 发送请求即可:公共请求层会把数组参数按逗号放入 query,并从 JSON body 删除 `park/building`。后端无论 POST 还是 GET 都从 query 读取。不要在业务层自行拼接认证头、URL 或重复拆装空间参数。
8
+
9
+ ## 最容易误解的行为
10
+
11
+ ### `defaultPark=false` 是否意味着没有首次请求?
12
+
13
+ 不是。它只关闭“自动选择园区列表第一项”,不关闭空间初始化,也不关闭首次业务查询。组件仍会完成初始化并提交一次 `confirm`,此时没有有效默认园区,业务请求不应带有效 `park`。
14
+
15
+ ### 为什么不能在 `spaceChange` 中请求列表?
16
+
17
+ `spaceChange` 发生在内部空间状态发布时,适合做受控同步和 UI 联动;园区切换还需要等待楼栋数据加载,楼栋选择也可能发生重复回写。若业务在这里请求,会与组件自己的 `confirm` 竞争,产生空条件请求、重复请求或页面闪烁。列表请求统一放在 `@confirm`。
18
+
19
+ ### 楼栋选择为什么现在会查询?
20
+
21
+ 楼栋是业务过滤条件。选择值实际变化后,toolbar 会用最新 `park/building` 快照确认一次;同一值重复回写会被组件忽略。展开未加载节点触发的是空间子节点懒加载,不等同于业务列表查询。
22
+
23
+ ### 为什么首次请求不应该先发一次空 `park`?
24
+
25
+ 园区是全局通用条件,业务接口可能依赖它。toolbar 对空间初始化增加了门禁:园区列表、默认值和必要的楼栋数据完成后才允许首次 `confirm`,避免先展示错误结果再被第二次响应覆盖。
26
+
27
+ ## 快速排查
28
+
29
+ 1. 看 `spaceConfig.visible/showPark/showBuilding` 是否与页面实际显示一致。
30
+ 2. 看 `defaultPark` 是否被显式关闭,以及业务是否接受首次无 `park` 查询。
31
+ 3. 看业务是否在 `spaceChange`、字段 change 回调、watcher 和 `@confirm` 中重复请求。
32
+ 4. 看 Network:`park/building` 应在 query,request payload 不应包含它们。
33
+ 5. 看是否误用了旧 `parkIds/buildingIds`。它们只属于组件内部 `spaceValue`,不是对外业务参数。
34
+ 6. `showPark=false` 但楼栋为空时,检查自定义 `load` 是否提供了完整楼栋树和园区归属。
35
+
36
+ ## 预期请求次数
37
+
38
+ | 操作 | 预期业务列表请求 |
39
+ | --- | ---: |
40
+ | 无空间控件首次进入 | 按业务原有逻辑 |
41
+ | 空间控件首次初始化 | 1 |
42
+ | 园区切换 | 1,等待新空间数据完成后发送 |
43
+ | 楼栋实际变化 | 1 |
44
+ | 楼栋重复回写同一值 | 0 |
45
+ | toolbar 重置 | 1 |
46
+ | 仅展开未加载楼栋节点 | 0,只有空间子节点请求 |
47
+
@@ -1,56 +1,18 @@
1
- import type { SearchFormProp } from './hooks/searchFormItem';
2
- interface DasSearchFormProp {
3
- title?: string;
4
- options?: SearchFormProp[];
5
- labelLength?: string | number;
6
- showFilterPanel?: boolean;
7
- layout?: 'horizontal' | 'vertical';
8
- /**当无过滤面板时,部分设计右侧有间距 */
9
- isMarginRight?: boolean;
10
- labelPosition?: 'left' | 'top' | 'right';
11
- hasBtn?: boolean;
12
- isExpandAtFocus?: boolean;
13
- isExpandFilter?: boolean;
14
- }
15
- declare var __VLS_1: {}, __VLS_18: any, __VLS_19: {}, __VLS_31: any, __VLS_32: {}, __VLS_50: {}, __VLS_92: any, __VLS_93: {}, __VLS_105: any, __VLS_106: {}, __VLS_119: any, __VLS_120: {};
1
+ type __VLS_Props = {
2
+ layoutMode?: 'legacy' | 'toolbar';
3
+ };
4
+ declare var __VLS_8: string | number, __VLS_9: {};
16
5
  type __VLS_Slots = {} & {
17
- [K in NonNullable<typeof __VLS_18>]?: (props: typeof __VLS_19) => any;
18
- } & {
19
- [K in NonNullable<typeof __VLS_31>]?: (props: typeof __VLS_32) => any;
20
- } & {
21
- [K in NonNullable<typeof __VLS_92>]?: (props: typeof __VLS_93) => any;
22
- } & {
23
- [K in NonNullable<typeof __VLS_105>]?: (props: typeof __VLS_106) => any;
24
- } & {
25
- [K in NonNullable<typeof __VLS_119>]?: (props: typeof __VLS_120) => any;
26
- } & {
27
- left?: (props: typeof __VLS_1) => any;
28
- } & {
29
- right?: (props: typeof __VLS_50) => any;
6
+ [K in NonNullable<typeof __VLS_8>]?: (props: typeof __VLS_9) => any;
30
7
  };
31
- declare const __VLS_component: import("vue").DefineComponent<DasSearchFormProp, {
32
- /**treeSelect 调用懒加载树刷新 */
33
- treeSelectResetLazyLoad: (key: string) => void;
34
- closeSearch: (data: SearchFormProp | any[]) => Promise<void>;
35
- resetSearch: (isTriggerEvent?: boolean) => Promise<void>;
8
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
9
+ closeSearch: (...args: any[]) => any;
10
+ resetSearch: (...args: any[]) => any;
11
+ confirm: (...args: any[]) => any;
12
+ treeSelectResetLazyLoad: (...args: any[]) => any;
36
13
  getCollapseStatus: () => any;
37
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
38
- confirm: (e: any) => any;
39
- clearSearch: (e: any) => any;
40
- }, string, import("vue").PublicProps, Readonly<DasSearchFormProp> & Readonly<{
41
- onConfirm?: ((e: any) => any) | undefined;
42
- onClearSearch?: ((e: any) => any) | undefined;
43
- }>, {
44
- options: SearchFormProp[];
45
- title: string;
46
- layout: "horizontal" | "vertical";
47
- labelLength: string | number;
48
- labelPosition: "left" | "top" | "right";
49
- isExpandAtFocus: boolean;
50
- showFilterPanel: boolean;
51
- isMarginRight: boolean;
52
- hasBtn: boolean;
53
- isExpandFilter: boolean;
14
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
+ layoutMode: "legacy" | "toolbar";
54
16
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
55
17
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
56
18
  export default _default;
@@ -0,0 +1,61 @@
1
+ import type { SearchFormProp } from './hooks/searchFormItem';
2
+ interface DasSearchFormProp {
3
+ title?: string;
4
+ options?: SearchFormProp[];
5
+ labelLength?: string | number;
6
+ showFilterPanel?: boolean;
7
+ layout?: 'horizontal' | 'vertical';
8
+ /**当无过滤面板时,部分设计右侧有间距 */
9
+ isMarginRight?: boolean;
10
+ labelPosition?: 'left' | 'top' | 'right';
11
+ hasBtn?: boolean;
12
+ isExpandAtFocus?: boolean;
13
+ isExpandFilter?: boolean;
14
+ }
15
+ declare var __VLS_1: {}, __VLS_18: any, __VLS_19: {}, __VLS_31: any, __VLS_32: {}, __VLS_50: {}, __VLS_92: any, __VLS_93: {}, __VLS_105: any, __VLS_106: {}, __VLS_119: any, __VLS_120: {};
16
+ type __VLS_Slots = {} & {
17
+ [K in NonNullable<typeof __VLS_18>]?: (props: typeof __VLS_19) => any;
18
+ } & {
19
+ [K in NonNullable<typeof __VLS_31>]?: (props: typeof __VLS_32) => any;
20
+ } & {
21
+ [K in NonNullable<typeof __VLS_92>]?: (props: typeof __VLS_93) => any;
22
+ } & {
23
+ [K in NonNullable<typeof __VLS_105>]?: (props: typeof __VLS_106) => any;
24
+ } & {
25
+ [K in NonNullable<typeof __VLS_119>]?: (props: typeof __VLS_120) => any;
26
+ } & {
27
+ left?: (props: typeof __VLS_1) => any;
28
+ } & {
29
+ right?: (props: typeof __VLS_50) => any;
30
+ };
31
+ declare const __VLS_component: import("vue").DefineComponent<DasSearchFormProp, {
32
+ /**treeSelect 调用懒加载树刷新 */
33
+ treeSelectResetLazyLoad: (key: string) => void;
34
+ closeSearch: (data: SearchFormProp | any[]) => Promise<void>;
35
+ resetSearch: (isTriggerEvent?: boolean) => Promise<void>;
36
+ getCollapseStatus: () => any;
37
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
38
+ confirm: (e: any) => any;
39
+ clearSearch: (e: any) => any;
40
+ }, string, import("vue").PublicProps, Readonly<DasSearchFormProp> & Readonly<{
41
+ onConfirm?: ((e: any) => any) | undefined;
42
+ onClearSearch?: ((e: any) => any) | undefined;
43
+ }>, {
44
+ options: SearchFormProp[];
45
+ title: string;
46
+ layout: "horizontal" | "vertical";
47
+ labelLength: string | number;
48
+ labelPosition: "left" | "top" | "right";
49
+ isExpandAtFocus: boolean;
50
+ showFilterPanel: boolean;
51
+ isMarginRight: boolean;
52
+ hasBtn: boolean;
53
+ isExpandFilter: boolean;
54
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
55
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
56
+ export default _default;
57
+ type __VLS_WithSlots<T, S> = T & {
58
+ new (): {
59
+ $slots: S;
60
+ };
61
+ };
@@ -1,12 +1,15 @@
1
1
  import type { Props } from './hooks/searchFormItem';
2
- declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
+ type __VLS_Props = Props & {
3
+ size?: 'large' | 'default' | 'middle' | 'small' | 'table';
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
3
6
  "update:modelValue": (value: any) => any;
4
7
  "update:optionValue": (value: string | number) => any;
5
8
  selectChange: (value: string | number) => any;
6
9
  dateRangeChange: (value: any) => any;
7
10
  openDialogHandle: () => any;
8
11
  openDialogChange: (value: any) => any;
9
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
13
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
11
14
  "onUpdate:optionValue"?: ((value: string | number) => any) | undefined;
12
15
  onSelectChange?: ((value: string | number) => any) | undefined;
@@ -0,0 +1,57 @@
1
+ import type { SearchFormProp } from './hooks/searchFormItem';
2
+ import type { SpaceConfig, SpaceValue } from './toolbar-types';
3
+ type __VLS_Props = {
4
+ title?: string;
5
+ options?: SearchFormProp[] | null;
6
+ spaceConfig?: SpaceConfig;
7
+ spaceValue?: SpaceValue;
8
+ searchOrder?: 'last' | 'original';
9
+ };
10
+ declare function confirm(): Promise<void>;
11
+ declare function resetSearch(): Promise<void>;
12
+ declare function closeSearch(target: SearchFormProp | SearchFormProp[]): void;
13
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_31: {}, __VLS_33: {}, __VLS_99: string | undefined, __VLS_100: {};
14
+ type __VLS_Slots = {} & {
15
+ [K in NonNullable<typeof __VLS_99>]?: (props: typeof __VLS_100) => any;
16
+ } & {
17
+ left?: (props: typeof __VLS_1) => any;
18
+ } & {
19
+ space?: (props: typeof __VLS_3) => any;
20
+ } & {
21
+ space?: (props: typeof __VLS_31) => any;
22
+ } & {
23
+ right?: (props: typeof __VLS_33) => any;
24
+ };
25
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
26
+ confirm: typeof confirm;
27
+ resetSearch: typeof resetSearch;
28
+ closeSearch: typeof closeSearch;
29
+ getCollapseStatus: () => boolean;
30
+ treeSelectResetLazyLoad: (key: string) => void;
31
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ reset: (...args: any[]) => void;
33
+ confirm: (...args: any[]) => void;
34
+ clearSearch: (...args: any[]) => void;
35
+ "update:spaceValue": (...args: any[]) => void;
36
+ spaceChange: (...args: any[]) => void;
37
+ spaceError: (...args: any[]) => void;
38
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
39
+ onReset?: ((...args: any[]) => any) | undefined;
40
+ onConfirm?: ((...args: any[]) => any) | undefined;
41
+ onClearSearch?: ((...args: any[]) => any) | undefined;
42
+ "onUpdate:spaceValue"?: ((...args: any[]) => any) | undefined;
43
+ onSpaceChange?: ((...args: any[]) => any) | undefined;
44
+ onSpaceError?: ((...args: any[]) => any) | undefined;
45
+ }>, {
46
+ options: SearchFormProp[] | null;
47
+ title: string;
48
+ spaceConfig: SpaceConfig;
49
+ searchOrder: "last" | "original";
50
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
51
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
52
+ export default _default;
53
+ type __VLS_WithSlots<T, S> = T & {
54
+ new (): {
55
+ $slots: S;
56
+ };
57
+ };
@@ -0,0 +1,8 @@
1
+ import type { SpaceId, SpaceNode } from '../toolbar-types';
2
+ export declare function loadParkOptions(signal: AbortSignal): Promise<SpaceNode[]>;
3
+ export declare function loadParkDetail(parkId: SpaceId, signal: AbortSignal): Promise<any>;
4
+ export declare function extractRegions(detail: any): {
5
+ id: string;
6
+ name?: string;
7
+ }[];
8
+ export declare function loadSpaceChildren(spaceId: SpaceId | '', signal: AbortSignal): Promise<any[]>;
@@ -0,0 +1,7 @@
1
+ import type { Ref } from 'vue';
2
+ export declare function useCommonSpaceQuery(root: Ref<HTMLElement | undefined>, enabled: () => boolean, read: () => Record<string, any> | undefined, onActive: () => void): {
3
+ isActive: () => boolean;
4
+ notify(): void;
5
+ fail(error: unknown): void;
6
+ dispose(): void;
7
+ };
@@ -2,34 +2,36 @@ type DateType = 'date' | 'dateTime' | 'week' | 'month' | 'quarter' | 'year' | 't
2
2
  type DateRangeType = 'dateRange' | 'dateTimeRange' | 'weekRange' | 'monthRange' | 'yearRange' | 'timeRange';
3
3
  type FormType = 'input' | 'textarea' | 'password' | 'select' | 'treeSelect' | 'radio' | 'checkbox' | 'switch' | 'custom' | DateType | DateRangeType | 'cascader' | 'colorPicker' | 'selectInput' | 'inputDialogSelect' | 'inputNumber';
4
4
  export interface SearchFormProp {
5
- /**过滤条件key值 */
5
+ /** 查询结果对象中的字段名;未配置时该项不进入查询值。 */
6
6
  key?: string;
7
- /** v-model绑定值 */
7
+ /** 当前控件值,支持普通值或 Vue ref。 */
8
8
  value?: any;
9
- /** 若type为treeSelect,且需要有默认值,checkedNodes必传,为选中node数组类型 */
9
+ /** treeSelect 当前选中节点;设置树默认值时同步提供,保证标签和节点状态一致。 */
10
10
  checkedNodes?: any[];
11
- /** 过滤条件标签文本 */
11
+ /** 筛选字段显示名称。 */
12
12
  label?: any;
13
- /** 过滤条件的类型 过滤条件内的普通搜索框使用searchInput类型;带select的搜索框使用selectSearch ;带select搜索框的日期范围使用selectDateRange*;inputSelect选择弹窗*/
13
+ /** 控件类型;toolbar 模式会把 searchInput/selectSearch 默认排到字段末尾。 */
14
14
  type?: FormType | 'searchInput' | 'selectSearch' | 'selectDateRange' | 'inputSelect';
15
- /**过滤条件放顶部部还是过滤区内部 */
15
+ /** legacy 模式中控制字段位于顶部还是过滤面板内部;toolbar 模式不使用此布局字段。 */
16
16
  layout?: 'out' | 'inner';
17
- /** 在顶部已选择筛选区-是否可删除 */
17
+ /** legacy 已选条件标签是否允许删除。 */
18
18
  closable?: boolean;
19
- /** 是否启用自定义录入模式 */
19
+ /** 是否启用自定义录入与普通选项切换。 */
20
20
  custom?: boolean;
21
- /**自定义录入模式下:是否处于自定义筛选 */
21
+ /** 自定义录入模式当前是否处于自定义输入状态。 */
22
22
  customerActive?: boolean;
23
- /**自定义录入模式下:自定义项前面单选组的配置 */
23
+ /** 自定义录入模式的选项配置。 */
24
24
  customOption?: any;
25
- /**当type为selectDateRange,日期type使用dateType字段 */
25
+ /** type 为 selectDateRange 时,指定实际日期范围类型。 */
26
26
  dateType?: string;
27
- /**当type为selectDateRange,mode模式分为default,optional;默认default;其余组件mode赋值根据对应组件 */
27
+ /** 日期范围或底层控件的模式;具体取值由对应控件决定。 */
28
28
  mode?: string;
29
- /**当前配置项change事件是否需要自动触发confirm查询事件:默认为true --isChangeTrigger为false的使用情景:change需要调用的事件和confirm事件不一样*/
29
+ /** legacy 模式字段变化后是否自动查询;toolbar 模式始终由查询按钮或实例方法提交。 */
30
30
  isChangeTrigger?: boolean;
31
- /** 右边距 */
31
+ /** legacy 字段布局的右侧间距。 */
32
32
  marginRight?: string;
33
+ /** 单字段控件尺寸;toolbar 下未配置时,searchInput/selectDateRange/treeSelect 使用 middle。 */
34
+ size?: 'small' | 'middle' | 'large' | 'default' | 'table';
33
35
  [idx: string]: any;
34
36
  }
35
37
  export interface Props {
@@ -0,0 +1,23 @@
1
+ import type { SearchFormProp } from './searchFormItem';
2
+ export declare function createSearchSubmission(getOptions: () => SearchFormProp[]): {
3
+ read: () => {
4
+ value?: any;
5
+ optionValue?: any;
6
+ key?: string;
7
+ checkedNodes?: any[];
8
+ label?: any;
9
+ type?: ("input" | "select" | "textarea" | "custom" | "switch" | "password" | "treeSelect" | "radio" | "checkbox" | "cascader" | "colorPicker" | "selectInput" | "inputDialogSelect" | "inputNumber" | ("date" | "year" | "month" | "week" | "time" | "dateTime" | "quarter") | ("dateRange" | "dateTimeRange" | "weekRange" | "monthRange" | "yearRange" | "timeRange")) | "searchInput" | "selectSearch" | "selectDateRange" | "inputSelect";
10
+ layout?: "out" | "inner";
11
+ closable?: boolean;
12
+ custom?: boolean;
13
+ customerActive?: boolean;
14
+ customOption?: any;
15
+ dateType?: string;
16
+ mode?: string;
17
+ isChangeTrigger?: boolean;
18
+ marginRight?: string;
19
+ size?: "small" | "middle" | "large" | "default" | "table";
20
+ }[];
21
+ commit: () => void;
22
+ commitIfSubmitted: (payload?: unknown) => void;
23
+ };
@@ -0,0 +1,22 @@
1
+ import type { SearchFormProp } from './searchFormItem';
2
+ import type { SpaceConfig, SpaceId, SpaceNode, SpaceValue } from '../toolbar-types';
3
+ export declare function copyValue(value: any): any;
4
+ export declare function setField(item: any, key: string, value: any): void;
5
+ export declare function formValues(options: SearchFormProp[]): {
6
+ [k: string]: any;
7
+ };
8
+ export declare function includeVisibleSpaceValues(values: Record<string, any>, space: SpaceValue, config: SpaceConfig): Record<string, any>;
9
+ export declare function shouldLoadParkOptions(config: SpaceConfig): boolean;
10
+ export declare function shouldInitializeSpace(config: SpaceConfig): boolean;
11
+ export declare function normalizeSpace(value?: Partial<SpaceValue>): SpaceValue;
12
+ export declare function selectDefaultPark(space: SpaceValue, parks: SpaceNode[], config: SpaceConfig): SpaceValue;
13
+ export declare function mapSpaceNodes(nodes: any[], parkId?: SpaceId): SpaceNode[];
14
+ export declare function buildParkTrees(parks: {
15
+ park: SpaceNode;
16
+ regions: {
17
+ id: string;
18
+ name?: string;
19
+ }[];
20
+ }[], nodes: any[]): SpaceNode[];
21
+ export declare function buildingTree(nodes: SpaceNode[], parks: SpaceId[], inheritedPark?: SpaceId): SpaceNode[];
22
+ export declare function selectableBuildingIds(nodes: SpaceNode[]): SpaceId[];