@gct-paas/excel 0.1.39-beta.8 → 0.1.39

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.
Files changed (136) hide show
  1. package/dist/{BaseComponent-Dri2NRAY.js → BaseComponent-vcQYIdIV.js} +2 -2
  2. package/dist/{VueVideoPlayer-DPJyefX-.js → VueVideoPlayer-i-e8JA1p.js} +2 -2
  3. package/dist/{align-editor-BvGUsoz3.js → align-editor-BHe6RawU.js} +1 -1
  4. package/dist/{barcode-design-C8V6Zzz_.js → barcode-design-B2QebWCm.js} +2 -2
  5. package/dist/base/index.es.js +624 -264
  6. package/dist/{diagonal-design-DXfWVZvL.js → diagonal-design-Di8yoq2q.js} +2 -2
  7. package/dist/{dynamic-table-action-BQfJFJ4j.js → dynamic-table-action-ixEHBudI.js} +1041 -368
  8. package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZRtpBe8.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-CKf2tZG7.js} +1039 -1409
  9. package/dist/{edit.utils-CXmmCnxE-CvJGxh2v.js → edit.utils-CXmmCnxE-Dq-jFR6z.js} +1 -1
  10. package/dist/excel.css +616 -351
  11. package/dist/{exceljs.min-BfRvRgvB.js → exceljs.min-Biokosoj.js} +2 -2
  12. package/dist/{font-editor-C-R6CAVG.js → font-editor-B8l8oZMc.js} +3 -3
  13. package/dist/{image-design-A8_t4F3t.js → image-design-BI6ld3iT.js} +2 -2
  14. package/dist/{index-DFNVqlgA.js → index-0QNiqIDD.js} +1 -1
  15. package/dist/{index-Caygbi4F.js → index-4DBBFAz2.js} +2 -2
  16. package/dist/{index-DERot0lx.js → index-5-uaHPu2.js} +2 -2
  17. package/dist/{index-H2nF4SP8.js → index-849t15XD.js} +2 -2
  18. package/dist/{index-C3k8QiLF.js → index-ACzLWeSq.js} +2 -2
  19. package/dist/{index-DkwkBWEP.js → index-B-2uV1do.js} +2 -2
  20. package/dist/{index-bH6ERrWd.js → index-B-in7hrx.js} +2 -2
  21. package/dist/{index-B-Kwr44d.js → index-B1qdPPcT.js} +1 -1
  22. package/dist/{index-B_GyS-E2.js → index-B2-4fQY4.js} +1 -1
  23. package/dist/{index-Bl5PEJrh.js → index-BC-WTGht.js} +6 -3
  24. package/dist/{index-CJdwj04Z.js → index-BWibgLgR.js} +1 -1
  25. package/dist/{index-DWVhXPb-.js → index-BY-gcezU.js} +2 -2
  26. package/dist/{index-BLmR9aiG.js → index-B_8k4BAM.js} +1 -1
  27. package/dist/{index-CTASuQPn.js → index-BaiFrPHF.js} +1 -1
  28. package/dist/{index-C-k8dFLv.js → index-BgCtUVN4.js} +2 -2
  29. package/dist/{index-DkDetjLm.js → index-Boq5CJjh.js} +3 -3
  30. package/dist/{index-CfGLFrkj.js → index-BwN8dOzz.js} +1 -1
  31. package/dist/{index-CCBueGEh.js → index-Bz-WrsTI.js} +6 -5
  32. package/dist/{index-DqkPgoly.js → index-C4P86Gyr.js} +2 -2
  33. package/dist/{index-CRloZ0HP.js → index-C68Ddx67.js} +2 -2
  34. package/dist/{index-afC-rHNa.js → index-CDYkiSAG.js} +2 -2
  35. package/dist/{index-DpMV2Mnw.js → index-CKQht60B.js} +6 -5
  36. package/dist/{index-BUK-p31i.js → index-CM549sqd.js} +3 -2
  37. package/dist/{index-DmBx27M9.js → index-CNNAdkvj.js} +2 -2
  38. package/dist/{index-Bs8Xs0bo.js → index-CTmqu_l0.js} +1 -1
  39. package/dist/{index-DY7Xkd8n.js → index-CbwfhoZc.js} +2 -2
  40. package/dist/{index-D9444n1O.js → index-CbzO_9_B.js} +2 -2
  41. package/dist/{index-BE-3UQG0.js → index-CqJMdCBq.js} +50 -3
  42. package/dist/{index-BYH3tYm7.js → index-DJWuge8D.js} +5 -7
  43. package/dist/{index-D9OUmbBs.js → index-DdeccRDL.js} +1 -1
  44. package/dist/{index-P9ZTqL1i.js → index-T4KiEmZK.js} +3 -3
  45. package/dist/{index-DsLZqLga.js → index-aGBVmmIs.js} +2 -2
  46. package/dist/{index-luggjixn.js → index-bLaVMu7L.js} +2454 -1959
  47. package/dist/{index-DPHGDezJ.js → index-n8fyvJSm.js} +1 -1
  48. package/dist/{index-D1jXU0ka.js → index-rMox9ntl.js} +2 -2
  49. package/dist/index.es.js +2 -2
  50. package/dist/{mb-render-DybPk-KF.js → mb-render-BhZlu6KQ.js} +8 -2
  51. package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-BEX02BrW.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-1sgb8Alq.js} +8 -1
  52. package/dist/{pagination-design-CpZhqHAZ.js → pagination-design-DvqAcQIp.js} +2 -2
  53. package/dist/paper-widget-design-D_kqGHiq.js +4 -0
  54. package/dist/{print-runtime-instance-DP1Lp8e2.js → print-runtime-instance-CmWFXzPQ.js} +1 -1
  55. package/dist/{print-snapshot-renderer-Cf73dKcd.js → print-snapshot-renderer-DsksM5OJ.js} +3 -3
  56. package/dist/{qrcode-design-BDVFS0l9.js → qrcode-design-CuDgywl1.js} +1 -1
  57. package/dist/{revo-grid.entry-EvEm_y2W.js → revo-grid.entry-BqAGRHgf.js} +1 -1
  58. package/dist/{revogr-attribution_7.entry-DgE6PR1L.js → revogr-attribution_7.entry-Dl-LcgkK.js} +3 -3
  59. package/dist/{revogr-clipboard_3.entry-CNDxeVhF.js → revogr-clipboard_3.entry-CT01IdhF.js} +2 -2
  60. package/dist/{revogr-data_4.entry-DKwV9DMF.js → revogr-data_4.entry-fH5V7Zgk.js} +2 -2
  61. package/dist/{revogr-filter-panel.entry-1SAhHHfl.js → revogr-filter-panel.entry-DiC81RU-.js} +1 -1
  62. package/dist/seal-design-CZ8RLM62.js +4 -0
  63. package/dist/{serialnumber-design-Cs3B0ZNE.js → serialnumber-design-CVO53aOV.js} +1 -1
  64. package/dist/shared/index.es.js +23 -21
  65. package/dist/{single-field-drop-Ijh7_RRT.js → single-field-drop-B51_f5z6.js} +2 -2
  66. package/dist/{size-editor-B2TfX4_r.js → size-editor-BeSNExEt.js} +1 -1
  67. package/dist/src/domain/table/business/material/material-balance/profile/fields.d.ts +2 -0
  68. package/dist/src/domain/table/business/preprocess/pretreatment-list/profile/field-keys.d.ts +1 -7
  69. package/dist/src/domain/table/business/sterilize/entrust-steril-batch-list/profile/fields.d.ts +2 -0
  70. package/dist/src/nocode-base/src/core/factory/sub-table-factory.d.ts +2 -0
  71. package/dist/src/nocode-base/src/core/sub-table/allocate-table-core.d.ts +2 -1
  72. package/dist/src/nocode-base/src/core/sub-table/sub-table-core.d.ts +2 -1
  73. package/dist/src/nocode-base/src/hooks/form-model/form-model-controller.d.ts +2 -0
  74. package/dist/src/nocode-base/src/hooks/material-consume/bom-validator.d.ts +9 -7
  75. package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +18 -14
  76. package/dist/src/nocode-base/src/hooks/material-consume/tmpl-bom-controller.d.ts +20 -7
  77. package/dist/src/nocode-base/src/hooks/material-consume/types.d.ts +6 -0
  78. package/dist/src/nocode-base/src/hooks/material-consume-object/bom-validator.d.ts +4 -3
  79. package/dist/src/nocode-base/src/hooks/material-consume-object/initialize-autofill.d.ts +19 -0
  80. package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
  81. package/dist/src/nocode-base/src/interface/render.d.ts +3 -1
  82. package/dist/src/nocode-base/src/interface/transform.d.ts +14 -1
  83. package/dist/src/nocode-base/src/runtime/formula-utils.d.ts +2 -0
  84. package/dist/src/nocode-base/src/runtime/multi-sheet-runtime.d.ts +3 -1
  85. package/dist/src/nocode-base/src/runtime/runtime-context.d.ts +4 -0
  86. package/dist/src/nocode-base/src/runtime/runtime-form-state-store.d.ts +6 -2
  87. package/dist/src/nocode-base/src/runtime/table-row-identity.d.ts +2 -0
  88. package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +5 -1
  89. package/dist/src/nocode-web-render/src/render/sub-table/common/inventory-scan-columns.d.ts +6 -0
  90. package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-design.vue.d.ts +2 -0
  91. package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields.util.d.ts +2 -2
  92. package/dist/src/online-form/src/views/__cell_widgets__/common/quick-search-editor/quick-search.util.d.ts +8 -0
  93. package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-option-select.vue.d.ts +1 -0
  94. package/dist/src/online-form/src/views/designer/conversions/normalize-paper-grid.d.ts +3 -0
  95. package/dist/src/online-form/src/views/designer/hooks/useAllSpreadSheets.d.ts +35 -0
  96. package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts +16 -1
  97. package/dist/src/online-form/src/views/designer/modules/base/designer-wrapper.vue.d.ts +1 -0
  98. package/dist/src/online-form/src/views/designer/modules/duplicate-field-notice.vue.d.ts +2 -0
  99. package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/hooks/useObjectInit.d.ts +2 -0
  100. package/dist/src/online-form/src/views/designer/modules/panel/sub-table/comps/use-dynamic-sub-table-panel.d.ts +12 -0
  101. package/dist/src/online-form/src/views/designer/modules/xlsx-import-summary.vue.d.ts +11 -0
  102. package/dist/src/online-form/src/views/designer/types/index.d.ts +2 -0
  103. package/dist/src/online-form/src/views/designer/types/sheets.d.ts +2 -0
  104. package/dist/src/online-form/src/views/designer/utils/cell-field-placements.d.ts +12 -0
  105. package/dist/src/online-form/src/views/designer/utils/xlsx-parser.d.ts +9 -3
  106. package/dist/src/online-form/src/views/render/__components__/_field_/trace/composables/useReferenceLabel.d.ts +4 -0
  107. package/dist/src/online-form/src/views/render/__components__/_field_/trace/utils/use-rule-props.d.ts +0 -3
  108. package/dist/src/shared/enum/field-type.d.ts +2 -0
  109. package/dist/src/shared/enum/index.d.ts +2 -0
  110. package/dist/src/shared/enum/product-type.d.ts +9 -0
  111. package/dist/src/shared/enum/production-identification.d.ts +19 -0
  112. package/dist/src/shared/utils/cell-wrap.d.ts +9 -0
  113. package/dist/src/shared/utils/grid-size.d.ts +2 -0
  114. package/dist/src/shared/utils/lot2sn.d.ts +14 -1
  115. package/dist/src/shared/utils/query-filter.d.ts +24 -0
  116. package/dist/{sub-table-factory-CNkIUJTC.js → sub-table-factory-sC8iCJWs.js} +38 -18
  117. package/dist/{text-design-BaDQZeS2.js → text-design-DK_QWoro.js} +5 -4
  118. package/dist/{throttle-Cpk1LoGk-Ch-cqj2G.js → throttle-Cpk1LoGk-BreMfOwP.js} +1 -1
  119. package/dist/{timediff-design-DASqeRcJ.js → timediff-design-Iwg0BNOb.js} +1 -1
  120. package/dist/{trace-like-wrapper-B1n1LPhU.js → trace-like-wrapper-D0pPaeII.js} +5 -2
  121. package/dist/{value-editor.vue_vue_type_style_index_0_lang-_7d452gl.js → value-editor.vue_vue_type_style_index_0_lang-B4gIt1fw.js} +2 -2
  122. package/dist/web-render/index.es.js +3 -3
  123. package/dist/{widget-barcode-D3nGm6wi.js → widget-barcode-DSBywfHB.js} +4 -4
  124. package/dist/{widget-diagonal-CrTfSw6w.js → widget-diagonal-DiBbiuEA.js} +3 -3
  125. package/dist/{widget-image-Bq3B9IR0.js → widget-image-DUtfyekO.js} +5 -5
  126. package/dist/{widget-line-BE8D0_Mn.js → widget-line-6Ngl_4mJ.js} +2 -2
  127. package/dist/{widget-pagination-CJZ-nXas.js → widget-pagination-DXmnbvtx.js} +5 -5
  128. package/dist/{widget-power-CUVtkygi.js → widget-power-DbsY-uwC.js} +3 -3
  129. package/dist/{widget-qrcode-DDqtIjp6.js → widget-qrcode-LsBgDKds.js} +3 -3
  130. package/dist/{widget-rangelimit-CiXyiZ4L.js → widget-rangelimit-DJ_5u-vA.js} +3 -3
  131. package/dist/{widget-serialnumber-DdV7rw4j.js → widget-serialnumber-TEVkPcgx.js} +1 -1
  132. package/dist/{widget-text-B5pDJ4lb.js → widget-text-DD-xuVwh.js} +5 -5
  133. package/dist/{widget-timediff-D_BS7hfR.js → widget-timediff-DQV78xgH.js} +2 -2
  134. package/package.json +2 -2
  135. package/dist/paper-widget-design-o-K-d1mV.js +0 -4
  136. package/dist/seal-design-D2dtOjZh.js +0 -4
@@ -1,10 +1,10 @@
1
- import { reactive, toRaw, computed, watch, onScopeDispose, inject, h, shallowReactive, markRaw, ref, nextTick, toRef, provide, defineComponent, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, renderSlot, createCommentVNode, createVNode, toDisplayString, Fragment, renderList, onUnmounted, isVNode, onMounted, onBeforeMount, resolveComponent, createBlock, withCtx, createTextVNode } from "vue";
2
- import { ai as CellWidgetViewState, F as FIELD_TYPE, b8 as RenderModeEnum, Y as FormTypeEnum, bE as BpmnNodeTypeEnum, cv as getFieldPlaceholder, bV as MobileFillTypeEnum, C as ComponentTypeEnum, $ as PlatformEnum, cw as isReferenceOptionActive, E as api, bu as uuid2, c3 as calcUtils, bj as findRuntimeTableRow, c7 as ensureTableRowKeys, c0 as bindRuntimeTableColumns, bi as getRowId, cx as FRONT_ROW_KEY, cm as isTableRowKeyMatch, bw as isAttachFieldActive, cy as filterRulesByTrigger, cz as isEmptyValue$1, c4 as decodeTableCellRowKey, c6 as ensureFrontRowKey, b0 as getParseRuleInfo, aF as transformUtils, aY as materialCheck, aZ as getLotLockedReason, a_ as validateReinspectionDate, bn as FormulaRuleFieldKeyEnum, f as SubTableType, b1 as getParseRuleValue, cA as buildError, H as CreateType, bl as findRuntimeParentRow, aI as Dependency_ENUM, aH as ASSIGNMENTSTRATEGY_ENUM, bJ as commonUtils, aM as DeviceLink, a8 as _export_sfc, cg as getRenderedRuntimeTableCell, y as CellType, cq as relocateDeletedRowsToEnd, cB as resetTableRowIdentity, J as useModal, cC as q, cD as QUICK_FILL_ALLOWED_FIELDS, cE as groupFixedTableRows, cF as processQuickFillRows, cG as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZRtpBe8.js";
3
- import { cloneDeep, isEmpty, has, pickBy, isNil, mergeWith, omit, last, pick, merge } from "lodash-es";
1
+ import { reactive, toRaw, computed, watch, onScopeDispose, inject, h, shallowReactive, markRaw, ref, toRef, nextTick, provide, defineComponent, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, renderSlot, createCommentVNode, createVNode, toDisplayString, Fragment, renderList, onUnmounted, isVNode, onMounted, onBeforeMount, resolveComponent, createBlock, withCtx, createTextVNode } from "vue";
2
+ import { cg as splitRuntimeDataPath, af as CellWidgetViewState, F as FIELD_TYPE, b5 as RenderModeEnum, X as FormTypeEnum, bt as BpmnNodeTypeEnum, cj as getFieldPlaceholder, bJ as MobileFillTypeEnum, C as ComponentTypeEnum, bd as findRuntimeTableRow, aT as renderUtils, _ as PlatformEnum, E as api, bm as uuid2, bT as calcUtils, bX as ensureTableRowKeys, bQ as bindRuntimeTableColumns, bc as getRowId, ck as FRONT_ROW_KEY, ca as isTableRowKeyMatch, au as RangeCompareOp, at as RangeValidateMode, bU as decodeTableCellRowKey, bW as ensureFrontRowKey, a$ as getParseRuleInfo, aC as transformUtils, aV as materialCheck, aW as getLotLockedReason, aX as validateReinspectionDate, bg as FormulaRuleFieldKeyEnum, f as SubTableType, b0 as getParseRuleValue, H as CreateType, be as findRuntimeParentRow, aF as Dependency_ENUM, aE as ASSIGNMENTSTRATEGY_ENUM, bx as commonUtils, aJ as DeviceLink, a7 as _export_sfc, c4 as getRenderedRuntimeTableCell, y as CellType, cl as resetTableRowIdentity, J as useModal, cm as q, cn as QUICK_FILL_ALLOWED_FIELDS, co as groupFixedTableRows, cp as processQuickFillRows, cq as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-CKf2tZG7.js";
4
3
  import dayjs from "dayjs";
4
+ import { cloneDeep, isEmpty, isNil, pickBy, mergeWith, omit, last, pick, merge } from "lodash-es";
5
5
  import { a as useNamespace, I as Icon } from "./AntdIcon-DCIaV352.js";
6
6
  import { Modal, message } from "ant-design-vue";
7
- import { u as useFormModel } from "./mb-render-DybPk-KF.js";
7
+ import { u as useFormModel } from "./mb-render-BhZlu6KQ.js";
8
8
  var MaterialConsumptionPatternEnum = /* @__PURE__ */ ((MaterialConsumptionPatternEnum2) => {
9
9
  MaterialConsumptionPatternEnum2["RECORD"] = "record";
10
10
  MaterialConsumptionPatternEnum2["BOM"] = "bom";
@@ -42,8 +42,8 @@ function getRuntimeDependencyOutputKey(widgetId, type4, rowPath) {
42
42
  return JSON.stringify([widgetId, type4, rowPath]);
43
43
  }
44
44
  function pathMatches(source, changedPath, structureOnly = false) {
45
- const expected = source.split(".");
46
- const changed = changedPath.split(".");
45
+ const expected = splitRuntimeDataPath(source);
46
+ const changed = splitRuntimeDataPath(changedPath);
47
47
  if (structureOnly && changed.length > expected.length) return false;
48
48
  return expected.slice(0, Math.min(expected.length, changed.length)).every((part, index) => part === "*" || part === changed[index]);
49
49
  }
@@ -146,7 +146,9 @@ class RuntimeDependencyService {
146
146
  }
147
147
  schedule(change) {
148
148
  if (this.disposed) return;
149
- if (change.source === "restore") change = { ...change, paths: ["*"] };
149
+ const labelsOnly = change.paths.length > 0 && change.paths.every((path) => path.endsWith("_lb_"));
150
+ if (change.source === "restore" && change.restoreScope !== "fields" && !labelsOnly)
151
+ change = { ...change, paths: ["*"] };
150
152
  this.effects.forEach((effect) => {
151
153
  if (this.matches(effect, change.paths)) this.cancelExecution(effect.id);
152
154
  });
@@ -337,6 +339,11 @@ function parseRuntimeFieldPath(path) {
337
339
  return void 0;
338
340
  }
339
341
  }
342
+ function isCellAutoLineBreak(style) {
343
+ const whiteSpace = style?.whiteSpace ?? style?.["white-space"];
344
+ const wordBreak = style?.wordBreak ?? style?.["word-break"];
345
+ return whiteSpace === "pre-wrap" && wordBreak === "break-all" || whiteSpace === "pre-line";
346
+ }
340
347
  var NCB_PROVIDE = /* @__PURE__ */ ((NCB_PROVIDE2) => {
341
348
  NCB_PROVIDE2["IS_PDF"] = "NCB_IsPdf";
342
349
  NCB_PROVIDE2["RUNTIME_INSTANCE_REGISTRY"] = "NCB_RuntimeInstanceRegistry";
@@ -454,12 +461,7 @@ function useWidgetStaticAttrs(widget) {
454
461
  dataRelationShip
455
462
  )
456
463
  );
457
- const isAutoLineBreak = computed(() => {
458
- if (!isEmpty(widget.style) && has(widget.style, "whiteSpace") && has(widget.style, "wordBreak") && widget.style.whiteSpace === "pre-wrap" && widget.style.wordBreak === "break-all") {
459
- return true;
460
- }
461
- return false;
462
- });
464
+ const isAutoLineBreak = computed(() => isCellAutoLineBreak(widget.style));
463
465
  return {
464
466
  field,
465
467
  fieldType,
@@ -703,6 +705,49 @@ function getSubTableQuickFillInfo(subTableFieldId, mobileTdIdGroups) {
703
705
  if (!subTableFieldId) return;
704
706
  return assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE, { rowSubFieldKey: subTableFieldId });
705
707
  }
708
+ function getCurrentFormData(_rule, options) {
709
+ if (!_rule._subtableFieldId) return options?.formData;
710
+ return findRuntimeTableRow(options?.formData?.[_rule._subtableFieldId], _rule._rowKey);
711
+ }
712
+ function isSameOptionValue(current, expected) {
713
+ if (typeof expected === "boolean") {
714
+ return renderUtils.getBoolValue(current) === expected;
715
+ }
716
+ if (current === void 0 || current === null || current === "") {
717
+ return false;
718
+ }
719
+ return String(current) === String(expected);
720
+ }
721
+ function isAttachFieldActive(attach, formData) {
722
+ if (attach?.parent && !isAttachFieldActive(attach.parent, formData)) return false;
723
+ if (!attach?.belongFieldId || isNil(attach.optionValue)) {
724
+ return true;
725
+ }
726
+ const row = attach.subtableFieldId ? findRuntimeTableRow(formData?.[attach.subtableFieldId], attach.rowKey) : formData;
727
+ if (attach.subtableFieldId && (!attach.rowKey || !row || row === formData)) {
728
+ return false;
729
+ }
730
+ const raw = row?.[attach.belongFieldId];
731
+ if (attach.multiple) {
732
+ const current = renderUtils.getValue(raw, true);
733
+ if (!Array.isArray(current)) return false;
734
+ return current.some((v) => isSameOptionValue(v, attach.optionValue));
735
+ }
736
+ return isSameOptionValue(raw, attach.optionValue);
737
+ }
738
+ function isReferenceOptionActive(referenceInfo, rowFormData) {
739
+ if (!referenceInfo?.belongFieldId || isNil(referenceInfo.optionValue)) {
740
+ return true;
741
+ }
742
+ return isAttachFieldActive(
743
+ {
744
+ belongFieldId: referenceInfo.belongFieldId,
745
+ optionValue: referenceInfo.optionValue,
746
+ multiple: referenceInfo.multiple
747
+ },
748
+ rowFormData
749
+ );
750
+ }
706
751
  function fieldChromeStyles(state) {
707
752
  const required4 = state === "required";
708
753
  const disabled = state === "disabled";
@@ -854,6 +899,9 @@ function useMaterialBalance() {
854
899
  destoryConsumeModal
855
900
  };
856
901
  }
902
+ function normalizeGridColumnWidth(value) {
903
+ return typeof value === "number" && Number.isFinite(value) ? Math.max(0, value) : 75;
904
+ }
857
905
  function normalizeHistoricalFieldConfig(value) {
858
906
  if (!value || typeof value !== "object") return value;
859
907
  if (Array.isArray(value)) {
@@ -871,10 +919,17 @@ function normalizeHistoricalFieldConfig(value) {
871
919
  const props = result.props;
872
920
  const attachment = props.fieldType === FIELD_TYPE.ATTACHMENT && props.viewState === CellWidgetViewState.Auto;
873
921
  const autofill = Array.isArray(props.autofillRules) && props.enableAutofill === void 0;
874
- if (attachment || autofill) {
922
+ const wrap = result.component === "td" && props.autoLineBreak !== true && isCellAutoLineBreak(result.cellWidget?.style);
923
+ const colsWidth = Array.isArray(props.colsWidth) ? props.colsWidth.map(
924
+ (width) => typeof width === "number" && Number.isFinite(width) ? normalizeGridColumnWidth(width) : width
925
+ ) : void 0;
926
+ const columnWidths = colsWidth?.some((width, index) => width !== props.colsWidth[index]);
927
+ if (attachment || autofill || wrap || columnWidths) {
875
928
  result = { ...result, props: { ...props } };
876
929
  if (attachment) result.props.viewState = CellWidgetViewState.Readonly;
877
930
  if (autofill) result.props.enableAutofill = true;
931
+ if (wrap) result.props.autoLineBreak = true;
932
+ if (columnWidths) result.props.colsWidth = colsWidth;
878
933
  }
879
934
  }
880
935
  return result;
@@ -976,16 +1031,17 @@ function validateSheetGraph(sheet) {
976
1031
  }
977
1032
  function normalizeSheetMetadata(sheet) {
978
1033
  const nodes = normalizeHistoricalFieldConfig(sheet.nodes);
1034
+ const sourcePaper = normalizeHistoricalFieldConfig(sheet.paper);
979
1035
  const paper = {
980
- ...sheet.paper,
1036
+ ...sourcePaper,
981
1037
  props: {
982
- ...sheet.paper.props,
1038
+ ...sourcePaper.props,
983
1039
  subTableWidgetIds: Object.entries(nodes).filter(([, node]) => node.component === ComponentTypeEnum.SUB_TABLE).map(([id]) => id)
984
1040
  }
985
1041
  };
986
1042
  return { ...sheet, paper, nodes, dataCenter: { [ComponentTypeEnum.PAPER]: paper, ...nodes } };
987
1043
  }
988
- function normalizeRuntime(runtime) {
1044
+ function normalizeRuntime(runtime, formType) {
989
1045
  if (typeof runtime === "string") {
990
1046
  if (!runtime.trim()) throw new Error("运行时数据不能为空");
991
1047
  try {
@@ -996,7 +1052,16 @@ function normalizeRuntime(runtime) {
996
1052
  }
997
1053
  assertObject(runtime, "运行时数据格式无效");
998
1054
  if (runtime.schemaVersion == null || runtime.schemaVersion === 1) {
999
- const normalized = convertV1Runtime(runtime);
1055
+ const legacyRuntime = formType === FormTypeEnum.FILE && runtime[ComponentTypeEnum.PAPER] == null ? {
1056
+ ...runtime,
1057
+ [ComponentTypeEnum.PAPER]: {
1058
+ id: ComponentTypeEnum.PAPER,
1059
+ component: ComponentTypeEnum.PAPER,
1060
+ props: {},
1061
+ nextIds: []
1062
+ }
1063
+ } : runtime;
1064
+ const normalized = convertV1Runtime(legacyRuntime);
1000
1065
  normalized.sheets.forEach(validateSheetGraph);
1001
1066
  return { ...normalized, sheets: normalized.sheets.map(normalizeSheetMetadata) };
1002
1067
  }
@@ -1133,6 +1198,7 @@ function createRuntimeInstanceContext(options) {
1133
1198
  uniqueId: options.uniqueId,
1134
1199
  instanceId: options.instanceId,
1135
1200
  templateId: options.templateId,
1201
+ formType: options.formType,
1136
1202
  schemaVersion: options.runtime.schemaVersion,
1137
1203
  formConfig: options.runtime.formConfig,
1138
1204
  defaultData: options.defaultData,
@@ -1222,7 +1288,7 @@ class RuntimeSheetService {
1222
1288
  this.calculatingDepth += 1;
1223
1289
  let succeeded = false;
1224
1290
  try {
1225
- const pageData = RuntimeSheetService.calculatePages(sheet.dataCenter, this.formState.state);
1291
+ const pageData = this.context.formType === FormTypeEnum.FILE ? [] : RuntimeSheetService.calculatePages(sheet.dataCenter, this.formState.state);
1226
1292
  this.assertAlive();
1227
1293
  sheet.pageData = pageData;
1228
1294
  sheet.paginationError = void 0;
@@ -1423,6 +1489,7 @@ class RuntimeFormStateStore {
1423
1489
  constructor(initialState, subtableFields = [], tableRelations = []) {
1424
1490
  this.tableRelations = tableRelations;
1425
1491
  this.subtableFields = new Set(subtableFields);
1492
+ normalizeEmptyReferenceLabels(initialState);
1426
1493
  this.subtableFields.forEach((field) => ensureTableRowKeys(initialState[field]));
1427
1494
  bindRuntimeTableColumns(initialState, this.tableRelations);
1428
1495
  this.reactiveState = reactive(initialState);
@@ -1445,7 +1512,7 @@ class RuntimeFormStateStore {
1445
1512
  reactiveState;
1446
1513
  /** 每次成功提交一批变更递增一次,保存和提交用它判断快照是否过期。 */
1447
1514
  revision = 0;
1448
- /** 是否存在尚未保存的变更;restore 来源不会把实例标记为脏。 */
1515
+ /** 是否存在尚未保存的变更;数据恢复及保存回填不会把实例标记为脏。 */
1449
1516
  dirty = false;
1450
1517
  /** 当前嵌套事务深度;只有最外层事务结束时才递增 revision 并通知订阅方。 */
1451
1518
  mutationDepth = 0;
@@ -1453,6 +1520,7 @@ class RuntimeFormStateStore {
1453
1520
  pendingPaths = /* @__PURE__ */ new Set();
1454
1521
  /** 最外层事务的变更来源,嵌套写入沿用该来源。 */
1455
1522
  pendingSource = "system";
1523
+ pendingRestoreScope;
1456
1524
  /** 联动、分页失效、自动保存等实例服务登记的变更监听器。 */
1457
1525
  subscribers = /* @__PURE__ */ new Set();
1458
1526
  /** 用户主动修改过的业务路径,供公式和自动填充执行“不覆盖用户输入”策略。 */
@@ -1577,9 +1645,15 @@ class RuntimeFormStateStore {
1577
1645
  target = this.unwrap(target);
1578
1646
  value = this.unwrap(value);
1579
1647
  this.ensureIncomingRowKeys(target, fieldKey, value);
1580
- if (Object.is(toRaw(this.unwrap(target[fieldKey])), toRaw(value))) return;
1581
- this.mutate([path], source, () => {
1582
- target[fieldKey] = value;
1648
+ const valueChanged = !Object.is(toRaw(this.unwrap(target[fieldKey])), toRaw(value));
1649
+ const labelKey = `${fieldKey}_lb_`;
1650
+ const clearLabel = isEmptyReferenceValue(value) && target[labelKey] != null;
1651
+ if (!valueChanged && !clearLabel) return;
1652
+ const paths = valueChanged ? [path] : [];
1653
+ if (clearLabel) paths.push(`${path}_lb_`);
1654
+ this.mutate(paths, source, () => {
1655
+ if (valueChanged) target[fieldKey] = value;
1656
+ if (clearLabel) target[labelKey] = null;
1583
1657
  });
1584
1658
  }
1585
1659
  /** 合并当前行的一组关联字段,累计稳定业务路径,只提交一次变更。 */
@@ -1598,10 +1672,12 @@ class RuntimeFormStateStore {
1598
1672
  /**
1599
1673
  * 保存后只回填后端身份元数据,不能用仅含 id_/front_row_key_ 的数组覆盖当前业务行。
1600
1674
  * 二维内置复合键可通过原始子行键匹配保存前的本地行。
1675
+ * 保存回填只通知实际变化的字段,不作为整份数据恢复触发全部赋值规则。
1601
1676
  */
1602
1677
  patchSavedMetadata(values) {
1603
- const paths = Object.keys(values);
1604
- this.mutate(paths, "restore", () => this.mergeSavedMetadata(this.reactiveState, values));
1678
+ this.transaction("restore", () => this.mergeSavedMetadata(this.state, values), {
1679
+ restoreScope: "fields"
1680
+ });
1605
1681
  }
1606
1682
  /**
1607
1683
  * 用新对象整体替换实例数据,删除旧对象中多余的顶层字段。
@@ -1610,19 +1686,23 @@ class RuntimeFormStateStore {
1610
1686
  replace(values, source = "restore") {
1611
1687
  const paths = /* @__PURE__ */ new Set([...Object.keys(this.reactiveState), ...Object.keys(values)]);
1612
1688
  this.mutate(Array.from(paths), source, () => {
1689
+ this.userModifiedPaths.clear();
1613
1690
  Object.keys(this.reactiveState).forEach((key) => delete this.reactiveState[key]);
1614
1691
  this.assignValues(this.reactiveState, values);
1692
+ normalizeEmptyReferenceLabels(this.reactiveState);
1615
1693
  });
1616
- this.userModifiedPaths.clear();
1617
1694
  if (source === "restore") this.dirty = false;
1618
1695
  }
1619
1696
  /**
1620
1697
  * 将多次深层写入合并成一次变更提交。
1621
1698
  * 嵌套事务只累计路径,最外层 finally 统一递增 revision 并通知订阅方。
1622
1699
  */
1623
- transaction(source, callback) {
1700
+ transaction(source, callback, options) {
1624
1701
  const outermost = this.mutationDepth === 0;
1625
- if (outermost) this.pendingSource = source;
1702
+ if (outermost) {
1703
+ this.pendingSource = source;
1704
+ this.pendingRestoreScope = source === "restore" ? options?.restoreScope : void 0;
1705
+ }
1626
1706
  this.mutationDepth += 1;
1627
1707
  try {
1628
1708
  return callback(this.state);
@@ -1632,7 +1712,9 @@ class RuntimeFormStateStore {
1632
1712
  const paths = Array.from(this.pendingPaths);
1633
1713
  this.pendingPaths.clear();
1634
1714
  const pendingSource = this.pendingSource;
1715
+ const restoreScope = this.pendingRestoreScope;
1635
1716
  this.pendingSource = "system";
1717
+ this.pendingRestoreScope = void 0;
1636
1718
  try {
1637
1719
  if (paths.some(
1638
1720
  (path) => this.tableRelations.some(
@@ -1645,7 +1727,7 @@ class RuntimeFormStateStore {
1645
1727
  });
1646
1728
  }
1647
1729
  } finally {
1648
- if (paths.length) this.commit(paths, pendingSource);
1730
+ if (paths.length) this.commit(paths, pendingSource, restoreScope);
1649
1731
  }
1650
1732
  }
1651
1733
  }
@@ -1695,10 +1777,15 @@ class RuntimeFormStateStore {
1695
1777
  this.userModifiedPaths.clear();
1696
1778
  }
1697
1779
  /** 提交当前事务积累的路径,更新版本和脏状态,然后同步通知实例服务。 */
1698
- commit(paths, source) {
1780
+ commit(paths, source, restoreScope) {
1699
1781
  this.revision += 1;
1700
1782
  if (source !== "restore") this.dirty = true;
1701
- const change = { revision: this.revision, paths, source };
1783
+ const change = {
1784
+ revision: this.revision,
1785
+ paths,
1786
+ source,
1787
+ ...restoreScope ? { restoreScope } : {}
1788
+ };
1702
1789
  this.subscribers.forEach((subscriber) => subscriber(change));
1703
1790
  }
1704
1791
  /** 如果值是 Store 创建的 scoped view,返回它实际包装的 Vue 响应式目标。 */
@@ -1750,7 +1837,8 @@ class RuntimeFormStateStore {
1750
1837
  if (!target || typeof target !== "object" || Array.isArray(target)) return incoming;
1751
1838
  Object.entries(incoming).forEach(([key, value]) => {
1752
1839
  const childPath = path ? `${path}.${key}` : key;
1753
- target[key] = this.mergeSavedMetadata(target[key], value, childPath);
1840
+ const merged = this.mergeSavedMetadata(target[key], value, childPath);
1841
+ this.setObjectField(target, key, merged, "restore");
1754
1842
  });
1755
1843
  return target;
1756
1844
  }
@@ -1792,6 +1880,23 @@ const ARRAY_MUTATIONS = /* @__PURE__ */ new Set([
1792
1880
  "unshift"
1793
1881
  ]);
1794
1882
  const ARRAY_SEARCHES = /* @__PURE__ */ new Set(["includes", "indexOf", "lastIndexOf"]);
1883
+ function isEmptyReferenceValue(value) {
1884
+ return value == null || value === "" || Array.isArray(value) && value.length === 0;
1885
+ }
1886
+ function normalizeEmptyReferenceLabels(value, visited = /* @__PURE__ */ new WeakSet()) {
1887
+ if (!isMutableRecord(value) || visited.has(toRaw(value))) return;
1888
+ visited.add(toRaw(value));
1889
+ Object.entries(value).forEach(([key, child]) => {
1890
+ if (key.endsWith("_lb_")) {
1891
+ const fieldKey = key.slice(0, -4);
1892
+ if (child != null && Object.prototype.hasOwnProperty.call(value, fieldKey) && isEmptyReferenceValue(value[fieldKey])) {
1893
+ value[key] = null;
1894
+ }
1895
+ } else if (key !== "_DICT") {
1896
+ normalizeEmptyReferenceLabels(child, visited);
1897
+ }
1898
+ });
1899
+ }
1795
1900
  function joinPath(basePath, key) {
1796
1901
  return basePath ? `${basePath}.${key}` : key;
1797
1902
  }
@@ -2070,7 +2175,7 @@ function format(template) {
2070
2175
  function isNativeStringType(type4) {
2071
2176
  return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
2072
2177
  }
2073
- function isEmptyValue(value, type4) {
2178
+ function isEmptyValue$1(value, type4) {
2074
2179
  if (value === void 0 || value === null) {
2075
2180
  return true;
2076
2181
  }
@@ -2229,7 +2334,7 @@ function deepMerge(target, source) {
2229
2334
  return target;
2230
2335
  }
2231
2336
  var required$1 = function required(rule, value, source, errors, options, type4) {
2232
- if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
2337
+ if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue$1(value, type4 || rule.type))) {
2233
2338
  errors.push(format(options.messages.required, rule.fullField));
2234
2339
  }
2235
2340
  };
@@ -2416,11 +2521,11 @@ var string = function string2(rule, value, callback, source, options) {
2416
2521
  var errors = [];
2417
2522
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2418
2523
  if (validate) {
2419
- if (isEmptyValue(value, "string") && !rule.required) {
2524
+ if (isEmptyValue$1(value, "string") && !rule.required) {
2420
2525
  return callback();
2421
2526
  }
2422
2527
  rules.required(rule, value, source, errors, options, "string");
2423
- if (!isEmptyValue(value, "string")) {
2528
+ if (!isEmptyValue$1(value, "string")) {
2424
2529
  rules.type(rule, value, source, errors, options);
2425
2530
  rules.range(rule, value, source, errors, options);
2426
2531
  rules.pattern(rule, value, source, errors, options);
@@ -2435,7 +2540,7 @@ var method2 = function method3(rule, value, callback, source, options) {
2435
2540
  var errors = [];
2436
2541
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2437
2542
  if (validate) {
2438
- if (isEmptyValue(value) && !rule.required) {
2543
+ if (isEmptyValue$1(value) && !rule.required) {
2439
2544
  return callback();
2440
2545
  }
2441
2546
  rules.required(rule, value, source, errors, options);
@@ -2452,7 +2557,7 @@ var number2 = function number3(rule, value, callback, source, options) {
2452
2557
  if (value === "") {
2453
2558
  value = void 0;
2454
2559
  }
2455
- if (isEmptyValue(value) && !rule.required) {
2560
+ if (isEmptyValue$1(value) && !rule.required) {
2456
2561
  return callback();
2457
2562
  }
2458
2563
  rules.required(rule, value, source, errors, options);
@@ -2467,7 +2572,7 @@ var _boolean = function _boolean2(rule, value, callback, source, options) {
2467
2572
  var errors = [];
2468
2573
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2469
2574
  if (validate) {
2470
- if (isEmptyValue(value) && !rule.required) {
2575
+ if (isEmptyValue$1(value) && !rule.required) {
2471
2576
  return callback();
2472
2577
  }
2473
2578
  rules.required(rule, value, source, errors, options);
@@ -2481,11 +2586,11 @@ var regexp2 = function regexp3(rule, value, callback, source, options) {
2481
2586
  var errors = [];
2482
2587
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2483
2588
  if (validate) {
2484
- if (isEmptyValue(value) && !rule.required) {
2589
+ if (isEmptyValue$1(value) && !rule.required) {
2485
2590
  return callback();
2486
2591
  }
2487
2592
  rules.required(rule, value, source, errors, options);
2488
- if (!isEmptyValue(value)) {
2593
+ if (!isEmptyValue$1(value)) {
2489
2594
  rules.type(rule, value, source, errors, options);
2490
2595
  }
2491
2596
  }
@@ -2495,7 +2600,7 @@ var integer2 = function integer3(rule, value, callback, source, options) {
2495
2600
  var errors = [];
2496
2601
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2497
2602
  if (validate) {
2498
- if (isEmptyValue(value) && !rule.required) {
2603
+ if (isEmptyValue$1(value) && !rule.required) {
2499
2604
  return callback();
2500
2605
  }
2501
2606
  rules.required(rule, value, source, errors, options);
@@ -2510,7 +2615,7 @@ var floatFn = function floatFn2(rule, value, callback, source, options) {
2510
2615
  var errors = [];
2511
2616
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2512
2617
  if (validate) {
2513
- if (isEmptyValue(value) && !rule.required) {
2618
+ if (isEmptyValue$1(value) && !rule.required) {
2514
2619
  return callback();
2515
2620
  }
2516
2621
  rules.required(rule, value, source, errors, options);
@@ -2540,7 +2645,7 @@ var object2 = function object3(rule, value, callback, source, options) {
2540
2645
  var errors = [];
2541
2646
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2542
2647
  if (validate) {
2543
- if (isEmptyValue(value) && !rule.required) {
2648
+ if (isEmptyValue$1(value) && !rule.required) {
2544
2649
  return callback();
2545
2650
  }
2546
2651
  rules.required(rule, value, source, errors, options);
@@ -2555,7 +2660,7 @@ var enumerable2 = function enumerable3(rule, value, callback, source, options) {
2555
2660
  var errors = [];
2556
2661
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2557
2662
  if (validate) {
2558
- if (isEmptyValue(value) && !rule.required) {
2663
+ if (isEmptyValue$1(value) && !rule.required) {
2559
2664
  return callback();
2560
2665
  }
2561
2666
  rules.required(rule, value, source, errors, options);
@@ -2569,11 +2674,11 @@ var pattern2 = function pattern3(rule, value, callback, source, options) {
2569
2674
  var errors = [];
2570
2675
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2571
2676
  if (validate) {
2572
- if (isEmptyValue(value, "string") && !rule.required) {
2677
+ if (isEmptyValue$1(value, "string") && !rule.required) {
2573
2678
  return callback();
2574
2679
  }
2575
2680
  rules.required(rule, value, source, errors, options);
2576
- if (!isEmptyValue(value, "string")) {
2681
+ if (!isEmptyValue$1(value, "string")) {
2577
2682
  rules.pattern(rule, value, source, errors, options);
2578
2683
  }
2579
2684
  }
@@ -2583,11 +2688,11 @@ var date2 = function date3(rule, value, callback, source, options) {
2583
2688
  var errors = [];
2584
2689
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2585
2690
  if (validate) {
2586
- if (isEmptyValue(value, "date") && !rule.required) {
2691
+ if (isEmptyValue$1(value, "date") && !rule.required) {
2587
2692
  return callback();
2588
2693
  }
2589
2694
  rules.required(rule, value, source, errors, options);
2590
- if (!isEmptyValue(value, "date")) {
2695
+ if (!isEmptyValue$1(value, "date")) {
2591
2696
  var dateObject;
2592
2697
  if (value instanceof Date) {
2593
2698
  dateObject = value;
@@ -2613,11 +2718,11 @@ var type2 = function type3(rule, value, callback, source, options) {
2613
2718
  var errors = [];
2614
2719
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2615
2720
  if (validate) {
2616
- if (isEmptyValue(value, ruleType) && !rule.required) {
2721
+ if (isEmptyValue$1(value, ruleType) && !rule.required) {
2617
2722
  return callback();
2618
2723
  }
2619
2724
  rules.required(rule, value, source, errors, options, ruleType);
2620
- if (!isEmptyValue(value, ruleType)) {
2725
+ if (!isEmptyValue$1(value, ruleType)) {
2621
2726
  rules.type(rule, value, source, errors, options);
2622
2727
  }
2623
2728
  }
@@ -2627,7 +2732,7 @@ var any = function any2(rule, value, callback, source, options) {
2627
2732
  var errors = [];
2628
2733
  var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
2629
2734
  if (validate) {
2630
- if (isEmptyValue(value) && !rule.required) {
2735
+ if (isEmptyValue$1(value) && !rule.required) {
2631
2736
  return callback();
2632
2737
  }
2633
2738
  rules.required(rule, value, source, errors, options);
@@ -2964,6 +3069,505 @@ Schema.register = function register(type4, validator) {
2964
3069
  Schema.warning = warning;
2965
3070
  Schema.messages = messages;
2966
3071
  Schema.validators = validators;
3072
+ const stampKeys = [
3073
+ "sealId",
3074
+ "sealName",
3075
+ "sealType",
3076
+ "sealImage",
3077
+ "sealUserId",
3078
+ "sealUserName",
3079
+ "sealUserTime"
3080
+ ];
3081
+ function isSealPosition(value) {
3082
+ if (!value || typeof value !== "object") return false;
3083
+ const p = value;
3084
+ return typeof p.sheetId === "string" && !!p.sheetId && Number.isInteger(p.pageIndex) && p.pageIndex >= 0 && Number.isFinite(p.leftMm) && p.leftMm >= 0 && Number.isFinite(p.topMm) && p.topMm >= 0;
3085
+ }
3086
+ function readSealValue(raw, fallback) {
3087
+ let parsed = {};
3088
+ try {
3089
+ const value = typeof raw === "string" ? JSON.parse(raw || "{}") : raw;
3090
+ if (value && typeof value === "object" && !Array.isArray(value)) parsed = value;
3091
+ } catch {
3092
+ }
3093
+ const stamp = Object.fromEntries(
3094
+ stampKeys.map((key) => [key, typeof parsed[key] === "string" ? parsed[key] : ""])
3095
+ );
3096
+ return {
3097
+ ...stamp,
3098
+ sealPosition: { ...isSealPosition(parsed.sealPosition) ? parsed.sealPosition : fallback }
3099
+ };
3100
+ }
3101
+ function isSealStamped(raw) {
3102
+ try {
3103
+ const value = typeof raw === "string" ? JSON.parse(raw || "{}") : raw;
3104
+ return !!value && typeof value.sealId === "string" && !!value.sealId && typeof value.sealImage === "string" && !!value.sealImage;
3105
+ } catch {
3106
+ return false;
3107
+ }
3108
+ }
3109
+ function isValidSealValue(raw) {
3110
+ try {
3111
+ const value = typeof raw === "string" ? JSON.parse(raw || "{}") : raw;
3112
+ return !!value && stampKeys.every((key) => typeof value[key] === "string") && isSealPosition(value.sealPosition) && (stampKeys.every((key) => !value[key]) || stampKeys.every((key) => !!value[key]));
3113
+ } catch {
3114
+ return false;
3115
+ }
3116
+ }
3117
+ function moveSealValue(raw, fallback, position) {
3118
+ return JSON.stringify({ ...readSealValue(raw, fallback), sealPosition: { ...position } });
3119
+ }
3120
+ function stampSealValue(raw, fallback, stamp) {
3121
+ const current = readSealValue(raw, fallback);
3122
+ const next = readSealValue({ ...stamp, sealPosition: current.sealPosition }, fallback);
3123
+ return JSON.stringify(next);
3124
+ }
3125
+ function clearSealValue(raw, fallback) {
3126
+ return JSON.stringify(
3127
+ readSealValue({ sealPosition: readSealValue(raw, fallback).sealPosition }, fallback)
3128
+ );
3129
+ }
3130
+ function normalizeSealDiameter(value) {
3131
+ const diameter = Number(value);
3132
+ return Number.isFinite(diameter) && diameter > 0 ? Math.min(diameter, 200) : 42;
3133
+ }
3134
+ function clampSealPosition(position, widthMm, heightMm, diameterMm) {
3135
+ return {
3136
+ ...position,
3137
+ leftMm: Math.max(0, Math.min(position.leftMm, Math.max(0, widthMm - diameterMm))),
3138
+ topMm: Math.max(0, Math.min(position.topMm, Math.max(0, heightMm - diameterMm)))
3139
+ };
3140
+ }
3141
+ function initializeSealFields(fields, formData) {
3142
+ for (const { props } of fields) {
3143
+ if (!props.field || props.isFieldModel || props.subFieldKey) continue;
3144
+ const raw = formData[props.field];
3145
+ if (raw == null || raw === "") {
3146
+ formData[props.field] = JSON.stringify(readSealValue("", props.sealPosition));
3147
+ continue;
3148
+ }
3149
+ try {
3150
+ const parsed = typeof raw === "string" ? JSON.parse(raw) : raw;
3151
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) continue;
3152
+ if (!isSealPosition(parsed.sealPosition)) {
3153
+ formData[props.field] = JSON.stringify({
3154
+ ...parsed,
3155
+ sealPosition: { ...props.sealPosition }
3156
+ });
3157
+ } else if (typeof raw !== "string") {
3158
+ formData[props.field] = JSON.stringify(parsed);
3159
+ }
3160
+ } catch {
3161
+ }
3162
+ }
3163
+ }
3164
+ const { identify, calculate: calculate$1 } = {
3165
+ identify: (expression) => window.NocodeAdapter.utils?.formulaIdentify?.(expression) ?? [],
3166
+ calculate: (expression, data) => window.NocodeAdapter.utils?.formulaCalculate?.(expression, data)
3167
+ };
3168
+ const getFieldDataValue = (parseInfo, formData) => {
3169
+ const getTextValue = (processedKey, value) => {
3170
+ const textValue = value ?? formData?.[processedKey] ?? "";
3171
+ return Array.isArray(textValue) ? textValue.join() : textValue;
3172
+ };
3173
+ const { type: type4, processed, hashValue } = parseInfo;
3174
+ if (type4 === "hash") {
3175
+ const tableData = toRaw(formData?.[hashValue] || []);
3176
+ return tableData.filter((d) => !d.deleted_).map((row) => getTextValue(processed, row?.[processed])).filter((i) => !isNil(i));
3177
+ }
3178
+ return getTextValue(processed, formData?.[processed]);
3179
+ };
3180
+ const parseFormulaVar = (formulaVar) => {
3181
+ const result = {
3182
+ original: formulaVar,
3183
+ type: "",
3184
+ processed: "",
3185
+ hashValue: "",
3186
+ dataType: ""
3187
+ };
3188
+ if (/^\$([^$]+)\$\.(.+)$/.test(formulaVar)) {
3189
+ const match = formulaVar.match(/^\$([^$]+)\$\.(.+)$/);
3190
+ result.type = "hash";
3191
+ result.processed = match[2];
3192
+ result.hashValue = match[1];
3193
+ result.dataType = "globType";
3194
+ } else if (/^_\.(.+)$/.test(formulaVar)) {
3195
+ const match = formulaVar.match(/^_\.(.+)$/);
3196
+ result.type = "underscore";
3197
+ result.processed = match[1];
3198
+ result.dataType = "currentRowType";
3199
+ } else {
3200
+ result.type = "plain";
3201
+ result.processed = formulaVar;
3202
+ result.dataType = "globType";
3203
+ }
3204
+ return result;
3205
+ };
3206
+ const getParseFormulaVarInfos = (expr) => {
3207
+ const rowArgs = expr ? identify(expr) : [];
3208
+ return {
3209
+ rowArgs,
3210
+ parseInfos: rowArgs.map((curr) => parseFormulaVar(curr))
3211
+ };
3212
+ };
3213
+ const resolveFormulaData = (expr, formData, instanceFormState) => {
3214
+ const rowArgs = identify(expr);
3215
+ const formulaData = isEmpty(rowArgs) ? {} : rowArgs.reduce((total, curr) => {
3216
+ const parseInfo = parseFormulaVar(curr);
3217
+ total[curr] = getFieldDataValue(
3218
+ parseInfo,
3219
+ parseInfo.dataType === "currentRowType" ? formData : instanceFormState
3220
+ );
3221
+ return total;
3222
+ }, {});
3223
+ return formulaData;
3224
+ };
3225
+ const calculateFormula = async (expr, formData, instanceFormState) => calculate$1(expr, resolveFormulaData(expr, formData, instanceFormState));
3226
+ const isEmptyValue = (value) => {
3227
+ return value === void 0 || value === null || typeof value === "string" && value.trim() === "" || Array.isArray(value) && value.length === 0;
3228
+ };
3229
+ const compareByOp = (left, right, op) => {
3230
+ switch (op) {
3231
+ case RangeCompareOp.LT:
3232
+ return left < right;
3233
+ case RangeCompareOp.LE:
3234
+ return left <= right;
3235
+ case RangeCompareOp.GT:
3236
+ return left > right;
3237
+ case RangeCompareOp.GE:
3238
+ default:
3239
+ return left >= right;
3240
+ }
3241
+ };
3242
+ const rangeCompareMessage = (op, val) => {
3243
+ switch (op) {
3244
+ case RangeCompareOp.LT:
3245
+ return $t("sys.fieldValueNotGreaterOrEqual", { val });
3246
+ case RangeCompareOp.LE:
3247
+ return $t("sys.fieldValueNoMoreThan", { val });
3248
+ case RangeCompareOp.GT:
3249
+ return $t("sys.fieldValueNotLessOrEqual", { val });
3250
+ case RangeCompareOp.GE:
3251
+ default:
3252
+ return $t("sys.fieldValueNotLessThan", { val });
3253
+ }
3254
+ };
3255
+ const toUnixTimestamp = (input) => {
3256
+ if (isNil(input) || input === "") return null;
3257
+ const asNumber = typeof input === "number" || typeof input === "string" && /^-?\d+(\.\d+)?$/.test(input.trim());
3258
+ if (asNumber) {
3259
+ const n = Number(input);
3260
+ if (Number.isNaN(n)) return null;
3261
+ const parsed2 = n > 1e12 ? dayjs(n) : dayjs.unix(n);
3262
+ return parsed2.isValid() ? parsed2.unix() : null;
3263
+ }
3264
+ const parsed = dayjs(input);
3265
+ return parsed.isValid() ? parsed.unix() : null;
3266
+ };
3267
+ const buildError = (validatorInfo, message2) => JSON.stringify({ ...validatorInfo, message: message2 });
3268
+ function areValidationCommentsEqual(left, right) {
3269
+ const serialize = (comments) => JSON.stringify(
3270
+ comments,
3271
+ (_key, value) => value && typeof value === "object" && "message" in value ? { ...value, message: value.message } : value
3272
+ );
3273
+ return serialize(left) === serialize(right);
3274
+ }
3275
+ const createRule = (validator, message2, trigger = "change") => ({
3276
+ required: true,
3277
+ validator,
3278
+ message: message2,
3279
+ trigger
3280
+ });
3281
+ function relocateDeletedRowsToEnd(rows = []) {
3282
+ const active = [];
3283
+ const deleted = [];
3284
+ for (const row of rows) {
3285
+ if (row?.deleted_) deleted.push(row);
3286
+ else active.push(row);
3287
+ }
3288
+ return [...active, ...deleted];
3289
+ }
3290
+ function filterRulesByTrigger(rules2, trigger) {
3291
+ return rules2.filter((rule) => {
3292
+ const ruleTrigger = rule.trigger;
3293
+ if (!ruleTrigger) return trigger === "change";
3294
+ if (trigger === "blur") {
3295
+ return ruleTrigger === "blur" || ruleTrigger === "change";
3296
+ }
3297
+ return ruleTrigger === trigger;
3298
+ });
3299
+ }
3300
+ function assembleRules(input) {
3301
+ const { showRequired, fieldType, validatorInfo, props } = input;
3302
+ const {
3303
+ minlength,
3304
+ maxlength,
3305
+ regex,
3306
+ regexHint,
3307
+ validateTrue,
3308
+ validateFalse,
3309
+ enableRangeValidate,
3310
+ maxValidateMode,
3311
+ minValidateMode,
3312
+ maxCompareOp,
3313
+ minCompareOp,
3314
+ minValue,
3315
+ maxValue,
3316
+ minFormulaExpr,
3317
+ maxFormulaExpr,
3318
+ minDate,
3319
+ maxDate,
3320
+ minDateFormulaExpr,
3321
+ maxDateFormulaExpr,
3322
+ maxDateValidateMode,
3323
+ minDateValidateMode
3324
+ } = props;
3325
+ const resolvedMaxCompareOp = maxCompareOp ?? RangeCompareOp.LE;
3326
+ const resolvedMinCompareOp = minCompareOp ?? RangeCompareOp.GE;
3327
+ const RuleProps = [];
3328
+ if (props.bizType === FIELD_TYPE.SEAL) {
3329
+ if (showRequired) {
3330
+ RuleProps.push(
3331
+ createRule(
3332
+ (_rule, value) => isSealStamped(value),
3333
+ buildError(
3334
+ { ...validatorInfo, validationCode: "seal-required" },
3335
+ $t("sys.fieldRequired")
3336
+ ),
3337
+ "manual"
3338
+ )
3339
+ );
3340
+ }
3341
+ RuleProps.push(createRule((_rule, value) => isEmptyValue(value) || isValidSealValue(value), buildError(validatorInfo, $t("sys.seal.invalid"))));
3342
+ return RuleProps;
3343
+ }
3344
+ if (showRequired) {
3345
+ RuleProps.push(
3346
+ createRule(
3347
+ (_rule, value) => !isEmptyValue(value),
3348
+ buildError(validatorInfo, $t("sys.fieldRequired")),
3349
+ "manual"
3350
+ )
3351
+ );
3352
+ }
3353
+ if (!isNil(minlength)) {
3354
+ RuleProps.push(
3355
+ createRule((_rule, value) => {
3356
+ if (isEmptyValue(value)) return true;
3357
+ return String(value).length >= minlength;
3358
+ }, buildError(validatorInfo, $t("sys.fieldLengthNotLessThan", { len: minlength })))
3359
+ );
3360
+ }
3361
+ const effectiveMaxlength = isNil(maxlength) && fieldType === FIELD_TYPE.TEXT ? 1024 : maxlength;
3362
+ if (!isNil(effectiveMaxlength)) {
3363
+ RuleProps.push(
3364
+ createRule((_rule, value) => {
3365
+ if (isEmptyValue(value)) return true;
3366
+ return String(value).length <= effectiveMaxlength;
3367
+ }, buildError(validatorInfo, $t("sys.fieldLengthNoMoreThan", { len: effectiveMaxlength })))
3368
+ );
3369
+ }
3370
+ if (regex) {
3371
+ RuleProps.push(
3372
+ createRule((_rule, value) => {
3373
+ if (isEmptyValue(value)) return true;
3374
+ return new RegExp(regex).test(value);
3375
+ }, buildError(validatorInfo, regexHint ?? $t("sys.fieldFormatError")))
3376
+ );
3377
+ }
3378
+ if (validateTrue) {
3379
+ RuleProps.push({
3380
+ required: true,
3381
+ trigger: "manual",
3382
+ validator: (_rule, value) => value === true,
3383
+ message: buildError(validatorInfo, $t("sys.fieldValueNeedTrue"))
3384
+ });
3385
+ }
3386
+ if (validateFalse) {
3387
+ RuleProps.push({
3388
+ required: true,
3389
+ trigger: "manual",
3390
+ validator: (_rule, value) => value === false,
3391
+ message: buildError(validatorInfo, $t("sys.fieldValueNeedFalse"))
3392
+ });
3393
+ }
3394
+ if (!enableRangeValidate) {
3395
+ return RuleProps;
3396
+ }
3397
+ if (minValidateMode === RangeValidateMode.Fixed_Number && !isEmptyValue(minValue)) {
3398
+ RuleProps.push(
3399
+ createRule((_rule, value) => {
3400
+ if (isEmptyValue(value)) return true;
3401
+ return compareByOp(Number(value), Number(minValue), resolvedMinCompareOp);
3402
+ }, buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, minValue)))
3403
+ );
3404
+ }
3405
+ if (minValidateMode === RangeValidateMode.Variable_Validate && minFormulaExpr) {
3406
+ RuleProps.push({
3407
+ required: true,
3408
+ trigger: "change",
3409
+ validator: async (_rule, value, _callback, _source, options) => {
3410
+ const currentFormData = getCurrentFormData(_rule, options);
3411
+ const formulaValue = await calculateFormula(
3412
+ minFormulaExpr,
3413
+ currentFormData,
3414
+ options?.formData
3415
+ );
3416
+ if (isEmptyValue(formulaValue)) {
3417
+ return Promise.resolve();
3418
+ }
3419
+ const parsedMin = parseFloat(formulaValue);
3420
+ if (!isNaN(parsedMin)) {
3421
+ if (isEmptyValue(value)) {
3422
+ return Promise.resolve();
3423
+ }
3424
+ if (!compareByOp(Number(value), parsedMin, resolvedMinCompareOp)) {
3425
+ return Promise.reject(
3426
+ new Error(
3427
+ buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, parsedMin))
3428
+ )
3429
+ );
3430
+ }
3431
+ }
3432
+ return Promise.resolve();
3433
+ }
3434
+ });
3435
+ }
3436
+ if (maxValidateMode === RangeValidateMode.Fixed_Number && !isEmptyValue(maxValue)) {
3437
+ RuleProps.push(
3438
+ createRule((_rule, value) => {
3439
+ if (isEmptyValue(value)) return true;
3440
+ return compareByOp(Number(value), Number(maxValue), resolvedMaxCompareOp);
3441
+ }, buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, maxValue)))
3442
+ );
3443
+ }
3444
+ if (maxValidateMode === RangeValidateMode.Variable_Validate && maxFormulaExpr) {
3445
+ RuleProps.push({
3446
+ required: true,
3447
+ trigger: "change",
3448
+ validator: async (_rule, value, _callback, _source, options) => {
3449
+ const currentFormData = getCurrentFormData(_rule, options);
3450
+ const formulaValue = await calculateFormula(
3451
+ maxFormulaExpr,
3452
+ currentFormData,
3453
+ options?.formData
3454
+ );
3455
+ if (isEmptyValue(formulaValue)) {
3456
+ return Promise.resolve();
3457
+ }
3458
+ const parsedMax = parseFloat(formulaValue);
3459
+ if (!isNaN(parsedMax)) {
3460
+ if (isEmptyValue(value)) {
3461
+ return Promise.resolve();
3462
+ }
3463
+ if (!compareByOp(Number(value), parsedMax, resolvedMaxCompareOp)) {
3464
+ return Promise.reject(
3465
+ new Error(
3466
+ buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, parsedMax))
3467
+ )
3468
+ );
3469
+ }
3470
+ }
3471
+ return Promise.resolve();
3472
+ }
3473
+ });
3474
+ }
3475
+ if (minDateValidateMode === RangeValidateMode.Fixed_Number && minDate) {
3476
+ RuleProps.push(
3477
+ createRule((_rule, value) => {
3478
+ if (isEmptyValue(value)) return true;
3479
+ const inputTime = dayjs(value).unix();
3480
+ const minTimestamp = dayjs(minDate).unix();
3481
+ if (!dayjs(value).isValid() || !dayjs(minDate).isValid()) return true;
3482
+ return compareByOp(inputTime, minTimestamp, resolvedMinCompareOp);
3483
+ }, buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, minDate)))
3484
+ );
3485
+ }
3486
+ if (maxDateValidateMode === RangeValidateMode.Fixed_Number && maxDate) {
3487
+ RuleProps.push(
3488
+ createRule((_rule, value) => {
3489
+ if (isEmptyValue(value)) return true;
3490
+ const inputTime = dayjs(value).unix();
3491
+ const maxTimestamp = dayjs(maxDate).unix();
3492
+ if (!dayjs(value).isValid() || !dayjs(maxDate).isValid()) return true;
3493
+ return compareByOp(inputTime, maxTimestamp, resolvedMaxCompareOp);
3494
+ }, buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, maxDate)))
3495
+ );
3496
+ }
3497
+ if (minDateValidateMode === RangeValidateMode.Variable_Validate && minDateFormulaExpr) {
3498
+ RuleProps.push({
3499
+ required: true,
3500
+ trigger: "change",
3501
+ validator: async (_rule, value, _callback, _source, options) => {
3502
+ const currentFormData = getCurrentFormData(_rule, options);
3503
+ const formulaValue = await calculateFormula(
3504
+ minDateFormulaExpr,
3505
+ currentFormData,
3506
+ options?.formData
3507
+ );
3508
+ const limitTime = toUnixTimestamp(formulaValue);
3509
+ if (limitTime !== null) {
3510
+ if (isEmptyValue(value)) {
3511
+ return Promise.resolve();
3512
+ }
3513
+ if (!dayjs(value).isValid()) {
3514
+ return Promise.resolve();
3515
+ }
3516
+ const inputTime = dayjs(value).unix();
3517
+ const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
3518
+ if (!compareByOp(inputTime, limitTime, resolvedMinCompareOp)) {
3519
+ return Promise.reject(
3520
+ new Error(
3521
+ buildError(
3522
+ validatorInfo,
3523
+ rangeCompareMessage(resolvedMinCompareOp, dayjs.unix(limitTime).format(fmt))
3524
+ )
3525
+ )
3526
+ );
3527
+ }
3528
+ }
3529
+ return Promise.resolve();
3530
+ }
3531
+ });
3532
+ }
3533
+ if (maxDateValidateMode === RangeValidateMode.Variable_Validate && maxDateFormulaExpr) {
3534
+ RuleProps.push({
3535
+ required: true,
3536
+ trigger: "change",
3537
+ validator: async (_rule, value, _callback, _source, options) => {
3538
+ const currentFormData = getCurrentFormData(_rule, options);
3539
+ const formulaValue = await calculateFormula(
3540
+ maxDateFormulaExpr,
3541
+ currentFormData,
3542
+ options?.formData
3543
+ );
3544
+ const limitTime = toUnixTimestamp(formulaValue);
3545
+ if (limitTime !== null) {
3546
+ if (isEmptyValue(value)) {
3547
+ return Promise.resolve();
3548
+ }
3549
+ if (!dayjs(value).isValid()) {
3550
+ return Promise.resolve();
3551
+ }
3552
+ const inputTime = dayjs(value).unix();
3553
+ const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
3554
+ if (!compareByOp(inputTime, limitTime, resolvedMaxCompareOp)) {
3555
+ return Promise.reject(
3556
+ new Error(
3557
+ buildError(
3558
+ validatorInfo,
3559
+ rangeCompareMessage(resolvedMaxCompareOp, dayjs.unix(limitTime).format(fmt))
3560
+ )
3561
+ )
3562
+ );
3563
+ }
3564
+ }
3565
+ return Promise.resolve();
3566
+ }
3567
+ });
3568
+ }
3569
+ return RuleProps;
3570
+ }
2967
3571
  function resolveKeepExceptionHighlight(formValue, fieldValue) {
2968
3572
  if (typeof fieldValue === "boolean") {
2969
3573
  return fieldValue;
@@ -3089,7 +3693,7 @@ function clearResolvedManualErrors(map, resolvePayload) {
3089
3693
  if (!payload) continue;
3090
3694
  const hasManual = filterRulesByTrigger(payload.rules, "manual").length > 0;
3091
3695
  const hasLive = filterRulesByTrigger(payload.rules, "change").length > 0;
3092
- if (hasManual && !hasLive && !isEmptyValue$1(payload.value)) {
3696
+ if (hasManual && !hasLive && !isEmptyValue(payload.value)) {
3093
3697
  delete next[path];
3094
3698
  }
3095
3699
  }
@@ -3103,7 +3707,7 @@ function mergeLiveValidation(current, liveResult, livePaths, resolvePayload) {
3103
3707
  continue;
3104
3708
  }
3105
3709
  const payload = resolvePayload(path);
3106
- const keepManualComment = !!payload && filterRulesByTrigger(payload.rules, "manual").length > 0 && isEmptyValue$1(payload.value) && !!base[path]?.length;
3710
+ const keepManualComment = !!payload && filterRulesByTrigger(payload.rules, "manual").length > 0 && isEmptyValue(payload.value) && !!base[path]?.length;
3107
3711
  if (!keepManualComment) {
3108
3712
  delete base[path];
3109
3713
  }
@@ -3146,7 +3750,7 @@ function mergeDisplayValidation(current, displayResult, ruleKeys, validatedPaths
3146
3750
  next[path] = displayResult[path];
3147
3751
  } else {
3148
3752
  const payload = resolvePayload(path);
3149
- const keepManualComment = !!payload && filterRulesByTrigger(payload.rules, "manual").length > 0 && isEmptyValue$1(payload.value) && !!next[path]?.length;
3753
+ const keepManualComment = !!payload && filterRulesByTrigger(payload.rules, "manual").length > 0 && isEmptyValue(payload.value) && !!next[path]?.length;
3150
3754
  if (!keepManualComment) delete next[path];
3151
3755
  }
3152
3756
  }
@@ -3309,8 +3913,8 @@ class RuntimeValidationService {
3309
3913
  }
3310
3914
  function matchesPattern(pattern4, path) {
3311
3915
  if (!pattern4.includes("*")) return pattern4 === path;
3312
- const expected = pattern4.split(".");
3313
- const actual = path.split(".");
3916
+ const expected = splitRuntimeDataPath(pattern4);
3917
+ const actual = splitRuntimeDataPath(path);
3314
3918
  return expected.length === actual.length && expected.every((part, index) => part === "*" || part === actual[index]);
3315
3919
  }
3316
3920
  class RuntimeFieldRegistry {
@@ -4145,7 +4749,7 @@ class BomEntryValidator {
4145
4749
  this.productCodes[i.product_id_] = i.product_code_;
4146
4750
  });
4147
4751
  }
4148
- this.hasConsumed = this.calcQtyConsumed(this.historyData);
4752
+ this.hasConsumed = this.calcQtyConsumed(this.historyData, "history");
4149
4753
  }
4150
4754
  bomEntry;
4151
4755
  enableSequenceLoading;
@@ -4170,7 +4774,7 @@ class BomEntryValidator {
4170
4774
  }
4171
4775
  /** 需求总量 = 数量倍数 × BOM 单位用量 */
4172
4776
  get total() {
4173
- return this.materialNoNum * this.bomEntry.qty_required_;
4777
+ return this.materialNoNum * Number(this.bomEntry.qty_required_);
4174
4778
  }
4175
4779
  /**
4176
4780
  * 翻译物料的code
@@ -4185,13 +4789,15 @@ class BomEntryValidator {
4185
4789
  * @param arr
4186
4790
  * @return {*}
4187
4791
  */
4188
- filterGroupData(arr) {
4189
- return arr.filter((i) => this.isRowInGroup(i) && i.product_id_);
4792
+ filterGroupData(arr, source = "current") {
4793
+ return arr.filter((i) => this.isRowInGroup(i, source) && i.product_id_);
4190
4794
  }
4191
- /** 行是否属于本 BOM 组(优先 bom_entry_id_,避免跨组 product_id_ 误判) */
4192
- isRowInGroup(row) {
4795
+ /** 按数据来源优先匹配关联标识,无关联标识时按物料判断。 */
4796
+ isRowInGroup(row, source = "current") {
4193
4797
  if (row.deleted_) return false;
4194
- if (row.bom_entry_id_) return row.bom_entry_id_ === this.bomEntry.id_;
4798
+ const entryId = source === "history" ? row.bom_entry_parent_id_ : row.bom_entry_id_;
4799
+ const targetId = source === "history" ? this.bomEntry.parent_id_ : this.bomEntry.id_;
4800
+ if (entryId) return entryId === targetId;
4195
4801
  if (row.product_id_) return this.productIds.includes(row.product_id_);
4196
4802
  return false;
4197
4803
  }
@@ -4322,14 +4928,14 @@ class BomEntryValidator {
4322
4928
  * @param arr
4323
4929
  * @return {*}
4324
4930
  */
4325
- calcQtyConsumed(arr = this.historyData) {
4326
- const groupData = this.filterGroupData(arr);
4327
- return groupData.reduce((acc, cur) => acc + (cur.qty_ ?? 0), 0);
4931
+ calcQtyConsumed(arr = this.historyData, source = "history") {
4932
+ const groupData = this.filterGroupData(arr, source);
4933
+ return groupData.reduce((acc, cur) => acc + Number(cur.qty_ ?? 0), 0);
4328
4934
  }
4329
4935
  /** 上下限校验统一按需求单位口径取转换数量,历史数据未转换时兼容原数量。 */
4330
- calcQtyForBounds(arr) {
4331
- const groupData = this.filterGroupData(arr);
4332
- return groupData.reduce((acc, cur) => acc + (cur.qty_transfer_ ?? cur.qty_ ?? 0), 0);
4936
+ calcQtyForBounds(arr, source = "current") {
4937
+ const groupData = this.filterGroupData(arr, source);
4938
+ return groupData.reduce((acc, cur) => acc + Number(cur.qty_transfer_ ?? cur.qty_ ?? 0), 0);
4333
4939
  }
4334
4940
  /**
4335
4941
  * 计算自定义的数量校验的最大值和最小值
@@ -4344,9 +4950,10 @@ class BomEntryValidator {
4344
4950
  try {
4345
4951
  const json = JSON.parse(str);
4346
4952
  if (json.expr) {
4347
- return await window.gct_expression.execute(json.expr, {
4348
- qty_required_: data.qty_required_
4953
+ const value = await window.gct_expression.execute(json.expr, {
4954
+ qty_required_: data.qty_required_ == null ? data.qty_required_ : Number(data.qty_required_)
4349
4955
  });
4956
+ return value == null ? void 0 : Number(value);
4350
4957
  } else {
4351
4958
  console.warn("没有配置表达式");
4352
4959
  }
@@ -4370,11 +4977,11 @@ class BomEntryValidator {
4370
4977
  return;
4371
4978
  }
4372
4979
  const groupData = this.filterGroupData(arr);
4373
- const loaded = this.calcQtyConsumed(arr);
4980
+ const loaded = this.calcQtyConsumed(arr, "current");
4374
4981
  let required4 = this.remainingNum;
4375
4982
  if (this.isCustomRequiredQty) {
4376
- const currentQty = groupData[0]?.qty_required_;
4377
- if (typeof currentQty !== "number" || !Number.isFinite(currentQty) || currentQty <= 0) {
4983
+ const currentQty = Number(groupData[0]?.qty_required_);
4984
+ if (!Number.isFinite(currentQty) || currentQty <= 0) {
4378
4985
  throw new Error(
4379
4986
  groupNo != null && groupNo > 0 ? `序号${groupNo},需求数量必须大于 0` : "需求数量必须大于 0"
4380
4987
  );
@@ -4403,7 +5010,7 @@ class BomEntryValidator {
4403
5010
  break;
4404
5011
  case "bounds": {
4405
5012
  const groupData2 = this.filterGroupData(arr);
4406
- const consumeSum = this.calcQtyForBounds(arr) + this.calcQtyForBounds(this.historyData);
5013
+ const consumeSum = this.calcQtyForBounds(arr) + this.calcQtyForBounds(this.historyData, "history");
4407
5014
  const { min, max } = await this.calcCustomNumberLimit(groupData2[0]);
4408
5015
  if (min !== void 0 && consumeSum < min || max !== void 0 && consumeSum > max) {
4409
5016
  fail($t("sys.qtyValidationRule.bounds", { min, max }));
@@ -5188,7 +5795,7 @@ function calcGroupRowSpans(rows, validator) {
5188
5795
  function calcGroupQtyConsumedTotal(entryIdx, tableData, validator) {
5189
5796
  if (entryIdx < 0) return 0;
5190
5797
  return tableData.reduce((sum, row) => {
5191
- return validator.resolveEntryIndex(row) === entryIdx ? sum + (row.qty_ ?? 0) : sum;
5798
+ return validator.resolveEntryIndex(row) === entryIdx ? sum + Number(row.qty_ ?? 0) : sum;
5192
5799
  }, 0);
5193
5800
  }
5194
5801
  function syncGroupQtyConsumedTotals(tableData, validator) {
@@ -5246,7 +5853,8 @@ class MaterialConsumeTableController {
5246
5853
  constructor(tmplBomController, tmplBom, options = {}) {
5247
5854
  this.tmplBomController = tmplBomController;
5248
5855
  this.tmplBom = tmplBom;
5249
- if (!options.printOnly) this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
5856
+ if (!options.printOnly && this.hasFormInstance)
5857
+ this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
5250
5858
  this.scanParamType = this.tmplBom.scan_param_type_;
5251
5859
  markRaw(this);
5252
5860
  this.bomEntriesValidator = new BomEntriesValidator(
@@ -5286,8 +5894,10 @@ class MaterialConsumeTableController {
5286
5894
  mainFormState = ref({});
5287
5895
  /** 表单数据状态(由 factory bindRuntime 注入):未填报 / STASH / SUBMIT */
5288
5896
  dataStatus;
5289
- /** factory 是否已绑定过运行时(避免重复 initTableData) */
5290
- runtimeBound = false;
5897
+ /** 实例数据只在 LOADED 前准备一次,运行时绑定不再重新生成行。 */
5898
+ initialDataPrepared = false;
5899
+ /** 最近一次同步需求数量时使用的数量依赖。 */
5900
+ syncedMaterialNoNum;
5291
5901
  /** 多 Sheet / 同屏多实例下,弹层和异步交互使用该键隔离。 */
5292
5902
  runtimeOwnerId = "";
5293
5903
  /** 表单是否已暂存或提交(已处理过则不再跑初始化) */
@@ -5309,6 +5919,9 @@ class MaterialConsumeTableController {
5309
5919
  get mcPattern() {
5310
5920
  return this.tmplBom.material_consumption_pattern_ ?? this.tmplBomController.defaultMCPattern;
5311
5921
  }
5922
+ get hasFormInstance() {
5923
+ return this.tmplBomController.hasFormInstance;
5924
+ }
5312
5925
  /**
5313
5926
  * 解析规则数据对象
5314
5927
  */
@@ -5435,7 +6048,8 @@ class MaterialConsumeTableController {
5435
6048
  return this.actualBomEntries.map((i) => {
5436
6049
  return {
5437
6050
  product_id_: i.product_id_,
5438
- ...materialNoNum === void 0 ? {} : { qty_required_: i.qty_required_ * materialNoNum },
6051
+ qty_required_uom_id_: i.uom_id_ || void 0,
6052
+ ...materialNoNum === void 0 ? {} : { qty_required_: Number(i.qty_required_) * Number(materialNoNum) },
5439
6053
  bom_entry_id_: i.id_
5440
6054
  };
5441
6055
  });
@@ -5561,6 +6175,10 @@ class MaterialConsumeTableController {
5561
6175
  }
5562
6176
  const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD && !this.tmplBom.personal_bom_enabled_;
5563
6177
  console.log("parseScanStr", data);
6178
+ if (!data.lot && !data.uniqueCode) {
6179
+ this.error($t("sys.edhr.mcTable.lotOrUniqueCodeRequired"));
6180
+ return;
6181
+ }
5564
6182
  const arr = await materialCheck({
5565
6183
  material_no_: data.materialCode,
5566
6184
  production_identification_name_: data.lot,
@@ -5615,6 +6233,9 @@ class MaterialConsumeTableController {
5615
6233
  this.setDefaultValue(row);
5616
6234
  try {
5617
6235
  const plan = await this.bomEntriesValidator.validateScanCanInsert(row, this.actualTableData);
6236
+ if (plan) {
6237
+ row.qty_required_uom_id_ = plan.target.bomEntry.uom_id_ || void 0;
6238
+ }
5618
6239
  const existingRequiredQty = this.isCustomRequiredQty && plan ? this.actualTableData.find(
5619
6240
  (item) => plan.target.isRowInGroup(item) && item.qty_required_ != null
5620
6241
  )?.qty_required_ : void 0;
@@ -5671,40 +6292,36 @@ class MaterialConsumeTableController {
5671
6292
  });
5672
6293
  this.isScanOpen = false;
5673
6294
  }
5674
- /**
5675
- * 打开扫描弹窗
5676
- * @param opts
5677
- */
5678
- async openBomModal() {
5679
- if (!this.actualBomEntries) {
5680
- return;
6295
+ /** Store 创建前准备物料行和数量,全部 Sheet 的 LOADED 共用这份数据。 */
6296
+ prepareInitialData(opts) {
6297
+ if (this.initialDataPrepared) return;
6298
+ this.tableDataRef = toRef(opts.formState, opts.field, []);
6299
+ this.mainFormState = toRef(() => opts.formState);
6300
+ this.dataStatus = opts.dataStatus;
6301
+ this.initTableData(opts.defaultRowData);
6302
+ const rows = this.actualTableData;
6303
+ if (rows.length === 1 && !rows[0].product_id_) {
6304
+ MCDataUtil.setRowEditing(rows[0], true);
5681
6305
  }
5682
- await MaterialConsumeTableController.render?.openBomModal({
5683
- ownerId: this.runtimeOwnerId,
5684
- bomList: this.actualBomEntries,
5685
- onSubstitute: async () => {
5686
- console.log("一键导入数据逻辑");
5687
- }
5688
- });
6306
+ if (this.dataStatus !== "SUBMIT") {
6307
+ this.syncQtyRequiredFromBom();
6308
+ }
6309
+ this.syncedMaterialNoNum = this.materialNoNum;
6310
+ this.initialDataPrepared = true;
5689
6311
  }
5690
- /**
5691
- * 表单加载时由 factory 调用:绑定稳定数据源并初始化行数据。
5692
- * 不在分页组件 setup 中调用,避免跨页挂载重复 init。
5693
- */
6312
+ /** 数量依赖实际变化时才重算,避免首次绑定覆盖 LOADED 中的回填。 */
6313
+ syncQtyRequiredFromBomIfChanged() {
6314
+ if (this.dataStatus === "SUBMIT") return;
6315
+ const materialNoNum = this.materialNoNum;
6316
+ if (this.initialDataPrepared && Object.is(materialNoNum, this.syncedMaterialNoNum)) return;
6317
+ this.syncQtyRequiredFromBom();
6318
+ this.syncedMaterialNoNum = materialNoNum;
6319
+ }
6320
+ /** 只绑定运行时 Store,不重新生成行或修改行内容。 */
5694
6321
  bindRuntime(opts) {
5695
6322
  this.tableDataRef = opts.tableDataRef;
5696
- this.runtimeOwnerId = opts.ownerId;
5697
6323
  this.mainFormState = opts.mainFormState ?? ref({});
5698
6324
  this.dataStatus = opts.dataStatus;
5699
- if (this.runtimeBound) return;
5700
- this.runtimeBound = true;
5701
- this.initTableData(opts.defaultRowData);
5702
- if (this.actualTableData.length === 1) {
5703
- const firstRow = this.actualTableData[0];
5704
- if (!firstRow.product_id_) {
5705
- MCDataUtil.setRowEditing(firstRow, true);
5706
- }
5707
- }
5708
6325
  }
5709
6326
  /**
5710
6327
  * 消耗表组件挂载时调用:只同步视图依赖,不初始化数据、不注册 watch。
@@ -5718,7 +6335,10 @@ class MaterialConsumeTableController {
5718
6335
  * 按当前 materialNoNum 回写各行 qty_required_(校验侧 total 已通过 getter 实时读取)
5719
6336
  */
5720
6337
  syncQtyRequiredFromBom() {
5721
- if (this.tmplBom.required_qty_calc_rule_ === RequiredQtyCalcRule.Custom) return;
6338
+ if (this.tmplBom.required_qty_calc_rule_ === RequiredQtyCalcRule.Custom) {
6339
+ this.updateDerivedQtyFields();
6340
+ return;
6341
+ }
5722
6342
  this.actualTableData.forEach((row) => {
5723
6343
  if (!row.product_id_) return;
5724
6344
  const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
@@ -5762,7 +6382,7 @@ class MaterialConsumeTableController {
5762
6382
  const formData = transformFields.reduce((acc, cur) => {
5763
6383
  if (!cur.targetField) return acc;
5764
6384
  if (cur.sourceField === FormulaRuleFieldKeyEnum.INPUT) {
5765
- acc[cur.sourceField] = row.qty_;
6385
+ acc[cur.sourceField] = row.qty_ == null ? row.qty_ : Number(row.qty_);
5766
6386
  } else if (cur.targetField.includes(".")) {
5767
6387
  const fieldKey = cur.targetField.split(".").pop();
5768
6388
  acc[cur.sourceField] = row[fieldKey];
@@ -5774,7 +6394,7 @@ class MaterialConsumeTableController {
5774
6394
  try {
5775
6395
  const res = await calculate(formulaContent, formData);
5776
6396
  Object.assign(row, {
5777
- qty_transfer_: res,
6397
+ qty_transfer_: res == null ? res : Number(res),
5778
6398
  qty_transfer_uom_id_: targetUnitId,
5779
6399
  transfer_formula_: formulaContent
5780
6400
  });
@@ -5958,7 +6578,7 @@ class MaterialConsumeTableController {
5958
6578
  const modifySingleRow = (index) => {
5959
6579
  const row = this.actualTableData[index];
5960
6580
  if (!row.product_id_) {
5961
- row.qty_consumed_ = 0 + (row.qty_ ?? 0);
6581
+ row.qty_consumed_ = Number(row.qty_ ?? 0);
5962
6582
  return;
5963
6583
  }
5964
6584
  let total = 0;
@@ -5967,7 +6587,7 @@ class MaterialConsumeTableController {
5967
6587
  if (util) {
5968
6588
  total += util.hasConsumed;
5969
6589
  util.filterGroupData(beforeArr).forEach((i) => {
5970
- total += i.qty_ ?? 0;
6590
+ total += Number(i.qty_ ?? 0);
5971
6591
  });
5972
6592
  row.qty_consumed_ = total;
5973
6593
  }
@@ -5989,11 +6609,22 @@ class MaterialConsumeTableController {
5989
6609
  this.updateRowConsumed();
5990
6610
  this.updateGroupQtyConsumedTotal();
5991
6611
  }
6612
+ /** 同步 BOM 主物料的需求数量单位,未关联 BOM 的行保留原单位。 */
6613
+ syncRequiredUomFromBom(row) {
6614
+ const validator = this.bomEntriesValidator;
6615
+ const productId = row.product_id_;
6616
+ const bound = row.bom_entry_id_ ? validator.bomEntryValidators.find((item) => item.bomEntry.id_ === row.bom_entry_id_) : void 0;
6617
+ const matched = productId ? bound?.productIds.includes(productId) ? bound : validator.findUtilByProductId(productId) : void 0;
6618
+ if (matched || bound) {
6619
+ row.qty_required_uom_id_ = matched?.bomEntry.uom_id_ || void 0;
6620
+ }
6621
+ }
5992
6622
  /**
5993
- * 设置默认值,如工序,需求数量/已消耗数量
6623
+ * 设置默认值,如工序,需求数量/需求数量单位/已消耗数量
5994
6624
  * @param row
5995
6625
  */
5996
6626
  setDefaultValue(row) {
6627
+ this.syncRequiredUomFromBom(row);
5997
6628
  if (!row.routing_operation_id_) {
5998
6629
  row.routing_operation_id_ = this.tmplBomController.operationId;
5999
6630
  }
@@ -6055,7 +6686,16 @@ class MaterialConsumeTableController {
6055
6686
  this.error(msg);
6056
6687
  return;
6057
6688
  }
6058
- if (!value) return;
6689
+ if (!value) {
6690
+ if (row.product_id_ && !this.isCustomRequiredQty) {
6691
+ const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
6692
+ if (util) {
6693
+ row.qty_required_ = util.total;
6694
+ }
6695
+ }
6696
+ this.updateDerivedQtyFields();
6697
+ return;
6698
+ }
6059
6699
  try {
6060
6700
  await validateReinspectionDate({
6061
6701
  product_id_: option.product_id_ ?? row.product_id_,
@@ -6079,6 +6719,7 @@ class MaterialConsumeTableController {
6079
6719
  const qty = oldGroupId && row.bom_entry_id_ === oldGroupId ? oldRequiredQty : this.getCustomGroupRequiredQty(row);
6080
6720
  this.setCustomGroupRequiredQty(row, qty);
6081
6721
  }
6722
+ this.updateDerivedQtyFields();
6082
6723
  } else if (field === "qty_") {
6083
6724
  this.updateDerivedQtyFields();
6084
6725
  }
@@ -6713,11 +7354,12 @@ class SubTableCore {
6713
7354
  /**
6714
7355
  * 扫码多条候选时选择一行(1 条自动选中)
6715
7356
  */
6716
- async pickScanRecord(records) {
7357
+ async pickScanRecord(records, options = {}) {
6717
7358
  if (!records.length) return void 0;
6718
7359
  if (records.length === 1) return records[0];
6719
7360
  return this.render.openMultiRowsModal({
6720
- rows: mapScanRecordsForPicker(records)
7361
+ rows: mapScanRecordsForPicker(records),
7362
+ ...options
6721
7363
  });
6722
7364
  }
6723
7365
  /**
@@ -6943,7 +7585,7 @@ async function validateObjectBomQtyOnSubmit(opts) {
6943
7585
  for (const obj of objectFieldList) {
6944
7586
  if (!obj?.objectField) continue;
6945
7587
  const objectBom = findObjectBom(formInstBom, obj.objectField);
6946
- if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD) {
7588
+ if (objectBom?.material_consumption_pattern_ === MaterialConsumptionPatternEnum.RECORD && !objectBom.personal_bom_enabled_) {
6947
7589
  continue;
6948
7590
  }
6949
7591
  const { productKey, productFieldName, qtyKey, qtyRequiredKey, qtyFieldName } = pickObjectFieldKeys(obj.subFields, obj.objectField);
@@ -7004,150 +7646,6 @@ async function validateObjectBomQtyOnSubmit(opts) {
7004
7646
  }
7005
7647
  return errors;
7006
7648
  }
7007
- function isBlank(value) {
7008
- return value == null || value === "";
7009
- }
7010
- function pickPresent(preferred, fallback) {
7011
- return isBlank(preferred) ? fallback : preferred;
7012
- }
7013
- function resolveObjectFieldKeys(opts) {
7014
- const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
7015
- const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
7016
- const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
7017
- requireUsed: false
7018
- });
7019
- return {
7020
- productKey: pickPresent(fromList.productKey, fromFallback.productKey),
7021
- productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
7022
- materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
7023
- materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
7024
- qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
7025
- qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
7026
- qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
7027
- bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
7028
- };
7029
- }
7030
- function buildObjectLotExtraQuery(productId) {
7031
- if (isBlank(productId)) return {};
7032
- const versionId = String(productId).split(":").pop();
7033
- if (!versionId) return {};
7034
- return { "product_id_.versionEq": versionId };
7035
- }
7036
- function clearedLotFields(materialNoKey) {
7037
- if (!materialNoKey) return {};
7038
- return {
7039
- [materialNoKey]: void 0,
7040
- [`${materialNoKey}_id_`]: void 0,
7041
- [`${materialNoKey}_lb_`]: void 0
7042
- };
7043
- }
7044
- function shouldClearLotOnProductChange(opts) {
7045
- const { prevProduct, nextProduct, lotValue } = opts;
7046
- if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
7047
- if (prevProduct === nextProduct) return false;
7048
- if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
7049
- return false;
7050
- }
7051
- return true;
7052
- }
7053
- let fillingProduct = false;
7054
- function runWithFillProduct(fn) {
7055
- fillingProduct = true;
7056
- try {
7057
- fn();
7058
- } finally {
7059
- nextTick(() => {
7060
- fillingProduct = false;
7061
- });
7062
- }
7063
- }
7064
- function resolveLotValidateParams(keys, formData, option) {
7065
- return {
7066
- product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
7067
- material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
7068
- material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
7069
- };
7070
- }
7071
- async function applyConsumeObjectTraceChange(opts) {
7072
- const { belongingObject, role, formData } = opts;
7073
- if (!belongingObject || !formData) return {};
7074
- const keys = resolveObjectFieldKeys({
7075
- belongingObject,
7076
- objectFieldList: opts.objectFieldList,
7077
- fallbackFields: opts.fallbackFields
7078
- });
7079
- if (role === FIELD_TYPE.PRODUCT) {
7080
- if (!("prevProduct" in opts) || fillingProduct) return {};
7081
- const values = {};
7082
- if (shouldClearLotOnProductChange({
7083
- prevProduct: opts.prevProduct,
7084
- nextProduct: opts.nextValue,
7085
- lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
7086
- })) {
7087
- Object.assign(values, clearedLotFields(keys.materialNoKey));
7088
- }
7089
- if (keys.bomEntryIdKey) {
7090
- values[keys.bomEntryIdKey] = null;
7091
- if (!isBlank(opts.nextValue) && opts.formInstBom) {
7092
- const entry = resolveObjectBomEntry({
7093
- formInstBom: opts.formInstBom,
7094
- belongingObject,
7095
- productId: String(opts.nextValue)
7096
- });
7097
- if (entry) values[keys.bomEntryIdKey] = entry.id_;
7098
- }
7099
- }
7100
- opts.rowWriter.patchRow(values, "autofill");
7101
- const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
7102
- if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
7103
- try {
7104
- await validateReinspectionDate({
7105
- product_id_: String(opts.nextValue),
7106
- material_no_: lotValue,
7107
- material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
7108
- });
7109
- } catch (e) {
7110
- return { abortReinspection: e?.message || String(e) };
7111
- }
7112
- }
7113
- return {};
7114
- }
7115
- if (role === FIELD_TYPE.MATERIAL_NO) {
7116
- if (opts.option?.is_locked_) {
7117
- opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
7118
- return { abortLocked: opts.option.id_ };
7119
- }
7120
- const params = resolveLotValidateParams(keys, formData, opts.option);
7121
- if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
7122
- try {
7123
- await validateReinspectionDate(params);
7124
- } catch (e) {
7125
- opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
7126
- return { abortReinspection: e?.message || String(e) };
7127
- }
7128
- const values = {};
7129
- const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
7130
- if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
7131
- if (keys.bomEntryIdKey && opts.formInstBom) {
7132
- if (!isBlank(productId)) {
7133
- const entry = resolveObjectBomEntry({
7134
- formInstBom: opts.formInstBom,
7135
- belongingObject,
7136
- productId: String(productId)
7137
- });
7138
- if (entry) values[keys.bomEntryIdKey] = entry.id_;
7139
- }
7140
- }
7141
- const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
7142
- if (keys.productKey && !isBlank(productId)) {
7143
- runWithFillProduct(patchRelatedFields);
7144
- } else {
7145
- patchRelatedFields();
7146
- }
7147
- return {};
7148
- }
7149
- return {};
7150
- }
7151
7649
  function useRuntimeRowState(rowSource) {
7152
7650
  const { formStateStore } = useRuntimeInstanceServices();
7153
7651
  function requireStore() {
@@ -7470,7 +7968,11 @@ function useDependency(widget, props) {
7470
7968
  );
7471
7969
  if (!controlledFormData.value._OPCT) {
7472
7970
  const store = formStateStore.value;
7473
- store.setObjectField(controlledFormData.value, "_OPCT", { _DICT: {} }, "restore");
7971
+ store.transaction(
7972
+ "restore",
7973
+ () => store.setObjectField(controlledFormData.value, "_OPCT", { _DICT: {} }, "restore"),
7974
+ { restoreScope: "fields" }
7975
+ );
7474
7976
  }
7475
7977
  const formRowData = toRef(() => {
7476
7978
  if (isFieldModel) {
@@ -7496,6 +7998,7 @@ function useDependency(widget, props) {
7496
7998
  if (!store) throw new Error("字段组件缺少实例级 FormStateStore");
7497
7999
  const row = store.createScopedView(formRowData.value, formRowPath.value);
7498
8000
  const path = store.getFieldPath(row, targetFieldId);
8001
+ if (assignment_expression) store.markUserModified(path);
7499
8002
  store.setObjectField(row, targetFieldId, val, "user", path);
7500
8003
  if (assignment_expression && strategy === ASSIGNMENTSTRATEGY_ENUM.notCovered && commonUtils.isEmptyValue(val)) {
7501
8004
  store.clearUserModified(path);
@@ -7894,6 +8397,150 @@ function useFormTmplConfig() {
7894
8397
  injectController
7895
8398
  };
7896
8399
  }
8400
+ function isBlank(value) {
8401
+ return value == null || value === "";
8402
+ }
8403
+ function pickPresent(preferred, fallback) {
8404
+ return isBlank(preferred) ? fallback : preferred;
8405
+ }
8406
+ function resolveObjectFieldKeys(opts) {
8407
+ const obj = opts.objectFieldList?.find((item) => item.objectField === opts.belongingObject);
8408
+ const fromList = obj?.subFields ? pickObjectFieldKeys(obj.subFields, opts.belongingObject) : {};
8409
+ const fromFallback = pickObjectFieldKeys(opts.fallbackFields, opts.belongingObject, {
8410
+ requireUsed: false
8411
+ });
8412
+ return {
8413
+ productKey: pickPresent(fromList.productKey, fromFallback.productKey),
8414
+ productFieldName: fromList.productFieldName ?? fromFallback.productFieldName,
8415
+ materialNoKey: pickPresent(fromList.materialNoKey, fromFallback.materialNoKey),
8416
+ materialNoFieldName: fromList.materialNoFieldName ?? fromFallback.materialNoFieldName,
8417
+ qtyKey: pickPresent(fromList.qtyKey, fromFallback.qtyKey),
8418
+ qtyRequiredKey: pickPresent(fromList.qtyRequiredKey, fromFallback.qtyRequiredKey),
8419
+ qtyFieldName: fromList.qtyFieldName ?? fromFallback.qtyFieldName,
8420
+ bomEntryIdKey: pickPresent(fromList.bomEntryIdKey, fromFallback.bomEntryIdKey)
8421
+ };
8422
+ }
8423
+ function buildObjectLotExtraQuery(productId) {
8424
+ if (isBlank(productId)) return {};
8425
+ const versionId = String(productId).split(":").pop();
8426
+ if (!versionId) return {};
8427
+ return { "product_id_.versionEq": versionId };
8428
+ }
8429
+ function clearedLotFields(materialNoKey) {
8430
+ if (!materialNoKey) return {};
8431
+ return {
8432
+ [materialNoKey]: void 0,
8433
+ [`${materialNoKey}_id_`]: void 0,
8434
+ [`${materialNoKey}_lb_`]: void 0
8435
+ };
8436
+ }
8437
+ function shouldClearLotOnProductChange(opts) {
8438
+ const { prevProduct, nextProduct, lotValue } = opts;
8439
+ if (isBlank(prevProduct) && isBlank(nextProduct)) return false;
8440
+ if (prevProduct === nextProduct) return false;
8441
+ if (isBlank(prevProduct) && !isBlank(nextProduct) && !isBlank(lotValue)) {
8442
+ return false;
8443
+ }
8444
+ return true;
8445
+ }
8446
+ let fillingProduct = false;
8447
+ function runWithFillProduct(fn) {
8448
+ fillingProduct = true;
8449
+ try {
8450
+ fn();
8451
+ } finally {
8452
+ nextTick(() => {
8453
+ fillingProduct = false;
8454
+ });
8455
+ }
8456
+ }
8457
+ function resolveLotValidateParams(keys, formData, option) {
8458
+ return {
8459
+ product_id_: option?.product_id_ ?? option?._item?.product_id_ ?? (keys.productKey ? formData[keys.productKey] : void 0),
8460
+ material_no_: option?.name_ ?? option?.__VALUE__ ?? (keys.materialNoKey ? formData[keys.materialNoKey] : void 0),
8461
+ material_no_id_: option?.id_ ?? (keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0)
8462
+ };
8463
+ }
8464
+ async function applyConsumeObjectTraceChange(opts) {
8465
+ const { belongingObject, role, formData } = opts;
8466
+ if (!belongingObject || !formData) return {};
8467
+ const keys = resolveObjectFieldKeys({
8468
+ belongingObject,
8469
+ objectFieldList: opts.objectFieldList,
8470
+ fallbackFields: opts.fallbackFields
8471
+ });
8472
+ if (role === FIELD_TYPE.PRODUCT) {
8473
+ if (!("prevProduct" in opts) || fillingProduct) return {};
8474
+ const values = {};
8475
+ if (shouldClearLotOnProductChange({
8476
+ prevProduct: opts.prevProduct,
8477
+ nextProduct: opts.nextValue,
8478
+ lotValue: keys.materialNoKey ? formData[keys.materialNoKey] : void 0
8479
+ })) {
8480
+ Object.assign(values, clearedLotFields(keys.materialNoKey));
8481
+ }
8482
+ if (keys.bomEntryIdKey) {
8483
+ values[keys.bomEntryIdKey] = null;
8484
+ if (!isBlank(opts.nextValue) && opts.formInstBom) {
8485
+ const entry = resolveObjectBomEntry({
8486
+ formInstBom: opts.formInstBom,
8487
+ belongingObject,
8488
+ productId: String(opts.nextValue)
8489
+ });
8490
+ if (entry) values[keys.bomEntryIdKey] = entry.id_;
8491
+ }
8492
+ }
8493
+ opts.rowWriter.patchRow(values, "autofill");
8494
+ const lotValue = keys.materialNoKey ? formData[keys.materialNoKey] : void 0;
8495
+ if (!isBlank(opts.nextValue) && !isBlank(lotValue)) {
8496
+ try {
8497
+ await validateReinspectionDate({
8498
+ product_id_: String(opts.nextValue),
8499
+ material_no_: lotValue,
8500
+ material_no_id_: keys.materialNoKey ? formData[`${keys.materialNoKey}_id_`] : void 0
8501
+ });
8502
+ } catch (e) {
8503
+ return { abortReinspection: e?.message || String(e) };
8504
+ }
8505
+ }
8506
+ return {};
8507
+ }
8508
+ if (role === FIELD_TYPE.MATERIAL_NO) {
8509
+ if (opts.option?.is_locked_) {
8510
+ opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "autofill");
8511
+ return { abortLocked: opts.option.id_ };
8512
+ }
8513
+ const params = resolveLotValidateParams(keys, formData, opts.option);
8514
+ if (isBlank(params.material_no_) && isBlank(params.material_no_id_)) return {};
8515
+ try {
8516
+ await validateReinspectionDate(params);
8517
+ } catch (e) {
8518
+ opts.rowWriter.patchRow(clearedLotFields(keys.materialNoKey), "async");
8519
+ return { abortReinspection: e?.message || String(e) };
8520
+ }
8521
+ const values = {};
8522
+ const productId = opts.option?.product_id_ ?? opts.option?._item?.product_id_;
8523
+ if (keys.productKey && !isBlank(productId)) values[keys.productKey] = productId;
8524
+ if (keys.bomEntryIdKey && opts.formInstBom) {
8525
+ if (!isBlank(productId)) {
8526
+ const entry = resolveObjectBomEntry({
8527
+ formInstBom: opts.formInstBom,
8528
+ belongingObject,
8529
+ productId: String(productId)
8530
+ });
8531
+ if (entry) values[keys.bomEntryIdKey] = entry.id_;
8532
+ }
8533
+ }
8534
+ const patchRelatedFields = () => opts.rowWriter.patchRow(values, "autofill");
8535
+ if (keys.productKey && !isBlank(productId)) {
8536
+ runWithFillProduct(patchRelatedFields);
8537
+ } else {
8538
+ patchRelatedFields();
8539
+ }
8540
+ return {};
8541
+ }
8542
+ return {};
8543
+ }
7897
8544
  const _hoisted_1$5 = ["data-merge", "data-fill-direction"];
7898
8545
  const _hoisted_2$1 = {
7899
8546
  key: 0,
@@ -8214,6 +8861,7 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8214
8861
  showDisplayStatus,
8215
8862
  dataRelationShip
8216
8863
  } = useWidgetStaticAttrs(props.widget);
8864
+ const isMockMaterialConsume = computed(() => !!dataRelationShip?.isMockReport && !!props.widget.props.isMaterialConsumeTable);
8217
8865
  const sheetId = () => fields.value?.findWidgetById(props.widget.id)?.sheetId;
8218
8866
  const subTableCore = props.subTableCore;
8219
8867
  provide(NCB_PROVIDE.SUB_TABLE_CORE, subTableCore);
@@ -8354,6 +9002,9 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8354
9002
  key,
8355
9003
  actionValue
8356
9004
  }) => {
9005
+ if (isMockMaterialConsume.value && (key === SubTableActionEnum.SCAN || key === SubTableActionEnum.Insert1GroupAfter)) {
9006
+ return;
9007
+ }
8357
9008
  switch (key) {
8358
9009
  case "insertRowBefore":
8359
9010
  handleAddRow({
@@ -8447,10 +9098,11 @@ const DocumentSubTable = /* @__PURE__ */ defineComponent({
8447
9098
  showRowWatermark,
8448
9099
  rowGroupKey
8449
9100
  }) => {
8450
- const menus = subTableCore?.calcSubTableActionMenu({
9101
+ const baseMenus = subTableCore?.calcSubTableActionMenu({
8451
9102
  rowData,
8452
9103
  showDelBtn
8453
9104
  });
9105
+ const menus = isMockMaterialConsume.value ? [getMenuByAction(SubTableActionEnum.SCAN), getMenuByAction(SubTableActionEnum.Insert1GroupAfter), ...baseMenus ?? []] : baseMenus;
8454
9106
  const annRowDetails = dataRelationShip?.annRowDetails;
8455
9107
  const rowMark = dataIdx !== -1 && annRowDetails?.length ? resolveRowFormChangeMark(field, rowData, annRowDetails) : null;
8456
9108
  const rowUi = resolveFormChangeRowUi(rowData, rowMark);
@@ -8952,6 +9604,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
8952
9604
  }));
8953
9605
  };
8954
9606
  const handleAction = (action, rowData) => {
9607
+ if (!tableController.hasFormInstance) return;
8955
9608
  switch (action) {
8956
9609
  case MaterialConsumeActionType.CONFIRM:
8957
9610
  tableController.confirm(rowData);
@@ -9024,6 +9677,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
9024
9677
  key,
9025
9678
  actionValue
9026
9679
  }) => {
9680
+ if (!tableController.hasFormInstance) return;
9027
9681
  switch (key) {
9028
9682
  case "rowEdit":
9029
9683
  await tableController.editRow(rowData);
@@ -9394,7 +10048,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
9394
10048
  createElementVNode("i", { class: "iconfont icon-zhuyi" }),
9395
10049
  createElementVNode("ul", { class: "tips-list" }, [
9396
10050
  createElementVNode("li", null, "可将Excel内容粘贴到表格中,支持使用复制、粘贴、删除快捷键"),
9397
- createElementVNode("li", null, " 表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、LOT/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割) ")
10051
+ createElementVNode("li", null, " 表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、批次/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割) ")
9398
10052
  ])
9399
10053
  ], -1)),
9400
10054
  createElementVNode("div", {
@@ -9419,7 +10073,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
9419
10073
  };
9420
10074
  }
9421
10075
  });
9422
- const FixedQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b589958f"]]);
10076
+ const FixedQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-58540cb3"]]);
9423
10077
  const _hoisted_1$1 = {
9424
10078
  key: 1,
9425
10079
  class: "sub-table-action__subtitle"
@@ -10121,7 +10775,7 @@ const DocumentPaper = /* @__PURE__ */ defineComponent({
10121
10775
  }) : null,
10122
10776
  // 在[固定表]顶部的可见单元格上加装操作按钮
10123
10777
  tableAction: (() => {
10124
- const fixedTableActionVisible = fixedTableInfo?.quickFillVisible && !filledFixedTableKeys.value.includes(fixedTableInfo.subFieldKey);
10778
+ const fixedTableActionVisible = props.basicInfo.renderModeType !== RenderModeEnum.ViewMode && fixedTableInfo?.quickFillVisible && !filledFixedTableKeys.value.includes(fixedTableInfo.subFieldKey);
10125
10779
  return () => fixedTableActionVisible ? createVNode(_sfc_main$2, {
10126
10780
  "tdId": tdId,
10127
10781
  "formState": formState.value,
@@ -10192,7 +10846,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10192
10846
  createElementVNode("i", { class: "iconfont icon-zhuyi" }),
10193
10847
  createElementVNode("ul", { class: "tips-list" }, [
10194
10848
  createElementVNode("li", null, "可将Excel内容粘贴到表格中,支持使用复制、粘贴、删除快捷键"),
10195
- createElementVNode("li", null, "表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、LOT/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割)"),
10849
+ createElementVNode("li", null, "表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、批次/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割)"),
10196
10850
  createElementVNode("li", null, "当前快速填报最多支持200行")
10197
10851
  ])
10198
10852
  ], -1)),
@@ -10212,7 +10866,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10212
10866
  };
10213
10867
  }
10214
10868
  });
10215
- const DynamicQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ae9acd3f"]]);
10869
+ const DynamicQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-840aca0a"]]);
10216
10870
  const _sfc_main = /* @__PURE__ */ defineComponent({
10217
10871
  __name: "dynamic-table-action",
10218
10872
  props: {
@@ -10296,111 +10950,130 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10296
10950
  });
10297
10951
  const DynamicTableAction = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-53d7e66c"]]);
10298
10952
  export {
10299
- RuntimeSheetService as $,
10300
- useStyles as A,
10953
+ DocumentPaper as $,
10954
+ useNocodeFormWidget as A,
10301
10955
  BorderTD as B,
10302
- useDependency as C,
10956
+ applyConsumeObjectTraceChange as C,
10303
10957
  DEFAULT_BOOLEAN_FIELD_WIDTH as D,
10304
- EMPTY_PRODUCT_VERSION_ID as E,
10305
- useFieldPresentation as F,
10306
- useRuntimeEditorFlusher as G,
10307
- createRuntimeInstanceContext as H,
10308
- RuntimeInstanceRegistry as I,
10309
- RequiredQtyCalcRule as J,
10310
- registerFormulaFuncs as K,
10311
- DocumentPaper as L,
10958
+ getObjectBomProductQuery as E,
10959
+ EMPTY_PRODUCT_VERSION_ID as F,
10960
+ normalizeHistoricalAutofillRow as G,
10961
+ readSealValue as H,
10962
+ isSealStamped as I,
10963
+ stampSealValue as J,
10964
+ isValidSealValue as K,
10965
+ clearSealValue as L,
10312
10966
  MAX_RUNTIME_SHEETS as M,
10313
10967
  NCB_PROVIDE as N,
10314
- DynamicTableAction as O,
10315
- getRuntimeDataFieldId as P,
10316
- buildRuntimeFieldPath as Q,
10317
- RuntimeFormStateStore as R,
10318
- ScanParamType as S,
10319
- resolveRuntimeFieldProps as T,
10320
- resolveRuntimeFieldState as U,
10321
- getRuntimeDependencyOutputKey as V,
10322
- isRowAddedInCurrentFormChange as W,
10323
- MaterialConsumeTableController as X,
10324
- setFormulaParamsConfig as Y,
10325
- normalizeRuntime as Z,
10326
- _sfc_main$5 as _,
10968
+ parseRuntimeFieldPath as O,
10969
+ calculateFormula as P,
10970
+ useStyles as Q,
10971
+ useDependency as R,
10972
+ useFieldPresentation as S,
10973
+ useRuntimeEditorFlusher as T,
10974
+ RuntimeFormStateStore as U,
10975
+ createRuntimeInstanceContext as V,
10976
+ RuntimeInstanceRegistry as W,
10977
+ ScanParamType as X,
10978
+ RequiredQtyCalcRule as Y,
10979
+ registerFormulaFuncs as Z,
10980
+ moveSealValue as _,
10327
10981
  MAX_RUNTIME_SHEET_TITLE_LENGTH as a,
10328
- validateObjectBomQtyOnSubmit as a0,
10329
- closeValidatorPopovers as a1,
10330
- enrichFormChangeRowDetails as a2,
10331
- useMaterialBalance as a3,
10332
- collectFormChangeFieldLocations as a4,
10333
- nextFormChangeRowViewHistoryId as a5,
10334
- DeviceConnector as a6,
10335
- DocumentLoading as a7,
10336
- DynamicQuickFillModal as a8,
10337
- FixedQuickFillModal as a9,
10338
- recordSubtableRowDelete as aA,
10339
- resolveAnnotationFieldLocation as aB,
10340
- resolveFormChangeRowUi as aC,
10341
- resolveRowFormChangeMark as aD,
10342
- setSelectMobileTdId as aE,
10343
- stripLegacyFormConfigFromPaper as aF,
10344
- SubTableActionMenuTypeEnum as aG,
10345
- getMenuByAction as aH,
10346
- SubTableActionEnum as aI,
10347
- resolveScanFillData as aJ,
10348
- getInsertSubMenu as aK,
10349
- resolveScanAdjustType as aL,
10350
- resolveScanQty as aM,
10351
- toDateOnly as aN,
10352
- getCopySubMenu as aO,
10353
- resolveScanParsedValue as aP,
10354
- isProductBatchEmptyRow as aQ,
10355
- FormTmplConfigController as aa,
10356
- LEGACY_RUNTIME_FORM_CONFIG_KEYS as ab,
10357
- LEGACY_RUNTIME_SHEET_ID as ac,
10358
- LEGACY_RUNTIME_SHEET_TITLE as ad,
10359
- MCDataUtil as ae,
10360
- OCR_MODEL_PRECISION_ENUM_KEY as af,
10361
- RuntimeAsyncTaskCoordinator as ag,
10362
- RuntimeDependencyService as ah,
10363
- RuntimeFieldRegistry as ai,
10364
- RuntimeInstanceEventBus as aj,
10365
- RuntimePersistenceCoordinator as ak,
10366
- RuntimeValidationService as al,
10367
- SubTableCore as am,
10368
- buildFormChangeDisplayRows as an,
10369
- convertV1Runtime as ao,
10370
- detailsHaveFormChangeRowOps as ap,
10371
- extractFormChangeRowDetails as aq,
10372
- getFormChangeRowKey as ar,
10373
- getFormChangeRowOp as as,
10374
- getSubTableQuickFillInfo as at,
10375
- isAnnLocationSelected as au,
10376
- isBlank as av,
10377
- isFormChangeGhostRow as aw,
10378
- normalizeHistoricalFieldConfig as ax,
10379
- pickObjectFieldKeys as ay,
10380
- recordSubtableRowAdd as az,
10982
+ resolveScanFillData as a$,
10983
+ DynamicTableAction as a0,
10984
+ _sfc_main$5 as a1,
10985
+ getRuntimeDataFieldId as a2,
10986
+ buildRuntimeFieldPath as a3,
10987
+ resolveRuntimeFieldProps as a4,
10988
+ resolveRuntimeFieldState as a5,
10989
+ assembleRules as a6,
10990
+ isAttachFieldActive as a7,
10991
+ getRuntimeDependencyOutputKey as a8,
10992
+ isRowAddedInCurrentFormChange as a9,
10993
+ RuntimeInstanceEventBus as aA,
10994
+ RuntimePersistenceCoordinator as aB,
10995
+ RuntimeValidationService as aC,
10996
+ SubTableCore as aD,
10997
+ buildFormChangeDisplayRows as aE,
10998
+ convertV1Runtime as aF,
10999
+ detailsHaveFormChangeRowOps as aG,
11000
+ extractFormChangeRowDetails as aH,
11001
+ getFormChangeRowKey as aI,
11002
+ getFormChangeRowOp as aJ,
11003
+ getSubTableQuickFillInfo as aK,
11004
+ isAnnLocationSelected as aL,
11005
+ isBlank as aM,
11006
+ isFormChangeGhostRow as aN,
11007
+ normalizeHistoricalFieldConfig as aO,
11008
+ pickObjectFieldKeys as aP,
11009
+ recordSubtableRowAdd as aQ,
11010
+ recordSubtableRowDelete as aR,
11011
+ relocateDeletedRowsToEnd as aS,
11012
+ resolveAnnotationFieldLocation as aT,
11013
+ resolveFormChangeRowUi as aU,
11014
+ resolveRowFormChangeMark as aV,
11015
+ setSelectMobileTdId as aW,
11016
+ stripLegacyFormConfigFromPaper as aX,
11017
+ SubTableActionMenuTypeEnum as aY,
11018
+ getMenuByAction as aZ,
11019
+ SubTableActionEnum as a_,
11020
+ resolveFormulaData as aa,
11021
+ MaterialConsumeTableController as ab,
11022
+ setFormulaParamsConfig as ac,
11023
+ normalizeRuntime as ad,
11024
+ initializeSealFields as ae,
11025
+ RuntimeSheetService as af,
11026
+ validateObjectBomQtyOnSubmit as ag,
11027
+ areValidationCommentsEqual as ah,
11028
+ closeValidatorPopovers as ai,
11029
+ enrichFormChangeRowDetails as aj,
11030
+ useMaterialBalance as ak,
11031
+ collectFormChangeFieldLocations as al,
11032
+ nextFormChangeRowViewHistoryId as am,
11033
+ DeviceConnector as an,
11034
+ DocumentLoading as ao,
11035
+ DynamicQuickFillModal as ap,
11036
+ FixedQuickFillModal as aq,
11037
+ FormTmplConfigController as ar,
11038
+ LEGACY_RUNTIME_FORM_CONFIG_KEYS as as,
11039
+ LEGACY_RUNTIME_SHEET_ID as at,
11040
+ LEGACY_RUNTIME_SHEET_TITLE as au,
11041
+ MCDataUtil as av,
11042
+ OCR_MODEL_PRECISION_ENUM_KEY as aw,
11043
+ RuntimeAsyncTaskCoordinator as ax,
11044
+ RuntimeDependencyService as ay,
11045
+ RuntimeFieldRegistry as az,
10381
11046
  MULTI_SHEET_SCHEMA_VERSION as b,
10382
- createRuntimeDocumentV2 as c,
10383
- normalizeHistoricalBusinessRow as d,
10384
- DeviceLinkTmplUtil as e,
10385
- normalizeAIOcrTmpl as f,
11047
+ getInsertSubMenu as b0,
11048
+ resolveScanAdjustType as b1,
11049
+ resolveScanQty as b2,
11050
+ toDateOnly as b3,
11051
+ hasSubtableBusinessData as b4,
11052
+ getCopySubMenu as b5,
11053
+ resolveScanParsedValue as b6,
11054
+ isProductBatchEmptyRow as b7,
11055
+ getParseFormulaVarInfos as c,
11056
+ createRuntimeDocumentV2 as d,
11057
+ clampSealPosition as e,
11058
+ normalizeSealDiameter as f,
10386
11059
  getBusinessFieldKey as g,
10387
- useWidgetStaticAttrs as h,
10388
- useRuntimeInstanceServices as i,
10389
- setSelectAnnotationId as j,
10390
- useRuntimeRowState as k,
10391
- getObjectBomMaterialLotQuery as l,
10392
- buildObjectLotExtraQuery as m,
10393
- normalizeFieldWidth as n,
10394
- MaterialConsumptionPatternEnum as o,
10395
- resolveObjectBomEntry as p,
10396
- runWithFillProduct as q,
10397
- resolveObjectFieldKeys as r,
11060
+ normalizeFieldWidth as h,
11061
+ isCellAutoLineBreak as i,
11062
+ normalizeHistoricalBusinessRow as j,
11063
+ DeviceLinkTmplUtil as k,
11064
+ normalizeAIOcrTmpl as l,
11065
+ useWidgetStaticAttrs as m,
11066
+ normalizeGridColumnWidth as n,
11067
+ useRuntimeInstanceServices as o,
11068
+ setSelectAnnotationId as p,
11069
+ useRuntimeRowState as q,
11070
+ getObjectBomMaterialLotQuery as r,
10398
11071
  setSelectValidatorId as s,
10399
- useNocodeFormWidget as t,
11072
+ buildObjectLotExtraQuery as t,
10400
11073
  useFormTmplConfig as u,
10401
- validateObjectBomForScan as v,
10402
- applyConsumeObjectTraceChange as w,
10403
- getObjectBomProductQuery as x,
10404
- normalizeHistoricalAutofillRow as y,
10405
- parseRuntimeFieldPath as z
11074
+ resolveObjectFieldKeys as v,
11075
+ MaterialConsumptionPatternEnum as w,
11076
+ validateObjectBomForScan as x,
11077
+ resolveObjectBomEntry as y,
11078
+ runWithFillProduct as z
10406
11079
  };