@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,83 @@
|
|
|
1
|
+
import type { PlatformCombConfig, PlatformFormConfig, PlatformSearchConfig, PlatformTableConfig, PlatformTreeViewConfig, PlatformViewConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 清空配置缓存(`resetDesignHost()` 之后、或需要强制重取配置时用)。
|
|
4
|
+
* 登出 / 切换租户后不清会拿到上一个身份的配置。
|
|
5
|
+
*/
|
|
6
|
+
export declare function clearDesignApiCache(): void;
|
|
7
|
+
/**
|
|
8
|
+
* 获取表格配置
|
|
9
|
+
* API: POST /{category}/{name}/table
|
|
10
|
+
*
|
|
11
|
+
* 请求体与**数据接口同形状**:`{ search: {}, params: {...} }`。
|
|
12
|
+
* 后端用这里的 params/search 求标题表达式;不带的话 `params.month` 全是 nil,
|
|
13
|
+
* 标题会算成 `null发放批次123`。配置本身与参数无关,只有标题需要这份 env。
|
|
14
|
+
*/
|
|
15
|
+
export declare const fetchTableConfig: (category: string, name: string, params?: Record<string, any> | undefined) => Promise<PlatformTableConfig>;
|
|
16
|
+
/** 获取表单配置 API: POST /{category}/{name}/form */
|
|
17
|
+
export declare const fetchFormConfig: (category: string, name: string) => Promise<PlatformFormConfig>;
|
|
18
|
+
/**
|
|
19
|
+
* 获取查询表单(搜索)配置
|
|
20
|
+
* API: POST /{category}/{name}/sform
|
|
21
|
+
* 返回二维数组,每个内层数组是一行查询字段。
|
|
22
|
+
*/
|
|
23
|
+
export declare const fetchSearchConfig: (category: string, name: string) => Promise<PlatformSearchConfig>;
|
|
24
|
+
/** 获取视图/页面配置 API: POST /{category}/{name}/view */
|
|
25
|
+
export declare const fetchViewConfig: (category: string, name: string) => Promise<PlatformViewConfig>;
|
|
26
|
+
/** 获取组合视图配置 API: POST /{category}/{name}/comb */
|
|
27
|
+
export declare const fetchCombConfig: (category: string, name: string) => Promise<PlatformCombConfig>;
|
|
28
|
+
/**
|
|
29
|
+
* 获取组合视图数据(dataUrl 数据接口,返回单个对象,用于生成标题)
|
|
30
|
+
* @param url 配置中的 dataUrl 字段(相对路径)
|
|
31
|
+
* @param params 查询参数(路由 query 参数,如 id)
|
|
32
|
+
*/
|
|
33
|
+
export declare function fetchCombData(url: string, params?: Record<string, any>): Promise<Record<string, any>>;
|
|
34
|
+
/**
|
|
35
|
+
* 获取树形视图配置
|
|
36
|
+
* API: POST /{category}/{name}/tree
|
|
37
|
+
* 说明:本接口只返回配置,不内嵌树数据;树数据由下面的 `/design/dataSet/*` 按数据集类型加载
|
|
38
|
+
* (后端负责父子层级)。
|
|
39
|
+
*/
|
|
40
|
+
export declare const fetchTreeViewConfig: (category: string, name: string) => Promise<PlatformTreeViewConfig>;
|
|
41
|
+
/**
|
|
42
|
+
* 获取 design-ui 构建端地址(开发模式「编辑/设计」跳转用)
|
|
43
|
+
* API: GET /design/uiConfig → { uiUrl }
|
|
44
|
+
*/
|
|
45
|
+
export declare const fetchDesignUiConfig: () => Promise<{
|
|
46
|
+
uiUrl: string;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* 获取数据集数据(树形视图的树数据来源)
|
|
50
|
+
* API: POST /system/dataset/{dataSetName}/data
|
|
51
|
+
* 返回行数据数组(或 { datas: [...] } / { data: [...] },调用方负责归一化)。
|
|
52
|
+
*/
|
|
53
|
+
export declare function fetchDataSetData(dataSetName: string): Promise<any>;
|
|
54
|
+
/** 数据集运行时元信息:前端据此决定取数方式(requestMode)与节点展示约定 */
|
|
55
|
+
export interface DataSetMeta {
|
|
56
|
+
setCode: string;
|
|
57
|
+
setName?: string;
|
|
58
|
+
/** tree-树形 / list-列表型 */
|
|
59
|
+
setType?: string;
|
|
60
|
+
/** sync-同步 / async-异步 */
|
|
61
|
+
requestMode?: string;
|
|
62
|
+
idField?: string;
|
|
63
|
+
titleField?: string;
|
|
64
|
+
parentIdField?: string;
|
|
65
|
+
}
|
|
66
|
+
/** 列表数据提取(扁平行) */
|
|
67
|
+
export declare function fetchDataSetListData(setCode: string, params?: Record<string, any>): Promise<any[]>;
|
|
68
|
+
/** 同步树:后端整树嵌套返回(节点含原始行字段 + key/title + children/hasChild/isLeaf) */
|
|
69
|
+
export declare function fetchDataSetTreeSync(setCode: string, params?: Record<string, any>): Promise<any[]>;
|
|
70
|
+
/** 异步树:parentId 为空=根集合,否则=该父节点直接子集 */
|
|
71
|
+
export declare function fetchDataSetTreeAsync(setCode: string, parentId?: null | number | string, params?: Record<string, any>): Promise<any[]>;
|
|
72
|
+
/** 数据集元信息 */
|
|
73
|
+
export declare function fetchDataSetMeta(setCode: string): Promise<DataSetMeta>;
|
|
74
|
+
/**
|
|
75
|
+
* 树节点数量:按本次加载的节点批量取数量(500 个一批,服务端做)。
|
|
76
|
+
* 返回**只含有命中的 key**(未命中的由调用方按 `defaultValue` 补)。
|
|
77
|
+
*
|
|
78
|
+
* @param moduleName 模块编码(category)
|
|
79
|
+
* @param code 树形视图名称
|
|
80
|
+
* @param keys 本次加载节点的匹配值(matchField 留空时就是 node.key)
|
|
81
|
+
* @param params 组件自身参数(extraParams)
|
|
82
|
+
*/
|
|
83
|
+
export declare function fetchTreeNodeCount(moduleName: string, code: string, keys: any[], params?: Record<string, any>): Promise<Record<string, any>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool, PlatformCombConfig } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 模块分类 */
|
|
4
|
+
category?: string;
|
|
5
|
+
/** 配置名称 */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** 直接传入配置(可选,跳过 API 请求) */
|
|
8
|
+
config?: PlatformCombConfig | null;
|
|
9
|
+
/**
|
|
10
|
+
* 当前记录 id(上级如树/表单推送,对齐 DesignForm.sourceId)。
|
|
11
|
+
* 有值时作为权威 id:驱动 dataUrl 取单条(不再依赖组合级 expressId 从参数现算),
|
|
12
|
+
* 并进入表达上下文顶层 id 供组合项/标题读取;空 / 字面量 'undefined' / 'null' 忽略。
|
|
13
|
+
*/
|
|
14
|
+
sourceId?: string | number;
|
|
15
|
+
/** 上游组件推过来的参数;与路由参数合并为组件自身 extraParams(透传 dataUrl/内嵌子组件) */
|
|
16
|
+
parentParams?: Record<string, any>;
|
|
17
|
+
/** dev 悬浮按钮距容器顶部距离(px);嵌套在其它设计组件内时下移,避免与父组件按钮重叠 */
|
|
18
|
+
devButtonTop?: number;
|
|
19
|
+
};
|
|
20
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
|
+
"config-loaded": (config: any) => any;
|
|
22
|
+
"update:title": (title: string) => any;
|
|
23
|
+
"tool-command": (tool: TableTool) => any;
|
|
24
|
+
"update:remarks": (remarks: string) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
+
"onConfig-loaded"?: ((config: any) => any) | undefined;
|
|
27
|
+
"onUpdate:title"?: ((title: string) => any) | undefined;
|
|
28
|
+
"onTool-command"?: ((tool: TableTool) => any) | undefined;
|
|
29
|
+
"onUpdate:remarks"?: ((remarks: string) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
name: string;
|
|
32
|
+
config: PlatformCombConfig | null;
|
|
33
|
+
category: string;
|
|
34
|
+
sourceId: string | number;
|
|
35
|
+
parentParams: Record<string, any>;
|
|
36
|
+
devButtonTop: number;
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 运行时兼容自检
|
|
3
|
+
*
|
|
4
|
+
* 背景:本库把 `vue` / `antdv-next` 声明为 **peerDependencies**(构建时 external),
|
|
5
|
+
* 运行时用的是宿主那一份 —— 好处是全站只有一个实例,代价是**宿主装什么版本就用什么版本**。
|
|
6
|
+
* 版本对不上时的典型症状是"某个 prop 不生效""样式不对""Teleport 错位",
|
|
7
|
+
* 而且要排查很久才想到是版本问题。所以在宿主接入时主动查一次,**明确报出来**。
|
|
8
|
+
*
|
|
9
|
+
* 策略(与项目口径一致:不做偷偷兜底):
|
|
10
|
+
* - 低于/超出支持区间 → `console.error` 输出一条能直接照着改的提示;
|
|
11
|
+
* - 需要"启动即失败"的宿主,传 `{ throwOnError: true }`(或
|
|
12
|
+
* `installDesignPlatform({ strictCompat: true })`)→ 直接抛错。
|
|
13
|
+
*/
|
|
14
|
+
/** 声明支持区间(改这里要同步 package.json 的 peerDependencies、README「版本兼容与支持矩阵」与 CHANGELOG) */
|
|
15
|
+
export declare const SUPPORTED_VERSIONS: Record<string, string>;
|
|
16
|
+
export interface CompatCheckItem {
|
|
17
|
+
found: string;
|
|
18
|
+
ok: boolean;
|
|
19
|
+
/** 声明支持区间 */
|
|
20
|
+
supported: string;
|
|
21
|
+
/** 包名 */
|
|
22
|
+
pkg: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CompatReport {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
items: CompatCheckItem[];
|
|
27
|
+
/** 一句话结论(有问题的包列在里面) */
|
|
28
|
+
message: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 极简 semver 匹配:只为自检服务,支持 `^` / `~` / `>=` / `>` / `<=` / `<` / 精确 / `*`。
|
|
32
|
+
* 不引第三方库,避免"为了检查依赖又加一个依赖"。
|
|
33
|
+
*/
|
|
34
|
+
export declare function satisfiesRange(version: string, range: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* 检查宿主实际安装的版本是否落在支持区间内。
|
|
37
|
+
*
|
|
38
|
+
* ```ts
|
|
39
|
+
* // 宿主 bootstrap(或 CI 冒烟脚本里)
|
|
40
|
+
* const report = checkDesignRuntimeCompat({ throwOnError: true })
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function checkDesignRuntimeCompat(options?: {
|
|
44
|
+
silent?: boolean;
|
|
45
|
+
throwOnError?: boolean;
|
|
46
|
+
}): CompatReport;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SwitchProps } from 'antdv-next';
|
|
2
|
+
interface Props {
|
|
3
|
+
/** 选中时的文案,默认「启用」 */
|
|
4
|
+
checkedText?: string;
|
|
5
|
+
/** 未选中时的文案,默认「禁用」 */
|
|
6
|
+
unCheckedText?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** 真正执行更新的逻辑(内部已双向绑定,可直接拿到新值) */
|
|
9
|
+
api: (checked: SwitchProps['checked']) => PromiseLike<void> | void;
|
|
10
|
+
/** 更新前是否弹窗确认 */
|
|
11
|
+
confirm?: boolean;
|
|
12
|
+
/** 确认框文案(可自定义),默认「确认要更新状态吗?」 */
|
|
13
|
+
confirmText?: (checked: SwitchProps['checked']) => string;
|
|
14
|
+
}
|
|
15
|
+
type __VLS_Props = Props;
|
|
16
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
17
|
+
'value'?: SwitchProps['checked'];
|
|
18
|
+
};
|
|
19
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
reload: () => any;
|
|
21
|
+
"update:value": (value: import("antdv-next/dist/switch/index").CheckedValueType | undefined) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
onReload?: (() => any) | undefined;
|
|
24
|
+
"onUpdate:value"?: ((value: import("antdv-next/dist/switch/index").CheckedValueType | undefined) => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
checkedText: string;
|
|
27
|
+
unCheckedText: string;
|
|
28
|
+
confirm: boolean;
|
|
29
|
+
confirmText: (checked: SwitchProps["checked"]) => string;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设置开发模式开关。
|
|
3
|
+
* on=true:持久化到 localStorage(后续访问自动进入);
|
|
4
|
+
* on=false:清理 localStorage,并移除 URL 参数,保证刷新后保持关闭。
|
|
5
|
+
*/
|
|
6
|
+
export declare function setDevMode(on: boolean): void;
|
|
7
|
+
/** 获取共享的开发模式状态(ref,模板中可直接 v-if / 解包) */
|
|
8
|
+
export declare function useDevMode(): import("vue").Ref<boolean, boolean>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 组件显示名(弹窗标题用),如 "DesignForm" */
|
|
3
|
+
title: string;
|
|
4
|
+
/**
|
|
5
|
+
* 状态分 tab:key=tab 名(parentParams / extraParams / route / config / ...),
|
|
6
|
+
* value=任意可 JSON 序列化的数据。传入的是响应式 computed 时弹窗内实时更新。
|
|
7
|
+
*/
|
|
8
|
+
state: Record<string, any>;
|
|
9
|
+
/**
|
|
10
|
+
* 设计器类型(form/table/search/combo/tree/view)。
|
|
11
|
+
* 传入后在开发模式弹窗内显示「编辑」「设计」按钮,
|
|
12
|
+
* window.open 打开 design-ui 构建端并深链到目标配置。
|
|
13
|
+
*/
|
|
14
|
+
designerType?: string;
|
|
15
|
+
/** 模块编码(design-ui 的 module code) */
|
|
16
|
+
designerCategory?: string;
|
|
17
|
+
/** 配置名称(design-ui 的 name) */
|
|
18
|
+
designerName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 「表达式计算」用的真实映射作用域(可选,如 { params, data } / { params, node, router })。
|
|
21
|
+
* **传入后独占**:弹窗里的「可用作用域」= 该组件表达式真正能用的变量,
|
|
22
|
+
* 因此面板算出的值 = 映射实际会算出的值。各组件作用域不同,不要互相照抄:
|
|
23
|
+
* DesignForm / DesignComb → params + data;DesignTree → params + node;
|
|
24
|
+
* DesignTable / DesignView → params;DesignSearch → data(无字段映射)。
|
|
25
|
+
*/
|
|
26
|
+
exprScope?: Record<string, any>;
|
|
27
|
+
/**
|
|
28
|
+
* 「表达式计算」的**第二个可选作用域**(可选)。传入后表达式 tab 顶部出现作用域切换按钮,
|
|
29
|
+
* 可在「映射作用域」与它之间切换 —— 用于调试**非映射类**表达式(如单元格渲染条件 vif /
|
|
30
|
+
* 显示条件 vshow,其作用域只有派生字段值)。
|
|
31
|
+
* **不传时行为与改动前完全一致**(只有映射作用域,无切换按钮)。
|
|
32
|
+
*/
|
|
33
|
+
exprScopeExtra?: {
|
|
34
|
+
/** 切换按钮文字,如「条件作用域(派生值)」 */
|
|
35
|
+
label: string;
|
|
36
|
+
/** 该作用域的变量空间 */
|
|
37
|
+
scope: Record<string, any>;
|
|
38
|
+
/** 选中时显示在提示行里的说明(可选) */
|
|
39
|
+
hint?: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 各作用域变量的含义(可选,如 { params: '组件自身参数(extraParams)' }),
|
|
43
|
+
* 拼进 chip 提示,让「params 到底是什么」在面板里直接可见。
|
|
44
|
+
*/
|
|
45
|
+
exprScopeLabels?: Record<string, string>;
|
|
46
|
+
/**
|
|
47
|
+
* 悬浮按钮距容器顶部的距离(px)。
|
|
48
|
+
* 嵌套在其它设计组件内(如 tree 内嵌 table)时传更大值,避免与父组件按钮重叠。
|
|
49
|
+
*/
|
|
50
|
+
top?: number;
|
|
51
|
+
};
|
|
52
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
53
|
+
top: number;
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 开发面板「表达式计算」的求值内核(纯函数,便于单测 —— 见同目录 __tests__/expr-eval.test.ts)。
|
|
3
|
+
*
|
|
4
|
+
* 语义与 design-tools/mapping.ts 的 evaluateMappedExpress **完全一致**:
|
|
5
|
+
* 把表达式包成 `return (表达式)`,把作用域对象的所有键作为函数形参名注入。
|
|
6
|
+
* 因此开发面板里算出来的值,就是工具条「字段映射」真正会算出来的值 —— 这是这套工具的价值所在。
|
|
7
|
+
*/
|
|
8
|
+
/** 作用域键能否注入表达式(非法键名会让 new Function 直接语法报错,故剔除) */
|
|
9
|
+
export declare function isValidScopeKey(key: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 组装表达式作用域。
|
|
12
|
+
*
|
|
13
|
+
* **组件传入 exprScope 时以它为准且独占**:「可用作用域」= 该组件表达式真正能用的变量,
|
|
14
|
+
* 各组件互不相同 ——
|
|
15
|
+
* - DesignForm / DesignComb → `params`(组件自身参数 extraParams)+ `data`
|
|
16
|
+
* - DesignTree → `params` + `node`(不含 router:路由参数已并入 extraParams)
|
|
17
|
+
* - DesignTable / DesignView → `params`
|
|
18
|
+
* - DesignSearch → `data`(查询表单当前值;该组件无字段映射)
|
|
19
|
+
* 不把开发面板的 state 键(props/route/config/...)混进来,否则面板里能算出值、
|
|
20
|
+
* 真实映射里却取不到,反而给出错误信心。
|
|
21
|
+
*
|
|
22
|
+
* 未接线组件的最小兜底:只给 `params`(按项目约定指向 extraParams)。
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildExprScope(state?: Record<string, any> | null, exprScope?: Record<string, any> | null): Record<string, any>;
|
|
25
|
+
/** 可在表达式里使用的变量名(非法标识符不进作用域,也不在面板里展示) */
|
|
26
|
+
export declare function listScopeKeys(scope: Record<string, any>): string[];
|
|
27
|
+
/**
|
|
28
|
+
* 作用域变量 chip 的提示文本:`含义 —— 类型与结构`。
|
|
29
|
+
* labels 由组件传入(如 { params: '组件自身参数(extraParams)' }),
|
|
30
|
+
* 让「可用作用域」自己说清 params 到底是什么、各组件差别在哪。
|
|
31
|
+
*/
|
|
32
|
+
export declare function scopeKeyTip(key: string, value: any, labels?: Record<string, string> | null): string;
|
|
33
|
+
export interface ExprEvalResult {
|
|
34
|
+
/** 是否求值成功(语法错误 / 运行时报错时为 false) */
|
|
35
|
+
ok: boolean;
|
|
36
|
+
/** 结果类型标签:string / number / boolean / object / array / null / undefined / function */
|
|
37
|
+
type: string;
|
|
38
|
+
/** 结果展示文本(对象/数组为格式化 JSON,字符串带引号) */
|
|
39
|
+
text: string;
|
|
40
|
+
/** 是否未取到值(undefined / null)—— 排查「映射配了但没传值」时最常见的原因 */
|
|
41
|
+
empty: boolean;
|
|
42
|
+
/** 失败原因(ok=false 时) */
|
|
43
|
+
error?: string;
|
|
44
|
+
}
|
|
45
|
+
/** 把求值结果整理成展示信息:类型 + 文本 + 是否空值 */
|
|
46
|
+
export declare function describeValue(value: any): ExprEvalResult;
|
|
47
|
+
/**
|
|
48
|
+
* 对表达式求值并整理结果;表达式为空返回 null(面板据此显示引导文案)。
|
|
49
|
+
* 与 design-tools/mapping.ts 同款动态执行:仅用于开发模式面板中开发者本人输入的调试表达式。
|
|
50
|
+
*/
|
|
51
|
+
export declare function evalExpression(expr: string, scope: Record<string, any>): ExprEvalResult | null;
|
|
52
|
+
/** 作用域变量的取值预览(面板 chips 的 title,先看清结构再写表达式) */
|
|
53
|
+
export declare function previewScopeValue(value: any): string;
|
|
54
|
+
/** 点击作用域变量:把键名追加到表达式末尾(接在 `.` 后则不再补空格) */
|
|
55
|
+
export declare function appendScopeKey(expression: string, key: string): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 扩展包组件(业务自定义组件)在**任意宿主插槽**里拿到的平台能力
|
|
3
|
+
* (搬自宿主 `components/design/design-runtime/host-api.ts`)
|
|
4
|
+
*
|
|
5
|
+
* 五个插槽用的是同一套 `api`,差异只在多出的上下文 props:
|
|
6
|
+
* form-field → cell / modelValue / disabled
|
|
7
|
+
* table-cell → cell / row / value
|
|
8
|
+
* toolbar → cell(工具项)/ rows(选中行)
|
|
9
|
+
* row-action → cell(操作项)/ row
|
|
10
|
+
* page → route(query / params / path)
|
|
11
|
+
*
|
|
12
|
+
* 设计原则(与宿主侧 `HcmFieldContext` 一致):**扩展包不 import 基座内部模块**,
|
|
13
|
+
* 能力一律从这里传进去 —— 这样业务组件既能被本库渲染,也能被别处复用。
|
|
14
|
+
*
|
|
15
|
+
* 迁移时的两处替换:
|
|
16
|
+
* - `alovaInstance` → **注入的 http**(`requireHttp()`,没有第二套拦截器)
|
|
17
|
+
* - antd `message` 静态方法 → 优先用注入的 `host.message`(宿主那份支持主题与
|
|
18
|
+
* `ConfigProvider` 上下文),未注入时才回退 antdv-next 的静态 `message`
|
|
19
|
+
* (这是**外观能力**,不是业务口径,所以可以回退;业务口径如 http 一律不回退)
|
|
20
|
+
*/
|
|
21
|
+
/** 宿主位置(扩展包组件用它区分自己被谁渲染了) */
|
|
22
|
+
export type DesignHostSlot = 'form' | 'page' | 'row-action' | 'table-cell' | 'toolbar';
|
|
23
|
+
export interface DesignHostApi {
|
|
24
|
+
/** 平台轻提示(loading 返回关闭函数) */
|
|
25
|
+
message: {
|
|
26
|
+
error: (msg: string) => void;
|
|
27
|
+
loading: (content: string) => () => void;
|
|
28
|
+
success: (msg: string) => void;
|
|
29
|
+
warning: (msg: string) => void;
|
|
30
|
+
};
|
|
31
|
+
/** 平台请求(走注入的 http,返回值已解包成业务数据) */
|
|
32
|
+
request: (config: {
|
|
33
|
+
data?: any;
|
|
34
|
+
method?: string;
|
|
35
|
+
params?: Record<string, any>;
|
|
36
|
+
url: string;
|
|
37
|
+
}) => Promise<any>;
|
|
38
|
+
/** 仅弹窗类插槽:关闭弹窗 */
|
|
39
|
+
close?: () => void;
|
|
40
|
+
/** 仅列表类插槽:刷新当前列表 */
|
|
41
|
+
reload?: () => void;
|
|
42
|
+
}
|
|
43
|
+
/** 平台请求:POST 带 body,其余按 GET 带 query */
|
|
44
|
+
export declare function hostRequest(config: {
|
|
45
|
+
data?: any;
|
|
46
|
+
method?: string;
|
|
47
|
+
params?: Record<string, any>;
|
|
48
|
+
url: string;
|
|
49
|
+
}): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* 平台轻提示:优先注入的 `host.message`(支持宿主主题/ConfigProvider 上下文),
|
|
52
|
+
* 未注入时回退 antdv-next 的静态 `message`。
|
|
53
|
+
* 这是**外观能力**,不是业务口径 —— 业务口径(http / 鉴权 / 字典)一律不回落。
|
|
54
|
+
*/
|
|
55
|
+
export declare function platformMessage(): DesignHostApi['message'];
|
|
56
|
+
/** 组装平台能力(`extra` 是插槽专属的可选能力:reload / close) */
|
|
57
|
+
export declare function buildHostApi(extra?: {
|
|
58
|
+
close?: () => void;
|
|
59
|
+
reload?: () => void;
|
|
60
|
+
}): DesignHostApi;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* design 运行时弹层的宿主体系(搬自宿主 `components/design/popup-host.ts`)
|
|
4
|
+
*
|
|
5
|
+
* 页面级(独立页/树右区/组合项等)默认用 vben(reka-ui) 弹层(抽屉/弹窗);
|
|
6
|
+
* 当列表/树/组合/表单被放进 antd `<Modal>`(弹窗列表/弹窗树/弹窗表单/弹窗组合 动作或工具)
|
|
7
|
+
* 打开时,容器内再叠 vben 抽屉会与 antd Modal 的焦点管理冲突(点不进表单、Tab 进不去),
|
|
8
|
+
* 因此容器组件 provide 'antd',其子树里的 AddTool / EditAction 等改为打开同体系的 antd 弹窗。
|
|
9
|
+
*/
|
|
10
|
+
export type DesignPopupHost = 'antd' | 'vben';
|
|
11
|
+
export declare const DESIGN_POPUP_HOST_KEY: InjectionKey<DesignPopupHost>;
|
|
12
|
+
/** 读取当前弹层宿主(默认 vben) */
|
|
13
|
+
export declare function usePopupHost(defaultHost?: DesignPopupHost): DesignPopupHost;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
formOptions?: Record<string, any>;
|
|
3
|
+
gridOptions?: Record<string, any>;
|
|
4
|
+
tableTitle?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_7: string | number, __VLS_8: any;
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
[K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
11
|
+
gridApi: any;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { DesignTableTool as TableTool, PlatformTableConfig, RowAction } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 模块分类 */
|
|
4
|
+
category?: string;
|
|
5
|
+
/** 配置名称 */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** 直接传入配置(可选,跳过 API 请求) */
|
|
8
|
+
config?: PlatformTableConfig | null;
|
|
9
|
+
/**
|
|
10
|
+
* 上游组件推过来的参数(如树节点参数);与路由参数合并为组件自身 extraParams。
|
|
11
|
+
* ⚠ 它只进请求体的 `params`(表达式 env,供配置里 `${params.x}` / 动作条件用),
|
|
12
|
+
* **不参与 search 过滤**(想按列过滤请在列表上配查询表单字段或 pager 动作条件)。
|
|
13
|
+
*/
|
|
14
|
+
parentParams?: Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* 页面显式传入的查询条件(如 DesignSearch 点「查询」后的值):
|
|
17
|
+
* 每次取数时读最新值,作为 `search` 参数下发(见 buildQuerySearch 的优先级说明)。
|
|
18
|
+
* 与 parentParams/extraParams 分开:它只是取数条件,不参与字段映射、不随保存下发。
|
|
19
|
+
*/
|
|
20
|
+
search?: Record<string, any>;
|
|
21
|
+
/** 不使用 Page 包裹 */
|
|
22
|
+
noPage?: boolean;
|
|
23
|
+
/** 表格高度(vxe-grid height,如 '100%' 撑满容器滚动;默认 'auto' 跟随内容) */
|
|
24
|
+
tableHeight?: string;
|
|
25
|
+
/** dev 悬浮按钮距容器顶部距离(px);嵌套在其它设计组件内时下移,避免与父组件按钮重叠 */
|
|
26
|
+
devButtonTop?: number;
|
|
27
|
+
};
|
|
28
|
+
declare function handleDelete(row: Record<string, any>): Promise<void>;
|
|
29
|
+
declare var __VLS_91: string | number, __VLS_92: any, __VLS_164: string | number, __VLS_165: any;
|
|
30
|
+
type __VLS_Slots = {} & {
|
|
31
|
+
[K in NonNullable<typeof __VLS_91>]?: (props: typeof __VLS_92) => any;
|
|
32
|
+
} & {
|
|
33
|
+
[K in NonNullable<typeof __VLS_164>]?: (props: typeof __VLS_165) => any;
|
|
34
|
+
};
|
|
35
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
36
|
+
gridApi: any;
|
|
37
|
+
handleDelete: typeof handleDelete;
|
|
38
|
+
reload: () => void;
|
|
39
|
+
/** 开发面板用的状态快照(本库不渲染面板,留给宿主调试台按需读取) */
|
|
40
|
+
devState: import("vue").ComputedRef<Record<string, any>>;
|
|
41
|
+
exprScope: import("vue").ComputedRef<Record<string, any>>;
|
|
42
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
deleted: () => any;
|
|
44
|
+
"update:title": (title: string) => any;
|
|
45
|
+
"tool-command": (tool: TableTool) => any;
|
|
46
|
+
"row-command": (action: RowAction, row: Record<string, any>) => any;
|
|
47
|
+
loaded: (config: PlatformTableConfig | null) => any;
|
|
48
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
49
|
+
onDeleted?: (() => any) | undefined;
|
|
50
|
+
"onUpdate:title"?: ((title: string) => any) | undefined;
|
|
51
|
+
"onTool-command"?: ((tool: TableTool) => any) | undefined;
|
|
52
|
+
"onRow-command"?: ((action: RowAction, row: Record<string, any>) => any) | undefined;
|
|
53
|
+
onLoaded?: ((config: PlatformTableConfig | null) => any) | undefined;
|
|
54
|
+
}>, {
|
|
55
|
+
name: string;
|
|
56
|
+
config: PlatformTableConfig | null;
|
|
57
|
+
search: Record<string, any>;
|
|
58
|
+
category: string;
|
|
59
|
+
parentParams: Record<string, any>;
|
|
60
|
+
devButtonTop: number;
|
|
61
|
+
noPage: boolean;
|
|
62
|
+
tableHeight: string;
|
|
63
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
65
|
+
export default _default;
|
|
66
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
67
|
+
new (): {
|
|
68
|
+
$slots: S;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RowAction } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
action: RowAction;
|
|
4
|
+
gridApi?: any;
|
|
5
|
+
row: Record<string, any>;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
deleted: (row: Record<string, any>) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onDeleted?: ((row: Record<string, any>) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RowAction } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
action: RowAction;
|
|
4
|
+
row: Record<string, any>;
|
|
5
|
+
category?: string;
|
|
6
|
+
pfield?: string;
|
|
7
|
+
gridApi?: any;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
saved: () => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onSaved?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* 行操作 `type` → 组件
|
|
4
|
+
*
|
|
5
|
+
* ## 为什么用 `defineAsyncComponent` 而不是静态 import + markRaw
|
|
6
|
+
*
|
|
7
|
+
* 行操作与设计组件本身是**相互引用**的:`design-table.vue` 渲染行操作,而
|
|
8
|
+
* `modal-table-action` 又要渲染 `design-table.vue`(`modal-tree` / `modal-combo` 同理)。
|
|
9
|
+
* 静态 import + 模块顶层 `markRaw(Comp)` 会在 ESM 初始化阶段就去读那个还没初始化的绑定,
|
|
10
|
+
* 实测直接抛 `ReferenceError: Cannot access '_sfc_main$8' before initialization`。
|
|
11
|
+
*
|
|
12
|
+
* 改成懒加载后:① 没有初始化顺序问题;② 每个动作单独成 chunk,表格不打开弹窗就不加载;
|
|
13
|
+
* ③ 与自定义组件注册表(`src/registry.ts`)同一套「懒加载 + 异步包装」思路。
|
|
14
|
+
*
|
|
15
|
+
* ## 未知 type 的处理
|
|
16
|
+
*
|
|
17
|
+
* {@link resolveRowActionComponent} 对未知 type **warn 一次**并返回 undefined,
|
|
18
|
+
* 调用方据此降级(不要静默渲染成空按钮)。
|
|
19
|
+
*/
|
|
20
|
+
export declare const rowActionComponentMap: Record<string, Component>;
|
|
21
|
+
/** 尚未迁移的行操作类型(现已全部迁入,保留空数组以兼容调用方的判断逻辑) */
|
|
22
|
+
export declare const pendingRowActionTypes: string[];
|
|
23
|
+
/** 按 type 取行操作组件;未知类型 warn 一次并返回 undefined */
|
|
24
|
+
export declare function resolveRowActionComponent(type?: string): Component | undefined;
|
|
25
|
+
export declare const rowActionTypes: string[];
|
|
@@ -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,15 @@
|
|
|
1
|
+
import type { RowAction } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
action: RowAction;
|
|
4
|
+
category?: string;
|
|
5
|
+
gridApi?: any;
|
|
6
|
+
params?: Record<string, any>;
|
|
7
|
+
pfield?: string;
|
|
8
|
+
row: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
saved: () => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onSaved?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
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,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,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;
|