@gct-paas/excel 0.1.40-beta.0 → 0.1.40-beta.3
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-BTolXjlE.js → BaseComponent-B9o59n-h.js} +2 -2
- package/dist/{VueVideoPlayer-Dvf7Ya7H.js → VueVideoPlayer-CAWYWBHi.js} +2 -2
- package/dist/{align-editor-jp0NsOnT.js → align-editor-a4DQt4Un.js} +1 -1
- package/dist/{barcode-design-ClfdoOKn.js → barcode-design-CBqUEPYu.js} +2 -2
- package/dist/base/index.es.js +228 -150
- package/dist/{diagonal-design-Br0xpyqC.js → diagonal-design-u23896Ky.js} +2 -2
- package/dist/{dynamic-table-action-C-HIKtZG.js → dynamic-table-action-BWI4Gaqi.js} +241 -131
- package/dist/{dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BHExrYFJ.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BvrrN6te.js} +428 -282
- package/dist/{edit.utils-CXmmCnxE-D4-n_eOM.js → edit.utils-CXmmCnxE-XxpC8ALV.js} +1 -1
- package/dist/excel.css +3098 -4130
- package/dist/{exceljs.min-BH63KI8s.js → exceljs.min-DfbB110X.js} +2 -2
- package/dist/{font-editor-QSpu9bjJ.js → font-editor-BtSCLMrM.js} +3 -3
- package/dist/{image-design-ySQAmnTF.js → image-design-CtE-Lw7N.js} +2 -2
- package/dist/{index-CTO4kNz9.js → index-3WwCV4xR.js} +1 -1
- package/dist/{index-CvDQjwre.js → index-51LtNdZ2.js} +1 -1
- package/dist/{index-DZGqXE3S.js → index-731OYkrc.js} +3 -3
- package/dist/{index-DYxskDRv.js → index-7aS5L4ot.js} +3 -3
- package/dist/{index-CMOvPSr6.js → index-9S48hpoJ.js} +2 -2
- package/dist/{index-C2RMbM6E.js → index-B0cdcIWq.js} +2 -2
- package/dist/{index-4_qe7Eco.js → index-BC8hQ4vo.js} +2 -2
- package/dist/{index-ibQys99q.js → index-BFg5eUdY.js} +1 -1
- package/dist/{index-CN-rY-3F.js → index-BGAcYDx-.js} +1 -1
- package/dist/{index-B6Bs-q34.js → index-BKXb3VJc.js} +2 -2
- package/dist/{index-BXXvFDgt.js → index-BMoz_QhA.js} +1 -1
- package/dist/{index-Cf7KwZfa.js → index-BP-LhXXV.js} +4 -4
- package/dist/{index-BxEjRF0o.js → index-BRQkrFQ9.js} +2 -2
- package/dist/{index-CUrMIr2v.js → index-Bc61F6Hm.js} +2 -2
- package/dist/{index-COx1-SPe.js → index-BfBuxgcp.js} +2 -2
- package/dist/{index-Qf8D5LdT.js → index-Bnb70qEi.js} +3 -3
- package/dist/{index-BOaDYNtp.js → index-CAdDeEzJ.js} +2 -2
- package/dist/{index-BHiNdrGr.js → index-CIa37rQm.js} +2 -2
- package/dist/{index-QTmeSdj9.js → index-CL9K9orM.js} +2 -2
- package/dist/{index-8yhxxqYM.js → index-CPTGioxl.js} +1 -1
- package/dist/{index-FSCxAVGq.js → index-CVsoaxTR.js} +2 -2
- package/dist/{index-dhaw5vxN.js → index-CYLAVQfT.js} +3 -3
- package/dist/{index-Cb-I6DkL.js → index-Ca9TLzUh.js} +1 -1
- package/dist/{index-B3mCVcXB.js → index-CdHVHaxO.js} +2 -2
- package/dist/{index-2FWN7Q91.js → index-CeEhYXl9.js} +2 -2
- package/dist/{index-C7DwXZ-K.js → index-CpPk8P3L.js} +1 -1
- package/dist/{index-nBc_3R3r.js → index-DNj0vFvx.js} +1 -1
- package/dist/{index-DbPA5PUX.js → index-DVEe11uM.js} +1 -1
- package/dist/{index-BJ6ZaX-f.js → index-DdWefZMa.js} +2 -2
- package/dist/{index-uVpJOLb3.js → index-DeHX7rte.js} +5 -4
- package/dist/{index-D9zBCWpE.js → index-Dyomjz3y.js} +2 -2
- package/dist/{index-D3IdoYWe.js → index-I1r5pfu5.js} +2 -2
- package/dist/{index-BJQd1G0r.js → index-IVc1dOet.js} +3 -3
- package/dist/{index-Ca8q7yXC.js → index-aNV9T6LI.js} +2 -2
- package/dist/{index-oOLbaFI8.js → index-ixQwAcB1.js} +18201 -20494
- package/dist/index.es.js +2 -2
- package/dist/{mb-render-BRejJNP-.js → mb-render-Bs9S9oFn.js} +2 -2
- package/dist/{online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-QX4lxsni.js → online-form-model-select.vue_vue_type_script_setup_true_name_online-form-model-select_lang-CRyGHP7k.js} +1 -1
- package/dist/{pagination-design-pTh3Fqbz.js → pagination-design-CmbsdlMe.js} +2 -2
- package/dist/paper-widget-design-DIhsk1I9.js +4 -0
- package/dist/{print-runtime-instance-CBUjws4D.js → print-runtime-instance-DQysbz5n.js} +1 -1
- package/dist/{print-snapshot-renderer-s0IhY_T_.js → print-snapshot-renderer-DWHjMsOC.js} +3 -3
- package/dist/{qrcode-design-CnKOb-s9.js → qrcode-design-CX0_2mLC.js} +1 -1
- package/dist/{revo-grid.entry-BqbaKcyR.js → revo-grid.entry-DbmWFi7p.js} +1 -1
- package/dist/{revogr-attribution_7.entry-jmN78nkb.js → revogr-attribution_7.entry-BWQDu7fq.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-eK74i7_f.js → revogr-clipboard_3.entry-BtTYHFZi.js} +2 -2
- package/dist/{revogr-data_4.entry-D2lAUBEM.js → revogr-data_4.entry-CWPXyZ7g.js} +2 -2
- package/dist/{revogr-filter-panel.entry-C-1WXBDy.js → revogr-filter-panel.entry-5gYct0XI.js} +1 -1
- package/dist/seal-design-BhzgwVju.js +4 -0
- package/dist/{serialnumber-design-DEYD9ku_.js → serialnumber-design-aSqL4gX6.js} +1 -1
- package/dist/shared/index.es.js +9 -9
- package/dist/{single-field-drop-Bd3PcWQF.js → single-field-drop-C67wLHxK.js} +2 -2
- package/dist/{size-editor-DiZ8E2R6.js → size-editor-BHGTPLir.js} +1 -1
- package/dist/src/domain/table/business/material/material-substitution/profile/field-keys.d.ts +21 -0
- package/dist/src/domain/table/business/material/material-substitution/runtime/row-change-handlers.d.ts +3 -0
- package/dist/src/domain/table/business/sterilize/entrust-steril-batch-list/profile/field-keys.d.ts +2 -0
- 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 +2 -2
- package/dist/src/nocode-base/src/core/sub-table/utils/sterilize/field-keys.d.ts +1 -2
- package/dist/src/nocode-base/src/hooks/formula-params-cache.d.ts +15 -0
- package/dist/src/nocode-base/src/hooks/render-page/sterilization-date.d.ts +3 -0
- package/dist/src/nocode-base/src/hooks/useCalcFunction.d.ts +8 -2
- 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 +1 -1
- package/dist/src/nocode-base/src/runtime/runtime-form-state-store.d.ts +6 -0
- package/dist/src/nocode-base/src/runtime/runtime-validation-service.d.ts +1 -0
- package/dist/src/nocode-base/src/runtime/table-row-identity.d.ts +11 -2
- package/dist/src/nocode-base/src/types/fields/i-sign.d.ts +1 -1
- package/dist/src/nocode-base/src/types/render/mc-render.d.ts +1 -1
- 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/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/DoubleInput/double-input.vue.d.ts +162 -2
- package/dist/src/shared/components/LimitedNumberInput/limited-number-input.vue.d.ts +41 -0
- package/dist/src/shared/components/LimitedNumberInput/number-input-rules.d.ts +16 -0
- package/dist/src/shared/components/Signature/logic/index.d.ts +1 -1
- package/dist/{sub-table-factory-B6HdlZ7-.js → sub-table-factory-DTtDvr17.js} +34 -19
- package/dist/{text-design-D2IwsbOW.js → text-design-Dz0Qf2O3.js} +2 -2
- package/dist/{throttle-Cpk1LoGk-DRpYOKiV.js → throttle-Cpk1LoGk-CgtsG2CV.js} +1 -1
- package/dist/{timediff-design-Cq3SADlb.js → timediff-design-D9JfNqH8.js} +1 -1
- package/dist/{trace-like-wrapper-Qmczl-Hz.js → trace-like-wrapper-BXgr0Uv3.js} +2 -2
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-UXPOa0Wv.js → value-editor.vue_vue_type_style_index_0_lang-doohzADY.js} +2 -2
- package/dist/web-render/index.es.js +3 -3
- package/dist/{widget-barcode-C7wO0SFO.js → widget-barcode-XF3nCU9v.js} +4 -4
- package/dist/{widget-diagonal-Cbuv8o5A.js → widget-diagonal-DSym7fks.js} +3 -3
- package/dist/{widget-image-4AeqjwGp.js → widget-image-CmjwkVs7.js} +5 -5
- package/dist/{widget-line--RgXiyvO.js → widget-line-BX64xVfU.js} +2 -2
- package/dist/{widget-pagination-jr6bVWPW.js → widget-pagination-BV89Lvjt.js} +5 -5
- package/dist/{widget-power-ptilZfAF.js → widget-power-DoSfQv92.js} +3 -3
- package/dist/{widget-qrcode-DH-1741M.js → widget-qrcode-UGcRLC56.js} +3 -3
- package/dist/{widget-rangelimit-B4yv3Qw3.js → widget-rangelimit-CUHD__1H.js} +3 -3
- package/dist/{widget-serialnumber-AZ2IUJTg.js → widget-serialnumber-CAkZR5Xl.js} +1 -1
- package/dist/{widget-text-CW0A1n16.js → widget-text-DtYVTThu.js} +5 -5
- package/dist/{widget-timediff-C3xTGqfj.js → widget-timediff-DX_IoCMO.js} +2 -2
- package/package.json +2 -2
- package/dist/paper-widget-design-CBI-8vTV.js +0 -4
- package/dist/seal-design-CMJBAfIN.js +0 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { reactive, toRaw, computed, watch, onScopeDispose, inject, h, shallowReactive, markRaw, ref, nextTick, toRef, provide, defineComponent, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, renderSlot, createCommentVNode, createVNode, toDisplayString, Fragment, renderList, onUnmounted, isVNode, onMounted, onBeforeMount, resolveComponent, createBlock, withCtx, createTextVNode } from "vue";
|
|
2
|
-
import { ai as CellWidgetViewState, F as FIELD_TYPE,
|
|
2
|
+
import { ai as CellWidgetViewState, F as FIELD_TYPE, b6 as RenderModeEnum, Y as FormTypeEnum, bC as BpmnNodeTypeEnum, cv as getFieldPlaceholder, bU as MobileFillTypeEnum, C as ComponentTypeEnum, $ as PlatformEnum, cw as isReferenceOptionActive, o as api, bs as uuid2, c2 as calcUtils, bh as findRuntimeTableRow, c6 as ensureTableRowKeys, b$ as bindRuntimeTableColumns, bg as getRowId, cx as FRONT_ROW_KEY, cl as isTableRowKeyMatch, bu as isAttachFieldActive, cy as filterRulesByTrigger, cz as isEmptyValue$1, c3 as decodeTableCellRowKey, c5 as ensureFrontRowKey, a_ as getParseRuleInfo, aF as transformUtils, aW as materialCheck, aX as getLotLockedReason, aY as validateReinspectionDate, bl as FormulaRuleFieldKeyEnum, f as SubTableType, a$ as getParseRuleValue, cA as buildError, H as CreateType, bj as findRuntimeParentRow, aI as Dependency_ENUM, aH as ASSIGNMENTSTRATEGY_ENUM, bH as commonUtils, aM as DeviceLink, a8 as _export_sfc, cf as getRenderedRuntimeTableCell, z as CellType, cp as relocateDeletedRowsToEnd, cB as resetTableRowIdentity, J as useModal, cC as q, cD as QUICK_FILL_ALLOWED_FIELDS, cE as groupFixedTableRows, cF as processQuickFillRows, cG as getIsGroupEmpty } from "./dynamic-table-action.vue_vue_type_style_index_0_scoped_53d7e66c_lang-BvrrN6te.js";
|
|
3
3
|
import { cloneDeep, isEmpty, has, pickBy, isNil, mergeWith, omit, last, pick, merge } from "lodash-es";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
5
|
import { a as useNamespace, I as Icon } from "./AntdIcon-DCIaV352.js";
|
|
6
6
|
import "@gct-paas/form-base";
|
|
7
7
|
import { Modal, message } from "ant-design-vue";
|
|
8
|
-
import { u as useFormModel } from "./mb-render-
|
|
8
|
+
import { u as useFormModel } from "./mb-render-Bs9S9oFn.js";
|
|
9
9
|
var MaterialConsumptionPatternEnum = /* @__PURE__ */ ((MaterialConsumptionPatternEnum2) => {
|
|
10
10
|
MaterialConsumptionPatternEnum2["RECORD"] = "record";
|
|
11
11
|
MaterialConsumptionPatternEnum2["BOM"] = "bom";
|
|
@@ -958,6 +958,8 @@ function convertV1Runtime(runtime) {
|
|
|
958
958
|
return { schemaVersion: 1, formConfig, sheets: [sheet] };
|
|
959
959
|
}
|
|
960
960
|
const MULTI_SHEET_SCHEMA_VERSION = 2;
|
|
961
|
+
const MAX_RUNTIME_SHEETS = 100;
|
|
962
|
+
const MAX_RUNTIME_SHEET_TITLE_LENGTH = 255;
|
|
961
963
|
function assertObject(value, message2) {
|
|
962
964
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(message2);
|
|
963
965
|
}
|
|
@@ -1023,7 +1025,9 @@ function normalizeRuntime(runtime) {
|
|
|
1023
1025
|
if (!Array.isArray(runtime.sheets) || runtime.sheets.length === 0) {
|
|
1024
1026
|
throw new Error("多 Sheet 运行时至少需要一个工作表");
|
|
1025
1027
|
}
|
|
1026
|
-
if (runtime.sheets.length >
|
|
1028
|
+
if (runtime.sheets.length > MAX_RUNTIME_SHEETS) {
|
|
1029
|
+
throw new Error(`每份表单最多支持 ${MAX_RUNTIME_SHEETS} 个工作表`);
|
|
1030
|
+
}
|
|
1027
1031
|
const formConfig = runtime.formConfig ?? {};
|
|
1028
1032
|
assertObject(formConfig, "多 Sheet 运行时的 formConfig 格式无效");
|
|
1029
1033
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -1034,7 +1038,9 @@ function normalizeRuntime(runtime) {
|
|
|
1034
1038
|
const sheetId = String(rawSheet.sheetId ?? "").trim();
|
|
1035
1039
|
const title = String(rawSheet.title ?? "").trim();
|
|
1036
1040
|
if (!sheetId) throw new Error(`第 ${index + 1} 个工作表缺少 sheetId`);
|
|
1037
|
-
if (!title || title.length >
|
|
1041
|
+
if (!title || title.length > MAX_RUNTIME_SHEET_TITLE_LENGTH) {
|
|
1042
|
+
throw new Error(`工作表名称必须为 1 到 ${MAX_RUNTIME_SHEET_TITLE_LENGTH} 个字符:${title}`);
|
|
1043
|
+
}
|
|
1038
1044
|
if (ids.has(sheetId)) throw new Error(`重复的 sheetId:${sheetId}`);
|
|
1039
1045
|
if (titles.has(title)) throw new Error(`重复的工作表名称:${title}`);
|
|
1040
1046
|
ids.add(sheetId);
|
|
@@ -1605,6 +1611,14 @@ class RuntimeFormStateStore {
|
|
|
1605
1611
|
const paths = Object.keys(values);
|
|
1606
1612
|
this.mutate(paths, source, () => this.assignValues(this.reactiveState, values));
|
|
1607
1613
|
}
|
|
1614
|
+
/**
|
|
1615
|
+
* 保存后只回填后端身份元数据,不能用仅含 id_/front_row_key_ 的数组覆盖当前业务行。
|
|
1616
|
+
* 二维内置复合键可通过原始子行键匹配保存前的本地行。
|
|
1617
|
+
*/
|
|
1618
|
+
patchSavedMetadata(values) {
|
|
1619
|
+
const paths = Object.keys(values);
|
|
1620
|
+
this.mutate(paths, "restore", () => this.mergeSavedMetadata(this.reactiveState, values));
|
|
1621
|
+
}
|
|
1608
1622
|
/**
|
|
1609
1623
|
* 用新对象整体替换实例数据,删除旧对象中多余的顶层字段。
|
|
1610
1624
|
* 草稿/接口恢复后会清空用户修改标记;restore 来源同时恢复为非脏状态。
|
|
@@ -1716,6 +1730,46 @@ class RuntimeFormStateStore {
|
|
|
1716
1730
|
target[key] = incoming;
|
|
1717
1731
|
});
|
|
1718
1732
|
}
|
|
1733
|
+
mergeSavedMetadata(target, incoming, path = "") {
|
|
1734
|
+
if (Array.isArray(incoming)) {
|
|
1735
|
+
const isTableRows = this.subtableFields.has(path) || path.endsWith("._2DTABLE_");
|
|
1736
|
+
if (!isTableRows || !Array.isArray(target)) return incoming;
|
|
1737
|
+
incoming.forEach((savedRow) => {
|
|
1738
|
+
const rowKey = savedRow?.[FRONT_ROW_KEY];
|
|
1739
|
+
const savedId = savedRow?.id_;
|
|
1740
|
+
let currentRow = target.find((row) => {
|
|
1741
|
+
if (!row || typeof row !== "object") return false;
|
|
1742
|
+
if (rowKey != null && isTableRowKeyMatch(rowKey, row[FRONT_ROW_KEY])) return true;
|
|
1743
|
+
return savedId != null && row.id_ != null && String(row.id_) === String(savedId);
|
|
1744
|
+
});
|
|
1745
|
+
let matchedByGroup = false;
|
|
1746
|
+
if (!currentRow && Array.isArray(savedRow?._2DTABLE_) && savedRow.group_ != null && String(savedRow.group_).trim() !== "") {
|
|
1747
|
+
const matchingGroups = target.filter(
|
|
1748
|
+
(row) => Array.isArray(row?._2DTABLE_) && row.group_ != null && String(row.group_) === String(savedRow.group_)
|
|
1749
|
+
);
|
|
1750
|
+
if (matchingGroups.length === 1) {
|
|
1751
|
+
currentRow = matchingGroups[0];
|
|
1752
|
+
matchedByGroup = true;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
if (currentRow) {
|
|
1756
|
+
this.mergeSavedMetadata(
|
|
1757
|
+
currentRow,
|
|
1758
|
+
matchedByGroup ? { ...savedRow, [FRONT_ROW_KEY]: currentRow[FRONT_ROW_KEY] } : savedRow,
|
|
1759
|
+
path
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1762
|
+
});
|
|
1763
|
+
return target;
|
|
1764
|
+
}
|
|
1765
|
+
if (!incoming || typeof incoming !== "object") return incoming;
|
|
1766
|
+
if (!target || typeof target !== "object" || Array.isArray(target)) return incoming;
|
|
1767
|
+
Object.entries(incoming).forEach(([key, value]) => {
|
|
1768
|
+
const childPath = path ? `${path}.${key}` : key;
|
|
1769
|
+
target[key] = this.mergeSavedMetadata(target[key], value, childPath);
|
|
1770
|
+
});
|
|
1771
|
+
return target;
|
|
1772
|
+
}
|
|
1719
1773
|
/**
|
|
1720
1774
|
* 所有写入口共用的表格身份边界:整表恢复/回填、数组插入、二维子行替换均在通知前补齐。
|
|
1721
1775
|
* 只处理业务索引声明的表格及 _2DTABLE_,不把多选值、上传文件等数组当作表格。
|
|
@@ -1800,6 +1854,7 @@ class RuntimeAsyncTaskCoordinator {
|
|
|
1800
1854
|
fieldIdentity: options.fieldIdentity,
|
|
1801
1855
|
sheetId: options.sheetId,
|
|
1802
1856
|
required: options.required !== false,
|
|
1857
|
+
blockOnFailure: options.blockOnFailure !== false,
|
|
1803
1858
|
status: "pending",
|
|
1804
1859
|
sequence,
|
|
1805
1860
|
promise: task,
|
|
@@ -1843,7 +1898,7 @@ class RuntimeAsyncTaskCoordinator {
|
|
|
1843
1898
|
* 等待全部 required 任务达到稳定状态。
|
|
1844
1899
|
*
|
|
1845
1900
|
* 一轮任务完成后的字段回填可能触发新的公式或远程任务,因此这里循环读取任务表,直到
|
|
1846
|
-
* 没有新的 pending required
|
|
1901
|
+
* 没有新的 pending required 任务。稳定后只检查需要阻断提交的失败项。
|
|
1847
1902
|
*/
|
|
1848
1903
|
async waitForRequired(keyPrefix) {
|
|
1849
1904
|
const matches = (task) => task.required && (!keyPrefix || task.key.startsWith(keyPrefix));
|
|
@@ -1855,7 +1910,7 @@ class RuntimeAsyncTaskCoordinator {
|
|
|
1855
1910
|
await Promise.allSettled(pending.map((task) => task.promise));
|
|
1856
1911
|
}
|
|
1857
1912
|
const failed = Array.from(this.tasks.values()).filter(
|
|
1858
|
-
(task) => matches(task) && task.status === "rejected"
|
|
1913
|
+
(task) => matches(task) && task.blockOnFailure && task.status === "rejected"
|
|
1859
1914
|
);
|
|
1860
1915
|
if (failed.length) {
|
|
1861
1916
|
const details = failed.map((task) => {
|
|
@@ -3201,11 +3256,12 @@ class RuntimeValidationService {
|
|
|
3201
3256
|
this.pendingLive = this.pendingLive === "blur" ? "blur" : trigger;
|
|
3202
3257
|
if (this.liveTimer) clearTimeout(this.liveTimer);
|
|
3203
3258
|
this.liveTimer = void 0;
|
|
3204
|
-
if (immediate)
|
|
3259
|
+
if (immediate)
|
|
3260
|
+
void this.flushLive().catch((error) => this.logBackgroundError("字段校验失败", error));
|
|
3205
3261
|
else
|
|
3206
3262
|
this.liveTimer = setTimeout(() => {
|
|
3207
3263
|
this.liveTimer = void 0;
|
|
3208
|
-
void this.flushLive().catch((error) =>
|
|
3264
|
+
void this.flushLive().catch((error) => this.logBackgroundError("字段校验失败", error));
|
|
3209
3265
|
}, 300);
|
|
3210
3266
|
}
|
|
3211
3267
|
async flushLive() {
|
|
@@ -3227,11 +3283,17 @@ class RuntimeValidationService {
|
|
|
3227
3283
|
this.displayTimer = void 0;
|
|
3228
3284
|
const run = () => {
|
|
3229
3285
|
this.displayTimer = void 0;
|
|
3230
|
-
void this.validate("display").catch(
|
|
3286
|
+
void this.validate("display").catch(
|
|
3287
|
+
(error) => this.logBackgroundError("字段展示校验失败", error)
|
|
3288
|
+
);
|
|
3231
3289
|
};
|
|
3232
3290
|
if (immediate) run();
|
|
3233
3291
|
else this.displayTimer = setTimeout(run, 320);
|
|
3234
3292
|
}
|
|
3293
|
+
logBackgroundError(label, error) {
|
|
3294
|
+
if (error instanceof Error && error.message.startsWith("以下异步任务执行失败:")) return;
|
|
3295
|
+
console.error(label, error);
|
|
3296
|
+
}
|
|
3235
3297
|
pruneComments() {
|
|
3236
3298
|
if (!this.binding || this.disposed) return;
|
|
3237
3299
|
this.binding.applyComments(
|
|
@@ -3827,8 +3889,10 @@ const SNAPSHOT_SKIP = /* @__PURE__ */ new Set([
|
|
|
3827
3889
|
]);
|
|
3828
3890
|
function rowIdentityKeys(row) {
|
|
3829
3891
|
if (!row) return [];
|
|
3892
|
+
const frontRowKey = row[FRONT_ROW_KEY] != null && String(row[FRONT_ROW_KEY]).trim() !== "" ? String(row[FRONT_ROW_KEY]) : void 0;
|
|
3830
3893
|
return [
|
|
3831
|
-
|
|
3894
|
+
frontRowKey,
|
|
3895
|
+
decodeTableCellRowKey(frontRowKey)?.cellRowKey,
|
|
3832
3896
|
row.id_ != null && row.id_ !== "" ? String(row.id_) : void 0
|
|
3833
3897
|
].filter(Boolean);
|
|
3834
3898
|
}
|
|
@@ -4562,7 +4626,16 @@ class BomEntriesValidator {
|
|
|
4562
4626
|
memberIndexes.push(idx);
|
|
4563
4627
|
if (byLot && !row.material_no_) emptyLotIndexes.push(idx);
|
|
4564
4628
|
});
|
|
4565
|
-
const
|
|
4629
|
+
const targetExists = this.groupExistsInTable(arr, target);
|
|
4630
|
+
if (!targetExists) {
|
|
4631
|
+
const index = arr.findIndex((row2) => !row2.deleted_);
|
|
4632
|
+
const row = arr[index];
|
|
4633
|
+
const canReuse = row && !row.product_id_ && !row.bom_entry_id_ && !row.is_confirmed_ && arr.every((item, idx) => item.deleted_ || idx === index);
|
|
4634
|
+
if (canReuse) {
|
|
4635
|
+
emptyProductIndexes.push(index);
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4638
|
+
const needInsert = !targetExists && emptyProductIndexes.length === 0;
|
|
4566
4639
|
const last2 = memberIndexes[memberIndexes.length - 1];
|
|
4567
4640
|
let groupInsertIndex = -1;
|
|
4568
4641
|
if (needInsert) {
|
|
@@ -6680,37 +6753,71 @@ class SubTableCore {
|
|
|
6680
6753
|
console.log(this.ctx.widget.props.tableTitle, "处理表单按钮点击事件", params);
|
|
6681
6754
|
}
|
|
6682
6755
|
}
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6756
|
+
const STORAGE_KEY = "gct:formula:params:v1";
|
|
6757
|
+
const PARAMS_CHANGED_EVENT = "gct:formula-params-updated:v1";
|
|
6758
|
+
function emptyConfig() {
|
|
6759
|
+
return {
|
|
6760
|
+
routingParamList: [],
|
|
6761
|
+
inspectionParamList: [],
|
|
6762
|
+
deviceParamList: []
|
|
6763
|
+
};
|
|
6689
6764
|
}
|
|
6690
|
-
|
|
6691
|
-
if (!
|
|
6692
|
-
|
|
6765
|
+
function normalizeList(value) {
|
|
6766
|
+
if (!Array.isArray(value)) return [];
|
|
6767
|
+
return value.filter(
|
|
6768
|
+
(item) => item !== null && typeof item === "object" && typeof item.customFieldKey === "string"
|
|
6769
|
+
);
|
|
6770
|
+
}
|
|
6771
|
+
function normalizeConfig(value) {
|
|
6772
|
+
const data = value !== null && typeof value === "object" ? value : {};
|
|
6773
|
+
return {
|
|
6774
|
+
routingParamList: normalizeList(data.routingParamList),
|
|
6775
|
+
inspectionParamList: normalizeList(data.inspectionParamList),
|
|
6776
|
+
deviceParamList: normalizeList(data.deviceParamList)
|
|
6777
|
+
};
|
|
6778
|
+
}
|
|
6779
|
+
let lastRaw;
|
|
6780
|
+
let cachedConfig = emptyConfig();
|
|
6781
|
+
function readFormulaParamsConfig() {
|
|
6782
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
6783
|
+
if (raw !== lastRaw) {
|
|
6784
|
+
try {
|
|
6785
|
+
cachedConfig = normalizeConfig(raw ? JSON.parse(raw) : null);
|
|
6786
|
+
} catch {
|
|
6787
|
+
cachedConfig = emptyConfig();
|
|
6788
|
+
}
|
|
6789
|
+
lastRaw = raw;
|
|
6790
|
+
}
|
|
6791
|
+
return cachedConfig;
|
|
6792
|
+
}
|
|
6793
|
+
const currentParamsConfig = {
|
|
6794
|
+
get routingParamList() {
|
|
6795
|
+
return readFormulaParamsConfig().routingParamList;
|
|
6796
|
+
},
|
|
6797
|
+
get inspectionParamList() {
|
|
6798
|
+
return readFormulaParamsConfig().inspectionParamList;
|
|
6693
6799
|
}
|
|
6694
|
-
const config = paramList?.find((e) => e.customFieldKey === key);
|
|
6695
|
-
if (!config) return null;
|
|
6696
|
-
const { upperLimit, lowerLimit } = config;
|
|
6697
|
-
if (lowerLimit == null || upperLimit == null) return null;
|
|
6698
|
-
const actual = Number(value);
|
|
6699
|
-
const min = Number(config.lowerLimit);
|
|
6700
|
-
const max = Number(config.upperLimit);
|
|
6701
|
-
if (![actual, min, max].every(Number.isFinite)) return null;
|
|
6702
|
-
return actual >= min && actual <= max;
|
|
6703
|
-
}
|
|
6704
|
-
const FORMULA_FUNCS = {
|
|
6705
|
-
RoutingParamCheck: (key, value) => CALC_IS_QUALIFIED(key, value, currentParamsConfig.routingParamList || []),
|
|
6706
|
-
InspectionParamCheck: (key, value) => CALC_IS_QUALIFIED(key, value, currentParamsConfig.inspectionParamList || [])
|
|
6707
6800
|
};
|
|
6708
|
-
function
|
|
6709
|
-
const
|
|
6710
|
-
if (
|
|
6711
|
-
|
|
6712
|
-
|
|
6801
|
+
function setFormulaParamsConfig(paramsConfig = {}) {
|
|
6802
|
+
const raw = JSON.stringify(normalizeConfig(paramsConfig));
|
|
6803
|
+
if (window.localStorage.getItem(STORAGE_KEY) === raw) return;
|
|
6804
|
+
window.localStorage.setItem(STORAGE_KEY, raw);
|
|
6805
|
+
window.dispatchEvent(new Event(PARAMS_CHANGED_EVENT));
|
|
6806
|
+
}
|
|
6807
|
+
const boundCalculators = /* @__PURE__ */ new WeakSet();
|
|
6808
|
+
function bindFormulaCacheInvalidation(value) {
|
|
6809
|
+
if (typeof value !== "function") return;
|
|
6810
|
+
const calculator = value;
|
|
6811
|
+
if (typeof calculator.clear !== "function" || boundCalculators.has(calculator)) return;
|
|
6812
|
+
boundCalculators.add(calculator);
|
|
6813
|
+
const clearCache = () => calculator.clear();
|
|
6814
|
+
window.addEventListener(PARAMS_CHANGED_EVENT, clearCache);
|
|
6815
|
+
window.addEventListener("storage", (event) => {
|
|
6816
|
+
if (event.storageArea === window.localStorage && (event.key === STORAGE_KEY || event.key === null)) {
|
|
6817
|
+
clearCache();
|
|
6818
|
+
}
|
|
6713
6819
|
});
|
|
6820
|
+
clearCache();
|
|
6714
6821
|
}
|
|
6715
6822
|
function getGroupProductIds(entry) {
|
|
6716
6823
|
const ids = [entry.product_id_];
|
|
@@ -8710,7 +8817,7 @@ const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
|
8710
8817
|
const {
|
|
8711
8818
|
showDisplayStatus,
|
|
8712
8819
|
dataRelationShip
|
|
8713
|
-
} = useWidgetStaticAttrs(props);
|
|
8820
|
+
} = useWidgetStaticAttrs(props.widget);
|
|
8714
8821
|
const sheetId = () => fields.value?.findWidgetById(props.widget.id)?.sheetId;
|
|
8715
8822
|
const formModelController = useFormModel().injectController();
|
|
8716
8823
|
const tableController = props.tableController;
|
|
@@ -10243,109 +10350,112 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10243
10350
|
});
|
|
10244
10351
|
const DynamicTableAction = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-53d7e66c"]]);
|
|
10245
10352
|
export {
|
|
10246
|
-
|
|
10247
|
-
|
|
10353
|
+
normalizeRuntime as $,
|
|
10354
|
+
normalizeHistoricalAutofillRow as A,
|
|
10248
10355
|
BorderTD as B,
|
|
10249
|
-
|
|
10356
|
+
parseRuntimeFieldPath as C,
|
|
10250
10357
|
DEFAULT_BOOLEAN_FIELD_WIDTH as D,
|
|
10251
10358
|
EMPTY_PRODUCT_VERSION_ID as E,
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10359
|
+
useStyles as F,
|
|
10360
|
+
useDependency as G,
|
|
10361
|
+
useFieldPresentation as H,
|
|
10362
|
+
useRuntimeEditorFlusher as I,
|
|
10363
|
+
createRuntimeInstanceContext as J,
|
|
10364
|
+
RuntimeInstanceRegistry as K,
|
|
10365
|
+
RequiredQtyCalcRule as L,
|
|
10366
|
+
MAX_RUNTIME_SHEETS as M,
|
|
10260
10367
|
NCB_PROVIDE as N,
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10368
|
+
DocumentPaper as O,
|
|
10369
|
+
DynamicTableAction as P,
|
|
10370
|
+
getRuntimeDataFieldId as Q,
|
|
10264
10371
|
RuntimeFormStateStore as R,
|
|
10265
10372
|
ScanParamType as S,
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10373
|
+
buildRuntimeFieldPath as T,
|
|
10374
|
+
resolveRuntimeFieldProps as U,
|
|
10375
|
+
resolveRuntimeFieldState as V,
|
|
10376
|
+
getRuntimeDependencyOutputKey as W,
|
|
10377
|
+
isRowAddedInCurrentFormChange as X,
|
|
10378
|
+
MaterialConsumeTableController as Y,
|
|
10379
|
+
setFormulaParamsConfig as Z,
|
|
10273
10380
|
_sfc_main$5 as _,
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10321
|
-
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10381
|
+
MAX_RUNTIME_SHEET_TITLE_LENGTH as a,
|
|
10382
|
+
RuntimeSheetService as a0,
|
|
10383
|
+
validateObjectBomQtyOnSubmit as a1,
|
|
10384
|
+
closeValidatorPopovers as a2,
|
|
10385
|
+
enrichFormChangeRowDetails as a3,
|
|
10386
|
+
useMaterialBalance as a4,
|
|
10387
|
+
collectFormChangeFieldLocations as a5,
|
|
10388
|
+
nextFormChangeRowViewHistoryId as a6,
|
|
10389
|
+
DeviceConnector as a7,
|
|
10390
|
+
DocumentLoading as a8,
|
|
10391
|
+
DynamicQuickFillModal as a9,
|
|
10392
|
+
recordSubtableRowAdd as aA,
|
|
10393
|
+
recordSubtableRowDelete as aB,
|
|
10394
|
+
resolveAnnotationFieldLocation as aC,
|
|
10395
|
+
resolveFormChangeRowUi as aD,
|
|
10396
|
+
resolveRowFormChangeMark as aE,
|
|
10397
|
+
setSelectMobileTdId as aF,
|
|
10398
|
+
stripLegacyFormConfigFromPaper as aG,
|
|
10399
|
+
SubTableActionMenuTypeEnum as aH,
|
|
10400
|
+
getMenuByAction as aI,
|
|
10401
|
+
SubTableActionEnum as aJ,
|
|
10402
|
+
resolveScanFillData as aK,
|
|
10403
|
+
getInsertSubMenu as aL,
|
|
10404
|
+
resolveScanAdjustType as aM,
|
|
10405
|
+
resolveScanQty as aN,
|
|
10406
|
+
toDateOnly as aO,
|
|
10407
|
+
getCopySubMenu as aP,
|
|
10408
|
+
resolveScanParsedValue as aQ,
|
|
10409
|
+
isProductBatchEmptyRow as aR,
|
|
10410
|
+
FixedQuickFillModal as aa,
|
|
10411
|
+
FormTmplConfigController as ab,
|
|
10412
|
+
LEGACY_RUNTIME_FORM_CONFIG_KEYS as ac,
|
|
10413
|
+
LEGACY_RUNTIME_SHEET_ID as ad,
|
|
10414
|
+
LEGACY_RUNTIME_SHEET_TITLE as ae,
|
|
10415
|
+
MCDataUtil as af,
|
|
10416
|
+
OCR_MODEL_PRECISION_ENUM_KEY as ag,
|
|
10417
|
+
RuntimeAsyncTaskCoordinator as ah,
|
|
10418
|
+
RuntimeDependencyService as ai,
|
|
10419
|
+
RuntimeFieldRegistry as aj,
|
|
10420
|
+
RuntimeInstanceEventBus as ak,
|
|
10421
|
+
RuntimePersistenceCoordinator as al,
|
|
10422
|
+
RuntimeValidationService as am,
|
|
10423
|
+
SubTableCore as an,
|
|
10424
|
+
buildFormChangeDisplayRows as ao,
|
|
10425
|
+
convertV1Runtime as ap,
|
|
10426
|
+
detailsHaveFormChangeRowOps as aq,
|
|
10427
|
+
extractFormChangeRowDetails as ar,
|
|
10428
|
+
getFormChangeRowKey as as,
|
|
10429
|
+
getFormChangeRowOp as at,
|
|
10430
|
+
getSubTableQuickFillInfo as au,
|
|
10431
|
+
isAnnLocationSelected as av,
|
|
10432
|
+
isBlank as aw,
|
|
10433
|
+
isFormChangeGhostRow as ax,
|
|
10434
|
+
normalizeHistoricalFieldConfig as ay,
|
|
10435
|
+
pickObjectFieldKeys as az,
|
|
10436
|
+
bindFormulaCacheInvalidation as b,
|
|
10437
|
+
currentParamsConfig as c,
|
|
10438
|
+
MULTI_SHEET_SCHEMA_VERSION as d,
|
|
10439
|
+
createRuntimeDocumentV2 as e,
|
|
10440
|
+
normalizeHistoricalBusinessRow as f,
|
|
10331
10441
|
getBusinessFieldKey as g,
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10442
|
+
DeviceLinkTmplUtil as h,
|
|
10443
|
+
normalizeAIOcrTmpl as i,
|
|
10444
|
+
useWidgetStaticAttrs as j,
|
|
10445
|
+
useRuntimeInstanceServices as k,
|
|
10446
|
+
setSelectAnnotationId as l,
|
|
10447
|
+
useRuntimeRowState as m,
|
|
10338
10448
|
normalizeFieldWidth as n,
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10449
|
+
getObjectBomMaterialLotQuery as o,
|
|
10450
|
+
buildObjectLotExtraQuery as p,
|
|
10451
|
+
MaterialConsumptionPatternEnum as q,
|
|
10342
10452
|
resolveObjectFieldKeys as r,
|
|
10343
10453
|
setSelectValidatorId as s,
|
|
10344
|
-
|
|
10454
|
+
resolveObjectBomEntry as t,
|
|
10345
10455
|
useFormTmplConfig as u,
|
|
10346
10456
|
validateObjectBomForScan as v,
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10457
|
+
runWithFillProduct as w,
|
|
10458
|
+
useNocodeFormWidget as x,
|
|
10459
|
+
applyConsumeObjectTraceChange as y,
|
|
10460
|
+
getObjectBomProductQuery as z
|
|
10351
10461
|
};
|