@gct-paas/excel 0.1.39-beta.15 → 0.1.39-beta.17

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 (90) hide show
  1. package/dist/{BaseComponent-l0nid3jb.js → BaseComponent-DlErT5t9.js} +2 -2
  2. package/dist/{VueVideoPlayer-rLEjwJD1.js → VueVideoPlayer-IeaDX9ln.js} +2 -2
  3. package/dist/{align-editor-CThA5sqY.js → align-editor-wPpZ_4zH.js} +1 -1
  4. package/dist/{barcode-design-sl71IZAh.js → barcode-design-BYqSIluT.js} +2 -2
  5. package/dist/base/index.es.js +279 -47
  6. package/dist/{diagonal-design-fvV8Eqv9.js → diagonal-design-VrL3QMMA.js} +2 -2
  7. package/dist/{dynamic-table-action-CB1iBpyr.js → dynamic-table-action-BXNnUUIX.js} +146 -146
  8. package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZTbBLX8.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js} +30 -29
  9. package/dist/{edit.utils-CXmmCnxE-wVxZBX2T.js → edit.utils-CXmmCnxE-CQiGidG5.js} +1 -1
  10. package/dist/{exceljs.min-D5juKAwL.js → exceljs.min-5Z93-UbZ.js} +2 -2
  11. package/dist/{font-editor-Bk29ABZ6.js → font-editor-fCko9QUc.js} +3 -3
  12. package/dist/{image-design-CEQehKo3.js → image-design-DVq9O1ZF.js} +2 -2
  13. package/dist/{index-DUkOUXvm.js → index-9S_12I_m.js} +2 -2
  14. package/dist/{index-BWBOM-o3.js → index-B0_PuKlp.js} +2 -2
  15. package/dist/{index-C8xKDyeD.js → index-B4LBLC9w.js} +1 -1
  16. package/dist/{index-DGG9f-bH.js → index-B71AMKCN.js} +2 -2
  17. package/dist/{index-_ezdUnRi.js → index-B9mMKdWV.js} +2 -2
  18. package/dist/{index-Cr7QXLLQ.js → index-BDQQZex8.js} +2 -2
  19. package/dist/{index-RBXxr4Qh.js → index-BHXvTfAC.js} +2 -2
  20. package/dist/{index-CshDRgUb.js → index-BK1OplGc.js} +2 -2
  21. package/dist/{index-ZauIkvFj.js → index-BLFfeKcf.js} +2 -2
  22. package/dist/{index-CdIEzrgB.js → index-BO6dvJRn.js} +2 -2
  23. package/dist/{index-Da8VYng5.js → index-BQGtju-p.js} +2 -2
  24. package/dist/{index-CR8lFjT1.js → index-BUIxSSiF.js} +2 -2
  25. package/dist/{index-CxLCSrXd.js → index-BaQfzPpW.js} +2 -2
  26. package/dist/{index-V3wyDGwq.js → index-BhRaNTnf.js} +2 -2
  27. package/dist/{index-CswmgeN8.js → index-Bq15nkZU.js} +2 -2
  28. package/dist/{index-C_9ArFTt.js → index-C-urdRZ2.js} +1 -1
  29. package/dist/{index-BI8BFTVe.js → index-CPQNMrdO.js} +1 -1
  30. package/dist/{index-CR7GrAch.js → index-CSinNyyL.js} +2 -2
  31. package/dist/{index-otXN6GGD.js → index-CSlejyqH.js} +1 -1
  32. package/dist/{index-Cpjc72Wh.js → index-CdWE4-P2.js} +3 -3
  33. package/dist/{index-DDm5el4N.js → index-CvPWXCmn.js} +1 -1
  34. package/dist/{index-BxBjo_MG.js → index-CyX1kNkY.js} +1 -1
  35. package/dist/{index-SAxvmqYI.js → index-D0HlL8_z.js} +3 -3
  36. package/dist/{index-DZZnfG6h.js → index-D23sYrAs.js} +3 -3
  37. package/dist/{index-CeQoHTEw.js → index-DLPPv2-H.js} +3 -3
  38. package/dist/{index-JGcv_SyH.js → index-DQhVTdNc.js} +2 -2
  39. package/dist/{index-XpLSF1_s.js → index-DSmijiaG.js} +4 -4
  40. package/dist/{index-D988RFRH.js → index-DaYPI9DA.js} +1 -1
  41. package/dist/{index-DJRMAb-S.js → index-DbpSl_cV.js} +47 -46
  42. package/dist/{index-BloYiyGP.js → index-Dq8DSt0w.js} +1 -1
  43. package/dist/{index-DxyFvOfR.js → index-KLikXsxt.js} +2 -2
  44. package/dist/{index-GnYi1hwL.js → index-N2ZMSuL6.js} +1 -1
  45. package/dist/{index-VH3XbUxT.js → index-UMo1va8T.js} +2 -2
  46. package/dist/{index-DGGJRR4E.js → index-em0rzOJO.js} +2 -2
  47. package/dist/{index-CXQRI3Yu.js → index-haSf7Cn8.js} +1 -1
  48. package/dist/index.es.js +2 -2
  49. package/dist/{mb-render-BqkWBMtI.js → mb-render-DjXYXimz.js} +1 -1
  50. package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-B9dH3NoS.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-CtYTpCF6.js} +1 -1
  51. package/dist/{pagination-design-ztn5CKGM.js → pagination-design-F8N309cx.js} +2 -2
  52. package/dist/paper-widget-design-CsD7nTJg.js +4 -0
  53. package/dist/{print-runtime-instance-q9U9m7kZ.js → print-runtime-instance-DhOKtC-h.js} +1 -1
  54. package/dist/{print-snapshot-renderer-BL9gSLhH.js → print-snapshot-renderer-BZKxblV4.js} +3 -3
  55. package/dist/{qrcode-design-yuG7ZadI.js → qrcode-design-PR7BvK0q.js} +1 -1
  56. package/dist/{revo-grid.entry-D1QKkvpp.js → revo-grid.entry-DORNB4cp.js} +1 -1
  57. package/dist/{revogr-attribution_7.entry-CRCtX47l.js → revogr-attribution_7.entry-CrdX04rF.js} +3 -3
  58. package/dist/{revogr-clipboard_3.entry-elrA4DUz.js → revogr-clipboard_3.entry-CWLVEZnP.js} +2 -2
  59. package/dist/{revogr-data_4.entry-bZYGKHyL.js → revogr-data_4.entry-Bs8mqW3y.js} +2 -2
  60. package/dist/{revogr-filter-panel.entry-B_d9G-hl.js → revogr-filter-panel.entry-CTN0T0tx.js} +1 -1
  61. package/dist/seal-design-D_dpyFes.js +4 -0
  62. package/dist/{serialnumber-design-MJSy7jsx.js → serialnumber-design-BSgTQN0r.js} +1 -1
  63. package/dist/shared/index.es.js +2 -2
  64. package/dist/{single-field-drop-BpOEtHNr.js → single-field-drop-DUSU1bKr.js} +2 -2
  65. package/dist/{size-editor-6IH71VxK.js → size-editor-DQJIuZCE.js} +1 -1
  66. package/dist/src/nocode-base/src/hooks/material-consume-object/initialize-autofill.d.ts +17 -0
  67. package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
  68. package/dist/src/nocode-base/src/interface/render.d.ts +3 -1
  69. package/dist/src/nocode-base/src/interface/transform.d.ts +1 -1
  70. package/dist/{sub-table-factory-g6wNeE0J.js → sub-table-factory-CGAWlYDu.js} +2 -2
  71. package/dist/{text-design-DpeHIj-K.js → text-design-Dqq470X5.js} +2 -2
  72. package/dist/{throttle-Cpk1LoGk-mAa23iVE.js → throttle-Cpk1LoGk-w1fTQ4cj.js} +1 -1
  73. package/dist/{timediff-design-svW4L_Q7.js → timediff-design-BIyHZKid.js} +1 -1
  74. package/dist/{trace-like-wrapper-CyNhKXCr.js → trace-like-wrapper-CLMuoU3p.js} +2 -2
  75. package/dist/{value-editor.vue_vue_type_style_index_0_lang-BtYBXBJ9.js → value-editor.vue_vue_type_style_index_0_lang-jT58gI_m.js} +2 -2
  76. package/dist/web-render/index.es.js +3 -3
  77. package/dist/{widget-barcode-BzWlJVh7.js → widget-barcode-CMjsnSQF.js} +4 -4
  78. package/dist/{widget-diagonal-ZuqfaeSd.js → widget-diagonal-DLo1ff_l.js} +3 -3
  79. package/dist/{widget-image-DnWSsHBe.js → widget-image-Nc9WZSx-.js} +5 -5
  80. package/dist/{widget-line-BZxumyVs.js → widget-line-BaHY6N6j.js} +2 -2
  81. package/dist/{widget-pagination-c8I62Pn2.js → widget-pagination-CM_isO4h.js} +5 -5
  82. package/dist/{widget-power-BUxzDToN.js → widget-power-C-wYKvN7.js} +3 -3
  83. package/dist/{widget-qrcode-BNK4xrRv.js → widget-qrcode-5wCmIfDR.js} +3 -3
  84. package/dist/{widget-rangelimit-B6rJ9V0I.js → widget-rangelimit-DOPnGakj.js} +3 -3
  85. package/dist/{widget-serialnumber-YjUhKx9-.js → widget-serialnumber-XYXXp8wM.js} +1 -1
  86. package/dist/{widget-text-Bpz7TEX4.js → widget-text-DozYzNsG.js} +5 -5
  87. package/dist/{widget-timediff-DFCvDygV.js → widget-timediff-DQvxlpW_.js} +2 -2
  88. package/package.json +2 -2
  89. package/dist/paper-widget-design-oWHXl2z7.js +0 -4
  90. package/dist/seal-design-D6lnj8jJ.js +0 -4
@@ -1,6 +1,6 @@
1
- import { n as normalizeFieldWidth } from "./dynamic-table-action-CB1iBpyr.js";
1
+ import { n as normalizeFieldWidth } from "./dynamic-table-action-BXNnUUIX.js";
2
2
  import { get, pick } from "lodash-es";
3
- import { F as FIELD_TYPE } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZTbBLX8.js";
3
+ import { F as FIELD_TYPE } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js";
4
4
  import { f as fontStyleAttrs } from "./config.enum-B8UZQTON.js";
5
5
  const DESIGNER_DEFAULT_TYPES = /* @__PURE__ */ new Set([
6
6
  FIELD_TYPE.DEVICE,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, toRaw, shallowRef, computed, ref, readonly, onMounted, watch, normalizeClass, onBeforeUnmount, h as h$1, watchEffect, unref, createVNode, reactive } from "vue";
2
- import { M as commonjsGlobal, N as getDefaultExportFromCjs } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZTbBLX8.js";
3
- import { r as require$$0 } from "./index-RBXxr4Qh.js";
2
+ import { M as commonjsGlobal, N as getDefaultExportFromCjs } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js";
3
+ import { r as require$$0 } from "./index-BHXvTfAC.js";
4
4
  var window_1;
5
5
  var hasRequiredWindow;
6
6
  function requireWindow() {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, renderList, normalizeClass, createVNode, withCtx, createElementVNode, createTextVNode, toDisplayString } from "vue";
2
- import { a8 as _export_sfc } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZTbBLX8.js";
2
+ import { a8 as _export_sfc } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js";
3
3
  const _hoisted_1 = { class: "align-group-box" };
4
4
  const _hoisted_2 = ["onClick"];
5
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeStyle, normalizeClass, createElementVNode, toDisplayString, createCommentVNode } from "vue";
2
2
  import { pick } from "lodash-es";
3
- import { u as useSpreadSheet, h as useModelFields, l as loadBwip } from "./index-DJRMAb-S.js";
4
- import { Q as PaperWidgeValueType, a8 as _export_sfc } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZTbBLX8.js";
3
+ import { u as useSpreadSheet, h as useModelFields, l as loadBwip } from "./index-DbpSl_cV.js";
4
+ import { Q as PaperWidgeValueType, a8 as _export_sfc } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js";
5
5
  import "dayjs";
6
6
  import "ant-design-vue";
7
7
  const _hoisted_1 = { class: "wrapper" };
@@ -1,13 +1,13 @@
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-DZTbBLX8.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-DZTbBLX8.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-CB1iBpyr.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-CB1iBpyr.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-BmECtuSE.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-BmECtuSE.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-BXNnUUIX.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-BXNnUUIX.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-g6wNeE0J.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-g6wNeE0J.js";
10
- import { B as B3, F as F2, M as M3, a as a11, u as u2 } from "../mb-render-BqkWBMtI.js";
8
+ import { S as SubTableCoreFactory, R as RuntimeInstanceController } from "../sub-table-factory-CGAWlYDu.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-CGAWlYDu.js";
10
+ import { B as B3, F as F2, M as M3, a as a11, u as u2 } from "../mb-render-DjXYXimz.js";
11
11
  const InstanceStatusValues = {
12
12
  /** 作废状态 */
13
13
  ABANDON: "ABANDON",
@@ -1003,6 +1003,71 @@ class FormTmplBomController {
1003
1003
  };
1004
1004
  }
1005
1005
  }
1006
+ async function prepareObjectProductDefaults({
1007
+ enabled,
1008
+ fields,
1009
+ objectInitialValues = []
1010
+ }) {
1011
+ const defaults2 = /* @__PURE__ */ new WeakMap();
1012
+ if (!enabled) return defaults2;
1013
+ const requests = /* @__PURE__ */ new Map();
1014
+ const tasks = [];
1015
+ function fetchProduct(productId) {
1016
+ const existing = requests.get(productId);
1017
+ if (existing) return existing;
1018
+ const request = (async () => {
1019
+ const result = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
1020
+ {
1021
+ modelCategory: "entity",
1022
+ modelKey: "em_product",
1023
+ bsKey: "rdoGetVersionById"
1024
+ },
1025
+ // 沿用现有接口约定,传完整默认值,不拆分版本 ID。
1026
+ { id: productId }
1027
+ );
1028
+ const product = result?.data;
1029
+ if (!product || typeof product !== "object" || Array.isArray(product) || Object.keys(product).length === 0) {
1030
+ throw new Error(`未找到默认物料详情:${productId}`);
1031
+ }
1032
+ return { ...product, _DICT: result?.dict ?? product._DICT };
1033
+ })();
1034
+ requests.set(productId, request);
1035
+ return request;
1036
+ }
1037
+ for (const entry of fields) {
1038
+ if (!entry || typeof entry !== "object") continue;
1039
+ const field = entry;
1040
+ if (typeof field.fieldId !== "string" || !field.belongingObject || field.fieldType !== FIELD_TYPE.PRODUCT || field.isFieldModel || field.subFieldKey || field.subModelKey) {
1041
+ continue;
1042
+ }
1043
+ const configured = objectInitialValues.find(
1044
+ (item) => item.objectField === field.belongingObject
1045
+ );
1046
+ if (!configured?.values || !Object.prototype.hasOwnProperty.call(configured.values, field.fieldId)) {
1047
+ continue;
1048
+ }
1049
+ const productDefault = {
1050
+ value: configured.values[field.fieldId]
1051
+ };
1052
+ defaults2.set(entry, productDefault);
1053
+ const productId = productDefault.value;
1054
+ const needsAutofill = field.enableAutofill !== false && field.autofillRules?.some((rule) => !!rule.toField);
1055
+ if (!needsAutofill || typeof productId !== "string" || productId === "") continue;
1056
+ tasks.push(
1057
+ fetchProduct(productId).then(
1058
+ (sourceData) => {
1059
+ productDefault.sourceData = sourceData;
1060
+ },
1061
+ (error) => {
1062
+ const reason = error instanceof Error ? error.message : String(error);
1063
+ throw new Error(`对象初始化数据填充失败,字段 ${field.fieldId}:${reason}`);
1064
+ }
1065
+ )
1066
+ );
1067
+ }
1068
+ await Promise.all(tasks);
1069
+ return defaults2;
1070
+ }
1006
1071
  async function getModelQueries(opts) {
1007
1072
  const isEdhr = await isEdhrSuite();
1008
1073
  if (!isEdhr || !opts.mainMaterialNo) {
@@ -1368,7 +1433,13 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
1368
1433
  params: { id: paramsConfig?.warehouseId }
1369
1434
  }
1370
1435
  ]);
1436
+ const objectProductDefaults = await prepareObjectProductDefaults({
1437
+ enabled: fillModeType === RenderModeEnum.FormMode && selfInfo.dataStatus !== "STASH" && selfInfo.dataStatus !== "SUBMIT",
1438
+ fields: fieldInfoMap.useDefaultValueFields,
1439
+ objectInitialValues: runtimeContext.formConfig.objectInitialValues
1440
+ });
1371
1441
  const defaultDataMap = renderUtils.getDefaultValueMapByField({
1442
+ objectProductDefaults,
1372
1443
  defaultValueFields: fieldInfoMap.useDefaultValueFields,
1373
1444
  mainMaterialNo: paramsConfig?.materialNo || selfInfo.materialNo,
1374
1445
  mainRelatedLotNo: paramsConfig?.relatedLotNo,
@@ -1893,7 +1964,13 @@ function createRuntimePersistenceAccess(runtimeRegistry, props, payload) {
1893
1964
  const signatureKeys = (runtimeRecord.context.businessIndex.useSignatureFields || []).map(
1894
1965
  (item) => item.fieldId
1895
1966
  );
1896
- const idsFormState = transformUtils.getFormDataIdsMap(newFormState, signatureKeys);
1967
+ const idsFormState = transformUtils.getFormDataIdsMap(
1968
+ newFormState,
1969
+ signatureKeys,
1970
+ (path) => runtimeRecord.fields.findByPath(path).some(
1971
+ ({ widget, subFieldKey }) => subFieldKey !== path && [FIELD_TYPE.DATE, FIELD_TYPE.DATE_TIME].includes(widget?.props.fieldType)
1972
+ )
1973
+ );
1897
1974
  if (saveToken ? !runtimeRecord.persistence.completeSave(saveToken) : requestedRevision !== runtimeRecord.formState.revision) {
1898
1975
  return false;
1899
1976
  }
@@ -1970,6 +2047,139 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1970
2047
  }
1971
2048
  });
1972
2049
  const InspectionDecisionPromptModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9c14035f"]]);
2050
+ function createMaterialConsumeObjectValidation(options) {
2051
+ const { record, getInfo, isCurrent, shouldSkip, applyComments } = options;
2052
+ let enabled = false;
2053
+ let disposed = false;
2054
+ let submitting = 0;
2055
+ let generation = 0;
2056
+ let lastRevision = -1;
2057
+ let timer;
2058
+ let paths = /* @__PURE__ */ new Set();
2059
+ const unlocated = /* @__PURE__ */ new Set();
2060
+ const alive = () => !disposed && isCurrent();
2061
+ function cancelLive() {
2062
+ generation++;
2063
+ if (timer !== void 0) clearTimeout(timer);
2064
+ timer = void 0;
2065
+ }
2066
+ function calcObjectError(error) {
2067
+ const info = getInfo();
2068
+ const modelKey = info?.modelKey || record.context.businessIndex.modelDisplay.key;
2069
+ const descriptor = record.fields.findField({ modelKey, fieldId: error.field });
2070
+ const props = descriptor?.widget?.props;
2071
+ if (!props?.field || descriptor?.subFieldKey || props.subFieldKey) {
2072
+ const key = modelKey + "." + error.field;
2073
+ if (!unlocated.has(key)) {
2074
+ unlocated.add(key);
2075
+ console.warn("物料消耗对象错误未定位到主表控件,保留在校验清单:", key);
2076
+ }
2077
+ return { error, path: void 0 };
2078
+ }
2079
+ const path = buildRuntimeFieldPath({
2080
+ ...props,
2081
+ modelKey: props.modelKey ?? info?.modelKey,
2082
+ fieldId: props.field
2083
+ });
2084
+ return { error: { ...error, field: path }, path };
2085
+ }
2086
+ function replaceObjectFields(fields) {
2087
+ if (!alive()) return;
2088
+ const next = { ...getInfo()?.mcValidatorMessageMap ?? {} };
2089
+ paths.forEach((path) => delete next[path]);
2090
+ Object.assign(next, fields);
2091
+ paths = new Set(Object.keys(fields));
2092
+ applyComments(next);
2093
+ }
2094
+ function replaceTableFields(fields) {
2095
+ if (!alive()) return;
2096
+ const current = getInfo()?.mcValidatorMessageMap ?? {};
2097
+ const next = { ...fields ?? {} };
2098
+ paths.forEach((path) => {
2099
+ if (current[path]) {
2100
+ next[path] = [...next[path] ?? [], ...current[path]];
2101
+ }
2102
+ });
2103
+ applyComments(next);
2104
+ }
2105
+ function clear() {
2106
+ cancelLive();
2107
+ enabled = false;
2108
+ lastRevision = -1;
2109
+ replaceObjectFields({});
2110
+ }
2111
+ async function validate(live = false) {
2112
+ cancelLive();
2113
+ if (!alive()) return;
2114
+ if (shouldSkip()) {
2115
+ clear();
2116
+ return { isValid: true };
2117
+ }
2118
+ const ticket = generation;
2119
+ const revision = record.formState.revision;
2120
+ const info = getInfo();
2121
+ const display = record.context.businessIndex.modelDisplay;
2122
+ const errors = await validateObjectBomQtyOnSubmit({
2123
+ formState: record.formState.state,
2124
+ objectFieldList: record.context.formConfig.objectFieldList,
2125
+ formInstBom: record.context.services.tmplBomController?.formInstBom,
2126
+ showModelName: display.name,
2127
+ showModelKey: display.key || info?.modelKey || ""
2128
+ });
2129
+ if (!alive() || generation !== ticket || record.formState.revision !== revision || live && getInfo()?.renderModeType !== RenderModeEnum.FormMode)
2130
+ return;
2131
+ const fields = {};
2132
+ const comments = {};
2133
+ for (const source of errors) {
2134
+ const adapted = calcObjectError(source);
2135
+ (fields[adapted.error.field] ??= []).push(adapted.error);
2136
+ if (adapted.path) (comments[adapted.path] ??= []).push(adapted.error);
2137
+ }
2138
+ enabled = !!record.context.formConfig.objectFieldList?.length;
2139
+ lastRevision = revision;
2140
+ replaceObjectFields(comments);
2141
+ return { isValid: !errors.length, fields: Object.keys(fields).length ? fields : void 0 };
2142
+ }
2143
+ function requestLive() {
2144
+ cancelLive();
2145
+ if (!alive() || !enabled || submitting > 0 || getInfo()?.renderModeType !== RenderModeEnum.FormMode)
2146
+ return;
2147
+ const ticket = generation;
2148
+ timer = setTimeout(() => {
2149
+ timer = void 0;
2150
+ void (async () => {
2151
+ await record.controller?.waitUntilPrepared();
2152
+ await record.asyncTasks.waitForRequired();
2153
+ if (!alive() || generation !== ticket || submitting > 0 || getInfo()?.renderModeType !== RenderModeEnum.FormMode)
2154
+ return;
2155
+ await validate(true);
2156
+ })().catch((error) => {
2157
+ if (alive()) console.error("物料消耗对象实时校验失败", error);
2158
+ });
2159
+ }, 300);
2160
+ }
2161
+ return {
2162
+ validate,
2163
+ requestLive,
2164
+ replaceTableFields,
2165
+ clear,
2166
+ beginSubmit() {
2167
+ submitting++;
2168
+ cancelLive();
2169
+ },
2170
+ endSubmit() {
2171
+ submitting--;
2172
+ if (alive() && submitting === 0 && enabled && lastRevision !== record.formState.revision)
2173
+ requestLive();
2174
+ },
2175
+ dispose() {
2176
+ disposed = true;
2177
+ cancelLive();
2178
+ paths.clear();
2179
+ unlocated.clear();
2180
+ }
2181
+ };
2182
+ }
1973
2183
  function applyValidationComments(info, comments, kind) {
1974
2184
  if (!info) return;
1975
2185
  const locationKey = kind === "field" ? "validatorLocationList" : "mcValidatorLocationList";
@@ -1987,6 +2197,29 @@ function applyValidationComments(info, comments, kind) {
1987
2197
  info[messageKey] = map;
1988
2198
  }
1989
2199
  function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType) {
2200
+ const objectValidations = /* @__PURE__ */ new WeakMap();
2201
+ function getObjectValidation(record) {
2202
+ const existing = objectValidations.get(record);
2203
+ if (existing) return existing;
2204
+ const uniqueId = record.context.uniqueId;
2205
+ const validation = createMaterialConsumeObjectValidation({
2206
+ record,
2207
+ getInfo: () => getInfo(uniqueId),
2208
+ isCurrent: () => runtimeRegistry.get(uniqueId) === record,
2209
+ shouldSkip: () => {
2210
+ const skip = syncInspectionDecisionRule(uniqueId);
2211
+ if (skip) clearInspectionValidationState(uniqueId);
2212
+ return skip;
2213
+ },
2214
+ applyComments: (fields) => applyValidationComments(getInfo(uniqueId), fields, "material")
2215
+ });
2216
+ objectValidations.set(record, validation);
2217
+ runtimeRegistry.registerDisposable(uniqueId, () => {
2218
+ validation.dispose();
2219
+ objectValidations.delete(record);
2220
+ });
2221
+ return validation;
2222
+ }
1990
2223
  const inspectionDecisionMatched = /* @__PURE__ */ new WeakMap();
1991
2224
  const inspectionDecisionPrompting = /* @__PURE__ */ new WeakSet();
1992
2225
  function openInspectionDecisionPrompt(uniqueId, content) {
@@ -2027,11 +2260,14 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
2027
2260
  return matched;
2028
2261
  }
2029
2262
  function clearInspectionValidationState(uniqueId) {
2263
+ const record = runtimeRegistry.get(uniqueId);
2264
+ if (record) objectValidations.get(record)?.clear();
2030
2265
  applyValidationComments(getInfo(uniqueId), null, "field");
2031
2266
  applyValidationComments(getInfo(uniqueId), null, "material");
2032
2267
  }
2033
2268
  function bindFormValidationSync(uniqueId) {
2034
2269
  const record = runtimeRegistry.require(uniqueId);
2270
+ const objects = getObjectValidation(record);
2035
2271
  syncInspectionDecisionRule(uniqueId);
2036
2272
  const stop = record.formState.subscribe(() => {
2037
2273
  if (runtimeRegistry.get(uniqueId) !== record) return;
@@ -2042,6 +2278,7 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
2042
2278
  uniqueId,
2043
2279
  !suppressed && info.renderModeType === RenderModeEnum.FormMode
2044
2280
  );
2281
+ objects.requestLive();
2045
2282
  if (suppressed) return;
2046
2283
  if (info.renderModeType === RenderModeEnum.FormMode) {
2047
2284
  record.validation.requestLive("change");
@@ -2074,48 +2311,43 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
2074
2311
  }
2075
2312
  async function runSubmissionValidation(uniqueId) {
2076
2313
  const record = runtimeRegistry.require(uniqueId);
2077
- const formState = record.formState.state;
2078
- const bomC = record.context.services.tmplBomController;
2079
- if (syncInspectionDecisionRule(uniqueId)) {
2080
- clearInspectionValidationState(uniqueId);
2081
- return { isValid: true };
2082
- }
2083
- const res = await record.validation.validate();
2084
- if (!res || runtimeRegistry.get(uniqueId) !== record) return;
2085
- const revision = record.formState.revision;
2086
- if (bomC) {
2087
- const bomRes = await bomC.submitValidate();
2088
- if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2089
- return;
2090
- applyValidationComments(getInfo(uniqueId), bomRes.fields ?? null, "material");
2091
- if (!bomRes.isValid) {
2092
- merge(res, bomRes);
2093
- return res;
2314
+ const objects = getObjectValidation(record);
2315
+ objects.beginSubmit();
2316
+ try {
2317
+ if (syncInspectionDecisionRule(uniqueId)) {
2318
+ clearInspectionValidationState(uniqueId);
2319
+ return { isValid: true };
2094
2320
  }
2095
- const info = getInfo(uniqueId);
2096
- const display = record.context.businessIndex.modelDisplay;
2097
- display.name;
2098
- const showModelKey = display.key || info?.modelKey || "";
2099
- const objErrs = await validateObjectBomQtyOnSubmit({
2100
- formState: formState ?? {},
2101
- objectFieldList: record.context.formConfig.objectFieldList,
2102
- formInstBom: bomC.formInstBom,
2103
- showModelKey
2104
- });
2105
- if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2106
- return;
2107
- if (objErrs.length) {
2108
- const fields = {};
2109
- objErrs.forEach((e3) => {
2110
- (fields[e3.field] ??= []).push(e3);
2111
- });
2112
- const objectBomRes = { isValid: false, fields };
2113
- merge(res, objectBomRes);
2114
- applyValidationComments(info, { ...info?.validatorMessageMap ?? {}, ...fields }, "field");
2115
- return res;
2321
+ const res = await record.validation.validate();
2322
+ if (!res || runtimeRegistry.get(uniqueId) !== record) return;
2323
+ const revision = record.formState.revision;
2324
+ const bomC = record.context.services.tmplBomController;
2325
+ if (bomC) {
2326
+ const bomRes = await bomC.submitValidate();
2327
+ if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2328
+ return;
2329
+ objects.replaceTableFields(bomRes.fields);
2330
+ if (!bomRes.isValid) {
2331
+ merge(res, bomRes);
2332
+ return res;
2333
+ }
2334
+ const objectRes = await objects.validate();
2335
+ if (!objectRes || runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
2336
+ return;
2337
+ if (!objectRes.isValid) {
2338
+ const fields = { ...res.fields ?? {} };
2339
+ for (const [path, errors] of Object.entries(objectRes.fields ?? {})) {
2340
+ fields[path] = [...fields[path] ?? [], ...errors];
2341
+ }
2342
+ return { ...res, isValid: false, fields };
2343
+ }
2344
+ } else {
2345
+ objects.clear();
2116
2346
  }
2347
+ return res;
2348
+ } finally {
2349
+ objects.endSubmit();
2117
2350
  }
2118
- return res;
2119
2351
  }
2120
2352
  function updateRenderModeType(uniqueId, mode, updateButton = false) {
2121
2353
  const record = runtimeRegistry.require(uniqueId);
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createBlock } from "vue";
2
- import { h as useModelFields, D as Diagonal } from "./index-DJRMAb-S.js";
3
- import { ao as resolveDiagonalVertex, a8 as _export_sfc } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DZTbBLX8.js";
2
+ import { h as useModelFields, D as Diagonal } from "./index-DbpSl_cV.js";
3
+ import { ao as resolveDiagonalVertex, a8 as _export_sfc } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BmECtuSE.js";
4
4
  import "lodash-es";
5
5
  import "dayjs";
6
6
  import "ant-design-vue";