@gct-paas/word 0.2.40-beta.0 → 0.2.40-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.
@@ -39,12 +39,15 @@ export declare class BomEntryValidator {
39
39
  /** 物料和code的映射 */
40
40
  productCodes: Record<string, string>;
41
41
  /** 历史数据中已经消耗的 */
42
- hasConsumed: number;
42
+ private readonly historyQty;
43
+ get hasConsumed(): number;
44
+ private get remainingQty();
43
45
  /** 剩于可消耗数量 */
44
46
  get remainingNum(): number;
45
47
  /** 批次/生产数量(用时读取,避免构造快照过期) */
46
48
  get materialNoNum(): number;
47
49
  /** 需求总量 = 数量倍数 × BOM 单位用量 */
50
+ private get totalQty();
48
51
  get total(): number;
49
52
  constructor(bomEntry: IBomEntry,
50
53
  /** 是否启用顺序投料 */
@@ -110,9 +113,11 @@ export declare class BomEntryValidator {
110
113
  * @param arr
111
114
  * @return {*}
112
115
  */
113
- calcQtyConsumed(arr: IMaterialConsumeData[], source?: ConsumeDataSource): number;
116
+ calcQtyConsumed(arr: IMaterialConsumeData[], source?: ConsumeDataSource): BigNumber;
114
117
  /** 上下限校验优先使用单位转换后的数量,历史数据未转换时兼容原数量。 */
115
- calcQtyForBounds(arr: IMaterialConsumeData[], source?: ConsumeDataSource): number;
118
+ calcQtyForBounds(arr: IMaterialConsumeData[], source?: ConsumeDataSource): BigNumber;
119
+ private calcTotalForBounds;
120
+ calcRunningQtyConsumed(arr: IMaterialConsumeData[]): number;
116
121
  /**
117
122
  * 计算自定义的数量校验的最大值和最小值
118
123
  * @param data
@@ -0,0 +1,6 @@
1
+ import { Doc } from '../../../../../core';
2
+ import { IMaterialConsumeData } from '../../../../../domain/table/business/material/types';
3
+ type Updates = Record<string, unknown>;
4
+ /** 初值仅填 undefined,详情或规则错误均不阻断基础行初始化。 */
5
+ export declare function prepareConsumeInitialWrite(doc: Doc, subFieldKey: string, rows: readonly IMaterialConsumeData[]): Promise<Updates>;
6
+ export {};
@@ -175,7 +175,7 @@ export declare class MaterialConsumeTableController {
175
175
  * 未填报时初始化消耗表行数据
176
176
  * @param defaultData 子表行默认值(含工序等)
177
177
  */
178
- initTableData(dataManager: DataManager, subFieldKey: string, defaultData?: Record<string, any>): number[];
178
+ initTableData(doc: Doc, subFieldKey: string, defaultData?: Record<string, any>): Promise<number[]>;
179
179
  /**
180
180
  * 根据数据计算需要禁用的字段
181
181
  * @param row
@@ -344,14 +344,18 @@ export declare class MaterialConsumeTableController {
344
344
  */
345
345
  setDefaultValue(row: IMaterialConsumeData, doc: Doc): void;
346
346
  getDefaultValue(row: IMaterialConsumeData): any;
347
- /**
348
- * 处理[物料消耗表]下拉字段变更
349
- */
350
- handleSelectChange({ changedData, selectedOption, doc, parsed, dataIndex, }: {
351
- changedData: any;
347
+ /** 下拉写入前校验,只生成更新,不修改当前行。 */
348
+ prepareSelectChange({ pending, selectedOption, doc, parsed, dataIndex, }: {
349
+ pending: Record<string, unknown>;
352
350
  selectedOption: any;
353
351
  doc: Doc;
354
352
  parsed: ParsedValuePath;
355
353
  dataIndex: number;
356
- }): Promise<void>;
354
+ }): Promise<Record<string, unknown>>;
355
+ /** 提交成功后刷新查询条件、禁用状态及派生数量。 */
356
+ afterSelectChange({ doc, parsed, dataIndex, }: {
357
+ doc: Doc;
358
+ parsed: ParsedValuePath;
359
+ dataIndex: number;
360
+ }): void;
357
361
  }
@@ -0,0 +1,7 @@
1
+ import { Doc } from '../../../../../core';
2
+ type Updates = Record<string, unknown>;
3
+ /** 批次选择只填充实际变化的来源;扫码仍按本次命中行执行。 */
4
+ export declare function getChangedConsumeSourcePaths(doc: Doc, pending: Updates, sourcePaths: readonly string[]): string[];
5
+ /** 仅对指定来源生成填充更新;详情查询失败时保留业务更新。 */
6
+ export declare function prepareConsumeWrite(doc: Doc, pending: Updates, sourcePaths: readonly string[]): Promise<Updates>;
7
+ export {};
@@ -0,0 +1,4 @@
1
+ export type ProductRecord = Record<string, unknown>;
2
+ export declare function productVersionId(value: unknown): string;
3
+ /** 初始化专用:单次批量查询,失败不抛错、不逐条补查。 */
4
+ export declare function loadConsumeInitialProducts(productRefs: readonly unknown[]): Promise<Map<string, ProductRecord>>;
@@ -1,10 +1,15 @@
1
1
  import { BomEntryValidator, ScanFillPlan } from './bom-validator';
2
2
  import { IMaterialConsumeData } from '../../../../../domain/table/business/material/types';
3
3
  export type ValidateCurrentGroupForSwitch = (table: IMaterialConsumeData[], current: BomEntryValidator) => void | Promise<void>;
4
+ export interface ScanFillResult {
5
+ rows: IMaterialConsumeData[];
6
+ /** 本次扫码实际写入行的稳定身份 */
7
+ filledRowKey: string;
8
+ }
4
9
  /**
5
- * 按 ScanFillPlan 切组 / 建组 / 填充,返回新表(不改入参 arr)。
10
+ * 按 ScanFillPlan 切组 / 建组 / 填充,返回新表及本次写入行的身份(不改入参 arr)。
6
11
  * needSwitch 时通过 options.validateCurrentGroupForSwitch 先校验当前组。
7
12
  */
8
13
  export declare function applyScanFillPlan(arr: IMaterialConsumeData[], scanRow: IMaterialConsumeData, plan?: ScanFillPlan, options?: {
9
14
  validateCurrentGroupForSwitch?: ValidateCurrentGroupForSwitch;
10
- }): Promise<IMaterialConsumeData[]>;
15
+ }): Promise<ScanFillResult>;
@@ -14,6 +14,8 @@ export interface CreateWidgetFromPaletteOptions {
14
14
  overrideProps?: Record<string, any>;
15
15
  /** 用于解析子表业务 Profile */
16
16
  refModelType?: string;
17
+ /** 当前模型的完整字段列表,包含对象及对象子字段。 */
18
+ modelFields?: readonly FieldMeta[];
17
19
  }
18
20
  export declare function createDesignFieldToWidgetFactory(getFieldManifestForField: (f: FieldTypeSource) => FieldManifest | undefined): (field: FieldMeta, opts?: CreateWidgetFromPaletteOptions) => WidgetMeta;
19
21
  export declare function createDesignPaperWidgetToWidgetFactory(getManifest: (type: PAPER_WIDGET_TYPE) => PaperWidgetManifest | undefined): (widget: PaperWidgetMeta, opts?: CreateWidgetFromPaletteOptions) => WidgetMeta;
@@ -9,6 +9,8 @@ type AutofillApplyOptions = {
9
9
  /** 仅写入指定子表行(插行场景) */
10
10
  rowIndexes?: number[];
11
11
  };
12
+ /** 只解析目标路径,不执行来源取值或填充。 */
13
+ export declare function getAutofillTargetPaths(autofillRules: AutofillRule[], opts?: AutofillApplyOptions): string[];
12
14
  export declare function applyAutofillRules(record: Record<string, unknown>, autofillRules: AutofillRule[], opts?: AutofillApplyOptions): Record<string, unknown>;
13
15
  /**
14
16
  * 子表插行 / 行初始化:从主表规则补默认值
@@ -0,0 +1,9 @@
1
+ import { default as BigNumber } from 'bignumber.js';
2
+ export type Decimal = BigNumber;
3
+ type Numeric = BigNumber.Value;
4
+ export declare function plus(a: Numeric, b: Numeric): Decimal;
5
+ export declare function minus(a: Numeric, b: Numeric): Decimal;
6
+ export declare function multiply(a: Numeric, b: Numeric): Decimal;
7
+ export declare function sum(values: readonly Numeric[], initial?: Numeric): Decimal;
8
+ export declare function compare(a: Numeric, b: Numeric): -1 | 0 | 1 | null;
9
+ export {};
package/dist/word.css CHANGED
@@ -10152,7 +10152,7 @@ to {
10152
10152
  /**
10153
10153
  * 字段态配色 —— DOM 控件子集(input / select / overlay)
10154
10154
  */
10155
- .widget-container-action[data-v-b206a36a] {
10155
+ .widget-container-action[data-v-f4ff350c] {
10156
10156
  position: absolute;
10157
10157
  inset: 0;
10158
10158
  z-index: 999;
@@ -10160,7 +10160,7 @@ to {
10160
10160
  height: 0;
10161
10161
  pointer-events: all;
10162
10162
  }
10163
- .picker-trigger[data-v-b206a36a] {
10163
+ .picker-trigger[data-v-f4ff350c] {
10164
10164
  display: flex;
10165
10165
  box-sizing: border-box;
10166
10166
  align-items: center;
@@ -10172,19 +10172,19 @@ to {
10172
10172
  outline: none;
10173
10173
  background-color: #fff;
10174
10174
  }
10175
- .picker-trigger.disabled[data-v-b206a36a] {
10175
+ .picker-trigger.disabled[data-v-f4ff350c] {
10176
10176
  border: 1px solid rgba(13, 13, 13, 0.12);
10177
10177
  cursor: not-allowed;
10178
10178
  }
10179
- .picker-trigger.disabled .gct-icon[data-v-b206a36a] {
10179
+ .picker-trigger.disabled .gct-icon[data-v-f4ff350c] {
10180
10180
  color: rgba(0, 0, 0, 0.25);
10181
10181
  }
10182
- .picker-trigger.readonly[data-v-b206a36a] {
10182
+ .picker-trigger.readonly[data-v-f4ff350c] {
10183
10183
  border-color: #d9d9d9;
10184
10184
  background-color: #f5f6f8;
10185
10185
  cursor: default;
10186
10186
  }
10187
- .picker-trigger.readonly .gct-icon[data-v-b206a36a] {
10187
+ .picker-trigger.readonly .gct-icon[data-v-f4ff350c] {
10188
10188
  color: rgba(0, 0, 0, 0.65);
10189
10189
  }
10190
10190
  .resize-box[data-v-788ab62c] {
@@ -11473,12 +11473,12 @@ to {
11473
11473
  color: #c3c3c3;
11474
11474
  font-size: 12px;
11475
11475
  }
11476
- .field-palette-container[data-v-7b935af4] {
11476
+ .field-palette-container[data-v-b473340e] {
11477
11477
  display: flex;
11478
11478
  flex-direction: row-reverse;
11479
11479
  align-items: start;
11480
11480
  }
11481
- .field-palette-container .field-pallette[data-v-7b935af4]:not(:nth-child(1)) {
11481
+ .field-palette-container .field-pallette[data-v-b473340e]:not(:nth-child(1)) {
11482
11482
  border-right: 1px solid #eaeaea;
11483
11483
  }
11484
11484
  .toolkit-content-widgets[data-v-393cb2aa] {
@@ -14266,7 +14266,7 @@ svg.portrait-icon[data-v-8bdb451e] {
14266
14266
  --size: 8px !important;
14267
14267
  --color: #1a1d23 !important;
14268
14268
  }
14269
- .content[data-v-498a9180] {
14269
+ .content[data-v-aefdaa0c] {
14270
14270
  display: flex;
14271
14271
  align-items: center;
14272
14272
  width: 100%;
@@ -14656,14 +14656,14 @@ svg.portrait-icon[data-v-8bdb451e] {
14656
14656
  color: #e45151;
14657
14657
  font-size: 12px;
14658
14658
  }
14659
- .form-item.default.ref-autofill-editor.is-content-hidden[data-v-fb5fe71e] .form-item__label {
14659
+ .form-item.default.ref-autofill-editor.is-content-hidden[data-v-18682fe2] .form-item__label {
14660
14660
  margin-bottom: 0 !important ;
14661
14661
  }
14662
- .ref-autofill-editor__extra[data-v-fb5fe71e] {
14662
+ .ref-autofill-editor__extra[data-v-18682fe2] {
14663
14663
  display: inline-flex;
14664
14664
  align-items: center;
14665
14665
  }
14666
- .data-filter-button[data-v-fb5fe71e] {
14666
+ .data-filter-button[data-v-18682fe2] {
14667
14667
  display: flex;
14668
14668
  box-sizing: border-box;
14669
14669
  align-items: center;
@@ -14674,11 +14674,11 @@ svg.portrait-icon[data-v-8bdb451e] {
14674
14674
  color: #333;
14675
14675
  cursor: pointer;
14676
14676
  }
14677
- .data-filter-button[data-v-fb5fe71e]:hover {
14677
+ .data-filter-button[data-v-18682fe2]:hover {
14678
14678
  border-color: #026ac8;
14679
14679
  color: #026ac8;
14680
14680
  }
14681
- .data-filter-button.primary[data-v-fb5fe71e] {
14681
+ .data-filter-button.primary[data-v-18682fe2] {
14682
14682
  border-color: #026ac8;
14683
14683
  background-color: #026ac8;
14684
14684
  color: #fff;
@@ -15457,7 +15457,7 @@ svg.portrait-icon[data-v-8bdb451e] {
15457
15457
  max-width: 240px;
15458
15458
  padding: 8px;
15459
15459
  }
15460
- .panel-field-text-config[data-v-d0b52eab] {
15460
+ .panel-field-text-config[data-v-7ccc38ed] {
15461
15461
  padding: 16px;
15462
15462
  }
15463
15463
  .form-item.default.assoc-filter-editor.is-content-hidden[data-v-81133a7f] .form-item__label {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/word",
3
- "version": "0.2.40-beta.0",
3
+ "version": "0.2.40-beta.1",
4
4
  "description": "GCT 在线 word",
5
5
  "keywords": [
6
6
  "vue",