@gct-paas/word 0.1.64 → 0.1.66

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.
@@ -74,6 +74,11 @@ export declare class DataManager {
74
74
  private shiftFieldRuntimeConfigAfterRowInsert;
75
75
  /** 子表删行后:移除该行配置,其后行配置下标 -1 */
76
76
  private shiftFieldRuntimeConfigAfterRowRemove;
77
+ private getSubFieldConfigMap;
78
+ /** 插行后同步 _subFieldConfig 下标 +1 */
79
+ private shiftSubFieldConfigAfterRowInsert;
80
+ /** 硬删后同步 _subFieldConfig:删该行并对其后行 -1 */
81
+ private shiftSubFieldConfigAfterRowRemove;
77
82
  private parseSubtableFieldPath;
78
83
  /** 收集 depGraph 中所有 DepNode(按 key 去重) */
79
84
  private collectDepNodes;
@@ -110,8 +115,6 @@ export declare class DataManager {
110
115
  * 检验表纵向轴配置只进 defaults,rawData 可能尚未物化多行。
111
116
  */
112
117
  countDefaultsIndexedRows(subFieldKey: string): number;
113
- /** 版面可见行下标 → rawData 数组实际下标 */
114
- resolveSubtableVisibleIndex(arrayPath: JsonPath, visibleIndex: number): number;
115
118
  private assignField;
116
119
  /**
117
120
  * 根据 jsonpath 设置数据
@@ -26,10 +26,11 @@ export type BusinessFieldChange = {
26
26
  export declare function parseSubtableFieldPath(path: string): SubtableFieldPath | null;
27
27
  /** 统一解析数据路径,区分主表 / 子表字段变更结构 */
28
28
  export declare function parseBusinessFieldChange(changedPath: string): BusinessFieldChange | null;
29
- /** 子表在 rawData 中的行数(含接口 { data: [] } 形态,未转数组时返回 0) */
29
+ /** 子表在 rawData 中的未软删行数(含接口 { data: [] } 形态,未转数组时返回 0) */
30
30
  export declare function countSubTableDataRows(rawData: Record<string, unknown>, subFieldKey: string): number;
31
31
  /** 子表应展开的行数:已有数据行与版面槽位取较大值(动态表无数据时至少 1 行) */
32
32
  export declare function resolveSubTableRowCount(doc: Doc | undefined, subFieldKey: string, rawData: Record<string, unknown>): number;
33
+ /** 返回应参与展开的存储下标;有数据时跳过 deleted_,指定 rowIndexes 时原样返回 */
33
34
  export declare function resolveSubTableRowIndexes(doc: Doc | undefined, subFieldKey: string, rawData: Record<string, unknown>, rowIndexes?: number[]): number[];
34
35
  export declare function mapTemplateToRowPaths(templatePath: string, rowIndexes: number[]): string[];
35
36
  interface ExpandSubTableWidgetPathsOptions {
@@ -1,4 +1,4 @@
1
- /** 子表行软删 / 可见下标与存储下标映射(与后端 deleted_ 约定一致) */
1
+ /** 子表行软删(与后端 deleted_ 约定一致;活跃行密排在前、软删行仅在后缀) */
2
2
  export type AxisType = 'x' | 'y';
3
3
  type PersistedSubtableRowContext = {
4
4
  rawData?: Record<string, any>;
@@ -6,14 +6,10 @@ type PersistedSubtableRowContext = {
6
6
  tableKey?: string;
7
7
  axis?: AxisType;
8
8
  };
9
- /** 是否应软删(打 deleted_)而非 splice */
9
+ /** 是否应软删(打 deleted_ 并移到后缀)而非物理删除 */
10
10
  export declare function isPersistedSubtableRow(row: Record<string, any> | undefined | null, ctx?: PersistedSubtableRowContext): boolean;
11
11
  /** 未软删的行数;空数组返回 0 */
12
12
  export declare function countActiveSubtableRows(rows: unknown): number;
13
- /** 版面可见行下标 → rawData 数组中的实际下标 */
14
- export declare function resolveSubtableStorageIndex(rows: any[], visibleIndex: number): number;
15
- /** 在可见下标处插入时对应的 splice 位置 */
16
- export declare function resolveSubtableInsertIndex(rows: any[], visibleIndex: number): number;
17
13
  /** 按字段列表拼接行分组/合并 key,空值视为 '' */
18
14
  export declare function buildRowGroupKey(row: Record<string, unknown>, fieldKeys: readonly string[], separator?: string): string;
19
15
  export {};
@@ -48,8 +48,6 @@ export declare class LayoutContext {
48
48
  */
49
49
  getParagraphRemainingSize(): number;
50
50
  addRun(run: LayoutNode): void;
51
- /** 子表可见行下标 → rawData 存储下标(跳过 deleted_ 行) */
52
- private mapSubtableVisibleIndex;
53
51
  /**
54
52
  * 根据 dataIndex 替换 path 中的 [n] 为实际值
55
53
  * @param path 包含 [n] 的路径,如 "$.items[n].name"
@@ -125,6 +125,8 @@ export interface IMaterialConsumeData {
125
125
  /** 后端需要的bom明细id */
126
126
  bom_entry_id_?: string;
127
127
  product_id__lb_?: string;
128
+ /** 扫码未回填 product_id_ 的兜底行标记(记录模式内部瞬态,行生命周期内持久,不向后端提交) */
129
+ _scanFallback?: boolean;
128
130
  }
129
131
  /**
130
132
  * 条码解析规则配置参数
@@ -7,7 +7,7 @@ export declare class RowRuntimeEngine {
7
7
  hasRowInit(ctx: TableRuntimeContext): boolean;
8
8
  /** 对单行执行行初始化 */
9
9
  applyRowInit(ctx: TableRuntimeContext, rowIndex: number, rowSource?: string): void;
10
- /** 初始化时对所有行执行行初始化 */
10
+ /** 初始化时对所有未软删行执行行初始化 */
11
11
  applyRowInitForAllRows(ctx: TableRuntimeContext): void;
12
12
  /** 字段变更时执行 when=onFieldChange 的行处理器(按 watch 过滤) */
13
13
  applyRowHandlersOnFieldChange(ctx: TableRuntimeContext, change: SubtableFieldPath, fieldChange?: FieldChangeDetail): void;
@@ -20,15 +20,25 @@ export declare class TableRuntimeContext {
20
20
  get refModelType(): string;
21
21
  /** 子表数组路径 $.subFieldKey */
22
22
  get arrayPath(): string;
23
- /** 指定行路径 $.subFieldKey[rowIndex] */
23
+ /** 指定行路径 $.subFieldKey[rowIndex];rowIndex 为存储下标 */
24
24
  rowPath(rowIndex: number): string;
25
- /** 读取指定行数据 */
25
+ /** 读取指定行数据;rowIndex 为存储下标 */
26
26
  getRow(rowIndex: number): Record<string, unknown> | undefined;
27
- /** 子表总行数,无数据默认返回 1 */
27
+ /**
28
+ * 子表存储行数(含软删),无数据默认返回 1
29
+ */
28
30
  getRowCount(): number;
29
- /** 构建单行规则执行上下文 */
31
+ /**
32
+ * 未软删行的存储下标。无数据时返回 [0](与版面默认空行一致);
33
+ * 仅剩软删行时返回 []。
34
+ */
35
+ getActiveRowIndexes(): number[];
36
+ /** 构建单行规则执行上下文;rowIndex 为存储下标 */
30
37
  buildRuleContext(rowIndex: number, changedFieldKey?: string): RuleContext;
31
- /** 遍历子表数据行,支持指定单行或全量遍历,逐行注入 RuleContext */
38
+ /**
39
+ * 遍历子表数据行,支持指定单行或全量遍历,逐行注入 RuleContext。
40
+ * rowIndex / 全量遍历均使用存储下标;全量时跳过 deleted_ 行。
41
+ */
32
42
  eachRow(options: EachRowOptions, iteratee: (ctx: RuleContext) => void): void;
33
43
  /** 在子表字段配置列表中查找指定字段配置(支持 match.fieldKey 为数组) */
34
44
  findFieldProfile(fieldKey: string): BusinessFieldProfile | undefined;