@gct-paas/word 0.1.52-beta.3 → 0.1.52-beta.5
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/dist/assets/svgs/table/index.d.ts +1 -1
- package/dist/base/input/src/input.vue.d.ts +3 -3
- package/dist/base/input/src/text-area.vue.d.ts +2 -2
- package/dist/core/data/DataManager.d.ts +20 -14
- package/dist/core/data/derived-fields.d.ts +20 -0
- package/dist/core/data/emit-source.d.ts +15 -0
- package/dist/core/data/enricher-types.d.ts +8 -1
- package/dist/core/data/enrichers/build-field-enrichers.d.ts +24 -1
- package/dist/core/data/enrichers/enrich-design-defaults.d.ts +19 -0
- package/dist/core/data/enrichers/label-enricher.d.ts +62 -0
- package/dist/core/data/enrichers/static-label-enrichers.d.ts +9 -0
- package/dist/core/data/pipeline-logger.d.ts +72 -0
- package/dist/core/data/post-change-pipeline.d.ts +15 -65
- package/dist/core/model/document/wtcRegionRef.d.ts +2 -2
- package/dist/core/model/logic/subtable/repeating/RepeatingRegion.d.ts +5 -1
- package/dist/domain/active/active-types.d.ts +2 -0
- package/dist/domain/field/field-props-schema-type.d.ts +9 -3
- package/dist/domain/table/business/warehouse/warehouse-allocate/actions/change-parse-rule.d.ts +7 -0
- package/dist/domain/table/business/warehouse/warehouse-allocate/actions/index.d.ts +2 -0
- package/dist/domain/table/business/warehouse/warehouse-allocate/actions/scan.d.ts +7 -0
- package/dist/domain/table/business/warehouse/warehouse-allocate/index.d.ts +2 -0
- package/dist/domain/table/business/warehouse/warehouse-allocate/profile/field-keys.d.ts +26 -0
- package/dist/domain/table/business/warehouse/warehouse-allocate/profile/fields.d.ts +2 -0
- package/dist/domain/table/business/warehouse/{warehouse-transfer → warehouse-allocate}/profile/index.d.ts +1 -1
- package/dist/domain/table/business/warehouse/warehouse-allocate/runtime/register-handlers.d.ts +1 -0
- package/dist/domain/table/business/warehouse/warehouse-allocate/runtime/row-change-handlers.d.ts +9 -0
- package/dist/domain/table/business/warehouse/warehouse-inventory/profile/field-keys.d.ts +11 -5
- package/dist/domain/table/business/warehouse/warehouse-inventory/runtime/row-change-handlers.d.ts +4 -4
- package/dist/domain/table/business/warehouse/warehouse-inventory/runtime/stocktake-calc.d.ts +1 -1
- package/dist/domain/table/runtime/api/biz-service-api.d.ts +2 -0
- package/dist/domain/table/runtime/engines/remote-sync-engine.d.ts +16 -3
- package/dist/domain/table/runtime/runtime-handlers.d.ts +1 -1
- package/dist/domain/table/runtime/table-runtime-utils.d.ts +1 -5
- package/dist/domain/table/runtime/table-runtime.d.ts +5 -2
- package/dist/domain/table/types.d.ts +19 -3
- package/dist/index.es.js +74310 -73090
- package/dist/runtime/canvas/table/render/material-consume/index.d.ts +1 -1
- package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts +3 -10
- package/dist/runtime/canvas/table/render/material-consume/material-consume.util.d.ts +11 -0
- package/dist/runtime/canvas/table/render/table-structure-overlay/sub-table-action.vue.d.ts +1 -1
- package/dist/runtime/interface/computed.d.ts +12 -31
- package/dist/runtime/interface/fetchers.d.ts +3 -1
- package/dist/runtime/renderer/dialogs/device-scan/device-scan-dialog.vue.d.ts +8 -8
- package/dist/runtime/renderer/dropdowns/components/tables/columns/business/product-ndo.d.ts +11 -0
- package/dist/runtime/renderer/dropdowns/components/tables/rdo-table-dropdown.vue.d.ts +8 -8
- package/dist/runtime/renderer/dropdowns/components/tables/strategy/selectStrategy.d.ts +2 -2
- package/dist/runtime/renderer/dropdowns/components/tables/table-dropdown.vue.d.ts +8 -8
- package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +21 -3
- package/dist/sdk/doc-runtime/utils/wait-for-data-settle.d.ts +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/suites/edhr/manifest/field/_common_/basic.d.ts +7 -1
- package/dist/suites/edhr/panel-schema/index.d.ts +1 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/parse-rule-editor.vue.d.ts +1 -1
- package/dist/suites/edhr/panel-schema/warehouse-allocate-table/WarehouseAllocateTablePanel.vue.d.ts +8 -0
- package/dist/suites/edhr/panel-schema/warehouse-allocate-table/warehouse-allocate-table.basic.d.ts +1 -0
- package/dist/suites/shared/hooks/usePanelProps.d.ts +2 -0
- package/dist/suites/shared/panel/config/editor/qrcode-parse-editor/barcode-parsing-rules-string-editor.vue.d.ts +2 -2
- package/dist/types/warehouse-allocate.type.d.ts +38 -0
- package/dist/utils/TriggerUtil.d.ts +1 -1
- package/dist/utils/func/core.d.ts +4 -0
- package/dist/utils/func/form.d.ts +1 -5
- package/dist/word.css +78 -52
- package/package.json +1 -1
- package/dist/core/data/data-path-suffix.d.ts +0 -9
- package/dist/domain/table/business/warehouse/warehouse-transfer/index.d.ts +0 -1
- package/dist/runtime/canvas/table/render/material-consume/mc-render.d.ts +0 -47
- package/dist/runtime/canvas/table/render/material-consume/mc-web-render.d.ts +0 -21
- package/dist/runtime/canvas/table/render/material-consume/sync-material-info.d.ts +0 -2
|
@@ -14,7 +14,7 @@ export declare const TABLE_DATA_SVG: {
|
|
|
14
14
|
export declare const TABLE_BUSINESS_SVG: {
|
|
15
15
|
readonly 'warehouse-in-out': string;
|
|
16
16
|
readonly 'warehouse-inventory': string;
|
|
17
|
-
readonly 'warehouse-
|
|
17
|
+
readonly 'warehouse-allocate': string;
|
|
18
18
|
readonly 'material-consume': string;
|
|
19
19
|
readonly 'material-balance': string;
|
|
20
20
|
readonly 'check-table': string;
|
|
@@ -25,8 +25,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
25
25
|
keydown: (event: KeyboardEvent) => any;
|
|
26
26
|
keypress: (event: KeyboardEvent) => any;
|
|
27
27
|
keyup: (event: KeyboardEvent) => any;
|
|
28
|
-
"update:modelValue": (value: string | number) => any;
|
|
29
28
|
clear: () => any;
|
|
29
|
+
"update:modelValue": (value: string | number) => any;
|
|
30
30
|
pressEnter: (event: KeyboardEvent) => any;
|
|
31
31
|
}, string, import('vue').PublicProps, Readonly<GctInputProps> & Readonly<{
|
|
32
32
|
onInput?: ((value: string | number, event: Event) => any) | undefined;
|
|
@@ -37,8 +37,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
37
37
|
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
38
38
|
onKeypress?: ((event: KeyboardEvent) => any) | undefined;
|
|
39
39
|
onKeyup?: ((event: KeyboardEvent) => any) | undefined;
|
|
40
|
-
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
41
40
|
onClear?: (() => any) | undefined;
|
|
41
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
42
42
|
onPressEnter?: ((event: KeyboardEvent) => any) | undefined;
|
|
43
43
|
}>, {
|
|
44
44
|
name: string;
|
|
@@ -46,8 +46,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
46
46
|
id: string;
|
|
47
47
|
readonly: boolean;
|
|
48
48
|
disabled: boolean;
|
|
49
|
-
suffix: string;
|
|
50
49
|
size: import('./types').InputSize;
|
|
50
|
+
suffix: string;
|
|
51
51
|
placeholder: string;
|
|
52
52
|
modelValue: string | number;
|
|
53
53
|
prefix: string;
|
|
@@ -23,8 +23,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
23
23
|
keydown: (event: KeyboardEvent) => any;
|
|
24
24
|
keypress: (event: KeyboardEvent) => any;
|
|
25
25
|
keyup: (event: KeyboardEvent) => any;
|
|
26
|
-
"update:modelValue": (value: string | number) => any;
|
|
27
26
|
clear: () => any;
|
|
27
|
+
"update:modelValue": (value: string | number) => any;
|
|
28
28
|
pressEnter: (event: KeyboardEvent) => any;
|
|
29
29
|
}, string, import('vue').PublicProps, Readonly<GctInputProps> & Readonly<{
|
|
30
30
|
onInput?: ((value: string | number, event: Event) => any) | undefined;
|
|
@@ -35,8 +35,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
35
35
|
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
36
36
|
onKeypress?: ((event: KeyboardEvent) => any) | undefined;
|
|
37
37
|
onKeyup?: ((event: KeyboardEvent) => any) | undefined;
|
|
38
|
-
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
39
38
|
onClear?: (() => any) | undefined;
|
|
39
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
40
40
|
onPressEnter?: ((event: KeyboardEvent) => any) | undefined;
|
|
41
41
|
}>, {
|
|
42
42
|
name: string;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { Doc } from '../view/Doc';
|
|
2
2
|
import { PostChangePipelineContext } from './post-change-pipeline';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @property dependency - 依赖数据变更触发
|
|
7
|
-
* @property enrichment - 数据补充/富化逻辑触发
|
|
8
|
-
* @property parent - 父组件/上层逻辑触发
|
|
9
|
-
*/
|
|
10
|
-
export type EmitSource = 'user' | 'dependency' | 'enrichment' | 'parent';
|
|
3
|
+
import { EmitSource } from './emit-source';
|
|
4
|
+
export type { EmitSource } from './emit-source';
|
|
5
|
+
export { EMIT_SOURCE_DESC } from './emit-source';
|
|
11
6
|
/** 单字段变更明细(path 作为 FieldChangeMap 的 key) */
|
|
12
7
|
export interface FieldChangeDetail {
|
|
13
8
|
oldValue: unknown;
|
|
@@ -69,10 +64,20 @@ export declare class DataManager {
|
|
|
69
64
|
* 调度 layout,自动合并同一微任务队列中的多个操作
|
|
70
65
|
*/
|
|
71
66
|
attachPostChangePipeline(ctx: PostChangePipelineContext): void;
|
|
72
|
-
/** 文档初始化 / 刷新数据后,对已有 value 跑一轮后置 enrich */
|
|
67
|
+
/** 文档初始化 / 刷新数据后,对已有 value 跑一轮后置 enrich(不触发业务副作用) */
|
|
73
68
|
runInitialPostChangeFlush(paths: JsonPath[]): Promise<void>;
|
|
74
69
|
/** 等待已入队的 emit 批处理(含 postChange / enrich 写回)全部完成 */
|
|
75
70
|
whenEmitSettled(): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* 提交前准备:排空流水线 → 物化未写入 rawData 的默认值 → 补全 _lb_ / _href_
|
|
73
|
+
* 避免秒存或懒读 defaults 导致提交缺标签。
|
|
74
|
+
*/
|
|
75
|
+
prepareForSubmit(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* 将 defaults Map 中尚未进入 rawData 的项物化写入(source: hydrate)。
|
|
78
|
+
* @returns 本次物化的路径列表
|
|
79
|
+
*/
|
|
80
|
+
materializePendingDefaults(): JsonPath[];
|
|
76
81
|
/**
|
|
77
82
|
* 对已注册的组件依赖全量重算(refresh 后 depGraph 已重建,需等 readonly/赋值稳定后再 enrich/layout)
|
|
78
83
|
*/
|
|
@@ -125,9 +130,10 @@ export declare class DataManager {
|
|
|
125
130
|
* 根据 jsonpath 设置数据
|
|
126
131
|
* @param path jsonpath 路径
|
|
127
132
|
* @param value 要设置的值
|
|
133
|
+
* @param source 写入来源
|
|
128
134
|
* @returns 是否设置成功
|
|
129
135
|
*/
|
|
130
|
-
set(path: JsonPath, value: any, source
|
|
136
|
+
set(path: JsonPath, value: any, source: EmitSource): boolean;
|
|
131
137
|
/**
|
|
132
138
|
* 从带数字下标的 path 推断二维坐标(供 setMultiple / patch / 业务回填等无 modelRef 的场景)
|
|
133
139
|
* - 单轴:$.f_ewb[0].f_name → y=0;$.f_ewblink[1].x → x=1(需能从 rawData 的交叉 key 识别轴,或命中 link 命名启发)
|
|
@@ -160,7 +166,7 @@ export declare class DataManager {
|
|
|
160
166
|
/**
|
|
161
167
|
* 将一个部分值对象合进整体
|
|
162
168
|
*/
|
|
163
|
-
patch(data: PartialData): void;
|
|
169
|
+
patch(data: PartialData, source: EmitSource): void;
|
|
164
170
|
/**
|
|
165
171
|
* 根据 jsonpath 删除数据
|
|
166
172
|
* @param path jsonpath 路径
|
|
@@ -173,13 +179,14 @@ export declare class DataManager {
|
|
|
173
179
|
* @param callback 更新回调函数
|
|
174
180
|
* @returns 是否更新成功
|
|
175
181
|
*/
|
|
176
|
-
update<T = any>(path: JsonPath, callback: (value: T) => T): boolean;
|
|
182
|
+
update<T = any>(path: JsonPath, callback: (value: T) => T, source: EmitSource): boolean;
|
|
177
183
|
/**
|
|
178
184
|
* 根据 jsonpath 批量设置数据
|
|
179
185
|
* @param updates 路径与值的映射对象
|
|
186
|
+
* @param source 写入来源
|
|
180
187
|
* @returns 是否全部设置成功
|
|
181
188
|
*/
|
|
182
|
-
setMultiple(updates: Record<JsonPath, any>, source
|
|
189
|
+
setMultiple(updates: Record<JsonPath, any>, source: EmitSource): boolean;
|
|
183
190
|
/** 依赖赋值写回 rawData,不触发 emit(用于注册期常量公式立即执行) */
|
|
184
191
|
private applyDependencyWrites;
|
|
185
192
|
/**
|
|
@@ -370,4 +377,3 @@ export declare class DataManager {
|
|
|
370
377
|
*/
|
|
371
378
|
clear(): void;
|
|
372
379
|
}
|
|
373
|
-
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** 与 rawData 并存的 label 后缀(展示用) */
|
|
2
|
+
export declare const LABEL_SUFFIX = "_lb_";
|
|
3
|
+
/** 与 rawData 并存的外链 href 后缀(超链接字段) */
|
|
4
|
+
export declare const HREF_SUFFIX = "_href_";
|
|
5
|
+
/** 版面超链接文字颜色 */
|
|
6
|
+
export declare const HYPERLINK_TEXT_COLOR = "#0563c1";
|
|
7
|
+
export declare function getLabelPath(path: string): string;
|
|
8
|
+
export declare function getHrefPath(path: string): string;
|
|
9
|
+
/** 派生数据路径(label / href),不参与 changedMap / 业务副作用 */
|
|
10
|
+
export declare function isDerivedDataPath(path: string): boolean;
|
|
11
|
+
/** 子表行内仅前端使用、不参与提交的字段 */
|
|
12
|
+
export declare const ROW_RUNTIME_META_KEYS: Set<string>;
|
|
13
|
+
/** 该字段 key 是否不参与提交 */
|
|
14
|
+
export declare function isSubmitExcludedKey(key: string): boolean;
|
|
15
|
+
/** 提交时是否保留该行字段(含空 label 剔除规则) */
|
|
16
|
+
export declare function shouldIncludeSubmitField(key: string, value: unknown): boolean;
|
|
17
|
+
/** 从对象中挑出可提交的字段 */
|
|
18
|
+
export declare function pickSubmitFields(record: Record<string, unknown>): Record<string, unknown>;
|
|
19
|
+
/** 剔除顶层不参与提交的 key */
|
|
20
|
+
export declare function omitSubmitExcludedTopLevel<T extends Record<string, unknown>>(data: T): Partial<T>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 字段写入来源
|
|
3
|
+
*
|
|
4
|
+
* 用来区分「用户真的改了」还是「系统在补水/算公式」
|
|
5
|
+
* 从而决定要不要触发业务副作用,比如清空下游、remoteSync 等
|
|
6
|
+
*
|
|
7
|
+
* @property user - 用户手动操作触发(下拉、输入、扫码)
|
|
8
|
+
* @property hydrate - 打开表单、刷新、初始化填空(非用户操作,不能把「加载」当成「改字段」,两者是不同的)
|
|
9
|
+
* @property dependency - 数据变更触发后把别的字段值给算出来了(组件依赖)
|
|
10
|
+
* @property enrichment - Pipeline 进行数据补充,自动补的派生数据(超链接 _href_、标签 _lb_)
|
|
11
|
+
* @property parent - 子字段变了,通知父级监听,主要是内部使用
|
|
12
|
+
*/
|
|
13
|
+
export type EmitSource = 'user' | 'hydrate' | 'dependency' | 'enrichment' | 'parent';
|
|
14
|
+
/** 各来源中文说明 */
|
|
15
|
+
export declare const EMIT_SOURCE_DESC: Record<EmitSource, string>;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { EmitSource } from './emit-source';
|
|
2
|
+
/** enricher 执行时的批次上下文 */
|
|
3
|
+
export type EnrichContext = {
|
|
4
|
+
batchSource?: EmitSource;
|
|
5
|
+
oldValue?: unknown;
|
|
6
|
+
newValue?: unknown;
|
|
7
|
+
};
|
|
1
8
|
export type DataEnricherRegistration = {
|
|
2
9
|
id: string;
|
|
3
10
|
valuePathTemplate: string;
|
|
4
11
|
match: (path: string) => boolean;
|
|
5
|
-
enrich: (path: string, value: unknown) => Promise<Record<string, unknown> | void>;
|
|
12
|
+
enrich: (path: string, value: unknown, ctx?: EnrichContext) => Promise<Record<string, unknown> | void>;
|
|
6
13
|
};
|
|
@@ -2,6 +2,29 @@ import { Doc } from '../../view/Doc';
|
|
|
2
2
|
import { Wr } from '../../model/document';
|
|
3
3
|
import { PostChangePipelineContext } from '../post-change-pipeline';
|
|
4
4
|
import { DataEnricherRegistration } from '../enricher-types';
|
|
5
|
+
import { FieldComputedConfig } from '../../../domain/field/field-props-schema-type';
|
|
6
|
+
/**
|
|
7
|
+
* 解析 enricher 用的 widget props
|
|
8
|
+
* 枚举等字段的运行时选项在 computedOptions,需先跑 manifest.propRules
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveEnricherWidgetProps(instance: {
|
|
11
|
+
widgetMeta?: {
|
|
12
|
+
props?: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
}, manifest?: {
|
|
15
|
+
computed?: FieldComputedConfig;
|
|
16
|
+
}): Record<string, unknown>;
|
|
17
|
+
/** 根据文档 widget 列表构建全部 enricher 注册项 */
|
|
5
18
|
export declare function buildFieldEnricherRegistrations(instances: any[], ctx: PostChangePipelineContext, doc: Doc): DataEnricherRegistration[];
|
|
6
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* 将设计/初始化路径模板展开为运行时具体路径(含 [n] / [n_y][n_x])
|
|
21
|
+
*/
|
|
22
|
+
export declare function expandInitPathTemplates(templatePath: string, rawData: Record<string, any>): string[];
|
|
23
|
+
/**
|
|
24
|
+
* 收集 init / 换数后需要跑 hydrate 的运行时路径(仅 rawData 中已有值的字段)
|
|
25
|
+
*/
|
|
7
26
|
export declare function collectInitialEnrichPaths(instances: Wr[], rawData: Record<string, any>): string[];
|
|
27
|
+
/** 收集子表指定行的 widget 字段路径(扫码 / 批量写行后补跑 label enrich) */
|
|
28
|
+
export declare function collectSubtableRowEnrichPaths(instances: Wr[], subFieldKey: string, rowIndexes: number[]): string[];
|
|
29
|
+
/** 子表指定行补跑 label / 派生字段 hydrate(enrichment 或整表 user 写入后不触发 enricher) */
|
|
30
|
+
export declare function hydrateSubtableRowLabels(doc: Doc, subFieldKey: string, rowIndexes: number[]): Promise<void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Doc } from '../../view/Doc';
|
|
2
|
+
import { FieldDataBindingMeta } from '../../../domain/field/field-binding';
|
|
3
|
+
import { FIELD_TYPE } from '../../../domain/field/field-type';
|
|
4
|
+
import { FieldManifest } from '../../../capabilities/field-manifest';
|
|
5
|
+
import { FieldMeta } from '../../../capabilities/model-field-runtime';
|
|
6
|
+
/** 单字段 defaults Map 补全 _lb_ */
|
|
7
|
+
export declare function enrichDesignDefaults(defaults: Record<string, any> | undefined, options: {
|
|
8
|
+
doc: Doc;
|
|
9
|
+
fieldBinding?: FieldDataBindingMeta | null;
|
|
10
|
+
widgetProps: Record<string, unknown>;
|
|
11
|
+
manifest?: FieldManifest;
|
|
12
|
+
loadFieldByKey: (modelKey: string, key: string) => Promise<FieldMeta | undefined>;
|
|
13
|
+
}): Promise<Record<string, any> | undefined>;
|
|
14
|
+
/** 填报 init:为 loadDefaultValuesByFields 产出的 defaults Map 批量补 _lb_ */
|
|
15
|
+
export declare function enrichWidgetDefaultsMap(defaultDataMap: Record<string, any>, instances: any[], options: {
|
|
16
|
+
doc: Doc;
|
|
17
|
+
getFieldManifest: (type: FIELD_TYPE) => FieldManifest | undefined;
|
|
18
|
+
loadFieldByKey: (modelKey: string, key: string) => Promise<FieldMeta | undefined>;
|
|
19
|
+
}): Promise<Record<string, any>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Doc } from '../../view/Doc';
|
|
2
|
+
import { WidgetMeta } from '../../widget/widget-meta';
|
|
3
|
+
import { FieldDataBindingMeta } from '../../../domain/field/field-binding';
|
|
4
|
+
import { FIELD_TYPE } from '../../../domain/field/field-type';
|
|
5
|
+
import { FieldManifest } from '../../../capabilities/field-manifest';
|
|
6
|
+
import { FieldMeta } from '../../../capabilities/model-field-runtime';
|
|
7
|
+
import { DataEnricherRegistration } from '../enricher-types';
|
|
8
|
+
import { DataManager } from '../DataManager';
|
|
9
|
+
import { apiFetchers } from '../../../runtime/interface/fetchers';
|
|
10
|
+
/** 单条 label 解析策略 */
|
|
11
|
+
type LabelResolveStrategy = {
|
|
12
|
+
type: 'dict';
|
|
13
|
+
dictFieldKey?: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'options';
|
|
16
|
+
from: 'optionsJson' | 'computedOptions';
|
|
17
|
+
labelKey?: string;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'api';
|
|
21
|
+
fetcher: keyof typeof apiFetchers;
|
|
22
|
+
fallback?: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'static-map';
|
|
25
|
+
map: Record<string, string>;
|
|
26
|
+
};
|
|
27
|
+
/** resolveFieldLabel 运行时入参 */
|
|
28
|
+
interface LabelResolveContext {
|
|
29
|
+
path: string;
|
|
30
|
+
value: unknown;
|
|
31
|
+
dataManager: DataManager;
|
|
32
|
+
fieldBinding: FieldDataBindingMeta;
|
|
33
|
+
widgetProps: Record<string, unknown>;
|
|
34
|
+
manifest?: FieldManifest;
|
|
35
|
+
loadFieldByKey: (modelKey: string, key: string) => Promise<FieldMeta | undefined>;
|
|
36
|
+
}
|
|
37
|
+
type LabelEnricherOptions = Omit<DataEnricherRegistration, 'enrich'> & {
|
|
38
|
+
doc: Doc;
|
|
39
|
+
widgetMeta: WidgetMeta;
|
|
40
|
+
fieldBinding: FieldDataBindingMeta;
|
|
41
|
+
manifest?: FieldManifest;
|
|
42
|
+
loadFieldByKey: (modelKey: string, key: string) => Promise<FieldMeta | undefined>;
|
|
43
|
+
};
|
|
44
|
+
/** 该字段是否应注册 label-enricher */
|
|
45
|
+
export declare function fieldNeedsLabelEnrichment(fieldType: FIELD_TYPE, manifest?: FieldManifest): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 静态映射 enricher:value 字段 → 固定 label 字段
|
|
48
|
+
* 用于无 widget 的业务字段,如盘点 stocktake_status → stocktake_status__lb_
|
|
49
|
+
*/
|
|
50
|
+
export declare function createStaticMapLabelEnricher(doc: Doc, options: {
|
|
51
|
+
id: string;
|
|
52
|
+
valueFieldKey: string;
|
|
53
|
+
labelFieldKey: string;
|
|
54
|
+
map: Record<string, string>;
|
|
55
|
+
}): DataEnricherRegistration;
|
|
56
|
+
/** 从 manifest 推导 label 解析策略链 */
|
|
57
|
+
export declare function resolveFieldLabelStrategies(fieldType: FIELD_TYPE, manifest?: FieldManifest): LabelResolveStrategy[] | undefined;
|
|
58
|
+
/** 按策略链解析 label */
|
|
59
|
+
export declare function resolveFieldLabel(strategies: LabelResolveStrategy[], ctx: LabelResolveContext): Promise<string | null | undefined>;
|
|
60
|
+
/** 为单个 widget 字段创建 label enricher 注册项 */
|
|
61
|
+
export declare function createLabelEnricher(reg: LabelEnricherOptions): DataEnricherRegistration;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Doc } from '../../view/Doc';
|
|
2
|
+
import { DataEnricherRegistration } from '../enricher-types';
|
|
3
|
+
/** 拿到 doc 后生成 enricher 注册项 */
|
|
4
|
+
type StaticLabelEnricherFactory = (doc: Doc) => DataEnricherRegistration;
|
|
5
|
+
/** 注册业务侧静态/定制 label enricher */
|
|
6
|
+
export declare function registerStaticLabelEnricher(factory: StaticLabelEnricherFactory): void;
|
|
7
|
+
/** 文档初始化时构建所有已注册的静态 label enricher */
|
|
8
|
+
export declare function buildStaticLabelEnrichers(doc: Doc): DataEnricherRegistration[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { EmitSource } from './emit-source';
|
|
2
|
+
export type PipelineLogNS = 'data.emit' | 'pipeline.hydrate' | 'pipeline.onChange' | 'pipeline.deps' | 'enricher.label' | 'enricher.hyperlink' | 'pipeline.afterFlush' | 'table.runtime' | 'init.lifecycle' | 'submit.prepare';
|
|
3
|
+
export type PipelineLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
4
|
+
export interface PipelineLogEvent {
|
|
5
|
+
ns: PipelineLogNS;
|
|
6
|
+
level: PipelineLogLevel;
|
|
7
|
+
msg: string;
|
|
8
|
+
batchId?: string;
|
|
9
|
+
path?: string;
|
|
10
|
+
source?: EmitSource;
|
|
11
|
+
durationMs?: number;
|
|
12
|
+
meta?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export interface PipelineLogger {
|
|
15
|
+
debug(msg: string, meta?: Record<string, unknown>): void;
|
|
16
|
+
info(msg: string, meta?: Record<string, unknown>): void;
|
|
17
|
+
warn(msg: string, meta?: Record<string, unknown>): void;
|
|
18
|
+
error(msg: string, meta?: Record<string, unknown>): void;
|
|
19
|
+
child(meta: Record<string, unknown>): PipelineLogger;
|
|
20
|
+
time(label: string): () => number;
|
|
21
|
+
}
|
|
22
|
+
interface PipelineLoggingConfig {
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
level: PipelineLogLevel;
|
|
25
|
+
namespaces?: PipelineLogNS[];
|
|
26
|
+
}
|
|
27
|
+
/** 创建 pipeline 批次 id,用于串联同一次 flush 日志 */
|
|
28
|
+
export declare function createPipelineBatchId(prefix?: string): string;
|
|
29
|
+
/** 配置 pipeline 日志 */
|
|
30
|
+
export declare function configurePipelineLogging(options: Partial<PipelineLoggingConfig>): void;
|
|
31
|
+
/** 日志展示 来源枚举 → 中文 */
|
|
32
|
+
export declare function formatEmitSourceLabel(source: EmitSource): string;
|
|
33
|
+
export declare function truncatePipelineValue(value: unknown, maxLen?: number): unknown;
|
|
34
|
+
/** 单值展示(日志一行里用) */
|
|
35
|
+
export declare function formatPipelineValue(value: unknown): string;
|
|
36
|
+
export interface PipelineFieldChangeInput {
|
|
37
|
+
oldValue: unknown;
|
|
38
|
+
newValue: unknown;
|
|
39
|
+
source: EmitSource;
|
|
40
|
+
}
|
|
41
|
+
export interface FieldChangeLogMeta {
|
|
42
|
+
pathCount: number;
|
|
43
|
+
paths: string[];
|
|
44
|
+
changes: Array<{
|
|
45
|
+
path: string;
|
|
46
|
+
source: EmitSource;
|
|
47
|
+
old: unknown;
|
|
48
|
+
new: unknown;
|
|
49
|
+
text: string;
|
|
50
|
+
}>;
|
|
51
|
+
/** 拼进 log.msg 的简短摘要 */
|
|
52
|
+
brief: string;
|
|
53
|
+
omittedCount: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 把一批字段变更整理成 Console 可读的结构
|
|
57
|
+
* - brief:单条直接展示 path + 旧→新;多条展示前几条 +「等 N 项」
|
|
58
|
+
* - changes:展开可看每条明细
|
|
59
|
+
*/
|
|
60
|
+
export declare function formatFieldChangesForLog(changedMap: Record<string, PipelineFieldChangeInput>, options?: {
|
|
61
|
+
maxItems?: number;
|
|
62
|
+
hydrateMode?: boolean;
|
|
63
|
+
}): FieldChangeLogMeta;
|
|
64
|
+
/** info 级日志附带字段明细(paths + changes + brief) */
|
|
65
|
+
export declare function fieldChangeLogMeta(changedMap: Record<string, PipelineFieldChangeInput>, options?: {
|
|
66
|
+
maxItems?: number;
|
|
67
|
+
hydrateMode?: boolean;
|
|
68
|
+
}): Record<string, unknown>;
|
|
69
|
+
export declare function createPipelineLogger(ns: PipelineLogNS, baseMeta?: Record<string, unknown>): PipelineLogger;
|
|
70
|
+
/** 开发构建默认开启 debug 级别 pipeline 日志 */
|
|
71
|
+
export declare function configurePipelineLoggingForDev(): void;
|
|
72
|
+
export {};
|
|
@@ -2,7 +2,8 @@ import { FIELD_TYPE } from '../../domain/field/field-type';
|
|
|
2
2
|
import { FieldManifest } from '../../capabilities/field-manifest';
|
|
3
3
|
import { FieldMeta } from '../../capabilities/model-field-runtime';
|
|
4
4
|
import { Doc } from '../view/Doc';
|
|
5
|
-
import { DataManager,
|
|
5
|
+
import { DataManager, FieldChangeMap } from './DataManager';
|
|
6
|
+
import { EmitSource } from './emit-source';
|
|
6
7
|
/**
|
|
7
8
|
* Pipeline 运行时上下文
|
|
8
9
|
*
|
|
@@ -19,86 +20,35 @@ export type PostChangePipelineContext = {
|
|
|
19
20
|
* 根据模型 key + 字段 key 获取字段 meta
|
|
20
21
|
*/
|
|
21
22
|
loadFieldByKey: (modelKey: string, key: string) => Promise<FieldMeta | undefined>;
|
|
22
|
-
/**
|
|
23
|
+
/** 用户编辑并完成 enrich 后的业务副作用 */
|
|
23
24
|
afterFlush?: (changedMap: FieldChangeMap, source: EmitSource) => void | Promise<void>;
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
27
|
* 数据变更后的处理流水线
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* 3. 执行 enrich 逻辑
|
|
32
|
-
* 4. 将 enrich 结果再次写回 DataManager
|
|
33
|
-
*
|
|
34
|
-
* 典型场景:
|
|
35
|
-
* - 自动填充字段
|
|
36
|
-
* - 字段联动
|
|
37
|
-
* - 数据增强
|
|
38
|
-
* - 根据某字段自动计算其它字段
|
|
29
|
+
* 两个入口:
|
|
30
|
+
* - hydrate:装载/换数后激活,只跑 deps + enrichers
|
|
31
|
+
* - onChange:用户/依赖编辑,deps + enrichers +(仅 user)afterFlush
|
|
39
32
|
*/
|
|
40
33
|
export declare class PostChangePipeline {
|
|
41
|
-
/**
|
|
42
|
-
* 数据管理器
|
|
43
|
-
*/
|
|
44
34
|
private dataManager;
|
|
45
|
-
/**
|
|
46
|
-
* 文档实例
|
|
47
|
-
*/
|
|
48
35
|
private doc;
|
|
49
|
-
/**
|
|
50
|
-
* 当前注册的 enrichers
|
|
51
|
-
*
|
|
52
|
-
* 每个 enricher:
|
|
53
|
-
* - match(path) 判断是否处理该字段
|
|
54
|
-
* - enrich(path, value) 生成补充数据
|
|
55
|
-
*/
|
|
56
36
|
private enrichers;
|
|
57
|
-
/**
|
|
58
|
-
* 防止同一路径重复并发执行
|
|
59
|
-
*
|
|
60
|
-
* key:
|
|
61
|
-
* path
|
|
62
|
-
*
|
|
63
|
-
* value:
|
|
64
|
-
* 当前执行中的 Promise
|
|
65
|
-
*/
|
|
66
37
|
private inFlight;
|
|
67
|
-
/**
|
|
68
|
-
* pipeline 上下文
|
|
69
|
-
*/
|
|
70
38
|
private pipelineCtx?;
|
|
71
|
-
constructor(
|
|
72
|
-
/**
|
|
73
|
-
* 数据管理器
|
|
74
|
-
*/
|
|
75
|
-
dataManager: DataManager,
|
|
76
|
-
/**
|
|
77
|
-
* 文档实例
|
|
78
|
-
*/
|
|
79
|
-
doc: Doc);
|
|
80
|
-
/**
|
|
81
|
-
* 设置 pipeline 上下文
|
|
82
|
-
*
|
|
83
|
-
* 设置后会重新构建 enrichers
|
|
84
|
-
*/
|
|
39
|
+
constructor(dataManager: DataManager, doc: Doc);
|
|
85
40
|
setContext(ctx: PostChangePipelineContext): void;
|
|
86
|
-
/**
|
|
87
|
-
* 重建 enricher 注册列表
|
|
88
|
-
*
|
|
89
|
-
* 从当前文档中的 widget instances
|
|
90
|
-
* 动态生成 enrichers
|
|
91
|
-
*/
|
|
92
41
|
rebuildRegistrations(): void;
|
|
42
|
+
/** 装载/换数后:deps + enrichers,不触发业务副作用 */
|
|
43
|
+
hydrate(paths: string[]): Promise<void>;
|
|
44
|
+
/** 字段变更:deps + enrichers;仅 user 批次触发 afterFlush */
|
|
45
|
+
onChange(changedMap: FieldChangeMap, options?: {
|
|
46
|
+
runBusinessSideEffects?: boolean;
|
|
47
|
+
}): Promise<void>;
|
|
93
48
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* @param changedMap 本批次字段变更 path → { oldValue, newValue, source }
|
|
97
|
-
* @param source 批次级变更来源(兼容保留,单字段以 map 内 source 为准)
|
|
49
|
+
* @deprecated 请使用 hydrate / onChange
|
|
98
50
|
*/
|
|
99
51
|
flush(changedMap: FieldChangeMap, source: EmitSource): Promise<void>;
|
|
100
|
-
|
|
101
|
-
* 执行某个 path 对应的 enrichers
|
|
102
|
-
*/
|
|
52
|
+
private runCore;
|
|
103
53
|
private runEnrichersForPath;
|
|
104
54
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
* 出入库明细等复用 repeating 存储,layout 层通过 widgetMeta.props.layoutType 区分。
|
|
20
20
|
*/
|
|
21
|
-
export type SubTableRegionType = 'repeating' | 'bounded' | '2d-table' | 'check-table' | 'material-consume-table';
|
|
21
|
+
export type SubTableRegionType = 'repeating' | 'bounded' | '2d-table' | 'check-table' | 'material-consume-table' | 'warehouse-allocate-table';
|
|
22
22
|
/** 表头 region 类型 */
|
|
23
23
|
export type TableHeaderRegionType = 'table-header' | 'sub-table-header';
|
|
24
24
|
/** 所有子表表格 region 类型 */
|
|
@@ -29,7 +29,7 @@ export declare const SUB_TABLE_REGION_TYPES: readonly ["repeating", "bounded", "
|
|
|
29
29
|
* 子表 layout 类型
|
|
30
30
|
* Ribbon 面板、子表主题色均使用此类型;主题配置见 @/domain/table 各 Profile.theme
|
|
31
31
|
*/
|
|
32
|
-
export type SubTableLayoutType = 'dynamic-table' | 'fixed-table' | '2d-table' | 'check-table' | 'material-consume-table' | 'warehouse-in-out-table' | 'warehouse-inventory-table';
|
|
32
|
+
export type SubTableLayoutType = 'dynamic-table' | 'fixed-table' | '2d-table' | 'check-table' | 'material-consume-table' | 'warehouse-in-out-table' | 'warehouse-inventory-table' | 'warehouse-allocate-table';
|
|
33
33
|
/** 表头 layout 类型 */
|
|
34
34
|
export type TableHeaderLayoutType = 'table-header';
|
|
35
35
|
/** 所有子表表格 layout 类型 */
|
|
@@ -19,7 +19,11 @@ export type WarehouseInventoryTableProps = RepeatingWidgetPropsBase & {
|
|
|
19
19
|
/** 条码解析规则 */
|
|
20
20
|
barcode_parsing_rules_id_?: string;
|
|
21
21
|
};
|
|
22
|
-
export type
|
|
22
|
+
export type WarehouseAllocateTableProps = RepeatingWidgetPropsBase & {
|
|
23
|
+
layoutType: 'warehouse-allocate-table';
|
|
24
|
+
barcode_parsing_rules_id_?: string;
|
|
25
|
+
};
|
|
26
|
+
export type RepeatingWidgetPropsMeta = DynamicTableProps | WarehouseInOutTableProps | WarehouseInventoryTableProps | WarehouseAllocateTableProps;
|
|
23
27
|
export type RepeatingWidgetMeta = {
|
|
24
28
|
props: RepeatingWidgetPropsMeta;
|
|
25
29
|
};
|
|
@@ -61,13 +61,19 @@ export interface MapRule {
|
|
|
61
61
|
export interface HyperlinkRule {
|
|
62
62
|
type: 'hyperlink';
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
/** 值变化后补全展示标签 */
|
|
65
|
+
export interface LabelRule {
|
|
66
|
+
type: 'label';
|
|
67
|
+
}
|
|
68
|
+
export type ValueChangeRule = HyperlinkRule | LabelRule;
|
|
69
|
+
/** 将 manifest 中的 onValueChangeRule 规范为数组 */
|
|
70
|
+
export declare function normalizeValueChangeRules(rule?: ValueChangeRule | ValueChangeRule[]): ValueChangeRule[];
|
|
65
71
|
export type ComputedRule = PriorityRule | ResolveRule | MapRule | JoinRule | ApiRule;
|
|
66
72
|
export interface FieldComputedConfig {
|
|
67
73
|
/** 写回 props 的派生规则 */
|
|
68
74
|
propRules?: Record<string, ComputedRule>;
|
|
69
75
|
/** 写入 dataManager 的派生规则 */
|
|
70
76
|
defaultValueRule?: ComputedRule;
|
|
71
|
-
/**
|
|
72
|
-
onValueChangeRule?: ValueChangeRule;
|
|
77
|
+
/** 填报值变化后的 enrich(超链接 _href_、展示标签 _lb_) */
|
|
78
|
+
onValueChangeRule?: ValueChangeRule | ValueChangeRule[];
|
|
73
79
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 调拨表字段 key 统一定义
|
|
3
|
+
*/
|
|
4
|
+
/** 单字段 key */
|
|
5
|
+
export declare const F: {
|
|
6
|
+
readonly product: "product_id_";
|
|
7
|
+
readonly productName: "product_id_name_";
|
|
8
|
+
readonly productCode: "product_id_code_";
|
|
9
|
+
readonly productSpec: "product_id_spec_";
|
|
10
|
+
readonly matno: "material_no_";
|
|
11
|
+
readonly validity: "validity_";
|
|
12
|
+
readonly stock: "stock_num_";
|
|
13
|
+
readonly warehouse: "warehouse_id_";
|
|
14
|
+
readonly location: "location_id_";
|
|
15
|
+
readonly originWarehouseId: "origin_warehouse_id_";
|
|
16
|
+
readonly originLocationId: "origin_location_id_";
|
|
17
|
+
readonly originLocationIdLb: "origin_location_id__lb_";
|
|
18
|
+
readonly allocateReason: "allocate_reason_";
|
|
19
|
+
readonly allocateNum: "allocate_num_";
|
|
20
|
+
readonly matcode: "product_code_";
|
|
21
|
+
readonly rowSource: "row_source_";
|
|
22
|
+
readonly allocateLocationIds: "_allocate_location_ids_";
|
|
23
|
+
};
|
|
24
|
+
export type AllocateFieldKey = (typeof F)[keyof typeof F];
|
|
25
|
+
/** runtimeRules:始终只读的信息字段 */
|
|
26
|
+
export declare const READONLY_INFO_FIELDS: readonly ["product_id_name_", "product_id_code_", "product_id_spec_", "stock_num_", "validity_"];
|
package/dist/domain/table/business/warehouse/warehouse-allocate/runtime/register-handlers.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/domain/table/business/warehouse/warehouse-allocate/runtime/row-change-handlers.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Doc } from '../../../../../../core';
|
|
2
|
+
/**
|
|
3
|
+
* 物料切换 / 清空
|
|
4
|
+
*/
|
|
5
|
+
export declare function handleProductIdChange(doc: Doc, subFieldKey: string, rowIndex: number): void;
|
|
6
|
+
/**
|
|
7
|
+
* 库位切换 / 清空
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleLocationChange(doc: Doc, subFieldKey: string, rowIndex: number): void;
|