@gct-paas/word 0.1.47-beta.1 → 0.1.47-beta.10
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/base/input/src/input.vue.d.ts +5 -5
- package/dist/base/input/src/text-area.vue.d.ts +4 -4
- package/dist/capabilities/panel/schema/types.d.ts +14 -4
- package/dist/core/command/base/CommandBase.d.ts +3 -0
- package/dist/core/command/commands/SetMaterialConsumeTable.d.ts +7 -0
- package/dist/core/command/types.d.ts +7 -2
- package/dist/core/cursor/render/cursor-renderer.vue.d.ts +2 -2
- package/dist/core/data/DataManager.d.ts +13 -0
- package/dist/core/interaction/types.d.ts +3 -0
- package/dist/core/interaction/useInteraction.d.ts +16 -0
- package/dist/core/layout/LayoutMapper.d.ts +4 -0
- package/dist/core/layout/attach-field/AttachFieldContext.d.ts +59 -0
- package/dist/core/layout/attach-field/index.d.ts +2 -0
- package/dist/core/layout/attach-field/types.d.ts +20 -0
- package/dist/core/layout/handlers/fields/AttachFieldHandler.d.ts +10 -0
- package/dist/core/layout/handlers/fields/OptionHandler.d.ts +2 -0
- package/dist/core/layout/handlers/fields/index.d.ts +1 -0
- package/dist/core/model/document/Wtbl/Calculation.d.ts +4 -0
- package/dist/core/model/document/Wtbl/RegionManager.d.ts +5 -1
- package/dist/core/model/document/Wtbl.d.ts +5 -1
- package/dist/core/model/document/Wtc.d.ts +3 -3
- package/dist/core/model/document/wtcRegionRef.d.ts +11 -7
- package/dist/core/model/logic/index.d.ts +2 -0
- package/dist/core/model/logic/subtable/repeating/MaterialConsumeTableRegion.d.ts +37 -0
- package/dist/core/model/logic/types.d.ts +4 -3
- package/dist/core/utils/expand.d.ts +5 -3
- package/dist/core/view/TableCell.d.ts +5 -3
- package/dist/domain/active/active-types.d.ts +7 -1
- package/dist/domain/field/attach-field.d.ts +15 -0
- package/dist/index.es.js +12288 -9193
- package/dist/runtime/_register_/composables/panel/useActivePanel.d.ts +2 -0
- package/dist/runtime/canvas/__common__/context-menu/resolve-table-menu-index.d.ts +9 -0
- package/dist/runtime/canvas/table/render/label-parse-rule/index.d.ts +2 -0
- package/dist/runtime/canvas/table/render/label-parse-rule/type.d.ts +56 -0
- package/dist/runtime/canvas/table/render/label-parse-rule/useLabelParsingRules.d.ts +39 -0
- package/dist/runtime/canvas/table/render/material-consume/bom-validator.d.ts +168 -0
- package/dist/runtime/canvas/table/render/material-consume/index.d.ts +3 -0
- package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts +212 -0
- package/dist/runtime/canvas/table/render/material-consume/mc-render.d.ts +47 -0
- package/dist/runtime/canvas/table/render/material-consume/mc-web-render.d.ts +21 -0
- package/dist/runtime/canvas/table/render/material-consume/service.d.ts +49 -0
- package/dist/runtime/canvas/table/render/material-consume/tmpl-bom-controller.d.ts +80 -0
- package/dist/runtime/canvas/table/render/table-structure-overlay/sub-table-action.vue.d.ts +1 -0
- package/dist/runtime/canvas/table/utils/index.d.ts +9 -1
- package/dist/runtime/canvas/table/utils/useTableSelection.d.ts +16 -0
- package/dist/runtime/designer/ribbon/components/sub-table-form-modal.vue.d.ts +2 -1
- package/dist/runtime/factories/useFormValidator.d.ts +13 -4
- package/dist/runtime/factories/validation-refresh-scheduler.d.ts +7 -0
- package/dist/runtime/renderer/dialogs/device-scan/device-scan-dialog.vue.d.ts +12 -12
- package/dist/runtime/renderer/dropdowns/components/tables/composables/useTableDropdown.d.ts +1 -0
- package/dist/runtime/renderer/dropdowns/components/tables/rdo-table-dropdown.vue.d.ts +12 -12
- package/dist/runtime/renderer/dropdowns/components/tables/strategy/selectStrategy.d.ts +2 -0
- package/dist/runtime/renderer/dropdowns/components/tables/table-dropdown.vue.d.ts +12 -12
- package/dist/runtime/renderer/dropdowns/components/tree/tree-node.vue.d.ts +2 -0
- package/dist/runtime/renderer/validation/validation-comment-item.vue.d.ts +2 -0
- package/dist/sdk/doc-runtime/composables/useValidationFullSync.d.ts +9 -0
- package/dist/sdk/doc-runtime/factories/document-initializer.d.ts +21 -0
- package/dist/sdk/doc-runtime/factories/useDocumentFactory.d.ts +3 -0
- package/dist/sdk/plugins/index.d.ts +1 -1
- package/dist/sdk/plugins/register-panel-schemas.d.ts +1 -1
- package/dist/suites/edhr/panel-schema/field/field.basic.d.ts +5 -0
- package/dist/suites/edhr/panel-schema/index.d.ts +18 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/MaterialConsumeTablePanel.vue.d.ts +8 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/bom-entry-editor.vue.d.ts +13 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/bom-product-name.vue.d.ts +7 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/material-consume-table.basic.d.ts +14 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/parse-rule-add-btn.vue.d.ts +13 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/parse-rule-editor.vue.d.ts +11 -0
- package/dist/suites/edhr/panel-schema/material-consume-table/use-product-translate.d.ts +3 -0
- package/dist/suites/shared/hooks/panel-props-source.d.ts +36 -0
- package/dist/suites/shared/hooks/useAttachedFieldActivate.d.ts +6 -0
- package/dist/suites/shared/hooks/useFieldPanel.d.ts +7 -0
- package/dist/suites/shared/hooks/useFieldPanelMeta.d.ts +11 -0
- package/dist/suites/shared/hooks/usePanelProps.d.ts +4 -0
- package/dist/suites/shared/panel/config/editor/attach-fields-editor/resolve-attach-field.d.ts +5 -0
- package/dist/suites/shared/panel/config/editor/attach-fields-editor/types.d.ts +4 -0
- package/dist/suites/shared/panel/config/editor/enum-opt-editor/types.d.ts +3 -0
- package/dist/suites/shared/panel/modules/field-dependency-module/field-dependency-modal.vue.d.ts +3 -0
- package/dist/suites/shared/panel/modules/field-dependency-module/types.d.ts +2 -0
- package/dist/suites/shared/panel/modules/field-formula-module/field-formula-module.vue.d.ts +2 -0
- package/dist/suites/shared/panel/modules/field-formula-module/formula-field-options.d.ts +2 -0
- package/dist/suites/shared/panel/modules/table-setting-module.vue.d.ts +2 -1
- package/dist/types/formula.type.d.ts +140 -0
- package/dist/types/material.type.d.ts +132 -0
- package/dist/utils/TriggerUtil.d.ts +1 -1
- package/dist/utils/func/form.d.ts +26 -0
- package/dist/utils/symbol/contextKey.d.ts +2 -0
- package/dist/word.css +450 -317
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
15
15
|
focus: () => void;
|
|
16
16
|
blur: () => void;
|
|
17
17
|
select: () => void;
|
|
18
|
-
inputRef: import('vue').Ref<
|
|
18
|
+
inputRef: import('vue').Ref<HTMLTextAreaElement | HTMLInputElement | null, HTMLTextAreaElement | HTMLInputElement | null>;
|
|
19
19
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
20
20
|
input: (value: string | number, event: Event) => any;
|
|
21
21
|
search: (value: string | number) => any;
|
|
@@ -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;
|
|
@@ -47,6 +47,8 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
47
47
|
readonly: boolean;
|
|
48
48
|
disabled: boolean;
|
|
49
49
|
size: import('./types').InputSize;
|
|
50
|
+
autocomplete: string;
|
|
51
|
+
spellcheck: boolean;
|
|
50
52
|
placeholder: string;
|
|
51
53
|
modelValue: string | number;
|
|
52
54
|
prefix: string;
|
|
@@ -58,11 +60,9 @@ declare const __VLS_component: import('vue').DefineComponent<GctInputProps, {
|
|
|
58
60
|
showPasswordToggle: boolean;
|
|
59
61
|
maxLength: number;
|
|
60
62
|
autofocus: boolean;
|
|
61
|
-
autocomplete: string;
|
|
62
63
|
rows: number;
|
|
63
64
|
bordered: boolean;
|
|
64
65
|
showSearchButton: boolean;
|
|
65
|
-
spellcheck: boolean;
|
|
66
66
|
customStyle: Record<string, string | number>;
|
|
67
67
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
68
68
|
inputRef: HTMLInputElement;
|
|
@@ -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,23 +35,23 @@ 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;
|
|
43
43
|
readonly: boolean;
|
|
44
44
|
disabled: boolean;
|
|
45
|
+
autocomplete: string;
|
|
46
|
+
spellcheck: boolean;
|
|
45
47
|
placeholder: string;
|
|
46
48
|
modelValue: string | number;
|
|
47
49
|
allowClear: boolean;
|
|
48
50
|
showCount: boolean;
|
|
49
51
|
maxLength: number;
|
|
50
52
|
autofocus: boolean;
|
|
51
|
-
autocomplete: string;
|
|
52
53
|
rows: number;
|
|
53
54
|
bordered: boolean;
|
|
54
|
-
spellcheck: boolean;
|
|
55
55
|
customStyle: Record<string, string | number>;
|
|
56
56
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
57
57
|
textareaRef: HTMLTextAreaElement;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
import { ActivePanelData } from '../../../domain/active/active-types';
|
|
2
|
+
import { AttachFieldTarget } from '../../../domain/field/attach-field';
|
|
3
|
+
export type PanelBreadcrumbItem = {
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
7
|
+
export type PanelTitle = string | PanelBreadcrumbItem[];
|
|
8
|
+
export type PanelTitleContext = {
|
|
9
|
+
active: ActivePanelData | null;
|
|
10
|
+
attachFieldTarget: AttachFieldTarget | null;
|
|
11
|
+
};
|
|
1
12
|
export interface PanelSchema {
|
|
2
13
|
/** schema 唯一 key */
|
|
3
14
|
key: PanelSchemaKey;
|
|
4
15
|
/** 面板标题 */
|
|
5
|
-
title:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}>;
|
|
16
|
+
title: PanelTitle;
|
|
17
|
+
/** 按当前上下文解析标题(如引用字段面包屑) */
|
|
18
|
+
resolveTitle?: (ctx: PanelTitleContext) => PanelTitle;
|
|
9
19
|
/** 实际渲染组件 */
|
|
10
20
|
render: any;
|
|
11
21
|
}
|
|
@@ -3,6 +3,7 @@ import { Doc } from '../../view/Doc';
|
|
|
3
3
|
import { Wr, Wp, Wtbl, Wtr, Wtc } from '../../model/document';
|
|
4
4
|
import { RawElement } from '../../model/types/raw';
|
|
5
5
|
import { CursorManager } from '../../cursor/CursorManager';
|
|
6
|
+
import { LayoutNode } from '../../view/base/LayoutNode';
|
|
6
7
|
export declare const SelectionMode: {
|
|
7
8
|
readonly PP: "PP";
|
|
8
9
|
readonly PTr: "PTr";
|
|
@@ -209,5 +210,7 @@ export declare abstract class CommandBase<T extends CommandType = CommandType> i
|
|
|
209
210
|
modelIndex: number;
|
|
210
211
|
modelParent: Wp;
|
|
211
212
|
} | undefined;
|
|
213
|
+
/** 设计态删除字段组件后,清理 DataManager 中该字段的 defaults / rawData / 依赖 */
|
|
214
|
+
protected cleanupDesignFieldBinding(run?: LayoutNode): void;
|
|
212
215
|
}
|
|
213
216
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommandBase, PostCommandContext } from '../base/CommandBase';
|
|
2
|
+
import { Doc } from '../../view/Doc';
|
|
3
|
+
import { CommandPayloadMap } from '../types';
|
|
4
|
+
export declare class SetMaterialConsumeTable extends CommandBase<'setMaterialConsumeTable'> {
|
|
5
|
+
constructor(doc: Doc, payload?: CommandPayloadMap['setMaterialConsumeTable']);
|
|
6
|
+
protected execute(): Promise<PostCommandContext>;
|
|
7
|
+
}
|
|
@@ -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 {
|
|
6
|
+
import { SubTableRegionType } from '../model/document/wtcRegionRef';
|
|
7
7
|
export interface CursorMeta {
|
|
8
8
|
nodeId: string;
|
|
9
9
|
offset: number;
|
|
@@ -53,6 +53,7 @@ export declare const CommandType: {
|
|
|
53
53
|
readonly deleteTableHeader: "deleteTableHeader";
|
|
54
54
|
readonly setRepeating: "setRepeating";
|
|
55
55
|
readonly set2DTable: "set2DTable";
|
|
56
|
+
readonly setMaterialConsumeTable: "setMaterialConsumeTable";
|
|
56
57
|
readonly setBounded: "setBounded";
|
|
57
58
|
readonly setBoundedItem: "setBoundedItem";
|
|
58
59
|
readonly setCheckTable: "setCheckTable";
|
|
@@ -160,6 +161,10 @@ export type CommandPayloadMap = {
|
|
|
160
161
|
name: string;
|
|
161
162
|
valuePath: string;
|
|
162
163
|
};
|
|
164
|
+
setMaterialConsumeTable: CommandPayload & {
|
|
165
|
+
name: string;
|
|
166
|
+
valuePath: string;
|
|
167
|
+
};
|
|
163
168
|
setBounded: CommandPayload & {
|
|
164
169
|
name: string;
|
|
165
170
|
valuePath: string;
|
|
@@ -179,7 +184,7 @@ export type CommandPayloadMap = {
|
|
|
179
184
|
deleteSubTable: CommandPayload & {
|
|
180
185
|
tableId: string;
|
|
181
186
|
regionId: string;
|
|
182
|
-
regionType:
|
|
187
|
+
regionType: SubTableRegionType;
|
|
183
188
|
};
|
|
184
189
|
deleteBoundedItem: CommandPayload & {
|
|
185
190
|
tableId: string;
|
|
@@ -9,10 +9,10 @@ type __VLS_Props = {
|
|
|
9
9
|
visible?: boolean;
|
|
10
10
|
};
|
|
11
11
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
-
visible: boolean;
|
|
13
|
-
caretColor: string;
|
|
14
12
|
caretWidth: number;
|
|
13
|
+
caretColor: string;
|
|
15
14
|
blinkInterval: number;
|
|
16
15
|
alwaysVisibleAfterEventMs: number;
|
|
16
|
+
visible: boolean;
|
|
17
17
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
18
|
export default _default;
|
|
@@ -65,6 +65,7 @@ export declare class DataManager {
|
|
|
65
65
|
private scheduleLayout;
|
|
66
66
|
getLabelPath(path: JsonPath): JsonPath;
|
|
67
67
|
getHrefPath(path: JsonPath): JsonPath;
|
|
68
|
+
getFieldRuntimeSpecificConfigKeys(): string[];
|
|
68
69
|
getFieldRuntimeSpecificConfig(path: JsonPath): FieldRuntimeSpecificConfig | undefined;
|
|
69
70
|
setFieldRuntimeSpecificConfig(path: JsonPath, partial: FieldRuntimeSpecificConfig): void;
|
|
70
71
|
/** 子表插行后:index 及之后的行配置下标 +1 */
|
|
@@ -290,6 +291,18 @@ export declare class DataManager {
|
|
|
290
291
|
* 获取父路径
|
|
291
292
|
*/
|
|
292
293
|
private getParentPath;
|
|
294
|
+
/**
|
|
295
|
+
* 设计态删除字段后,清理该字段在 DataManager 中的绑定数据
|
|
296
|
+
* @param designValuePath 设计时 valuePath(可含 [n] / [n_y][n_x] 通配符)
|
|
297
|
+
* @param runtimeValuePath 版面解析后的具体路径(可选)
|
|
298
|
+
*/
|
|
299
|
+
removeFieldBindingData(designValuePath: JsonPath, runtimeValuePath?: JsonPath): void;
|
|
300
|
+
/** 收集与字段绑定相关的路径(含 value / label / href 及通配符变体) */
|
|
301
|
+
private collectFieldBindingPaths;
|
|
302
|
+
/** 收集可从 rawData 删除的具体路径(跳过含通配符的设计路径) */
|
|
303
|
+
private collectConcreteRawDataPaths;
|
|
304
|
+
/** 移除字段注册的组件依赖 */
|
|
305
|
+
private removeFieldDependencies;
|
|
293
306
|
/**
|
|
294
307
|
* 设置默认值
|
|
295
308
|
* @param path jsonpath 路径 (支持 [n] 数组索引和 [n] 通配符)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActivePanelData } from '../../domain/active/active-types';
|
|
2
|
+
import { AttachFieldTarget } from '../../domain/field/attach-field';
|
|
2
3
|
export type ITableSelection = {
|
|
3
4
|
tableId: string;
|
|
4
5
|
axis: 'row' | 'col' | 'all';
|
|
@@ -20,6 +21,8 @@ export type InteractionState = {
|
|
|
20
21
|
focusTick: number | undefined;
|
|
21
22
|
/** 当前点击的组件 右侧面板 */
|
|
22
23
|
panelData: ActivePanelData | null;
|
|
24
|
+
/** 引用字段配置定位(与 panel:attach-field 配合) */
|
|
25
|
+
attachFieldTarget: AttachFieldTarget | null;
|
|
23
26
|
/** 字段校验批注信息集合 */
|
|
24
27
|
validationCommentMap: Record<string, Array<{
|
|
25
28
|
field: string;
|
|
@@ -18,11 +18,27 @@ export declare function useInteraction(docRef: Ref<Doc | null>): {
|
|
|
18
18
|
readonly context: {
|
|
19
19
|
readonly mainModelKey?: string | undefined;
|
|
20
20
|
readonly subFieldKey?: string | undefined;
|
|
21
|
+
readonly parentModelId?: string | undefined;
|
|
21
22
|
readonly isDataGroup2DClicked?: boolean | undefined;
|
|
22
23
|
readonly regionId?: string | undefined;
|
|
23
24
|
readonly secRefId?: string | undefined;
|
|
24
25
|
};
|
|
25
26
|
} | null | undefined;
|
|
27
|
+
readonly attachFieldTarget?: {
|
|
28
|
+
readonly kind: "boolean";
|
|
29
|
+
readonly itemsKey: "trueAttachFields" | "falseAttachFields";
|
|
30
|
+
readonly parentModelId: string;
|
|
31
|
+
readonly itemId: string;
|
|
32
|
+
readonly attachFieldLabel: string;
|
|
33
|
+
readonly subFieldKey?: string | undefined;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: "enum-option";
|
|
36
|
+
readonly optionId: string;
|
|
37
|
+
readonly parentModelId: string;
|
|
38
|
+
readonly itemId: string;
|
|
39
|
+
readonly attachFieldLabel: string;
|
|
40
|
+
readonly subFieldKey?: string | undefined;
|
|
41
|
+
} | null | undefined;
|
|
26
42
|
readonly validationCommentMap?: {
|
|
27
43
|
readonly [x: string]: readonly {
|
|
28
44
|
readonly field: string;
|
|
@@ -16,10 +16,14 @@ export declare class LayoutMapper {
|
|
|
16
16
|
/** 组件信息中心 */
|
|
17
17
|
widgetMetaMap: Map<string, any>;
|
|
18
18
|
modelMap: Map<string, ModelMode>;
|
|
19
|
+
/** 布局期生成的 model 节点(如布尔/枚举引用字段),不在 doc.model 树中 */
|
|
20
|
+
runtimeModelMap: Map<string, ModelMode>;
|
|
19
21
|
modelSplitMap: Map<string, string[]>;
|
|
20
22
|
/** 扁平处理 layout 数据 */
|
|
21
23
|
buildLayoutIndex(): void;
|
|
22
24
|
buildModelMap(): void;
|
|
25
|
+
/** 注册布局期生成的 model 节点,供 getModelNodeById 查找 */
|
|
26
|
+
registerRuntimeModelNode(node: ModelMode): void;
|
|
23
27
|
getBaseMetaNodeById<T extends BaseMetaNode>(id?: string): T | undefined;
|
|
24
28
|
getBaseMetaNodeByIds<T extends BaseMetaNode>(ids: string[]): T[] | undefined;
|
|
25
29
|
getLayoutNodeById(id: string): Page | import('../view/base').BandContainer | import('..').Paragraph | import('..').Table | import('../view/TableCell').TableCell | import('../view/TableRow').TableRow | import('..').OverlayLayout | import('../view/base').OverlayContainer | import('..').TextRun | import('..').ImageRun | undefined;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Doc } from '../..';
|
|
2
|
+
import { BaseMetaNode } from '../types';
|
|
3
|
+
import { WidgetMeta } from '../../widget/widget-meta';
|
|
4
|
+
import { MultipleItem } from '../../../suites/shared/panel/config/editor/attach-fields-editor/types';
|
|
5
|
+
import { AttachFieldTarget } from '../../../domain/field/attach-field';
|
|
6
|
+
import { AttachFieldParentMeta, WidgetOptionLike } from './types';
|
|
7
|
+
export type AttachFieldCursorPin = {
|
|
8
|
+
nodeId: string;
|
|
9
|
+
side: 'before' | 'after';
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 引用字段(attach field)运行时上下文。
|
|
13
|
+
*/
|
|
14
|
+
export declare class AttachFieldContext {
|
|
15
|
+
/** `widgetMeta.extra.biz` 上标识「此为引用字段」的键 */
|
|
16
|
+
static readonly BIZ_FLAG: "isAttachField";
|
|
17
|
+
/**
|
|
18
|
+
* 为布局生成的 widgetMeta.extra 打上引用字段标记。
|
|
19
|
+
*/
|
|
20
|
+
static markAttachFieldMeta(extra?: WidgetMeta['extra']): WidgetMeta['extra'];
|
|
21
|
+
/** 当前 widget 是否为引用字段(非画布拖入的独立字段组件) */
|
|
22
|
+
static isAttachFieldWidget(widgetMeta: WidgetMeta | undefined | null): boolean;
|
|
23
|
+
/** 读取布局阶段写入的「父选项」绑定信息,非引用字段返回 null */
|
|
24
|
+
static getParentMeta(widgetMeta: WidgetMeta | undefined | null): AttachFieldParentMeta | null;
|
|
25
|
+
/** 由父字段 props 与选项值解析列表定位,供面板与画布点击共用 */
|
|
26
|
+
private static resolveListContext;
|
|
27
|
+
/** 根据引用字段 widgetMeta.id 解析画布上的 modelRef.id */
|
|
28
|
+
static resolveAttachFieldModelId(doc: Doc, itemId: string): string | null;
|
|
29
|
+
/** 画布点击引用字段时,生成与 panel 列表点击一致的 `attachFieldTarget` */
|
|
30
|
+
static resolveAttachFieldTarget(doc: Doc, widgetMeta: WidgetMeta): AttachFieldTarget | null;
|
|
31
|
+
private static isFieldMarkerRun;
|
|
32
|
+
/** 引用字段 model 分组内的正文字符 run(排除 [ ] 与间距占位) */
|
|
33
|
+
private static getAttachFieldContentNodes;
|
|
34
|
+
/** 取节点内最后一个字符索引(单字节点为 0) */
|
|
35
|
+
private static getNodeLastCharOffset;
|
|
36
|
+
/**
|
|
37
|
+
* 点击引用字段【/】时,落到内侧首尾字符:
|
|
38
|
+
* 【 → 首字 before;】 → 末字 after
|
|
39
|
+
*/
|
|
40
|
+
static resolveAttachFieldMarkerContentPin(doc: Doc, modelId: string, marker: 'left' | 'right'): (AttachFieldCursorPin & {
|
|
41
|
+
offset: number;
|
|
42
|
+
}) | null;
|
|
43
|
+
static getModelSplitNodes(doc: Doc, modelId: string): BaseMetaNode[];
|
|
44
|
+
/**
|
|
45
|
+
* 从父组件 props 解析某一选项下的引用字段列表。
|
|
46
|
+
* - 布尔:`trueAttachFields` / `falseAttachFields`
|
|
47
|
+
* - 枚举:选项对象上的 `attachFields`(通常来自 computedOptions)
|
|
48
|
+
*/
|
|
49
|
+
static getOptionAttachFields(widgetProps: Record<string, any> | undefined, option: WidgetOptionLike): MultipleItem[];
|
|
50
|
+
/**
|
|
51
|
+
* 父字段当前值是否包含本引用字段绑定的选项值。
|
|
52
|
+
* 用于条件校验、overlay 禁用等:未选中对应选项时不应要求填写引用字段。
|
|
53
|
+
*/
|
|
54
|
+
private static isParentOptionActive;
|
|
55
|
+
/** 引用字段当前是否处于可填报 / 可校验状态。无父绑定信息时视为普通字段,恒为 true。 */
|
|
56
|
+
static isActive(doc: Doc, widgetMeta: WidgetMeta | undefined | null): boolean;
|
|
57
|
+
/** 枚举 / 布尔选项值相等比较(布尔走 toBoolean,其余按字符串) */
|
|
58
|
+
private static isSameOptionValue;
|
|
59
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MultipleItem } from '../../../suites/shared/panel/config/editor/attach-fields-editor/types';
|
|
2
|
+
/** 布局时写入引用字段 widgetMeta 的父选项绑定(见 AttachFieldHandler) */
|
|
3
|
+
export type AttachFieldParentMeta = {
|
|
4
|
+
/** 父字段 layout modelRef.id,设计态 hover 委托用 */
|
|
5
|
+
parentModelRefId: string;
|
|
6
|
+
/** 父字段运行时 valuePath,用于读取当前选中值 */
|
|
7
|
+
parentRuntimeValuePath: string;
|
|
8
|
+
/** 本引用字段绑定的选项值(true/false 或枚举项 value) */
|
|
9
|
+
parentOptionValue: unknown;
|
|
10
|
+
/** 父字段是否为多选枚举(fw:enum-multiple) */
|
|
11
|
+
isMultiple: boolean;
|
|
12
|
+
/** 父字段子表 subFieldKey,设计态面板 extra 用 */
|
|
13
|
+
parentSubFieldKey?: string;
|
|
14
|
+
};
|
|
15
|
+
/** 布局解析 computedOptions 时的选项结构(含 attachFields) */
|
|
16
|
+
export type WidgetOptionLike = {
|
|
17
|
+
value: unknown;
|
|
18
|
+
label: string;
|
|
19
|
+
attachFields?: MultipleItem[];
|
|
20
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FieldBaseHandler } from './FieldBaseHandler';
|
|
2
|
+
import { TextRun } from '../../../view/runs/TextRun';
|
|
3
|
+
import { HandlerContext } from '../../types';
|
|
4
|
+
import { WidgetOptionLike } from '../../attach-field/types';
|
|
5
|
+
/** 布尔 / 枚举选项后的引用字段布局 */
|
|
6
|
+
export declare class AttachFieldHandler extends FieldBaseHandler {
|
|
7
|
+
static layoutOptionAttachFields(ctx: HandlerContext, option: WidgetOptionLike, layoutStyle: ReturnType<typeof TextRun.textStyle2LayoutStyle>): void;
|
|
8
|
+
private static buildWidgetMeta;
|
|
9
|
+
private static layoutItem;
|
|
10
|
+
}
|
|
@@ -3,9 +3,11 @@ import { WrText } from '../../../model/document';
|
|
|
3
3
|
import { LayoutContext } from '../../LayoutContext';
|
|
4
4
|
import { TextRun } from '../../../view/runs/TextRun';
|
|
5
5
|
import { HandlerContext } from '../../types';
|
|
6
|
+
import { MultipleItem } from '../../../../suites/shared/panel/config/editor/attach-fields-editor/types';
|
|
6
7
|
type WidgetOption = {
|
|
7
8
|
value: any;
|
|
8
9
|
label: string;
|
|
10
|
+
attachFields?: MultipleItem[];
|
|
9
11
|
};
|
|
10
12
|
export declare class OptionHandler extends FieldBaseHandler {
|
|
11
13
|
static layout(ctx: HandlerContext): void;
|
|
@@ -4,3 +4,4 @@ export { SignatureHandler } from './SignatureHandler';
|
|
|
4
4
|
export { InputHandler } from './InputHandler';
|
|
5
5
|
export { AttachmentHandler } from './AttachmentHandler';
|
|
6
6
|
export { FieldBaseHandler } from './FieldBaseHandler';
|
|
7
|
+
export { AttachFieldHandler } from './AttachFieldHandler';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoundedRegionOptions, CheckTableRegionOptions, RepeatingRegionOptions, TableRegion, TableHeaderRegionOptions, SubTableHeaderRegionOptions, _2DTableRegionOptions, BoundedRegion, CheckTableRegion, RepeatingRegion, TableHeaderRegion, SubTableHeaderRegion, _2DTableRegion } from '../../logic';
|
|
1
|
+
import { BoundedRegionOptions, CheckTableRegionOptions, RepeatingRegionOptions, TableRegion, TableHeaderRegionOptions, SubTableHeaderRegionOptions, _2DTableRegionOptions, MaterialConsumeTableRegionOptions, MaterialConsumeTableRegion, BoundedRegion, CheckTableRegion, RepeatingRegion, TableHeaderRegion, SubTableHeaderRegion, _2DTableRegion } from '../../logic';
|
|
2
2
|
import { Wtbl } from '../Wtbl';
|
|
3
3
|
/** 矩形区域边界(行/列起止索引) */
|
|
4
4
|
type RegionBounds = Pick<TableRegion, 'start' | 'end'>;
|
|
@@ -33,6 +33,10 @@ export declare class WtblRegionManager {
|
|
|
33
33
|
* 设置二维表区域
|
|
34
34
|
*/
|
|
35
35
|
static set2DTable(table: Wtbl, options: Omit<_2DTableRegionOptions, 'table'>): _2DTableRegion;
|
|
36
|
+
/**
|
|
37
|
+
* 设置物料消耗表
|
|
38
|
+
*/
|
|
39
|
+
static setMaterialConsumeTable(table: Wtbl, options: Omit<MaterialConsumeTableRegionOptions, 'table'>): MaterialConsumeTableRegion;
|
|
36
40
|
/**
|
|
37
41
|
* 设置有界区域(子表体)
|
|
38
42
|
*/
|
|
@@ -3,7 +3,7 @@ import { Wbody } from './Wbody';
|
|
|
3
3
|
import { Wtr } from './Wtr';
|
|
4
4
|
import { Wtc } from './Wtc';
|
|
5
5
|
import { ModelGroup, ModelGroupOptions } from '../base';
|
|
6
|
-
import { TableRegion, BoundedRegionOptions, CheckTableRegionOptions, RepeatingRegionOptions, _2DTableRegionOptions, TableHeaderRegion, SubTableHeaderRegion, TableHeaderRegionOptions, SubTableHeaderRegionOptions, CheckTableRegion, BoundedRegion, RepeatingRegion, _2DTableRegion } from '../logic';
|
|
6
|
+
import { TableRegion, BoundedRegionOptions, CheckTableRegionOptions, RepeatingRegionOptions, _2DTableRegionOptions, TableHeaderRegion, SubTableHeaderRegion, TableHeaderRegionOptions, SubTableHeaderRegionOptions, CheckTableRegion, MaterialConsumeTableRegion, MaterialConsumeTableRegionOptions, BoundedRegion, RepeatingRegion, _2DTableRegion } from '../logic';
|
|
7
7
|
import { WtblPr } from './WtblPr';
|
|
8
8
|
export declare class Wtbl extends ModelGroup {
|
|
9
9
|
name: 'w:tbl';
|
|
@@ -27,6 +27,9 @@ export declare class Wtbl extends ModelGroup {
|
|
|
27
27
|
get _2DTable(): _2DTableRegion[];
|
|
28
28
|
get2DTableById(id: string): _2DTableRegion | undefined;
|
|
29
29
|
get has2DTable(): boolean;
|
|
30
|
+
get materialConsumeTable(): MaterialConsumeTableRegion[];
|
|
31
|
+
getMaterialConsumeTableById(id: string): MaterialConsumeTableRegion | undefined;
|
|
32
|
+
get hasMaterialConsumeTable(): boolean;
|
|
30
33
|
get bounded(): BoundedRegion[];
|
|
31
34
|
getBoundedById(id: string): BoundedRegion | undefined;
|
|
32
35
|
get hasBounded(): boolean;
|
|
@@ -59,6 +62,7 @@ export declare class Wtbl extends ModelGroup {
|
|
|
59
62
|
splitAt(index: number): [Wtbl | null, Wtbl | null];
|
|
60
63
|
setRepeating(options: Omit<RepeatingRegionOptions, 'table'>): RepeatingRegion;
|
|
61
64
|
set2DTable(options: Omit<_2DTableRegionOptions, 'table'>): _2DTableRegion;
|
|
65
|
+
setMaterialConsumeTable(options: Omit<MaterialConsumeTableRegionOptions, 'table'>): MaterialConsumeTableRegion;
|
|
62
66
|
setBounded(options: Omit<BoundedRegionOptions, 'table'>): BoundedRegion;
|
|
63
67
|
setCheckTable(options: Omit<CheckTableRegionOptions, 'table'>): CheckTableRegion;
|
|
64
68
|
setTableHeader(options: Omit<TableHeaderRegionOptions, 'table'>): TableHeaderRegion;
|
|
@@ -3,7 +3,7 @@ import { Wtr } from './Wtr';
|
|
|
3
3
|
import { Wp } from './Wp';
|
|
4
4
|
import { ModelGroup, ModelGroupOptions } from '../base';
|
|
5
5
|
import { Wtbl } from './Wtbl';
|
|
6
|
-
import {
|
|
6
|
+
import { SubTableRegionType, SubTableItemType, TableHeaderRegionType, WtcHeaderRef, WtcSubTableItemRef, WtcSubTableRef } from './wtcRegionRef';
|
|
7
7
|
/** 单元格上需随行列复制同步的引用字段 */
|
|
8
8
|
export declare const WTC_REF_KEYS: readonly ["mergeId", "subTable", "subTableItem", "header"];
|
|
9
9
|
/**
|
|
@@ -78,11 +78,11 @@ export declare class Wtc extends ModelGroup {
|
|
|
78
78
|
*/
|
|
79
79
|
isRoot: boolean;
|
|
80
80
|
};
|
|
81
|
-
setSubTable(type:
|
|
81
|
+
setSubTable(type: SubTableRegionType, regionId: string): void;
|
|
82
82
|
clearSubTable(): void;
|
|
83
83
|
setSubTableItem(type: SubTableItemType, regionId: string): void;
|
|
84
84
|
clearSubTableItem(): void;
|
|
85
|
-
setHeaderRef(type:
|
|
85
|
+
setHeaderRef(type: TableHeaderRegionType, regionId: string): void;
|
|
86
86
|
clearHeaderRef(): void;
|
|
87
87
|
/** 按 regionId 清除单元格上的子表 / 表头引用 */
|
|
88
88
|
clearRegionRef(regionId: string): void;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/** 子表主体类型(repeating 在 layout 层映射为 dynamic-table) */
|
|
2
|
-
export type
|
|
2
|
+
export type SubTableRegionType = 'repeating' | 'bounded' | '2d-table' | 'check-table' | 'material-consume-table';
|
|
3
|
+
export type TableHeaderRegionType = 'table-header' | 'sub-table-header';
|
|
4
|
+
export type TableRegionType = SubTableRegionType | TableHeaderRegionType;
|
|
5
|
+
export declare const SUB_TABLE_REGION_TYPES: string[];
|
|
6
|
+
export type SubTableLayoutType = 'dynamic-table' | 'fixed-table' | '2d-table' | 'check-table' | 'material-consume-table';
|
|
7
|
+
export type TableHeaderLayoutType = 'table-header';
|
|
8
|
+
export type TableLayoutType = SubTableLayoutType | TableHeaderLayoutType;
|
|
3
9
|
/** 子表内数据分组 / 数据关联 */
|
|
4
10
|
export type SubTableItemType = 'bounded-item' | 'data-group-2d';
|
|
5
|
-
export type TableHeaderRefType = 'table-header' | 'sub-table-header';
|
|
6
11
|
export type WtcSubTableRef = {
|
|
7
|
-
type:
|
|
12
|
+
type: SubTableRegionType;
|
|
8
13
|
regionId: string;
|
|
9
14
|
};
|
|
10
15
|
export type WtcSubTableItemRef = {
|
|
@@ -12,9 +17,8 @@ export type WtcSubTableItemRef = {
|
|
|
12
17
|
regionId: string;
|
|
13
18
|
};
|
|
14
19
|
export type WtcHeaderRef = {
|
|
15
|
-
type:
|
|
20
|
+
type: TableHeaderRegionType;
|
|
16
21
|
regionId: string;
|
|
17
22
|
};
|
|
18
|
-
export
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function headerTypeToLayoutType(type: TableHeaderRefType): 'table-header';
|
|
23
|
+
export declare function tableRegionTypeToLayoutType(type: SubTableRegionType): SubTableLayoutType;
|
|
24
|
+
export declare function headerRegionTypeToLayoutType(type: TableHeaderRegionType): TableHeaderLayoutType;
|
|
@@ -6,6 +6,8 @@ export type { TableHeaderRegionOptions } from './header/TableHeaderRegion';
|
|
|
6
6
|
export type { SubTableHeaderRegionOptions } from './header/SubTableHeaderRegion';
|
|
7
7
|
export { RepeatingRegion } from './subtable/repeating/RepeatingRegion';
|
|
8
8
|
export type { RepeatingRegionOptions, RepeatingWidgetMeta } from './subtable/repeating/RepeatingRegion';
|
|
9
|
+
export { MaterialConsumeTableRegion } from './subtable/repeating/MaterialConsumeTableRegion';
|
|
10
|
+
export type { MaterialConsumeTableRegionOptions, MaterialConsumeTableWidgetMeta } from './subtable/repeating/MaterialConsumeTableRegion';
|
|
9
11
|
export { BoundedRegion } from './subtable/bounded/BoundedRegion';
|
|
10
12
|
export { BoundedItemRegion } from './subtable/bounded/BoundedItemRegion';
|
|
11
13
|
export type { BoundedRegionOptions, BoundedWidgetMeta } from './subtable/bounded/BoundedRegion';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Wtbl } from '../../../document';
|
|
2
|
+
import { Region, RegionOptions } from '../../base/Region';
|
|
3
|
+
import { RegionJson } from '../../../types';
|
|
4
|
+
export type MaterialConsumeTableWidgetPropsMeta = {
|
|
5
|
+
table_key_: string;
|
|
6
|
+
barcode_parsing_rules_id_?: string;
|
|
7
|
+
personal_bom_enabled_?: boolean;
|
|
8
|
+
entries_?: any[];
|
|
9
|
+
sequence_loading_enabled_?: boolean;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export type MaterialConsumeTableWidgetMeta = {
|
|
13
|
+
props: MaterialConsumeTableWidgetPropsMeta;
|
|
14
|
+
};
|
|
15
|
+
export type MaterialConsumeTableRegionOptions = RegionOptions & {
|
|
16
|
+
name: string;
|
|
17
|
+
valuePath: string;
|
|
18
|
+
widgetMeta: MaterialConsumeTableWidgetMeta;
|
|
19
|
+
};
|
|
20
|
+
export type MaterialConsumeTableRegionJson = RegionJson & {
|
|
21
|
+
name: string;
|
|
22
|
+
valuePath: string;
|
|
23
|
+
widgetMeta: MaterialConsumeTableWidgetMeta;
|
|
24
|
+
};
|
|
25
|
+
export declare class MaterialConsumeTableRegion extends Region {
|
|
26
|
+
type: "material-consume-table";
|
|
27
|
+
name: string;
|
|
28
|
+
valuePath: string;
|
|
29
|
+
widgetMeta: MaterialConsumeTableWidgetMeta;
|
|
30
|
+
constructor(options: MaterialConsumeTableRegionOptions);
|
|
31
|
+
get subFieldKey(): string;
|
|
32
|
+
get linkFieldKey(): string;
|
|
33
|
+
get subValuePath(): string;
|
|
34
|
+
get linkValuePath(): string;
|
|
35
|
+
toJSON(): MaterialConsumeTableRegionJson;
|
|
36
|
+
static fromJSON(json: MaterialConsumeTableRegionJson, table: Wtbl): MaterialConsumeTableRegion;
|
|
37
|
+
}
|
|
@@ -4,7 +4,8 @@ import { CheckTableRegion } from './subtable/link/CheckTableRegion';
|
|
|
4
4
|
import { TableHeaderRegion } from './header/TableHeaderRegion';
|
|
5
5
|
import { SubTableHeaderRegion } from './header/SubTableHeaderRegion';
|
|
6
6
|
import { _2DTableRegion } from './subtable/link/_2DTableRegion';
|
|
7
|
-
|
|
8
|
-
export type TableRegion = RepeatingRegion | _2DTableRegion | BoundedRegion | CheckTableRegion | TableHeaderRegion | SubTableHeaderRegion;
|
|
7
|
+
import { MaterialConsumeTableRegion } from './subtable/repeating/MaterialConsumeTableRegion';
|
|
9
8
|
/** 可作为子表体的区域类型 */
|
|
10
|
-
export type SubTableRegion = RepeatingRegion | BoundedRegion;
|
|
9
|
+
export type SubTableRegion = RepeatingRegion | BoundedRegion | CheckTableRegion | _2DTableRegion | MaterialConsumeTableRegion;
|
|
10
|
+
/** 表格上可注册的全部逻辑区域 */
|
|
11
|
+
export type TableRegion = SubTableRegion | TableHeaderRegion | SubTableHeaderRegion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataManager } from '../data/DataManager';
|
|
2
2
|
import { Wtr, Wtbl, Wtc } from '../model/document';
|
|
3
|
-
import { RepeatingRegion, BoundedRegion, TableHeaderRegion, SubTableHeaderRegion, CheckTableRegion, _2DTableRegion } from '../model/logic';
|
|
3
|
+
import { RepeatingRegion, BoundedRegion, TableHeaderRegion, SubTableHeaderRegion, CheckTableRegion, _2DTableRegion, MaterialConsumeTableRegion, SubTableRegion } from '../model/logic';
|
|
4
4
|
import { LinkSubTableCellZone } from '../layout/linkSubTableLayout';
|
|
5
5
|
import { Doc } from '../view/Doc';
|
|
6
6
|
/** 表格矩形范围(含起止行列,均为闭区间) */
|
|
@@ -27,6 +27,7 @@ export type CellFragment = {
|
|
|
27
27
|
yDataIndex?: number;
|
|
28
28
|
repeatingId?: string;
|
|
29
29
|
_2DTableId?: string;
|
|
30
|
+
materialConsumeTableId?: string;
|
|
30
31
|
boundedId?: string;
|
|
31
32
|
checkTableId?: string;
|
|
32
33
|
mergeFromId?: string;
|
|
@@ -46,7 +47,6 @@ type IndexMap = Map<string, {
|
|
|
46
47
|
refPos?: string;
|
|
47
48
|
refCellId?: string;
|
|
48
49
|
}>;
|
|
49
|
-
type SubTableRegion = RepeatingRegion | BoundedRegion | CheckTableRegion | _2DTableRegion;
|
|
50
50
|
export declare class TableExpander {
|
|
51
51
|
table: Wtbl;
|
|
52
52
|
doc: Doc;
|
|
@@ -58,6 +58,7 @@ export declare class TableExpander {
|
|
|
58
58
|
/** 模板行索引 → 各类逻辑区域(用于按行分发展开策略) */
|
|
59
59
|
rowIndexRepeatingMapper: Map<number, RepeatingRegion>;
|
|
60
60
|
rowIndex2DTableMapper: Map<number, _2DTableRegion>;
|
|
61
|
+
rowIndexMaterialConsumeTableMapper: Map<number, MaterialConsumeTableRegion>;
|
|
61
62
|
rowIndexBoundedMapper: Map<number, BoundedRegion>;
|
|
62
63
|
rowIndexCheckTableMapper: Map<number, CheckTableRegion>;
|
|
63
64
|
rowIndexTableHeaderMapper: Map<number, TableHeaderRegion | SubTableHeaderRegion>;
|
|
@@ -92,9 +93,10 @@ export declare class TableExpander {
|
|
|
92
93
|
private mergeIndexMap;
|
|
93
94
|
private initializeRows;
|
|
94
95
|
/** 编辑模式只展开一份;预览/填报模式按数据路径长度重复 */
|
|
95
|
-
getRepeatCount(region: RepeatingRegion | _2DTableRegion): number;
|
|
96
|
+
getRepeatCount(region: RepeatingRegion | _2DTableRegion | MaterialConsumeTableRegion): number;
|
|
96
97
|
private initializeRepeatingRowsInRange;
|
|
97
98
|
private initialize2DTableRowsInRange;
|
|
99
|
+
private initializeMaterialConsumeTableRowsInRange;
|
|
98
100
|
/**
|
|
99
101
|
* 循环子表与二维子表共用的纵向展开逻辑:
|
|
100
102
|
* 按数据条数复制行块,区域外最后一行单元格需合并 rowspan 以覆盖重复产生的额外行。
|
|
@@ -3,8 +3,9 @@ import { LayoutGroup, LayoutGroupOptions } from './base';
|
|
|
3
3
|
import { IContainerMetrics, Border } from './types';
|
|
4
4
|
import { Table } from './Table';
|
|
5
5
|
import { TableRow } from './TableRow';
|
|
6
|
-
import { RepeatingWidgetMeta, BoundedWidgetMeta, CheckTableWidgetMeta, _2DTableWidgetMeta } from '../model/logic';
|
|
6
|
+
import { RepeatingWidgetMeta, BoundedWidgetMeta, CheckTableWidgetMeta, _2DTableWidgetMeta, MaterialConsumeTableWidgetMeta } from '../model/logic';
|
|
7
7
|
import { LinkSubTableCellZone } from '../layout/linkSubTableLayout';
|
|
8
|
+
import { TableLayoutType } from '../model/document/wtcRegionRef';
|
|
8
9
|
export interface TableCellOptions extends LayoutGroupOptions {
|
|
9
10
|
colspan?: number;
|
|
10
11
|
rowspan?: number;
|
|
@@ -16,10 +17,11 @@ export interface TableCellOptions extends LayoutGroupOptions {
|
|
|
16
17
|
}
|
|
17
18
|
export type SubRenderer = {
|
|
18
19
|
id: string;
|
|
19
|
-
type:
|
|
20
|
+
type: TableLayoutType;
|
|
21
|
+
tableName?: string;
|
|
20
22
|
dataIndex?: number;
|
|
21
23
|
valuePath: string;
|
|
22
|
-
widgetMeta?: RepeatingWidgetMeta | BoundedWidgetMeta | CheckTableWidgetMeta | _2DTableWidgetMeta;
|
|
24
|
+
widgetMeta?: RepeatingWidgetMeta | BoundedWidgetMeta | CheckTableWidgetMeta | _2DTableWidgetMeta | MaterialConsumeTableWidgetMeta;
|
|
23
25
|
xDataIndex?: number;
|
|
24
26
|
yDataIndex?: number;
|
|
25
27
|
/** 用来标记二维表的子类型 交叉 / 横向 / 纵向 */
|