@gct-paas/word 0.1.63 → 0.1.65
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/core/data/DataManager.d.ts +5 -2
- package/dist/core/data/paths/subtable-path.d.ts +2 -1
- package/dist/core/data/subtable/row.d.ts +2 -6
- package/dist/core/layout/LayoutContext.d.ts +0 -2
- package/dist/domain/table/business/material/types.d.ts +2 -0
- package/dist/domain/table/runtime/engines/row-runtime-engine.d.ts +1 -1
- package/dist/domain/table/runtime/table-runtime-context.d.ts +15 -5
- package/dist/index.es.js +225 -171
- package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts +6 -4
- package/dist/runtime/canvas/table/render/material-consume/material-consume.util.d.ts +6 -1
- package/dist/runtime/canvas/table/render/material-consume/service.d.ts +1 -1
- package/dist/suites/shared/panel/config/editor/ref-autofill-editor/autofill-runtime.d.ts +3 -1
- package/dist/word.css +18 -18
- package/package.json +1 -1
|
@@ -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
|
|
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
|
-
/**
|
|
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_
|
|
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"
|
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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;
|
package/dist/index.es.js
CHANGED
|
@@ -33535,7 +33535,7 @@ function getValue$1(value, multiple) {
|
|
|
33535
33535
|
}
|
|
33536
33536
|
return value;
|
|
33537
33537
|
}
|
|
33538
|
-
function setValue
|
|
33538
|
+
function setValue(value, valuePath, payload) {
|
|
33539
33539
|
const { multiple = false, valueKey } = payload || {};
|
|
33540
33540
|
const values = multiple ? value?.map((item) => valueKey ? item[valueKey] : item).join(",") || null : value ?? null;
|
|
33541
33541
|
return {
|
|
@@ -81339,7 +81339,7 @@ function getLabelPath(path) {
|
|
|
81339
81339
|
function getHrefPath(path) {
|
|
81340
81340
|
return path + HREF_SUFFIX;
|
|
81341
81341
|
}
|
|
81342
|
-
function getIdPath
|
|
81342
|
+
function getIdPath(path) {
|
|
81343
81343
|
return path + ID_SUFFIX;
|
|
81344
81344
|
}
|
|
81345
81345
|
function isCompanionIdPath(path) {
|
|
@@ -84171,7 +84171,7 @@ async function applyAutofillOnSubTableRowInit(doc, subFieldKey, rowIndex, fetchS
|
|
|
84171
84171
|
if (!bindings.length) return;
|
|
84172
84172
|
const updates = await buildAutofillUpdatesFromBindings(doc, bindings, {
|
|
84173
84173
|
rawData: doc.dataManager.getRawData(),
|
|
84174
|
-
rowIndexes: [
|
|
84174
|
+
rowIndexes: [rowIndex],
|
|
84175
84175
|
fetchSource
|
|
84176
84176
|
});
|
|
84177
84177
|
if (Object.keys(updates).length) {
|
|
@@ -84511,7 +84511,7 @@ function createIdEnricher(reg) {
|
|
|
84511
84511
|
return createCompanionEnricher(reg, {
|
|
84512
84512
|
cacheNamespace: "id_enrich_resolve",
|
|
84513
84513
|
defaultIdPrefix: "id:",
|
|
84514
|
-
getCompanionPath: getIdPath
|
|
84514
|
+
getCompanionPath: getIdPath,
|
|
84515
84515
|
preserveOnHydrate: true,
|
|
84516
84516
|
skipWhenCompanionPresent: true,
|
|
84517
84517
|
buildCacheKey: (path, value, doc) => ({
|
|
@@ -85085,31 +85085,13 @@ function countActiveSubtableRows(rows) {
|
|
|
85085
85085
|
if (!Array.isArray(rows)) return 0;
|
|
85086
85086
|
return rows.filter((row) => !row?.deleted_).length;
|
|
85087
85087
|
}
|
|
85088
|
-
function resolveSubtableStorageIndex(rows, visibleIndex) {
|
|
85089
|
-
if (!Array.isArray(rows) || visibleIndex < 0) return visibleIndex;
|
|
85090
|
-
let seen = -1;
|
|
85091
|
-
for (let i = 0; i < rows.length; i++) {
|
|
85092
|
-
if (!rows[i]?.deleted_) {
|
|
85093
|
-
seen++;
|
|
85094
|
-
if (seen === visibleIndex) return i;
|
|
85095
|
-
}
|
|
85096
|
-
}
|
|
85097
|
-
return visibleIndex;
|
|
85098
|
-
}
|
|
85099
|
-
function resolveSubtableInsertIndex(rows, visibleIndex) {
|
|
85100
|
-
if (!Array.isArray(rows)) return 0;
|
|
85101
|
-
let seen = -1;
|
|
85102
|
-
for (let i = 0; i < rows.length; i++) {
|
|
85103
|
-
if (!rows[i]?.deleted_) {
|
|
85104
|
-
seen++;
|
|
85105
|
-
if (seen === visibleIndex) return i;
|
|
85106
|
-
}
|
|
85107
|
-
}
|
|
85108
|
-
return rows.length;
|
|
85109
|
-
}
|
|
85110
85088
|
function buildRowGroupKey(row, fieldKeys, separator = "|") {
|
|
85111
85089
|
return fieldKeys.map((key) => String(row[key] ?? "")).join(separator);
|
|
85112
85090
|
}
|
|
85091
|
+
function activeRowIndexes(rows) {
|
|
85092
|
+
const count = countActiveSubtableRows(rows);
|
|
85093
|
+
return Array.from({ length: count }, (_2, index2) => index2);
|
|
85094
|
+
}
|
|
85113
85095
|
function expandInitPathTemplates(templatePath, rawData) {
|
|
85114
85096
|
const parsed = parseValuePath(templatePath);
|
|
85115
85097
|
const hasCrossPlaceholder = templatePath.includes("[n_y]") || templatePath.includes("[n_x]");
|
|
@@ -85117,11 +85099,11 @@ function expandInitPathTemplates(templatePath, rawData) {
|
|
|
85117
85099
|
if (hasCrossPlaceholder) {
|
|
85118
85100
|
const yKey = parsed.parentFieldKey || "";
|
|
85119
85101
|
const xKey = parsed.linkFieldKey || "";
|
|
85120
|
-
const
|
|
85121
|
-
const
|
|
85102
|
+
const yIndexes = activeRowIndexes(get(rawData, yKey));
|
|
85103
|
+
const xIndexes = activeRowIndexes(get(rawData, xKey));
|
|
85122
85104
|
const paths = [];
|
|
85123
|
-
for (
|
|
85124
|
-
for (
|
|
85105
|
+
for (const y2 of yIndexes) {
|
|
85106
|
+
for (const x2 of xIndexes) {
|
|
85125
85107
|
paths.push(replacePathIndexPlaceholders({ templatePath, y: y2, x: x2, n: y2 }));
|
|
85126
85108
|
}
|
|
85127
85109
|
}
|
|
@@ -85129,12 +85111,9 @@ function expandInitPathTemplates(templatePath, rawData) {
|
|
|
85129
85111
|
}
|
|
85130
85112
|
if (hasSinglePlaceholder) {
|
|
85131
85113
|
const tableKey = parsed.parentFieldKey || "";
|
|
85132
|
-
|
|
85133
|
-
|
|
85134
|
-
|
|
85135
|
-
paths.push(replacePathIndexPlaceholders({ templatePath, n: i, y: i, x: i }));
|
|
85136
|
-
}
|
|
85137
|
-
return paths;
|
|
85114
|
+
return activeRowIndexes(get(rawData, tableKey)).map(
|
|
85115
|
+
(i) => replacePathIndexPlaceholders({ templatePath, n: i, y: i, x: i })
|
|
85116
|
+
);
|
|
85138
85117
|
}
|
|
85139
85118
|
return [templatePath];
|
|
85140
85119
|
}
|
|
@@ -85172,9 +85151,9 @@ function parseBusinessFieldChange(changedPath) {
|
|
|
85172
85151
|
}
|
|
85173
85152
|
function countSubTableDataRows(rawData, subFieldKey) {
|
|
85174
85153
|
const existing = get(rawData, subFieldKey);
|
|
85175
|
-
if (Array.isArray(existing)) return existing
|
|
85154
|
+
if (Array.isArray(existing)) return countActiveSubtableRows(existing);
|
|
85176
85155
|
if (existing && typeof existing === "object" && Array.isArray(existing.data)) {
|
|
85177
|
-
return existing.data
|
|
85156
|
+
return countActiveSubtableRows(existing.data);
|
|
85178
85157
|
}
|
|
85179
85158
|
return 0;
|
|
85180
85159
|
}
|
|
@@ -85185,6 +85164,18 @@ function resolveSubTableRowCount(doc, subFieldKey, rawData) {
|
|
|
85185
85164
|
}
|
|
85186
85165
|
function resolveSubTableRowIndexes(doc, subFieldKey, rawData, rowIndexes) {
|
|
85187
85166
|
if (rowIndexes?.length) return rowIndexes;
|
|
85167
|
+
const existing = get(rawData, subFieldKey);
|
|
85168
|
+
if (Array.isArray(existing) && existing.length > 0) {
|
|
85169
|
+
const count2 = countActiveSubtableRows(existing);
|
|
85170
|
+
return Array.from({ length: count2 }, (_2, index2) => index2);
|
|
85171
|
+
}
|
|
85172
|
+
if (existing && typeof existing === "object" && Array.isArray(existing.data)) {
|
|
85173
|
+
const data = existing.data;
|
|
85174
|
+
if (data.length > 0) {
|
|
85175
|
+
const count2 = countActiveSubtableRows(data);
|
|
85176
|
+
return Array.from({ length: count2 }, (_2, index2) => index2);
|
|
85177
|
+
}
|
|
85178
|
+
}
|
|
85188
85179
|
const count = resolveSubTableRowCount(doc, subFieldKey, rawData);
|
|
85189
85180
|
return Array.from({ length: count }, (_2, index2) => index2);
|
|
85190
85181
|
}
|
|
@@ -85362,7 +85353,7 @@ class DataManager {
|
|
|
85362
85353
|
return getHrefPath(path);
|
|
85363
85354
|
}
|
|
85364
85355
|
getIdPath(path) {
|
|
85365
|
-
return getIdPath
|
|
85356
|
+
return getIdPath(path);
|
|
85366
85357
|
}
|
|
85367
85358
|
getFieldRuntimeSpecificConfigKeys() {
|
|
85368
85359
|
return [...this.fieldRuntimeConfigByPath.keys()];
|
|
@@ -85429,6 +85420,51 @@ class DataManager {
|
|
|
85429
85420
|
this.doc?.eventManager?.eventBus.emit("field-runtime-config-changed", { path });
|
|
85430
85421
|
}
|
|
85431
85422
|
}
|
|
85423
|
+
getSubFieldConfigMap() {
|
|
85424
|
+
const key = "_subFieldConfig";
|
|
85425
|
+
const params = this.doc?.paramsConfig;
|
|
85426
|
+
const cfg = params?.[key];
|
|
85427
|
+
if (!cfg || typeof cfg !== "object") return void 0;
|
|
85428
|
+
return cfg;
|
|
85429
|
+
}
|
|
85430
|
+
/** 插行后同步 _subFieldConfig 下标 +1 */
|
|
85431
|
+
shiftSubFieldConfigAfterRowInsert(arrayPath, insertIndex) {
|
|
85432
|
+
const cfg = this.getSubFieldConfigMap();
|
|
85433
|
+
if (!cfg) return;
|
|
85434
|
+
const updates = {};
|
|
85435
|
+
const toDelete = [];
|
|
85436
|
+
for (const [path, value] of Object.entries(cfg)) {
|
|
85437
|
+
const parsed = this.parseSubtableFieldPath(path, arrayPath);
|
|
85438
|
+
if (!parsed) continue;
|
|
85439
|
+
const { rowIndex, suffix } = parsed;
|
|
85440
|
+
if (rowIndex >= insertIndex) {
|
|
85441
|
+
toDelete.push(path);
|
|
85442
|
+
updates[`${arrayPath}[${rowIndex + 1}]${suffix}`] = value;
|
|
85443
|
+
}
|
|
85444
|
+
}
|
|
85445
|
+
for (const path of toDelete) delete cfg[path];
|
|
85446
|
+
Object.assign(cfg, updates);
|
|
85447
|
+
}
|
|
85448
|
+
/** 硬删后同步 _subFieldConfig:删该行并对其后行 -1 */
|
|
85449
|
+
shiftSubFieldConfigAfterRowRemove(arrayPath, removeIndex) {
|
|
85450
|
+
const cfg = this.getSubFieldConfigMap();
|
|
85451
|
+
if (!cfg) return;
|
|
85452
|
+
const updates = {};
|
|
85453
|
+
const toDelete = [];
|
|
85454
|
+
for (const [path, value] of Object.entries(cfg)) {
|
|
85455
|
+
const parsed = this.parseSubtableFieldPath(path, arrayPath);
|
|
85456
|
+
if (!parsed) continue;
|
|
85457
|
+
const { rowIndex, suffix } = parsed;
|
|
85458
|
+
if (rowIndex === removeIndex) {
|
|
85459
|
+
toDelete.push(path);
|
|
85460
|
+
} else if (rowIndex > removeIndex) {
|
|
85461
|
+
toDelete.push(path);
|
|
85462
|
+
updates[`${arrayPath}[${rowIndex - 1}]${suffix}`] = value;
|
|
85463
|
+
}
|
|
85464
|
+
}
|
|
85465
|
+
for (const path of toDelete) delete cfg[path];
|
|
85466
|
+
Object.assign(cfg, updates);
|
|
85467
|
+
}
|
|
85432
85468
|
parseSubtableFieldPath(fullPath, arrayPath) {
|
|
85433
85469
|
const head = `${arrayPath}[`;
|
|
85434
85470
|
if (!fullPath.startsWith(head)) return null;
|
|
@@ -85581,12 +85617,6 @@ class DataManager {
|
|
|
85581
85617
|
}
|
|
85582
85618
|
return maxIndex + 1;
|
|
85583
85619
|
}
|
|
85584
|
-
/** 版面可见行下标 → rawData 数组实际下标 */
|
|
85585
|
-
resolveSubtableVisibleIndex(arrayPath, visibleIndex) {
|
|
85586
|
-
const rows = this.getByPath(this.rawData, arrayPath);
|
|
85587
|
-
if (!Array.isArray(rows)) return visibleIndex;
|
|
85588
|
-
return resolveSubtableStorageIndex(rows, visibleIndex);
|
|
85589
|
-
}
|
|
85590
85620
|
assignField(target, fieldPath, value) {
|
|
85591
85621
|
if (!fieldPath.includes(".") && !fieldPath.includes("[")) {
|
|
85592
85622
|
target[fieldPath] = value;
|
|
@@ -86007,10 +86037,11 @@ class DataManager {
|
|
|
86007
86037
|
arr = [{ ...DEFAULT_EMPTY_ITEM }];
|
|
86008
86038
|
this.set(path, arr, "parent");
|
|
86009
86039
|
}
|
|
86010
|
-
const
|
|
86011
|
-
if (
|
|
86040
|
+
const activeCount = countActiveSubtableRows(arr);
|
|
86041
|
+
if (index2 < 0 || index2 > activeCount) {
|
|
86012
86042
|
throw new Error(`Index ${index2} out of bounds for array of length ${arr.length}`);
|
|
86013
86043
|
}
|
|
86044
|
+
const storageIndex = index2;
|
|
86014
86045
|
const oldValue = [...arr];
|
|
86015
86046
|
const tableKey = path.replace(/^\$\./, "").replace(/\[(n|\d+)\]/g, "");
|
|
86016
86047
|
const axisInfo = this.resolveAxisByTableKey(tableKey);
|
|
@@ -86026,6 +86057,7 @@ class DataManager {
|
|
|
86026
86057
|
this.emit(path, arr, oldValue);
|
|
86027
86058
|
this.shiftFieldRuntimeConfigAfterRowInsert(path, storageIndex);
|
|
86028
86059
|
this.shiftDependencyGraphAfterRowInsert(path, storageIndex);
|
|
86060
|
+
this.shiftSubFieldConfigAfterRowInsert(path, storageIndex);
|
|
86029
86061
|
return true;
|
|
86030
86062
|
} catch (error) {
|
|
86031
86063
|
console.error(`Failed to insert value at path "${path}":`, error);
|
|
@@ -86044,10 +86076,11 @@ class DataManager {
|
|
|
86044
86076
|
if (!Array.isArray(arr)) {
|
|
86045
86077
|
throw new Error(`Path "${path}" is not an array`);
|
|
86046
86078
|
}
|
|
86047
|
-
const
|
|
86048
|
-
if (
|
|
86079
|
+
const activeCount = countActiveSubtableRows(arr);
|
|
86080
|
+
if (index2 < 0 || index2 >= activeCount) {
|
|
86049
86081
|
throw new Error(`Index ${index2} out of bounds for array of length ${arr.length}`);
|
|
86050
86082
|
}
|
|
86083
|
+
const storageIndex = index2;
|
|
86051
86084
|
const tableKey = path.replace(/^\$\./, "").replace(/\[(n|\d+)\]/g, "");
|
|
86052
86085
|
const axisInfo = this.resolveAxisByTableKey(tableKey);
|
|
86053
86086
|
const row = arr[storageIndex];
|
|
@@ -86057,15 +86090,21 @@ class DataManager {
|
|
|
86057
86090
|
axis: axisInfo?.axis
|
|
86058
86091
|
})) {
|
|
86059
86092
|
const oldValue2 = this.deepClone(arr);
|
|
86060
|
-
|
|
86093
|
+
const [removedRow] = arr.splice(storageIndex, 1);
|
|
86094
|
+
removedRow.deleted_ = true;
|
|
86095
|
+
arr.push(removedRow);
|
|
86096
|
+
this.shiftFieldRuntimeConfigAfterRowRemove(path, storageIndex);
|
|
86097
|
+
this.shiftDependencyGraphAfterRowRemove(path, storageIndex);
|
|
86098
|
+
this.shiftSubFieldConfigAfterRowRemove(path, storageIndex);
|
|
86061
86099
|
this.emit(path, arr, oldValue2);
|
|
86062
|
-
return
|
|
86100
|
+
return removedRow;
|
|
86063
86101
|
}
|
|
86064
86102
|
const oldValue = [...arr];
|
|
86065
86103
|
const removedValue = arr.splice(storageIndex, 1)[0];
|
|
86066
86104
|
this.emit(path, arr, oldValue);
|
|
86067
86105
|
this.shiftFieldRuntimeConfigAfterRowRemove(path, storageIndex);
|
|
86068
86106
|
this.shiftDependencyGraphAfterRowRemove(path, storageIndex);
|
|
86107
|
+
this.shiftSubFieldConfigAfterRowRemove(path, storageIndex);
|
|
86069
86108
|
if (axisInfo) {
|
|
86070
86109
|
const uidField = axisInfo.axis === "y" ? "__gw_y_uid" : "__gw_x_uid";
|
|
86071
86110
|
this.cleanupCrossByAxisUid(tableKey, axisInfo.axis, removedValue?.[uidField]);
|
|
@@ -86591,7 +86630,7 @@ class DataManager {
|
|
|
86591
86630
|
designValuePath,
|
|
86592
86631
|
getLabelPath(designValuePath),
|
|
86593
86632
|
getHrefPath(designValuePath),
|
|
86594
|
-
getIdPath
|
|
86633
|
+
getIdPath(designValuePath)
|
|
86595
86634
|
];
|
|
86596
86635
|
const wildcardKeys = new Set(bases.map((path) => this.convertPathToWildcard(path)));
|
|
86597
86636
|
const result = new Set(bases);
|
|
@@ -86615,7 +86654,7 @@ class DataManager {
|
|
|
86615
86654
|
paths.add(path);
|
|
86616
86655
|
paths.add(getLabelPath(path));
|
|
86617
86656
|
paths.add(getHrefPath(path));
|
|
86618
|
-
paths.add(getIdPath
|
|
86657
|
+
paths.add(getIdPath(path));
|
|
86619
86658
|
}
|
|
86620
86659
|
return [...paths];
|
|
86621
86660
|
}
|
|
@@ -86626,7 +86665,7 @@ class DataManager {
|
|
|
86626
86665
|
designValuePath,
|
|
86627
86666
|
getLabelPath(designValuePath),
|
|
86628
86667
|
getHrefPath(designValuePath),
|
|
86629
|
-
getIdPath
|
|
86668
|
+
getIdPath(designValuePath)
|
|
86630
86669
|
].map((path) => this.convertPathToWildcard(path))
|
|
86631
86670
|
);
|
|
86632
86671
|
const nodes = this.collectDepNodes();
|
|
@@ -86873,7 +86912,7 @@ function buildFieldSelectUpdates(valuePath, value, optionId, options = {}) {
|
|
|
86873
86912
|
[valuePath]: normalizedValue
|
|
86874
86913
|
};
|
|
86875
86914
|
if (options.persistOptionId) {
|
|
86876
|
-
updates[getIdPath
|
|
86915
|
+
updates[getIdPath(valuePath)] = optionId ?? null;
|
|
86877
86916
|
}
|
|
86878
86917
|
return updates;
|
|
86879
86918
|
}
|
|
@@ -87333,21 +87372,33 @@ class TableRuntimeContext {
|
|
|
87333
87372
|
get arrayPath() {
|
|
87334
87373
|
return `$.${this.subFieldKey}`;
|
|
87335
87374
|
}
|
|
87336
|
-
/** 指定行路径 $.subFieldKey[rowIndex] */
|
|
87375
|
+
/** 指定行路径 $.subFieldKey[rowIndex];rowIndex 为存储下标 */
|
|
87337
87376
|
rowPath(rowIndex) {
|
|
87338
87377
|
return `${this.arrayPath}[${rowIndex}]`;
|
|
87339
87378
|
}
|
|
87340
|
-
/**
|
|
87379
|
+
/** 读取指定行数据;rowIndex 为存储下标 */
|
|
87341
87380
|
getRow(rowIndex) {
|
|
87342
87381
|
return this.doc.dataManager.get(this.rowPath(rowIndex));
|
|
87343
87382
|
}
|
|
87344
|
-
/**
|
|
87383
|
+
/**
|
|
87384
|
+
* 子表存储行数(含软删),无数据默认返回 1
|
|
87385
|
+
*/
|
|
87345
87386
|
getRowCount() {
|
|
87346
87387
|
const rows = this.doc.dataManager.getRawData()[this.subFieldKey];
|
|
87347
87388
|
if (Array.isArray(rows) && rows.length > 0) return rows.length;
|
|
87348
87389
|
return 1;
|
|
87349
87390
|
}
|
|
87350
|
-
/**
|
|
87391
|
+
/**
|
|
87392
|
+
* 未软删行的存储下标。无数据时返回 [0](与版面默认空行一致);
|
|
87393
|
+
* 仅剩软删行时返回 []。
|
|
87394
|
+
*/
|
|
87395
|
+
getActiveRowIndexes() {
|
|
87396
|
+
const rows = this.doc.dataManager.getRawData()[this.subFieldKey];
|
|
87397
|
+
if (!Array.isArray(rows) || rows.length === 0) return [0];
|
|
87398
|
+
const count = countActiveSubtableRows(rows);
|
|
87399
|
+
return Array.from({ length: count }, (_2, index2) => index2);
|
|
87400
|
+
}
|
|
87401
|
+
/** 构建单行规则执行上下文;rowIndex 为存储下标 */
|
|
87351
87402
|
buildRuleContext(rowIndex, changedFieldKey) {
|
|
87352
87403
|
const rowPath = this.rowPath(rowIndex);
|
|
87353
87404
|
const rowData = this.getRow(rowIndex) ?? {};
|
|
@@ -87361,9 +87412,12 @@ class TableRuntimeContext {
|
|
|
87361
87412
|
paramsConfig: this.doc.paramsConfig ?? {}
|
|
87362
87413
|
};
|
|
87363
87414
|
}
|
|
87364
|
-
/**
|
|
87415
|
+
/**
|
|
87416
|
+
* 遍历子表数据行,支持指定单行或全量遍历,逐行注入 RuleContext。
|
|
87417
|
+
* rowIndex / 全量遍历均使用存储下标;全量时跳过 deleted_ 行。
|
|
87418
|
+
*/
|
|
87365
87419
|
eachRow(options, iteratee) {
|
|
87366
|
-
const rowIndexes = options.rowIndex !== void 0 ? [options.rowIndex] :
|
|
87420
|
+
const rowIndexes = options.rowIndex !== void 0 ? [options.rowIndex] : this.getActiveRowIndexes();
|
|
87367
87421
|
for (const rowIndex of rowIndexes) {
|
|
87368
87422
|
iteratee(this.buildRuleContext(rowIndex, options.changedFieldKey));
|
|
87369
87423
|
}
|
|
@@ -88027,8 +88081,7 @@ class RemoteSyncEngine {
|
|
|
88027
88081
|
const config = ctx.profile.remoteSync;
|
|
88028
88082
|
const missingKeys = config?.resyncOnInitWhenMissing;
|
|
88029
88083
|
if (!config || !missingKeys?.length) return;
|
|
88030
|
-
const
|
|
88031
|
-
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
88084
|
+
for (const rowIndex of ctx.getActiveRowIndexes()) {
|
|
88032
88085
|
const row = ctx.getRow(rowIndex);
|
|
88033
88086
|
if (!row) continue;
|
|
88034
88087
|
if (config.requireAllOf?.some((key) => !isPresent(row[key]))) continue;
|
|
@@ -88210,11 +88263,10 @@ class RowRuntimeEngine {
|
|
|
88210
88263
|
runRowHandler(ctx.profile.type, handler.handler, this.doc, ctx.subFieldKey, rowIndex);
|
|
88211
88264
|
}
|
|
88212
88265
|
}
|
|
88213
|
-
/**
|
|
88266
|
+
/** 初始化时对所有未软删行执行行初始化 */
|
|
88214
88267
|
applyRowInitForAllRows(ctx) {
|
|
88215
88268
|
if (!this.hasRowInit(ctx)) return;
|
|
88216
|
-
const
|
|
88217
|
-
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
88269
|
+
for (const rowIndex of ctx.getActiveRowIndexes()) {
|
|
88218
88270
|
this.applyRowInit(ctx, rowIndex);
|
|
88219
88271
|
}
|
|
88220
88272
|
}
|
|
@@ -88897,7 +88949,14 @@ const profile$3 = {
|
|
|
88897
88949
|
fieldType: "master_slave",
|
|
88898
88950
|
refModelType: "MATERIAL_CONSUME"
|
|
88899
88951
|
},
|
|
88900
|
-
rowHandlers: [{ when: "onFieldChange", watch: ["qty_"], handler: "on-qty-change" }],
|
|
88952
|
+
rowHandlers: [{ when: "onFieldChange", watch: ["qty_", "product_id_", "material_no_"], handler: "on-qty-change" }],
|
|
88953
|
+
runtimeRules: [
|
|
88954
|
+
{
|
|
88955
|
+
when: "always",
|
|
88956
|
+
fields: ["qty_consumed_"],
|
|
88957
|
+
effect: { disabled: true }
|
|
88958
|
+
}
|
|
88959
|
+
],
|
|
88901
88960
|
theme: {
|
|
88902
88961
|
color: "#4891B3",
|
|
88903
88962
|
background: "rgba(72,145,179,0.2)",
|
|
@@ -89134,7 +89193,7 @@ const CLEAR_ON_MFG_ORDER_SWITCH = [F$2.materialContainer, F$2.productionContaine
|
|
|
89134
89193
|
const CLEAR_ON_MATERIAL_CONTAINER_NO_EMPTY = [...CLEAR_ON_COMMON_EMPTY];
|
|
89135
89194
|
const CLEAR_ON_MATERIAL_CONTAINER_NO_SWITCH = [F$2.mfgOrder, F$2.productionContainer];
|
|
89136
89195
|
const CLEAR_ON_MATERIAL_CONTAINER_NO_MANUAL_SWITCH = [...CLEAR_ON_COMMON_EMPTY];
|
|
89137
|
-
const MATERIAL_CONTAINER_ID = getIdPath
|
|
89196
|
+
const MATERIAL_CONTAINER_ID = getIdPath(F$2.materialContainer);
|
|
89138
89197
|
const PRODUCT_EDITABILITY_WATCH = [
|
|
89139
89198
|
F$2.materialContainer,
|
|
89140
89199
|
MATERIAL_CONTAINER_ID,
|
|
@@ -89444,7 +89503,7 @@ function handleMfgOrderChange(doc, subFieldKey, rowIndex) {
|
|
|
89444
89503
|
function handleMaterialContainerNoChange(doc, subFieldKey, rowIndex) {
|
|
89445
89504
|
const ctx = getRowChangeCtx(doc, subFieldKey, rowIndex);
|
|
89446
89505
|
if (!ctx) return;
|
|
89447
|
-
const clearWhenPresent = isBlank(ctx.row[getIdPath
|
|
89506
|
+
const clearWhenPresent = isBlank(ctx.row[getIdPath(F$2.materialContainer)]) ? [...CLEAR_ON_MATERIAL_CONTAINER_NO_MANUAL_SWITCH, ...CLEAR_ON_MATERIAL_CONTAINER_NO_SWITCH] : CLEAR_ON_MATERIAL_CONTAINER_NO_SWITCH;
|
|
89448
89507
|
handleIdentityFieldChange$1(
|
|
89449
89508
|
ctx,
|
|
89450
89509
|
F$2.materialContainer,
|
|
@@ -99439,22 +99498,6 @@ class LayoutContext {
|
|
|
99439
99498
|
this.paragraph?.addChild(run);
|
|
99440
99499
|
this.layoutRun = run;
|
|
99441
99500
|
}
|
|
99442
|
-
/** 子表可见行下标 → rawData 存储下标(跳过 deleted_ 行) */
|
|
99443
|
-
mapSubtableVisibleIndex(templatePath, visibleIndex, axis) {
|
|
99444
|
-
if (visibleIndex === void 0) return void 0;
|
|
99445
|
-
const parsed = parseValuePath(templatePath);
|
|
99446
|
-
const dm = this.doc.dataManager;
|
|
99447
|
-
if (axis === "n_y" && parsed.parentFieldPath) {
|
|
99448
|
-
return dm.resolveSubtableVisibleIndex(parsed.parentFieldPath, visibleIndex);
|
|
99449
|
-
}
|
|
99450
|
-
if (axis === "n_x" && parsed.linkFieldPath) {
|
|
99451
|
-
return dm.resolveSubtableVisibleIndex(parsed.linkFieldPath, visibleIndex);
|
|
99452
|
-
}
|
|
99453
|
-
if (parsed.isSubTable && parsed.parentFieldPath) {
|
|
99454
|
-
return dm.resolveSubtableVisibleIndex(parsed.parentFieldPath, visibleIndex);
|
|
99455
|
-
}
|
|
99456
|
-
return visibleIndex;
|
|
99457
|
-
}
|
|
99458
99501
|
/**
|
|
99459
99502
|
* 根据 dataIndex 替换 path 中的 [n] 为实际值
|
|
99460
99503
|
* @param path 包含 [n] 的路径,如 "$.items[n].name"
|
|
@@ -99465,8 +99508,8 @@ class LayoutContext {
|
|
|
99465
99508
|
const { type: type4, dataIndex, xDataIndex, yDataIndex, cellZone } = this.cell?.subRenderer || {};
|
|
99466
99509
|
if (isLinkSubTableType(type4) && cellZone === "cross") {
|
|
99467
99510
|
return replacePathIndexPlaceholders({
|
|
99468
|
-
x:
|
|
99469
|
-
y:
|
|
99511
|
+
x: xDataIndex,
|
|
99512
|
+
y: yDataIndex,
|
|
99470
99513
|
templatePath: path
|
|
99471
99514
|
});
|
|
99472
99515
|
}
|
|
@@ -99476,10 +99519,6 @@ class LayoutContext {
|
|
|
99476
99519
|
let n = dataIndex;
|
|
99477
99520
|
if (isLinkSubTableType(type4)) {
|
|
99478
99521
|
n = cellZone === "horizontal" ? yDataIndex : xDataIndex;
|
|
99479
|
-
const axis = cellZone === "horizontal" ? "n_y" : "n_x";
|
|
99480
|
-
n = this.mapSubtableVisibleIndex(path, n, axis);
|
|
99481
|
-
} else {
|
|
99482
|
-
n = this.mapSubtableVisibleIndex(path, n, "n");
|
|
99483
99522
|
}
|
|
99484
99523
|
if (n === void 0) return path;
|
|
99485
99524
|
return replacePathIndexPlaceholder(n, path);
|
|
@@ -108450,6 +108489,9 @@ class BomEntriesValidator {
|
|
|
108450
108489
|
* @param row 单行的数据
|
|
108451
108490
|
*/
|
|
108452
108491
|
validateInBom(row) {
|
|
108492
|
+
if (this.mcPattern === MaterialConsumptionPatternEnum.RECORD) {
|
|
108493
|
+
return;
|
|
108494
|
+
}
|
|
108453
108495
|
if (!row.product_id_) {
|
|
108454
108496
|
throw new Error(
|
|
108455
108497
|
"物料不能为空"
|
|
@@ -108578,9 +108620,7 @@ class BomEntriesValidator {
|
|
|
108578
108620
|
* @return {*}
|
|
108579
108621
|
*/
|
|
108580
108622
|
mergeRowInArr(row, arr) {
|
|
108581
|
-
|
|
108582
|
-
this.validateInBom(row);
|
|
108583
|
-
}
|
|
108623
|
+
this.validateInBom(row);
|
|
108584
108624
|
const newArr = cloneDeep(arr).filter((i) => i.product_id_);
|
|
108585
108625
|
const util = this.findUtilByProductId(row.product_id_);
|
|
108586
108626
|
const sameIndex = findLastIndex(newArr, (i) => {
|
|
@@ -108732,12 +108772,12 @@ class MCDataUtil {
|
|
|
108732
108772
|
});
|
|
108733
108773
|
}
|
|
108734
108774
|
/**
|
|
108735
|
-
* [
|
|
108775
|
+
* 物料消耗模式 BOM 模式需要禁用[需求数量]
|
|
108736
108776
|
* 参顶部[物料消耗表字段控制]
|
|
108737
108777
|
* @param rowPath $.f_sub[n] n 必须为数字
|
|
108738
108778
|
*/
|
|
108739
|
-
static
|
|
108740
|
-
const fields2 = ["
|
|
108779
|
+
static disableQtyRequired(dataManager, rowPath) {
|
|
108780
|
+
const fields2 = ["qty_required_"];
|
|
108741
108781
|
this._updateDisablement({ dataManager, rowPath, fields: fields2, disabled: true });
|
|
108742
108782
|
}
|
|
108743
108783
|
/**
|
|
@@ -108775,6 +108815,7 @@ class MCDataUtil {
|
|
|
108775
108815
|
const { dataManager, subFieldKey, rowIndex } = option;
|
|
108776
108816
|
const rows = dataManager.getRawData()[subFieldKey] ?? [];
|
|
108777
108817
|
const row = rows[rowIndex];
|
|
108818
|
+
if (!row) return;
|
|
108778
108819
|
row.is_confirmed_ = isConfirmed;
|
|
108779
108820
|
rows[rowIndex] = row;
|
|
108780
108821
|
dataManager.set(subFieldKey, rows, "user");
|
|
@@ -108865,7 +108906,7 @@ class MaterialConsumeTableController {
|
|
|
108865
108906
|
return this.tableDataRef.value.filter((i) => !i.deleted_);
|
|
108866
108907
|
}
|
|
108867
108908
|
/**
|
|
108868
|
-
*
|
|
108909
|
+
* 修改表格数据(保留软删行在后缀)
|
|
108869
108910
|
*/
|
|
108870
108911
|
set actualTableData(value) {
|
|
108871
108912
|
const deletedArr = this.tableDataRef.value.filter((i) => i.deleted_);
|
|
@@ -108979,9 +109020,9 @@ class MaterialConsumeTableController {
|
|
|
108979
109020
|
qty_: data.qty,
|
|
108980
109021
|
validate_: data.expiration,
|
|
108981
109022
|
// 记录模式传null,后台就不校验了
|
|
108982
|
-
|
|
109023
|
+
bom_entries_: isRecordPattern ? null : this.actualBomEntries,
|
|
108983
109024
|
operation_id_: this.tmplBomController.operationId
|
|
108984
|
-
});
|
|
109025
|
+
}) || (isRecordPattern ? [{ productionIdentificationName: data.lot }] : null);
|
|
108985
109026
|
if (!arr) {
|
|
108986
109027
|
this.error(
|
|
108987
109028
|
"扫描的物料不存在或不在bom中"
|
|
@@ -108990,7 +109031,7 @@ class MaterialConsumeTableController {
|
|
|
108990
109031
|
return;
|
|
108991
109032
|
}
|
|
108992
109033
|
let materialData = arr[0];
|
|
108993
|
-
if (arr.length > 1) {
|
|
109034
|
+
if (arr.length > 1 && !isRecordPattern) {
|
|
108994
109035
|
const ids = this.actualTableData.map((i) => i.product_id_);
|
|
108995
109036
|
const find = arr.find((j2) => ids.includes(j2.materialId));
|
|
108996
109037
|
if (!find) {
|
|
@@ -109006,6 +109047,9 @@ class MaterialConsumeTableController {
|
|
|
109006
109047
|
qty_: data.qty,
|
|
109007
109048
|
is_confirmed_: false
|
|
109008
109049
|
};
|
|
109050
|
+
if (isRecordPattern && !row.product_id_) {
|
|
109051
|
+
row._scanFallback = true;
|
|
109052
|
+
}
|
|
109009
109053
|
if (this.scanRuleProps?.fillMapArr?.length) {
|
|
109010
109054
|
const fillData = calcFillData(data, this.scanRuleProps.fillMapArr);
|
|
109011
109055
|
console.log("fillData", fillData);
|
|
@@ -109014,18 +109058,18 @@ class MaterialConsumeTableController {
|
|
|
109014
109058
|
if (data.expiration) {
|
|
109015
109059
|
row.expiration_date_ = toDateOnly(data.expiration);
|
|
109016
109060
|
}
|
|
109017
|
-
this.setDefaultValue(row);
|
|
109061
|
+
this.setDefaultValue(row, option.doc);
|
|
109018
109062
|
try {
|
|
109019
109063
|
const newArr = this.bomEntriesValidator.mergeRowInArr(row, this.actualTableData);
|
|
109020
109064
|
await this.bomEntriesValidator.validateScanCanInsert(newArr);
|
|
109021
|
-
this.
|
|
109065
|
+
this.actualTableData = newArr;
|
|
109022
109066
|
setTimeout(async () => {
|
|
109023
109067
|
const row2 = this.actualTableData.find((i) => !i.is_confirmed_);
|
|
109024
109068
|
const rowIndex = this.actualTableData.findIndex((i) => !i.is_confirmed_);
|
|
109025
109069
|
const { doc, subFieldKey, subModelKey } = option;
|
|
109026
109070
|
await doc.dataManager.whenEmitSettled();
|
|
109027
109071
|
await hydrateSubtableRowLabels(doc, subFieldKey, [rowIndex]);
|
|
109028
|
-
if (row2) {
|
|
109072
|
+
if (row2 && row2.product_id_) {
|
|
109029
109073
|
this.confirm({ dataManager: doc.dataManager, subFieldKey, rowIndex }, subModelKey, doc);
|
|
109030
109074
|
}
|
|
109031
109075
|
});
|
|
@@ -109109,6 +109153,9 @@ class MaterialConsumeTableController {
|
|
|
109109
109153
|
const { dataManager, rowIndex, subFieldKey } = option;
|
|
109110
109154
|
const rows = dataManager.getRawData()[subFieldKey] ?? [];
|
|
109111
109155
|
const row = rows[rowIndex];
|
|
109156
|
+
if (!row.product_id_) {
|
|
109157
|
+
throw new Error("物料不能为空");
|
|
109158
|
+
}
|
|
109112
109159
|
this.validateExpiration(row);
|
|
109113
109160
|
} else {
|
|
109114
109161
|
await this.bomEntriesValidator.validate(this.actualTableData);
|
|
@@ -109226,15 +109273,15 @@ class MaterialConsumeTableController {
|
|
|
109226
109273
|
* - 删除行
|
|
109227
109274
|
*/
|
|
109228
109275
|
updateRowConsumed(doc) {
|
|
109229
|
-
const modifySingleRow = (
|
|
109230
|
-
const
|
|
109276
|
+
const modifySingleRow = (row, rowIndex) => {
|
|
109277
|
+
const fieldKey = `${this.subTableInfo.valuePath}[${rowIndex}].qty_consumed_`;
|
|
109231
109278
|
if (!row.product_id_) {
|
|
109232
|
-
row.
|
|
109279
|
+
doc.dataManager.set(fieldKey, row.qty_ ? Number(row.qty_) : "", "user");
|
|
109233
109280
|
return;
|
|
109234
109281
|
}
|
|
109235
109282
|
let total = 0;
|
|
109236
109283
|
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
109237
|
-
const beforeArr = this.actualTableData.slice(0,
|
|
109284
|
+
const beforeArr = this.actualTableData.slice(0, rowIndex + 1);
|
|
109238
109285
|
if (util) {
|
|
109239
109286
|
total += util.hasConsumed;
|
|
109240
109287
|
console.log("total", total);
|
|
@@ -109242,21 +109289,20 @@ class MaterialConsumeTableController {
|
|
|
109242
109289
|
filterGroupData.forEach((i) => {
|
|
109243
109290
|
total += Number(i.qty_ || 0) ?? 0;
|
|
109244
109291
|
});
|
|
109245
|
-
const fieldKey = `${this.subTableInfo.valuePath}[${index2}].qty_consumed_`;
|
|
109246
109292
|
doc.dataManager.set(fieldKey, total, "user");
|
|
109247
109293
|
}
|
|
109248
109294
|
};
|
|
109249
109295
|
setTimeout(() => {
|
|
109250
|
-
|
|
109251
|
-
modifySingleRow(
|
|
109252
|
-
}
|
|
109296
|
+
this.actualTableData.forEach((row, rowIndex) => {
|
|
109297
|
+
modifySingleRow(row, rowIndex);
|
|
109298
|
+
});
|
|
109253
109299
|
});
|
|
109254
109300
|
}
|
|
109255
109301
|
/**
|
|
109256
109302
|
* 设置默认值,如工序,需求数量/已消耗数量
|
|
109257
109303
|
* @param row
|
|
109258
109304
|
*/
|
|
109259
|
-
setDefaultValue(row) {
|
|
109305
|
+
setDefaultValue(row, doc) {
|
|
109260
109306
|
if (!row.routing_operation_id_) {
|
|
109261
109307
|
row.routing_operation_id_ = this.tmplBomController.operationId;
|
|
109262
109308
|
}
|
|
@@ -109268,6 +109314,7 @@ class MaterialConsumeTableController {
|
|
|
109268
109314
|
row.bom_entry_id_ = util.bomEntry.id_;
|
|
109269
109315
|
}
|
|
109270
109316
|
}
|
|
109317
|
+
this.updateRowConsumed(doc);
|
|
109271
109318
|
}
|
|
109272
109319
|
getDefaultValue(row) {
|
|
109273
109320
|
const value = {};
|
|
@@ -109298,6 +109345,10 @@ class MaterialConsumeTableController {
|
|
|
109298
109345
|
if (["product_id_", "material_no_"].includes(fieldKey)) {
|
|
109299
109346
|
const rowPath = `${parentFieldPath}[${dataIndex}]`;
|
|
109300
109347
|
if (fieldKey === "product_id_") {
|
|
109348
|
+
const row = doc.dataManager.get(rowPath);
|
|
109349
|
+
if (row._scanFallback) {
|
|
109350
|
+
return;
|
|
109351
|
+
}
|
|
109301
109352
|
const product_id_ = changedData[`${rowPath}.product_id_`];
|
|
109302
109353
|
const versionId = product_id_?.split(":").pop();
|
|
109303
109354
|
if (versionId) {
|
|
@@ -109487,9 +109538,13 @@ const syncMaterialConsumeTableBomInfo = async (templateId, docModel) => {
|
|
|
109487
109538
|
};
|
|
109488
109539
|
const initMaterialConsumeTableConfig = (doc, subConfig, tmplBomC) => {
|
|
109489
109540
|
if (!tmplBomC?.formInstBom?.formTmplBomList) return;
|
|
109490
|
-
const useBomMode = tmplBomC.defaultMCPattern === MaterialConsumptionPatternEnum.BOM;
|
|
109491
109541
|
tmplBomC.formInstBom.formTmplBomList.forEach(
|
|
109492
109542
|
({ personal_bom_enabled_, entries_, table_key_ }) => {
|
|
109543
|
+
const tableController = tmplBomC?.findTableControllerByField(table_key_);
|
|
109544
|
+
const useBomMode = tableController?.mcPattern === MaterialConsumptionPatternEnum.BOM;
|
|
109545
|
+
const subFieldKey = table_key_.replace("$.", "");
|
|
109546
|
+
const rows = doc.dataManager.getRawData()[subFieldKey] || [];
|
|
109547
|
+
const activeCount = rows.filter((row) => !row?.deleted_).length;
|
|
109493
109548
|
if (useBomMode) {
|
|
109494
109549
|
const entries = personal_bom_enabled_ ? entries_ : tmplBomC.bomEntries;
|
|
109495
109550
|
const includedIds = [];
|
|
@@ -109500,16 +109555,13 @@ const initMaterialConsumeTableConfig = (doc, subConfig, tmplBomC) => {
|
|
|
109500
109555
|
});
|
|
109501
109556
|
});
|
|
109502
109557
|
subConfig[`${table_key_}[n].product_id_`] = { "id_.in": includedIds };
|
|
109558
|
+
repeat(activeCount || 1, (index2) => {
|
|
109559
|
+
MCDataUtil.disableQtyRequired(doc.dataManager, `${table_key_}[${index2}]`);
|
|
109560
|
+
});
|
|
109503
109561
|
}
|
|
109504
|
-
const subFieldKey = table_key_.replace("$.", "");
|
|
109505
|
-
const rows = doc.dataManager.getRawData()[subFieldKey] || [];
|
|
109506
|
-
const rowCount = rows.length;
|
|
109507
|
-
repeat(rowCount || 1, (index2) => {
|
|
109508
|
-
MCDataUtil.disableQtyFields(doc.dataManager, `${table_key_}[${index2}]`);
|
|
109509
|
-
});
|
|
109510
109562
|
rows.forEach((row, rowIndex) => {
|
|
109563
|
+
if (row?.deleted_) return;
|
|
109511
109564
|
const rowPath = `${table_key_}[${rowIndex}]`;
|
|
109512
|
-
const tableController = tmplBomC?.findTableControllerByField(table_key_);
|
|
109513
109565
|
if (row.product_id_) {
|
|
109514
109566
|
const versionId = row.product_id_.split(":").pop();
|
|
109515
109567
|
if (versionId) {
|
|
@@ -109534,6 +109586,12 @@ const initMaterialConsumeTableConfig = (doc, subConfig, tmplBomC) => {
|
|
|
109534
109586
|
}
|
|
109535
109587
|
);
|
|
109536
109588
|
};
|
|
109589
|
+
const handleAllMCTablesMounted = (doc, tmplBomC) => {
|
|
109590
|
+
tmplBomC.formInstBom?.formTmplBomList?.forEach(({ table_key_ }) => {
|
|
109591
|
+
const tableController = tmplBomC.findTableControllerByField(table_key_);
|
|
109592
|
+
tableController?.updateRowConsumed(doc);
|
|
109593
|
+
});
|
|
109594
|
+
};
|
|
109537
109595
|
class DocRequestStrategy {
|
|
109538
109596
|
props;
|
|
109539
109597
|
payload;
|
|
@@ -110121,7 +110179,8 @@ class InitLoadEngine {
|
|
|
110121
110179
|
if (config.rowPatch) {
|
|
110122
110180
|
rows = rows.map((row) => ({ ...row, ...config.rowPatch }));
|
|
110123
110181
|
}
|
|
110124
|
-
this.
|
|
110182
|
+
const deletedRows = this.readExistingRows(subFieldKey).filter((row) => row.deleted_);
|
|
110183
|
+
this.doc.dataManager.set(subFieldKey, [...rows, ...deletedRows], "hydrate");
|
|
110125
110184
|
}
|
|
110126
110185
|
isEnabled(config, regionProps) {
|
|
110127
110186
|
if (config.enabled === true) return true;
|
|
@@ -110137,7 +110196,7 @@ class InitLoadEngine {
|
|
|
110137
110196
|
* @returns true-跳过,false-不跳过
|
|
110138
110197
|
*/
|
|
110139
110198
|
shouldSkip(subFieldKey, config) {
|
|
110140
|
-
const existingRows = this.readExistingRows(subFieldKey);
|
|
110199
|
+
const existingRows = this.readExistingRows(subFieldKey).filter((row) => !row.deleted_);
|
|
110141
110200
|
if (existingRows.length === 0) return false;
|
|
110142
110201
|
if (config.skipWhenNonemptyRows && this.hasNonemptyRow(existingRows)) {
|
|
110143
110202
|
return true;
|
|
@@ -110825,10 +110884,14 @@ function useDocumentFactory(props, payload) {
|
|
|
110825
110884
|
try {
|
|
110826
110885
|
const response = await runFetchDocument(newRequestId);
|
|
110827
110886
|
if (!response) return;
|
|
110828
|
-
if (response.tmplBomC) {
|
|
110829
|
-
tmplBomCRef.value = response.tmplBomC;
|
|
110830
|
-
}
|
|
110831
110887
|
await mountDocument(response);
|
|
110888
|
+
const { tmplBomC } = response;
|
|
110889
|
+
if (tmplBomC) {
|
|
110890
|
+
tmplBomCRef.value = tmplBomC;
|
|
110891
|
+
if (docIns.value) {
|
|
110892
|
+
handleAllMCTablesMounted(docIns.value, tmplBomC);
|
|
110893
|
+
}
|
|
110894
|
+
}
|
|
110832
110895
|
} catch (err) {
|
|
110833
110896
|
console.error(err);
|
|
110834
110897
|
}
|
|
@@ -111743,7 +111806,7 @@ function appendFillMapPayload(payload, parsed, parseRules, runtimeValuePath) {
|
|
|
111743
111806
|
for (const formField of mapItem?.formFields || []) {
|
|
111744
111807
|
const path = resolveTargetPath(runtimeValuePath, formField);
|
|
111745
111808
|
if (!path || path === runtimeValuePath) continue;
|
|
111746
|
-
Object.assign(payload, setValue
|
|
111809
|
+
Object.assign(payload, setValue(value, path));
|
|
111747
111810
|
}
|
|
111748
111811
|
}
|
|
111749
111812
|
}
|
|
@@ -111794,7 +111857,7 @@ async function submitDeviceScan(params) {
|
|
|
111794
111857
|
if (!row) {
|
|
111795
111858
|
return { ok: false, message: MSG_NO_DATA };
|
|
111796
111859
|
}
|
|
111797
|
-
const payload = setValue
|
|
111860
|
+
const payload = setValue(row.__VALUE__, runtimeValuePath);
|
|
111798
111861
|
appendFillMapPayload(payload, parsed, parseRules, runtimeValuePath);
|
|
111799
111862
|
return { ok: true, payload, record: row._item };
|
|
111800
111863
|
}
|
|
@@ -116336,18 +116399,15 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
|
|
|
116336
116399
|
};
|
|
116337
116400
|
const getTableRows = (subFieldKey, visible) => {
|
|
116338
116401
|
const rows = docInst.value.dataManager.getRawData()[subFieldKey] ?? [];
|
|
116339
|
-
|
|
116402
|
+
{
|
|
116340
116403
|
return rows.filter((row) => !row.deleted_);
|
|
116341
116404
|
}
|
|
116342
|
-
return rows;
|
|
116343
116405
|
};
|
|
116344
116406
|
const checkTargetRowThen = (cb) => {
|
|
116345
116407
|
const { dataManager } = docInst.value;
|
|
116346
|
-
const {
|
|
116347
|
-
|
|
116348
|
-
|
|
116349
|
-
allRows.splice(index2, 0, {});
|
|
116350
|
-
dataManager.set(subFieldKey, allRows, "user");
|
|
116408
|
+
const { path, index: index2 } = getCtx();
|
|
116409
|
+
if (!dataManager.get(`${path}[${index2}]`)) {
|
|
116410
|
+
dataManager.insertAt(path, index2, {});
|
|
116351
116411
|
}
|
|
116352
116412
|
setTimeout(cb);
|
|
116353
116413
|
};
|
|
@@ -116372,7 +116432,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
|
|
|
116372
116432
|
});
|
|
116373
116433
|
const actionInfo = computed(() => {
|
|
116374
116434
|
const { subFieldKey, index: index2 } = getCtx();
|
|
116375
|
-
const visibleRows = getTableRows(subFieldKey
|
|
116435
|
+
const visibleRows = getTableRows(subFieldKey);
|
|
116376
116436
|
const { isMaterialConsume, isWarehouseInventory, isWarehouseAllocate } = subTableType.value;
|
|
116377
116437
|
const canCopy = !isWarehouseInventory && !isWarehouseAllocate;
|
|
116378
116438
|
const canInsertMulti = !isMaterialConsume && !isWarehouseInventory && !isWarehouseAllocate;
|
|
@@ -116427,10 +116487,10 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
|
|
|
116427
116487
|
await changeWarehouseInventoryParseRule({ doc, subRenderer, subModelKey });
|
|
116428
116488
|
}
|
|
116429
116489
|
};
|
|
116430
|
-
const
|
|
116490
|
+
const getIsIncreasable = () => {
|
|
116431
116491
|
if (subTableType.value.isMaterialConsume) {
|
|
116432
116492
|
const { subFieldKey } = getCtx();
|
|
116433
|
-
const visibleRows = getTableRows(subFieldKey
|
|
116493
|
+
const visibleRows = getTableRows(subFieldKey);
|
|
116434
116494
|
const isAllConfirmed = visibleRows.length && visibleRows.every((row) => row.is_confirmed_);
|
|
116435
116495
|
if (!isAllConfirmed) {
|
|
116436
116496
|
GctMessage.error("同时只能有一条数据开启编辑状态");
|
|
@@ -116439,34 +116499,35 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
|
|
|
116439
116499
|
}
|
|
116440
116500
|
return true;
|
|
116441
116501
|
};
|
|
116442
|
-
const
|
|
116502
|
+
const handleRowIncreased = (subFieldKey, rowIndex) => {
|
|
116443
116503
|
if (subTableType.value.isMaterialConsume) {
|
|
116444
|
-
|
|
116504
|
+
mcTableCtrl.value?.updateRowConsumed(props.doc);
|
|
116505
|
+
if (mcTableCtrl.value?.mcPattern === MaterialConsumptionPatternEnum.BOM) {
|
|
116506
|
+
MCDataUtil.disableQtyRequired(props.doc.dataManager, `$.${subFieldKey}[${rowIndex}]`);
|
|
116507
|
+
}
|
|
116445
116508
|
}
|
|
116446
116509
|
new TableRuntime(props.doc).onRowInit(subFieldKey, rowIndex);
|
|
116447
116510
|
};
|
|
116448
116511
|
const insertRows = (index2, count = 1) => {
|
|
116449
|
-
if (!
|
|
116512
|
+
if (!getIsIncreasable()) return;
|
|
116450
116513
|
const { path, subFieldKey } = getCtx();
|
|
116451
116514
|
props.doc.dataManager.insertAt(path, index2, ...Array.from({ length: count }, () => ({})));
|
|
116452
|
-
|
|
116453
|
-
};
|
|
116454
|
-
const removeRow = () => {
|
|
116455
|
-
const { path, index: index2 } = getCtx();
|
|
116456
|
-
props.doc.dataManager.removeAt(path, index2);
|
|
116457
|
-
mcTableCtrl.value?.updateRowConsumed(props.doc);
|
|
116515
|
+
handleRowIncreased(subFieldKey, index2);
|
|
116458
116516
|
};
|
|
116459
116517
|
const copyRow = () => {
|
|
116460
|
-
if (!
|
|
116518
|
+
if (!getIsIncreasable()) return;
|
|
116461
116519
|
const { path, index: index2, subFieldKey } = getCtx();
|
|
116462
|
-
|
|
116463
|
-
let data = props.doc.dataManager.get(`${path}[${storageIndex}]`) || {};
|
|
116520
|
+
let data = props.doc.dataManager.get(`${path}[${index2}]`) || {};
|
|
116464
116521
|
data = omit(data, "id_");
|
|
116465
116522
|
if (subTableType.value.isMaterialConsume) {
|
|
116466
116523
|
data = omit(data, "is_confirmed_");
|
|
116467
116524
|
}
|
|
116468
116525
|
props.doc.dataManager.insertAt(path, index2 + 1, data);
|
|
116469
|
-
|
|
116526
|
+
handleRowIncreased(subFieldKey, index2 + 1);
|
|
116527
|
+
};
|
|
116528
|
+
const removeRow = () => {
|
|
116529
|
+
const { path, index: index2 } = getCtx();
|
|
116530
|
+
props.doc.dataManager.removeAt(path, index2);
|
|
116470
116531
|
mcTableCtrl.value?.updateRowConsumed(props.doc);
|
|
116471
116532
|
};
|
|
116472
116533
|
const actionHandlers = {
|
|
@@ -116686,7 +116747,7 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
|
|
|
116686
116747
|
};
|
|
116687
116748
|
}
|
|
116688
116749
|
});
|
|
116689
|
-
const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2T, [["__scopeId", "data-v-
|
|
116750
|
+
const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$2T, [["__scopeId", "data-v-923a27bd"]]);
|
|
116690
116751
|
const _sfc_main$2S = /* @__PURE__ */ defineComponent({
|
|
116691
116752
|
__name: "index",
|
|
116692
116753
|
props: {
|
|
@@ -125381,7 +125442,7 @@ const _sfc_main$2c = /* @__PURE__ */ defineComponent({
|
|
|
125381
125442
|
return getValue$1(value, isMultiple.value);
|
|
125382
125443
|
},
|
|
125383
125444
|
set(v) {
|
|
125384
|
-
const data = setValue
|
|
125445
|
+
const data = setValue(v, runtimeValuePath.value, {
|
|
125385
125446
|
multiple: isMultiple.value
|
|
125386
125447
|
});
|
|
125387
125448
|
docInst.value?.dataManager.setMultiple(data, "user");
|
|
@@ -139658,7 +139719,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
139658
139719
|
emitChange(value);
|
|
139659
139720
|
}
|
|
139660
139721
|
function emitChange(value) {
|
|
139661
|
-
const data = setValue
|
|
139722
|
+
const data = setValue(value, runtimeValuePath.value, {
|
|
139662
139723
|
multiple: props.isMultiple
|
|
139663
139724
|
});
|
|
139664
139725
|
emit("change", data);
|
|
@@ -139955,7 +140016,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
139955
140016
|
emitChange(null);
|
|
139956
140017
|
}
|
|
139957
140018
|
function emitChange(value) {
|
|
139958
|
-
const data = setValue
|
|
140019
|
+
const data = setValue(value, runtimeValuePath.value, {
|
|
139959
140020
|
multiple: props.isMultiple
|
|
139960
140021
|
});
|
|
139961
140022
|
emit("change", data);
|
|
@@ -140043,7 +140104,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
140043
140104
|
() => isDateTime.value ? resolveDateTimePickerTimeFormat(widgetProps.value) : void 0
|
|
140044
140105
|
);
|
|
140045
140106
|
function onPanelChange(v) {
|
|
140046
|
-
const data = setValue
|
|
140107
|
+
const data = setValue(
|
|
140047
140108
|
v ? formatDateTimeForStorage(v, storageFormat.value, pickerTimeFormat.value) : v,
|
|
140048
140109
|
runtimeValuePath.value
|
|
140049
140110
|
);
|
|
@@ -140082,7 +140143,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
140082
140143
|
const pickerFormat = computed(() => resolveTimePickerFormat(widgetProps.value));
|
|
140083
140144
|
function onPanelChange(timeObj) {
|
|
140084
140145
|
const value = timeObj.value == null ? timeObj.value : completeTimeValue(timeObj.value);
|
|
140085
|
-
const data = setValue
|
|
140146
|
+
const data = setValue(value, runtimeValuePath.value);
|
|
140086
140147
|
emit("change", data);
|
|
140087
140148
|
}
|
|
140088
140149
|
return (_ctx, _cache) => {
|
|
@@ -140555,7 +140616,7 @@ function useTableDropdown(props, searchFilters) {
|
|
|
140555
140616
|
const columns2 = computed(() => getColumns(strategy.value.columnsKey, strategy.value.isTree));
|
|
140556
140617
|
const selectedId = computed(() => {
|
|
140557
140618
|
if (!runtimeValuePath.value) return void 0;
|
|
140558
|
-
const id = docInst.value.dataManager.get(getIdPath
|
|
140619
|
+
const id = docInst.value.dataManager.get(getIdPath(runtimeValuePath.value));
|
|
140559
140620
|
return id != null && id !== "" ? String(id) : void 0;
|
|
140560
140621
|
});
|
|
140561
140622
|
const businessLinkage = computed(
|
|
@@ -140647,11 +140708,8 @@ function useTableDropdown(props, searchFilters) {
|
|
|
140647
140708
|
const valuePath = fieldMeta.value?.valuePath;
|
|
140648
140709
|
const subFieldConfig = getSubFieldConfig(docInst.value.paramsConfig);
|
|
140649
140710
|
const extraParams = subFieldConfig.get(valuePath);
|
|
140650
|
-
|
|
140651
|
-
|
|
140652
|
-
const _valuePath = valuePath.replace("[n]", `[${dataIndex}]`);
|
|
140653
|
-
const subParams = subFieldConfig.get(_valuePath);
|
|
140654
|
-
Object.assign(extraParams, subParams);
|
|
140711
|
+
if (runtimeValuePath.value) {
|
|
140712
|
+
Object.assign(extraParams, subFieldConfig.get(runtimeValuePath.value));
|
|
140655
140713
|
}
|
|
140656
140714
|
const { queryData = {}, exp = "" } = buildQuery?.({
|
|
140657
140715
|
keyword,
|
|
@@ -140782,10 +140840,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
140782
140840
|
row?._item?.id_,
|
|
140783
140841
|
{ persistOptionId: persistOptionId.value }
|
|
140784
140842
|
);
|
|
140785
|
-
if (persistOptionId.value) {
|
|
140786
|
-
const idPath = getIdPath(runtimeValuePath.value);
|
|
140787
|
-
Object.assign(data, setValue(row?._item?.id_ ?? void 0, idPath));
|
|
140788
|
-
}
|
|
140789
140843
|
if (clearValuePath.value) {
|
|
140790
140844
|
Object.assign(data, buildFieldSelectUpdates(clearValuePath.value, void 0));
|
|
140791
140845
|
}
|
|
@@ -140978,7 +141032,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
140978
141032
|
showValue = value;
|
|
140979
141033
|
}
|
|
140980
141034
|
}
|
|
140981
|
-
const data = setValue
|
|
141035
|
+
const data = setValue(showValue, runtimeValuePath.value);
|
|
140982
141036
|
emit("change", data, __DEFAULT__ ? __DEFAULT__._item : row?._item);
|
|
140983
141037
|
};
|
|
140984
141038
|
__expose({
|
|
@@ -141389,7 +141443,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
141389
141443
|
GctMessage.warning("请等待附件上传完成后再点击确定");
|
|
141390
141444
|
return;
|
|
141391
141445
|
}
|
|
141392
|
-
return setValue
|
|
141446
|
+
return setValue(innerValue.value, runtimeValuePath.value);
|
|
141393
141447
|
}
|
|
141394
141448
|
function cancelUploading() {
|
|
141395
141449
|
uploadRef.value?.cancelUploading?.();
|
|
@@ -141717,7 +141771,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
141717
141771
|
GctMessage.warning("请等待图片上传完成后再点击确定");
|
|
141718
141772
|
return;
|
|
141719
141773
|
}
|
|
141720
|
-
return setValue
|
|
141774
|
+
return setValue(innerValue.value, runtimeValuePath.value);
|
|
141721
141775
|
}
|
|
141722
141776
|
function cancelUploading() {
|
|
141723
141777
|
uploadRef.value?.cancelUploading?.();
|
|
@@ -142002,7 +142056,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
142002
142056
|
const persistSignatures = () => {
|
|
142003
142057
|
const list = signatureList.value.map(({ displaySrc: _2, ...item }) => item);
|
|
142004
142058
|
const data = list.length ? JSON.stringify(list) : void 0;
|
|
142005
|
-
return setValue
|
|
142059
|
+
return setValue(data, runtimeValuePath.value);
|
|
142006
142060
|
};
|
|
142007
142061
|
const validateAll = async () => {
|
|
142008
142062
|
clearErrors();
|
package/dist/runtime/canvas/table/render/material-consume/material-consume-table-controller.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface UpdateRowOption {
|
|
|
22
22
|
* - [有效期、唯一标识、自定义字段] 始终可填(不做控制)
|
|
23
23
|
* - 选择的物料类型是[查看物料]时 [批次、上料数量、工序] 只读
|
|
24
24
|
* - 单行校验通过后(包括暂存后再次编辑)[物料、批次、上料数量、工序、需求数量单位、数量单位、转换后数量、转换数量单位ID、单位转化公式] 只读
|
|
25
|
+
* v2026.7.30
|
|
26
|
+
* - [物料消耗模式]是[记录模式]时,可以填写[需求数量](BOM 模式禁用 需求数量)
|
|
25
27
|
*/
|
|
26
28
|
export declare class MCDataUtil {
|
|
27
29
|
/**
|
|
@@ -37,11 +39,11 @@ export declare class MCDataUtil {
|
|
|
37
39
|
*/
|
|
38
40
|
private static _updateDisablement;
|
|
39
41
|
/**
|
|
40
|
-
* [
|
|
42
|
+
* 物料消耗模式 BOM 模式需要禁用[需求数量]
|
|
41
43
|
* 参顶部[物料消耗表字段控制]
|
|
42
44
|
* @param rowPath $.f_sub[n] n 必须为数字
|
|
43
45
|
*/
|
|
44
|
-
static
|
|
46
|
+
static disableQtyRequired(dataManager: DataManager, rowPath: string): void;
|
|
45
47
|
/**
|
|
46
48
|
* 物料类型 是否选择[查看物料]时,需要更新指定字段是否禁用
|
|
47
49
|
* 参顶部[物料消耗表字段控制]
|
|
@@ -112,7 +114,7 @@ export declare class MaterialConsumeTableController {
|
|
|
112
114
|
*/
|
|
113
115
|
get actualTableData(): IMaterialConsumeData[];
|
|
114
116
|
/**
|
|
115
|
-
*
|
|
117
|
+
* 修改表格数据(保留软删行在后缀)
|
|
116
118
|
*/
|
|
117
119
|
set actualTableData(value: IMaterialConsumeData[]);
|
|
118
120
|
constructor(tmplBomController: FormTmplBomController, tmplBom: IFormTmplBom);
|
|
@@ -237,7 +239,7 @@ export declare class MaterialConsumeTableController {
|
|
|
237
239
|
* 设置默认值,如工序,需求数量/已消耗数量
|
|
238
240
|
* @param row
|
|
239
241
|
*/
|
|
240
|
-
setDefaultValue(row: IMaterialConsumeData): void;
|
|
242
|
+
setDefaultValue(row: IMaterialConsumeData, doc: Doc): void;
|
|
241
243
|
getDefaultValue(row: IMaterialConsumeData): any;
|
|
242
244
|
/**
|
|
243
245
|
* 处理[物料消耗表]下拉字段变更
|
|
@@ -2,10 +2,15 @@ import { Doc } from '../../../../../core';
|
|
|
2
2
|
import { DocModel } from '../../../../../core/model';
|
|
3
3
|
import { FormTmplBomController } from './tmpl-bom-controller';
|
|
4
4
|
/**
|
|
5
|
-
* 同步[物料消耗表] formTmplBomList
|
|
5
|
+
* 同步[物料消耗表] formTmplBomList 信息到 widgetProps 上
|
|
6
|
+
* 因为 formTmplBomList 有独立存取接口
|
|
6
7
|
*/
|
|
7
8
|
export declare const syncMaterialConsumeTableBomInfo: (templateId: string, docModel: DocModel) => Promise<void>;
|
|
8
9
|
/**
|
|
9
10
|
* 处理表单实例上的[物料消耗表]相关配置
|
|
10
11
|
*/
|
|
11
12
|
export declare const initMaterialConsumeTableConfig: (doc: Doc, subConfig: Record<string, any>, tmplBomC?: FormTmplBomController) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 文档加载完毕后,处理所有[物料消耗表]已消耗数量累加计算
|
|
15
|
+
*/
|
|
16
|
+
export declare const handleAllMCTablesMounted: (doc: Doc, tmplBomC: FormTmplBomController) => void;
|
|
@@ -10,6 +10,8 @@ type AutofillApplyOptions = {
|
|
|
10
10
|
rowIndexes?: number[];
|
|
11
11
|
};
|
|
12
12
|
export declare function applyAutofillRules(record: Record<string, unknown>, autofillRules: AutofillRule[], opts?: AutofillApplyOptions): Record<string, unknown>;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* 子表插行 / 行初始化:从主表规则补默认值
|
|
15
|
+
*/
|
|
14
16
|
export declare function applyAutofillOnSubTableRowInit(doc: Doc, subFieldKey: string, rowIndex: number, fetchSource?: (field: FieldDataBindingMeta, context: Record<string, unknown>) => Promise<unknown>): Promise<void>;
|
|
15
17
|
export {};
|
package/dist/word.css
CHANGED
|
@@ -9124,20 +9124,20 @@ textarea[data-v-2de31883]::placeholder {
|
|
|
9124
9124
|
.table-action .row-headers .row-header:last-child .row-add-btn[data-v-c40eef9f] .gct-icon.bottom {
|
|
9125
9125
|
transform: translateY(-100%);
|
|
9126
9126
|
}
|
|
9127
|
-
.sub-table-action-container[data-v-
|
|
9127
|
+
.sub-table-action-container[data-v-923a27bd] {
|
|
9128
9128
|
position: absolute;
|
|
9129
9129
|
z-index: 999;
|
|
9130
9130
|
}
|
|
9131
|
-
.sub-table-action-bar[data-v-
|
|
9132
|
-
.sub-table-action-popper[data-v-
|
|
9131
|
+
.sub-table-action-bar[data-v-923a27bd],
|
|
9132
|
+
.sub-table-action-popper[data-v-923a27bd] {
|
|
9133
9133
|
pointer-events: auto;
|
|
9134
9134
|
user-select: none;
|
|
9135
9135
|
}
|
|
9136
|
-
.sub-table-action-bar[data-v-
|
|
9136
|
+
.sub-table-action-bar[data-v-923a27bd] {
|
|
9137
9137
|
display: flex;
|
|
9138
9138
|
}
|
|
9139
|
-
.sub-table-action-bar .more-btn[data-v-
|
|
9140
|
-
.sub-table-action-bar .confirm-btn[data-v-
|
|
9139
|
+
.sub-table-action-bar .more-btn[data-v-923a27bd],
|
|
9140
|
+
.sub-table-action-bar .confirm-btn[data-v-923a27bd] {
|
|
9141
9141
|
display: flex;
|
|
9142
9142
|
justify-content: center;
|
|
9143
9143
|
align-items: center;
|
|
@@ -9146,44 +9146,44 @@ textarea[data-v-2de31883]::placeholder {
|
|
|
9146
9146
|
cursor: pointer;
|
|
9147
9147
|
box-sizing: border-box;
|
|
9148
9148
|
}
|
|
9149
|
-
.sub-table-action-bar .more-btn[data-v-
|
|
9149
|
+
.sub-table-action-bar .more-btn[data-v-923a27bd] {
|
|
9150
9150
|
width: 10px;
|
|
9151
9151
|
background: #026ac8;
|
|
9152
9152
|
border-radius: 0 4px 4px 0;
|
|
9153
9153
|
}
|
|
9154
|
-
.sub-table-action-bar .confirm-btn[data-v-
|
|
9154
|
+
.sub-table-action-bar .confirm-btn[data-v-923a27bd] {
|
|
9155
9155
|
margin-left: 4px;
|
|
9156
9156
|
border-radius: 4px;
|
|
9157
9157
|
border: 1px solid #4ec262;
|
|
9158
9158
|
}
|
|
9159
|
-
.sub-table-action-popper[data-v-
|
|
9159
|
+
.sub-table-action-popper[data-v-923a27bd] {
|
|
9160
9160
|
padding: 2px 8px;
|
|
9161
9161
|
}
|
|
9162
|
-
.sub-table-action-popper .action-menu[data-v-
|
|
9162
|
+
.sub-table-action-popper .action-menu[data-v-923a27bd] {
|
|
9163
9163
|
padding: 4px 0;
|
|
9164
9164
|
width: 220px;
|
|
9165
9165
|
user-select: none;
|
|
9166
9166
|
}
|
|
9167
|
-
.sub-table-action-popper .action-menu + .action-menu[data-v-
|
|
9167
|
+
.sub-table-action-popper .action-menu + .action-menu[data-v-923a27bd] {
|
|
9168
9168
|
margin-top: 4px;
|
|
9169
9169
|
padding-top: 4px;
|
|
9170
9170
|
border-top: 1px solid #efefef;
|
|
9171
9171
|
}
|
|
9172
|
-
.sub-table-action-popper .action-menu .menu-title[data-v-
|
|
9172
|
+
.sub-table-action-popper .action-menu .menu-title[data-v-923a27bd] {
|
|
9173
9173
|
color: #bcbcbc;
|
|
9174
9174
|
margin: 4px 0;
|
|
9175
9175
|
}
|
|
9176
|
-
.sub-table-action-popper .action-menu .menu-item[data-v-
|
|
9176
|
+
.sub-table-action-popper .action-menu .menu-item[data-v-923a27bd] {
|
|
9177
9177
|
display: flex;
|
|
9178
9178
|
align-items: center;
|
|
9179
9179
|
padding: 8px 10px;
|
|
9180
9180
|
border-radius: 4px;
|
|
9181
9181
|
}
|
|
9182
|
-
.sub-table-action-popper .action-menu .menu-item[data-v-
|
|
9182
|
+
.sub-table-action-popper .action-menu .menu-item[data-v-923a27bd]:hover {
|
|
9183
9183
|
cursor: pointer;
|
|
9184
9184
|
background-color: #f2f5f8;
|
|
9185
9185
|
}
|
|
9186
|
-
.sub-table-action-popper .action-menu .menu-item .item-icon[data-v-
|
|
9186
|
+
.sub-table-action-popper .action-menu .menu-item .item-icon[data-v-923a27bd] {
|
|
9187
9187
|
display: flex;
|
|
9188
9188
|
align-items: center;
|
|
9189
9189
|
justify-content: start;
|
|
@@ -9191,14 +9191,14 @@ textarea[data-v-2de31883]::placeholder {
|
|
|
9191
9191
|
width: 20px;
|
|
9192
9192
|
height: 20px;
|
|
9193
9193
|
}
|
|
9194
|
-
.sub-table-action-popper .action-menu .menu-item .item-icon.scale-large[data-v-
|
|
9194
|
+
.sub-table-action-popper .action-menu .menu-item .item-icon.scale-large[data-v-923a27bd] {
|
|
9195
9195
|
transform: scale(1.5);
|
|
9196
9196
|
}
|
|
9197
|
-
.sub-table-action-popper .action-menu .menu-item .item-label[data-v-
|
|
9197
|
+
.sub-table-action-popper .action-menu .menu-item .item-label[data-v-923a27bd] {
|
|
9198
9198
|
flex-grow: 1;
|
|
9199
9199
|
margin-left: 8px;
|
|
9200
9200
|
}
|
|
9201
|
-
.sub-table-action-popper .action-menu .menu-item .item-label.flex-between-center[data-v-
|
|
9201
|
+
.sub-table-action-popper .action-menu .menu-item .item-label.flex-between-center[data-v-923a27bd] {
|
|
9202
9202
|
display: flex;
|
|
9203
9203
|
justify-content: space-between;
|
|
9204
9204
|
align-items: center;
|