@gct-paas/excel 0.1.39-beta.3 → 0.1.39-beta.30

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 (120) hide show
  1. package/dist/{BaseComponent-MsYFQjlq.js → BaseComponent-BkwxLOiM.js} +2 -2
  2. package/dist/{VueVideoPlayer-B-X9Kvhp.js → VueVideoPlayer-DmZ_P4Cp.js} +2 -2
  3. package/dist/{align-editor-1IbAiPBg.js → align-editor-C1Fj-34U.js} +1 -1
  4. package/dist/{barcode-design-DPH8Uh2K.js → barcode-design-D90bLWOL.js} +2 -2
  5. package/dist/base/index.es.js +498 -195
  6. package/dist/{diagonal-design-AJOcMvxo.js → diagonal-design-YbEx-5SA.js} +2 -2
  7. package/dist/{dynamic-table-action-Bi7RdYoy.js → dynamic-table-action-DXlLVZZF.js} +349 -265
  8. package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-ClcBVLO0.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DlcK-wt_.js} +375 -299
  9. package/dist/{edit.utils-CXmmCnxE-88-QvdIv.js → edit.utils-CXmmCnxE-BMWwEMfe.js} +1 -1
  10. package/dist/excel.css +522 -332
  11. package/dist/{exceljs.min-D7RI5VAg.js → exceljs.min-B-mYUB0l.js} +2 -2
  12. package/dist/{font-editor-ttnkgG9j.js → font-editor-D0dV4bEL.js} +3 -3
  13. package/dist/{image-design-B84grap7.js → image-design-DkQBDv9K.js} +2 -2
  14. package/dist/{index-BbDITMyp.js → index-8GDKkzhT.js} +2 -2
  15. package/dist/{index-Db-ix7hC.js → index-B-hm9GED.js} +2 -2
  16. package/dist/{index-_h9yoejq.js → index-BEkX75av.js} +2 -2
  17. package/dist/{index-MJFci9IB.js → index-BKmJ_uM2.js} +1 -1
  18. package/dist/{index-CUHfI8cg.js → index-BPvsxMaD.js} +1 -1
  19. package/dist/{index-UCNknVxk.js → index-BYpPubsS.js} +1 -1
  20. package/dist/{index-Doz8Gf_5.js → index-BgL2ciTw.js} +1 -1
  21. package/dist/{index-_ZsA68LD.js → index-Boj1Babg.js} +2 -2
  22. package/dist/{index-BKBn7Evl.js → index-C0gB21qk.js} +2 -2
  23. package/dist/{index-7YbJRzdP.js → index-CHv965Bj.js} +2 -2
  24. package/dist/{index-DgdosgZd.js → index-CNSt1kk7.js} +2 -2
  25. package/dist/{index-CLL_9LZB.js → index-CVPJGks5.js} +2 -2
  26. package/dist/{index-ChncMTkv.js → index-CaKVMIWJ.js} +1 -1
  27. package/dist/{index-Bb41zgXE.js → index-CfLLsSW6.js} +2 -2
  28. package/dist/{index-CuGZ6C7l.js → index-CiyvJops.js} +2 -2
  29. package/dist/{index-CR2Qyh5l.js → index-CrnlU1jr.js} +6 -5
  30. package/dist/{index-DCzL4GOP.js → index-D19ggbiC.js} +53 -5
  31. package/dist/{index-D9xmHJZc.js → index-D9BcQ25Q.js} +2 -2
  32. package/dist/{index-CX6LqGJP.js → index-DOGxYpwq.js} +1 -1
  33. package/dist/{index-D0Q-6EtG.js → index-DWrIPK_U.js} +1 -1
  34. package/dist/{index-89I_eBZ-.js → index-DZYpzeZM.js} +3 -3
  35. package/dist/{index-jRA6sXVY.js → index-Dgs95dud.js} +1 -1
  36. package/dist/{index-C_FegWKd.js → index-DlfthBvr.js} +2 -2
  37. package/dist/{index-DBT8-Qit.js → index-DsS5smhd.js} +3 -3
  38. package/dist/{index-DAN58pC9.js → index-DyLoooUC.js} +2 -2
  39. package/dist/{index-IRXUwksU.js → index-DzmKXFwH.js} +2 -2
  40. package/dist/{index-DNmbm6HV.js → index-K9yUIBxc.js} +6 -5
  41. package/dist/{index-DHHyy4mL.js → index-V3FsjgC2.js} +1 -1
  42. package/dist/{index-C90vW_gE.js → index-VBBgqHqv.js} +3 -3
  43. package/dist/{index-ab9KSEKp.js → index-Zr4W3H4i.js} +2 -2
  44. package/dist/{index-DmBNvVlZ.js → index-jfKiyRsE.js} +1327 -1111
  45. package/dist/{index-EhaPjLBG.js → index-lSMZmF7U.js} +2 -2
  46. package/dist/{index-B5NG2ONv.js → index-rDv1Pb8y.js} +2 -2
  47. package/dist/{index-n1HZa-Ar.js → index-ulVZgzRz.js} +2 -2
  48. package/dist/{index-_-ORWa-m.js → index-w1Oz-JSm.js} +1 -1
  49. package/dist/index.es.js +2 -2
  50. package/dist/{mb-render-BZDgmpm9.js → mb-render-Dc2J-VKn.js} +9 -3
  51. package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-Ciue53Ue.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-D60Qjkgq.js} +8 -1
  52. package/dist/{pagination-design-DU2ZuaY4.js → pagination-design-J5Xr1H6H.js} +2 -2
  53. package/dist/paper-widget-design-mppU2AMx.js +4 -0
  54. package/dist/{print-runtime-instance-ydLRVd0y.js → print-runtime-instance-CkGherFi.js} +1 -1
  55. package/dist/{print-snapshot-renderer-C3fEtvNI.js → print-snapshot-renderer-BxrmKmGQ.js} +3 -3
  56. package/dist/{qrcode-design-BXlQ5QTm.js → qrcode-design-DJciYm3W.js} +1 -1
  57. package/dist/{revo-grid.entry-DdE6cuGJ.js → revo-grid.entry-D2XU7yfg.js} +1 -1
  58. package/dist/{revogr-attribution_7.entry-Er1fVrov.js → revogr-attribution_7.entry-DiKuD6Oj.js} +3 -3
  59. package/dist/{revogr-clipboard_3.entry-COq2SN-B.js → revogr-clipboard_3.entry-BaU8s-5o.js} +2 -2
  60. package/dist/{revogr-data_4.entry--CfGDdVK.js → revogr-data_4.entry-D6AqE208.js} +2 -2
  61. package/dist/{revogr-filter-panel.entry-DoNXkBy6.js → revogr-filter-panel.entry-B0-_hrSZ.js} +1 -1
  62. package/dist/seal-design-FsL7H3e7.js +4 -0
  63. package/dist/{serialnumber-design-fMRSi9jn.js → serialnumber-design-BfeGFYY4.js} +1 -1
  64. package/dist/shared/index.es.js +10 -8
  65. package/dist/{single-field-drop-CYcOH6mT.js → single-field-drop-wg47buz7.js} +2 -2
  66. package/dist/{size-editor-BKJfYgbR.js → size-editor-hnWquuM2.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/sub-table/allocate-table-core.d.ts +2 -1
  71. package/dist/src/nocode-base/src/core/sub-table/sub-table-core.d.ts +2 -1
  72. package/dist/src/nocode-base/src/hooks/form-model/form-model-controller.d.ts +2 -0
  73. package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +1 -0
  74. package/dist/src/nocode-base/src/hooks/material-consume/tmpl-bom-controller.d.ts +12 -7
  75. package/dist/src/nocode-base/src/hooks/material-consume-object/bom-validator.d.ts +4 -3
  76. package/dist/src/nocode-base/src/hooks/material-consume-object/initialize-autofill.d.ts +19 -0
  77. package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
  78. package/dist/src/nocode-base/src/interface/render.d.ts +3 -1
  79. package/dist/src/nocode-base/src/interface/transform.d.ts +9 -1
  80. package/dist/src/nocode-base/src/runtime/async-task-coordinator.d.ts +6 -2
  81. package/dist/src/nocode-base/src/runtime/multi-sheet-runtime.d.ts +5 -1
  82. package/dist/src/nocode-base/src/runtime/runtime-context.d.ts +4 -0
  83. package/dist/src/nocode-base/src/runtime/runtime-field-initializer.d.ts +1 -1
  84. package/dist/src/nocode-base/src/runtime/runtime-validation-service.d.ts +1 -0
  85. package/dist/src/nocode-base/src/types/render/mc-render.d.ts +1 -1
  86. package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +5 -1
  87. package/dist/src/nocode-web-render/src/render/sub-table/common/inventory-scan-columns.d.ts +6 -0
  88. package/dist/src/nocode-web-render/src/render/sub-table/material-consume/mc-web-render.d.ts +1 -1
  89. package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-design.vue.d.ts +1 -0
  90. package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields.util.d.ts +2 -2
  91. package/dist/src/online-form/src/views/__cell_widgets__/common/quick-search-editor/quick-search.util.d.ts +8 -0
  92. package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-option-select.vue.d.ts +1 -0
  93. package/dist/src/online-form/src/views/designer/conversions/normalize-paper-grid.d.ts +3 -0
  94. package/dist/src/online-form/src/views/render/__components__/_field_/trace/utils/use-rule-props.d.ts +0 -3
  95. package/dist/src/online-form/src/views/render/sheet-tab-bar.vue.d.ts +5 -3
  96. package/dist/src/shared/enum/field-type.d.ts +2 -0
  97. package/dist/src/shared/enum/index.d.ts +2 -0
  98. package/dist/src/shared/enum/product-type.d.ts +9 -0
  99. package/dist/src/shared/enum/production-identification.d.ts +19 -0
  100. package/dist/{sub-table-factory-DxM8KQoS.js → sub-table-factory-DCjl5fld.js} +19 -7
  101. package/dist/{text-design-8Za9qOSI.js → text-design-BQqBHcG3.js} +2 -2
  102. package/dist/{throttle-Cpk1LoGk-BI0wP2Le.js → throttle-Cpk1LoGk-C-bCLTWf.js} +1 -1
  103. package/dist/{timediff-design-O1IfzLVD.js → timediff-design-DzNFXX0B.js} +1 -1
  104. package/dist/{trace-like-wrapper-BPNmxIDn.js → trace-like-wrapper-BO9GpUUT.js} +2 -2
  105. package/dist/{value-editor.vue_vue_type_style_index_0_lang-CQ0YP-OF.js → value-editor.vue_vue_type_style_index_0_lang-NrJ6BC4L.js} +2 -2
  106. package/dist/web-render/index.es.js +3 -3
  107. package/dist/{widget-barcode-C38yawCK.js → widget-barcode-CqFwMMNr.js} +4 -4
  108. package/dist/{widget-diagonal-abcgVyu4.js → widget-diagonal-Bv7rOoCE.js} +3 -3
  109. package/dist/{widget-image-DcSNslZ-.js → widget-image-C7uAoxCn.js} +5 -5
  110. package/dist/{widget-line-CttlnK7g.js → widget-line-DjEbtHhc.js} +2 -2
  111. package/dist/{widget-pagination-BNG9Rszh.js → widget-pagination-Dc4pC9a8.js} +5 -5
  112. package/dist/{widget-power-DaC1id-m.js → widget-power-9LyPBlNG.js} +3 -3
  113. package/dist/{widget-qrcode-BRFsOH44.js → widget-qrcode-wY0Htp8v.js} +3 -3
  114. package/dist/{widget-rangelimit-fA6YF2E2.js → widget-rangelimit-CT9yqbbL.js} +3 -3
  115. package/dist/{widget-serialnumber-mnpGMXuB.js → widget-serialnumber-CChK8wrF.js} +1 -1
  116. package/dist/{widget-text-gHJcpS1w.js → widget-text-mWwms2HC.js} +5 -5
  117. package/dist/{widget-timediff-ByHm9Dg3.js → widget-timediff-GSd_w8qO.js} +2 -2
  118. package/package.json +2 -2
  119. package/dist/paper-widget-design-BE_wOTpv.js +0 -4
  120. package/dist/seal-design-7aKsQ6RT.js +0 -4
@@ -1,13 +1,13 @@
1
- import { E as api, $ as PlatformEnum, F as FIELD_TYPE, bi as getRowId, bj as findRuntimeTableRow, b8 as RenderModeEnum, C as ComponentTypeEnum, bv as assembleRules, bw as isAttachFieldActive, aI as Dependency_ENUM, bk as calculateFormula, aH as ASSIGNMENTSTRATEGY_ENUM, R as getParseFormulaVarInfos, bx as fetchHistoryConsume, by as isBomGranted, aW as renderUtils, bu as uuid2, bz as parseFrontConfig, aL as CheckDsTypeEnum, aF as transformUtils, bA as baseDataUtils, bB as initializeSealFields, Y as FormTypeEnum, bC as normalizeToArray, bD as safeParseArray, bE as BpmnNodeTypeEnum, bF as mergeByMultiKey, a8 as _export_sfc, bG as evaluateInspectionDecisionRule, bH as areValidationCommentsEqual, bI as useNocodeEmitter, bJ as commonUtils, aJ as EntityModelCategoryEnum } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-ClcBVLO0.js";
2
- import { aO, aQ, a$, a1, bK, bL, B, bM, y, ai, bN, bO, bP, bh, bQ, aT, ay, aP, aM, aN, bR, aj, an, bS, bT, aG, a3, ah, az, aR, a0, al, L, bU, bV, bW, O, p, P, aa, o, Q, A, bX, bY, ax, aw, a6, a2, a4, a5, a7, f, bZ, am, aq, ak, b_, b$, c0, c1, bg, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, bl, cc, cd, aZ, ce, b0, b1, cf, cg, ch, ci, cj, ck, cl, cm, cn, co, aY, cp, b2, be, cq, cr, cs, ao, t, aS, ct, cu, bm, a_ } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-ClcBVLO0.js";
3
- import { L as getRuntimeDataFieldId, x as parseRuntimeFieldPath, O as buildRuntimeFieldPath, P as resolveRuntimeFieldProps, Q as resolveRuntimeFieldState, T as getRuntimeDependencyOutputKey, U as isRowAddedInCurrentFormChange, l as MaterialConsumptionPatternEnum, V as MaterialConsumeTableController, W as setFormulaParamsConfig, X as normalizeRuntime, F as createRuntimeInstanceContext, R as RuntimeFormStateStore, Y as RuntimeSheetService, g as getBusinessFieldKey, Z as validateObjectBomQtyOnSubmit, $ as closeValidatorPopovers, a0 as enrichFormChangeRowDetails, N as NCB_PROVIDE, G as RuntimeInstanceRegistry, a1 as useMaterialBalance, a2 as collectFormChangeFieldLocations, a3 as nextFormChangeRowViewHistoryId } from "../dynamic-table-action-Bi7RdYoy.js";
4
- import { B as B2, a4 as a42, b, _, a5 as a52, J, a6 as a62, K, E, a7 as a72, a8, a9, aa as aa2, ab, ac, M, ad, ae, af, ag, ah as ah2, ai as ai2, aj as aj2, ak as ak2, q, al as al2, k, am as am2, c, an as an2, ao as ao2, ap, aq as aq2, j, t as t2, ar, as, at, au, d, w, a, av, aw as aw2, ax as ax2, ay as ay2, az as az2, aA, m, r, aB, o as o2, h, aC, s, aD, z, A as A2, u, p as p2, C, f as f2, i, y as y2, e, v } from "../dynamic-table-action-Bi7RdYoy.js";
1
+ import { E as api, $ as PlatformEnum, F as FIELD_TYPE, bj as getRowId, bk as findRuntimeTableRow, b9 as RenderModeEnum, C as ComponentTypeEnum, bw as assembleRules, bx as isAttachFieldActive, aI as Dependency_ENUM, bl as calculateFormula, aH as ASSIGNMENTSTRATEGY_ENUM, R as getParseFormulaVarInfos, by as fetchHistoryConsume, bz as isBomGranted, aW as renderUtils, bv as uuid2, bA as parseFrontConfig, aL as CheckDsTypeEnum, aF as transformUtils, bB as baseDataUtils, bC as initializeSealFields, Y as FormTypeEnum, bD as normalizeToArray, bE as safeParseArray, bF as BpmnNodeTypeEnum, bG as mergeByMultiKey, a8 as _export_sfc, bH as evaluateInspectionDecisionRule, bI as areValidationCommentsEqual, bJ as useNocodeEmitter, bK as commonUtils, aJ as EntityModelCategoryEnum } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DlcK-wt_.js";
2
+ import { aO, aQ, b0, a1, bL, bM, B, bN, y, ai, bO, bP, bQ, bi, bR, aT, ay, aP, aM, aN, bS, aj, an, bT, bU, aG, a3, ah, az, aR, a0, al, L, bV, bW, bX, O, p, P, aa, o, Q, A, bY, bZ, ax, aw, a6, a2, a4, a5, a7, f, b_, am, aq, ak, b$, c0, c1, c2, bh, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, bm, cd, ce, aZ, cf, b1, b2, cg, ch, ci, cj, ck, cl, cm, cn, co, cp, aY, cq, b3, bf, cr, cs, ct, ao, t, aS, cu, cv, bn, a_ } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DlcK-wt_.js";
3
+ import { P as getRuntimeDataFieldId, z as parseRuntimeFieldPath, Q as buildRuntimeFieldPath, T as resolveRuntimeFieldProps, U as resolveRuntimeFieldState, V as getRuntimeDependencyOutputKey, W as isRowAddedInCurrentFormChange, o as MaterialConsumptionPatternEnum, X as MaterialConsumeTableController, Y as setFormulaParamsConfig, Z as normalizeRuntime, H as createRuntimeInstanceContext, R as RuntimeFormStateStore, $ as RuntimeSheetService, g as getBusinessFieldKey, a0 as validateObjectBomQtyOnSubmit, a1 as closeValidatorPopovers, a2 as enrichFormChangeRowDetails, N as NCB_PROVIDE, I as RuntimeInstanceRegistry, a3 as useMaterialBalance, a4 as collectFormChangeFieldLocations, a5 as nextFormChangeRowViewHistoryId } from "../dynamic-table-action-DXlLVZZF.js";
4
+ import { B as B2, a6 as a62, e, _, a7 as a72, L as L2, a8, O as O2, E, a9, aa as aa2, ab, ac, ad, M, a, ae, b, af, ag, ah as ah2, ai as ai2, aj as aj2, ak as ak2, al as al2, am as am2, w, an as an2, m, ao as ao2, c, ap, aq as aq2, ar, as, l, x, at, au, av, aw as aw2, f as f2, y as y2, d, ax as ax2, ay as ay2, az as az2, aA, aB, aC, p as p2, r, aD, q, j, aE, s, aF, C, F, u, t as t2, G, i, k, A as A2, h, v } from "../dynamic-table-action-DXlLVZZF.js";
5
5
  import { toRaw, watch, toRef, computed, defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, ref, provide, onUnmounted, markRaw, reactive, onBeforeUnmount } from "vue";
6
6
  import { cloneDeep, defaults, isEmpty, merge } from "lodash-es";
7
7
  import "dayjs";
8
- import { S as SubTableCoreFactory, R as RuntimeInstanceController } from "../sub-table-factory-DxM8KQoS.js";
9
- import { A as A3, D, M as M2, a as a10, P as P2, b as b3, c as c10, d as d2, e as e2, W, f as f3, g, h as h2 } from "../sub-table-factory-DxM8KQoS.js";
10
- import { B as B3, F, M as M3, a as a11, u as u2 } from "../mb-render-BZDgmpm9.js";
8
+ import { S as SubTableCoreFactory, R as RuntimeInstanceController } from "../sub-table-factory-DCjl5fld.js";
9
+ import { A as A3, D, M as M2, a as a10, P as P2, b as b4, c as c10, d as d2, e as e2, W, f as f3, g, h as h2 } from "../sub-table-factory-DCjl5fld.js";
10
+ import { B as B3, F as F2, M as M3, a as a11, u as u2 } from "../mb-render-Dc2J-VKn.js";
11
11
  const InstanceStatusValues = {
12
12
  /** 作废状态 */
13
13
  ABANDON: "ABANDON",
@@ -190,7 +190,7 @@ class RuntimeFieldInitializer {
190
190
  await Promise.resolve();
191
191
  this.scheduled = false;
192
192
  if (!signal.aborted && !this.disposed) await this.initialize();
193
- }).catch((error) => console.error("业务字段初始化失败", error)).finally(() => this.tasks.delete("initialize:structure"));
193
+ }).catch(() => void 0).finally(() => this.tasks.delete("initialize:structure"));
194
194
  });
195
195
  }
196
196
  record;
@@ -203,7 +203,7 @@ class RuntimeFieldInitializer {
203
203
  disposed = false;
204
204
  scheduled = false;
205
205
  unsubscribe;
206
- /** 初次加载等待全部目标;失败保留在任务中心,不能把未完成的默认值当成可提交数据。 */
206
+ /** 初次加载等待全部目标;默认值请求失败保留在任务中心供诊断,但不阻止提交。 */
207
207
  async initialize() {
208
208
  if (this.disposed || this.info.renderPurpose || this.info.platformType === PlatformEnum.INTEGRATION_PAAS_DP)
209
209
  return;
@@ -247,7 +247,8 @@ class RuntimeFieldInitializer {
247
247
  modelKey: props.modelKey,
248
248
  subModelKey: props.subModelKey
249
249
  },
250
- sheetId
250
+ sheetId,
251
+ blockOnFailure: false
251
252
  }
252
253
  ).finally(() => this.tasks.delete(key));
253
254
  pending.push(task);
@@ -259,7 +260,7 @@ class RuntimeFieldInitializer {
259
260
  this.record.asyncTasks.cancel(key);
260
261
  this.tasks.delete(key);
261
262
  }
262
- await Promise.all(pending);
263
+ await Promise.allSettled(pending);
263
264
  }
264
265
  request(key, fetch) {
265
266
  const existing = this.requests.get(key);
@@ -805,6 +806,10 @@ class FormTmplBomController {
805
806
  field2TableMap = {};
806
807
  /** 默认物料消耗模式 */
807
808
  defaultMCPattern = MaterialConsumptionPatternEnum.RECORD;
809
+ /** 表单实例身份与 BOM 数据是否存在无关,模板展示也会创建完整控制器。 */
810
+ hasFormInstance = false;
811
+ /** 按页面中的表解析后的配置,页面与打印共用。 */
812
+ resolvedTmplBomList = [];
808
813
  constructor() {
809
814
  }
810
815
  /**
@@ -822,7 +827,9 @@ class FormTmplBomController {
822
827
  productQty: this.productQty,
823
828
  historyData: this.historyData,
824
829
  field2TableMap: this.field2TableMap,
825
- defaultMCPattern: this.defaultMCPattern
830
+ defaultMCPattern: this.defaultMCPattern,
831
+ hasFormInstance: this.hasFormInstance,
832
+ resolvedTmplBomList: this.resolvedTmplBomList
826
833
  })
827
834
  );
828
835
  (view.tmplBomList ?? []).forEach((config) => {
@@ -874,11 +881,11 @@ class FormTmplBomController {
874
881
  * @readonly
875
882
  */
876
883
  get bomEntries() {
877
- return this.formInstBom?.bomEntries;
884
+ return this.formInstBom?.bomEntries ?? [];
878
885
  }
879
886
  /** 表单模板bom信息配置列表 */
880
887
  get tmplBomList() {
881
- return this.formInstBom?.formTmplBomList;
888
+ return this.resolvedTmplBomList;
882
889
  }
883
890
  /**
884
891
  * bom那边指定的当前工序的开关
@@ -887,30 +894,55 @@ class FormTmplBomController {
887
894
  get enableSequenceLoading() {
888
895
  return !!this.formInstBom?.sequenceEntries?.[0]?.enabled_;
889
896
  }
890
- /**
891
- * 初始化模板的物料消耗的配置
892
- */
897
+ createDefaultConfig(table) {
898
+ return {
899
+ table_key_: `${table.tableKey}:${table.masterSubField}`,
900
+ material_loading_model_enabled_: false,
901
+ material_consumption_pattern_: MaterialConsumptionPatternEnum.RECORD,
902
+ bom_init_enabled_: false,
903
+ personal_bom_enabled_: false,
904
+ sequence_loading_enabled_: false,
905
+ entries_: []
906
+ };
907
+ }
908
+ /** 有实例时读取实例配置,无实例时仅创建默认展示控制器。 */
893
909
  async init(data) {
894
- if (!data.formInstBom) {
895
- return;
910
+ this.hasFormInstance = data.hasFormInstance;
911
+ this.operationId = data.operationId ?? "";
912
+ this.materialNo = data.materialNo ?? "";
913
+ this.formInstBom = this.hasFormInstance ? data.formInstBom ?? null : null;
914
+ this.productQty = this.formInstBom ? data.productQty ?? 0 : data.productQty;
915
+ this.historyData = [];
916
+ this.defaultMCPattern = MaterialConsumptionPatternEnum.RECORD;
917
+ this.tableControllers = {};
918
+ this.field2TableMap = {};
919
+ const instanceConfigs = new Map(
920
+ (this.formInstBom?.formTmplBomList ?? []).filter((config) => !config.deleted_ && config.table_key_).map((config) => [config.table_key_, config])
921
+ );
922
+ this.resolvedTmplBomList = data.materialConsumeTableList.map((table) => {
923
+ const key = `${table.tableKey}:${table.masterSubField}`;
924
+ const source = instanceConfigs.get(key);
925
+ if (!source) return this.createDefaultConfig(table);
926
+ const config = cloneDeep(source);
927
+ config.entries_ ??= [];
928
+ return config;
929
+ });
930
+ if (this.formInstBom) {
931
+ if (this.formInstBom.productionIdentificationId && this.operationId) {
932
+ this.historyData = await fetchHistoryConsume({
933
+ production_identification_id_: this.formInstBom.productionIdentificationId,
934
+ routing_operation_id_: this.operationId
935
+ });
936
+ }
937
+ const isGranted = await isBomGranted();
938
+ this.defaultMCPattern = isGranted ? MaterialConsumptionPatternEnum.BOM : MaterialConsumptionPatternEnum.RECORD;
896
939
  }
897
- this.operationId = data.operationId;
898
- this.materialNo = data.materialNo;
899
- this.formInstBom = data.formInstBom;
900
- this.productQty = data.productQty ?? 0;
901
- this.historyData = await fetchHistoryConsume({
902
- production_identification_id_: this.formInstBom.productionIdentificationId,
903
- routing_operation_id_: this.operationId
940
+ data.materialConsumeTableList.forEach((table, index) => {
941
+ const config = this.resolvedTmplBomList[index];
942
+ const controller = new MaterialConsumeTableController(this, config);
943
+ this.tableControllers[table.tableKey] = controller;
944
+ this.field2TableMap[table.masterSubField] = table.tableKey;
904
945
  });
905
- const isGranted = await isBomGranted();
906
- this.defaultMCPattern = isGranted ? MaterialConsumptionPatternEnum.BOM : MaterialConsumptionPatternEnum.RECORD;
907
- this.tableControllers = {};
908
- this.tmplBomList.forEach((cur) => {
909
- const controller = new MaterialConsumeTableController(this, cur);
910
- const [tableKey, fieldKey] = cur.table_key_.split(":");
911
- this.tableControllers[tableKey] = controller;
912
- this.field2TableMap[fieldKey] = tableKey;
913
- }, {});
914
946
  }
915
947
  /**
916
948
  * 根据字段key获取子表控制器
@@ -971,6 +1003,79 @@ class FormTmplBomController {
971
1003
  };
972
1004
  }
973
1005
  }
1006
+ async function prepareObjectProductDefaults({
1007
+ enabled,
1008
+ fields,
1009
+ objectInitialValues = [],
1010
+ onWarning
1011
+ }) {
1012
+ const defaults2 = /* @__PURE__ */ new WeakMap();
1013
+ if (!enabled) return defaults2;
1014
+ const requests = /* @__PURE__ */ new Map();
1015
+ const tasks = [];
1016
+ function fetchProduct(productId) {
1017
+ const existing = requests.get(productId);
1018
+ if (existing) return existing;
1019
+ const request = (async () => {
1020
+ const result = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
1021
+ {
1022
+ modelCategory: "entity",
1023
+ modelKey: "em_product",
1024
+ bsKey: "rdoGetVersionById"
1025
+ },
1026
+ // 沿用现有接口约定,传完整默认值,不拆分版本 ID。
1027
+ { id: productId }
1028
+ );
1029
+ const product = result?.data;
1030
+ if (!product || typeof product !== "object" || Array.isArray(product) || Object.keys(product).length === 0) {
1031
+ return void 0;
1032
+ }
1033
+ return { ...product, _DICT: result?.dict ?? product._DICT };
1034
+ })();
1035
+ requests.set(productId, request);
1036
+ return request;
1037
+ }
1038
+ for (const entry of fields) {
1039
+ if (!entry || typeof entry !== "object") continue;
1040
+ const field = entry;
1041
+ if (typeof field.fieldId !== "string" || !field.belongingObject || field.fieldType !== FIELD_TYPE.PRODUCT || field.isFieldModel || field.subFieldKey || field.subModelKey) {
1042
+ continue;
1043
+ }
1044
+ const configured = objectInitialValues.find(
1045
+ (item) => item.objectField === field.belongingObject
1046
+ );
1047
+ if (!configured?.values || !Object.prototype.hasOwnProperty.call(configured.values, field.fieldId)) {
1048
+ continue;
1049
+ }
1050
+ const productDefault = {
1051
+ value: configured.values[field.fieldId]
1052
+ };
1053
+ defaults2.set(entry, productDefault);
1054
+ const productId = productDefault.value;
1055
+ const needsAutofill = field.enableAutofill !== false && field.autofillRules?.some((rule) => !!rule.toField);
1056
+ if (!needsAutofill || typeof productId !== "string" || productId === "") continue;
1057
+ tasks.push(
1058
+ fetchProduct(productId).then(
1059
+ (sourceData) => {
1060
+ if (!sourceData) {
1061
+ const objectName = configured.objectFieldName || field.belongingObject;
1062
+ onWarning?.(
1063
+ `「数据 → 对象初始化 → ${objectName} → 配置」中的默认物料未查到详情(字段 ${field.fieldId},物料 ${productId}),已跳过自动填充。`
1064
+ );
1065
+ return;
1066
+ }
1067
+ productDefault.sourceData = sourceData;
1068
+ },
1069
+ (error) => {
1070
+ const reason = error instanceof Error ? error.message : String(error);
1071
+ throw new Error(`对象初始化数据填充失败,字段 ${field.fieldId}:${reason}`);
1072
+ }
1073
+ )
1074
+ );
1075
+ }
1076
+ await Promise.all(tasks);
1077
+ return defaults2;
1078
+ }
974
1079
  async function getModelQueries(opts) {
975
1080
  const isEdhr = await isEdhrSuite();
976
1081
  if (!isEdhr || !opts.mainMaterialNo) {
@@ -1115,13 +1220,14 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
1115
1220
  let runtimeFormStateStore;
1116
1221
  let scriptRunner;
1117
1222
  try {
1118
- const normalizedRuntime = normalizeRuntime(selfInfo?.runtimeJson || "{}");
1223
+ const normalizedRuntime = normalizeRuntime(selfInfo?.runtimeJson || "{}", selfInfo.formType);
1119
1224
  const tid = result.tid;
1120
1225
  const uniqueId = `${tid}_${uuid2(8)}`;
1121
1226
  const runtimeContext = createRuntimeInstanceContext({
1122
1227
  uniqueId,
1123
1228
  instanceId: id,
1124
1229
  templateId: tid,
1230
+ formType: selfInfo.formType,
1125
1231
  runtime: normalizedRuntime,
1126
1232
  defaultData: {}
1127
1233
  });
@@ -1263,6 +1369,8 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
1263
1369
  }
1264
1370
  await tmplBomC.init({
1265
1371
  formInstBom: selfInfo.formInstBom,
1372
+ materialConsumeTableList: businessIndex.materialConsumeTableList,
1373
+ hasFormInstance: isFormInstance,
1266
1374
  operationId: paramsConfig?.routingOperationId,
1267
1375
  materialNo,
1268
1376
  productQty: paramsConfig?.productQty
@@ -1334,7 +1442,16 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
1334
1442
  params: { id: paramsConfig?.warehouseId }
1335
1443
  }
1336
1444
  ]);
1445
+ const objectProductDefaults = await prepareObjectProductDefaults({
1446
+ enabled: fillModeType === RenderModeEnum.FormMode && selfInfo.dataStatus !== "STASH" && selfInfo.dataStatus !== "SUBMIT",
1447
+ fields: fieldInfoMap.useDefaultValueFields,
1448
+ objectInitialValues: runtimeContext.formConfig.objectInitialValues,
1449
+ onWarning: (content) => {
1450
+ window.NocodeAdapter.openUtil?.message({ type: "warning", content, duration: 8 });
1451
+ }
1452
+ });
1337
1453
  const defaultDataMap = renderUtils.getDefaultValueMapByField({
1454
+ objectProductDefaults,
1338
1455
  defaultValueFields: fieldInfoMap.useDefaultValueFields,
1339
1456
  mainMaterialNo: paramsConfig?.materialNo || selfInfo.materialNo,
1340
1457
  mainRelatedLotNo: paramsConfig?.relatedLotNo,
@@ -1424,6 +1541,15 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
1424
1541
  });
1425
1542
  initializeSealFields(floatingFields, formState);
1426
1543
  }
1544
+ await transformUtils.getEventInitDataLoaded({
1545
+ formConfig: runtimeContext.formConfig,
1546
+ formState,
1547
+ viewMode: fillModeType,
1548
+ dataStatus: selfInfo.dataStatus,
1549
+ ofCtx: { formPrint: payload.formPrint, id: result.id }
1550
+ }).catch((error) => {
1551
+ console.error("Error in getEventInitDataLoaded:", error);
1552
+ });
1427
1553
  runtimeFormStateStore = new RuntimeFormStateStore(
1428
1554
  formState,
1429
1555
  // 子表信息覆盖普通/固定/检验表、二维关联列以及各类业务表;不能只依赖已放置字段。
@@ -1542,6 +1668,18 @@ function bindRuntimeBusinessServices(runtimeRegistry, record, dataStatus) {
1542
1668
  uniqueId,
1543
1669
  () => MaterialConsumeTableController.render?.destroyAllModals(uniqueId)
1544
1670
  );
1671
+ runtimeRegistry.registerDisposable(
1672
+ uniqueId,
1673
+ watch(
1674
+ () => record.context.activeSheetId,
1675
+ (next, previous) => {
1676
+ if (next !== previous) {
1677
+ MaterialConsumeTableController.render?.destroyAllModals(uniqueId);
1678
+ }
1679
+ },
1680
+ { flush: "sync" }
1681
+ )
1682
+ );
1545
1683
  if (!mcList.length) return;
1546
1684
  const tmplBomC = record.context.services.tmplBomController;
1547
1685
  if (!tmplBomC) return;
@@ -1838,7 +1976,13 @@ function createRuntimePersistenceAccess(runtimeRegistry, props, payload) {
1838
1976
  const signatureKeys = (runtimeRecord.context.businessIndex.useSignatureFields || []).map(
1839
1977
  (item) => item.fieldId
1840
1978
  );
1841
- const idsFormState = transformUtils.getFormDataIdsMap(newFormState, signatureKeys);
1979
+ const idsFormState = transformUtils.getFormDataIdsMap(
1980
+ newFormState,
1981
+ signatureKeys,
1982
+ (path) => runtimeRecord.fields.findByPath(path).some(
1983
+ ({ widget, subFieldKey }) => subFieldKey !== path && [FIELD_TYPE.DATE, FIELD_TYPE.DATE_TIME].includes(widget?.props.fieldType)
1984
+ )
1985
+ );
1842
1986
  if (saveToken ? !runtimeRecord.persistence.completeSave(saveToken) : requestedRevision !== runtimeRecord.formState.revision) {
1843
1987
  return false;
1844
1988
  }
@@ -1915,6 +2059,139 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1915
2059
  }
1916
2060
  });
1917
2061
  const InspectionDecisionPromptModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9c14035f"]]);
2062
+ function createMaterialConsumeObjectValidation(options) {
2063
+ const { record, getInfo, isCurrent, shouldSkip, applyComments } = options;
2064
+ let enabled = false;
2065
+ let disposed = false;
2066
+ let submitting = 0;
2067
+ let generation = 0;
2068
+ let lastRevision = -1;
2069
+ let timer;
2070
+ let paths = /* @__PURE__ */ new Set();
2071
+ const unlocated = /* @__PURE__ */ new Set();
2072
+ const alive = () => !disposed && isCurrent();
2073
+ function cancelLive() {
2074
+ generation++;
2075
+ if (timer !== void 0) clearTimeout(timer);
2076
+ timer = void 0;
2077
+ }
2078
+ function calcObjectError(error) {
2079
+ const info = getInfo();
2080
+ const modelKey = info?.modelKey || record.context.businessIndex.modelDisplay.key;
2081
+ const descriptor = record.fields.findField({ modelKey, fieldId: error.field });
2082
+ const props = descriptor?.widget?.props;
2083
+ if (!props?.field || descriptor?.subFieldKey || props.subFieldKey) {
2084
+ const key = modelKey + "." + error.field;
2085
+ if (!unlocated.has(key)) {
2086
+ unlocated.add(key);
2087
+ console.warn("物料消耗对象错误未定位到主表控件,保留在校验清单:", key);
2088
+ }
2089
+ return { error, path: void 0 };
2090
+ }
2091
+ const path = buildRuntimeFieldPath({
2092
+ ...props,
2093
+ modelKey: props.modelKey ?? info?.modelKey,
2094
+ fieldId: props.field
2095
+ });
2096
+ return { error: { ...error, field: path }, path };
2097
+ }
2098
+ function replaceObjectFields(fields) {
2099
+ if (!alive()) return;
2100
+ const next = { ...getInfo()?.mcValidatorMessageMap ?? {} };
2101
+ paths.forEach((path) => delete next[path]);
2102
+ Object.assign(next, fields);
2103
+ paths = new Set(Object.keys(fields));
2104
+ applyComments(next);
2105
+ }
2106
+ function replaceTableFields(fields) {
2107
+ if (!alive()) return;
2108
+ const current = getInfo()?.mcValidatorMessageMap ?? {};
2109
+ const next = { ...fields ?? {} };
2110
+ paths.forEach((path) => {
2111
+ if (current[path]) {
2112
+ next[path] = [...next[path] ?? [], ...current[path]];
2113
+ }
2114
+ });
2115
+ applyComments(next);
2116
+ }
2117
+ function clear() {
2118
+ cancelLive();
2119
+ enabled = false;
2120
+ lastRevision = -1;
2121
+ replaceObjectFields({});
2122
+ }
2123
+ async function validate(live = false) {
2124
+ cancelLive();
2125
+ if (!alive()) return;
2126
+ if (shouldSkip()) {
2127
+ clear();
2128
+ return { isValid: true };
2129
+ }
2130
+ const ticket = generation;
2131
+ const revision = record.formState.revision;
2132
+ const info = getInfo();
2133
+ const display = record.context.businessIndex.modelDisplay;
2134
+ const errors = await validateObjectBomQtyOnSubmit({
2135
+ formState: record.formState.state,
2136
+ objectFieldList: record.context.formConfig.objectFieldList,
2137
+ formInstBom: record.context.services.tmplBomController?.formInstBom,
2138
+ showModelName: display.name,
2139
+ showModelKey: display.key || info?.modelKey || ""
2140
+ });
2141
+ if (!alive() || generation !== ticket || record.formState.revision !== revision || live && getInfo()?.renderModeType !== RenderModeEnum.FormMode)
2142
+ return;
2143
+ const fields = {};
2144
+ const comments = {};
2145
+ for (const source of errors) {
2146
+ const adapted = calcObjectError(source);
2147
+ (fields[adapted.error.field] ??= []).push(adapted.error);
2148
+ if (adapted.path) (comments[adapted.path] ??= []).push(adapted.error);
2149
+ }
2150
+ enabled = !!record.context.formConfig.objectFieldList?.length;
2151
+ lastRevision = revision;
2152
+ replaceObjectFields(comments);
2153
+ return { isValid: !errors.length, fields: Object.keys(fields).length ? fields : void 0 };
2154
+ }
2155
+ function requestLive() {
2156
+ cancelLive();
2157
+ if (!alive() || !enabled || submitting > 0 || getInfo()?.renderModeType !== RenderModeEnum.FormMode)
2158
+ return;
2159
+ const ticket = generation;
2160
+ timer = setTimeout(() => {
2161
+ timer = void 0;
2162
+ void (async () => {
2163
+ await record.controller?.waitUntilPrepared();
2164
+ await record.asyncTasks.waitForRequired();
2165
+ if (!alive() || generation !== ticket || submitting > 0 || getInfo()?.renderModeType !== RenderModeEnum.FormMode)
2166
+ return;
2167
+ await validate(true);
2168
+ })().catch((error) => {
2169
+ if (alive()) console.error("物料消耗对象实时校验失败", error);
2170
+ });
2171
+ }, 300);
2172
+ }
2173
+ return {
2174
+ validate,
2175
+ requestLive,
2176
+ replaceTableFields,
2177
+ clear,
2178
+ beginSubmit() {
2179
+ submitting++;
2180
+ cancelLive();
2181
+ },
2182
+ endSubmit() {
2183
+ submitting--;
2184
+ if (alive() && submitting === 0 && enabled && lastRevision !== record.formState.revision)
2185
+ requestLive();
2186
+ },
2187
+ dispose() {
2188
+ disposed = true;
2189
+ cancelLive();
2190
+ paths.clear();
2191
+ unlocated.clear();
2192
+ }
2193
+ };
2194
+ }
1918
2195
  function applyValidationComments(info, comments, kind) {
1919
2196
  if (!info) return;
1920
2197
  const locationKey = kind === "field" ? "validatorLocationList" : "mcValidatorLocationList";
@@ -1932,6 +2209,29 @@ function applyValidationComments(info, comments, kind) {
1932
2209
  info[messageKey] = map;
1933
2210
  }
1934
2211
  function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType) {
2212
+ const objectValidations = /* @__PURE__ */ new WeakMap();
2213
+ function getObjectValidation(record) {
2214
+ const existing = objectValidations.get(record);
2215
+ if (existing) return existing;
2216
+ const uniqueId = record.context.uniqueId;
2217
+ const validation = createMaterialConsumeObjectValidation({
2218
+ record,
2219
+ getInfo: () => getInfo(uniqueId),
2220
+ isCurrent: () => runtimeRegistry.get(uniqueId) === record,
2221
+ shouldSkip: () => {
2222
+ const skip = syncInspectionDecisionRule(uniqueId);
2223
+ if (skip) clearInspectionValidationState(uniqueId);
2224
+ return skip;
2225
+ },
2226
+ applyComments: (fields) => applyValidationComments(getInfo(uniqueId), fields, "material")
2227
+ });
2228
+ objectValidations.set(record, validation);
2229
+ runtimeRegistry.registerDisposable(uniqueId, () => {
2230
+ validation.dispose();
2231
+ objectValidations.delete(record);
2232
+ });
2233
+ return validation;
2234
+ }
1935
2235
  const inspectionDecisionMatched = /* @__PURE__ */ new WeakMap();
1936
2236
  const inspectionDecisionPrompting = /* @__PURE__ */ new WeakSet();
1937
2237
  function openInspectionDecisionPrompt(uniqueId, content) {
@@ -1972,11 +2272,14 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
1972
2272
  return matched;
1973
2273
  }
1974
2274
  function clearInspectionValidationState(uniqueId) {
2275
+ const record = runtimeRegistry.get(uniqueId);
2276
+ if (record) objectValidations.get(record)?.clear();
1975
2277
  applyValidationComments(getInfo(uniqueId), null, "field");
1976
2278
  applyValidationComments(getInfo(uniqueId), null, "material");
1977
2279
  }
1978
2280
  function bindFormValidationSync(uniqueId) {
1979
2281
  const record = runtimeRegistry.require(uniqueId);
2282
+ const objects = getObjectValidation(record);
1980
2283
  syncInspectionDecisionRule(uniqueId);
1981
2284
  const stop = record.formState.subscribe(() => {
1982
2285
  if (runtimeRegistry.get(uniqueId) !== record) return;
@@ -1987,6 +2290,7 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
1987
2290
  uniqueId,
1988
2291
  !suppressed && info.renderModeType === RenderModeEnum.FormMode
1989
2292
  );
2293
+ objects.requestLive();
1990
2294
  if (suppressed) return;
1991
2295
  if (info.renderModeType === RenderModeEnum.FormMode) {
1992
2296
  record.validation.requestLive("change");
@@ -2019,48 +2323,43 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
2019
2323
  }
2020
2324
  async function runSubmissionValidation(uniqueId) {
2021
2325
  const record = runtimeRegistry.require(uniqueId);
2022
- const formState = record.formState.state;
2023
- const bomC = record.context.services.tmplBomController;
2024
- if (syncInspectionDecisionRule(uniqueId)) {
2025
- clearInspectionValidationState(uniqueId);
2026
- return { isValid: true };
2027
- }
2028
- const res = await record.validation.validate();
2029
- if (!res || runtimeRegistry.get(uniqueId) !== record) return;
2030
- const revision = record.formState.revision;
2031
- if (bomC) {
2032
- const bomRes = await bomC.submitValidate();
2033
- if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2034
- return;
2035
- applyValidationComments(getInfo(uniqueId), bomRes.fields ?? null, "material");
2036
- if (!bomRes.isValid) {
2037
- merge(res, bomRes);
2038
- return res;
2326
+ const objects = getObjectValidation(record);
2327
+ objects.beginSubmit();
2328
+ try {
2329
+ if (syncInspectionDecisionRule(uniqueId)) {
2330
+ clearInspectionValidationState(uniqueId);
2331
+ return { isValid: true };
2039
2332
  }
2040
- const info = getInfo(uniqueId);
2041
- const display = record.context.businessIndex.modelDisplay;
2042
- display.name;
2043
- const showModelKey = display.key || info?.modelKey || "";
2044
- const objErrs = await validateObjectBomQtyOnSubmit({
2045
- formState: formState ?? {},
2046
- objectFieldList: record.context.formConfig.objectFieldList,
2047
- formInstBom: bomC.formInstBom,
2048
- showModelKey
2049
- });
2050
- if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2051
- return;
2052
- if (objErrs.length) {
2053
- const fields = {};
2054
- objErrs.forEach((e3) => {
2055
- (fields[e3.field] ??= []).push(e3);
2056
- });
2057
- const objectBomRes = { isValid: false, fields };
2058
- merge(res, objectBomRes);
2059
- applyValidationComments(info, { ...info?.validatorMessageMap ?? {}, ...fields }, "field");
2060
- return res;
2333
+ const res = await record.validation.validate();
2334
+ if (!res || runtimeRegistry.get(uniqueId) !== record) return;
2335
+ const revision = record.formState.revision;
2336
+ const bomC = record.context.services.tmplBomController;
2337
+ if (bomC) {
2338
+ const bomRes = await bomC.submitValidate();
2339
+ if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2340
+ return;
2341
+ objects.replaceTableFields(bomRes.fields);
2342
+ if (!bomRes.isValid) {
2343
+ merge(res, bomRes);
2344
+ return res;
2345
+ }
2346
+ const objectRes = await objects.validate();
2347
+ if (!objectRes || runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2348
+ return;
2349
+ if (!objectRes.isValid) {
2350
+ const fields = { ...res.fields ?? {} };
2351
+ for (const [path, errors] of Object.entries(objectRes.fields ?? {})) {
2352
+ fields[path] = [...fields[path] ?? [], ...errors];
2353
+ }
2354
+ return { ...res, isValid: false, fields };
2355
+ }
2356
+ } else {
2357
+ objects.clear();
2061
2358
  }
2359
+ return res;
2360
+ } finally {
2361
+ objects.endSubmit();
2062
2362
  }
2063
- return res;
2064
2363
  }
2065
2364
  function updateRenderModeType(uniqueId, mode, updateButton = false) {
2066
2365
  const record = runtimeRegistry.require(uniqueId);
@@ -2078,7 +2377,9 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
2078
2377
  if (!isCurrent() || runtimeRegistry.get(uniqueId) !== record) return;
2079
2378
  await record.validation.settleAfterModeSwitch(mode === RenderModeEnum.FormMode);
2080
2379
  }).catch((error) => {
2081
- if (runtimeRegistry.get(uniqueId) === record) console.error("表单模式准备失败", error);
2380
+ if (runtimeRegistry.get(uniqueId) !== record) return;
2381
+ if (error instanceof Error && error.message.startsWith("以下异步任务执行失败:")) return;
2382
+ console.error("表单模式准备失败", error);
2082
2383
  });
2083
2384
  }
2084
2385
  async function prepareInitialView(record) {
@@ -3060,75 +3361,77 @@ export {
3060
3361
  A3 as AllocateTableCore,
3061
3362
  B3 as BaseFormModelFetcher,
3062
3363
  aQ as BinarizeMethodOptions,
3063
- a$ as BindCmpStyleEnum,
3364
+ b0 as BindCmpStyleEnum,
3064
3365
  a1 as BooleanShowMode,
3065
3366
  B2 as BorderTD,
3066
3367
  BpmnNodeTypeEnum,
3067
- bK as BpmnSignatureTypeEnum,
3068
- bL as ButtonTypeEnum,
3368
+ bL as BpmnSignatureTypeEnum,
3369
+ bM as ButtonTypeEnum,
3069
3370
  B as BwipCodeType,
3070
- bM as CHECK_TABLE_MEDPRO_PROTOCOL_KEY,
3371
+ bN as CHECK_TABLE_MEDPRO_PROTOCOL_KEY,
3071
3372
  y as CellType,
3072
3373
  ai as CellWidgetViewState,
3073
3374
  CheckDsTypeEnum,
3074
- bN as CodeRunner,
3375
+ bO as CodeRunner,
3075
3376
  ComponentTypeEnum,
3076
- bO as Config_Fields,
3077
- bP as ControlStatusEnum,
3078
- bh as DEVICE_GROUP_QUERY_KEY,
3079
- bQ as DEVICE_SEARCH_API,
3377
+ bP as Config_Fields,
3378
+ bQ as ControlStatusEnum,
3379
+ bi as DEVICE_GROUP_QUERY_KEY,
3380
+ bR as DEVICE_SEARCH_API,
3080
3381
  aT as DateFormat,
3081
3382
  ay as DecimalDisplayMode,
3082
3383
  aP as DenoiseMethodOptions,
3083
- a42 as DeviceConnector,
3384
+ a62 as DeviceConnector,
3084
3385
  aM as DeviceLink,
3085
- b as DeviceLinkTmplUtil,
3386
+ e as DeviceLinkTmplUtil,
3086
3387
  aN as DeviceParamsTypeTitle,
3087
3388
  D as DevicePartConsumeTableCore,
3088
- bR as DeviceStatus,
3389
+ bS as DeviceStatus,
3089
3390
  aj as DiagonalDirection,
3090
3391
  an as DiagonalVertex,
3091
3392
  _ as DocumentLayout,
3092
- a52 as DocumentLoading,
3093
- J as DocumentPaper,
3094
- a62 as DynamicQuickFillModal,
3095
- K as DynamicTableAction,
3096
- bS as EBR_PROVIDE_ENUM,
3097
- bT as EFieldBizTypeEnum,
3393
+ a72 as DocumentLoading,
3394
+ L2 as DocumentPaper,
3395
+ a8 as DynamicQuickFillModal,
3396
+ O2 as DynamicTableAction,
3397
+ bT as EBR_PROVIDE_ENUM,
3398
+ bU as EFieldBizTypeEnum,
3098
3399
  E as EMPTY_PRODUCT_VERSION_ID,
3099
3400
  aG as EmptySymbol,
3100
3401
  a3 as FallbackSignTypeEnum,
3101
3402
  ah as FieldSysVarDefaultValueEnum,
3102
3403
  FillingTypeEnum,
3103
- a72 as FixedQuickFillModal,
3404
+ a9 as FixedQuickFillModal,
3104
3405
  FormAnnotationController,
3105
- F as FormModelController,
3406
+ F2 as FormModelController,
3106
3407
  FormTmplBomController,
3107
- a8 as FormTmplConfigController,
3408
+ aa2 as FormTmplConfigController,
3108
3409
  FormTypeEnum,
3109
3410
  az as ImageDisplayModeEnum,
3110
3411
  InstanceStatusValues,
3111
3412
  aR as JoinModelTypeEum,
3112
- a9 as LEGACY_RUNTIME_FORM_CONFIG_KEYS,
3113
- aa2 as LEGACY_RUNTIME_SHEET_ID,
3114
- ab as LEGACY_RUNTIME_SHEET_TITLE,
3413
+ ab as LEGACY_RUNTIME_FORM_CONFIG_KEYS,
3414
+ ac as LEGACY_RUNTIME_SHEET_ID,
3415
+ ad as LEGACY_RUNTIME_SHEET_TITLE,
3115
3416
  a0 as LabelPosition,
3116
3417
  al as LineDirection,
3117
3418
  L as LineType,
3118
- bU as MAX_FRONT_ROW_KEY_LENGTH,
3419
+ bV as MAX_FRONT_ROW_KEY_LENGTH,
3420
+ M as MAX_RUNTIME_SHEETS,
3421
+ a as MAX_RUNTIME_SHEET_TITLE_LENGTH,
3119
3422
  M3 as MBRender,
3120
- ac as MCDataUtil,
3423
+ ae as MCDataUtil,
3121
3424
  a11 as MCRender,
3122
- M as MULTI_SHEET_SCHEMA_VERSION,
3425
+ b as MULTI_SHEET_SCHEMA_VERSION,
3123
3426
  MaterialConsumeTableController,
3124
3427
  MaterialConsumptionPatternEnum,
3125
3428
  M2 as MaterialRequisitionTableCore,
3126
3429
  MaterialStatusEnum,
3127
3430
  a10 as MaterialSubstitutionTableCore,
3128
- bV as MobileFillTypeEnum,
3431
+ bW as MobileFillTypeEnum,
3129
3432
  NCB_PROVIDE,
3130
- ad as OCR_MODEL_PRECISION_ENUM_KEY,
3131
- bW as OfficeTypeEnum,
3433
+ af as OCR_MODEL_PRECISION_ENUM_KEY,
3434
+ bX as OfficeTypeEnum,
3132
3435
  O as Orientation,
3133
3436
  p as PageSizeEnum,
3134
3437
  P as PaginationFormat,
@@ -3138,24 +3441,24 @@ export {
3138
3441
  A as ParamModelTypeEnum,
3139
3442
  P2 as PartStocktakeTableCore,
3140
3443
  PlatformEnum,
3141
- bX as PosEnum,
3142
- b3 as PretreatmentListTableCore,
3444
+ bY as PosEnum,
3445
+ b4 as PretreatmentListTableCore,
3143
3446
  c10 as ProfileDrivenSubTableCore,
3144
- bY as RUNTIME_COLUMN_ROW_KEY,
3447
+ bZ as RUNTIME_COLUMN_ROW_KEY,
3145
3448
  ax as RangeCompareOp,
3146
3449
  aw as RangeValidateMode,
3147
3450
  RenderModeEnum,
3148
- ae as RuntimeAsyncTaskCoordinator,
3149
- af as RuntimeDependencyService,
3150
- ag as RuntimeFieldRegistry,
3451
+ ag as RuntimeAsyncTaskCoordinator,
3452
+ ah2 as RuntimeDependencyService,
3453
+ ai2 as RuntimeFieldRegistry,
3151
3454
  RuntimeFormStateStore,
3152
3455
  RuntimeInstanceController,
3153
- ah2 as RuntimeInstanceEventBus,
3456
+ aj2 as RuntimeInstanceEventBus,
3154
3457
  RuntimeInstanceRegistry,
3155
- ai2 as RuntimePersistenceCoordinator,
3458
+ ak2 as RuntimePersistenceCoordinator,
3156
3459
  RuntimeRuleCompiler,
3157
3460
  RuntimeSheetService,
3158
- aj2 as RuntimeValidationService,
3461
+ al2 as RuntimeValidationService,
3159
3462
  a6 as SignShowTypeEnum,
3160
3463
  a2 as SignatureImageDirectionEnum,
3161
3464
  a4 as SignatureNumberTypeEnum,
@@ -3163,10 +3466,10 @@ export {
3163
3466
  a7 as SignatureTypeEnum,
3164
3467
  d2 as SterilizeBatchTableCore,
3165
3468
  e2 as StocktakeTableCore,
3166
- ak2 as SubTableCore,
3469
+ am2 as SubTableCore,
3167
3470
  SubTableCoreFactory,
3168
3471
  f as SubTableType,
3169
- bZ as SummaryApproveHisTypeEnum,
3472
+ b_ as SummaryApproveHisTypeEnum,
3170
3473
  am as TimeDiffFormat,
3171
3474
  aq as ViewTypeEnum,
3172
3475
  W as WarehouseInTableCore,
@@ -3174,129 +3477,129 @@ export {
3174
3477
  g as WarehouseOutTableCore,
3175
3478
  h2 as WarehouseOutboundTableCore,
3176
3479
  ak as WidgetImageSizeMode,
3177
- b_ as applyCheckDsDataToRuntime,
3178
- q as applyConsumeObjectTraceChange,
3179
- b$ as applyMedProCheckDsDataToRuntime,
3480
+ b$ as applyCheckDsDataToRuntime,
3481
+ w as applyConsumeObjectTraceChange,
3482
+ c0 as applyMedProCheckDsDataToRuntime,
3180
3483
  baseDataUtils,
3181
- c0 as bindRuntimeTableColumns,
3182
- c1 as buildDeviceBaseQuery,
3183
- bg as buildDeviceFilterQuery,
3184
- al2 as buildFormChangeDisplayRows,
3185
- k as buildObjectLotExtraQuery,
3484
+ c1 as bindRuntimeTableColumns,
3485
+ c2 as buildDeviceBaseQuery,
3486
+ bh as buildDeviceFilterQuery,
3487
+ an2 as buildFormChangeDisplayRows,
3488
+ m as buildObjectLotExtraQuery,
3186
3489
  buildRuntimeFieldPath,
3187
- c2 as calcFillData,
3188
- c3 as calcUtils,
3490
+ c3 as calcFillData,
3491
+ c4 as calcUtils,
3189
3492
  calculateFormula,
3190
3493
  collectAnnotationItemsByLocation,
3191
3494
  collectFormChangeFieldLocations,
3192
3495
  commonUtils,
3193
3496
  convertHistoricalAnnotationLocation,
3194
- am2 as convertV1Runtime,
3497
+ ao2 as convertV1Runtime,
3195
3498
  c as createRuntimeDocumentV2,
3196
3499
  createRuntimeInstanceContext,
3197
- c4 as decodeTableCellRowKey,
3198
- an2 as detailsHaveFormChangeRowOps,
3199
- c5 as encodeTableCellRowKey,
3500
+ c5 as decodeTableCellRowKey,
3501
+ ap as detailsHaveFormChangeRowOps,
3502
+ c6 as encodeTableCellRowKey,
3200
3503
  enrichFormChangeRowDetails,
3201
- c6 as ensureFrontRowKey,
3202
- c7 as ensureTableRowKeys,
3203
- ao2 as extractFormChangeRowDetails,
3204
- c8 as extractKeywordFromQueryData,
3205
- c9 as fetchCheckDsDataForTable,
3206
- ca as fetchCustomCheckDsData,
3504
+ c7 as ensureFrontRowKey,
3505
+ c8 as ensureTableRowKeys,
3506
+ aq2 as extractFormChangeRowDetails,
3507
+ c9 as extractKeywordFromQueryData,
3508
+ ca as fetchCheckDsDataForTable,
3509
+ cb as fetchCustomCheckDsData,
3207
3510
  fetchHistoryConsume,
3208
- cb as fetchMedProCheckDsData,
3511
+ cc as fetchMedProCheckDsData,
3209
3512
  fetchOperationReceiveQty,
3210
3513
  fetchUdi,
3211
3514
  filterAnnotationItemsUpToCurrent,
3212
- bl as findRuntimeParentRow,
3213
- cc as findRuntimeTableCell,
3515
+ bm as findRuntimeParentRow,
3516
+ cd as findRuntimeTableCell,
3214
3517
  findRuntimeTableRow,
3215
3518
  getAppInfo,
3216
3519
  getBusinessFieldKey,
3217
- cd as getCheckTableSnapshotKey,
3218
- ap as getFormChangeRowKey,
3219
- aq2 as getFormChangeRowOp,
3520
+ ce as getCheckTableSnapshotKey,
3521
+ ar as getFormChangeRowKey,
3522
+ as as getFormChangeRowOp,
3220
3523
  aZ as getLotLockedReason,
3221
- j as getObjectBomMaterialLotQuery,
3222
- t2 as getObjectBomProductQuery,
3524
+ l as getObjectBomMaterialLotQuery,
3525
+ x as getObjectBomProductQuery,
3223
3526
  getParseFormulaVarInfos,
3224
- ce as getParseRuleConfig,
3225
- b0 as getParseRuleInfo,
3226
- b1 as getParseRuleValue,
3227
- cf as getReinspectionDate,
3228
- cg as getRenderedRuntimeTableCell,
3527
+ cf as getParseRuleConfig,
3528
+ b1 as getParseRuleInfo,
3529
+ b2 as getParseRuleValue,
3530
+ cg as getReinspectionDate,
3531
+ ch as getRenderedRuntimeTableCell,
3229
3532
  getRuntimeDataFieldId,
3230
3533
  getRuntimeDependencyOutputKey,
3231
- ar as getSubTableQuickFillInfo,
3534
+ at as getSubTableQuickFillInfo,
3232
3535
  getSuiteKey,
3233
- ch as handleOldConfig,
3234
- ci as hasAnyCheckTableSnapshot,
3235
- cj as hasByTableCheckTableSnapshot,
3236
- ck as hasSharedCheckTableSnapshot,
3237
- as as isAnnLocationSelected,
3238
- at as isBlank,
3536
+ ci as handleOldConfig,
3537
+ cj as hasAnyCheckTableSnapshot,
3538
+ ck as hasByTableCheckTableSnapshot,
3539
+ cl as hasSharedCheckTableSnapshot,
3540
+ au as isAnnLocationSelected,
3541
+ av as isBlank,
3239
3542
  isBomGranted,
3240
3543
  isEdhrSuite,
3241
3544
  isEqmSuite,
3242
- au as isFormChangeGhostRow,
3243
- cl as isMedProSuite,
3545
+ aw2 as isFormChangeGhostRow,
3546
+ cm as isMedProSuite,
3244
3547
  isRowAddedInCurrentFormChange,
3245
- cm as isTableRowKeyMatch,
3246
- cn as jsonSchemaUtils,
3247
- co as judgeUnique,
3548
+ cn as isTableRowKeyMatch,
3549
+ co as jsonSchemaUtils,
3550
+ cp as judgeUnique,
3248
3551
  aY as materialCheck,
3249
- cp as migrateDiagonalDirectionToVertex,
3552
+ cq as migrateDiagonalDirectionToVertex,
3250
3553
  nextFormChangeRowViewHistoryId,
3251
- d as normalizeAIOcrTmpl,
3252
- w as normalizeHistoricalAutofillRow,
3253
- a as normalizeHistoricalBusinessRow,
3254
- av as normalizeHistoricalFieldConfig,
3255
- b2 as normalizeRefLoaderResult,
3554
+ f2 as normalizeAIOcrTmpl,
3555
+ y2 as normalizeHistoricalAutofillRow,
3556
+ d as normalizeHistoricalBusinessRow,
3557
+ ax2 as normalizeHistoricalFieldConfig,
3558
+ b3 as normalizeRefLoaderResult,
3256
3559
  normalizeRuntime,
3257
3560
  parseFrontConfig,
3258
3561
  parseRuntimeFieldPath,
3259
3562
  parseUdi,
3260
- aw2 as pickObjectFieldKeys,
3261
- ax2 as recordSubtableRowAdd,
3262
- ay2 as recordSubtableRowDelete,
3263
- be as refUtils,
3264
- cq as relocateDeletedRowsToEnd,
3563
+ ay2 as pickObjectFieldKeys,
3564
+ az2 as recordSubtableRowAdd,
3565
+ aA as recordSubtableRowDelete,
3566
+ bf as refUtils,
3567
+ cr as relocateDeletedRowsToEnd,
3265
3568
  renderUtils,
3266
- cr as requestMedProCheckDsData,
3267
- cs as requestNonMedProCheckDsData,
3268
- az2 as resolveAnnotationFieldLocation,
3569
+ cs as requestMedProCheckDsData,
3570
+ ct as requestNonMedProCheckDsData,
3571
+ aB as resolveAnnotationFieldLocation,
3269
3572
  ao as resolveDiagonalVertex,
3270
3573
  t as resolveFieldRenderComponent,
3271
- aA as resolveFormChangeRowUi,
3272
- m as resolveObjectBomEntry,
3574
+ aC as resolveFormChangeRowUi,
3575
+ p2 as resolveObjectBomEntry,
3273
3576
  r as resolveObjectFieldKeys,
3274
- aB as resolveRowFormChangeMark,
3577
+ aD as resolveRowFormChangeMark,
3275
3578
  resolveUdiQuery,
3276
- o2 as runWithFillProduct,
3277
- h as setSelectAnnotationId,
3278
- aC as setSelectMobileTdId,
3579
+ q as runWithFillProduct,
3580
+ j as setSelectAnnotationId,
3581
+ aE as setSelectMobileTdId,
3279
3582
  s as setSelectValidatorId,
3280
3583
  aS as sqlUtils,
3281
- ct as stockCheck,
3282
- aD as stripLegacyFormConfigFromPaper,
3584
+ cu as stockCheck,
3585
+ aF as stripLegacyFormConfigFromPaper,
3283
3586
  transformUtils,
3284
- z as useDependency,
3587
+ C as useDependency,
3285
3588
  useEbrWikiFactoryV2,
3286
- A2 as useFieldPresentation,
3589
+ F as useFieldPresentation,
3287
3590
  u2 as useFormModel,
3288
3591
  u as useFormTmplConfig,
3289
3592
  useMaterialBalance,
3290
3593
  useNocodeEmitter,
3291
- p2 as useNocodeFormWidget,
3292
- cu as useOnlineFormActionButton,
3293
- bm as useOnlineFormTransformField2Component,
3594
+ t2 as useNocodeFormWidget,
3595
+ cv as useOnlineFormActionButton,
3596
+ bn as useOnlineFormTransformField2Component,
3294
3597
  useRenderPageFactory,
3295
- C as useRuntimeEditorFlusher,
3296
- f2 as useRuntimeInstanceServices,
3297
- i as useRuntimeRowState,
3298
- y2 as useStyles,
3299
- e as useWidgetStaticAttrs,
3598
+ G as useRuntimeEditorFlusher,
3599
+ i as useRuntimeInstanceServices,
3600
+ k as useRuntimeRowState,
3601
+ A2 as useStyles,
3602
+ h as useWidgetStaticAttrs,
3300
3603
  v as validateObjectBomForScan,
3301
3604
  validateObjectBomQtyOnSubmit,
3302
3605
  a_ as validateReinspectionDate