@gct-paas/word 0.1.51 → 0.1.52-beta.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/dist/assets/svgs/table/index.d.ts +28 -0
- package/dist/base/dropdown/src/dropdown-basic-select.vue.d.ts +3 -0
- package/dist/capabilities/field-manifest/service.d.ts +2 -0
- package/dist/capabilities/model-field-runtime/types/field.d.ts +3 -1
- package/dist/capabilities/panel/schema/types.d.ts +1 -0
- package/dist/core/command/types.d.ts +2 -1
- package/dist/core/data/DataManager.d.ts +8 -0
- package/dist/core/data/post-change-pipeline.d.ts +6 -4
- package/dist/core/model/document/wtcRegionRef.d.ts +43 -4
- package/dist/core/model/logic/subtable/repeating/RepeatingRegion.d.ts +6 -1
- package/dist/domain/active/active-types.d.ts +2 -0
- package/dist/domain/field/field-binding.d.ts +4 -1
- package/dist/domain/field/field-props-schema-type.d.ts +1 -1
- package/dist/domain/field/field-type.d.ts +17 -1
- package/dist/domain/field/resolve-field-type.d.ts +7 -0
- package/dist/domain/table/_shared/autofill-expander.d.ts +20 -0
- package/dist/domain/table/_shared/linkage-engine.d.ts +25 -0
- package/dist/domain/table/_shared/region-item-theme.d.ts +6 -0
- package/dist/domain/table/_shared/rule-engine.d.ts +9 -0
- package/dist/domain/table/_shared/runtime-engine.d.ts +12 -0
- package/dist/domain/table/_shared/sub-model-matcher.d.ts +14 -0
- package/dist/domain/table/_shared/table-runtime-shared.d.ts +45 -0
- package/dist/domain/table/_shared/table-theme.d.ts +12 -0
- package/dist/domain/table/business/check-table/index.d.ts +2 -0
- package/dist/domain/table/business/check-table/profile.d.ts +3 -0
- package/dist/domain/table/business/material-balance/index.d.ts +1 -0
- package/dist/domain/table/business/material-balance/profile.d.ts +3 -0
- package/dist/domain/table/business/material-consume/index.d.ts +2 -0
- package/dist/domain/table/business/material-consume/profile.d.ts +3 -0
- package/dist/domain/table/business/warehouse-in-out/fields.d.ts +2 -0
- package/dist/domain/table/business/warehouse-in-out/index.d.ts +2 -0
- package/dist/domain/table/business/warehouse-in-out/profile.d.ts +2 -0
- package/dist/domain/table/business/warehouse-inventory/index.d.ts +1 -0
- package/dist/domain/table/business/warehouse-inventory/profile.d.ts +3 -0
- package/dist/domain/table/business/warehouse-transfer/index.d.ts +1 -0
- package/dist/domain/table/business/warehouse-transfer/profile.d.ts +3 -0
- package/dist/domain/table/data/dynamic-table/index.d.ts +2 -0
- package/dist/domain/table/data/dynamic-table/profile.d.ts +3 -0
- package/dist/domain/table/data/fixed-table/index.d.ts +2 -0
- package/dist/domain/table/data/fixed-table/profile.d.ts +3 -0
- package/dist/domain/table/data/two-d-table/index.d.ts +2 -0
- package/dist/domain/table/data/two-d-table/profile.d.ts +3 -0
- package/dist/domain/table/hooks/on-field-attach.d.ts +16 -0
- package/dist/domain/table/hooks/on-subtable-create.d.ts +22 -0
- package/dist/domain/table/index.d.ts +12 -0
- package/dist/domain/table/registry.d.ts +29 -0
- package/dist/domain/table/types.d.ts +286 -0
- package/dist/index.es.js +3681 -2776
- package/dist/runtime/_register_/context/DesignSuiteContext.d.ts +3 -0
- package/dist/runtime/canvas/table/utils/index.d.ts +2 -59
- package/dist/runtime/designer/panel/panel-nav.d.ts +13 -0
- package/dist/runtime/designer/ribbon/components/table-ribbon-group.vue.d.ts +2 -0
- package/dist/runtime/designer/ribbon/svg/table/table-svg-icon.vue.d.ts +11 -0
- package/dist/runtime/factories/createDesignWidgetFactory.d.ts +4 -2
- package/dist/runtime/renderer/dropdowns/components/tables/columns/business/ref.d.ts +11 -0
- package/dist/runtime/renderer/dropdowns/components/tables/utils/quick-search.d.ts +4 -0
- package/dist/suites/edhr/manifest/field/logic/ref-manifest.d.ts +2 -0
- package/dist/suites/edhr/manifest/field/material/warehouse-manager-manifest.d.ts +2 -0
- package/dist/suites/edhr/manifest/field/material/warehouse-receipt-date-manifest.d.ts +2 -0
- package/dist/suites/edhr/manifest/field/material/warehouse-receipt-no-manifest.d.ts +2 -0
- package/dist/suites/edhr/manifest/field/trace/external-reference-no-manifest.d.ts +2 -0
- package/dist/suites/edhr/panel-router/index.d.ts +2 -1
- package/dist/suites/edhr/panel-schema/2d-table/2d-table.basic.d.ts +1 -14
- package/dist/suites/edhr/panel-schema/_shared/create-table-panel-schema.d.ts +3 -0
- package/dist/suites/edhr/panel-schema/_shared/data-group-2d-title.d.ts +7 -0
- package/dist/suites/edhr/panel-schema/check-table/check-table.basic.d.ts +1 -14
- package/dist/suites/edhr/panel-schema/data-group-2d/data-group-2d.basic.d.ts +2 -0
- package/dist/suites/edhr/panel-schema/dynamic-table/dynamic-table.basic.d.ts +1 -14
- package/dist/suites/edhr/panel-schema/fixed-table/fixed-table.basic.d.ts +1 -14
- package/dist/suites/edhr/panel-schema/index.d.ts +7 -70
- package/dist/suites/edhr/panel-schema/material-consume-table/material-consume-table.basic.d.ts +1 -14
- package/dist/suites/edhr/panel-schema/warehouse-in-out-table/warehouse-in-out-table.basic.d.ts +1 -0
- package/dist/suites/shared/hooks/useSubTablePanelBase.d.ts +14 -0
- package/dist/suites/shared/panel/modules/sub-table-basic-info.vue.d.ts +31 -0
- package/dist/suites/shared/panel/modules/sub-table-grid-info.vue.d.ts +12 -0
- package/dist/word.css +206 -289
- package/package.json +1 -1
- package/dist/suites/edhr/panel-schema/dynamic-table/DynamicTablePanel.vue.d.ts +0 -8
- package/dist/suites/edhr/panel-schema/fixed-table/FixedTablePanel.vue.d.ts +0 -8
- /package/dist/suites/edhr/panel-schema/{2d-table/_2DTablePanel.vue.d.ts → _shared/BoundedSubTablePanel.vue.d.ts} +0 -0
- /package/dist/suites/edhr/panel-schema/{check-table/CheckTablePanel.vue.d.ts → _shared/RepeatingSubTablePanel.vue.d.ts} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Ribbon 主按钮图标 */
|
|
2
|
+
export declare const TABLE_CATEGORY_SVG: {
|
|
3
|
+
readonly dataTable: string;
|
|
4
|
+
readonly businessTable: string;
|
|
5
|
+
};
|
|
6
|
+
/** 数据表下拉项图标(按 tableType) */
|
|
7
|
+
export declare const TABLE_DATA_SVG: {
|
|
8
|
+
readonly 'table-header': string;
|
|
9
|
+
readonly 'dynamic-table': string;
|
|
10
|
+
readonly 'fixed-table': string;
|
|
11
|
+
readonly 'two-d-table': string;
|
|
12
|
+
};
|
|
13
|
+
/** 业务表下拉项图标(按 tableType) */
|
|
14
|
+
export declare const TABLE_BUSINESS_SVG: {
|
|
15
|
+
readonly 'warehouse-in-out': string;
|
|
16
|
+
readonly 'warehouse-inventory': string;
|
|
17
|
+
readonly 'warehouse-transfer': string;
|
|
18
|
+
readonly 'material-consume': string;
|
|
19
|
+
readonly 'material-balance': string;
|
|
20
|
+
readonly 'check-table': string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Ribbon 下拉项 value → SVG URL
|
|
24
|
+
*/
|
|
25
|
+
export declare const TABLE_SVG_BY_RIBBON_ACTION: Record<string, string>;
|
|
26
|
+
export type TableCategorySvgKey = keyof typeof TABLE_CATEGORY_SVG;
|
|
27
|
+
export type TableDataSvgKey = keyof typeof TABLE_DATA_SVG;
|
|
28
|
+
export type TableBusinessSvgKey = keyof typeof TABLE_BUSINESS_SVG;
|
|
@@ -24,6 +24,8 @@ type __VLS_Props = {
|
|
|
24
24
|
grouped?: boolean;
|
|
25
25
|
/** 下拉框宽度 */
|
|
26
26
|
popperWidth?: number;
|
|
27
|
+
/** 选项列表最大高度 */
|
|
28
|
+
listMaxHeight?: number | string;
|
|
27
29
|
dropdownExtraProps?: Record<string, any>;
|
|
28
30
|
};
|
|
29
31
|
declare function __VLS_template(): {
|
|
@@ -72,6 +74,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
72
74
|
showCheck: boolean;
|
|
73
75
|
grouped: boolean;
|
|
74
76
|
popperWidth: number;
|
|
77
|
+
listMaxHeight: number | string;
|
|
75
78
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
76
79
|
dropdownRef: import('vue').CreateComponentPublicInstanceWithMixins<Record<string, any> & {}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, {}, {}, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
77
80
|
P: {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BaseService } from '../base/BaseService';
|
|
2
2
|
import { FieldManifestRegistry } from './registry';
|
|
3
|
+
import { FieldTypeSource } from '../../domain/field/resolve-field-type';
|
|
3
4
|
import { FIELD_TYPE } from '../../domain/field/field-type';
|
|
4
5
|
import { FieldManifest } from './types';
|
|
5
6
|
export declare class FieldManifestService extends BaseService<FIELD_TYPE, FieldManifest, FieldManifestRegistry> {
|
|
6
7
|
constructor(suiteKey: SuiteKey);
|
|
7
8
|
getManifestBySuite(): FieldManifest[];
|
|
8
9
|
getManifestByType(fieldType: FIELD_TYPE): FieldManifest | undefined;
|
|
10
|
+
getManifestForField(field: FieldTypeSource): FieldManifest | undefined;
|
|
9
11
|
}
|
|
@@ -3,7 +3,7 @@ import { Doc } from '../view/Doc';
|
|
|
3
3
|
import { WidgetMeta } from '../widget/widget-meta';
|
|
4
4
|
import { WordHighlight } from '../model/types';
|
|
5
5
|
import { PointerHitResult } from '../cursor/hit/types';
|
|
6
|
-
import { SubTableRegionType } from '../model/document/wtcRegionRef';
|
|
6
|
+
import { SubTableLayoutType, SubTableRegionType } from '../model/document/wtcRegionRef';
|
|
7
7
|
export interface CursorMeta {
|
|
8
8
|
nodeId: string;
|
|
9
9
|
offset: number;
|
|
@@ -156,6 +156,7 @@ export type CommandPayloadMap = {
|
|
|
156
156
|
setRepeating: CommandPayload & {
|
|
157
157
|
name: string;
|
|
158
158
|
valuePath: string;
|
|
159
|
+
layoutType?: SubTableLayoutType;
|
|
159
160
|
};
|
|
160
161
|
set2DTable: CommandPayload & {
|
|
161
162
|
name: string;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { Doc } from '../view/Doc';
|
|
2
2
|
import { PostChangePipelineContext } from './post-change-pipeline';
|
|
3
3
|
export type EmitSource = 'user' | 'dependency' | 'enrichment' | 'parent';
|
|
4
|
+
/** 单字段变更明细(path 作为 FieldChangeMap 的 key) */
|
|
5
|
+
export interface FieldChangeDetail {
|
|
6
|
+
oldValue: unknown;
|
|
7
|
+
newValue: unknown;
|
|
8
|
+
source: EmitSource;
|
|
9
|
+
}
|
|
10
|
+
/** 本批次字段变更:path → 变更明细 */
|
|
11
|
+
export type FieldChangeMap = Record<string, FieldChangeDetail>;
|
|
4
12
|
export type Data = Record<string, any>;
|
|
5
13
|
export type PartialData = Partial<Data>;
|
|
6
14
|
type JsonPath = string;
|
|
@@ -2,7 +2,7 @@ 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, EmitSource } from './DataManager';
|
|
5
|
+
import { DataManager, EmitSource, FieldChangeMap } from './DataManager';
|
|
6
6
|
/**
|
|
7
7
|
* Pipeline 运行时上下文
|
|
8
8
|
*
|
|
@@ -19,6 +19,8 @@ export type PostChangePipelineContext = {
|
|
|
19
19
|
* 根据模型 key + 字段 key 获取字段 meta
|
|
20
20
|
*/
|
|
21
21
|
loadFieldByKey: (modelKey: string, key: string) => Promise<FieldMeta | undefined>;
|
|
22
|
+
/** 数据变更并完成 enrich 后的扩展钩子 */
|
|
23
|
+
afterFlush?: (changedMap: FieldChangeMap, source: EmitSource) => void | Promise<void>;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* 数据变更后的处理流水线
|
|
@@ -91,10 +93,10 @@ export declare class PostChangePipeline {
|
|
|
91
93
|
/**
|
|
92
94
|
* 变更后执行流水线
|
|
93
95
|
*
|
|
94
|
-
* @param
|
|
95
|
-
* @param source
|
|
96
|
+
* @param changedMap 本批次字段变更 path → { oldValue, newValue, source }
|
|
97
|
+
* @param source 批次级变更来源(兼容保留,单字段以 map 内 source 为准)
|
|
96
98
|
*/
|
|
97
|
-
flush(
|
|
99
|
+
flush(changedMap: FieldChangeMap, source: EmitSource): Promise<void>;
|
|
98
100
|
/**
|
|
99
101
|
* 执行某个 path 对应的 enrichers
|
|
100
102
|
*/
|
|
@@ -1,24 +1,63 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* 子表区域与布局类型定义
|
|
3
|
+
*
|
|
4
|
+
* 维护「存储层 region 类型」与「UI/layout 层类型」的映射关系:
|
|
5
|
+
*
|
|
6
|
+
* - Region 类型(SubTableRegionType):写入 runtimeJson / DocModel,如 repeating、bounded
|
|
7
|
+
* - Layout 类型(SubTableLayoutType):设计器面板、Ribbon、主题色等 UI 层使用
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* 子表主体 region 类型
|
|
12
|
+
*
|
|
13
|
+
* - repeating:动态表
|
|
14
|
+
* - bounded:固定表
|
|
15
|
+
* - 2d-table:二维表
|
|
16
|
+
* - check-table:检验表
|
|
17
|
+
* - material-consume-table:物料消耗表
|
|
18
|
+
*
|
|
19
|
+
* 出入库明细等复用 repeating 存储,layout 层通过 widgetMeta.props.layoutType 区分。
|
|
20
|
+
*/
|
|
2
21
|
export type SubTableRegionType = 'repeating' | 'bounded' | '2d-table' | 'check-table' | 'material-consume-table';
|
|
22
|
+
/** 表头 region 类型 */
|
|
3
23
|
export type TableHeaderRegionType = 'table-header' | 'sub-table-header';
|
|
24
|
+
/** 所有子表表格 region 类型 */
|
|
4
25
|
export type TableRegionType = SubTableRegionType | TableHeaderRegionType;
|
|
5
|
-
|
|
6
|
-
export
|
|
26
|
+
/** 子表 region 类型枚举列表 */
|
|
27
|
+
export declare const SUB_TABLE_REGION_TYPES: readonly ["repeating", "bounded", "2d-table", "check-table", "material-consume-table"];
|
|
28
|
+
/**
|
|
29
|
+
* 子表 layout 类型
|
|
30
|
+
* Ribbon 面板、子表主题色均使用此类型;主题配置见 @/domain/table 各 Profile.theme
|
|
31
|
+
*/
|
|
32
|
+
export type SubTableLayoutType = 'dynamic-table' | 'fixed-table' | '2d-table' | 'check-table' | 'material-consume-table' | 'warehouse-in-out-table';
|
|
33
|
+
/** 表头 layout 类型 */
|
|
7
34
|
export type TableHeaderLayoutType = 'table-header';
|
|
35
|
+
/** 所有子表表格 layout 类型 */
|
|
8
36
|
export type TableLayoutType = SubTableLayoutType | TableHeaderLayoutType;
|
|
9
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* 子表内部单元格关联类型
|
|
39
|
+
* - bounded-item:固定表 / 检验表内的数据分组
|
|
40
|
+
* - data-group-2d:二维表内的动态关联分组
|
|
41
|
+
*/
|
|
10
42
|
export type SubTableItemType = 'bounded-item' | 'data-group-2d';
|
|
43
|
+
/** 单元格关联的子表 region 引用 */
|
|
11
44
|
export type WtcSubTableRef = {
|
|
12
45
|
type: SubTableRegionType;
|
|
13
46
|
regionId: string;
|
|
14
47
|
};
|
|
48
|
+
/** 单元格关联的子表内部 item 引用 */
|
|
15
49
|
export type WtcSubTableItemRef = {
|
|
16
50
|
type: SubTableItemType;
|
|
17
51
|
regionId: string;
|
|
18
52
|
};
|
|
53
|
+
/** 单元格关联的表头 region 引用 */
|
|
19
54
|
export type WtcHeaderRef = {
|
|
20
55
|
type: TableHeaderRegionType;
|
|
21
56
|
regionId: string;
|
|
22
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* 将存储层 region 类型转换为 UI layout 类型
|
|
60
|
+
*/
|
|
23
61
|
export declare function tableRegionTypeToLayoutType(type: SubTableRegionType): SubTableLayoutType;
|
|
62
|
+
/** 表头 region 类型转 layout 类型(恒为 table-header) */
|
|
24
63
|
export declare function headerRegionTypeToLayoutType(type: TableHeaderRegionType): TableHeaderLayoutType;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Wtbl } from '../../../document';
|
|
2
1
|
import { Region, RegionOptions } from '../../base/Region';
|
|
3
2
|
import { RegionJson } from '../../../types';
|
|
3
|
+
import { Wtbl } from '../../../document';
|
|
4
|
+
import { SubTableLayoutType } from '../../../document/wtcRegionRef';
|
|
4
5
|
export type RepeatingWidgetPropsMeta = {
|
|
5
6
|
/** 快速填报 */
|
|
6
7
|
quickFill: boolean;
|
|
8
|
+
/** UI layout 类型;默认 dynamic-table,出入库明细等为 warehouse-in-out-table */
|
|
9
|
+
layoutType?: SubTableLayoutType;
|
|
7
10
|
[key: string]: any;
|
|
8
11
|
};
|
|
9
12
|
export type RepeatingWidgetMeta = {
|
|
@@ -29,6 +32,8 @@ export declare class RepeatingRegion extends Region {
|
|
|
29
32
|
get linkFieldKey(): string;
|
|
30
33
|
get subValuePath(): string;
|
|
31
34
|
get linkValuePath(): string;
|
|
35
|
+
/** 设计/渲染层子表类型 */
|
|
36
|
+
get layoutType(): SubTableLayoutType;
|
|
32
37
|
toJSON(): RepeatingRegionJson;
|
|
33
38
|
static fromJSON(json: RepeatingRegionJson, table: Wtbl): RepeatingRegion;
|
|
34
39
|
}
|
|
@@ -38,7 +38,10 @@ import { FIELD_TYPE } from './field-type';
|
|
|
38
38
|
* $.scrap_material_1_
|
|
39
39
|
*/
|
|
40
40
|
export interface FieldDataBindingMeta {
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* 字段 manifest 类型(拖入时由 bizType ?? type 解析写入)
|
|
43
|
+
* 例:外部参考号字段为 external_reference_no,而非底层存储类型 text
|
|
44
|
+
*/
|
|
42
45
|
fieldType: FIELD_TYPE;
|
|
43
46
|
/**
|
|
44
47
|
* 字段链路
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 字段配置-渲染组件标识 */
|
|
2
|
-
export type FieldPropsSchemaKey = 'schema:field-text' | 'schema:field-boolean' | 'schema:field-number' | 'schema:field-datetime' | 'schema:field-user' | 'schema:field-org' | 'schema:field-sign' | 'schema:field-enum' | 'schema:field-file' | 'schema:field-image' | 'schema:field-trace' | 'schema:field-business';
|
|
2
|
+
export type FieldPropsSchemaKey = 'schema:field-text' | 'schema:field-boolean' | 'schema:field-number' | 'schema:field-datetime' | 'schema:field-user' | 'schema:field-org' | 'schema:field-sign' | 'schema:field-enum' | 'schema:field-file' | 'schema:field-image' | 'schema:field-trace' | 'schema:field-business' | 'schema:field-ref';
|
|
3
3
|
/** 优先级规则 */
|
|
4
4
|
export interface PriorityRule {
|
|
5
5
|
type: 'priority';
|
|
@@ -303,5 +303,21 @@ export declare enum FIELD_TYPE {
|
|
|
303
303
|
/**
|
|
304
304
|
* 设备多选(MedPro)
|
|
305
305
|
*/
|
|
306
|
-
DEVICE_REF_MULTI = "device_ref_multi"
|
|
306
|
+
DEVICE_REF_MULTI = "device_ref_multi",
|
|
307
|
+
/**
|
|
308
|
+
* 外部参考号
|
|
309
|
+
*/
|
|
310
|
+
EXTERNAL_REF_NO = "external_reference_no",
|
|
311
|
+
/**
|
|
312
|
+
* 单据编号
|
|
313
|
+
*/
|
|
314
|
+
WAREHOUSE_RECEIPT_NO = "warehouse_receipt_no",
|
|
315
|
+
/**
|
|
316
|
+
* 单据日期
|
|
317
|
+
*/
|
|
318
|
+
WAREHOUSE_RECEIPT_DATE = "warehouse_receipt_date",
|
|
319
|
+
/**
|
|
320
|
+
* 仓管员
|
|
321
|
+
*/
|
|
322
|
+
WAREHOUSE_MANAGER = "warehouse_manager"
|
|
307
323
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FieldMeta } from '../../capabilities/model-field-runtime';
|
|
2
|
+
import { FIELD_TYPE } from './field-type';
|
|
3
|
+
export type FieldTypeSource = Pick<FieldMeta, 'type' | 'bizType'>;
|
|
4
|
+
/** manifest / 面板 / 渲染 / icon 查找用的类型 */
|
|
5
|
+
export declare function resolveFieldManifestType(field: FieldTypeSource): FIELD_TYPE;
|
|
6
|
+
/** 数据形态、类型兼容逻辑用的存储类型 */
|
|
7
|
+
export declare function resolveFieldStorageType(field: FieldTypeSource): FIELD_TYPE;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AutofillRule } from '../../../suites/shared/panel/config/editor/ref-autofill-editor/types';
|
|
2
|
+
import { AutofillTemplate } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 关联字段 key 规范化:去掉末尾 `_`,用于生成填充目标字段名
|
|
5
|
+
* @example product_id_ → product_id → product_id_name_
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeRefFieldKey(fieldKey: string): string;
|
|
8
|
+
interface ExpandAutofillContext {
|
|
9
|
+
/** 拖入的源字段 key,如 product_id_ */
|
|
10
|
+
sourceFieldKey: string;
|
|
11
|
+
/** 目标字段所在模型 key(子表字段为子模型 modelKey) */
|
|
12
|
+
toModelKey?: string;
|
|
13
|
+
/** 是否为子表字段 */
|
|
14
|
+
toSubModel?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 将字段 Profile 中的 autofillTemplates 展开为 widget.props.autofillRules
|
|
18
|
+
*/
|
|
19
|
+
export declare function expandAutofillTemplates(templates: AutofillTemplate[], ctx: ExpandAutofillContext): AutofillRule[];
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Doc } from '../../../core';
|
|
2
|
+
import { FieldChangeDetail } from '../../../core/data/DataManager';
|
|
3
|
+
import { BusinessSubTableRuntimeContext } from './table-runtime-shared';
|
|
4
|
+
import { RuleContext, SelectBehaviorDef } from '../types';
|
|
5
|
+
/** 解析级联上游字段值:行数据 → 隐式主表字段 → 主表同名字段 */
|
|
6
|
+
export declare function resolveLinkFieldValue(doc: Doc, runtimeCtx: BusinessSubTableRuntimeContext, ctx: RuleContext, linkFieldKey: string, select?: SelectBehaviorDef): unknown;
|
|
7
|
+
/** 字段值变更后:重建级联查询参数;仅上游值实质变化时清空下游 */
|
|
8
|
+
export declare function applyBusinessTableLinkageOnFieldChange(doc: Doc, changedPath: string, fieldChange?: FieldChangeDetail): void;
|
|
9
|
+
/** 子表插行后:应用级联查询参数 */
|
|
10
|
+
export declare function applyBusinessTableLinkageOnRowInit(doc: Doc, subFieldKey: string, rowIndex: number): void;
|
|
11
|
+
/** 文档初始化后:应用级联查询参数 */
|
|
12
|
+
export declare function applyBusinessTableLinkageOnInit(doc: Doc): void;
|
|
13
|
+
export interface BusinessSelectLinkageResult {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
linkFieldKey?: string;
|
|
16
|
+
linkValue?: unknown;
|
|
17
|
+
}
|
|
18
|
+
/** 下拉组件运行时解析 Profile 级联配置 */
|
|
19
|
+
export declare function resolveBusinessSelectLinkage(doc: Doc, options: {
|
|
20
|
+
subFieldKey?: string;
|
|
21
|
+
fieldKey?: string;
|
|
22
|
+
runtimeValuePath?: string;
|
|
23
|
+
}): BusinessSelectLinkageResult | null;
|
|
24
|
+
/** 上游字段变更时,同步清空下游字段 */
|
|
25
|
+
export declare function buildLinkageDownstreamClears(doc: Doc, pendingUpdates: Record<string, unknown>): Record<string, undefined>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Doc } from '../../../core';
|
|
2
|
+
import { FieldChangeDetail } from '../../../core/data/DataManager';
|
|
3
|
+
export { collectBusinessSubTableContexts, parseSubtableFieldPath, type BusinessSubTableRuntimeContext, } from './table-runtime-shared';
|
|
4
|
+
/** 字段值变更后:应用 onFieldChange 规则 */
|
|
5
|
+
export declare function applyBusinessTableRulesOnFieldChange(doc: Doc, changedPath: string, fieldChange?: FieldChangeDetail): void;
|
|
6
|
+
/** 子表插行后:应用 onRowInit + always */
|
|
7
|
+
export declare function applyBusinessTableRulesOnRowInit(doc: Doc, subFieldKey: string, rowIndex: number): void;
|
|
8
|
+
/** 文档初始化后:应用 always + onRowInit 规则 */
|
|
9
|
+
export declare function applyBusinessTableRulesOnInit(doc: Doc): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Doc } from '../../../core';
|
|
2
|
+
import { FieldChangeDetail, FieldChangeMap } from '../../../core/data/DataManager';
|
|
3
|
+
export { buildLinkageDownstreamClears, resolveBusinessSelectLinkage, type BusinessSelectLinkageResult, } from './linkage-engine';
|
|
4
|
+
export { collectBusinessSubTableContexts, parseSubtableFieldPath, type BusinessSubTableRuntimeContext, } from './table-runtime-shared';
|
|
5
|
+
/** 文档初始化 */
|
|
6
|
+
export declare function applyBusinessTableRuntimeOnInit(doc: Doc): void;
|
|
7
|
+
/** 子表插行 */
|
|
8
|
+
export declare function applyBusinessTableRuntimeOnRowInit(doc: Doc, subFieldKey: string, rowIndex: number): void;
|
|
9
|
+
/** 字段变更 */
|
|
10
|
+
export declare function applyBusinessTableRuntimeOnFieldChange(doc: Doc, changedPath: string, fieldChange?: FieldChangeDetail): void;
|
|
11
|
+
/** 批量字段变更 */
|
|
12
|
+
export declare function applyBusinessTableRuntimeOnFieldChanges(doc: Doc, changedMap: FieldChangeMap): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FieldMeta } from '../../../capabilities/model-field-runtime';
|
|
2
|
+
import { DropdownOption } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* 生成「选择子模型」下拉选项
|
|
5
|
+
* @param tableTypeOrRibbonAction 表类型或 Ribbon action
|
|
6
|
+
* @param fields 主模型下所有字段
|
|
7
|
+
* @param usedKeys 文档中已占用的子模型 field key(不可重复绑定)
|
|
8
|
+
*/
|
|
9
|
+
export declare function getSubModelOptions(tableTypeOrRibbonAction: string, fields: FieldMeta[], usedKeys?: string[]): DropdownOption[];
|
|
10
|
+
/**
|
|
11
|
+
* 创建子表前兜底校验
|
|
12
|
+
* @throws 子模型与表类型不匹配时抛出 Error
|
|
13
|
+
*/
|
|
14
|
+
export declare function validateSubModelBinding(tableTypeOrRibbonAction: string, fieldKey: string, fields: FieldMeta[]): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Doc } from '../../../core';
|
|
2
|
+
import { FieldChangeDetail } from '../../../core/data/DataManager';
|
|
3
|
+
import { BusinessFieldProfile, BusinessSubTableProfile, RuleContext } from '../types';
|
|
4
|
+
export interface BusinessSubTableRuntimeContext {
|
|
5
|
+
profile: BusinessSubTableProfile;
|
|
6
|
+
subFieldKey: string;
|
|
7
|
+
refModelType: string;
|
|
8
|
+
arrayPath: string;
|
|
9
|
+
}
|
|
10
|
+
/** 解析子表字段路径 `$.subFieldKey[n].fieldKey` */
|
|
11
|
+
export declare function parseSubtableFieldPath(path: string): {
|
|
12
|
+
subFieldKey: string;
|
|
13
|
+
rowIndex: number;
|
|
14
|
+
fieldKey: string;
|
|
15
|
+
} | null;
|
|
16
|
+
/** 解析主表字段路径 `$.fieldKey` */
|
|
17
|
+
export declare function parseMainFieldPath(path: string): string | null;
|
|
18
|
+
type BusinessFieldChange = {
|
|
19
|
+
kind: 'subtable';
|
|
20
|
+
subFieldKey: string;
|
|
21
|
+
rowIndex: number;
|
|
22
|
+
fieldKey: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'main';
|
|
25
|
+
fieldKey: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function parseBusinessFieldChange(changedPath: string): BusinessFieldChange | null;
|
|
28
|
+
/** 收集文档中已配置 layoutType 的业务子表 */
|
|
29
|
+
export declare function collectBusinessSubTableContexts(doc: Doc): BusinessSubTableRuntimeContext[];
|
|
30
|
+
export declare function findBusinessSubTableContext(doc: Doc, subFieldKey: string): BusinessSubTableRuntimeContext | undefined;
|
|
31
|
+
export declare function buildRuleContext(doc: Doc, runtimeCtx: BusinessSubTableRuntimeContext, rowIndex: number, changedFieldKey?: string): RuleContext;
|
|
32
|
+
export declare function getRowCount(doc: Doc, subFieldKey: string): number;
|
|
33
|
+
export declare function resolveFieldKeyFromMatch(fieldProfile: BusinessFieldProfile): string | undefined;
|
|
34
|
+
export declare function findFieldProfile(profile: BusinessSubTableProfile, fieldKey: string): BusinessFieldProfile | undefined;
|
|
35
|
+
export declare function isImplicitLinkFieldChanged(runtimeCtx: BusinessSubTableRuntimeContext, changedFieldKey: string): boolean;
|
|
36
|
+
/** 遍历业务子表行(支持单行或全表) */
|
|
37
|
+
export declare function forEachBusinessTableRow(doc: Doc, runtimeCtx: BusinessSubTableRuntimeContext, options: {
|
|
38
|
+
rowIndex?: number;
|
|
39
|
+
changedFieldKey?: string;
|
|
40
|
+
} | undefined, iteratee: (ctx: RuleContext) => void): void;
|
|
41
|
+
/** 判断字段值是否实质未变(用于避免同值 set 误触发级联清空) */
|
|
42
|
+
export declare function isSameFieldValue(a: unknown, b: unknown): boolean;
|
|
43
|
+
/** 上游字段变更是否应触发下游清空 */
|
|
44
|
+
export declare function shouldClearDownstreamForFieldChange(change?: FieldChangeDetail): boolean;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** 子表主题使用的样式结构 */
|
|
2
|
+
interface TableStyleResult {
|
|
3
|
+
strokeColor: string;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
label: string;
|
|
6
|
+
labelBjColor: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 获取子表设计态样式
|
|
10
|
+
*/
|
|
11
|
+
export declare function getStyleByType(type: string): TableStyleResult;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { profile as materialBalanceProfile } from './profile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { profile as warehouseInventoryProfile } from './profile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { profile as warehouseTransferProfile } from './profile';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldMeta } from '../../../capabilities/model-field-runtime';
|
|
2
|
+
import { WidgetMeta } from '../../../core';
|
|
3
|
+
interface ApplyFieldProfileOptions {
|
|
4
|
+
/** 子表分区路径,如 f_crkmx 或 f_ewb:f_link */
|
|
5
|
+
parentFieldKey?: string;
|
|
6
|
+
/** 用于解析业务表 Profile */
|
|
7
|
+
refModelType?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 字段拖入画布时应用业务表字段 Profile
|
|
11
|
+
* - 合并 defaultProps
|
|
12
|
+
* - 应用 locked 属性
|
|
13
|
+
* - 展开 autofillTemplates → autofillRules
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyFieldProfileOnAttach(widget: WidgetMeta, field: FieldMeta, options?: ApplyFieldProfileOptions): WidgetMeta;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DocModel } from '../../../core/model/DocModel';
|
|
2
|
+
import { FieldMeta } from '../../../capabilities/model-field-runtime';
|
|
3
|
+
import { SubTableCommand } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* 从当前文档收集已被子表占用的 master_slave field key
|
|
6
|
+
*/
|
|
7
|
+
export declare function collectUsedSubModelKeys(docModel?: DocModel | null): string[];
|
|
8
|
+
interface ConfirmSubTableCreateOptions {
|
|
9
|
+
/** Ribbon 触发的表类型 action */
|
|
10
|
+
ribbonAction: string;
|
|
11
|
+
/** 用户选择的子模型 field key */
|
|
12
|
+
subFieldKey: string;
|
|
13
|
+
fields: FieldMeta[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 确认创建子表:校验子模型绑定合法性,返回应执行的 Doc 命令
|
|
17
|
+
* @throws 校验失败时抛出 Error
|
|
18
|
+
*/
|
|
19
|
+
export declare function confirmSubTableCreate(options: ConfirmSubTableCreateOptions): SubTableCommand;
|
|
20
|
+
/** 解析 Ribbon action 对应的表 Profile */
|
|
21
|
+
export declare function resolveSubTableProfile(ribbonAction: string): import('..').TableProfile | undefined;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 子表配置化模块统一导出
|
|
3
|
+
*/
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './registry';
|
|
6
|
+
export * from './_shared/sub-model-matcher';
|
|
7
|
+
export * from './_shared/autofill-expander';
|
|
8
|
+
export * from './_shared/region-item-theme';
|
|
9
|
+
export * from './_shared/table-theme';
|
|
10
|
+
export * from './_shared/rule-engine';
|
|
11
|
+
export * from './hooks/on-subtable-create';
|
|
12
|
+
export * from './hooks/on-field-attach';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DropdownOption, DropdownOptionGroup } from '../../base';
|
|
2
|
+
import { BusinessSubTableProfile, TableProfile } from './types';
|
|
3
|
+
/** 表头(挂在数据表 Ribbon 首位) */
|
|
4
|
+
export declare const TABLE_HEADER_RIBBON_OPTION: DropdownOption;
|
|
5
|
+
/** 所有已注册的子表 Profile */
|
|
6
|
+
declare const ALL_TABLE_PROFILES: TableProfile[];
|
|
7
|
+
/** 按表类型获取 Profile */
|
|
8
|
+
export declare function getProfile(type: string): TableProfile | undefined;
|
|
9
|
+
/** 按 Ribbon 下拉项 value 获取 Profile */
|
|
10
|
+
export declare function getProfileByRibbonAction(ribbonAction: string): TableProfile | undefined;
|
|
11
|
+
/** 按 layoutType 获取 Profile */
|
|
12
|
+
export declare function getProfileByLayoutType(layoutType: string): TableProfile | undefined;
|
|
13
|
+
/** 按 layout 类型获取展示名称 */
|
|
14
|
+
export declare function getTableLabelByLayoutType(layoutType: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* 收集所有已注册业务表的 refModelType
|
|
17
|
+
* 用于判断 master_slave 字段是否属于业务子模型
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAllBusinessRefModelTypes(): string[];
|
|
20
|
+
/** 按 refModelType 获取业务表 Profile */
|
|
21
|
+
export declare function getBusinessProfileByRefModelType(refModelType: string): BusinessSubTableProfile | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* 生成 Ribbon「数据表」「业务表」下拉选项
|
|
24
|
+
*/
|
|
25
|
+
export declare function getRibbonTableOptions(): {
|
|
26
|
+
dataTables: DropdownOption[];
|
|
27
|
+
businessTables: DropdownOptionGroup[];
|
|
28
|
+
};
|
|
29
|
+
export { ALL_TABLE_PROFILES };
|