@gct-paas/word 1.0.3-beta.1 → 1.0.3-beta.2
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/chunks/{sdk-D9n5KeaD.js → sdk-DaWE1Ttf.js} +14 -5
- package/dist/chunks/{sdk-D9n5KeaD.js.map → sdk-DaWE1Ttf.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/types/adapters/platform/reference-policies.d.ts +3 -1
- package/dist/vue.js +115 -106
- package/dist/vue.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as snapshotPageWidgetDragDefinition, B as designRegionTypes, Bn as assertLayoutTextMeasurement, Cn as isEmptyDataValue, Ct as isSealPosition, Dn as readDataValueInput, E as snapshotSealDefinition, En as isUninitializedDataValue, Fn as layoutImageSourceKey, In as LayoutContractError, J as sameBusinessField, Kt as resourceName, On as wordClipboardType, S as sameFieldOptionInput, Sn as isClosedDataContainer, Tn as isRequiredDataValueMissing, V as designRegionVariants, Yt as validateResourceFiles, _n as dataValueIssuesFromError, _t as millimetersToLayoutPx, an as normalizeDataBoolean, bn as classifyDataValue, cn as encodeDataCollection, dn as resolveDataDefaultFrom, et as TextFlowError, fn as resolveDataDisplay, ft as LAYOUT_MILLIMETERS_PER_INCH, gn as assertValidDataValue, gt as layoutPxToPoints, h as sameFieldSignatureInput, hn as DataValueError, ht as layoutPxToMillimeters, in as encodeDataFieldValue, k as snapshotFieldDragDefinition, ln as emptyDataValue, mn as shouldInitializeDataValue, mt as LAYOUT_POINTS_PER_INCH, nn as dataParameterNumberKind, on as normalizeDataParameterNumber, pn as resolveDataValueUpdate, pt as LAYOUT_PIXELS_PER_INCH, qt as resourceUrl, r as sameFieldTextInput, rn as encodeDataChoice, sn as readDataBoolean, t as nativeTableRowBatchLimit, tn as assertDataNumberPrecision, un as resolveDataDefault, vn as findInvalidDataNumbers, vt as pointsToLayoutPx, wn as isInvalidDataNumber, wt as parseSealValue, x as sameFieldChoiceInput, xn as dataValueState, yn as invalidDataNumberText } from "./chunks/types-CzOaf1gP.js";
|
|
2
2
|
import { n as invertPositionMaps, r as mapTextPosition, t as invertOperation } from "./chunks/change-set-DgfKTJ6d.js";
|
|
3
|
-
import { $ as shouldInitializeDocumentData, A as NativeMaterialSelection, C as NativeReferenceScopeError, Ct as compareFieldConfigurations, Dt as LayoutSessionError, Et as LayoutSession, Ft as viewportPointToPage, G as attachNativeDataSources, H as nativeSourceWorkerCode, I as NativeInspectionInitialization, It as viewportRectToPage, L as NativeResources, M as NativeMaterialObjects, Mt as UnsupportedLayoutError, N as NativeMaterialInitialization, Nt as pagePointToViewport, Ot as LayoutQuery, Pt as pageRectToViewport, Q as isUninitialized, R as NativeFieldFills, S as NativeReferences, St as compareDocumentContent, U as runNativeSourceScript, W as NativeDataSources, X as NativeSourceError, Z as hasPersistedDocumentData, a as NativeDataServices, at as NativeDataRuntime, b as NativeSignatures, bt as combineSessionSignals, ct as DataManager, d as NativeValidator, dt as NativeTableQuickFill, et as NativeDataInitializer, f as attachNativeValidator, ft as nativeQuickFillLimit, g as createNativeSubmissionData, ht as EditorController, i as attachSessionLayout, it as attachNativeParameterInitializer, k as NativeMaterials, kt as DocumentLayoutBuilder, lt as NativeBusinessTables, m as attachNativeSubmissionCoordinator, mt as attachNativeInteraction, n as NativeLayoutPresentation, nt as attachNativeDataInitializer, o as attachNativeDataServices, ot as attachNativeDataRuntime, p as NativeSubmissionCoordinator, rt as NativeParameterInitializer, s as NativeBusinessFields, st as NativeDataQuery, t as attachNativeLayout, tt as NativeInitializationQueryError, u as attachSessionData, ut as NativeTableScan, w as validateNativeReference, wt as validateTemplateSave, x as NativeSeals, xt as DocumentSession, y as validateNativeSignatures, z as attachNativeFieldFills } from "./chunks/sdk-
|
|
3
|
+
import { $ as shouldInitializeDocumentData, A as NativeMaterialSelection, C as NativeReferenceScopeError, Ct as compareFieldConfigurations, Dt as LayoutSessionError, Et as LayoutSession, Ft as viewportPointToPage, G as attachNativeDataSources, H as nativeSourceWorkerCode, I as NativeInspectionInitialization, It as viewportRectToPage, L as NativeResources, M as NativeMaterialObjects, Mt as UnsupportedLayoutError, N as NativeMaterialInitialization, Nt as pagePointToViewport, Ot as LayoutQuery, Pt as pageRectToViewport, Q as isUninitialized, R as NativeFieldFills, S as NativeReferences, St as compareDocumentContent, U as runNativeSourceScript, W as NativeDataSources, X as NativeSourceError, Z as hasPersistedDocumentData, a as NativeDataServices, at as NativeDataRuntime, b as NativeSignatures, bt as combineSessionSignals, ct as DataManager, d as NativeValidator, dt as NativeTableQuickFill, et as NativeDataInitializer, f as attachNativeValidator, ft as nativeQuickFillLimit, g as createNativeSubmissionData, ht as EditorController, i as attachSessionLayout, it as attachNativeParameterInitializer, k as NativeMaterials, kt as DocumentLayoutBuilder, lt as NativeBusinessTables, m as attachNativeSubmissionCoordinator, mt as attachNativeInteraction, n as NativeLayoutPresentation, nt as attachNativeDataInitializer, o as attachNativeDataServices, ot as attachNativeDataRuntime, p as NativeSubmissionCoordinator, rt as NativeParameterInitializer, s as NativeBusinessFields, st as NativeDataQuery, t as attachNativeLayout, tt as NativeInitializationQueryError, u as attachSessionData, ut as NativeTableScan, w as validateNativeReference, wt as validateTemplateSave, x as NativeSeals, xt as DocumentSession, y as validateNativeSignatures, z as attachNativeFieldFills } from "./chunks/sdk-DaWE1Ttf.js";
|
|
4
4
|
import { B as number, H as oneOf, O as boolean, R as nonempty, S as array, U as optional, V as object, W as optionalConfig, X as record, Y as positive, a as validateFragment, l as fieldSchemas, nt as tagged, o as ConfigRegistry, p as ModelEditError, t as validateDocument, tt as string, u as tableVariantSchemas, z as nullable } from "./chunks/validation-DkCy8wHI.js";
|
|
5
5
|
import { f as validateChangeSet, m as serializeFragment, p as readFragment, t as ModelEditor } from "./chunks/ModelEditor-DqavEAJg.js";
|
|
6
6
|
import { c as DocumentValidationError, d as serializeDocument, l as parseDocument, t as NodeFactory, u as readDocument } from "./chunks/NodeFactory-DzFnWaWf.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Binding } from '../../model';
|
|
2
2
|
import type { NativeReferenceContext } from '../../sdk';
|
|
3
|
+
/** 业务字段已有固定来源,不要求模板另配普通关联的目标模型。 */
|
|
4
|
+
export declare function businessReferenceModel(source: Readonly<Binding['source']>): string | undefined;
|
|
3
5
|
export declare function referenceBusinessType(context: NativeReferenceContext): string;
|
|
4
6
|
export declare function lotSelection(context: NativeReferenceContext): boolean;
|
|
5
7
|
/** 字段固有查询条件不保存为可被模板改写的用户筛选。 */
|
package/dist/vue.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as getGctFieldIcon, c as getGctBusinessFieldType, i as readGctModelMe
|
|
|
2
2
|
import { a as icon_default, i as PopperWrapper, n as DialogActionButton_default, o as button_default, r as tooltip_default, s as _plugin_vue_export_helper_default, t as GctModal } from "./chunks/src-BFXPGLus.js";
|
|
3
3
|
import { Lt as isMaterialLotBinding, Rt as isNamedLotBinding, V as designRegionVariants, Xt as commonFieldDeclaration, et as TextFlowError, t as nativeTableRowBatchLimit, z as designRegionLabel } from "./chunks/types-CzOaf1gP.js";
|
|
4
4
|
import { A as readWordErrorText, B as inputScreenRect, D as FieldInputBlockedError, F as openImageViewer, G as loadBrowserImage, H as viewportClip, I as clipInputRect, J as NativeFontResources, K as CanvasImageResources, L as inputPageLocation, M as revealInputRect, N as ResourceFileSizes, O as isWordCancellation, P as resourceFileIcon, R as inputPointerRequest, S as attachCanvasBusinessTablePanel, U as paintPage, V as CanvasPages, W as paintSignatureGraphic, X as browserAbortable, Z as CanvasTextMeasurer, a as attachCanvasFieldDesignPanel, b as attachCanvasValidationPanel, c as attachCanvasTableDesignPanel, d as attachCanvasFieldCatalogPanel, g as attachCanvasObjectHandles, h as fieldSettingControls, j as wordPanelErrorText, k as isWordValidationError, n as CanvasBusinessTableActions, o as attachCanvasRegionDesignPanel, q as layoutImages, r as attachCanvasMaterialsPanel, t as CanvasMaterialTableActions, u as attachCanvasFormatPanel, v as attachCanvasFieldDrag, x as attachCanvasTextInput, z as inputScreenPages } from "./chunks/browser-DkEIriBA.js";
|
|
5
|
-
import { At as clippedFrame, B as logicalFillPath, C as NativeReferenceScopeError, D as materialAutofillRegions, E as tableSelectionKind, F as nativeProductReference, H as nativeSourceWorkerCode, J as sourceParameters, K as copySourceValue, Lt as runtimeRequest, O as productAutofillDetails, P as materialProductMatches, St as compareDocumentContent, T as inventorySelection, Tt as isRecord, U as runNativeSourceScript, V as subtableFillColumn, Y as sourceProperty, _ as CHECK_TABLE_TYPE_TO_VALUE_FIELD, _t as resizedDesignColumnWidth, c as businessNumberMinimum, gt as NestedTableInsertionError, h as allocationNotices, j as getInvalidMaterialLotReason, jt as signatureGraphic, l as businessTableFieldDefaults, mt as attachNativeInteraction, o as attachNativeDataServices, pt as isDerivedDataPath, q as sourceResult, r as choiceSpacingDefaults, t as attachNativeLayout, u as attachSessionData, v as isSubmitExcludedKey, vt as MissingSubTableHeaderTargetError, wt as validateTemplateSave, xt as DocumentSession, yt as FieldPlacementError } from "./chunks/sdk-
|
|
5
|
+
import { At as clippedFrame, B as logicalFillPath, C as NativeReferenceScopeError, D as materialAutofillRegions, E as tableSelectionKind, F as nativeProductReference, H as nativeSourceWorkerCode, J as sourceParameters, K as copySourceValue, Lt as runtimeRequest, O as productAutofillDetails, P as materialProductMatches, St as compareDocumentContent, T as inventorySelection, Tt as isRecord, U as runNativeSourceScript, V as subtableFillColumn, Y as sourceProperty, _ as CHECK_TABLE_TYPE_TO_VALUE_FIELD, _t as resizedDesignColumnWidth, c as businessNumberMinimum, gt as NestedTableInsertionError, h as allocationNotices, j as getInvalidMaterialLotReason, jt as signatureGraphic, l as businessTableFieldDefaults, mt as attachNativeInteraction, o as attachNativeDataServices, pt as isDerivedDataPath, q as sourceResult, r as choiceSpacingDefaults, t as attachNativeLayout, u as attachSessionData, v as isSubmitExcludedKey, vt as MissingSubTableHeaderTargetError, wt as validateTemplateSave, xt as DocumentSession, yt as FieldPlacementError } from "./chunks/sdk-DaWE1Ttf.js";
|
|
6
6
|
import { c as DocumentValidationError, l as parseDocument, u as readDocument } from "./chunks/NodeFactory-DzFnWaWf.js";
|
|
7
7
|
import { g as parseValuePath, r as collectDataLockFields, s as containsRectangle, t as ModelEditor } from "./chunks/ModelEditor-DqavEAJg.js";
|
|
8
8
|
import { u as createUuid$1 } from "./chunks/change-set-DgfKTJ6d.js";
|
|
@@ -35362,6 +35362,107 @@ async function encodeGctWordTemplateBusiness(document, savedBoms, signal) {
|
|
|
35362
35362
|
editor.dispose();
|
|
35363
35363
|
}
|
|
35364
35364
|
}
|
|
35365
|
+
// src/adapters/platform/reference-policies.ts
|
|
35366
|
+
/** @file 固定业务关联的范围声明,列表查询和选择确认使用同一套规则。 */
|
|
35367
|
+
/** 业务字段已有固定来源,不要求模板另配普通关联的目标模型。 */
|
|
35368
|
+
function businessReferenceModel(source) {
|
|
35369
|
+
if (source.businessType === "device") return "em_device";
|
|
35370
|
+
if (["production_container", "inspection_container"].includes(source.businessType ?? source.fieldType) || isNamedLotBinding(source)) return "em_production_identification";
|
|
35371
|
+
}
|
|
35372
|
+
var lotTypes = /* @__PURE__ */ new Set([
|
|
35373
|
+
"material_no",
|
|
35374
|
+
"related_lot_no",
|
|
35375
|
+
"scrap_material_no",
|
|
35376
|
+
"material_container",
|
|
35377
|
+
"sterilization_container",
|
|
35378
|
+
"production_container",
|
|
35379
|
+
"inspection_container"
|
|
35380
|
+
]);
|
|
35381
|
+
var operatingTypes = /* @__PURE__ */ new Set([
|
|
35382
|
+
"warehouse",
|
|
35383
|
+
"target_warehouse",
|
|
35384
|
+
"location",
|
|
35385
|
+
"shopfloor"
|
|
35386
|
+
]);
|
|
35387
|
+
var lotSearch = [
|
|
35388
|
+
"name_.iLike",
|
|
35389
|
+
"related_parent_name_.iLike",
|
|
35390
|
+
"product_id_$code_.iLike",
|
|
35391
|
+
"product_id_$name_.iLike",
|
|
35392
|
+
"product_id_$spec_.iLike"
|
|
35393
|
+
];
|
|
35394
|
+
var productionKinds = ["LOT", "SN"];
|
|
35395
|
+
function referenceBusinessType(context) {
|
|
35396
|
+
return context.binding.source.businessType ?? context.binding.source.fieldType ?? "";
|
|
35397
|
+
}
|
|
35398
|
+
function lotSelection(context) {
|
|
35399
|
+
return lotTypes.has(referenceBusinessType(context));
|
|
35400
|
+
}
|
|
35401
|
+
/** 字段固有查询条件不保存为可被模板改写的用户筛选。 */
|
|
35402
|
+
function referencePolicyQuery(context, component) {
|
|
35403
|
+
const type = referenceBusinessType(context), filters = {}, conditions = [];
|
|
35404
|
+
const filter = (key, value) => {
|
|
35405
|
+
filters[key] = value;
|
|
35406
|
+
conditions.push(key);
|
|
35407
|
+
};
|
|
35408
|
+
if (operatingTypes.has(type)) filter("operating_state_", true);
|
|
35409
|
+
if (type === "routing_operation") filter("type_", "NODE_SPEC");
|
|
35410
|
+
if (type === "routing_operation" && typeof component.routingId === "string" && component.routingId) filter("ref_master_id_", component.routingId);
|
|
35411
|
+
if (lotTypes.has(type)) filter("container_role_.ne", "related_parent");
|
|
35412
|
+
if (type === "production_container" || type === "inspection_container") {
|
|
35413
|
+
if (type === "production_container") filter("production_identification_type_.in", productionKinds);
|
|
35414
|
+
else filter("production_identification_type_.eq", "INSPECTION_CONTAINER");
|
|
35415
|
+
filter("is_rework_", 0);
|
|
35416
|
+
} else if (type === "sterilization_container") filter("production_identification_type_", "STERILIZATION");
|
|
35417
|
+
else if (type === "material_container") {
|
|
35418
|
+
filters["production_identification_type_.eq"] = "MATERIAL";
|
|
35419
|
+
filters["production_identification_type_.isNull"] = null;
|
|
35420
|
+
conditions.push("OR(production_identification_type_.eq,production_identification_type_.isNull)");
|
|
35421
|
+
}
|
|
35422
|
+
return [filters, conditions];
|
|
35423
|
+
}
|
|
35424
|
+
/** 回读也拒绝明确失效的状态,不能只靠候选列表过滤。接口省略的投影仍由查询条件限定。 */
|
|
35425
|
+
function referencePolicyAccepts(context, record, component) {
|
|
35426
|
+
const type = referenceBusinessType(context), kind = record.production_identification_type_;
|
|
35427
|
+
if (type === "routing_operation" && record.type_ !== void 0 && record.type_ !== "NODE_SPEC") return false;
|
|
35428
|
+
if (operatingTypes.has(type) && (record.operating_state_ === false || record.operating_state_ === 0)) return false;
|
|
35429
|
+
if (type === "routing_operation" && component.routingId && record.ref_master_id_ !== void 0 && record.ref_master_id_ !== component.routingId) return false;
|
|
35430
|
+
if (lotTypes.has(type) && record.container_role_ === "related_parent") return false;
|
|
35431
|
+
if (type === "production_container" || type === "inspection_container") {
|
|
35432
|
+
if (record.is_rework_ === true || record.is_rework_ === 1) return false;
|
|
35433
|
+
if (kind !== void 0 && (type === "production_container" ? !productionKinds.includes(kind) : kind !== "INSPECTION_CONTAINER")) return false;
|
|
35434
|
+
}
|
|
35435
|
+
if (type === "material_container" && kind != null && kind !== "MATERIAL") return false;
|
|
35436
|
+
if (type === "sterilization_container" && kind !== void 0 && kind !== "STERILIZATION") return false;
|
|
35437
|
+
return true;
|
|
35438
|
+
}
|
|
35439
|
+
function referencePolicySearch(context) {
|
|
35440
|
+
const type = referenceBusinessType(context);
|
|
35441
|
+
if ([
|
|
35442
|
+
"routing_operation",
|
|
35443
|
+
"operation",
|
|
35444
|
+
"e_sop"
|
|
35445
|
+
].includes(type)) return ["name_.iLike"];
|
|
35446
|
+
if ([
|
|
35447
|
+
"scrap_group",
|
|
35448
|
+
"scrap_reason",
|
|
35449
|
+
"not_good_group",
|
|
35450
|
+
"not_good_reason",
|
|
35451
|
+
"warehouse",
|
|
35452
|
+
"target_warehouse",
|
|
35453
|
+
"location",
|
|
35454
|
+
"shopfloor"
|
|
35455
|
+
].includes(type)) return ["name_.iLike", "code_.iLike"];
|
|
35456
|
+
if (type === "production_container" || type === "inspection_container") return ["name_.iLike", "related_parent_name_.iLike"];
|
|
35457
|
+
if (type === "material_container") return [
|
|
35458
|
+
"name_.iLike",
|
|
35459
|
+
"product_id_code_.iLike",
|
|
35460
|
+
"product_id_name_.iLike",
|
|
35461
|
+
"spec_.iLike"
|
|
35462
|
+
];
|
|
35463
|
+
if (type === "sterilization_container") return ["name_.iLike"];
|
|
35464
|
+
if (lotTypes.has(type)) return lotSearch;
|
|
35465
|
+
}
|
|
35365
35466
|
// src/adapters/platform/template-reference-migration.ts
|
|
35366
35467
|
/** @file 在模板转换边界补齐关联声明,填报查询只消费完整的原生绑定。 */
|
|
35367
35468
|
/** 旧绑定保留模型/字段链;目标查询只取明确的所属模型和字段,不能借用同名主表字段。 */
|
|
@@ -35380,6 +35481,7 @@ async function completeGctWordTemplateReferences(document, signal) {
|
|
|
35380
35481
|
const missing = new Set(Object.entries(document.bindings).flatMap(([id, { source }]) => {
|
|
35381
35482
|
if (source.refModelKey) return [];
|
|
35382
35483
|
const field = definition(source);
|
|
35484
|
+
if (businessReferenceModel(source) && field?.binding.source.businessType === source.businessType) return [];
|
|
35383
35485
|
return field?.widget === "relation" || field?.widget === "rdo-relation" ? [id] : [];
|
|
35384
35486
|
}));
|
|
35385
35487
|
if (!missing.size) return {
|
|
@@ -35410,26 +35512,31 @@ async function completeGctWordTemplateReferences(document, signal) {
|
|
|
35410
35512
|
document,
|
|
35411
35513
|
changed: false
|
|
35412
35514
|
};
|
|
35413
|
-
const models = new Map(await Promise.all([...new Set([...used].
|
|
35515
|
+
const models = new Map(await Promise.all([...new Set([...used].filter((id) => {
|
|
35516
|
+
const field = definition(document.bindings[id].source);
|
|
35517
|
+
return !field || !businessReferenceModel(field.binding.source);
|
|
35518
|
+
}).map((id) => document.bindings[id].source.modelLink.split(".").at(-1)))].map(async (key) => [key, await readGctModelMeta(key, signal)])));
|
|
35414
35519
|
signal.throwIfAborted();
|
|
35415
35520
|
const resolved = [...used].map((id) => {
|
|
35416
|
-
const binding = document.bindings[id], source = binding.source, modelKey = source.modelLink.split(".").at(-1), key = source.fieldLink.split(".").at(-1), matches = models.get(modelKey)?.fieldMetaList?.filter((field) => field.key === key) ?? [];
|
|
35521
|
+
const binding = document.bindings[id], source = binding.source, modelKey = source.modelLink.split(".").at(-1), key = source.fieldLink.split(".").at(-1), local = definition(source), matches = local && businessReferenceModel(local.binding.source) ? [] : models.get(modelKey)?.fieldMetaList?.filter((field) => field.key === key) ?? [];
|
|
35417
35522
|
if (matches.length > 1) throw Error(`模型 ${modelKey} 的字段 ${key} 不唯一,无法补齐关联配置`);
|
|
35418
35523
|
const field = definition(source, matches[0]);
|
|
35419
|
-
|
|
35524
|
+
const refModelKey = field && (businessReferenceModel(field.binding.source) ?? field.binding.source.refModelKey);
|
|
35525
|
+
if (!field || field.widget !== "relation" && field.widget !== "rdo-relation" || !refModelKey || fields.get(id).some((node) => node.widget !== field.widget)) throw Error(`字段 ${modelKey}.${key} 缺少关联模型,无法完成模板转换`);
|
|
35420
35526
|
return {
|
|
35421
35527
|
id,
|
|
35422
35528
|
binding,
|
|
35423
|
-
field
|
|
35529
|
+
field,
|
|
35530
|
+
refModelKey
|
|
35424
35531
|
};
|
|
35425
35532
|
});
|
|
35426
35533
|
editor.transaction("补齐转换字段的关联声明", () => {
|
|
35427
|
-
for (const { id, binding, field } of resolved) {
|
|
35534
|
+
for (const { id, binding, field, refModelKey } of resolved) {
|
|
35428
35535
|
editor.setDictionary("bindings", id, {
|
|
35429
35536
|
...binding,
|
|
35430
35537
|
source: {
|
|
35431
35538
|
...binding.source,
|
|
35432
|
-
refModelKey
|
|
35539
|
+
refModelKey,
|
|
35433
35540
|
...field.binding.source.businessType && !binding.source.businessType ? { businessType: field.binding.source.businessType } : {}
|
|
35434
35541
|
}
|
|
35435
35542
|
});
|
|
@@ -38335,101 +38442,6 @@ function createProductReleaseLots(businessType, readContext) {
|
|
|
38335
38442
|
}
|
|
38336
38443
|
};
|
|
38337
38444
|
}
|
|
38338
|
-
// src/adapters/platform/reference-policies.ts
|
|
38339
|
-
var lotTypes = /* @__PURE__ */ new Set([
|
|
38340
|
-
"material_no",
|
|
38341
|
-
"related_lot_no",
|
|
38342
|
-
"scrap_material_no",
|
|
38343
|
-
"material_container",
|
|
38344
|
-
"sterilization_container",
|
|
38345
|
-
"production_container",
|
|
38346
|
-
"inspection_container"
|
|
38347
|
-
]);
|
|
38348
|
-
var operatingTypes = /* @__PURE__ */ new Set([
|
|
38349
|
-
"warehouse",
|
|
38350
|
-
"target_warehouse",
|
|
38351
|
-
"location",
|
|
38352
|
-
"shopfloor"
|
|
38353
|
-
]);
|
|
38354
|
-
var lotSearch = [
|
|
38355
|
-
"name_.iLike",
|
|
38356
|
-
"related_parent_name_.iLike",
|
|
38357
|
-
"product_id_$code_.iLike",
|
|
38358
|
-
"product_id_$name_.iLike",
|
|
38359
|
-
"product_id_$spec_.iLike"
|
|
38360
|
-
];
|
|
38361
|
-
var productionKinds = ["LOT", "SN"];
|
|
38362
|
-
function referenceBusinessType(context) {
|
|
38363
|
-
return context.binding.source.businessType ?? context.binding.source.fieldType ?? "";
|
|
38364
|
-
}
|
|
38365
|
-
function lotSelection(context) {
|
|
38366
|
-
return lotTypes.has(referenceBusinessType(context));
|
|
38367
|
-
}
|
|
38368
|
-
/** 字段固有查询条件不保存为可被模板改写的用户筛选。 */
|
|
38369
|
-
function referencePolicyQuery(context, component) {
|
|
38370
|
-
const type = referenceBusinessType(context), filters = {}, conditions = [];
|
|
38371
|
-
const filter = (key, value) => {
|
|
38372
|
-
filters[key] = value;
|
|
38373
|
-
conditions.push(key);
|
|
38374
|
-
};
|
|
38375
|
-
if (operatingTypes.has(type)) filter("operating_state_", true);
|
|
38376
|
-
if (type === "routing_operation") filter("type_", "NODE_SPEC");
|
|
38377
|
-
if (type === "routing_operation" && typeof component.routingId === "string" && component.routingId) filter("ref_master_id_", component.routingId);
|
|
38378
|
-
if (lotTypes.has(type)) filter("container_role_.ne", "related_parent");
|
|
38379
|
-
if (type === "production_container" || type === "inspection_container") {
|
|
38380
|
-
if (type === "production_container") filter("production_identification_type_.in", productionKinds);
|
|
38381
|
-
else filter("production_identification_type_.eq", "INSPECTION_CONTAINER");
|
|
38382
|
-
filter("is_rework_", 0);
|
|
38383
|
-
} else if (type === "sterilization_container") filter("production_identification_type_", "STERILIZATION");
|
|
38384
|
-
else if (type === "material_container") {
|
|
38385
|
-
filters["production_identification_type_.eq"] = "MATERIAL";
|
|
38386
|
-
filters["production_identification_type_.isNull"] = null;
|
|
38387
|
-
conditions.push("OR(production_identification_type_.eq,production_identification_type_.isNull)");
|
|
38388
|
-
}
|
|
38389
|
-
return [filters, conditions];
|
|
38390
|
-
}
|
|
38391
|
-
/** 回读也拒绝明确失效的状态,不能只靠候选列表过滤。接口省略的投影仍由查询条件限定。 */
|
|
38392
|
-
function referencePolicyAccepts(context, record, component) {
|
|
38393
|
-
const type = referenceBusinessType(context), kind = record.production_identification_type_;
|
|
38394
|
-
if (type === "routing_operation" && record.type_ !== void 0 && record.type_ !== "NODE_SPEC") return false;
|
|
38395
|
-
if (operatingTypes.has(type) && (record.operating_state_ === false || record.operating_state_ === 0)) return false;
|
|
38396
|
-
if (type === "routing_operation" && component.routingId && record.ref_master_id_ !== void 0 && record.ref_master_id_ !== component.routingId) return false;
|
|
38397
|
-
if (lotTypes.has(type) && record.container_role_ === "related_parent") return false;
|
|
38398
|
-
if (type === "production_container" || type === "inspection_container") {
|
|
38399
|
-
if (record.is_rework_ === true || record.is_rework_ === 1) return false;
|
|
38400
|
-
if (kind !== void 0 && (type === "production_container" ? !productionKinds.includes(kind) : kind !== "INSPECTION_CONTAINER")) return false;
|
|
38401
|
-
}
|
|
38402
|
-
if (type === "material_container" && kind != null && kind !== "MATERIAL") return false;
|
|
38403
|
-
if (type === "sterilization_container" && kind !== void 0 && kind !== "STERILIZATION") return false;
|
|
38404
|
-
return true;
|
|
38405
|
-
}
|
|
38406
|
-
function referencePolicySearch(context) {
|
|
38407
|
-
const type = referenceBusinessType(context);
|
|
38408
|
-
if ([
|
|
38409
|
-
"routing_operation",
|
|
38410
|
-
"operation",
|
|
38411
|
-
"e_sop"
|
|
38412
|
-
].includes(type)) return ["name_.iLike"];
|
|
38413
|
-
if ([
|
|
38414
|
-
"scrap_group",
|
|
38415
|
-
"scrap_reason",
|
|
38416
|
-
"not_good_group",
|
|
38417
|
-
"not_good_reason",
|
|
38418
|
-
"warehouse",
|
|
38419
|
-
"target_warehouse",
|
|
38420
|
-
"location",
|
|
38421
|
-
"shopfloor"
|
|
38422
|
-
].includes(type)) return ["name_.iLike", "code_.iLike"];
|
|
38423
|
-
if (type === "production_container" || type === "inspection_container") return ["name_.iLike", "related_parent_name_.iLike"];
|
|
38424
|
-
if (type === "material_container") return [
|
|
38425
|
-
"name_.iLike",
|
|
38426
|
-
"product_id_code_.iLike",
|
|
38427
|
-
"product_id_name_.iLike",
|
|
38428
|
-
"spec_.iLike"
|
|
38429
|
-
];
|
|
38430
|
-
if (type === "sterilization_container") return ["name_.iLike"];
|
|
38431
|
-
if (lotTypes.has(type)) return lotSearch;
|
|
38432
|
-
}
|
|
38433
38445
|
// src/adapters/platform/reference-columns.ts
|
|
38434
38446
|
/** @file GCT 业务下拉的显示列策略;只投影短文本,不保存来源记录。 */
|
|
38435
38447
|
var column = (key, label, aliases) => ({
|
|
@@ -39376,10 +39388,7 @@ function label(item) {
|
|
|
39376
39388
|
return String(item.__SHOW_LABEL__ || item.__LABEL__ || item.name_ || item.code_ || item.id_ || "");
|
|
39377
39389
|
}
|
|
39378
39390
|
function modelFor(context) {
|
|
39379
|
-
|
|
39380
|
-
if (["production_container", "inspection_container"].includes(context.binding.source.businessType ?? context.binding.source.fieldType ?? "")) return "em_production_identification";
|
|
39381
|
-
if (isNamedLotBinding(context.binding.source)) return "em_production_identification";
|
|
39382
|
-
const { refModelKey } = context.binding.source;
|
|
39391
|
+
const refModelKey = businessReferenceModel(context.binding.source) ?? context.binding.source.refModelKey;
|
|
39383
39392
|
if (!refModelKey) throw new Error("关联字段缺少目标模型");
|
|
39384
39393
|
return refModelKey;
|
|
39385
39394
|
}
|