@jzg223/design-runtime 0.0.0-stage → 0.0.1
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.
- package/CHANGELOG.md +176 -0
- package/README.md +275 -2
- package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/api.js +149 -0
- package/dist/comb/design-comb.vue.js +7 -0
- package/dist/comb/design-comb2.vue.js +591 -0
- package/dist/compat.js +74 -0
- package/dist/components/ApiSwitch.vue.js +7 -0
- package/dist/components/ApiSwitch2.vue.js +98 -0
- package/dist/components/design-debug/dev-mode-toggle.vue.js +7 -0
- package/dist/components/design-debug/dev-mode-toggle2.vue.js +41 -0
- package/dist/components/design-debug/dev-mode.js +45 -0
- package/dist/components/design-debug/dev-state-button.vue.js +7 -0
- package/dist/components/design-debug/dev-state-button2.vue.js +447 -0
- package/dist/components/design-debug/expr-eval.js +81 -0
- package/dist/components/design-shared/host-api.js +47 -0
- package/dist/components/design-shared/popup-host.js +11 -0
- package/dist/components/design-table/design-table-inner.vue.js +7 -0
- package/dist/components/design-table/design-table-inner2.vue.js +39 -0
- package/dist/components/design-table/design-table.vue.js +7 -0
- package/dist/components/design-table/design-table2.vue.js +937 -0
- package/dist/components/design-table/row-actions/delete-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/delete-action2.vue.js +42 -0
- package/dist/components/design-table/row-actions/edit-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/edit-action2.vue.js +145 -0
- package/dist/components/design-table/row-actions/index.js +36 -0
- package/dist/components/design-table/row-actions/modal-comb-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/modal-comb-action2.vue.js +66 -0
- package/dist/components/design-table/row-actions/modal-custom-action.vue.js +7 -0
- package/dist/components/design-table/row-actions/modal-custom-action2.vue.js +105 -0
- package/dist/components/design-table/row-actions/modal-form-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/modal-form-action2.vue.js +82 -0
- package/dist/components/design-table/row-actions/modal-table-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/modal-table-action2.vue.js +67 -0
- package/dist/components/design-table/row-actions/modal-tree-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/modal-tree-action2.vue.js +70 -0
- package/dist/components/design-table/row-actions/navigate-comb-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/navigate-comb-action2.vue.js +47 -0
- package/dist/components/design-table/row-actions/navigate-form-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/navigate-form-action2.vue.js +47 -0
- package/dist/components/design-table/row-actions/navigate-table-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/navigate-table-action2.vue.js +47 -0
- package/dist/components/design-table/row-actions/navigate-tree-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/navigate-tree-action2.vue.js +47 -0
- package/dist/components/design-table/row-actions/other-action.vue.js +4 -0
- package/dist/components/design-table/row-actions/other-action2.vue.js +44 -0
- package/dist/components/design-tools/add-tool.vue.js +4 -0
- package/dist/components/design-tools/add-tool2.vue.js +136 -0
- package/dist/components/design-tools/command-executor.js +135 -0
- package/dist/components/design-tools/export-tool.vue.js +4 -0
- package/dist/components/design-tools/export-tool2.vue.js +46 -0
- package/dist/components/design-tools/import-tool.vue.js +4 -0
- package/dist/components/design-tools/import-tool2.vue.js +101 -0
- package/dist/components/design-tools/index.js +36 -0
- package/dist/components/design-tools/modal-comb-tool.vue.js +4 -0
- package/dist/components/design-tools/modal-comb-tool2.vue.js +56 -0
- package/dist/components/design-tools/modal-form-tool.vue.js +4 -0
- package/dist/components/design-tools/modal-form-tool2.vue.js +66 -0
- package/dist/components/design-tools/modal-hcm-tool.vue.js +7 -0
- package/dist/components/design-tools/modal-hcm-tool2.vue.js +85 -0
- package/dist/components/design-tools/modal-table-tool.vue.js +4 -0
- package/dist/components/design-tools/modal-table-tool2.vue.js +54 -0
- package/dist/components/design-tools/modal-tree-tool.vue.js +4 -0
- package/dist/components/design-tools/modal-tree-tool2.vue.js +57 -0
- package/dist/components/design-tools/navigate-comb-tool.vue.js +4 -0
- package/dist/components/design-tools/navigate-comb-tool2.vue.js +34 -0
- package/dist/components/design-tools/navigate-form-tool.vue.js +4 -0
- package/dist/components/design-tools/navigate-form-tool2.vue.js +34 -0
- package/dist/components/design-tools/navigate-table-tool.vue.js +4 -0
- package/dist/components/design-tools/navigate-table-tool2.vue.js +33 -0
- package/dist/components/design-tools/other-tool.vue.js +4 -0
- package/dist/components/design-tools/other-tool2.vue.js +34 -0
- package/dist/components/flow-status-cell/flow-status-cell.vue.js +7 -0
- package/dist/components/flow-status-cell/flow-status-cell2.vue.js +124 -0
- package/dist/flow.js +22 -0
- package/dist/form/cell-condition.js +122 -0
- package/dist/form/derived-express.js +34 -0
- package/dist/form/design-form-inner.vue.js +7 -0
- package/dist/form/design-form-inner2.vue.js +449 -0
- package/dist/form/design-form.vue.js +7 -0
- package/dist/form/design-form2.vue.js +681 -0
- package/dist/form/fields/checkbox-field.vue.js +88 -0
- package/dist/form/fields/checkbox-field2.vue.js +4 -0
- package/dist/form/fields/custom-field.vue.js +36 -0
- package/dist/form/fields/custom-field2.vue.js +4 -0
- package/dist/form/fields/date-field.vue.js +64 -0
- package/dist/form/fields/date-field2.vue.js +4 -0
- package/dist/form/fields/embedded-list-field.vue.js +7 -0
- package/dist/form/fields/embedded-list-field2.vue.js +437 -0
- package/dist/form/fields/file-field.vue.js +88 -0
- package/dist/form/fields/file-field2.vue.js +4 -0
- package/dist/form/fields/image-field.vue.js +90 -0
- package/dist/form/fields/image-field2.vue.js +4 -0
- package/dist/form/fields/index.js +106 -0
- package/dist/form/fields/month-field.vue.js +51 -0
- package/dist/form/fields/month-field2.vue.js +4 -0
- package/dist/form/fields/org-select-field.vue.js +7 -0
- package/dist/form/fields/org-select-field2.vue.js +187 -0
- package/dist/form/fields/orgs-select-field.vue.js +182 -0
- package/dist/form/fields/orgs-select-field2.vue.js +4 -0
- package/dist/form/fields/radio-field.vue.js +91 -0
- package/dist/form/fields/radio-field2.vue.js +4 -0
- package/dist/form/fields/select-field.vue.js +7 -0
- package/dist/form/fields/select-field2.vue.js +317 -0
- package/dist/form/fields/splitline-field.vue.js +7 -0
- package/dist/form/fields/splitline-field2.vue.js +50 -0
- package/dist/form/fields/switch-field.vue.js +32 -0
- package/dist/form/fields/switch-field2.vue.js +4 -0
- package/dist/form/fields/text-field.vue.js +78 -0
- package/dist/form/fields/text-field2.vue.js +4 -0
- package/dist/form/fields/time-field.vue.js +50 -0
- package/dist/form/fields/time-field2.vue.js +4 -0
- package/dist/form/fields/tree-field.vue.js +157 -0
- package/dist/form/fields/tree-field2.vue.js +4 -0
- package/dist/form/number-precision.js +18 -0
- package/dist/form/transformer.js +162 -0
- package/dist/host.js +76 -0
- package/dist/http.js +19 -0
- package/dist/index.js +166 -0
- package/dist/mapping.js +44 -0
- package/dist/org/dept-api.js +30 -0
- package/dist/org/dept-tree-source.js +53 -0
- package/dist/org/dept-tree.js +122 -0
- package/dist/registry.js +77 -0
- package/dist/search/design-search.vue.js +7 -0
- package/dist/search/design-search2.vue.js +232 -0
- package/dist/search/transformer.js +115 -0
- package/dist/style.css +1220 -0
- package/dist/table/data.js +18 -0
- package/dist/table/load-gate.js +19 -0
- package/dist/table/query-body.js +59 -0
- package/dist/table/query-dedupe.js +54 -0
- package/dist/table/query-search.js +9 -0
- package/dist/table/row-action-mapping.js +34 -0
- package/dist/table/transformer.js +328 -0
- package/dist/tree/design-tree.vue.js +7 -0
- package/dist/tree/design-tree2.vue.js +783 -0
- package/dist/types/api.d.ts +83 -0
- package/dist/types/comb/design-comb.vue.d.ts +38 -0
- package/dist/types/compat.d.ts +46 -0
- package/dist/types/components/ApiSwitch.vue.d.ts +31 -0
- package/dist/types/components/design-debug/dev-mode-toggle.vue.d.ts +2 -0
- package/dist/types/components/design-debug/dev-mode.d.ts +8 -0
- package/dist/types/components/design-debug/dev-state-button.vue.d.ts +55 -0
- package/dist/types/components/design-debug/expr-eval.d.ts +55 -0
- package/dist/types/components/design-shared/host-api.d.ts +60 -0
- package/dist/types/components/design-shared/popup-host.d.ts +13 -0
- package/dist/types/components/design-table/design-table-inner.vue.d.ts +19 -0
- package/dist/types/components/design-table/design-table.vue.d.ts +70 -0
- package/dist/types/components/design-table/row-actions/delete-action.vue.d.ts +12 -0
- package/dist/types/components/design-table/row-actions/edit-action.vue.d.ts +14 -0
- package/dist/types/components/design-table/row-actions/index.d.ts +25 -0
- package/dist/types/components/design-table/row-actions/modal-comb-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/modal-custom-action.vue.d.ts +15 -0
- package/dist/types/components/design-table/row-actions/modal-form-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/modal-table-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/modal-tree-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/navigate-comb-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/navigate-form-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/navigate-table-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/navigate-tree-action.vue.d.ts +10 -0
- package/dist/types/components/design-table/row-actions/other-action.vue.d.ts +14 -0
- package/dist/types/components/design-tools/add-tool.vue.d.ts +23 -0
- package/dist/types/components/design-tools/command-executor.d.ts +80 -0
- package/dist/types/components/design-tools/export-tool.vue.d.ts +9 -0
- package/dist/types/components/design-tools/import-tool.vue.d.ts +14 -0
- package/dist/types/components/design-tools/index.d.ts +23 -0
- package/dist/types/components/design-tools/modal-comb-tool.vue.d.ts +12 -0
- package/dist/types/components/design-tools/modal-form-tool.vue.d.ts +12 -0
- package/dist/types/components/design-tools/modal-hcm-tool.vue.d.ts +23 -0
- package/dist/types/components/design-tools/modal-table-tool.vue.d.ts +12 -0
- package/dist/types/components/design-tools/modal-tree-tool.vue.d.ts +12 -0
- package/dist/types/components/design-tools/navigate-comb-tool.vue.d.ts +12 -0
- package/dist/types/components/design-tools/navigate-form-tool.vue.d.ts +11 -0
- package/dist/types/components/design-tools/navigate-table-tool.vue.d.ts +12 -0
- package/dist/types/components/design-tools/other-tool.vue.d.ts +16 -0
- package/dist/types/components/flow-status-cell/flow-status-cell.vue.d.ts +14 -0
- package/dist/types/components/index.d.ts +33 -0
- package/dist/types/flow.d.ts +50 -0
- package/dist/types/form/cell-condition.d.ts +35 -0
- package/dist/types/form/derived-express.d.ts +28 -0
- package/dist/types/form/design-form-inner.vue.d.ts +55 -0
- package/dist/types/form/design-form.vue.d.ts +96 -0
- package/dist/types/form/fields/checkbox-field.vue.d.ts +14 -0
- package/dist/types/form/fields/custom-field.vue.d.ts +22 -0
- package/dist/types/form/fields/date-field.vue.d.ts +12 -0
- package/dist/types/form/fields/embedded-list-field.vue.d.ts +26 -0
- package/dist/types/form/fields/file-field.vue.d.ts +12 -0
- package/dist/types/form/fields/image-field.vue.d.ts +12 -0
- package/dist/types/form/fields/index.d.ts +34 -0
- package/dist/types/form/fields/month-field.vue.d.ts +12 -0
- package/dist/types/form/fields/org-select-field.vue.d.ts +14 -0
- package/dist/types/form/fields/orgs-select-field.vue.d.ts +12 -0
- package/dist/types/form/fields/radio-field.vue.d.ts +14 -0
- package/dist/types/form/fields/select-field.vue.d.ts +14 -0
- package/dist/types/form/fields/splitline-field.vue.d.ts +7 -0
- package/dist/types/form/fields/switch-field.vue.d.ts +12 -0
- package/dist/types/form/fields/text-field.vue.d.ts +12 -0
- package/dist/types/form/fields/time-field.vue.d.ts +12 -0
- package/dist/types/form/fields/tree-field.vue.d.ts +12 -0
- package/dist/types/form/number-precision.d.ts +15 -0
- package/dist/types/form/transformer.d.ts +27 -0
- package/dist/types/host.d.ts +182 -0
- package/dist/types/http.d.ts +59 -0
- package/dist/types/index.d.ts +41 -0
- package/dist/types/mapping.d.ts +39 -0
- package/dist/types/org/dept-api.d.ts +12 -0
- package/dist/types/org/dept-tree-source.d.ts +15 -0
- package/dist/types/org/dept-tree.d.ts +62 -0
- package/dist/types/registry.d.ts +79 -0
- package/dist/types/search/design-search.vue.d.ts +46 -0
- package/dist/types/search/transformer.d.ts +36 -0
- package/dist/types/table/data.d.ts +30 -0
- package/dist/types/table/index.d.ts +20 -0
- package/dist/types/table/load-gate.d.ts +24 -0
- package/dist/types/table/query-body.d.ts +46 -0
- package/dist/types/table/query-dedupe.d.ts +42 -0
- package/dist/types/table/query-search.d.ts +21 -0
- package/dist/types/table/row-action-mapping.d.ts +36 -0
- package/dist/types/table/transformer.d.ts +59 -0
- package/dist/types/tree/design-tree.vue.d.ts +33 -0
- package/dist/types/types.d.ts +525 -0
- package/dist/types/utils/default-value.d.ts +16 -0
- package/dist/types/utils/download.d.ts +9 -0
- package/dist/types/utils/popup-width.d.ts +21 -0
- package/dist/utils/default-value.js +38 -0
- package/dist/utils/download.js +19 -0
- package/dist/utils/popup-width.js +19 -0
- package/package.json +73 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RowAction } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
action: RowAction;
|
|
4
|
+
category?: string;
|
|
5
|
+
params?: Record<string, any>;
|
|
6
|
+
pfield?: string;
|
|
7
|
+
row: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RowAction } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
action: RowAction;
|
|
4
|
+
category?: string;
|
|
5
|
+
params?: Record<string, any>;
|
|
6
|
+
pfield?: string;
|
|
7
|
+
row: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RowAction } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
action: RowAction;
|
|
4
|
+
category?: string;
|
|
5
|
+
gridApi?: any;
|
|
6
|
+
pfield?: string;
|
|
7
|
+
row: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
command: (action: RowAction, row: Record<string, any>) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onCommand?: ((action: RowAction, row: Record<string, any>) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tool: TableTool;
|
|
4
|
+
category?: string;
|
|
5
|
+
gridApi?: any;
|
|
6
|
+
/** 表格注入的额外参数(如树节点过滤字段),作为表单初始值预填 */
|
|
7
|
+
extraParams?: Record<string, any>;
|
|
8
|
+
/**
|
|
9
|
+
* 字段映射表达式作用域:由宿主视图注入,键即表达式可引用的数据源。
|
|
10
|
+
* 如列表 { params }、树形 { node, params }、表单/组合 { params, data }。
|
|
11
|
+
* 表达式示例:params.deptId、node.deptId、data.id
|
|
12
|
+
*/
|
|
13
|
+
mappingScope?: Record<string, any>;
|
|
14
|
+
};
|
|
15
|
+
declare function open(): Promise<void>;
|
|
16
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
17
|
+
trigger: typeof open;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
saved: () => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onSaved?: (() => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { DesignTableTool, RowAction } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* 执行后台配置的 JS 脚本(搬自宿主 `design-tools/src/command-executor.ts`)
|
|
4
|
+
*
|
|
5
|
+
* 脚本内可直接访问:
|
|
6
|
+
* - `row` 当前行数据(工具栏操作时为 {})
|
|
7
|
+
* - `action` 触发的 action/tool 配置
|
|
8
|
+
* - `ctx` 完整上下文(含 gridApi / category / pfield)
|
|
9
|
+
* - `api` 内置 helper(openUrl / navigate / openComponent / openDialog / refresh / message / confirm)
|
|
10
|
+
*
|
|
11
|
+
* ## 迁移时改的四处(都是「宿主能力不能 import」)
|
|
12
|
+
*
|
|
13
|
+
* 1. `~~#~~/router` 的 `router` → **上下文里的 `nav`**:组件用 `useRouter()` 拿到后传进来
|
|
14
|
+
* (vue-router 是 peer,组件里直接用是合法的;而本文件不是组件,拿不到 `useRouter()`,
|
|
15
|
+
* 所以由调用方注入,避免为它再造一个全局单例)。
|
|
16
|
+
* 2. `window.message` / `window.modal` → `host.message` / `host.modal` 注入;
|
|
17
|
+
* 缺失时不静默:warn 一次并说明怎么注入。
|
|
18
|
+
* 3. `openComponent('/src/views/x.vue')` 的**源码路径动态加载**(`import.meta.glob('/src/**')`)→
|
|
19
|
+
* **comname 注册表**(`resolveDesignComponent`)。旧的路径式解析把配置绑死在宿主源码结构上,
|
|
20
|
+
* 一重构就全废(该方案已废弃,见 README 设计约束)。
|
|
21
|
+
* 4. `loadRemoteComponent`(UMD 清单)→ **删除**:宿主项目已全面退役 UMD 那套
|
|
22
|
+
* (`public/ext/`、`window.__HCM_UI__`、`window.__HCM_FIELDS__` 均已删,见 TODO P1-15)。
|
|
23
|
+
*/
|
|
24
|
+
/** 路由跳转能力(调用方把 `useRouter()` 的结果传进来) */
|
|
25
|
+
export interface CommandNav {
|
|
26
|
+
push: (to: any) => any;
|
|
27
|
+
replace?: (to: any) => any;
|
|
28
|
+
}
|
|
29
|
+
/** 命令执行上下文 */
|
|
30
|
+
export interface CommandContext {
|
|
31
|
+
/** 触发的 action / tool 配置 */
|
|
32
|
+
action: DesignTableTool | RowAction;
|
|
33
|
+
/** 模块分类 */
|
|
34
|
+
category?: string;
|
|
35
|
+
/** 表格 grid API */
|
|
36
|
+
gridApi?: any;
|
|
37
|
+
/** 路由跳转能力(组件内 `useRouter()` 传入) */
|
|
38
|
+
nav?: CommandNav;
|
|
39
|
+
/** 主键字段名 */
|
|
40
|
+
pfield?: string;
|
|
41
|
+
/** 当前行数据(行操作有值,工具栏操作无) */
|
|
42
|
+
row?: Record<string, any>;
|
|
43
|
+
}
|
|
44
|
+
/** 脚本内可用的辅助函数(由调用方按需注入) */
|
|
45
|
+
export interface CommandHelpers {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
/** openComponent 的渲染选项 */
|
|
49
|
+
export interface OpenComponentOptions {
|
|
50
|
+
/** 组件事件监听(如 `{ saved: fn }`) */
|
|
51
|
+
on?: Record<string, Function>;
|
|
52
|
+
/** 传入组件的 props */
|
|
53
|
+
props?: Record<string, any>;
|
|
54
|
+
/** 弹窗标题 */
|
|
55
|
+
title?: string;
|
|
56
|
+
/** 弹窗宽度 */
|
|
57
|
+
width?: number | string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 动态加载组件并在 Modal 中渲染。
|
|
61
|
+
*
|
|
62
|
+
* `comname` 必须是宿主注册过的名字(`registerComponents({...})`),
|
|
63
|
+
* 与配置里的自定义组件是同一套名字 —— 写错会抛带 comname 的明确错误。
|
|
64
|
+
*/
|
|
65
|
+
export declare function openComponent(comname: string, opts?: OpenComponentOptions): Promise<{
|
|
66
|
+
close: () => void;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* 执行后台配置的 JS 脚本(函数体)。
|
|
70
|
+
*
|
|
71
|
+
* 示例脚本:
|
|
72
|
+
* ```js
|
|
73
|
+
* openComponent('employee-select', { props: { id: row.id }, title: row.name });
|
|
74
|
+
* api.openUrl('/detail?id=' + row.id);
|
|
75
|
+
* api.navigate('/detail?id=' + row.id);
|
|
76
|
+
* api.navigate({ path: '/detail', query: { id: row.id } }, { replace: true });
|
|
77
|
+
* api.message.success('已处理 ' + row.name);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function executeCommand(command: string | undefined, context: CommandContext, helpers?: CommandHelpers): Promise<any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tool: TableTool;
|
|
4
|
+
};
|
|
5
|
+
declare function execute(): Promise<void>;
|
|
6
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
7
|
+
trigger: typeof execute;
|
|
8
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tool: TableTool;
|
|
4
|
+
gridApi?: any;
|
|
5
|
+
};
|
|
6
|
+
declare function open(): void;
|
|
7
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
8
|
+
trigger: typeof open;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
imported: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onImported?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 工具条 `type` → 组件
|
|
4
|
+
*
|
|
5
|
+
* ## 为什么是 `defineAsyncComponent`(和 row-actions 同一个原因)
|
|
6
|
+
*
|
|
7
|
+
* 工具与设计组件互相引用:`design-table.vue` 渲染工具,而 `modal-table-tool` 又要渲染
|
|
8
|
+
* `design-table.vue`(`modal-form/comb/tree` 与 `add` 同理)。静态 import + 模块顶层
|
|
9
|
+
* `markRaw(Comp)` 会在 ESM 初始化阶段去读还没初始化的绑定,实测抛
|
|
10
|
+
* `ReferenceError: Cannot access '_sfc_main$N' before initialization`。
|
|
11
|
+
*
|
|
12
|
+
* 懒加载后:① 无初始化顺序问题;② 每个工具单独成 chunk,不点就不加载;
|
|
13
|
+
* ③ 与本库的 comname 注册表、行操作表同一套思路。
|
|
14
|
+
*
|
|
15
|
+
* 2026-10-27:**12 个全部迁入**。
|
|
16
|
+
*/
|
|
17
|
+
export declare const toolComponentMap: Record<string, Component>;
|
|
18
|
+
/** 尚未迁移的工具类型(现已全部迁入,保留空数组以兼容调用方的判断逻辑) */
|
|
19
|
+
export declare const pendingToolTypes: string[];
|
|
20
|
+
/** 已迁入的工具类型(顺序稳定,便于诊断页/文档使用) */
|
|
21
|
+
export declare const toolTypes: string[];
|
|
22
|
+
/** 按 type 取工具组件;未知类型 warn 一次并返回 undefined */
|
|
23
|
+
export declare function resolveToolComponent(type?: string): Component | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tool: TableTool;
|
|
4
|
+
category?: string;
|
|
5
|
+
/** 映射表达式作用域(由宿主视图注入,如 { params }) */
|
|
6
|
+
mappingScope?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
declare function trigger(): void;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
trigger: typeof trigger;
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tool: TableTool;
|
|
4
|
+
category?: string;
|
|
5
|
+
/** 映射表达式作用域(由宿主视图注入,如 { params }) */
|
|
6
|
+
mappingScope?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
declare function trigger(): void;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
trigger: typeof trigger;
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* 工具条「自定义组件」(type='hcm-tool',2026-10-21)
|
|
4
|
+
*
|
|
5
|
+
* 按钮由宿主工具条渲染(和 modal-form 等一致,组件本身无 UI),点击 `trigger()` 打开 antd Modal,
|
|
6
|
+
* 里面渲染业务组件(宿主 `src/components/hcm/` 里的那些,按 `tool.comname` 解析注册表)。
|
|
7
|
+
*
|
|
8
|
+
* 组件拿到:`cell`(工具项配置)、`rows`(当前选中行)、`params`、`api{request,message,reload,close}`。
|
|
9
|
+
* 组件名没配/没注册 → 回退占位框 + warn,弹窗不炸。
|
|
10
|
+
*/
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
tool: TableTool;
|
|
13
|
+
category?: string;
|
|
14
|
+
/** 表达式/参数作用域(宿主视图注入,如 { params }) */
|
|
15
|
+
mappingScope?: Record<string, any>;
|
|
16
|
+
/** vxe grid(取选中行 + 刷新列表用) */
|
|
17
|
+
gridApi?: any;
|
|
18
|
+
};
|
|
19
|
+
declare function trigger(): void;
|
|
20
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
21
|
+
trigger: typeof trigger;
|
|
22
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tool: TableTool;
|
|
4
|
+
category?: string;
|
|
5
|
+
/** 映射表达式作用域(由宿主视图注入,如 { params });结果作为目标列表 parentParams */
|
|
6
|
+
mappingScope?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
declare function trigger(): void;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
trigger: typeof trigger;
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tool: TableTool;
|
|
4
|
+
category?: string;
|
|
5
|
+
/** 映射表达式作用域(由宿主视图注入,如 { params });结果作为目标树形视图 parentParams */
|
|
6
|
+
mappingScope?: Record<string, any>;
|
|
7
|
+
};
|
|
8
|
+
declare function trigger(): void;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
trigger: typeof trigger;
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesignTableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
category?: string;
|
|
4
|
+
/** 映射表达式作用域(由宿主视图注入,如 { params });跳转 query = mappings 求值结果 + expressId 作为 id */
|
|
5
|
+
mappingScope?: Record<string, any>;
|
|
6
|
+
tool: DesignTableTool;
|
|
7
|
+
};
|
|
8
|
+
declare function execute(): void;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
trigger: typeof execute;
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DesignTableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
category?: string;
|
|
4
|
+
mappingScope?: Record<string, any>;
|
|
5
|
+
tool: DesignTableTool;
|
|
6
|
+
};
|
|
7
|
+
declare function execute(): void;
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
trigger: typeof execute;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesignTableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
category?: string;
|
|
4
|
+
/** 映射表达式作用域(由宿主视图注入,如 { params });跳转 query = mappings 求值结果 */
|
|
5
|
+
mappingScope?: Record<string, any>;
|
|
6
|
+
tool: DesignTableTool;
|
|
7
|
+
};
|
|
8
|
+
declare function execute(): void;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
trigger: typeof execute;
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DesignTableTool } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
category?: string;
|
|
4
|
+
gridApi?: any;
|
|
5
|
+
pfield?: string;
|
|
6
|
+
tool: DesignTableTool;
|
|
7
|
+
};
|
|
8
|
+
declare function execute(): void;
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
10
|
+
trigger: typeof execute;
|
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
command: (tool: DesignTableTool) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onCommand?: ((tool: DesignTableTool) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DesignFlowStatusVo } from '../../flow';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 流程状态映射: businessId → 状态行 */
|
|
4
|
+
flowMap?: Record<string, DesignFlowStatusVo>;
|
|
5
|
+
/** 主键字段名(取 businessId 用) */
|
|
6
|
+
pfield?: string;
|
|
7
|
+
row: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
changed: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onChanged?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** 组件集中导出(每个组件一个文件,便于 tree-shaking 与后续按需引入) */
|
|
2
|
+
export { default as ApiSwitch } from './ApiSwitch.vue';
|
|
3
|
+
export { default as DesignTable } from './design-table/design-table.vue';
|
|
4
|
+
export { default as DesignTableInner } from './design-table/design-table-inner.vue';
|
|
5
|
+
export { default as DesignTableFlowStatusCell } from './flow-status-cell/flow-status-cell.vue';
|
|
6
|
+
/**
|
|
7
|
+
* 调试台(开发模式):`dev-state-button` + `dev-mode-toggle` + `dev-mode` + `expr-eval`。
|
|
8
|
+
* 设计组件模板里自带 `<DesignDevStateButton>`,由 `?dev=1` 或 localStorage 打开(默认零渲染)。
|
|
9
|
+
*/
|
|
10
|
+
export { default as DesignDevModeToggle } from './design-debug/dev-mode-toggle.vue';
|
|
11
|
+
export { default as DesignDevStateButton } from './design-debug/dev-state-button.vue';
|
|
12
|
+
export { setDevMode, useDevMode } from './design-debug/dev-mode';
|
|
13
|
+
export { evalExpression } from './design-debug/expr-eval';
|
|
14
|
+
export { default as DesignComb } from '../comb/design-comb.vue';
|
|
15
|
+
export { default as DesignSearch } from '../search/design-search.vue';
|
|
16
|
+
export { default as DesignTree } from '../tree/design-tree.vue';
|
|
17
|
+
export { default as DesignForm } from '../form/design-form.vue';
|
|
18
|
+
export { default as DesignFormInner } from '../form/design-form-inner.vue';
|
|
19
|
+
/**
|
|
20
|
+
* 设计组件之间的共用件(不是组件本体):
|
|
21
|
+
* - `buildHostApi` / `hostRequest`:交给业务自定义组件的平台能力(见文件头说明)
|
|
22
|
+
* - `usePopupHost` / `DESIGN_POPUP_HOST_KEY`:弹层体系切换(vben 抽屉 ↔ antd 弹窗)
|
|
23
|
+
*/
|
|
24
|
+
export { buildHostApi, hostRequest, platformMessage } from './design-shared/host-api';
|
|
25
|
+
export type { DesignHostApi, DesignHostSlot } from './design-shared/host-api';
|
|
26
|
+
/** 工具条(design-tools):12 种全部迁入,按 type 懒加载 */
|
|
27
|
+
export { pendingToolTypes, resolveToolComponent, toolComponentMap, toolTypes, } from './design-tools';
|
|
28
|
+
export { executeCommand, openComponent } from './design-tools/command-executor';
|
|
29
|
+
export type { CommandContext, CommandHelpers, CommandNav, OpenComponentOptions, } from './design-tools/command-executor';
|
|
30
|
+
export { DESIGN_POPUP_HOST_KEY, usePopupHost } from './design-shared/popup-host';
|
|
31
|
+
export type { DesignPopupHost } from './design-shared/popup-host';
|
|
32
|
+
/** 行操作(design-table):12 个类型全部迁入,按 type 懒加载 */
|
|
33
|
+
export { pendingRowActionTypes, resolveRowActionComponent, rowActionComponentMap, rowActionTypes, } from './design-table/row-actions';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 低代码业务-流程关联(`design_flow_data`)运行时接口
|
|
3
|
+
* 后端: `org.dromara.design.controller.DesignFlowDataController`(`/design/flowData/*`)
|
|
4
|
+
*
|
|
5
|
+
* 与宿主 `components/design/flow-api.ts` 对齐,只把 alova 换成注入的 http。
|
|
6
|
+
*
|
|
7
|
+
* 静默口径:`designFlowStatus` 是**列表每次取数后都要批量调**的读接口(并发多条),
|
|
8
|
+
* 必须 `silent: true`;`submit` / `remove` 是用户点出来的动作,走宿主的默认提示。
|
|
9
|
+
*/
|
|
10
|
+
/** 发起流程参数 */
|
|
11
|
+
export interface DesignFlowSubmitParams {
|
|
12
|
+
/** 业务归属(运行时业务表 code,与列表取状态同口径) */
|
|
13
|
+
businessType: string;
|
|
14
|
+
/** 业务行主键 */
|
|
15
|
+
businessId: number | string;
|
|
16
|
+
/** 流程定义编码 */
|
|
17
|
+
flowCode: string;
|
|
18
|
+
/** 冗余业务标题(可选) */
|
|
19
|
+
businessTitle?: string;
|
|
20
|
+
/** 流程变量(建议含 __designMeta / entity / 条件字段) */
|
|
21
|
+
variables?: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
/** 发起流程返回: Warm-Flow 实例 id + 首个(申请人)任务 id */
|
|
24
|
+
export interface DesignFlowStartResult {
|
|
25
|
+
processInstanceId: number | string;
|
|
26
|
+
taskId: number | string;
|
|
27
|
+
}
|
|
28
|
+
/** 流程状态行(列表合并展示) */
|
|
29
|
+
export interface DesignFlowStatusVo {
|
|
30
|
+
businessId: string;
|
|
31
|
+
flowCode?: string;
|
|
32
|
+
instanceId?: number | string;
|
|
33
|
+
businessTitle?: string;
|
|
34
|
+
/** draft / waiting / finish / back / cancel / invalid / termination */
|
|
35
|
+
status?: string;
|
|
36
|
+
statusName?: string;
|
|
37
|
+
startTime?: string;
|
|
38
|
+
finishTime?: string;
|
|
39
|
+
}
|
|
40
|
+
/** 批量状态 / 删除入参 */
|
|
41
|
+
export interface DesignFlowQueryParams {
|
|
42
|
+
businessType: string;
|
|
43
|
+
businessIds: Array<number | string>;
|
|
44
|
+
}
|
|
45
|
+
/** 发起流程: 校验 → Warm-Flow 启动 → 写 flow_data(waiting) */
|
|
46
|
+
export declare function designFlowSubmit(body: DesignFlowSubmitParams): Promise<DesignFlowStartResult>;
|
|
47
|
+
/** 批量查询业务行流程状态(读接口,一页一次,必须静默) */
|
|
48
|
+
export declare function designFlowStatus(body: DesignFlowQueryParams): Promise<DesignFlowStatusVo[]>;
|
|
49
|
+
/** 删除业务行前的流程关联清理(审批中会被后端拒绝) */
|
|
50
|
+
export declare function designFlowRemove(body: DesignFlowQueryParams): Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PlatformFormCell } from '../types';
|
|
2
|
+
/** 作用域键能否注入表达式 */
|
|
3
|
+
export declare function isInjectableScopeKey(key: string): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* 条件表达式作用域:**只有派生字段值**(裸名 + `derivedValues` 对象)。
|
|
6
|
+
* 注意 `derivedValues` 放在最后:若某个派生字段正好叫 `derivedValues`,以对象本身为准(不被它覆盖)。
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildConditionScope(derivedValues: Record<string, any> | undefined): Record<string, any>;
|
|
9
|
+
/** 条件求值结果 */
|
|
10
|
+
export interface CellConditionResult {
|
|
11
|
+
/** 渲染条件(vif)是否通过:true = 渲染。未配置 → true */
|
|
12
|
+
render: boolean;
|
|
13
|
+
/** 显示条件(vshow)是否通过:true = 显示。未配置 → true */
|
|
14
|
+
show: boolean;
|
|
15
|
+
/** 表达式求值异常信息(异常按「不隐藏」处理,这里留痕给告警与开发面板) */
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
/** 单个 cell 的条件求值结果(未配任何条件 → 全部通过) */
|
|
19
|
+
export declare function evalCellCondition(cell: PlatformFormCell | undefined, scope: Record<string, any>): CellConditionResult;
|
|
20
|
+
/** 是否被条件隐藏(渲染条件为假 或 显示条件为假)—— 校验跳过、必填底色等都用它 */
|
|
21
|
+
export declare function isConditionHidden(result: CellConditionResult): boolean;
|
|
22
|
+
/** 开发面板里的一行:一个配了条件的单元格「到底算成什么」 */
|
|
23
|
+
export interface CellConditionDebugItem {
|
|
24
|
+
row: number;
|
|
25
|
+
col: number;
|
|
26
|
+
name?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
vif?: string;
|
|
29
|
+
vshow?: string;
|
|
30
|
+
render: boolean;
|
|
31
|
+
show: boolean;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
/** 只收「配了 vif/vshow 的格」的条件求值快照(开发面板用;没配条件的格不进快照,避免噪声) */
|
|
35
|
+
export declare function computeConditionDebug(cells: PlatformFormCell[] | undefined, scope: Record<string, any>): CellConditionDebugItem[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PlatformFormCell } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 「派生取值表达式」(cell.derivedExpress)的求值内核(纯函数,便于单测 —— 见 __tests__/derived-express.test.ts)。
|
|
4
|
+
*
|
|
5
|
+
* 派生字段是**表单级变量空间**,与具体输入项没有绑定关系:
|
|
6
|
+
* 输入项 → 派生字段:`deriveTo`(选中/输入后把值赋给派生字段)
|
|
7
|
+
* 派生字段 → 输入项:`dictFilter`(下拉按派生值过滤选项)、`derivedExpress`(监听派生值并回填本格)
|
|
8
|
+
* 典型用例:表单声明 `idCard` / `birthDate` 两个变量,身份证输入项把值赋给 `idCard`,
|
|
9
|
+
* 出生日期输入项用 `derivedExpress` 从 `idCard` 提取出生日期回填自己。
|
|
10
|
+
*
|
|
11
|
+
* 求值口径与工具条字段映射(design-tools/mapping.ts)**完全一致**:`new Function(...作用域键, 'return (表达式)')`。
|
|
12
|
+
*/
|
|
13
|
+
/** 表达式作用域:表单值 + 派生值裸名(同名时**派生值覆盖**,与 dictFilter 的 data 口径一致),另给两个对象 */
|
|
14
|
+
export declare function buildDerivedScope(formData: Record<string, any>, derivedValues: Record<string, any>): Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* 单个 cell 的应回填值。
|
|
17
|
+
* 返回 undefined 表示「不动本格」:未配表达式、求值抛错、或结果本身是 null/undefined。
|
|
18
|
+
* 注意:显式返回 ''(如 `idCard ? 提取 : ''`)属于有效结果,会清空本格。
|
|
19
|
+
*/
|
|
20
|
+
export declare function evalDerivedExpress(cell: PlatformFormCell | undefined, formData: Record<string, any>, derivedValues: Record<string, any>): any;
|
|
21
|
+
/**
|
|
22
|
+
* 需要回填的 `{name, value}` 列表:只收「配了表达式 + 有 name + 值确实变了」的 cell。
|
|
23
|
+
* 已相等(含 '' 与 undefined 归一相等)的跳过 —— 既避免无意义回写,也避免派生值→回填→派生值 的重复触发。
|
|
24
|
+
*/
|
|
25
|
+
export declare function computeDerivedFills(cells: PlatformFormCell[] | undefined, formData: Record<string, any>, derivedValues: Record<string, any>): Array<{
|
|
26
|
+
name: string;
|
|
27
|
+
value: any;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { CellConditionDebugItem } from './cell-condition';
|
|
2
|
+
import type { FormGridConfig } from './transformer';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
gridConfig?: FormGridConfig;
|
|
5
|
+
labelWidth?: number;
|
|
6
|
+
source?: Record<string, any>;
|
|
7
|
+
/** 表单主键字段名(内嵌列表 embedded-list 激活判定用) */
|
|
8
|
+
pfield?: string;
|
|
9
|
+
/** 表单外部参数(路由/上游 parentParams;内嵌列表关系映射的 params 作用域) */
|
|
10
|
+
extraParams?: Record<string, any>;
|
|
11
|
+
/** 表单所在模块(内嵌列表未存 module 时的兜底) */
|
|
12
|
+
category?: string;
|
|
13
|
+
};
|
|
14
|
+
/** 本格是否被条件隐藏(渲染条件为假 或 显示条件为假):隐藏格跳过必填/正则校验(隐藏=无需填写) */
|
|
15
|
+
declare function isCellHidden(cell: {
|
|
16
|
+
row: number;
|
|
17
|
+
col: number;
|
|
18
|
+
}): boolean;
|
|
19
|
+
/** 提交值:用户录入 + persist=true 的派生字段 */
|
|
20
|
+
declare function getSubmitValues(): Record<string, any>;
|
|
21
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
22
|
+
formApi: {
|
|
23
|
+
getValues: typeof getSubmitValues;
|
|
24
|
+
setValues: (values: Record<string, any>) => void;
|
|
25
|
+
resetForm: () => void;
|
|
26
|
+
form: {
|
|
27
|
+
values: Record<string, any>;
|
|
28
|
+
};
|
|
29
|
+
/** 派生字段值空间(开发模式调试用) */
|
|
30
|
+
derivedValues: Record<string, any>;
|
|
31
|
+
};
|
|
32
|
+
isCellHidden: typeof isCellHidden;
|
|
33
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
"data-change": (data: Record<string, any>) => any;
|
|
35
|
+
"derived-change": (snapshot: Record<string, any>) => any;
|
|
36
|
+
"condition-change": (snapshot: {
|
|
37
|
+
scope: Record<string, any>;
|
|
38
|
+
items: CellConditionDebugItem[];
|
|
39
|
+
}) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
41
|
+
"onData-change"?: ((data: Record<string, any>) => any) | undefined;
|
|
42
|
+
"onDerived-change"?: ((snapshot: Record<string, any>) => any) | undefined;
|
|
43
|
+
"onCondition-change"?: ((snapshot: {
|
|
44
|
+
scope: Record<string, any>;
|
|
45
|
+
items: CellConditionDebugItem[];
|
|
46
|
+
}) => any) | undefined;
|
|
47
|
+
}>, {
|
|
48
|
+
source: Record<string, any>;
|
|
49
|
+
labelWidth: number;
|
|
50
|
+
category: string;
|
|
51
|
+
pfield: string;
|
|
52
|
+
extraParams: Record<string, any>;
|
|
53
|
+
gridConfig: FormGridConfig;
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
export default _default;
|