@gct-paas/excel 0.1.40-beta.1 → 0.1.40-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseComponent-DXIDs5gk.js → BaseComponent-DKaXUiq4.js} +2 -2
- package/dist/{VueVideoPlayer-DhyIm-g1.js → VueVideoPlayer-BeylL5J6.js} +2 -2
- package/dist/{align-editor-BcbgVXRp.js → align-editor-r0dHXFka.js} +1 -1
- package/dist/{barcode-design-BiCt0aS7.js → barcode-design-BCJkI4mq.js} +2 -2
- package/dist/base/index.es.js +665 -264
- package/dist/{diagonal-design-DmvWALIE.js → diagonal-design-CAILyrwR.js} +2 -2
- package/dist/{dynamic-table-action-fDIIzS2J.js → dynamic-table-action-CHY5xNLE.js} +449 -289
- package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-DhWpxyhm.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-8yB6zly8.js} +1037 -692
- package/dist/{edit.utils-CXmmCnxE-DxArFSxZ.js → edit.utils-CXmmCnxE-Cu6obgSA.js} +1 -1
- package/dist/excel.css +3304 -4069
- package/dist/{exceljs.min-CjKNZPlo.js → exceljs.min-CuCLHH9n.js} +2 -2
- package/dist/{font-editor-DseGyVgB.js → font-editor-DsrS0BQJ.js} +3 -3
- package/dist/{image-design-Dr-L9AdG.js → image-design-FDLY6DFg.js} +2 -2
- package/dist/{index-C6dFliaf.js → index-7u6Pmaax.js} +1 -1
- package/dist/{index-DrmR7WIs.js → index-AGp5c3cl.js} +2 -2
- package/dist/{index-D5IrgJyh.js → index-B-hfUWEs.js} +2 -2
- package/dist/{index-DcjOJuDw.js → index-B8pwnxas.js} +2 -2
- package/dist/{index-DKf57IGi.js → index-BCsDTwbK.js} +1 -1
- package/dist/{index-DNC5VG8P.js → index-BIeu5JwZ.js} +2 -2
- package/dist/{index-C70T1sVm.js → index-BPc_QQH5.js} +20226 -22256
- package/dist/{index-C4tVTc9U.js → index-BTfYHAPC.js} +2 -2
- package/dist/{index-BdJ4ouEl.js → index-BdFPuj12.js} +1 -1
- package/dist/{index-B34ZIwqL.js → index-BsVPhbAx.js} +6 -3
- package/dist/{index-4acBM2Lp.js → index-C3SyXJii.js} +2 -2
- package/dist/{index-BctQMMgh.js → index-C6jVSwAq.js} +2 -2
- package/dist/{index-Nytm1-X9.js → index-CFVecFFb.js} +53 -5
- package/dist/{index-CewKz2Ro.js → index-CRIhEnfm.js} +1 -1
- package/dist/{index-BjI7JCne.js → index-CRW2rDyo.js} +6 -5
- package/dist/{index-DqLVW6ej.js → index-CTJlsdnr.js} +3 -3
- package/dist/{index-CScWLXnC.js → index-CbmHekMw.js} +2 -2
- package/dist/{index-B29_mID7.js → index-CwK_A9FR.js} +3 -3
- package/dist/{index-C8OPhJhI.js → index-DEHsGK91.js} +1 -1
- package/dist/{index-DKRpaNo1.js → index-DGODLCja.js} +1 -1
- package/dist/{index-DsCTXMxB.js → index-DJiuJgNx.js} +1 -1
- package/dist/{index-CEmRRPE7.js → index-DOd1pUIe.js} +2 -2
- package/dist/{index-CXh-4yX8.js → index-DPGs3mX0.js} +3 -3
- package/dist/{index-CAdGL3Vp.js → index-DXNSTk5n.js} +2 -2
- package/dist/{index-r4MF8_-h.js → index-De6oWEZJ.js} +2 -2
- package/dist/{index-BxZ3M7eP.js → index-DgLLlaiF.js} +1 -1
- package/dist/{index-CX_eR36M.js → index-DkYlfWLa.js} +2 -2
- package/dist/{index-JkPJqZ_5.js → index-Dl_ZgCRB.js} +2 -2
- package/dist/{index-CJ9CrORT.js → index-DoVHKpph.js} +6 -5
- package/dist/{index-BPgCZjqV.js → index-Go0PUrqy.js} +1 -1
- package/dist/{index-hcCJUBne.js → index-KxrgWfEL.js} +1 -1
- package/dist/{index-lwjRRvDn.js → index-dXOMuxrp.js} +2 -2
- package/dist/{index-iRameN0x.js → index-etlM6HzI.js} +2 -2
- package/dist/{index-BY7RGawr.js → index-gGYvWSjX.js} +2 -2
- package/dist/{index-0W-MEvEf.js → index-rZVFumSM.js} +2 -2
- package/dist/index.es.js +12 -10
- package/dist/{mb-render-BdRsSczc.js → mb-render-_IUbyYCY.js} +9 -3
- package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-D32c_U8J.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-CnQiVFDN.js} +8 -1
- package/dist/{pagination-design-9Z_iRIKM.js → pagination-design-DsOKY9kM.js} +2 -2
- package/dist/paper-widget-design-BTxXtF4f.js +4 -0
- package/dist/{print-runtime-instance-BBOww4jg.js → print-runtime-instance-lfLuU2No.js} +1 -1
- package/dist/{print-snapshot-renderer-DGt44saz.js → print-snapshot-renderer-Di-YZz7g.js} +3 -3
- package/dist/{qrcode-design-qbUjPX-B.js → qrcode-design-BGptsxHU.js} +1 -1
- package/dist/{revo-grid.entry-RzymRzb0.js → revo-grid.entry-BZADj2ve.js} +1 -1
- package/dist/{revogr-attribution_7.entry-CxTEXm8Q.js → revogr-attribution_7.entry-DbQASE7d.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-DQEid83u.js → revogr-clipboard_3.entry-BUDhUelS.js} +2 -2
- package/dist/{revogr-data_4.entry-ASovYZWH.js → revogr-data_4.entry-0V57Lz9p.js} +2 -2
- package/dist/{revogr-filter-panel.entry-j_V74kgz.js → revogr-filter-panel.entry-BJEYteeW.js} +1 -1
- package/dist/seal-design-BS24iQos.js +4 -0
- package/dist/{serialnumber-design-DXKTYOY7.js → serialnumber-design-BbjW4gnZ.js} +1 -1
- package/dist/shared/index.es.js +26 -24
- package/dist/{single-field-drop-CLjaHjL-.js → single-field-drop-DP6_SO_H.js} +2 -2
- package/dist/{size-editor-C62H_eRP.js → size-editor-CcYZKUn5.js} +1 -1
- package/dist/src/domain/document-business/business/product-release/profile.d.ts +2 -0
- package/dist/src/domain/document-business/business/product-release/service.d.ts +2 -0
- package/dist/src/domain/document-business/index.d.ts +2 -0
- package/dist/src/domain/document-business/registry.d.ts +2 -0
- package/dist/src/domain/document-business/runtime/field-query-runtime.d.ts +4 -0
- package/dist/src/domain/document-business/types.d.ts +24 -0
- package/dist/src/domain/field/number/product-release-qty-manifest.d.ts +2 -0
- package/dist/src/domain/field/query-filter.d.ts +15 -0
- package/dist/src/domain/table/business/material/material-balance/profile/fields.d.ts +2 -0
- package/dist/src/domain/table/business/material/material-consume/profile/fields.d.ts +2 -0
- package/dist/src/domain/table/business/material/material-substitution/profile/field-keys.d.ts +25 -10
- package/dist/src/domain/table/business/material/material-substitution/runtime/select-loaders.d.ts +8 -0
- package/dist/src/domain/table/business/preprocess/pretreatment-list/profile/field-keys.d.ts +1 -7
- package/dist/src/domain/table/business/sterilize/entrust-steril-batch-list/profile/fields.d.ts +2 -0
- package/dist/src/domain/table/business/warehouse/shared/autofill-source-labels.d.ts +19 -0
- package/dist/src/domain/table/design/autofill-expander.d.ts +2 -0
- package/dist/src/domain/table/design/hooks/on-field-attach.d.ts +6 -0
- package/dist/src/domain/table/index.d.ts +1 -1
- package/dist/src/domain/table/types.d.ts +2 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/nocode-base/src/core/sub-table/allocate-table-core.d.ts +2 -1
- package/dist/src/nocode-base/src/core/sub-table/pretreatment-list-table-core.d.ts +1 -0
- package/dist/src/nocode-base/src/core/sub-table/profile-driven-sub-table-core.d.ts +3 -3
- package/dist/src/nocode-base/src/core/sub-table/sub-table-core.d.ts +2 -1
- package/dist/src/nocode-base/src/hooks/form-model/form-model-controller.d.ts +2 -0
- package/dist/src/nocode-base/src/hooks/formula-params-cache.d.ts +15 -0
- package/dist/src/nocode-base/src/hooks/inspection-module-qty.d.ts +4 -0
- package/dist/src/nocode-base/src/hooks/material-consume/material-consume-table-controller.d.ts +1 -0
- package/dist/src/nocode-base/src/hooks/material-consume/tmpl-bom-controller.d.ts +12 -7
- package/dist/src/nocode-base/src/hooks/material-consume-object/bom-validator.d.ts +4 -3
- package/dist/src/nocode-base/src/hooks/material-consume-object/initialize-autofill.d.ts +17 -0
- package/dist/src/nocode-base/src/hooks/material-consume-object/object-validation-controller.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/render-page/initialize-runtime.d.ts +3 -7
- package/dist/src/nocode-base/src/hooks/render-page/sterilization-date.d.ts +3 -0
- package/dist/src/nocode-base/src/hooks/render-page/types.d.ts +4 -1
- package/dist/src/nocode-base/src/hooks/useCalcFunction.d.ts +8 -2
- package/dist/src/nocode-base/src/hooks/useRenderPageFactory.d.ts +7 -6
- package/dist/src/nocode-base/src/hooks/validation/createValidateFactory.d.ts +1 -0
- package/dist/src/nocode-base/src/interface/ref-loader.d.ts +12 -1
- package/dist/src/nocode-base/src/interface/render.d.ts +3 -1
- package/dist/src/nocode-base/src/interface/transform.d.ts +9 -1
- package/dist/src/nocode-base/src/runtime/async-task-coordinator.d.ts +6 -2
- package/dist/src/nocode-base/src/runtime/multi-sheet-runtime.d.ts +2 -0
- package/dist/src/nocode-base/src/runtime/runtime-field-initializer.d.ts +2 -1
- package/dist/src/nocode-base/src/runtime/runtime-validation-service.d.ts +1 -0
- package/dist/src/nocode-base/src/types/common/base.d.ts +2 -0
- package/dist/src/nocode-base/src/types/render/mc-render.d.ts +1 -1
- package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +5 -1
- package/dist/src/nocode-web-render/src/render/sub-table/common/inventory-scan-columns.d.ts +6 -0
- package/dist/src/nocode-web-render/src/render/sub-table/material-consume/mc-web-render.d.ts +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-design.vue.d.ts +1 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/display-fields-editor/display-fields.util.d.ts +2 -2
- package/dist/src/online-form/src/views/__cell_widgets__/fake-field/fake-option-select.vue.d.ts +1 -0
- package/dist/src/online-form/src/views/designer/constants/index.d.ts +1 -0
- package/dist/src/online-form/src/views/designer/conversions/normalize-paper-grid.d.ts +3 -0
- package/dist/src/online-form/src/views/designer/utils/placed-fields.d.ts +9 -0
- package/dist/src/online-form/src/views/designer/utils/template-placed-fields.d.ts +7 -0
- package/dist/src/online-form/src/views/render/__components__/_field_/seal/component/seal-floating-field.vue.d.ts +0 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/seal/component/seal-runtime-layer.vue.d.ts +0 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/seal/component/use-seal-stamp.d.ts +1 -4
- package/dist/src/online-form/src/views/render/__components__/_field_/trace/utils/use-rule-props.d.ts +0 -3
- package/dist/src/online-form/src/views/render/sheet-tab-bar.vue.d.ts +5 -3
- package/dist/src/shared/components/Signature/logic/index.d.ts +14 -0
- package/dist/src/shared/enum/field-type.d.ts +9 -2
- package/dist/src/shared/enum/index.d.ts +2 -0
- package/dist/src/shared/enum/product-type.d.ts +9 -0
- package/dist/src/shared/enum/production-identification.d.ts +19 -0
- package/dist/src/shared/utils/withRequestCache.d.ts +27 -0
- package/dist/{sub-table-factory-sn1Ek1c9.js → sub-table-factory-B0YWwWSA.js} +229 -150
- package/dist/{text-design-CwHfwel0.js → text-design-CquXT5UG.js} +2 -2
- package/dist/{throttle-Cpk1LoGk-BHDq1lM3.js → throttle-Cpk1LoGk-BVommE6v.js} +1 -1
- package/dist/{timediff-design-8kCO3aXz.js → timediff-design-DLlIUaqv.js} +1 -1
- package/dist/{trace-like-wrapper-CxPz9Trr.js → trace-like-wrapper-BXA26KJX.js} +2 -2
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-CzEZ0CY7.js → value-editor.vue_vue_type_style_index_0_lang-BE_003Cm.js} +2 -2
- package/dist/web-render/index.es.js +3 -3
- package/dist/{widget-barcode-CRxh3tC2.js → widget-barcode-DSLB1Wm3.js} +4 -4
- package/dist/{widget-diagonal-CO586oV2.js → widget-diagonal-8alLoPL6.js} +3 -3
- package/dist/{widget-image-CE6kVnu5.js → widget-image-BmP7Adg_.js} +5 -5
- package/dist/{widget-line-Br4oIssb.js → widget-line-D9S0mzzT.js} +2 -2
- package/dist/{widget-pagination-BHwjrBV5.js → widget-pagination-BR3w_OHu.js} +5 -5
- package/dist/{widget-power-BySYsE15.js → widget-power-DCV70vg5.js} +3 -3
- package/dist/{widget-qrcode-D6b0T_Qa.js → widget-qrcode-CTzBIYUi.js} +3 -3
- package/dist/{widget-rangelimit-DTH7nrqC.js → widget-rangelimit-1aqxil7q.js} +3 -3
- package/dist/{widget-serialnumber-DVtxhNC3.js → widget-serialnumber-B-2Ey17u.js} +1 -1
- package/dist/{widget-text-gBGybAXk.js → widget-text-B1REfHTG.js} +5 -5
- package/dist/{widget-timediff-aY-maVkE.js → widget-timediff-DRoMv5aa.js} +2 -2
- package/package.json +2 -2
- package/dist/paper-widget-design-BGotQsIf.js +0 -4
- package/dist/seal-design-DP1XaAY8.js +0 -4
package/dist/base/index.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { B as B2,
|
|
1
|
+
import { p as api, a0 as PlatformEnum, F as FIELD_TYPE, bj as getRowId, bk as findRuntimeTableRow, bm as RenderModeEnum, C as ComponentTypeEnum, aB as findFieldMain, c as getProfileByTableType, d as getBusinessProfileByRefModelType, b as isBusinessSubTableProfile, ax as RangeValidateMode, bx as assembleRules, by as isAttachFieldActive, aK as Dependency_ENUM, bl as calculateFormula, aJ as ASSIGNMENTSTRATEGY_ENUM, U as getParseFormulaVarInfos, bz as fetchHistoryConsume, bA as isBomGranted, aX as renderUtils, bw as uuid2, bB as parseFrontConfig, aN as CheckDsTypeEnum, aH as transformUtils, bC as baseDataUtils, bD as initializeSealFields, Z as FormTypeEnum, bE as normalizeToArray, bF as safeParseArray, bG as BpmnNodeTypeEnum, bH as mergeByMultiKey, a9 as _export_sfc, bI as evaluateInspectionDecisionRule, bJ as areValidationCommentsEqual, bK as useNocodeEmitter, bL as commonUtils, aL as EntityModelCategoryEnum } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-8yB6zly8.js";
|
|
2
|
+
import { aQ, aS, b1, a2, bM, bN, B, bO, A, aj, bP, bQ, bR, bi, bS, aT, aC, aR, aO, aP, bT, ak, ao, bU, bV, aI, a4, ai, aD, bW, a1, am, L, bX, bY, bZ, O, s, P, ab, q, R, G, b_, b$, ay, a7, a3, a5, a6, a8, h, c0, an, ar, al, c1, c2, c3, c4, bh, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, bn, cf, cg, a_, ch, b2, b3, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, aZ, cs, b4, bf, ct, cu, cv, ap, v, cw, cx, cy, bo, a$ } from "../dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-8yB6zly8.js";
|
|
3
|
+
import { T as getRuntimeDataFieldId, F as parseRuntimeFieldPath, U as buildRuntimeFieldPath, f as findFieldProfile, V as resolveRuntimeFieldProps, W as resolveRuntimeFieldState, X as getRuntimeDependencyOutputKey, Y as isRowAddedInCurrentFormChange, t as MaterialConsumptionPatternEnum, Z as MaterialConsumeTableController, $ as setFormulaParamsConfig, a0 as normalizeRuntime, K as createRuntimeInstanceContext, R as RuntimeFormStateStore, a1 as RuntimeSheetService, g as getBusinessFieldKey, a2 as validateObjectBomQtyOnSubmit, a3 as closeValidatorPopovers, a4 as enrichFormChangeRowDetails, N as NCB_PROVIDE, L as RuntimeInstanceRegistry, a5 as useMaterialBalance, a6 as collectFormChangeFieldLocations, a7 as nextFormChangeRowViewHistoryId } from "../dynamic-table-action-CHY5xNLE.js";
|
|
4
|
+
import { B as B2, a8 as a82, i, _, a9, P as P2, aa, Q, E, ab as ab2, ac, ad, ae, af, M, a, ag, d, ah, ai as ai2, aj as aj2, ak as ak2, al as al2, am as am2, an as an2, ao as ao2, z, ap as ap2, q as q2, aq, e, ar as ar2, as, at, au, p, A as A2, av, aw, ax, ay as ay2, j, C, h as h2, az, aA, aB, aC as aC2, aD as aD2, aE, w, r, aF, x, m, aG, s as s2, aH, H, I, u, y, J, l, o, G as G2, k, v as v2 } from "../dynamic-table-action-CHY5xNLE.js";
|
|
5
5
|
import { toRaw, watch, toRef, computed, defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, shallowRef, markRaw, ref, provide, onUnmounted, reactive, onBeforeUnmount } from "vue";
|
|
6
6
|
import { cloneDeep, defaults, isEmpty, merge, get } from "lodash-es";
|
|
7
7
|
import "dayjs";
|
|
8
|
-
import { S as SubTableCoreFactory, R as RuntimeInstanceController } from "../sub-table-factory-
|
|
9
|
-
import { A as A3, D, M as M2, a as a10, P as
|
|
10
|
-
import { createDataSourceManager, getLegacyFieldFillTargets, createFieldFillRuntime, isFieldFillTargetProtected, buildDataSourceContext } from "@gct-paas/form-base";
|
|
11
|
-
import { B as B3, F, M as M3, a as a11, u as u2 } from "../mb-render-
|
|
8
|
+
import { S as SubTableCoreFactory, R as RuntimeInstanceController } from "../sub-table-factory-B0YWwWSA.js";
|
|
9
|
+
import { A as A3, D, M as M2, a as a10, P as P3, b, c, d as d2, e as e2, W, f, g, h as h3 } from "../sub-table-factory-B0YWwWSA.js";
|
|
10
|
+
import { createDataSourceManager, getLegacyFieldFillTargets, createFieldFillRuntime, buildFieldFillRows, isFieldFillTargetProtected, getFieldFillColumn, buildDataSourceContext } from "@gct-paas/form-base";
|
|
11
|
+
import { B as B3, F, M as M3, a as a11, u as u2 } from "../mb-render-_IUbyYCY.js";
|
|
12
12
|
const InstanceStatusValues = {
|
|
13
13
|
/** 作废状态 */
|
|
14
14
|
ABANDON: "ABANDON",
|
|
@@ -155,6 +155,32 @@ async function fetchOperationReceiveQty(paramsConfig) {
|
|
|
155
155
|
const num = Number(raw);
|
|
156
156
|
return Number.isNaN(num) ? void 0 : num;
|
|
157
157
|
}
|
|
158
|
+
const INSPECTION_MODULE_QTY_API = {
|
|
159
|
+
modelCategory: "entity",
|
|
160
|
+
modelKey: "em_inspection_list",
|
|
161
|
+
bsKey: "getById"
|
|
162
|
+
};
|
|
163
|
+
function isRecord(value) {
|
|
164
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
165
|
+
}
|
|
166
|
+
function parseInspectionModuleQty(res) {
|
|
167
|
+
if (!isRecord(res) || res.ok === false) return void 0;
|
|
168
|
+
const payload = isRecord(res.data) ? res.data : res;
|
|
169
|
+
const row = isRecord(payload.data) ? payload.data : payload;
|
|
170
|
+
const raw = row.inspection_number_;
|
|
171
|
+
if (typeof raw !== "number" && typeof raw !== "string") return void 0;
|
|
172
|
+
if (typeof raw === "string" && raw.trim() === "") return void 0;
|
|
173
|
+
const qty = Number(raw);
|
|
174
|
+
return Number.isFinite(qty) ? qty : void 0;
|
|
175
|
+
}
|
|
176
|
+
async function fetchInspectionModuleQty(txnInstId) {
|
|
177
|
+
if (txnInstId == null || txnInstId === "") return void 0;
|
|
178
|
+
const res = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
|
|
179
|
+
INSPECTION_MODULE_QTY_API,
|
|
180
|
+
{ id: txnInstId }
|
|
181
|
+
);
|
|
182
|
+
return parseInspectionModuleQty(res);
|
|
183
|
+
}
|
|
158
184
|
function listRuntimeFieldRows(record, subFieldKey, targetFieldId) {
|
|
159
185
|
if (!subFieldKey) {
|
|
160
186
|
return [{ row: record.formState.state }];
|
|
@@ -191,7 +217,7 @@ class RuntimeFieldInitializer {
|
|
|
191
217
|
await Promise.resolve();
|
|
192
218
|
this.scheduled = false;
|
|
193
219
|
if (!signal.aborted && !this.disposed) await this.initialize();
|
|
194
|
-
}).catch((
|
|
220
|
+
}).catch(() => void 0).finally(() => this.tasks.delete("initialize:structure"));
|
|
195
221
|
});
|
|
196
222
|
}
|
|
197
223
|
record;
|
|
@@ -204,7 +230,7 @@ class RuntimeFieldInitializer {
|
|
|
204
230
|
disposed = false;
|
|
205
231
|
scheduled = false;
|
|
206
232
|
unsubscribe;
|
|
207
|
-
/**
|
|
233
|
+
/** 初次加载等待全部目标;默认值请求失败保留在任务中心供诊断,但不阻止提交。 */
|
|
208
234
|
async initialize() {
|
|
209
235
|
if (this.disposed || this.info.renderPurpose || this.info.platformType === PlatformEnum.INTEGRATION_PAAS_DP)
|
|
210
236
|
return;
|
|
@@ -213,7 +239,7 @@ class RuntimeFieldInitializer {
|
|
|
213
239
|
for (const { widget, sheetId, referenceInfo } of this.record.fields.allWidgets()) {
|
|
214
240
|
const props = widget.props;
|
|
215
241
|
const fieldId = getRuntimeDataFieldId(props);
|
|
216
|
-
const kind = props.fieldType === FIELD_TYPE.UDI || props.bizType === FIELD_TYPE.UDI ? "udi" : props.bizType === FIELD_TYPE.OPERATION_RECEIVE_QTY ? "receive" : props.tmplId && [FIELD_TYPE.INTEGER, FIELD_TYPE.LONG].includes(props.fieldType) ? "count" : this.info.isMockReport && props.fieldType === FIELD_TYPE.RECORD_NO && props.newSpecificConfig?.newSnNo ? "recordNo" : void 0;
|
|
242
|
+
const kind = props.fieldType === FIELD_TYPE.UDI || props.bizType === FIELD_TYPE.UDI ? "udi" : props.bizType === FIELD_TYPE.OPERATION_RECEIVE_QTY ? "receive" : props.fieldType === FIELD_TYPE.INSPECTION_MODULE_QTY || props.bizType === FIELD_TYPE.INSPECTION_MODULE_QTY ? "inspection" : props.tmplId && [FIELD_TYPE.INTEGER, FIELD_TYPE.LONG].includes(props.fieldType) ? "count" : this.info.isMockReport && props.fieldType === FIELD_TYPE.RECORD_NO && props.newSpecificConfig?.newSnNo ? "recordNo" : void 0;
|
|
217
243
|
if (!kind || !fieldId || props.isFieldModel) continue;
|
|
218
244
|
for (const { row } of listRuntimeFieldRows(
|
|
219
245
|
this.record,
|
|
@@ -225,11 +251,13 @@ class RuntimeFieldInitializer {
|
|
|
225
251
|
if (this.initialized.get(key) === toRaw(row)) continue;
|
|
226
252
|
this.initialized.set(key, toRaw(row));
|
|
227
253
|
if (props.subFieldKey ? row.id_ : (this.info.instanceStatus ?? this.metadata.instanceStatus) !== InstanceStatusValues.UNFILLED) {
|
|
228
|
-
if (kind !== "recordNo") continue;
|
|
254
|
+
if (kind !== "recordNo" && kind !== "inspection") continue;
|
|
229
255
|
}
|
|
230
256
|
const previous = row[fieldId];
|
|
231
257
|
if (kind === "udi" && isPresent(previous)) continue;
|
|
232
258
|
const path = this.record.formState.getFieldPath(row, fieldId);
|
|
259
|
+
if (kind === "inspection" && (isPresent(previous) || this.record.formState.isUserModified(path)))
|
|
260
|
+
continue;
|
|
233
261
|
this.tasks.add(key);
|
|
234
262
|
const task = this.record.asyncTasks.run(
|
|
235
263
|
key,
|
|
@@ -248,9 +276,14 @@ class RuntimeFieldInitializer {
|
|
|
248
276
|
modelKey: props.modelKey,
|
|
249
277
|
subModelKey: props.subModelKey
|
|
250
278
|
},
|
|
251
|
-
sheetId
|
|
279
|
+
sheetId,
|
|
280
|
+
blockOnFailure: false
|
|
252
281
|
}
|
|
253
|
-
).finally(() =>
|
|
282
|
+
).finally(() => {
|
|
283
|
+
this.tasks.delete(key);
|
|
284
|
+
if (kind === "inspection" && this.initialized.get(key) === toRaw(row) && !isPresent(row[fieldId]))
|
|
285
|
+
this.initialized.delete(key);
|
|
286
|
+
});
|
|
254
287
|
pending.push(task);
|
|
255
288
|
}
|
|
256
289
|
}
|
|
@@ -260,20 +293,33 @@ class RuntimeFieldInitializer {
|
|
|
260
293
|
this.record.asyncTasks.cancel(key);
|
|
261
294
|
this.tasks.delete(key);
|
|
262
295
|
}
|
|
263
|
-
await Promise.
|
|
296
|
+
await Promise.allSettled(pending);
|
|
264
297
|
}
|
|
265
|
-
request(key, fetch) {
|
|
298
|
+
request(key, fetch, cacheResult = true) {
|
|
266
299
|
const existing = this.requests.get(key);
|
|
267
300
|
if (existing) return existing;
|
|
268
|
-
const task = fetch().
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
301
|
+
const task = fetch().then(
|
|
302
|
+
(value) => {
|
|
303
|
+
if (!cacheResult) this.requests.delete(key);
|
|
304
|
+
return value;
|
|
305
|
+
},
|
|
306
|
+
(error) => {
|
|
307
|
+
this.requests.delete(key);
|
|
308
|
+
throw error;
|
|
309
|
+
}
|
|
310
|
+
);
|
|
272
311
|
this.requests.set(key, task);
|
|
273
312
|
return task;
|
|
274
313
|
}
|
|
275
314
|
async readDefault(kind, props) {
|
|
276
315
|
if (kind === "recordNo") return props.newSpecificConfig.newSnNo;
|
|
316
|
+
if (kind === "inspection") {
|
|
317
|
+
return this.request(
|
|
318
|
+
`inspection:${this.metadata.txnInstId ?? ""}`,
|
|
319
|
+
() => fetchInspectionModuleQty(this.metadata.txnInstId),
|
|
320
|
+
false
|
|
321
|
+
);
|
|
322
|
+
}
|
|
277
323
|
if (kind === "count") {
|
|
278
324
|
const params = { ...JSON.parse(this.metadata.params || "{}"), ...this.info.paramsConfig };
|
|
279
325
|
const name = params.materialNo || this.metadata.materialNo;
|
|
@@ -490,6 +536,13 @@ class RuntimeRuleCompiler {
|
|
|
490
536
|
const props = widget.props ?? {};
|
|
491
537
|
const targetFieldId = getRuntimeDataFieldId(props);
|
|
492
538
|
if (!targetFieldId) return;
|
|
539
|
+
const fieldMain = findFieldMain(props.bizType, props.fieldType);
|
|
540
|
+
const tableProfile = getProfileByTableType(props.subModelType) ?? getBusinessProfileByRefModelType(props.subModelType);
|
|
541
|
+
const tableProps = tableProfile && isBusinessSubTableProfile(tableProfile) ? findFieldProfile(tableProfile, props.field)?.defaultProps : void 0;
|
|
542
|
+
const numeric = fieldMain?.render === "rd:number" || fieldMain?.render === "rd:double";
|
|
543
|
+
const defaultMinValue = numeric && [tableProps, fieldMain?.defaultProps].some(
|
|
544
|
+
(defaults2) => defaults2?.enableRangeValidate === true && defaults2.minValidateMode === RangeValidateMode.Fixed_Number && defaults2.minValue === 0
|
|
545
|
+
) ? 0 : void 0;
|
|
493
546
|
getRulePaths(
|
|
494
547
|
this.record,
|
|
495
548
|
props,
|
|
@@ -509,6 +562,7 @@ class RuntimeRuleCompiler {
|
|
|
509
562
|
const rules = assembleRules({
|
|
510
563
|
showRequired: state.required,
|
|
511
564
|
fieldType: props.fieldType,
|
|
565
|
+
defaultMinValue,
|
|
512
566
|
validatorInfo: {
|
|
513
567
|
showModelName: props.newSpecificConfig?.newModelName,
|
|
514
568
|
showModelKey: props.modelKey ?? this.basicInfo.modelKey,
|
|
@@ -808,6 +862,10 @@ class FormTmplBomController {
|
|
|
808
862
|
field2TableMap = {};
|
|
809
863
|
/** 默认物料消耗模式 */
|
|
810
864
|
defaultMCPattern = MaterialConsumptionPatternEnum.RECORD;
|
|
865
|
+
/** 表单实例身份与 BOM 数据是否存在无关,模板展示也会创建完整控制器。 */
|
|
866
|
+
hasFormInstance = false;
|
|
867
|
+
/** 按页面中的表解析后的配置,页面与打印共用。 */
|
|
868
|
+
resolvedTmplBomList = [];
|
|
811
869
|
constructor() {
|
|
812
870
|
}
|
|
813
871
|
/**
|
|
@@ -825,7 +883,9 @@ class FormTmplBomController {
|
|
|
825
883
|
productQty: this.productQty,
|
|
826
884
|
historyData: this.historyData,
|
|
827
885
|
field2TableMap: this.field2TableMap,
|
|
828
|
-
defaultMCPattern: this.defaultMCPattern
|
|
886
|
+
defaultMCPattern: this.defaultMCPattern,
|
|
887
|
+
hasFormInstance: this.hasFormInstance,
|
|
888
|
+
resolvedTmplBomList: this.resolvedTmplBomList
|
|
829
889
|
})
|
|
830
890
|
);
|
|
831
891
|
(view.tmplBomList ?? []).forEach((config) => {
|
|
@@ -877,11 +937,11 @@ class FormTmplBomController {
|
|
|
877
937
|
* @readonly
|
|
878
938
|
*/
|
|
879
939
|
get bomEntries() {
|
|
880
|
-
return this.formInstBom?.bomEntries;
|
|
940
|
+
return this.formInstBom?.bomEntries ?? [];
|
|
881
941
|
}
|
|
882
942
|
/** 表单模板bom信息配置列表 */
|
|
883
943
|
get tmplBomList() {
|
|
884
|
-
return this.
|
|
944
|
+
return this.resolvedTmplBomList;
|
|
885
945
|
}
|
|
886
946
|
/**
|
|
887
947
|
* bom那边指定的当前工序的开关
|
|
@@ -890,30 +950,55 @@ class FormTmplBomController {
|
|
|
890
950
|
get enableSequenceLoading() {
|
|
891
951
|
return !!this.formInstBom?.sequenceEntries?.[0]?.enabled_;
|
|
892
952
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
953
|
+
createDefaultConfig(table) {
|
|
954
|
+
return {
|
|
955
|
+
table_key_: `${table.tableKey}:${table.masterSubField}`,
|
|
956
|
+
material_loading_model_enabled_: false,
|
|
957
|
+
material_consumption_pattern_: MaterialConsumptionPatternEnum.RECORD,
|
|
958
|
+
bom_init_enabled_: false,
|
|
959
|
+
personal_bom_enabled_: false,
|
|
960
|
+
sequence_loading_enabled_: false,
|
|
961
|
+
entries_: []
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
/** 有实例时读取实例配置,无实例时仅创建默认展示控制器。 */
|
|
896
965
|
async init(data) {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
this.
|
|
901
|
-
this.
|
|
902
|
-
this.
|
|
903
|
-
this.
|
|
904
|
-
this.historyData = await fetchHistoryConsume({
|
|
905
|
-
production_identification_id_: this.formInstBom.productionIdentificationId,
|
|
906
|
-
routing_operation_id_: this.operationId
|
|
907
|
-
});
|
|
908
|
-
const isGranted = await isBomGranted();
|
|
909
|
-
this.defaultMCPattern = isGranted ? MaterialConsumptionPatternEnum.BOM : MaterialConsumptionPatternEnum.RECORD;
|
|
966
|
+
this.hasFormInstance = data.hasFormInstance;
|
|
967
|
+
this.operationId = data.operationId ?? "";
|
|
968
|
+
this.materialNo = data.materialNo ?? "";
|
|
969
|
+
this.formInstBom = this.hasFormInstance ? data.formInstBom ?? null : null;
|
|
970
|
+
this.productQty = this.formInstBom ? data.productQty ?? 0 : data.productQty;
|
|
971
|
+
this.historyData = [];
|
|
972
|
+
this.defaultMCPattern = MaterialConsumptionPatternEnum.RECORD;
|
|
910
973
|
this.tableControllers = {};
|
|
911
|
-
this.
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
974
|
+
this.field2TableMap = {};
|
|
975
|
+
const instanceConfigs = new Map(
|
|
976
|
+
(this.formInstBom?.formTmplBomList ?? []).filter((config) => !config.deleted_ && config.table_key_).map((config) => [config.table_key_, config])
|
|
977
|
+
);
|
|
978
|
+
this.resolvedTmplBomList = data.materialConsumeTableList.map((table) => {
|
|
979
|
+
const key = `${table.tableKey}:${table.masterSubField}`;
|
|
980
|
+
const source = instanceConfigs.get(key);
|
|
981
|
+
if (!source) return this.createDefaultConfig(table);
|
|
982
|
+
const config = cloneDeep(source);
|
|
983
|
+
config.entries_ ??= [];
|
|
984
|
+
return config;
|
|
985
|
+
});
|
|
986
|
+
if (this.formInstBom) {
|
|
987
|
+
if (this.formInstBom.productionIdentificationId && this.operationId) {
|
|
988
|
+
this.historyData = await fetchHistoryConsume({
|
|
989
|
+
production_identification_id_: this.formInstBom.productionIdentificationId,
|
|
990
|
+
routing_operation_id_: this.operationId
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
const isGranted = await isBomGranted();
|
|
994
|
+
this.defaultMCPattern = isGranted ? MaterialConsumptionPatternEnum.BOM : MaterialConsumptionPatternEnum.RECORD;
|
|
995
|
+
}
|
|
996
|
+
data.materialConsumeTableList.forEach((table, index) => {
|
|
997
|
+
const config = this.resolvedTmplBomList[index];
|
|
998
|
+
const controller = new MaterialConsumeTableController(this, config);
|
|
999
|
+
this.tableControllers[table.tableKey] = controller;
|
|
1000
|
+
this.field2TableMap[table.masterSubField] = table.tableKey;
|
|
1001
|
+
});
|
|
917
1002
|
}
|
|
918
1003
|
/**
|
|
919
1004
|
* 根据字段key获取子表控制器
|
|
@@ -960,7 +1045,7 @@ class FormTmplBomController {
|
|
|
960
1045
|
}
|
|
961
1046
|
async submitValidate() {
|
|
962
1047
|
const results = await Promise.all(
|
|
963
|
-
Object.values(this.tableControllers).map((
|
|
1048
|
+
Object.values(this.tableControllers).map((c10) => c10.submitValidate())
|
|
964
1049
|
);
|
|
965
1050
|
const fields = {};
|
|
966
1051
|
let isValid = true;
|
|
@@ -974,6 +1059,71 @@ class FormTmplBomController {
|
|
|
974
1059
|
};
|
|
975
1060
|
}
|
|
976
1061
|
}
|
|
1062
|
+
async function prepareObjectProductDefaults({
|
|
1063
|
+
enabled,
|
|
1064
|
+
fields,
|
|
1065
|
+
objectInitialValues = []
|
|
1066
|
+
}) {
|
|
1067
|
+
const defaults2 = /* @__PURE__ */ new WeakMap();
|
|
1068
|
+
if (!enabled) return defaults2;
|
|
1069
|
+
const requests = /* @__PURE__ */ new Map();
|
|
1070
|
+
const tasks = [];
|
|
1071
|
+
function fetchProduct(productId) {
|
|
1072
|
+
const existing = requests.get(productId);
|
|
1073
|
+
if (existing) return existing;
|
|
1074
|
+
const request = (async () => {
|
|
1075
|
+
const result = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
|
|
1076
|
+
{
|
|
1077
|
+
modelCategory: "entity",
|
|
1078
|
+
modelKey: "em_product",
|
|
1079
|
+
bsKey: "rdoGetVersionById"
|
|
1080
|
+
},
|
|
1081
|
+
// 沿用现有接口约定,传完整默认值,不拆分版本 ID。
|
|
1082
|
+
{ id: productId }
|
|
1083
|
+
);
|
|
1084
|
+
const product = result?.data;
|
|
1085
|
+
if (!product || typeof product !== "object" || Array.isArray(product) || Object.keys(product).length === 0) {
|
|
1086
|
+
throw new Error(`未找到默认物料详情:${productId}`);
|
|
1087
|
+
}
|
|
1088
|
+
return { ...product, _DICT: result?.dict ?? product._DICT };
|
|
1089
|
+
})();
|
|
1090
|
+
requests.set(productId, request);
|
|
1091
|
+
return request;
|
|
1092
|
+
}
|
|
1093
|
+
for (const entry of fields) {
|
|
1094
|
+
if (!entry || typeof entry !== "object") continue;
|
|
1095
|
+
const field = entry;
|
|
1096
|
+
if (typeof field.fieldId !== "string" || !field.belongingObject || field.fieldType !== FIELD_TYPE.PRODUCT || field.isFieldModel || field.subFieldKey || field.subModelKey) {
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
const configured = objectInitialValues.find(
|
|
1100
|
+
(item) => item.objectField === field.belongingObject
|
|
1101
|
+
);
|
|
1102
|
+
if (!configured?.values || !Object.prototype.hasOwnProperty.call(configured.values, field.fieldId)) {
|
|
1103
|
+
continue;
|
|
1104
|
+
}
|
|
1105
|
+
const productDefault = {
|
|
1106
|
+
value: configured.values[field.fieldId]
|
|
1107
|
+
};
|
|
1108
|
+
defaults2.set(entry, productDefault);
|
|
1109
|
+
const productId = productDefault.value;
|
|
1110
|
+
const needsAutofill = field.enableAutofill !== false && field.autofillRules?.some((rule) => !!rule.toField);
|
|
1111
|
+
if (!needsAutofill || typeof productId !== "string" || productId === "") continue;
|
|
1112
|
+
tasks.push(
|
|
1113
|
+
fetchProduct(productId).then(
|
|
1114
|
+
(sourceData) => {
|
|
1115
|
+
productDefault.sourceData = sourceData;
|
|
1116
|
+
},
|
|
1117
|
+
(error) => {
|
|
1118
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
1119
|
+
throw new Error(`对象初始化数据填充失败,字段 ${field.fieldId}:${reason}`);
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
);
|
|
1123
|
+
}
|
|
1124
|
+
await Promise.all(tasks);
|
|
1125
|
+
return defaults2;
|
|
1126
|
+
}
|
|
977
1127
|
async function getModelQueries(opts) {
|
|
978
1128
|
const isEdhr = await isEdhrSuite();
|
|
979
1129
|
if (!isEdhr || !opts.mainMaterialNo) {
|
|
@@ -993,6 +1143,37 @@ async function getModelQueries(opts) {
|
|
|
993
1143
|
console.log("getModelQueries", res);
|
|
994
1144
|
return res;
|
|
995
1145
|
}
|
|
1146
|
+
async function fillSterilizationDate(txnInstId, metadata, formState) {
|
|
1147
|
+
if (txnInstId == null || txnInstId === "") return;
|
|
1148
|
+
const fields = metadata.fields.filter(({ widget }) => {
|
|
1149
|
+
const props = widget?.props;
|
|
1150
|
+
return props?.fieldType === FIELD_TYPE.STERILIZATION_DATE || props?.bizType === FIELD_TYPE.STERILIZATION_DATE;
|
|
1151
|
+
});
|
|
1152
|
+
if (!fields.length) return;
|
|
1153
|
+
const response = await api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey(
|
|
1154
|
+
{ modelCategory: "entity", modelKey: "em_sterilization_list", bsKey: "getOne" },
|
|
1155
|
+
{},
|
|
1156
|
+
{ query: { txn_inst_id_: txnInstId } }
|
|
1157
|
+
);
|
|
1158
|
+
const data = response && "data" in response ? response.data : void 0;
|
|
1159
|
+
const record = Array.isArray(data) ? data[0] : data;
|
|
1160
|
+
const date = record && typeof record === "object" && "sterilization_date_" in record ? record.sterilization_date_ : void 0;
|
|
1161
|
+
if (date == null || date === "") return;
|
|
1162
|
+
fields.forEach(({ widget, subFieldKey }) => {
|
|
1163
|
+
const field = getRuntimeDataFieldId(widget?.props);
|
|
1164
|
+
if (!field) return;
|
|
1165
|
+
if (subFieldKey) {
|
|
1166
|
+
const rows = formState[subFieldKey];
|
|
1167
|
+
if (Array.isArray(rows)) {
|
|
1168
|
+
rows.forEach((row) => {
|
|
1169
|
+
if (row && typeof row === "object") row[field] = date;
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
} else {
|
|
1173
|
+
formState[field] = date;
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
996
1177
|
function uniqueItems(items, getKey) {
|
|
997
1178
|
return Array.from(new Map(items.map((item) => [getKey(item), item])).values());
|
|
998
1179
|
}
|
|
@@ -1267,6 +1448,8 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
|
|
|
1267
1448
|
}
|
|
1268
1449
|
await tmplBomC.init({
|
|
1269
1450
|
formInstBom: selfInfo.formInstBom,
|
|
1451
|
+
materialConsumeTableList: businessIndex.materialConsumeTableList,
|
|
1452
|
+
hasFormInstance: isFormInstance,
|
|
1270
1453
|
operationId: paramsConfig?.routingOperationId,
|
|
1271
1454
|
materialNo,
|
|
1272
1455
|
productQty: paramsConfig?.productQty
|
|
@@ -1338,7 +1521,13 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
|
|
|
1338
1521
|
params: { id: paramsConfig?.warehouseId }
|
|
1339
1522
|
}
|
|
1340
1523
|
]);
|
|
1524
|
+
const objectProductDefaults = await prepareObjectProductDefaults({
|
|
1525
|
+
enabled: fillModeType === RenderModeEnum.FormMode && selfInfo.dataStatus !== "STASH" && selfInfo.dataStatus !== "SUBMIT",
|
|
1526
|
+
fields: fieldInfoMap.useDefaultValueFields,
|
|
1527
|
+
objectInitialValues: runtimeContext.formConfig.objectInitialValues
|
|
1528
|
+
});
|
|
1341
1529
|
const defaultDataMap = renderUtils.getDefaultValueMapByField({
|
|
1530
|
+
objectProductDefaults,
|
|
1342
1531
|
defaultValueFields: fieldInfoMap.useDefaultValueFields,
|
|
1343
1532
|
mainMaterialNo: paramsConfig?.materialNo || selfInfo.materialNo,
|
|
1344
1533
|
mainRelatedLotNo: paramsConfig?.relatedLotNo,
|
|
@@ -1422,12 +1611,24 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
|
|
|
1422
1611
|
]
|
|
1423
1612
|
});
|
|
1424
1613
|
if (fillModeType === RenderModeEnum.FormMode) {
|
|
1614
|
+
if (!payload.isMockReport) {
|
|
1615
|
+
await fillSterilizationDate(selfInfo.txnInstId, fieldInfoMap.fieldMetadata, formState);
|
|
1616
|
+
}
|
|
1425
1617
|
const floatingFields = sheetEntries.flatMap((entry) => {
|
|
1426
1618
|
const ids = entry.dataCenter[ComponentTypeEnum.PAPER]?.props?.floatingFieldIds ?? [];
|
|
1427
1619
|
return ids.map((fieldId) => entry.dataCenter[fieldId]).filter(Boolean);
|
|
1428
1620
|
});
|
|
1429
1621
|
initializeSealFields(floatingFields, formState);
|
|
1430
1622
|
}
|
|
1623
|
+
await transformUtils.getEventInitDataLoaded({
|
|
1624
|
+
formConfig: runtimeContext.formConfig,
|
|
1625
|
+
formState,
|
|
1626
|
+
viewMode: fillModeType,
|
|
1627
|
+
dataStatus: selfInfo.dataStatus,
|
|
1628
|
+
ofCtx: { formPrint: payload.formPrint, id: result.id }
|
|
1629
|
+
}).catch((error) => {
|
|
1630
|
+
console.error("Error in getEventInitDataLoaded:", error);
|
|
1631
|
+
});
|
|
1431
1632
|
runtimeFormStateStore = new RuntimeFormStateStore(
|
|
1432
1633
|
formState,
|
|
1433
1634
|
// 子表信息覆盖普通/固定/检验表、二维关联列以及各类业务表;不能只依赖已放置字段。
|
|
@@ -1522,6 +1723,7 @@ function createRuntimeInstanceInitializer(props, payload, getConsumeData) {
|
|
|
1522
1723
|
productSearchFields: payload?.deviceConfig?.defaultProductSearchFields ?? "",
|
|
1523
1724
|
showPrintFieldBg: paramsConfig?.showPrintFieldBg,
|
|
1524
1725
|
paramsConfig,
|
|
1726
|
+
businessType: selfInfo.businessType,
|
|
1525
1727
|
instanceStatus: selfInfo.instanceStatus
|
|
1526
1728
|
},
|
|
1527
1729
|
selfInfo: runtimeSelfInfo
|
|
@@ -1546,6 +1748,18 @@ function bindRuntimeBusinessServices(runtimeRegistry, record, dataStatus) {
|
|
|
1546
1748
|
uniqueId,
|
|
1547
1749
|
() => MaterialConsumeTableController.render?.destroyAllModals(uniqueId)
|
|
1548
1750
|
);
|
|
1751
|
+
runtimeRegistry.registerDisposable(
|
|
1752
|
+
uniqueId,
|
|
1753
|
+
watch(
|
|
1754
|
+
() => record.context.activeSheetId,
|
|
1755
|
+
(next, previous) => {
|
|
1756
|
+
if (next !== previous) {
|
|
1757
|
+
MaterialConsumeTableController.render?.destroyAllModals(uniqueId);
|
|
1758
|
+
}
|
|
1759
|
+
},
|
|
1760
|
+
{ flush: "sync" }
|
|
1761
|
+
)
|
|
1762
|
+
);
|
|
1549
1763
|
if (!mcList.length) return;
|
|
1550
1764
|
const tmplBomC = record.context.services.tmplBomController;
|
|
1551
1765
|
if (!tmplBomC) return;
|
|
@@ -1842,7 +2056,13 @@ function createRuntimePersistenceAccess(runtimeRegistry, props, payload) {
|
|
|
1842
2056
|
const signatureKeys = (runtimeRecord.context.businessIndex.useSignatureFields || []).map(
|
|
1843
2057
|
(item) => item.fieldId
|
|
1844
2058
|
);
|
|
1845
|
-
const idsFormState = transformUtils.getFormDataIdsMap(
|
|
2059
|
+
const idsFormState = transformUtils.getFormDataIdsMap(
|
|
2060
|
+
newFormState,
|
|
2061
|
+
signatureKeys,
|
|
2062
|
+
(path) => runtimeRecord.fields.findByPath(path).some(
|
|
2063
|
+
({ widget, subFieldKey }) => subFieldKey !== path && [FIELD_TYPE.DATE, FIELD_TYPE.DATE_TIME].includes(widget?.props.fieldType)
|
|
2064
|
+
)
|
|
2065
|
+
);
|
|
1846
2066
|
if (saveToken ? !runtimeRecord.persistence.completeSave(saveToken) : requestedRevision !== runtimeRecord.formState.revision) {
|
|
1847
2067
|
return false;
|
|
1848
2068
|
}
|
|
@@ -1919,6 +2139,139 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1919
2139
|
}
|
|
1920
2140
|
});
|
|
1921
2141
|
const InspectionDecisionPromptModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9c14035f"]]);
|
|
2142
|
+
function createMaterialConsumeObjectValidation(options) {
|
|
2143
|
+
const { record, getInfo, isCurrent, shouldSkip, applyComments } = options;
|
|
2144
|
+
let enabled = false;
|
|
2145
|
+
let disposed = false;
|
|
2146
|
+
let submitting = 0;
|
|
2147
|
+
let generation = 0;
|
|
2148
|
+
let lastRevision = -1;
|
|
2149
|
+
let timer;
|
|
2150
|
+
let paths = /* @__PURE__ */ new Set();
|
|
2151
|
+
const unlocated = /* @__PURE__ */ new Set();
|
|
2152
|
+
const alive = () => !disposed && isCurrent();
|
|
2153
|
+
function cancelLive() {
|
|
2154
|
+
generation++;
|
|
2155
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
2156
|
+
timer = void 0;
|
|
2157
|
+
}
|
|
2158
|
+
function calcObjectError(error) {
|
|
2159
|
+
const info = getInfo();
|
|
2160
|
+
const modelKey = info?.modelKey || record.context.businessIndex.modelDisplay.key;
|
|
2161
|
+
const descriptor = record.fields.findField({ modelKey, fieldId: error.field });
|
|
2162
|
+
const props = descriptor?.widget?.props;
|
|
2163
|
+
if (!props?.field || descriptor?.subFieldKey || props.subFieldKey) {
|
|
2164
|
+
const key = modelKey + "." + error.field;
|
|
2165
|
+
if (!unlocated.has(key)) {
|
|
2166
|
+
unlocated.add(key);
|
|
2167
|
+
console.warn("物料消耗对象错误未定位到主表控件,保留在校验清单:", key);
|
|
2168
|
+
}
|
|
2169
|
+
return { error, path: void 0 };
|
|
2170
|
+
}
|
|
2171
|
+
const path = buildRuntimeFieldPath({
|
|
2172
|
+
...props,
|
|
2173
|
+
modelKey: props.modelKey ?? info?.modelKey,
|
|
2174
|
+
fieldId: props.field
|
|
2175
|
+
});
|
|
2176
|
+
return { error: { ...error, field: path }, path };
|
|
2177
|
+
}
|
|
2178
|
+
function replaceObjectFields(fields) {
|
|
2179
|
+
if (!alive()) return;
|
|
2180
|
+
const next = { ...getInfo()?.mcValidatorMessageMap ?? {} };
|
|
2181
|
+
paths.forEach((path) => delete next[path]);
|
|
2182
|
+
Object.assign(next, fields);
|
|
2183
|
+
paths = new Set(Object.keys(fields));
|
|
2184
|
+
applyComments(next);
|
|
2185
|
+
}
|
|
2186
|
+
function replaceTableFields(fields) {
|
|
2187
|
+
if (!alive()) return;
|
|
2188
|
+
const current = getInfo()?.mcValidatorMessageMap ?? {};
|
|
2189
|
+
const next = { ...fields ?? {} };
|
|
2190
|
+
paths.forEach((path) => {
|
|
2191
|
+
if (current[path]) {
|
|
2192
|
+
next[path] = [...next[path] ?? [], ...current[path]];
|
|
2193
|
+
}
|
|
2194
|
+
});
|
|
2195
|
+
applyComments(next);
|
|
2196
|
+
}
|
|
2197
|
+
function clear() {
|
|
2198
|
+
cancelLive();
|
|
2199
|
+
enabled = false;
|
|
2200
|
+
lastRevision = -1;
|
|
2201
|
+
replaceObjectFields({});
|
|
2202
|
+
}
|
|
2203
|
+
async function validate(live = false) {
|
|
2204
|
+
cancelLive();
|
|
2205
|
+
if (!alive()) return;
|
|
2206
|
+
if (shouldSkip()) {
|
|
2207
|
+
clear();
|
|
2208
|
+
return { isValid: true };
|
|
2209
|
+
}
|
|
2210
|
+
const ticket = generation;
|
|
2211
|
+
const revision = record.formState.revision;
|
|
2212
|
+
const info = getInfo();
|
|
2213
|
+
const display = record.context.businessIndex.modelDisplay;
|
|
2214
|
+
const errors = await validateObjectBomQtyOnSubmit({
|
|
2215
|
+
formState: record.formState.state,
|
|
2216
|
+
objectFieldList: record.context.formConfig.objectFieldList,
|
|
2217
|
+
formInstBom: record.context.services.tmplBomController?.formInstBom,
|
|
2218
|
+
showModelName: display.name,
|
|
2219
|
+
showModelKey: display.key || info?.modelKey || ""
|
|
2220
|
+
});
|
|
2221
|
+
if (!alive() || generation !== ticket || record.formState.revision !== revision || live && getInfo()?.renderModeType !== RenderModeEnum.FormMode)
|
|
2222
|
+
return;
|
|
2223
|
+
const fields = {};
|
|
2224
|
+
const comments = {};
|
|
2225
|
+
for (const source of errors) {
|
|
2226
|
+
const adapted = calcObjectError(source);
|
|
2227
|
+
(fields[adapted.error.field] ??= []).push(adapted.error);
|
|
2228
|
+
if (adapted.path) (comments[adapted.path] ??= []).push(adapted.error);
|
|
2229
|
+
}
|
|
2230
|
+
enabled = !!record.context.formConfig.objectFieldList?.length;
|
|
2231
|
+
lastRevision = revision;
|
|
2232
|
+
replaceObjectFields(comments);
|
|
2233
|
+
return { isValid: !errors.length, fields: Object.keys(fields).length ? fields : void 0 };
|
|
2234
|
+
}
|
|
2235
|
+
function requestLive() {
|
|
2236
|
+
cancelLive();
|
|
2237
|
+
if (!alive() || !enabled || submitting > 0 || getInfo()?.renderModeType !== RenderModeEnum.FormMode)
|
|
2238
|
+
return;
|
|
2239
|
+
const ticket = generation;
|
|
2240
|
+
timer = setTimeout(() => {
|
|
2241
|
+
timer = void 0;
|
|
2242
|
+
void (async () => {
|
|
2243
|
+
await record.controller?.waitUntilPrepared();
|
|
2244
|
+
await record.asyncTasks.waitForRequired();
|
|
2245
|
+
if (!alive() || generation !== ticket || submitting > 0 || getInfo()?.renderModeType !== RenderModeEnum.FormMode)
|
|
2246
|
+
return;
|
|
2247
|
+
await validate(true);
|
|
2248
|
+
})().catch((error) => {
|
|
2249
|
+
if (alive()) console.error("物料消耗对象实时校验失败", error);
|
|
2250
|
+
});
|
|
2251
|
+
}, 300);
|
|
2252
|
+
}
|
|
2253
|
+
return {
|
|
2254
|
+
validate,
|
|
2255
|
+
requestLive,
|
|
2256
|
+
replaceTableFields,
|
|
2257
|
+
clear,
|
|
2258
|
+
beginSubmit() {
|
|
2259
|
+
submitting++;
|
|
2260
|
+
cancelLive();
|
|
2261
|
+
},
|
|
2262
|
+
endSubmit() {
|
|
2263
|
+
submitting--;
|
|
2264
|
+
if (alive() && submitting === 0 && enabled && lastRevision !== record.formState.revision)
|
|
2265
|
+
requestLive();
|
|
2266
|
+
},
|
|
2267
|
+
dispose() {
|
|
2268
|
+
disposed = true;
|
|
2269
|
+
cancelLive();
|
|
2270
|
+
paths.clear();
|
|
2271
|
+
unlocated.clear();
|
|
2272
|
+
}
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
1922
2275
|
function applyValidationComments(info, comments, kind) {
|
|
1923
2276
|
if (!info) return;
|
|
1924
2277
|
const locationKey = kind === "field" ? "validatorLocationList" : "mcValidatorLocationList";
|
|
@@ -1936,6 +2289,29 @@ function applyValidationComments(info, comments, kind) {
|
|
|
1936
2289
|
info[messageKey] = map;
|
|
1937
2290
|
}
|
|
1938
2291
|
function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType) {
|
|
2292
|
+
const objectValidations = /* @__PURE__ */ new WeakMap();
|
|
2293
|
+
function getObjectValidation(record) {
|
|
2294
|
+
const existing = objectValidations.get(record);
|
|
2295
|
+
if (existing) return existing;
|
|
2296
|
+
const uniqueId = record.context.uniqueId;
|
|
2297
|
+
const validation = createMaterialConsumeObjectValidation({
|
|
2298
|
+
record,
|
|
2299
|
+
getInfo: () => getInfo(uniqueId),
|
|
2300
|
+
isCurrent: () => runtimeRegistry.get(uniqueId) === record,
|
|
2301
|
+
shouldSkip: () => {
|
|
2302
|
+
const skip = syncInspectionDecisionRule(uniqueId);
|
|
2303
|
+
if (skip) clearInspectionValidationState(uniqueId);
|
|
2304
|
+
return skip;
|
|
2305
|
+
},
|
|
2306
|
+
applyComments: (fields) => applyValidationComments(getInfo(uniqueId), fields, "material")
|
|
2307
|
+
});
|
|
2308
|
+
objectValidations.set(record, validation);
|
|
2309
|
+
runtimeRegistry.registerDisposable(uniqueId, () => {
|
|
2310
|
+
validation.dispose();
|
|
2311
|
+
objectValidations.delete(record);
|
|
2312
|
+
});
|
|
2313
|
+
return validation;
|
|
2314
|
+
}
|
|
1939
2315
|
const inspectionDecisionMatched = /* @__PURE__ */ new WeakMap();
|
|
1940
2316
|
const inspectionDecisionPrompting = /* @__PURE__ */ new WeakSet();
|
|
1941
2317
|
function openInspectionDecisionPrompt(uniqueId, content) {
|
|
@@ -1976,11 +2352,14 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
|
|
|
1976
2352
|
return matched;
|
|
1977
2353
|
}
|
|
1978
2354
|
function clearInspectionValidationState(uniqueId) {
|
|
2355
|
+
const record = runtimeRegistry.get(uniqueId);
|
|
2356
|
+
if (record) objectValidations.get(record)?.clear();
|
|
1979
2357
|
applyValidationComments(getInfo(uniqueId), null, "field");
|
|
1980
2358
|
applyValidationComments(getInfo(uniqueId), null, "material");
|
|
1981
2359
|
}
|
|
1982
2360
|
function bindFormValidationSync(uniqueId) {
|
|
1983
2361
|
const record = runtimeRegistry.require(uniqueId);
|
|
2362
|
+
const objects = getObjectValidation(record);
|
|
1984
2363
|
syncInspectionDecisionRule(uniqueId);
|
|
1985
2364
|
const stop = record.formState.subscribe(() => {
|
|
1986
2365
|
if (runtimeRegistry.get(uniqueId) !== record) return;
|
|
@@ -1991,6 +2370,7 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
|
|
|
1991
2370
|
uniqueId,
|
|
1992
2371
|
!suppressed && info.renderModeType === RenderModeEnum.FormMode
|
|
1993
2372
|
);
|
|
2373
|
+
objects.requestLive();
|
|
1994
2374
|
if (suppressed) return;
|
|
1995
2375
|
if (info.renderModeType === RenderModeEnum.FormMode) {
|
|
1996
2376
|
record.validation.requestLive("change");
|
|
@@ -2023,48 +2403,43 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
|
|
|
2023
2403
|
}
|
|
2024
2404
|
async function runSubmissionValidation(uniqueId) {
|
|
2025
2405
|
const record = runtimeRegistry.require(uniqueId);
|
|
2026
|
-
const
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
const res = await record.validation.validate();
|
|
2033
|
-
if (!res || runtimeRegistry.get(uniqueId) !== record) return;
|
|
2034
|
-
const revision = record.formState.revision;
|
|
2035
|
-
if (bomC) {
|
|
2036
|
-
const bomRes = await bomC.submitValidate();
|
|
2037
|
-
if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
|
|
2038
|
-
return;
|
|
2039
|
-
applyValidationComments(getInfo(uniqueId), bomRes.fields ?? null, "material");
|
|
2040
|
-
if (!bomRes.isValid) {
|
|
2041
|
-
merge(res, bomRes);
|
|
2042
|
-
return res;
|
|
2406
|
+
const objects = getObjectValidation(record);
|
|
2407
|
+
objects.beginSubmit();
|
|
2408
|
+
try {
|
|
2409
|
+
if (syncInspectionDecisionRule(uniqueId)) {
|
|
2410
|
+
clearInspectionValidationState(uniqueId);
|
|
2411
|
+
return { isValid: true };
|
|
2043
2412
|
}
|
|
2044
|
-
const
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2413
|
+
const res = await record.validation.validate();
|
|
2414
|
+
if (!res || runtimeRegistry.get(uniqueId) !== record) return;
|
|
2415
|
+
const revision = record.formState.revision;
|
|
2416
|
+
const bomC = record.context.services.tmplBomController;
|
|
2417
|
+
if (bomC) {
|
|
2418
|
+
const bomRes = await bomC.submitValidate();
|
|
2419
|
+
if (runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
|
|
2420
|
+
return;
|
|
2421
|
+
objects.replaceTableFields(bomRes.fields);
|
|
2422
|
+
if (!bomRes.isValid) {
|
|
2423
|
+
merge(res, bomRes);
|
|
2424
|
+
return res;
|
|
2425
|
+
}
|
|
2426
|
+
const objectRes = await objects.validate();
|
|
2427
|
+
if (!objectRes || runtimeRegistry.get(uniqueId) !== record || record.formState.revision !== revision)
|
|
2428
|
+
return;
|
|
2429
|
+
if (!objectRes.isValid) {
|
|
2430
|
+
const fields = { ...res.fields ?? {} };
|
|
2431
|
+
for (const [path, errors] of Object.entries(objectRes.fields ?? {})) {
|
|
2432
|
+
fields[path] = [...fields[path] ?? [], ...errors];
|
|
2433
|
+
}
|
|
2434
|
+
return { ...res, isValid: false, fields };
|
|
2435
|
+
}
|
|
2436
|
+
} else {
|
|
2437
|
+
objects.clear();
|
|
2065
2438
|
}
|
|
2439
|
+
return res;
|
|
2440
|
+
} finally {
|
|
2441
|
+
objects.endSubmit();
|
|
2066
2442
|
}
|
|
2067
|
-
return res;
|
|
2068
2443
|
}
|
|
2069
2444
|
function updateRenderModeType(uniqueId, mode, updateButton = false) {
|
|
2070
2445
|
const record = runtimeRegistry.require(uniqueId);
|
|
@@ -2082,7 +2457,9 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
|
|
|
2082
2457
|
if (!isCurrent() || runtimeRegistry.get(uniqueId) !== record) return;
|
|
2083
2458
|
await record.validation.settleAfterModeSwitch(mode === RenderModeEnum.FormMode);
|
|
2084
2459
|
}).catch((error) => {
|
|
2085
|
-
if (runtimeRegistry.get(uniqueId)
|
|
2460
|
+
if (runtimeRegistry.get(uniqueId) !== record) return;
|
|
2461
|
+
if (error instanceof Error && error.message.startsWith("以下异步任务执行失败:")) return;
|
|
2462
|
+
console.error("表单模式准备失败", error);
|
|
2086
2463
|
});
|
|
2087
2464
|
}
|
|
2088
2465
|
async function prepareInitialView(record) {
|
|
@@ -2112,14 +2489,14 @@ function createRuntimeValidationBinding(runtimeRegistry, getInfo, platformType)
|
|
|
2112
2489
|
function createRuntimeDataSourceBinding(registry, payload) {
|
|
2113
2490
|
const dataSourceManagerMap = shallowRef({});
|
|
2114
2491
|
async function bindDataSources(record, info, selfInfo) {
|
|
2115
|
-
if (payload.isMockReport || !["instance", "batchInstance"].includes(payload.factoryType))
|
|
2492
|
+
if (payload.isMockReport || !["instance", "batchInstance"].includes(payload.factoryType))
|
|
2493
|
+
return;
|
|
2116
2494
|
const isDetail = () => typeof payload.isDetailPage === "function" ? payload.isDetailPage() : payload.isDetailPage;
|
|
2117
2495
|
if (isDetail()) return;
|
|
2118
2496
|
const { context, formState } = record;
|
|
2119
2497
|
const { uniqueId, formConfig } = context;
|
|
2120
2498
|
const canExecute = () => registry.get(uniqueId) === record && info.renderModeType === RenderModeEnum.FormMode && !isDetail();
|
|
2121
2499
|
const getContext = () => buildDataSourceContext({ parameters: info.paramsConfig ?? {}, instance: selfInfo });
|
|
2122
|
-
let fieldFillRuntime;
|
|
2123
2500
|
const manager = markRaw(
|
|
2124
2501
|
createDataSourceManager({
|
|
2125
2502
|
canExecute,
|
|
@@ -2161,22 +2538,27 @@ function createRuntimeDataSourceBinding(registry, payload) {
|
|
|
2161
2538
|
for (const { widget } of record.fields.allWidgets()) {
|
|
2162
2539
|
const config = widget.props;
|
|
2163
2540
|
const fieldKey = config.field;
|
|
2164
|
-
if (
|
|
2165
|
-
|
|
2541
|
+
if (fieldKey && (config.subFieldKey || !config.subModelKey)) {
|
|
2542
|
+
const key = config.subFieldKey ? `${config.subFieldKey}.${fieldKey}` : fieldKey;
|
|
2543
|
+
targets.set(key, {
|
|
2544
|
+
table: config.subFieldKey,
|
|
2166
2545
|
field: config.isFieldModel ? config.fieldLink || fieldKey : fieldKey,
|
|
2167
2546
|
isFieldModel: !!config.isFieldModel
|
|
2168
2547
|
});
|
|
2169
2548
|
if (config.componentDependency?.configDependency?.assignment?.expression) {
|
|
2170
|
-
protectedTargets.add(
|
|
2549
|
+
protectedTargets.add(key);
|
|
2171
2550
|
}
|
|
2172
2551
|
}
|
|
2173
2552
|
if (config.enableAutofill !== false) {
|
|
2174
2553
|
for (const rule of config.autofillRules ?? []) {
|
|
2175
|
-
if (
|
|
2554
|
+
if (rule.toField)
|
|
2555
|
+
protectedTargets.add(
|
|
2556
|
+
rule.toSubModel && rule.toSubFieldKey ? `${rule.toSubFieldKey}.${rule.toField}` : rule.toField
|
|
2557
|
+
);
|
|
2176
2558
|
}
|
|
2177
2559
|
}
|
|
2178
2560
|
}
|
|
2179
|
-
fieldFillRuntime = markRaw(
|
|
2561
|
+
const fieldFillRuntime = markRaw(
|
|
2180
2562
|
createFieldFillRuntime({
|
|
2181
2563
|
preserveExistingValues: true,
|
|
2182
2564
|
fills: formConfig.fieldFills ?? [],
|
|
@@ -2185,17 +2567,30 @@ function createRuntimeDataSourceBinding(registry, payload) {
|
|
|
2185
2567
|
getForm: () => formState.state,
|
|
2186
2568
|
getFormField: (key) => {
|
|
2187
2569
|
const target = targets.get(key);
|
|
2570
|
+
if (target?.table)
|
|
2571
|
+
return getFieldFillColumn(
|
|
2572
|
+
formState.state[target.table],
|
|
2573
|
+
target.isFieldModel ? `_OPCT.${target.field}` : target.field
|
|
2574
|
+
);
|
|
2188
2575
|
return target?.isFieldModel ? formState.state._OPCT?.[target.field] : get(formState.state, key);
|
|
2189
2576
|
},
|
|
2190
2577
|
hasTargetField: (key) => targets.has(key),
|
|
2191
2578
|
canWrite: (key) => canExecute() && targets.has(key) && !isFieldFillTargetProtected(key, protectedTargets, (field) => {
|
|
2192
2579
|
const target = targets.get(field);
|
|
2193
|
-
|
|
2580
|
+
const path = target?.isFieldModel ? `_OPCT.${target.field}` : target?.field ?? field;
|
|
2581
|
+
return target?.table ? `${target.table}.${path}` : path;
|
|
2194
2582
|
}),
|
|
2195
|
-
setField: (key, value) => {
|
|
2583
|
+
setField: (key, value, collection) => {
|
|
2196
2584
|
if (registry.get(uniqueId) !== record) throw new Error(`字段填充实例已释放:${uniqueId}`);
|
|
2197
2585
|
const target = targets.get(key);
|
|
2198
|
-
if (target.
|
|
2586
|
+
if (target.table) {
|
|
2587
|
+
const field = target.isFieldModel ? `_OPCT.${target.field}` : target.field;
|
|
2588
|
+
formState.setField(
|
|
2589
|
+
target.table,
|
|
2590
|
+
buildFieldFillRows(formState.state[target.table], field, value, collection),
|
|
2591
|
+
"async"
|
|
2592
|
+
);
|
|
2593
|
+
} else if (target.isFieldModel) {
|
|
2199
2594
|
if (!formState.state._OPCT) formState.setField("_OPCT", { _DICT: {} }, "async");
|
|
2200
2595
|
formState.setObjectField(
|
|
2201
2596
|
formState.state._OPCT,
|
|
@@ -2221,9 +2616,13 @@ function createRuntimeDataSourceBinding(registry, payload) {
|
|
|
2221
2616
|
throw error;
|
|
2222
2617
|
}
|
|
2223
2618
|
}
|
|
2224
|
-
const stopModeWatch = watch(
|
|
2225
|
-
|
|
2226
|
-
|
|
2619
|
+
const stopModeWatch = watch(
|
|
2620
|
+
canExecute,
|
|
2621
|
+
(enabled) => {
|
|
2622
|
+
if (enabled) void initializeOnce().catch(() => void 0);
|
|
2623
|
+
},
|
|
2624
|
+
{ flush: "sync" }
|
|
2625
|
+
);
|
|
2227
2626
|
record.dataSourceManager = exposedManager;
|
|
2228
2627
|
dataSourceManagerMap.value = { ...dataSourceManagerMap.value, [uniqueId]: exposedManager };
|
|
2229
2628
|
registry.registerDisposable(uniqueId, () => {
|
|
@@ -3199,248 +3598,250 @@ function filterAnnotationItemsUpToCurrent(items) {
|
|
|
3199
3598
|
});
|
|
3200
3599
|
}
|
|
3201
3600
|
export {
|
|
3202
|
-
|
|
3601
|
+
aQ as AITooltips,
|
|
3203
3602
|
A3 as AllocateTableCore,
|
|
3204
3603
|
B3 as BaseFormModelFetcher,
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3604
|
+
aS as BinarizeMethodOptions,
|
|
3605
|
+
b1 as BindCmpStyleEnum,
|
|
3606
|
+
a2 as BooleanShowMode,
|
|
3208
3607
|
B2 as BorderTD,
|
|
3209
3608
|
BpmnNodeTypeEnum,
|
|
3210
|
-
|
|
3211
|
-
|
|
3609
|
+
bM as BpmnSignatureTypeEnum,
|
|
3610
|
+
bN as ButtonTypeEnum,
|
|
3212
3611
|
B as BwipCodeType,
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3612
|
+
bO as CHECK_TABLE_MEDPRO_PROTOCOL_KEY,
|
|
3613
|
+
A as CellType,
|
|
3614
|
+
aj as CellWidgetViewState,
|
|
3216
3615
|
CheckDsTypeEnum,
|
|
3217
|
-
|
|
3616
|
+
bP as CodeRunner,
|
|
3218
3617
|
ComponentTypeEnum,
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3618
|
+
bQ as Config_Fields,
|
|
3619
|
+
bR as ControlStatusEnum,
|
|
3620
|
+
bi as DEVICE_GROUP_QUERY_KEY,
|
|
3621
|
+
bS as DEVICE_SEARCH_API,
|
|
3223
3622
|
aT as DateFormat,
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3623
|
+
aC as DecimalDisplayMode,
|
|
3624
|
+
aR as DenoiseMethodOptions,
|
|
3625
|
+
a82 as DeviceConnector,
|
|
3626
|
+
aO as DeviceLink,
|
|
3627
|
+
i as DeviceLinkTmplUtil,
|
|
3628
|
+
aP as DeviceParamsTypeTitle,
|
|
3230
3629
|
D as DevicePartConsumeTableCore,
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3630
|
+
bT as DeviceStatus,
|
|
3631
|
+
ak as DiagonalDirection,
|
|
3632
|
+
ao as DiagonalVertex,
|
|
3234
3633
|
_ as DocumentLayout,
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3634
|
+
a9 as DocumentLoading,
|
|
3635
|
+
P2 as DocumentPaper,
|
|
3636
|
+
aa as DynamicQuickFillModal,
|
|
3637
|
+
Q as DynamicTableAction,
|
|
3638
|
+
bU as EBR_PROVIDE_ENUM,
|
|
3639
|
+
bV as EFieldBizTypeEnum,
|
|
3241
3640
|
E as EMPTY_PRODUCT_VERSION_ID,
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3641
|
+
aI as EmptySymbol,
|
|
3642
|
+
a4 as FallbackSignTypeEnum,
|
|
3643
|
+
ai as FieldSysVarDefaultValueEnum,
|
|
3245
3644
|
FillingTypeEnum,
|
|
3246
|
-
|
|
3645
|
+
ab2 as FixedQuickFillModal,
|
|
3247
3646
|
FormAnnotationController,
|
|
3248
3647
|
F as FormModelController,
|
|
3249
3648
|
FormTmplBomController,
|
|
3250
|
-
|
|
3649
|
+
ac as FormTmplConfigController,
|
|
3251
3650
|
FormTypeEnum,
|
|
3252
|
-
|
|
3651
|
+
aD as ImageDisplayModeEnum,
|
|
3253
3652
|
InstanceStatusValues,
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3653
|
+
bW as JoinModelTypeEum,
|
|
3654
|
+
ad as LEGACY_RUNTIME_FORM_CONFIG_KEYS,
|
|
3655
|
+
ae as LEGACY_RUNTIME_SHEET_ID,
|
|
3656
|
+
af as LEGACY_RUNTIME_SHEET_TITLE,
|
|
3657
|
+
a1 as LabelPosition,
|
|
3658
|
+
am as LineDirection,
|
|
3260
3659
|
L as LineType,
|
|
3261
|
-
|
|
3660
|
+
bX as MAX_FRONT_ROW_KEY_LENGTH,
|
|
3661
|
+
M as MAX_RUNTIME_SHEETS,
|
|
3662
|
+
a as MAX_RUNTIME_SHEET_TITLE_LENGTH,
|
|
3262
3663
|
M3 as MBRender,
|
|
3263
|
-
|
|
3664
|
+
ag as MCDataUtil,
|
|
3264
3665
|
a11 as MCRender,
|
|
3265
|
-
|
|
3666
|
+
d as MULTI_SHEET_SCHEMA_VERSION,
|
|
3266
3667
|
MaterialConsumeTableController,
|
|
3267
3668
|
MaterialConsumptionPatternEnum,
|
|
3268
3669
|
M2 as MaterialRequisitionTableCore,
|
|
3269
3670
|
MaterialStatusEnum,
|
|
3270
3671
|
a10 as MaterialSubstitutionTableCore,
|
|
3271
|
-
|
|
3672
|
+
bY as MobileFillTypeEnum,
|
|
3272
3673
|
NCB_PROVIDE,
|
|
3273
|
-
|
|
3274
|
-
|
|
3674
|
+
ah as OCR_MODEL_PRECISION_ENUM_KEY,
|
|
3675
|
+
bZ as OfficeTypeEnum,
|
|
3275
3676
|
O as Orientation,
|
|
3276
|
-
|
|
3677
|
+
s as PageSizeEnum,
|
|
3277
3678
|
P as PaginationFormat,
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3679
|
+
ab as PaperSizeMap,
|
|
3680
|
+
q as PaperWidgeType,
|
|
3681
|
+
R as PaperWidgeValueType,
|
|
3682
|
+
G as ParamModelTypeEnum,
|
|
3683
|
+
P3 as PartStocktakeTableCore,
|
|
3283
3684
|
PlatformEnum,
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3685
|
+
b_ as PosEnum,
|
|
3686
|
+
b as PretreatmentListTableCore,
|
|
3687
|
+
c as ProfileDrivenSubTableCore,
|
|
3688
|
+
b$ as RUNTIME_COLUMN_ROW_KEY,
|
|
3689
|
+
ay as RangeCompareOp,
|
|
3690
|
+
RangeValidateMode,
|
|
3290
3691
|
RenderModeEnum,
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3692
|
+
ai2 as RuntimeAsyncTaskCoordinator,
|
|
3693
|
+
aj2 as RuntimeDependencyService,
|
|
3694
|
+
ak2 as RuntimeFieldRegistry,
|
|
3294
3695
|
RuntimeFormStateStore,
|
|
3295
3696
|
RuntimeInstanceController,
|
|
3296
|
-
|
|
3697
|
+
al2 as RuntimeInstanceEventBus,
|
|
3297
3698
|
RuntimeInstanceRegistry,
|
|
3298
|
-
|
|
3699
|
+
am2 as RuntimePersistenceCoordinator,
|
|
3299
3700
|
RuntimeRuleCompiler,
|
|
3300
3701
|
RuntimeSheetService,
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3702
|
+
an2 as RuntimeValidationService,
|
|
3703
|
+
a7 as SignShowTypeEnum,
|
|
3704
|
+
a3 as SignatureImageDirectionEnum,
|
|
3705
|
+
a5 as SignatureNumberTypeEnum,
|
|
3706
|
+
a6 as SignatureTimeTypeEnum,
|
|
3707
|
+
a8 as SignatureTypeEnum,
|
|
3307
3708
|
d2 as SterilizeBatchTableCore,
|
|
3308
3709
|
e2 as StocktakeTableCore,
|
|
3309
|
-
|
|
3710
|
+
ao2 as SubTableCore,
|
|
3310
3711
|
SubTableCoreFactory,
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3712
|
+
h as SubTableType,
|
|
3713
|
+
c0 as SummaryApproveHisTypeEnum,
|
|
3714
|
+
an as TimeDiffFormat,
|
|
3715
|
+
ar as ViewTypeEnum,
|
|
3315
3716
|
W as WarehouseInTableCore,
|
|
3316
|
-
|
|
3717
|
+
f as WarehouseInboundTableCore,
|
|
3317
3718
|
g as WarehouseOutTableCore,
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3719
|
+
h3 as WarehouseOutboundTableCore,
|
|
3720
|
+
al as WidgetImageSizeMode,
|
|
3721
|
+
c1 as applyCheckDsDataToRuntime,
|
|
3722
|
+
z as applyConsumeObjectTraceChange,
|
|
3723
|
+
c2 as applyMedProCheckDsDataToRuntime,
|
|
3323
3724
|
baseDataUtils,
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3725
|
+
c3 as bindRuntimeTableColumns,
|
|
3726
|
+
c4 as buildDeviceBaseQuery,
|
|
3727
|
+
bh as buildDeviceFilterQuery,
|
|
3728
|
+
ap2 as buildFormChangeDisplayRows,
|
|
3729
|
+
q2 as buildObjectLotExtraQuery,
|
|
3329
3730
|
buildRuntimeFieldPath,
|
|
3330
|
-
|
|
3331
|
-
|
|
3731
|
+
c5 as calcFillData,
|
|
3732
|
+
c6 as calcUtils,
|
|
3332
3733
|
calculateFormula,
|
|
3333
3734
|
collectAnnotationItemsByLocation,
|
|
3334
3735
|
collectFormChangeFieldLocations,
|
|
3335
3736
|
commonUtils,
|
|
3336
3737
|
convertHistoricalAnnotationLocation,
|
|
3337
|
-
|
|
3338
|
-
|
|
3738
|
+
aq as convertV1Runtime,
|
|
3739
|
+
e as createRuntimeDocumentV2,
|
|
3339
3740
|
createRuntimeInstanceContext,
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3741
|
+
c7 as decodeTableCellRowKey,
|
|
3742
|
+
ar2 as detailsHaveFormChangeRowOps,
|
|
3743
|
+
c8 as encodeTableCellRowKey,
|
|
3343
3744
|
enrichFormChangeRowDetails,
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3745
|
+
c9 as ensureFrontRowKey,
|
|
3746
|
+
ca as ensureTableRowKeys,
|
|
3747
|
+
as as extractFormChangeRowDetails,
|
|
3748
|
+
cb as extractKeywordFromQueryData,
|
|
3749
|
+
cc as fetchCheckDsDataForTable,
|
|
3750
|
+
cd as fetchCustomCheckDsData,
|
|
3350
3751
|
fetchHistoryConsume,
|
|
3351
|
-
|
|
3752
|
+
ce as fetchMedProCheckDsData,
|
|
3352
3753
|
fetchOperationReceiveQty,
|
|
3353
3754
|
fetchUdi,
|
|
3354
3755
|
filterAnnotationItemsUpToCurrent,
|
|
3355
|
-
|
|
3356
|
-
|
|
3756
|
+
bn as findRuntimeParentRow,
|
|
3757
|
+
cf as findRuntimeTableCell,
|
|
3357
3758
|
findRuntimeTableRow,
|
|
3358
3759
|
getAppInfo,
|
|
3359
3760
|
getBusinessFieldKey,
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3761
|
+
cg as getCheckTableSnapshotKey,
|
|
3762
|
+
at as getFormChangeRowKey,
|
|
3763
|
+
au as getFormChangeRowOp,
|
|
3764
|
+
a_ as getLotLockedReason,
|
|
3765
|
+
p as getObjectBomMaterialLotQuery,
|
|
3766
|
+
A2 as getObjectBomProductQuery,
|
|
3366
3767
|
getParseFormulaVarInfos,
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3768
|
+
ch as getParseRuleConfig,
|
|
3769
|
+
b2 as getParseRuleInfo,
|
|
3770
|
+
b3 as getParseRuleValue,
|
|
3771
|
+
ci as getReinspectionDate,
|
|
3772
|
+
cj as getRenderedRuntimeTableCell,
|
|
3372
3773
|
getRuntimeDataFieldId,
|
|
3373
3774
|
getRuntimeDependencyOutputKey,
|
|
3374
|
-
|
|
3775
|
+
av as getSubTableQuickFillInfo,
|
|
3375
3776
|
getSuiteKey,
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3777
|
+
ck as handleOldConfig,
|
|
3778
|
+
cl as hasAnyCheckTableSnapshot,
|
|
3779
|
+
cm as hasByTableCheckTableSnapshot,
|
|
3780
|
+
cn as hasSharedCheckTableSnapshot,
|
|
3781
|
+
aw as isAnnLocationSelected,
|
|
3782
|
+
ax as isBlank,
|
|
3382
3783
|
isBomGranted,
|
|
3383
3784
|
isEdhrSuite,
|
|
3384
3785
|
isEqmSuite,
|
|
3385
|
-
|
|
3386
|
-
|
|
3786
|
+
ay2 as isFormChangeGhostRow,
|
|
3787
|
+
co as isMedProSuite,
|
|
3387
3788
|
isRowAddedInCurrentFormChange,
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3789
|
+
cp as isTableRowKeyMatch,
|
|
3790
|
+
cq as jsonSchemaUtils,
|
|
3791
|
+
cr as judgeUnique,
|
|
3792
|
+
aZ as materialCheck,
|
|
3793
|
+
cs as migrateDiagonalDirectionToVertex,
|
|
3393
3794
|
nextFormChangeRowViewHistoryId,
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3795
|
+
j as normalizeAIOcrTmpl,
|
|
3796
|
+
C as normalizeHistoricalAutofillRow,
|
|
3797
|
+
h2 as normalizeHistoricalBusinessRow,
|
|
3798
|
+
az as normalizeHistoricalFieldConfig,
|
|
3799
|
+
b4 as normalizeRefLoaderResult,
|
|
3399
3800
|
normalizeRuntime,
|
|
3400
3801
|
parseFrontConfig,
|
|
3401
3802
|
parseRuntimeFieldPath,
|
|
3402
3803
|
parseUdi,
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3804
|
+
aA as pickObjectFieldKeys,
|
|
3805
|
+
aB as recordSubtableRowAdd,
|
|
3806
|
+
aC2 as recordSubtableRowDelete,
|
|
3807
|
+
bf as refUtils,
|
|
3808
|
+
ct as relocateDeletedRowsToEnd,
|
|
3408
3809
|
renderUtils,
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3810
|
+
cu as requestMedProCheckDsData,
|
|
3811
|
+
cv as requestNonMedProCheckDsData,
|
|
3812
|
+
aD2 as resolveAnnotationFieldLocation,
|
|
3813
|
+
ap as resolveDiagonalVertex,
|
|
3814
|
+
v as resolveFieldRenderComponent,
|
|
3815
|
+
aE as resolveFormChangeRowUi,
|
|
3816
|
+
w as resolveObjectBomEntry,
|
|
3416
3817
|
r as resolveObjectFieldKeys,
|
|
3417
|
-
|
|
3818
|
+
aF as resolveRowFormChangeMark,
|
|
3418
3819
|
resolveUdiQuery,
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3820
|
+
x as runWithFillProduct,
|
|
3821
|
+
m as setSelectAnnotationId,
|
|
3822
|
+
aG as setSelectMobileTdId,
|
|
3823
|
+
s2 as setSelectValidatorId,
|
|
3824
|
+
cw as sqlUtils,
|
|
3825
|
+
cx as stockCheck,
|
|
3826
|
+
aH as stripLegacyFormConfigFromPaper,
|
|
3426
3827
|
transformUtils,
|
|
3427
|
-
|
|
3828
|
+
H as useDependency,
|
|
3428
3829
|
useEbrWikiFactoryV2,
|
|
3429
|
-
|
|
3830
|
+
I as useFieldPresentation,
|
|
3430
3831
|
u2 as useFormModel,
|
|
3431
3832
|
u as useFormTmplConfig,
|
|
3432
3833
|
useMaterialBalance,
|
|
3433
3834
|
useNocodeEmitter,
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3835
|
+
y as useNocodeFormWidget,
|
|
3836
|
+
cy as useOnlineFormActionButton,
|
|
3837
|
+
bo as useOnlineFormTransformField2Component,
|
|
3437
3838
|
useRenderPageFactory,
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3839
|
+
J as useRuntimeEditorFlusher,
|
|
3840
|
+
l as useRuntimeInstanceServices,
|
|
3841
|
+
o as useRuntimeRowState,
|
|
3842
|
+
G2 as useStyles,
|
|
3843
|
+
k as useWidgetStaticAttrs,
|
|
3844
|
+
v2 as validateObjectBomForScan,
|
|
3444
3845
|
validateObjectBomQtyOnSubmit,
|
|
3445
|
-
|
|
3846
|
+
a$ as validateReinspectionDate
|
|
3446
3847
|
};
|