@gct-paas/excel 0.1.16 → 0.1.18
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-DJNL1tGs.js → BaseComponent-xTm5lvAr.js} +1 -0
- package/dist/{VueVideoPlayer-Db7qcsRE.js → VueVideoPlayer-D3u-ZHom.js} +2 -2
- package/dist/{agg-design-BjqRVeg1.js → agg-design-D7CkIPCA.js} +1 -1
- package/dist/{agg-props-CrdosdGr.js → agg-props-DNNO9ucx.js} +1 -1
- package/dist/{agg-style-CfZoOE-b.js → agg-style-v_94dzX8.js} +1 -1
- package/dist/{align-editor-BaNT0jhx.js → align-editor-COpCDpFf.js} +1 -1
- package/dist/{attach-fields-editor-CThobu8X.js → attach-fields-editor-o_7W-2sr.js} +2 -2
- package/dist/{barcode-design-CHjIeaiJ.js → barcode-design-CvsGGAio.js} +2 -2
- package/dist/base/index.es.js +347 -53
- package/dist/{base-font-editor-BiSPxwVH.js → base-font-editor-BmC423aB.js} +2 -2
- package/dist/{boolean-design-BYAdX-h5.js → boolean-design-Hc8Es5l1.js} +2 -2
- package/dist/{boolean-props-jKvjhdlG.js → boolean-props-CGamLGXA.js} +3 -3
- package/dist/{boolean-style-RsMRzVBL.js → boolean-style-m-WuSO6S.js} +4 -4
- package/dist/{cell-upload-JxFLM1bV.js → cell-upload-CiXVE0Ii.js} +2 -2
- package/dist/date-range-editor-BZkhUU-x.js +470 -0
- package/dist/{date-time-design-Du8pmDo-.js → date-time-design-B_oFOcft.js} +1 -1
- package/dist/date-time-props-hGnSGQKc.js +105 -0
- package/dist/{date-time-style-DSEnmxAE.js → date-time-style-CGKG8i3K.js} +1 -1
- package/dist/{decimal-design-C2GbzP9k.js → decimal-design-B5Artgk6.js} +1 -1
- package/dist/{decimal-display-mode-CagizhJW.js → decimal-display-mode-C4XUezoP.js} +2 -2
- package/dist/{decimal-props-CGLqWy8I.js → decimal-props-Q37uOcWl.js} +4 -4
- package/dist/{decimal-style-6j22QKYO.js → decimal-style-C2CnGPVG.js} +1 -1
- package/dist/{default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-C5K6qhB-.js → default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-DTnbLBVW.js} +109 -39
- package/dist/{diagonal-design-Cq3oxdHe.js → diagonal-design-CyUvkcvp.js} +2 -2
- package/dist/{document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-Bbu6cwRC.js → document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-DKTGEH4Q.js} +2295 -1388
- package/dist/{document-sub-table-action-rz6gyez5.js → document-sub-table-action-Cy6Rd8OS.js} +384 -193
- package/dist/{double-design-CyXEqcV7.js → double-design-D_ipWcRm.js} +1 -1
- package/dist/{double-props-DaJoio1W.js → double-props-D4FGbfe2.js} +4 -4
- package/dist/{double-style-B4lIth-J.js → double-style-BbD_6_Os.js} +1 -1
- package/dist/{edit.utils-CXmmCnxE-DW8ClKe9.js → edit.utils-CXmmCnxE-BK4QnSP-.js} +1 -1
- package/dist/{enum-design-DSx09tOO.js → enum-design-lOufLU6Z.js} +2 -2
- package/dist/{enum-props-CJNuQLJ_.js → enum-props-brKRP5Uz.js} +4 -4
- package/dist/{enum-style-5N5xmgRJ.js → enum-style-BQQHkDUD.js} +2 -2
- package/dist/excel.css +943 -440
- package/dist/{exceljs.min-D9gV8q6H.js → exceljs.min-CUwGyNAf.js} +2 -2
- package/dist/{expression-design-BJDbafot.js → expression-design-BPEci3dg.js} +1 -1
- package/dist/{expression-props-BpHbrsle.js → expression-props-Cvg-9V-B.js} +1 -1
- package/dist/{expression-style-qPh81w7Q.js → expression-style-Dv3Hl8lm.js} +1 -1
- package/dist/{file-design-B7si04Bi.js → file-design-BIzi6cpq.js} +1 -1
- package/dist/{file-props-DTtOnHQy.js → file-props-oV2U7bpO.js} +2 -2
- package/dist/{file-style-C6KW_szu.js → file-style-CZrxokgP.js} +1 -1
- package/dist/{font-editor-DgGgvmB2.js → font-editor-B41KgpWJ.js} +3 -3
- package/dist/{form-annotation-controller-KcMm2QYA.js → form-annotation-controller-CdNmJKv-.js} +87 -31
- package/dist/{image-design-B92Xkcf-.js → image-design-C3FEtW6i.js} +2 -2
- package/dist/{image-design-CCfpT4Rp.js → image-design-DMfBfSkD.js} +2 -2
- package/dist/{image-props-DZgfzMta.js → image-props-DPibJk7n.js} +1 -1
- package/dist/{image-style-DX6Q_gF4.js → image-style-DLudd5Vt.js} +1 -1
- package/dist/{index-Bnbl3VER.js → index-B1CG-75q.js} +2 -2
- package/dist/{index-tbaOl7Nd.js → index-B1r6-Uxf.js} +1 -1
- package/dist/{index-bvhV6lsn.js → index-B7lz2J6V.js} +14 -7
- package/dist/{index-DRd2oRK1.js → index-B8ey1U_N.js} +2 -2
- package/dist/{index-BXMOCfWv.js → index-B8wKNUsK.js} +2 -2
- package/dist/{index-DzIKEtWw.js → index-BOis3jsA.js} +1 -1
- package/dist/{index-BYl8cK0A.js → index-BZ1jj7Nu.js} +1 -1
- package/dist/{index-DsASTvC2.js → index-BgZkpQKh.js} +1 -1
- package/dist/{index-Bg-x1hF6.js → index-BiNVmD5v.js} +2 -2
- package/dist/{index-BEBKoAOg.js → index-Bppcm2iQ.js} +2 -2
- package/dist/{index-Dsj3FuVs.js → index-Bvjplnz_.js} +2 -2
- package/dist/{index-DgHRTRH5.js → index-C5bYd42n.js} +2 -2
- package/dist/{index-BzhFcvnJ.js → index-CUIGN7Rt.js} +2 -2
- package/dist/{index-B2iip4UC.js → index-Cjz0GLDq.js} +2 -2
- package/dist/{index-DOFSbVSN.js → index-CkYbgRrH.js} +1 -1
- package/dist/{index-BB5uSbo3.js → index-Cn_c3-eW.js} +1 -1
- package/dist/{index-Be7TFwwX.js → index-Cp7mC3Qt.js} +4 -2
- package/dist/{index-DFgGQBCZ.js → index-CtiiIgjs.js} +2 -2
- package/dist/{index-D6diRqWG.js → index-D0YZX_c7.js} +2 -2
- package/dist/{index-DRKvAxuA.js → index-D7fFpHaN.js} +1 -1
- package/dist/{index-C8qPy1oW.js → index-DAqYc474.js} +2 -2
- package/dist/{index-p-Q3DQmv.js → index-DDpNgyvD.js} +3 -3
- package/dist/{index-IUYnmIJe.js → index-DFoELlwd.js} +1 -1
- package/dist/{index-DJISlRXi.js → index-DHVK-P9J.js} +4 -2
- package/dist/{index-BhzF0Rp3.js → index-DH_EZe8p.js} +4 -3
- package/dist/{index-CIoB2iny.js → index-DJIzgsog.js} +1 -1
- package/dist/{index-Doxcf2Zs.js → index-DPQkm6_v.js} +2 -2
- package/dist/{index-CtTSTTkq.js → index-DsNRjyQD.js} +2 -2
- package/dist/{index-Da7W9uBC.js → index-I_FRG0Ho.js} +2 -2
- package/dist/{index-CmaPtyCh.js → index-oSIIidoF.js} +4 -2
- package/dist/{index-rn6aiccW.js → index-rXMzwu77.js} +3 -3
- package/dist/{index-XbgrTOMF.js → index-vZZ5q2xJ.js} +1 -1
- package/dist/{index-Cw_YFCZT.js → index-yih5hGsL.js} +1467 -1345
- package/dist/index.es.js +6 -5
- package/dist/{integer-design-CPzJPZon.js → integer-design-DhkNa9IA.js} +1 -1
- package/dist/{integer-props-deCDvNET.js → integer-props-c_aQpjaT.js} +4 -4
- package/dist/{integer-style-DwZIRXEW.js → integer-style-CS5v7Bhq.js} +1 -1
- package/dist/{mb-render-Bejyn-ep.js → mb-render-Cs7LUxzk.js} +1 -1
- package/dist/{number-input-ex-CgwOH18n.js → number-input-ex-CwKIHfk1.js} +1 -1
- package/dist/{org-props-BeFVQ-QY.js → org-props-BcbW62Jg.js} +2 -2
- package/dist/{org-style-CLVWLtyd.js → org-style-Bk7mgML3.js} +1 -1
- package/dist/{pagination-design-CT0EQmxW.js → pagination-design-B1KyJUAG.js} +2 -2
- package/dist/paper-widget-design-Cp0ioo8c.js +4 -0
- package/dist/{qrcode-design-CjOkp2xa.js → qrcode-design-EafZURDZ.js} +1 -1
- package/dist/{ref-autofill-editor-B2KcQvyt.js → ref-autofill-editor-OtclaSqy.js} +2 -2
- package/dist/{ref-props-DPnt_pys.js → ref-props-C95McyZp.js} +3 -3
- package/dist/{ref-style-D0XKTtP1.js → ref-style-BxdvOF-4.js} +1 -1
- package/dist/regex-editor-BGukvOEI.js +796 -0
- package/dist/{revo-grid.entry-ztDhASK3.js → revo-grid.entry-BeRVTVKO.js} +1 -1
- package/dist/{revogr-attribution_7.entry-BtXV91vv.js → revogr-attribution_7.entry-CHtbU2lV.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-DXpq4oNb.js → revogr-clipboard_3.entry-DnvQ-Rl7.js} +2 -2
- package/dist/{revogr-data_4.entry-WA1PNcGb.js → revogr-data_4.entry-DLRSuaN8.js} +2 -2
- package/dist/{revogr-filter-panel.entry-unpVAD7l.js → revogr-filter-panel.entry-BDkhY-74.js} +1 -1
- package/dist/{select-render-type-editor.vue_vue_type_script_setup_true_lang-CqaEwsvS.js → select-render-type-editor.vue_vue_type_script_setup_true_lang-ChESg_eM.js} +2 -2
- package/dist/{serialnumber-design-ClArHZWU.js → serialnumber-design-CRaym9J-.js} +1 -1
- package/dist/shared/index.es.js +16 -16
- package/dist/{signature-design-Cg2Ejj3g.js → signature-design-BJHfLDNV.js} +1 -1
- package/dist/{signature-props-CNuLBWtc.js → signature-props-B9hfppHh.js} +3 -3
- package/dist/{signature-style-DtlZdeFB.js → signature-style-DM4rqHnN.js} +1 -1
- package/dist/{single-field-drop-COLR9RIu.js → single-field-drop-eClQhTSv.js} +2 -2
- package/dist/{size-editor-DyGGEX3s.js → size-editor-BjlCmEWf.js} +1 -1
- package/dist/src/adapter/index.d.ts +1 -0
- package/dist/src/adapter/setup.d.ts +1 -1
- package/dist/src/nocode-base/src/_utils_/uuid.d.ts +6 -1
- package/dist/src/nocode-base/src/constant/index.d.ts +11 -0
- package/dist/src/nocode-base/src/hooks/annotation/collect-annotation-items.d.ts +15 -0
- package/dist/src/nocode-base/src/hooks/annotation/form-annotation-controller.d.ts +5 -2
- package/dist/src/nocode-base/src/hooks/annotation/form-change-row.d.ts +60 -0
- package/dist/src/nocode-base/src/hooks/annotation/index.d.ts +2 -0
- package/dist/src/nocode-base/src/hooks/app-info/index.d.ts +2 -2
- package/dist/src/nocode-base/src/hooks/index.d.ts +2 -1
- package/dist/src/nocode-base/src/hooks/model-relation/index.d.ts +1 -1
- package/dist/src/nocode-base/src/hooks/service-util/sn-rule.d.ts +1 -1
- package/dist/src/nocode-base/src/hooks/useFormHook.d.ts +1 -1
- package/dist/src/nocode-base/src/hooks/useRenderData.d.ts +4 -2
- package/dist/src/nocode-base/src/hooks/useRenderPageFactory.d.ts +36 -4
- package/dist/src/nocode-base/src/hooks/useValidator.d.ts +6 -6
- package/dist/src/nocode-base/src/hooks/validation/admission.d.ts +19 -0
- package/dist/src/nocode-base/src/hooks/validation/attach.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/validation/createValidateFactory.d.ts +35 -0
- package/dist/src/nocode-base/src/hooks/validation/formRulesStore.d.ts +15 -0
- package/dist/src/nocode-base/src/hooks/validation/merge.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/validation/runValidation.d.ts +17 -0
- package/dist/src/nocode-base/src/hooks/validation/scheduler.d.ts +12 -0
- package/dist/src/nocode-base/src/hooks/validation/types.d.ts +44 -0
- package/dist/src/nocode-base/src/hooks/validation/useFormValidator.d.ts +39 -0
- package/dist/src/nocode-base/src/hooks/validation/utils.d.ts +24 -0
- package/dist/src/nocode-base/src/hooks/validation/waitForSettle.d.ts +17 -0
- package/dist/src/nocode-base/src/interface/render.d.ts +1 -1
- package/dist/src/nocode-base/src/types/common/base.d.ts +14 -2
- package/dist/src/nocode-base/src/types/fields/i-datepicker.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-datetimepicker.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-inputdouble.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-inputnumber.d.ts +5 -1
- package/dist/src/nocode-base/src/types/fields/i-trace.d.ts +27 -1
- package/dist/src/nocode-base/src/types/widgets/i-paper.d.ts +2 -0
- package/dist/src/online-form/src/components/version-diff/index/types.d.ts +2 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/keep-exception-highlight-editor/keep-exception-highlight-editor.vue.d.ts +10 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/regex-editor/common-regex-api.d.ts +11 -0
- package/dist/src/online-form/src/views/__cell_widgets__/common/regex-editor/editor.d.ts +8 -0
- package/dist/src/online-form/src/views/designer/hooks/useAllSpreadSheets.d.ts +12 -0
- package/dist/src/online-form/src/views/designer/hooks/useModelFields.d.ts +1 -1
- package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts +16 -0
- package/dist/src/online-form/src/views/designer/modules/panel/comps/signature-config/field-tree-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/add-builtin-param/add-builtin-param-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/form-field-tree-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/modules/panel/panel-rule-config/material-rdo-select.vue.d.ts +2 -2
- package/dist/src/online-form/src/views/designer/types/index.d.ts +2 -0
- package/dist/src/online-form/src/views/designer/utils/xlsx-parser.d.ts +3 -0
- package/dist/src/online-form/src/views/render/__components__/_common_/widget-component.vue.d.ts +3 -1
- package/dist/src/shared/components/DoubleInput/double-input.vue.d.ts +5 -0
- package/dist/src/shared/components/rdo-tree-select/rdo-tree-select.vue.d.ts +2 -2
- package/dist/src/shared/utils/host-api.d.ts +3 -11
- package/dist/{text-design-DjJS6aM4.js → text-design-BGxM7gzI.js} +2 -2
- package/dist/{text-design-490okDpw.js → text-design-C3RhersV.js} +2 -2
- package/dist/{text-props-Dh4S3iN0.js → text-props-CIpXslMv.js} +21 -252
- package/dist/{text-style-BGeNrOMv.js → text-style-BPjaT5Ic.js} +1 -1
- package/dist/{throttle-Cpk1LoGk-BWXeZXFZ.js → throttle-Cpk1LoGk-LNQ7rPwu.js} +1 -1
- package/dist/{timediff-design-DEh9xNVa.js → timediff-design-DqVuVrmx.js} +1 -1
- package/dist/{trace-design-Dk0irY70.js → trace-design-IbjVLAhv.js} +2 -2
- package/dist/{trace-props-DRBrPqIq.js → trace-props-C-F_eDG2.js} +53 -16
- package/dist/{trace-style-6lXlaJ2o.js → trace-style-DRenZ1n1.js} +1 -1
- package/dist/{user-props-yasRJPzM.js → user-props-qQx7HZ7T.js} +2 -2
- package/dist/{user-style-dkDUDf63.js → user-style-BPFOx0xn.js} +1 -1
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-8rhhfLv7.js → value-editor.vue_vue_type_style_index_0_lang-Crnt5d7x.js} +2 -2
- package/dist/{version-select-dvsx-Ifv.js → version-select-BkZzH36D.js} +1 -1
- package/dist/web-render/index.es.js +4 -4
- package/dist/{widget-barcode-BfzXe5MQ.js → widget-barcode-CPZjarSa.js} +4 -4
- package/dist/{widget-diagonal-R5qdvCvE.js → widget-diagonal-DebN3u9t.js} +3 -3
- package/dist/{widget-image-C0zAtiuf.js → widget-image-BSMWxm9c.js} +5 -5
- package/dist/{widget-line-z4TTPDkL.js → widget-line-CyavTHOV.js} +2 -2
- package/dist/{widget-pagination-CeO9pmmu.js → widget-pagination-ZCBdy6HQ.js} +5 -5
- package/dist/{widget-power-CP1DLxkZ.js → widget-power-B1NFysHT.js} +3 -3
- package/dist/{widget-qrcode-Boz_t9l9.js → widget-qrcode-B0TTSoSK.js} +3 -3
- package/dist/{widget-rangelimit-B9kRG_Fa.js → widget-rangelimit-C_ureKDr.js} +3 -3
- package/dist/{widget-serialnumber-BBUxx4nB.js → widget-serialnumber-Dq15dHnk.js} +1 -1
- package/dist/{widget-text-qvLZssGe.js → widget-text-B9EXKFiM.js} +5 -5
- package/dist/{widget-timediff-BBmssjfJ.js → widget-timediff-BhLrQuGb.js} +2 -2
- package/package.json +1 -1
- package/dist/date-format-editor-BZ89hVjL.js +0 -240
- package/dist/date-time-props-BWvuzNXX.js +0 -265
- package/dist/paper-widget-design-DKBVqvH3.js +0 -4
- package/dist/src/nocode-base/src/hooks/form-model/fetcher.d.ts +0 -40
- package/dist/src/nocode-base/src/interface/data.d.ts +0 -47
- package/dist/src/nocode-base/src/interface/util.d.ts +0 -108
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { computed, defineComponent, ref, onMounted, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, vShow, createVNode, render as render$1, inject, toRef, h as h$1, toRaw,
|
|
1
|
+
import { computed, defineComponent, ref, onMounted, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, vShow, createVNode, render as render$1, inject, toRef, h as h$1, toRaw, nextTick as nextTick$1, watch, defineAsyncComponent, getCurrentInstance } from "vue";
|
|
2
2
|
import { isNil, keyBy, pick, isEmpty, mapKeys, cloneDeep, flatMap, zip, merge, pickBy, omit, has, isObject as isObject$1, defaults, groupBy, omitBy, isEqual, get as get$1, last, first } from "lodash-es";
|
|
3
|
+
import { api as api$1 } from "@gct-paas/api";
|
|
3
4
|
import dayjs from "dayjs";
|
|
4
5
|
var PlatformEnum = /* @__PURE__ */ ((PlatformEnum2) => {
|
|
5
6
|
PlatformEnum2["INTEGRATION_PAAS_DP"] = "INTEGRATION_PAAS_DP";
|
|
@@ -161,6 +162,13 @@ var RangeValidateMode = /* @__PURE__ */ ((RangeValidateMode2) => {
|
|
|
161
162
|
RangeValidateMode2["Variable_Validate"] = "VariableValidate";
|
|
162
163
|
return RangeValidateMode2;
|
|
163
164
|
})(RangeValidateMode || {});
|
|
165
|
+
var RangeCompareOp = /* @__PURE__ */ ((RangeCompareOp2) => {
|
|
166
|
+
RangeCompareOp2["LE"] = "le";
|
|
167
|
+
RangeCompareOp2["LT"] = "lt";
|
|
168
|
+
RangeCompareOp2["GE"] = "ge";
|
|
169
|
+
RangeCompareOp2["GT"] = "gt";
|
|
170
|
+
return RangeCompareOp2;
|
|
171
|
+
})(RangeCompareOp || {});
|
|
164
172
|
var DecimalDisplayMode = /* @__PURE__ */ ((DecimalDisplayMode2) => {
|
|
165
173
|
DecimalDisplayMode2["PERCENT"] = "percent";
|
|
166
174
|
DecimalDisplayMode2["ORIGIN"] = "origin";
|
|
@@ -475,28 +483,39 @@ const mergeByMultiKey = (A, B, {
|
|
|
475
483
|
});
|
|
476
484
|
return result;
|
|
477
485
|
};
|
|
486
|
+
const CLIENT_ROW_UID_KEY = "__gct_rv_uid";
|
|
487
|
+
const FRONT_ROW_KEY = "front_row_key_";
|
|
488
|
+
function ensureFrontRowKey(row) {
|
|
489
|
+
if (!row) return "";
|
|
490
|
+
const existing = row[FRONT_ROW_KEY];
|
|
491
|
+
if (existing != null && String(existing).trim() !== "") return String(existing);
|
|
492
|
+
const uid = `r_${Date.now()}_${uuid2(8)}`;
|
|
493
|
+
row[FRONT_ROW_KEY] = uid;
|
|
494
|
+
return uid;
|
|
495
|
+
}
|
|
478
496
|
const getRowId = (row) => {
|
|
479
497
|
if (!row) return "";
|
|
480
|
-
if (
|
|
481
|
-
|
|
482
|
-
if (!row[ROW_UID_KEY]) {
|
|
483
|
-
row[ROW_UID_KEY] = `r_${Date.now()}_${uuid2(8)}`;
|
|
498
|
+
if (row[FRONT_ROW_KEY] != null && String(row[FRONT_ROW_KEY]).trim() !== "") {
|
|
499
|
+
return String(row[FRONT_ROW_KEY]);
|
|
484
500
|
}
|
|
485
|
-
return row
|
|
501
|
+
if (!isNil(row.id_)) return String(row.id_);
|
|
502
|
+
return ensureFrontRowKey(row);
|
|
486
503
|
};
|
|
487
|
-
function
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
{
|
|
493
|
-
get(_target, prop) {
|
|
494
|
-
const hostApi = getGct()?.api;
|
|
495
|
-
const value = hostApi?.[prop];
|
|
496
|
-
return typeof value === "function" ? value.bind(hostApi) : value;
|
|
504
|
+
function getApi$2() {
|
|
505
|
+
if (typeof globalThis !== "undefined") {
|
|
506
|
+
const globalApi = globalThis._api;
|
|
507
|
+
if (globalApi) {
|
|
508
|
+
return globalApi;
|
|
497
509
|
}
|
|
498
510
|
}
|
|
499
|
-
|
|
511
|
+
return api$1;
|
|
512
|
+
}
|
|
513
|
+
const api = new Proxy(api$1, {
|
|
514
|
+
get(_target, prop) {
|
|
515
|
+
const real = getApi$2();
|
|
516
|
+
return Reflect.get(real, prop, real);
|
|
517
|
+
}
|
|
518
|
+
});
|
|
500
519
|
const baseDataUtils = {
|
|
501
520
|
baseApis: {
|
|
502
521
|
getOneData2SqlView: api.apaas.sqlView.postBizServiceModelKeyBsKey,
|
|
@@ -56592,10 +56611,14 @@ const transformUtils = {
|
|
|
56592
56611
|
const rowData = { ...baseData };
|
|
56593
56612
|
if (payload.isRowSubTable2d) {
|
|
56594
56613
|
const groupKey = `dyn${uuid2(16)}`;
|
|
56595
|
-
const _2DTABLE_ = Array.from({ length: payload.childInitRowLen }, () =>
|
|
56596
|
-
|
|
56597
|
-
|
|
56598
|
-
|
|
56614
|
+
const _2DTABLE_ = Array.from({ length: payload.childInitRowLen }, () => {
|
|
56615
|
+
const child = {
|
|
56616
|
+
...baseData,
|
|
56617
|
+
...pick(subDefaultData, payload.crossFieldKeys)
|
|
56618
|
+
};
|
|
56619
|
+
ensureFrontRowKey(child);
|
|
56620
|
+
return child;
|
|
56621
|
+
});
|
|
56599
56622
|
const extraData = { ...omit(subDefaultData, payload.crossFieldKeys) };
|
|
56600
56623
|
Object.assign(rowData, {
|
|
56601
56624
|
group_: groupKey,
|
|
@@ -56605,6 +56628,7 @@ const transformUtils = {
|
|
|
56605
56628
|
} else {
|
|
56606
56629
|
Object.assign(rowData, subDefaultData);
|
|
56607
56630
|
}
|
|
56631
|
+
ensureFrontRowKey(rowData);
|
|
56608
56632
|
return rowData;
|
|
56609
56633
|
},
|
|
56610
56634
|
/** 数据转成真实提交数据(二维表要平铺) */
|
|
@@ -56615,7 +56639,7 @@ const transformUtils = {
|
|
|
56615
56639
|
materialConsumeTableList = []
|
|
56616
56640
|
} = paper?.props || {};
|
|
56617
56641
|
const list2D = [...subTable2DList, ...checkTable2DList];
|
|
56618
|
-
const filterKeys = ["_DICT", "_OPCT", "__FOREIGN__", "_MCTABLE"];
|
|
56642
|
+
const filterKeys = ["_DICT", "_OPCT", "__FOREIGN__", "_MCTABLE", CLIENT_ROW_UID_KEY];
|
|
56619
56643
|
const realFormData = Object.keys(formData).reduce((acc, fieldKey) => {
|
|
56620
56644
|
const info = list2D.find(
|
|
56621
56645
|
(item) => (item.subTable2d || item.checkTable2d) && item.rowSubFieldKey === fieldKey
|
|
@@ -56644,7 +56668,10 @@ const transformUtils = {
|
|
|
56644
56668
|
)
|
|
56645
56669
|
)
|
|
56646
56670
|
).map((item) => omit(item, "_2DTABLE_"));
|
|
56647
|
-
acc[fieldKey] = arr.every((item) =>
|
|
56671
|
+
acc[fieldKey] = arr.every((item) => {
|
|
56672
|
+
const keys2 = Object.keys(item).filter((key) => key !== FRONT_ROW_KEY);
|
|
56673
|
+
return keys2.length === 1 && has(item, "group_");
|
|
56674
|
+
}) ? [] : arr;
|
|
56648
56675
|
} else if (Array.isArray(formData[fieldKey])) {
|
|
56649
56676
|
acc[fieldKey] = formData[fieldKey].map(
|
|
56650
56677
|
(item) => Object.fromEntries(
|
|
@@ -57297,17 +57324,19 @@ const renderUtils = {
|
|
|
57297
57324
|
return Boolean(parseInt(value));
|
|
57298
57325
|
},
|
|
57299
57326
|
/** 判断一个日期或日期时间字符串是否在最小和最大时间戳之间 */
|
|
57300
|
-
isOutOfRange: (inputStr, minTimestamp, maxTimestamp) => {
|
|
57327
|
+
isOutOfRange: (inputStr, minTimestamp, maxTimestamp, minCompareOp, maxCompareOp) => {
|
|
57301
57328
|
if (isNil(inputStr)) {
|
|
57302
57329
|
return false;
|
|
57303
57330
|
}
|
|
57304
57331
|
const inputTime = dayjs(inputStr).unix();
|
|
57305
57332
|
if (isNaN(inputTime)) return false;
|
|
57306
|
-
if (!isNil(minTimestamp) && !isNaN(minTimestamp)
|
|
57307
|
-
|
|
57333
|
+
if (!isNil(minTimestamp) && !isNaN(minTimestamp)) {
|
|
57334
|
+
const pass = minCompareOp === "gt" ? inputTime > minTimestamp : inputTime >= minTimestamp;
|
|
57335
|
+
if (!pass) return true;
|
|
57308
57336
|
}
|
|
57309
|
-
if (!isNil(maxTimestamp) && !isNaN(maxTimestamp)
|
|
57310
|
-
|
|
57337
|
+
if (!isNil(maxTimestamp) && !isNaN(maxTimestamp)) {
|
|
57338
|
+
const pass = maxCompareOp === "lt" ? inputTime < maxTimestamp : inputTime <= maxTimestamp;
|
|
57339
|
+
if (!pass) return true;
|
|
57311
57340
|
}
|
|
57312
57341
|
return false;
|
|
57313
57342
|
},
|
|
@@ -57444,7 +57473,7 @@ const renderUtils = {
|
|
|
57444
57473
|
FIELD_TYPE.PRODUCT,
|
|
57445
57474
|
FIELD_TYPE.ROUTING_OPERATION,
|
|
57446
57475
|
FIELD_TYPE.MFG_ORDER
|
|
57447
|
-
].includes(fieldType) || [FIELD_TYPE.
|
|
57476
|
+
].includes(fieldType) || [FIELD_TYPE.E_SOP, FIELD_TYPE.E_SOP_VERSION].includes(bizType)) && !subFieldKey && !subModelKey || bizType === FIELD_TYPE.WAREHOUSE || !isNil(defaultValue) && defaultValue !== "";
|
|
57448
57477
|
if (shouldPushDefaultValueField && !useDefaultValueFields[key]) {
|
|
57449
57478
|
useDefaultValueFields[key] = {
|
|
57450
57479
|
fieldId,
|
|
@@ -57741,6 +57770,7 @@ const renderUtils = {
|
|
|
57741
57770
|
case FIELD_TYPE.REF:
|
|
57742
57771
|
case FIELD_TYPE.REF_MULTI:
|
|
57743
57772
|
const isRdo = [FIELD_TYPE.E_SOP].includes(bizType);
|
|
57773
|
+
const isBizType = [FIELD_TYPE.E_SOP].includes(bizType);
|
|
57744
57774
|
const queryCondition = refUtils.generateQueryConditions(field.dataFilter, paramsConfig);
|
|
57745
57775
|
return await getRefList({
|
|
57746
57776
|
modelKey,
|
|
@@ -57749,7 +57779,10 @@ const renderUtils = {
|
|
|
57749
57779
|
queryData: {
|
|
57750
57780
|
...queryCondition.dataFilterFixedQueryData,
|
|
57751
57781
|
...defaultQuery,
|
|
57752
|
-
...newQueryData
|
|
57782
|
+
...newQueryData,
|
|
57783
|
+
...isBizType ? {
|
|
57784
|
+
operating_state_: true
|
|
57785
|
+
} : {}
|
|
57753
57786
|
},
|
|
57754
57787
|
// 库位需要数据联动,初始化不要加载
|
|
57755
57788
|
needDataLink: field.field === "location_id_",
|
|
@@ -59471,194 +59504,1217 @@ const calcUtils = {
|
|
|
59471
59504
|
return pageData;
|
|
59472
59505
|
}
|
|
59473
59506
|
};
|
|
59474
|
-
|
|
59475
|
-
|
|
59476
|
-
|
|
59477
|
-
|
|
59478
|
-
|
|
59479
|
-
|
|
59480
|
-
|
|
59507
|
+
var NCB_PROVIDE = /* @__PURE__ */ ((NCB_PROVIDE2) => {
|
|
59508
|
+
NCB_PROVIDE2["IS_PDF"] = "NCB_IsPdf";
|
|
59509
|
+
NCB_PROVIDE2["FROM_DATA"] = "NCB_FromState";
|
|
59510
|
+
NCB_PROVIDE2["DEFAULT_FIELD_DATA"] = "NCB_DefaultFieldData";
|
|
59511
|
+
NCB_PROVIDE2["DATA_RELATION_SHIP"] = "NCB_DataRelationShip";
|
|
59512
|
+
NCB_PROVIDE2["PAGE_DATA_CALL_BACK"] = "NCB_PageDataCallback";
|
|
59513
|
+
NCB_PROVIDE2["FORM_INST_LIST"] = "NCB_FormInstList";
|
|
59514
|
+
NCB_PROVIDE2["MOBILE_FILL_FIELDS_POPUP"] = "NCB_MobileFillFieldsPopup";
|
|
59515
|
+
NCB_PROVIDE2["TMPL_BOM_CONTROLLER_MAP"] = "NCB_TmplBomControllerMap";
|
|
59516
|
+
NCB_PROVIDE2["MATERIAL_CONSUME_TABLE_CONTROLLER"] = "NCB_MaterialConsumeTableController";
|
|
59517
|
+
NCB_PROVIDE2["CHECK_TABLE_COL_INDEX"] = "NCB_CheckTableColIndex";
|
|
59518
|
+
NCB_PROVIDE2["SUB_TABLE_CORE_FACTORY_MAP"] = "NCB_SubTableCoreFactoryMap";
|
|
59519
|
+
NCB_PROVIDE2["SUB_TABLE_CORE"] = "NCB_SubTableCore";
|
|
59520
|
+
NCB_PROVIDE2["PAGER"] = "NCB_Pager";
|
|
59521
|
+
return NCB_PROVIDE2;
|
|
59522
|
+
})(NCB_PROVIDE || {});
|
|
59523
|
+
function mitt(all) {
|
|
59524
|
+
all = all || /* @__PURE__ */ new Map();
|
|
59525
|
+
return {
|
|
59526
|
+
/**
|
|
59527
|
+
* A Map of event names to registered handler functions.
|
|
59528
|
+
*/
|
|
59529
|
+
all,
|
|
59530
|
+
/**
|
|
59531
|
+
* Register an event handler for the given type.
|
|
59532
|
+
* @param {string|symbol} type Type of event to listen for, or `'*'` for all events
|
|
59533
|
+
* @param {Function} handler Function to call in response to given event
|
|
59534
|
+
* @memberOf mitt
|
|
59535
|
+
*/
|
|
59536
|
+
on(type4, handler) {
|
|
59537
|
+
const handlers = all.get(type4);
|
|
59538
|
+
if (handlers) {
|
|
59539
|
+
handlers.push(handler);
|
|
59540
|
+
} else {
|
|
59541
|
+
all.set(type4, [handler]);
|
|
59542
|
+
}
|
|
59543
|
+
},
|
|
59544
|
+
/**
|
|
59545
|
+
* Remove an event handler for the given type.
|
|
59546
|
+
* If `handler` is omitted, all handlers of the given type are removed.
|
|
59547
|
+
* @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
|
|
59548
|
+
* @param {Function} [handler] Handler function to remove
|
|
59549
|
+
* @memberOf mitt
|
|
59550
|
+
*/
|
|
59551
|
+
off(type4, handler) {
|
|
59552
|
+
const handlers = all.get(type4);
|
|
59553
|
+
if (handlers) {
|
|
59554
|
+
if (handler) {
|
|
59555
|
+
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
59556
|
+
} else {
|
|
59557
|
+
all.set(type4, []);
|
|
59481
59558
|
}
|
|
59482
59559
|
}
|
|
59560
|
+
},
|
|
59561
|
+
/**
|
|
59562
|
+
* Invoke all handlers for the given type.
|
|
59563
|
+
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
59564
|
+
*
|
|
59565
|
+
* Note: Manually firing '*' handlers is not supported.
|
|
59566
|
+
*
|
|
59567
|
+
* @param {string|symbol} type The event type to invoke
|
|
59568
|
+
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
59569
|
+
* @memberOf mitt
|
|
59570
|
+
*/
|
|
59571
|
+
emit(type4, evt) {
|
|
59572
|
+
let handlers = all.get(type4);
|
|
59573
|
+
if (handlers) {
|
|
59574
|
+
handlers.slice().forEach((handler) => {
|
|
59575
|
+
handler(evt);
|
|
59576
|
+
});
|
|
59577
|
+
}
|
|
59578
|
+
handlers = all.get("*");
|
|
59579
|
+
if (handlers) {
|
|
59580
|
+
handlers.slice().forEach((handler) => {
|
|
59581
|
+
handler(type4, evt);
|
|
59582
|
+
});
|
|
59583
|
+
}
|
|
59584
|
+
},
|
|
59585
|
+
/**
|
|
59586
|
+
* Clear all
|
|
59587
|
+
*/
|
|
59588
|
+
clear() {
|
|
59589
|
+
this.all.clear();
|
|
59483
59590
|
}
|
|
59484
|
-
return target;
|
|
59485
59591
|
};
|
|
59486
|
-
return _extends.apply(this, arguments);
|
|
59487
59592
|
}
|
|
59488
|
-
|
|
59489
|
-
|
|
59490
|
-
|
|
59491
|
-
|
|
59492
|
-
|
|
59493
|
-
|
|
59494
|
-
|
|
59495
|
-
|
|
59593
|
+
const emitter = mitt();
|
|
59594
|
+
var EmitterEnum = /* @__PURE__ */ ((EmitterEnum2) => {
|
|
59595
|
+
EmitterEnum2["__on__open_single_annotation_detail_"] = "__on__open_single_annotation_detail_";
|
|
59596
|
+
EmitterEnum2["__on__update_page_dom_"] = "__on__update_page_dom_";
|
|
59597
|
+
EmitterEnum2["__on_select_ebr_doc_instance_id"] = "__on_select_ebr_doc_instance_id";
|
|
59598
|
+
EmitterEnum2["__on_looper_auto_save"] = "__on_looper_auto_save";
|
|
59599
|
+
EmitterEnum2["__on_diff_ebr_form_state"] = "__on_diff_ebr_form_state";
|
|
59600
|
+
return EmitterEnum2;
|
|
59601
|
+
})(EmitterEnum || {});
|
|
59602
|
+
function useNocodeEmitter() {
|
|
59603
|
+
return {
|
|
59604
|
+
emitter,
|
|
59605
|
+
EmitterEnum
|
|
59496
59606
|
};
|
|
59497
|
-
return _getPrototypeOf(o);
|
|
59498
59607
|
}
|
|
59499
|
-
function
|
|
59500
|
-
|
|
59501
|
-
|
|
59502
|
-
|
|
59608
|
+
function useCurrentPageFormState() {
|
|
59609
|
+
const formStateMap = inject(NCB_PROVIDE.FROM_DATA);
|
|
59610
|
+
const dataRelationShip = inject(NCB_PROVIDE.DATA_RELATION_SHIP);
|
|
59611
|
+
const currentPageFormState = computed(() => {
|
|
59612
|
+
return formStateMap?.[dataRelationShip?.uniqueId ?? ""] ?? {};
|
|
59613
|
+
});
|
|
59614
|
+
return {
|
|
59615
|
+
currentPageFormState
|
|
59503
59616
|
};
|
|
59504
|
-
return _setPrototypeOf(o, p2);
|
|
59505
59617
|
}
|
|
59506
|
-
function
|
|
59507
|
-
|
|
59508
|
-
|
|
59509
|
-
|
|
59510
|
-
|
|
59511
|
-
|
|
59512
|
-
|
|
59513
|
-
|
|
59514
|
-
|
|
59515
|
-
|
|
59618
|
+
function useWidgetStaticAttrs(widget) {
|
|
59619
|
+
const dataRelationShip = inject(NCB_PROVIDE.DATA_RELATION_SHIP);
|
|
59620
|
+
const {
|
|
59621
|
+
field = "",
|
|
59622
|
+
fieldType,
|
|
59623
|
+
bizType,
|
|
59624
|
+
isFieldModel,
|
|
59625
|
+
fieldLink,
|
|
59626
|
+
modelKey = dataRelationShip?.modelKey,
|
|
59627
|
+
refModelKey,
|
|
59628
|
+
placeholder,
|
|
59629
|
+
bindCompStyleType,
|
|
59630
|
+
newSpecificConfig
|
|
59631
|
+
} = widget.props || {};
|
|
59632
|
+
let viewState = widget.props?.viewState;
|
|
59633
|
+
if (fieldType === FIELD_TYPE.ATTACHMENT && viewState === CellWidgetViewState.Auto) {
|
|
59634
|
+
viewState = CellWidgetViewState.Readonly;
|
|
59516
59635
|
}
|
|
59517
|
-
|
|
59518
|
-
|
|
59519
|
-
|
|
59520
|
-
|
|
59521
|
-
|
|
59522
|
-
|
|
59523
|
-
|
|
59524
|
-
|
|
59525
|
-
|
|
59526
|
-
|
|
59527
|
-
|
|
59528
|
-
|
|
59636
|
+
const disabled = toRef(widget.props, "disabled");
|
|
59637
|
+
const readonly = toRef(widget.props, "field_readonly");
|
|
59638
|
+
const newRequired = toRef(widget.props, "required");
|
|
59639
|
+
const newQueryDataRef = computed(() => widget.props.newSpecificConfig?.newQueryData);
|
|
59640
|
+
const customLoaderRef = computed(() => widget.props.newSpecificConfig?.customLoader);
|
|
59641
|
+
const {
|
|
59642
|
+
newFieldName,
|
|
59643
|
+
newModelName,
|
|
59644
|
+
newOptions = [],
|
|
59645
|
+
newUploadConfig = {},
|
|
59646
|
+
newPrecision = 0,
|
|
59647
|
+
newLoadFinished2Options,
|
|
59648
|
+
newTotalCount,
|
|
59649
|
+
newRefRecordNo,
|
|
59650
|
+
newQueryData,
|
|
59651
|
+
newQueryCondition,
|
|
59652
|
+
forcedDisabled,
|
|
59653
|
+
forcedReadonlyText,
|
|
59654
|
+
newPlaceholder,
|
|
59655
|
+
newRulesForRounding,
|
|
59656
|
+
newComponentProps = {},
|
|
59657
|
+
newDisplayRule = void 0,
|
|
59658
|
+
newSnNo = void 0
|
|
59659
|
+
} = newSpecificConfig || {};
|
|
59660
|
+
const targetFieldId = field ? isFieldModel ? fieldLink : field : "";
|
|
59661
|
+
const newDisplayStatus = computed(() => {
|
|
59662
|
+
const readonlyString = viewState === CellWidgetViewState.Disabled || viewState === CellWidgetViewState.Auto ? "readonly-component" : "readonly-text";
|
|
59663
|
+
const editString = readonly.value ? "readonly-component" : "edit-component";
|
|
59664
|
+
if (dataRelationShip?.annSwitchStatus || forcedReadonlyText) return "readonly-text";
|
|
59665
|
+
if (isFieldModel) return readonlyString;
|
|
59666
|
+
const renderMode = dataRelationShip?.renderModeType;
|
|
59667
|
+
const bpmnMap = dataRelationShip?.bpmnFieldAuthMap;
|
|
59668
|
+
const key = `${modelKey}.${field}`;
|
|
59669
|
+
const getFieldAuth = () => bpmnMap?.[key];
|
|
59670
|
+
const resolveFromAuth = (info) => {
|
|
59671
|
+
if (isEmpty(info)) return null;
|
|
59672
|
+
if (info.edit && !info.readonly) return editString;
|
|
59673
|
+
if (info.readonly && !info.edit) return readonlyString;
|
|
59674
|
+
return null;
|
|
59529
59675
|
};
|
|
59530
|
-
|
|
59531
|
-
|
|
59532
|
-
|
|
59533
|
-
|
|
59534
|
-
|
|
59535
|
-
}
|
|
59536
|
-
|
|
59537
|
-
|
|
59538
|
-
|
|
59539
|
-
|
|
59540
|
-
|
|
59541
|
-
|
|
59676
|
+
if (renderMode === RenderModeEnum.FormMode) {
|
|
59677
|
+
if (dataRelationShip?.formType !== FormTypeEnum.PROCESS) {
|
|
59678
|
+
const auth2 = getFieldAuth();
|
|
59679
|
+
const fromAuth2 = resolveFromAuth(auth2);
|
|
59680
|
+
return fromAuth2 ?? editString;
|
|
59681
|
+
}
|
|
59682
|
+
const auth = getFieldAuth();
|
|
59683
|
+
const fromAuth = resolveFromAuth(auth);
|
|
59684
|
+
if (fromAuth) return fromAuth;
|
|
59685
|
+
const bpmnType = dataRelationShip?.bpmnType;
|
|
59686
|
+
if (bpmnType === BpmnNodeTypeEnum.BpmnApproval || bpmnType === BpmnNodeTypeEnum.BpmnJudge) {
|
|
59687
|
+
return readonlyString;
|
|
59688
|
+
}
|
|
59689
|
+
return editString;
|
|
59542
59690
|
}
|
|
59543
|
-
if (
|
|
59544
|
-
|
|
59545
|
-
_cache.set(Class2, Wrapper);
|
|
59691
|
+
if (renderMode === RenderModeEnum.ViewMode) {
|
|
59692
|
+
return readonlyString;
|
|
59546
59693
|
}
|
|
59547
|
-
|
|
59548
|
-
|
|
59694
|
+
return readonly.value ? "readonly-text" : "edit-component";
|
|
59695
|
+
});
|
|
59696
|
+
const newDisabled = computed(() => {
|
|
59697
|
+
if (newDisplayStatus.value === "edit-component") {
|
|
59698
|
+
return forcedDisabled || disabled.value;
|
|
59549
59699
|
}
|
|
59550
|
-
|
|
59551
|
-
|
|
59552
|
-
|
|
59553
|
-
|
|
59554
|
-
|
|
59555
|
-
|
|
59556
|
-
|
|
59557
|
-
|
|
59558
|
-
|
|
59700
|
+
return viewState === CellWidgetViewState.Disabled || disabled.value;
|
|
59701
|
+
});
|
|
59702
|
+
const isAutoLineBreak = computed(() => {
|
|
59703
|
+
if (!isEmpty(widget.style) && has(widget.style, "whiteSpace") && has(widget.style, "wordBreak") && widget.style.whiteSpace === "pre-wrap" && widget.style.wordBreak === "break-all") {
|
|
59704
|
+
return true;
|
|
59705
|
+
}
|
|
59706
|
+
return false;
|
|
59707
|
+
});
|
|
59708
|
+
return {
|
|
59709
|
+
field,
|
|
59710
|
+
fieldType,
|
|
59711
|
+
/** 业务类型 */
|
|
59712
|
+
bizType,
|
|
59713
|
+
modelKey,
|
|
59714
|
+
refModelKey,
|
|
59715
|
+
isFieldModel,
|
|
59716
|
+
fieldLink,
|
|
59717
|
+
targetFieldId,
|
|
59718
|
+
placeholder: newPlaceholder || placeholder,
|
|
59719
|
+
bindCompStyleType,
|
|
59720
|
+
/** 字段名称 */
|
|
59721
|
+
showFieldName: newFieldName,
|
|
59722
|
+
/** 字段所属模型名称 */
|
|
59723
|
+
showModelName: newModelName,
|
|
59724
|
+
/** 是否必填 */
|
|
59725
|
+
showRequired: newRequired,
|
|
59726
|
+
/** 是否禁用 */
|
|
59727
|
+
showDisabled: newDisabled,
|
|
59728
|
+
/** 显示状态 */
|
|
59729
|
+
showDisplayStatus: newDisplayStatus,
|
|
59730
|
+
/** 下拉列表 */
|
|
59731
|
+
options: newOptions,
|
|
59732
|
+
/** 附件、图片配置项 */
|
|
59733
|
+
uploadConfig: newUploadConfig,
|
|
59734
|
+
/** 小数位数 */
|
|
59735
|
+
realPrecision: newPrecision,
|
|
59736
|
+
/** 精度小数的修约规则 */
|
|
59737
|
+
rulesForRounding: newRulesForRounding,
|
|
59738
|
+
/** 记录单号是否是链接 */
|
|
59739
|
+
realRefRecordNo: newRefRecordNo,
|
|
59740
|
+
/** 下拉列表内容是否都加载完成 */
|
|
59741
|
+
loadFinished2Options: newLoadFinished2Options,
|
|
59742
|
+
/** Rdo下拉框内容总数 */
|
|
59743
|
+
newTotalCount,
|
|
59744
|
+
/** 查询条件 */
|
|
59745
|
+
newQueryData,
|
|
59746
|
+
/** 查询条件响应式 */
|
|
59747
|
+
newQueryDataRef,
|
|
59748
|
+
/** 自定义数据源加载函数 */
|
|
59749
|
+
customLoaderRef,
|
|
59750
|
+
/** 查询条件 */
|
|
59751
|
+
queryCondition: newQueryCondition,
|
|
59752
|
+
/** 组件额外参数 */
|
|
59753
|
+
newComponentProps,
|
|
59754
|
+
/** 显示规则 */
|
|
59755
|
+
newDisplayRule,
|
|
59756
|
+
dataRelationShip,
|
|
59757
|
+
/** 是否是自动换行 */
|
|
59758
|
+
isAutoLineBreak,
|
|
59759
|
+
/** 序列号 */
|
|
59760
|
+
newSnNo
|
|
59559
59761
|
};
|
|
59560
|
-
return _wrapNativeSuper(Class);
|
|
59561
59762
|
}
|
|
59562
|
-
|
|
59563
|
-
|
|
59564
|
-
|
|
59565
|
-
|
|
59566
|
-
|
|
59567
|
-
|
|
59568
|
-
|
|
59569
|
-
|
|
59570
|
-
|
|
59571
|
-
|
|
59572
|
-
|
|
59763
|
+
function useCalculateFormula() {
|
|
59764
|
+
const { identify, calculate } = {
|
|
59765
|
+
identify: (...args) => window.NocodeAdapter.utils?.formulaIdentify?.(...args) ?? [],
|
|
59766
|
+
calculate: (...args) => window.NocodeAdapter.utils?.formulaCalculate?.(...args)
|
|
59767
|
+
};
|
|
59768
|
+
const getFieldDataValue = (parseInfo, formData) => {
|
|
59769
|
+
const getTextValue = (processedKey, value) => {
|
|
59770
|
+
const textValue = value ?? formData?.[processedKey] ?? "";
|
|
59771
|
+
return Array.isArray(textValue) ? textValue.join() : textValue;
|
|
59772
|
+
};
|
|
59773
|
+
const { type: type4, processed, hashValue } = parseInfo;
|
|
59774
|
+
if (type4 === "hash") {
|
|
59775
|
+
const tableData = toRaw(formData?.[hashValue] || []);
|
|
59776
|
+
return tableData.filter((d) => !d.deleted_).map((row) => getTextValue(processed, row?.[processed])).filter((i2) => !isNil(i2));
|
|
59573
59777
|
}
|
|
59778
|
+
return getTextValue(processed, formData?.[processed]);
|
|
59779
|
+
};
|
|
59780
|
+
const parseFormulaVar = (formulaVar) => {
|
|
59781
|
+
const result = {
|
|
59782
|
+
original: formulaVar,
|
|
59783
|
+
type: "",
|
|
59784
|
+
processed: "",
|
|
59785
|
+
hashValue: "",
|
|
59786
|
+
dataType: ""
|
|
59787
|
+
};
|
|
59788
|
+
if (/^\$([^$]+)\$\.(.+)$/.test(formulaVar)) {
|
|
59789
|
+
const match = formulaVar.match(/^\$([^$]+)\$\.(.+)$/);
|
|
59790
|
+
result.type = "hash";
|
|
59791
|
+
result.processed = match[2];
|
|
59792
|
+
result.hashValue = match[1];
|
|
59793
|
+
result.dataType = "globType";
|
|
59794
|
+
} else if (/^_\.(.+)$/.test(formulaVar)) {
|
|
59795
|
+
const match = formulaVar.match(/^_\.(.+)$/);
|
|
59796
|
+
result.type = "underscore";
|
|
59797
|
+
result.processed = match[1];
|
|
59798
|
+
result.dataType = "currentRowType";
|
|
59799
|
+
} else {
|
|
59800
|
+
result.type = "plain";
|
|
59801
|
+
result.processed = formulaVar;
|
|
59802
|
+
result.dataType = "globType";
|
|
59803
|
+
}
|
|
59804
|
+
return result;
|
|
59805
|
+
};
|
|
59806
|
+
const getParseFormulaVarInfos2 = (expr) => {
|
|
59807
|
+
const rowArgs = expr ? identify(expr) : [];
|
|
59808
|
+
return {
|
|
59809
|
+
rowArgs,
|
|
59810
|
+
parseInfos: rowArgs.map((curr) => parseFormulaVar(curr))
|
|
59811
|
+
};
|
|
59812
|
+
};
|
|
59813
|
+
const calculateFormula2 = async (expr, formData, currentPageFormState) => {
|
|
59814
|
+
const rowArgs = identify(expr);
|
|
59815
|
+
const formulaData = isEmpty(rowArgs) ? {} : rowArgs.reduce((total, curr) => {
|
|
59816
|
+
const parseInfo = parseFormulaVar(curr);
|
|
59817
|
+
total[curr] = getFieldDataValue(
|
|
59818
|
+
parseInfo,
|
|
59819
|
+
parseInfo.dataType === "currentRowType" ? formData : currentPageFormState
|
|
59820
|
+
);
|
|
59821
|
+
return total;
|
|
59822
|
+
}, {});
|
|
59823
|
+
return calculate(expr, formulaData);
|
|
59824
|
+
};
|
|
59825
|
+
const mergeParseInfos = (a = [], b = []) => {
|
|
59826
|
+
const map = /* @__PURE__ */ new Map();
|
|
59827
|
+
const keyOf = (p2) => `${p2.type}||${p2.processed}||${p2.hashValue ?? ""}`;
|
|
59828
|
+
for (const p2 of a || []) map.set(keyOf(p2), p2);
|
|
59829
|
+
for (const p2 of b || []) map.set(keyOf(p2), p2);
|
|
59830
|
+
return Array.from(map.values());
|
|
59831
|
+
};
|
|
59832
|
+
const getMergeParseInfos = (options) => {
|
|
59833
|
+
const { minFormulaExpr, maxFormulaExpr } = options;
|
|
59834
|
+
let minInfos = [];
|
|
59835
|
+
let maxInfos = [];
|
|
59836
|
+
try {
|
|
59837
|
+
if (minFormulaExpr) minInfos = getParseFormulaVarInfos2(minFormulaExpr)?.parseInfos || [];
|
|
59838
|
+
} catch (e) {
|
|
59839
|
+
minInfos = [];
|
|
59840
|
+
}
|
|
59841
|
+
try {
|
|
59842
|
+
if (maxFormulaExpr) maxInfos = getParseFormulaVarInfos2(maxFormulaExpr)?.parseInfos || [];
|
|
59843
|
+
} catch (e) {
|
|
59844
|
+
maxInfos = [];
|
|
59845
|
+
}
|
|
59846
|
+
const merged = mergeParseInfos(minInfos, maxInfos);
|
|
59847
|
+
return merged;
|
|
59848
|
+
};
|
|
59849
|
+
return {
|
|
59850
|
+
identify,
|
|
59851
|
+
getParseFormulaVarInfos: getParseFormulaVarInfos2,
|
|
59852
|
+
calculateFormula: calculateFormula2,
|
|
59853
|
+
getMergeParseInfos
|
|
59574
59854
|
};
|
|
59575
59855
|
}
|
|
59576
|
-
function
|
|
59577
|
-
if (!
|
|
59578
|
-
|
|
59579
|
-
|
|
59580
|
-
|
|
59581
|
-
|
|
59582
|
-
|
|
59583
|
-
|
|
59584
|
-
|
|
59585
|
-
|
|
59586
|
-
|
|
59587
|
-
|
|
59588
|
-
|
|
59589
|
-
|
|
59590
|
-
|
|
59591
|
-
|
|
59592
|
-
|
|
59593
|
-
|
|
59594
|
-
|
|
59595
|
-
|
|
59596
|
-
|
|
59597
|
-
|
|
59598
|
-
return "%";
|
|
59599
|
-
}
|
|
59600
|
-
if (i2 >= len) {
|
|
59601
|
-
return x;
|
|
59602
|
-
}
|
|
59603
|
-
switch (x) {
|
|
59604
|
-
case "%s":
|
|
59605
|
-
return String(args[i2++]);
|
|
59606
|
-
case "%d":
|
|
59607
|
-
return Number(args[i2++]);
|
|
59608
|
-
case "%j":
|
|
59609
|
-
try {
|
|
59610
|
-
return JSON.stringify(args[i2++]);
|
|
59611
|
-
} catch (_) {
|
|
59612
|
-
return "[Circular]";
|
|
59613
|
-
}
|
|
59614
|
-
break;
|
|
59615
|
-
default:
|
|
59616
|
-
return x;
|
|
59856
|
+
function setSelectAnnotationId(id, basicInfoItem, event) {
|
|
59857
|
+
if (!basicInfoItem) return;
|
|
59858
|
+
const { emitter: emitter2, EmitterEnum: EmitterEnum2 } = useNocodeEmitter();
|
|
59859
|
+
if (event?.target) {
|
|
59860
|
+
const target = event.target;
|
|
59861
|
+
const clickedIcon = target.closest(".annotation-icon");
|
|
59862
|
+
if (clickedIcon) {
|
|
59863
|
+
const cellDiv = target.closest(".cell-wrapper-container");
|
|
59864
|
+
if (cellDiv) {
|
|
59865
|
+
const scope = cellDiv.closest(".combine-fields-area") ?? cellDiv.closest("td") ?? cellDiv;
|
|
59866
|
+
const locations = [
|
|
59867
|
+
...new Set(
|
|
59868
|
+
Array.from(scope.querySelectorAll(".annotation-icon")).map((el2) => el2.dataset.ann).filter((loc) => !!loc)
|
|
59869
|
+
)
|
|
59870
|
+
];
|
|
59871
|
+
if (locations.length) {
|
|
59872
|
+
basicInfoItem.annSelectId = locations.length === 1 ? locations[0] : locations;
|
|
59873
|
+
emitter2.emit(EmitterEnum2.__on__open_single_annotation_detail_, {
|
|
59874
|
+
cellLocation: locations.length === 1 ? locations[0] : locations
|
|
59875
|
+
});
|
|
59876
|
+
return;
|
|
59877
|
+
}
|
|
59617
59878
|
}
|
|
59618
|
-
});
|
|
59619
|
-
return str;
|
|
59620
|
-
}
|
|
59621
|
-
return template;
|
|
59622
|
-
}
|
|
59623
|
-
function isNativeStringType(type4) {
|
|
59624
|
-
return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
|
|
59625
|
-
}
|
|
59626
|
-
function isEmptyValue(value, type4) {
|
|
59627
|
-
if (value === void 0 || value === null) {
|
|
59628
|
-
return true;
|
|
59629
|
-
}
|
|
59630
|
-
if (type4 === "array" && Array.isArray(value) && !value.length) {
|
|
59631
|
-
return true;
|
|
59632
|
-
}
|
|
59633
|
-
if (isNativeStringType(type4) && typeof value === "string" && !value) {
|
|
59634
|
-
return true;
|
|
59635
|
-
}
|
|
59636
|
-
return false;
|
|
59637
|
-
}
|
|
59638
|
-
function asyncParallelArray(arr, func, callback) {
|
|
59639
|
-
var results = [];
|
|
59640
|
-
var total = 0;
|
|
59641
|
-
var arrLength = arr.length;
|
|
59642
|
-
function count(errors) {
|
|
59643
|
-
results.push.apply(results, errors || []);
|
|
59644
|
-
total++;
|
|
59645
|
-
if (total === arrLength) {
|
|
59646
|
-
callback(results);
|
|
59647
59879
|
}
|
|
59648
59880
|
}
|
|
59649
|
-
|
|
59650
|
-
|
|
59881
|
+
if (isEmpty(id)) return;
|
|
59882
|
+
const newId = id === "gct-nocode-ann-main" ? "" : id;
|
|
59883
|
+
basicInfoItem.annSelectId = newId;
|
|
59884
|
+
emitter2.emit(EmitterEnum2.__on__open_single_annotation_detail_, {
|
|
59885
|
+
cellLocation: newId
|
|
59651
59886
|
});
|
|
59652
59887
|
}
|
|
59653
|
-
function
|
|
59654
|
-
|
|
59655
|
-
|
|
59656
|
-
|
|
59657
|
-
|
|
59658
|
-
|
|
59659
|
-
|
|
59660
|
-
|
|
59661
|
-
|
|
59888
|
+
function closeValidatorPopovers() {
|
|
59889
|
+
document.querySelectorAll(".nocode-validator-tooltip-wrapper").forEach((node) => {
|
|
59890
|
+
const host = node.closest(".ant-popover, .gct-popover, .popover");
|
|
59891
|
+
host?.remove();
|
|
59892
|
+
});
|
|
59893
|
+
}
|
|
59894
|
+
function setSelectValidatorId(event, basicInfoItem) {
|
|
59895
|
+
if (basicInfoItem && event.target) {
|
|
59896
|
+
closeValidatorPopovers();
|
|
59897
|
+
const cellDiv = event.target.closest(".cell-wrapper-container");
|
|
59898
|
+
if (!cellDiv) return;
|
|
59899
|
+
const clickedIcon = event.target.closest(
|
|
59900
|
+
".validator-icon"
|
|
59901
|
+
);
|
|
59902
|
+
const scope = clickedIcon ? cellDiv.closest(".combine-fields-area") ?? cellDiv.closest("td") ?? cellDiv : cellDiv;
|
|
59903
|
+
const ids = [
|
|
59904
|
+
...new Set(
|
|
59905
|
+
Array.from(scope.querySelectorAll(".validator-icon")).map((el2) => el2.dataset.ann).filter((id) => !!id)
|
|
59906
|
+
)
|
|
59907
|
+
];
|
|
59908
|
+
const validateList = ids.map((id) => basicInfoItem.validatorMessageMap?.[id]).filter(Boolean);
|
|
59909
|
+
const flattenedErrors = validateList.flatMap(
|
|
59910
|
+
(validates) => validates.map(({ field: _field, message: message2 }) => JSON.parse(message2))
|
|
59911
|
+
);
|
|
59912
|
+
const resultMap = flattenedErrors.reduce((acc, item) => {
|
|
59913
|
+
const { showModelName, showModelKey, subFieldKey, showFieldName, targetFieldId, message: message2 } = item;
|
|
59914
|
+
if (!acc[showModelKey]) {
|
|
59915
|
+
acc[showModelKey] = {
|
|
59916
|
+
showModelName,
|
|
59917
|
+
showModelKey,
|
|
59918
|
+
subFieldKey,
|
|
59919
|
+
fields: []
|
|
59920
|
+
};
|
|
59921
|
+
}
|
|
59922
|
+
acc[showModelKey].fields.push({ showFieldName, targetFieldId, message: message2 });
|
|
59923
|
+
return acc;
|
|
59924
|
+
}, {});
|
|
59925
|
+
if (Object.keys(resultMap).length) {
|
|
59926
|
+
const contentVNode = h$1(
|
|
59927
|
+
"div",
|
|
59928
|
+
{ class: "nocode-validator-tooltip-wrapper" },
|
|
59929
|
+
Object.values(resultMap).map(
|
|
59930
|
+
(data) => h$1("div", { class: "nocode-validator-tooltip-container", key: data.showModelKey }, [
|
|
59931
|
+
h$1("div", { class: "nocode-validator-tooltip-header" }, data.showModelName),
|
|
59932
|
+
h$1(
|
|
59933
|
+
"div",
|
|
59934
|
+
{ class: "nocode-validator-tooltip-header-label" },
|
|
59935
|
+
`${data.showModelKey}${data.subFieldKey ? "|" + data.subFieldKey : ""}`
|
|
59936
|
+
),
|
|
59937
|
+
h$1(
|
|
59938
|
+
"ul",
|
|
59939
|
+
{ class: "nocode-validator-tooltip-content" },
|
|
59940
|
+
data.fields.map(
|
|
59941
|
+
(field, index2) => h$1(
|
|
59942
|
+
"li",
|
|
59943
|
+
{ key: `${field.targetFieldId}-${index2}` },
|
|
59944
|
+
`${field.showFieldName}(${field.targetFieldId}):${field.message}`
|
|
59945
|
+
)
|
|
59946
|
+
)
|
|
59947
|
+
)
|
|
59948
|
+
])
|
|
59949
|
+
)
|
|
59950
|
+
);
|
|
59951
|
+
const iconEl = clickedIcon ?? scope.querySelector(".validator-icon");
|
|
59952
|
+
const anchorEl = iconEl ?? cellDiv;
|
|
59953
|
+
window.window.NocodeAdapter.utils.overlay.popover(
|
|
59954
|
+
anchorEl,
|
|
59955
|
+
contentVNode,
|
|
59956
|
+
{},
|
|
59957
|
+
{ placement: "top-center" }
|
|
59958
|
+
);
|
|
59959
|
+
}
|
|
59960
|
+
}
|
|
59961
|
+
}
|
|
59962
|
+
function setSelectMobileTdId(tdInfo, basicInfoItem, widgetCenter, callback, sbRowIndex) {
|
|
59963
|
+
const getWidgetInfo = () => {
|
|
59964
|
+
const { preLocation, props: tdProps } = tdInfo || {};
|
|
59965
|
+
const paper = widgetCenter?.[ComponentTypeEnum.PAPER];
|
|
59966
|
+
const subTable2DList = paper.props.subTable2DList ?? [];
|
|
59967
|
+
const checkTable2DList = paper.props.checkTable2DList ?? [];
|
|
59968
|
+
const fixedTableLenMap = paper.props.fixedTableLenMap ?? {};
|
|
59969
|
+
const getTdIds = (key) => [...basicInfoItem?.mobileTdIdGroups.get(key) || []];
|
|
59970
|
+
const assignWidgetInfo = (fillType, params) => {
|
|
59971
|
+
const { rowSubFieldKey = "", colSubFieldKey = "" } = params;
|
|
59972
|
+
const mainSetKey = rowSubFieldKey !== "gct_mobile_main" ? `gct_mobile_sub.${rowSubFieldKey}` : rowSubFieldKey;
|
|
59973
|
+
const linkSetKey = colSubFieldKey ? `gct_mobile_sub.${colSubFieldKey}` : colSubFieldKey;
|
|
59974
|
+
return {
|
|
59975
|
+
fillType,
|
|
59976
|
+
clickTdId: tdInfo.id,
|
|
59977
|
+
clickSbRowIndex: sbRowIndex,
|
|
59978
|
+
mainWidgetIds: getTdIds(mainSetKey),
|
|
59979
|
+
linkWidgetIds: getTdIds(linkSetKey),
|
|
59980
|
+
subInfo: params
|
|
59981
|
+
};
|
|
59982
|
+
};
|
|
59983
|
+
if (preLocation === ComponentTypeEnum.PAPER) {
|
|
59984
|
+
if (tdProps.isNewFixedTableTd) {
|
|
59985
|
+
const item2 = subTable2DList.find(
|
|
59986
|
+
(i2) => i2.subTable2d && i2.colSubFieldKey === tdProps.fixedTableFieldId
|
|
59987
|
+
);
|
|
59988
|
+
return item2 ? assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE_2D, {
|
|
59989
|
+
...item2,
|
|
59990
|
+
childInitRowLen: 1 * ((fixedTableLenMap?.[item2.colSubFieldKey] ?? 0) + 1)
|
|
59991
|
+
}) : assignWidgetInfo(MobileFillTypeEnum.FIXED_TABLE, {
|
|
59992
|
+
rowSubFieldKey: tdProps.fixedTableFieldId
|
|
59993
|
+
});
|
|
59994
|
+
}
|
|
59995
|
+
if (tdProps.isNewCheckTable2D) {
|
|
59996
|
+
const item2 = checkTable2DList.find(
|
|
59997
|
+
(i2) => i2.checkTable2d && (i2.colSubFieldKey === tdProps.fixedTableFieldId || i2.rowSubFieldKey === tdProps.fixedTableFieldId)
|
|
59998
|
+
);
|
|
59999
|
+
if (item2) {
|
|
60000
|
+
return assignWidgetInfo(MobileFillTypeEnum.CHECK_TABLE_2D, item2);
|
|
60001
|
+
}
|
|
60002
|
+
}
|
|
60003
|
+
return assignWidgetInfo(MobileFillTypeEnum.MAIN_FIELD, { rowSubFieldKey: "gct_mobile_main" });
|
|
60004
|
+
}
|
|
60005
|
+
const subTableFieldId = widgetCenter?.[preLocation]?.props?.field;
|
|
60006
|
+
if (!subTableFieldId) return;
|
|
60007
|
+
const item = subTable2DList.find((i2) => i2.subTable2d && i2.rowSubFieldKey === subTableFieldId);
|
|
60008
|
+
return item ? assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE_2D, {
|
|
60009
|
+
...item,
|
|
60010
|
+
childInitRowLen: 1 * ((fixedTableLenMap?.[item.colSubFieldKey] ?? 0) + 1)
|
|
60011
|
+
}) : assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE, { rowSubFieldKey: subTableFieldId });
|
|
60012
|
+
};
|
|
60013
|
+
if (basicInfoItem) {
|
|
60014
|
+
basicInfoItem.mobileSelectTdId = tdInfo.id;
|
|
60015
|
+
const widgetInfo = getWidgetInfo();
|
|
60016
|
+
callback?.(basicInfoItem, widgetInfo);
|
|
60017
|
+
}
|
|
60018
|
+
}
|
|
60019
|
+
function getSubTableQuickFillInfo(subTableFieldId, mobileTdIdGroups) {
|
|
60020
|
+
const getTdIds = (key) => [...mobileTdIdGroups.get(key) || []];
|
|
60021
|
+
const assignWidgetInfo = (fillType, params) => {
|
|
60022
|
+
const { rowSubFieldKey = "", colSubFieldKey = "" } = params;
|
|
60023
|
+
const mainSetKey = rowSubFieldKey !== "gct_mobile_main" ? `gct_mobile_sub.${rowSubFieldKey}` : rowSubFieldKey;
|
|
60024
|
+
const linkSetKey = colSubFieldKey ? `gct_mobile_sub.${colSubFieldKey}` : colSubFieldKey;
|
|
60025
|
+
return {
|
|
60026
|
+
fillType,
|
|
60027
|
+
mainWidgetIds: getTdIds(mainSetKey),
|
|
60028
|
+
linkWidgetIds: getTdIds(linkSetKey),
|
|
60029
|
+
subInfo: params
|
|
60030
|
+
};
|
|
60031
|
+
};
|
|
60032
|
+
if (!subTableFieldId) return;
|
|
60033
|
+
return assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE, { rowSubFieldKey: subTableFieldId });
|
|
60034
|
+
}
|
|
60035
|
+
const isEmptyValue$1 = (value) => {
|
|
60036
|
+
return value === void 0 || value === null || typeof value === "string" && value.trim() === "" || Array.isArray(value) && value.length === 0;
|
|
60037
|
+
};
|
|
60038
|
+
const compareByOp = (left, right, op) => {
|
|
60039
|
+
switch (op) {
|
|
60040
|
+
case RangeCompareOp.LT:
|
|
60041
|
+
return left < right;
|
|
60042
|
+
case RangeCompareOp.LE:
|
|
60043
|
+
return left <= right;
|
|
60044
|
+
case RangeCompareOp.GT:
|
|
60045
|
+
return left > right;
|
|
60046
|
+
case RangeCompareOp.GE:
|
|
60047
|
+
default:
|
|
60048
|
+
return left >= right;
|
|
60049
|
+
}
|
|
60050
|
+
};
|
|
60051
|
+
const rangeCompareMessage = (op, val) => {
|
|
60052
|
+
switch (op) {
|
|
60053
|
+
case RangeCompareOp.LT:
|
|
60054
|
+
return $t("sys.fieldValueNotGreaterOrEqual", { val });
|
|
60055
|
+
case RangeCompareOp.LE:
|
|
60056
|
+
return $t("sys.fieldValueNoMoreThan", { val });
|
|
60057
|
+
case RangeCompareOp.GT:
|
|
60058
|
+
return $t("sys.fieldValueNotLessOrEqual", { val });
|
|
60059
|
+
case RangeCompareOp.GE:
|
|
60060
|
+
default:
|
|
60061
|
+
return $t("sys.fieldValueNotLessThan", { val });
|
|
60062
|
+
}
|
|
60063
|
+
};
|
|
60064
|
+
const toUnixTimestamp = (input) => {
|
|
60065
|
+
if (isNil(input) || input === "") return null;
|
|
60066
|
+
const asNumber = typeof input === "number" || typeof input === "string" && /^-?\d+(\.\d+)?$/.test(input.trim());
|
|
60067
|
+
if (asNumber) {
|
|
60068
|
+
const n = Number(input);
|
|
60069
|
+
if (Number.isNaN(n)) return null;
|
|
60070
|
+
const parsed2 = n > 1e12 ? dayjs(n) : dayjs.unix(n);
|
|
60071
|
+
return parsed2.isValid() ? parsed2.unix() : null;
|
|
60072
|
+
}
|
|
60073
|
+
const parsed = dayjs(input);
|
|
60074
|
+
return parsed.isValid() ? parsed.unix() : null;
|
|
60075
|
+
};
|
|
60076
|
+
const buildError = (validatorInfo, message2) => JSON.stringify({ ...validatorInfo, message: message2 });
|
|
60077
|
+
const createRule = (validator, message2, trigger = "change") => ({
|
|
60078
|
+
required: true,
|
|
60079
|
+
validator,
|
|
60080
|
+
message: message2,
|
|
60081
|
+
trigger
|
|
60082
|
+
});
|
|
60083
|
+
function relocateDeletedRowsToEnd(rows = []) {
|
|
60084
|
+
const active = [];
|
|
60085
|
+
const deleted = [];
|
|
60086
|
+
for (const row of rows) {
|
|
60087
|
+
if (row?.deleted_) deleted.push(row);
|
|
60088
|
+
else active.push(row);
|
|
60089
|
+
}
|
|
60090
|
+
return [...active, ...deleted];
|
|
60091
|
+
}
|
|
60092
|
+
function getCurrentFormData(_rule, options) {
|
|
60093
|
+
if (!_rule._subtableFieldId) return options?.formData;
|
|
60094
|
+
const subTableData = options?.formData?.[_rule._subtableFieldId];
|
|
60095
|
+
if (!isNil(_rule._realRowIndex) && isNil(_rule._childSubTableDataIndex)) {
|
|
60096
|
+
return subTableData?.[_rule._realRowIndex];
|
|
60097
|
+
}
|
|
60098
|
+
if (!isNil(_rule._realRowIndex) && !isNil(_rule._childSubTableDataIndex)) {
|
|
60099
|
+
return subTableData?.[_rule._realRowIndex]?.["_2DTABLE_"]?.[_rule._childSubTableDataIndex];
|
|
60100
|
+
}
|
|
60101
|
+
return options?.formData;
|
|
60102
|
+
}
|
|
60103
|
+
function isSameOptionValue(current, expected) {
|
|
60104
|
+
if (typeof expected === "boolean") {
|
|
60105
|
+
return renderUtils.getBoolValue(current) === expected;
|
|
60106
|
+
}
|
|
60107
|
+
if (current === void 0 || current === null || current === "") {
|
|
60108
|
+
return false;
|
|
60109
|
+
}
|
|
60110
|
+
return String(current) === String(expected);
|
|
60111
|
+
}
|
|
60112
|
+
function resolveAttachContext(rule, metaAttach) {
|
|
60113
|
+
if (metaAttach?.belongFieldId != null && !isNil(metaAttach.optionValue)) {
|
|
60114
|
+
return {
|
|
60115
|
+
_belongFieldId: metaAttach.belongFieldId,
|
|
60116
|
+
_optionValue: metaAttach.optionValue,
|
|
60117
|
+
_multiple: metaAttach.multiple,
|
|
60118
|
+
_subtableFieldId: metaAttach.subtableFieldId,
|
|
60119
|
+
_realRowIndex: metaAttach.realRowIndex,
|
|
60120
|
+
_childSubTableDataIndex: metaAttach.childSubTableDataIndex
|
|
60121
|
+
};
|
|
60122
|
+
}
|
|
60123
|
+
return rule;
|
|
60124
|
+
}
|
|
60125
|
+
function isAttachFieldActive(rule, formData) {
|
|
60126
|
+
if (!rule?._belongFieldId || isNil(rule._optionValue)) {
|
|
60127
|
+
return true;
|
|
60128
|
+
}
|
|
60129
|
+
const row = getCurrentFormData(rule, { formData });
|
|
60130
|
+
if (rule._subtableFieldId && (isNil(rule._realRowIndex) || !row || row === formData)) {
|
|
60131
|
+
return false;
|
|
60132
|
+
}
|
|
60133
|
+
const raw = row?.[rule._belongFieldId];
|
|
60134
|
+
if (rule._multiple) {
|
|
60135
|
+
const current = renderUtils.getValue(raw, true);
|
|
60136
|
+
if (!Array.isArray(current)) return false;
|
|
60137
|
+
return current.some((v) => isSameOptionValue(v, rule._optionValue));
|
|
60138
|
+
}
|
|
60139
|
+
return isSameOptionValue(raw, rule._optionValue);
|
|
60140
|
+
}
|
|
60141
|
+
function isReferenceOptionActive(referenceInfo, rowFormData) {
|
|
60142
|
+
if (!referenceInfo?.belongFieldId || isNil(referenceInfo.optionValue)) {
|
|
60143
|
+
return true;
|
|
60144
|
+
}
|
|
60145
|
+
return isAttachFieldActive(
|
|
60146
|
+
{
|
|
60147
|
+
_belongFieldId: referenceInfo.belongFieldId,
|
|
60148
|
+
_optionValue: referenceInfo.optionValue,
|
|
60149
|
+
_multiple: referenceInfo.multiple
|
|
60150
|
+
},
|
|
60151
|
+
rowFormData
|
|
60152
|
+
);
|
|
60153
|
+
}
|
|
60154
|
+
function filterRulesByTrigger(rules2, trigger) {
|
|
60155
|
+
return rules2.filter((rule) => {
|
|
60156
|
+
const ruleTrigger = rule.trigger;
|
|
60157
|
+
if (!ruleTrigger) return trigger === "change";
|
|
60158
|
+
if (trigger === "blur") {
|
|
60159
|
+
return ruleTrigger === "blur" || ruleTrigger === "change";
|
|
60160
|
+
}
|
|
60161
|
+
return ruleTrigger === trigger;
|
|
60162
|
+
});
|
|
60163
|
+
}
|
|
60164
|
+
function assembleRules(input) {
|
|
60165
|
+
const { showRequired, fieldType, validatorInfo, props } = input;
|
|
60166
|
+
const {
|
|
60167
|
+
minlength,
|
|
60168
|
+
maxlength,
|
|
60169
|
+
regex,
|
|
60170
|
+
regexHint,
|
|
60171
|
+
validateTrue,
|
|
60172
|
+
validateFalse,
|
|
60173
|
+
enableRangeValidate,
|
|
60174
|
+
maxValidateMode,
|
|
60175
|
+
minValidateMode,
|
|
60176
|
+
maxCompareOp,
|
|
60177
|
+
minCompareOp,
|
|
60178
|
+
minValue,
|
|
60179
|
+
maxValue,
|
|
60180
|
+
minFormulaExpr,
|
|
60181
|
+
maxFormulaExpr,
|
|
60182
|
+
minDate,
|
|
60183
|
+
maxDate,
|
|
60184
|
+
minDateFormulaExpr,
|
|
60185
|
+
maxDateFormulaExpr,
|
|
60186
|
+
maxDateValidateMode,
|
|
60187
|
+
minDateValidateMode
|
|
60188
|
+
} = props;
|
|
60189
|
+
const resolvedMaxCompareOp = maxCompareOp ?? RangeCompareOp.LE;
|
|
60190
|
+
const resolvedMinCompareOp = minCompareOp ?? RangeCompareOp.GE;
|
|
60191
|
+
const RuleProps = [];
|
|
60192
|
+
if (showRequired) {
|
|
60193
|
+
RuleProps.push(
|
|
60194
|
+
createRule(
|
|
60195
|
+
(_rule, value) => !isEmptyValue$1(value),
|
|
60196
|
+
buildError(validatorInfo, $t("sys.fieldRequired")),
|
|
60197
|
+
"manual"
|
|
60198
|
+
)
|
|
60199
|
+
);
|
|
60200
|
+
}
|
|
60201
|
+
if (!isNil(minlength)) {
|
|
60202
|
+
RuleProps.push(
|
|
60203
|
+
createRule((_rule, value) => {
|
|
60204
|
+
if (isEmptyValue$1(value)) return true;
|
|
60205
|
+
return String(value).length >= minlength;
|
|
60206
|
+
}, buildError(validatorInfo, $t("sys.fieldLengthNotLessThan", { len: minlength })))
|
|
60207
|
+
);
|
|
60208
|
+
}
|
|
60209
|
+
if (!isNil(maxlength)) {
|
|
60210
|
+
RuleProps.push(
|
|
60211
|
+
createRule((_rule, value) => {
|
|
60212
|
+
if (isEmptyValue$1(value)) return true;
|
|
60213
|
+
return String(value).length <= maxlength;
|
|
60214
|
+
}, buildError(validatorInfo, $t("sys.fieldLengthNoMoreThan", { len: maxlength })))
|
|
60215
|
+
);
|
|
60216
|
+
}
|
|
60217
|
+
if (regex) {
|
|
60218
|
+
RuleProps.push(
|
|
60219
|
+
createRule((_rule, value) => {
|
|
60220
|
+
if (isEmptyValue$1(value)) return true;
|
|
60221
|
+
return new RegExp(regex).test(value);
|
|
60222
|
+
}, buildError(validatorInfo, regexHint ?? $t("sys.fieldFormatError")))
|
|
60223
|
+
);
|
|
60224
|
+
}
|
|
60225
|
+
if (validateTrue) {
|
|
60226
|
+
RuleProps.push({
|
|
60227
|
+
required: true,
|
|
60228
|
+
trigger: "manual",
|
|
60229
|
+
validator: (_rule, value) => value === true,
|
|
60230
|
+
message: buildError(validatorInfo, $t("sys.fieldValueNeedTrue"))
|
|
60231
|
+
});
|
|
60232
|
+
}
|
|
60233
|
+
if (validateFalse) {
|
|
60234
|
+
RuleProps.push({
|
|
60235
|
+
required: true,
|
|
60236
|
+
trigger: "manual",
|
|
60237
|
+
validator: (_rule, value) => value === false,
|
|
60238
|
+
message: buildError(validatorInfo, $t("sys.fieldValueNeedFalse"))
|
|
60239
|
+
});
|
|
60240
|
+
}
|
|
60241
|
+
if (!enableRangeValidate) {
|
|
60242
|
+
return RuleProps;
|
|
60243
|
+
}
|
|
60244
|
+
if (minValidateMode === RangeValidateMode.Fixed_Number) {
|
|
60245
|
+
RuleProps.push(
|
|
60246
|
+
createRule((_rule, value) => {
|
|
60247
|
+
if (isEmptyValue$1(value)) return true;
|
|
60248
|
+
return compareByOp(Number(value), Number(minValue), resolvedMinCompareOp);
|
|
60249
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, minValue)))
|
|
60250
|
+
);
|
|
60251
|
+
}
|
|
60252
|
+
if (minValidateMode === RangeValidateMode.Variable_Validate && minFormulaExpr) {
|
|
60253
|
+
RuleProps.push({
|
|
60254
|
+
required: true,
|
|
60255
|
+
trigger: "change",
|
|
60256
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60257
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60258
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60259
|
+
const formulaValue = await calculateFormula2(
|
|
60260
|
+
minFormulaExpr,
|
|
60261
|
+
currentFormData,
|
|
60262
|
+
options?.formData
|
|
60263
|
+
);
|
|
60264
|
+
const parsedMin = parseFloat(formulaValue);
|
|
60265
|
+
if (!isNaN(parsedMin)) {
|
|
60266
|
+
if (isEmptyValue$1(value)) {
|
|
60267
|
+
return Promise.resolve();
|
|
60268
|
+
}
|
|
60269
|
+
if (!compareByOp(Number(value), parsedMin, resolvedMinCompareOp)) {
|
|
60270
|
+
return Promise.reject(
|
|
60271
|
+
new Error(
|
|
60272
|
+
buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, parsedMin))
|
|
60273
|
+
)
|
|
60274
|
+
);
|
|
60275
|
+
}
|
|
60276
|
+
}
|
|
60277
|
+
return Promise.resolve();
|
|
60278
|
+
}
|
|
60279
|
+
});
|
|
60280
|
+
}
|
|
60281
|
+
if (maxValidateMode === RangeValidateMode.Fixed_Number) {
|
|
60282
|
+
RuleProps.push(
|
|
60283
|
+
createRule((_rule, value) => {
|
|
60284
|
+
if (isEmptyValue$1(value)) return true;
|
|
60285
|
+
return compareByOp(Number(value), Number(maxValue), resolvedMaxCompareOp);
|
|
60286
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, maxValue)))
|
|
60287
|
+
);
|
|
60288
|
+
}
|
|
60289
|
+
if (maxValidateMode === RangeValidateMode.Variable_Validate && maxFormulaExpr) {
|
|
60290
|
+
RuleProps.push({
|
|
60291
|
+
required: true,
|
|
60292
|
+
trigger: "change",
|
|
60293
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60294
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60295
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60296
|
+
const formulaValue = await calculateFormula2(
|
|
60297
|
+
maxFormulaExpr,
|
|
60298
|
+
currentFormData,
|
|
60299
|
+
options?.formData
|
|
60300
|
+
);
|
|
60301
|
+
const parsedMax = parseFloat(formulaValue);
|
|
60302
|
+
if (!isNaN(parsedMax)) {
|
|
60303
|
+
if (isEmptyValue$1(value)) {
|
|
60304
|
+
return Promise.resolve();
|
|
60305
|
+
}
|
|
60306
|
+
if (!compareByOp(Number(value), parsedMax, resolvedMaxCompareOp)) {
|
|
60307
|
+
return Promise.reject(
|
|
60308
|
+
new Error(
|
|
60309
|
+
buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, parsedMax))
|
|
60310
|
+
)
|
|
60311
|
+
);
|
|
60312
|
+
}
|
|
60313
|
+
}
|
|
60314
|
+
return Promise.resolve();
|
|
60315
|
+
}
|
|
60316
|
+
});
|
|
60317
|
+
}
|
|
60318
|
+
if (minDateValidateMode === RangeValidateMode.Fixed_Number && minDate) {
|
|
60319
|
+
RuleProps.push(
|
|
60320
|
+
createRule((_rule, value) => {
|
|
60321
|
+
if (isEmptyValue$1(value)) return true;
|
|
60322
|
+
const inputTime = dayjs(value).unix();
|
|
60323
|
+
const minTimestamp = dayjs(minDate).unix();
|
|
60324
|
+
if (!dayjs(value).isValid() || !dayjs(minDate).isValid()) return true;
|
|
60325
|
+
return compareByOp(inputTime, minTimestamp, resolvedMinCompareOp);
|
|
60326
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, minDate)))
|
|
60327
|
+
);
|
|
60328
|
+
}
|
|
60329
|
+
if (maxDateValidateMode === RangeValidateMode.Fixed_Number && maxDate) {
|
|
60330
|
+
RuleProps.push(
|
|
60331
|
+
createRule((_rule, value) => {
|
|
60332
|
+
if (isEmptyValue$1(value)) return true;
|
|
60333
|
+
const inputTime = dayjs(value).unix();
|
|
60334
|
+
const maxTimestamp = dayjs(maxDate).unix();
|
|
60335
|
+
if (!dayjs(value).isValid() || !dayjs(maxDate).isValid()) return true;
|
|
60336
|
+
return compareByOp(inputTime, maxTimestamp, resolvedMaxCompareOp);
|
|
60337
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, maxDate)))
|
|
60338
|
+
);
|
|
60339
|
+
}
|
|
60340
|
+
if (minDateValidateMode === RangeValidateMode.Variable_Validate && minDateFormulaExpr) {
|
|
60341
|
+
RuleProps.push({
|
|
60342
|
+
required: true,
|
|
60343
|
+
trigger: "change",
|
|
60344
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60345
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60346
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60347
|
+
const formulaValue = await calculateFormula2(
|
|
60348
|
+
minDateFormulaExpr,
|
|
60349
|
+
currentFormData,
|
|
60350
|
+
options?.formData
|
|
60351
|
+
);
|
|
60352
|
+
const limitTime = toUnixTimestamp(formulaValue);
|
|
60353
|
+
if (limitTime !== null) {
|
|
60354
|
+
if (isEmptyValue$1(value)) {
|
|
60355
|
+
return Promise.resolve();
|
|
60356
|
+
}
|
|
60357
|
+
if (!dayjs(value).isValid()) {
|
|
60358
|
+
return Promise.resolve();
|
|
60359
|
+
}
|
|
60360
|
+
const inputTime = dayjs(value).unix();
|
|
60361
|
+
const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
60362
|
+
if (!compareByOp(inputTime, limitTime, resolvedMinCompareOp)) {
|
|
60363
|
+
return Promise.reject(
|
|
60364
|
+
new Error(
|
|
60365
|
+
buildError(
|
|
60366
|
+
validatorInfo,
|
|
60367
|
+
rangeCompareMessage(resolvedMinCompareOp, dayjs.unix(limitTime).format(fmt))
|
|
60368
|
+
)
|
|
60369
|
+
)
|
|
60370
|
+
);
|
|
60371
|
+
}
|
|
60372
|
+
}
|
|
60373
|
+
return Promise.resolve();
|
|
60374
|
+
}
|
|
60375
|
+
});
|
|
60376
|
+
}
|
|
60377
|
+
if (maxDateValidateMode === RangeValidateMode.Variable_Validate && maxDateFormulaExpr) {
|
|
60378
|
+
RuleProps.push({
|
|
60379
|
+
required: true,
|
|
60380
|
+
trigger: "change",
|
|
60381
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60382
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60383
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60384
|
+
const formulaValue = await calculateFormula2(
|
|
60385
|
+
maxDateFormulaExpr,
|
|
60386
|
+
currentFormData,
|
|
60387
|
+
options?.formData
|
|
60388
|
+
);
|
|
60389
|
+
const limitTime = toUnixTimestamp(formulaValue);
|
|
60390
|
+
if (limitTime !== null) {
|
|
60391
|
+
if (isEmptyValue$1(value)) {
|
|
60392
|
+
return Promise.resolve();
|
|
60393
|
+
}
|
|
60394
|
+
if (!dayjs(value).isValid()) {
|
|
60395
|
+
return Promise.resolve();
|
|
60396
|
+
}
|
|
60397
|
+
const inputTime = dayjs(value).unix();
|
|
60398
|
+
const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
60399
|
+
if (!compareByOp(inputTime, limitTime, resolvedMaxCompareOp)) {
|
|
60400
|
+
return Promise.reject(
|
|
60401
|
+
new Error(
|
|
60402
|
+
buildError(
|
|
60403
|
+
validatorInfo,
|
|
60404
|
+
rangeCompareMessage(resolvedMaxCompareOp, dayjs.unix(limitTime).format(fmt))
|
|
60405
|
+
)
|
|
60406
|
+
)
|
|
60407
|
+
);
|
|
60408
|
+
}
|
|
60409
|
+
}
|
|
60410
|
+
return Promise.resolve();
|
|
60411
|
+
}
|
|
60412
|
+
});
|
|
60413
|
+
}
|
|
60414
|
+
return RuleProps;
|
|
60415
|
+
}
|
|
60416
|
+
const formRules = ref({});
|
|
60417
|
+
const formRuleMeta = ref({});
|
|
60418
|
+
const formRuleOwner = /* @__PURE__ */ new Map();
|
|
60419
|
+
function setFormRule(key, rules2, meta, owner) {
|
|
60420
|
+
formRules.value[key] = rules2;
|
|
60421
|
+
formRuleMeta.value[key] = meta;
|
|
60422
|
+
if (owner !== void 0) formRuleOwner.set(key, owner);
|
|
60423
|
+
}
|
|
60424
|
+
function deleteFormRule(key, owner) {
|
|
60425
|
+
if (owner !== void 0 && formRuleOwner.get(key) !== owner) {
|
|
60426
|
+
return;
|
|
60427
|
+
}
|
|
60428
|
+
delete formRules.value[key];
|
|
60429
|
+
delete formRuleMeta.value[key];
|
|
60430
|
+
formRuleOwner.delete(key);
|
|
60431
|
+
}
|
|
60432
|
+
function clearFormRules$1() {
|
|
60433
|
+
formRules.value = {};
|
|
60434
|
+
formRuleMeta.value = {};
|
|
60435
|
+
formRuleOwner.clear();
|
|
60436
|
+
}
|
|
60437
|
+
function getRawFormRules() {
|
|
60438
|
+
return toRaw(formRules.value);
|
|
60439
|
+
}
|
|
60440
|
+
function getRawFormRuleMeta() {
|
|
60441
|
+
return toRaw(formRuleMeta.value);
|
|
60442
|
+
}
|
|
60443
|
+
function listFormRuleKeys() {
|
|
60444
|
+
return Object.keys(formRules.value);
|
|
60445
|
+
}
|
|
60446
|
+
function deleteSubtableRow$1(subtableFieldId, realRowIndex) {
|
|
60447
|
+
const newFormRules = {};
|
|
60448
|
+
const newFormRuleMeta = {};
|
|
60449
|
+
const newFormRuleOwner = /* @__PURE__ */ new Map();
|
|
60450
|
+
for (const key in formRules.value) {
|
|
60451
|
+
const regex = new RegExp(`^${subtableFieldId}_(\\d+)_`);
|
|
60452
|
+
const match = key.match(regex);
|
|
60453
|
+
if (match) {
|
|
60454
|
+
const rowIndex = parseInt(match[1], 10);
|
|
60455
|
+
if (rowIndex < realRowIndex) {
|
|
60456
|
+
newFormRules[key] = formRules.value[key];
|
|
60457
|
+
if (formRuleMeta.value[key]) {
|
|
60458
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60459
|
+
}
|
|
60460
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60461
|
+
} else if (rowIndex > realRowIndex) {
|
|
60462
|
+
const newKey = key.replace(
|
|
60463
|
+
`${subtableFieldId}_${rowIndex}_`,
|
|
60464
|
+
`${subtableFieldId}_${rowIndex - 1}_`
|
|
60465
|
+
);
|
|
60466
|
+
newFormRules[newKey] = formRules.value[key];
|
|
60467
|
+
if (formRuleMeta.value[key]) {
|
|
60468
|
+
newFormRuleMeta[newKey] = formRuleMeta.value[key];
|
|
60469
|
+
}
|
|
60470
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(newKey, formRuleOwner.get(key));
|
|
60471
|
+
}
|
|
60472
|
+
} else {
|
|
60473
|
+
newFormRules[key] = formRules.value[key];
|
|
60474
|
+
if (formRuleMeta.value[key]) {
|
|
60475
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60476
|
+
}
|
|
60477
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60478
|
+
}
|
|
60479
|
+
}
|
|
60480
|
+
formRules.value = newFormRules;
|
|
60481
|
+
formRuleMeta.value = newFormRuleMeta;
|
|
60482
|
+
formRuleOwner.clear();
|
|
60483
|
+
for (const [k, v] of newFormRuleOwner) formRuleOwner.set(k, v);
|
|
60484
|
+
}
|
|
60485
|
+
function insertSubtableRows$1(subtableFieldId, insertIndex, count = 1) {
|
|
60486
|
+
if (count <= 0) return;
|
|
60487
|
+
const newFormRules = {};
|
|
60488
|
+
const newFormRuleMeta = {};
|
|
60489
|
+
const newFormRuleOwner = /* @__PURE__ */ new Map();
|
|
60490
|
+
const regex = new RegExp(`^${subtableFieldId}_(\\d+)_`);
|
|
60491
|
+
const entries = Object.keys(formRules.value).map((key) => {
|
|
60492
|
+
const match = key.match(regex);
|
|
60493
|
+
return {
|
|
60494
|
+
key,
|
|
60495
|
+
rowIndex: match ? parseInt(match[1], 10) : -1
|
|
60496
|
+
};
|
|
60497
|
+
});
|
|
60498
|
+
entries.sort((a, b) => b.rowIndex - a.rowIndex).forEach(({ key, rowIndex }) => {
|
|
60499
|
+
if (rowIndex < 0) {
|
|
60500
|
+
newFormRules[key] = formRules.value[key];
|
|
60501
|
+
if (formRuleMeta.value[key]) {
|
|
60502
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60503
|
+
}
|
|
60504
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60505
|
+
return;
|
|
60506
|
+
}
|
|
60507
|
+
if (rowIndex < insertIndex) {
|
|
60508
|
+
newFormRules[key] = formRules.value[key];
|
|
60509
|
+
if (formRuleMeta.value[key]) {
|
|
60510
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60511
|
+
}
|
|
60512
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60513
|
+
return;
|
|
60514
|
+
}
|
|
60515
|
+
const newKey = key.replace(
|
|
60516
|
+
`${subtableFieldId}_${rowIndex}_`,
|
|
60517
|
+
`${subtableFieldId}_${rowIndex + count}_`
|
|
60518
|
+
);
|
|
60519
|
+
newFormRules[newKey] = formRules.value[key];
|
|
60520
|
+
if (formRuleMeta.value[key]) {
|
|
60521
|
+
newFormRuleMeta[newKey] = formRuleMeta.value[key];
|
|
60522
|
+
}
|
|
60523
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(newKey, formRuleOwner.get(key));
|
|
60524
|
+
});
|
|
60525
|
+
formRules.value = newFormRules;
|
|
60526
|
+
formRuleMeta.value = newFormRuleMeta;
|
|
60527
|
+
formRuleOwner.clear();
|
|
60528
|
+
for (const [k, v] of newFormRuleOwner) formRuleOwner.set(k, v);
|
|
60529
|
+
}
|
|
60530
|
+
function _extends() {
|
|
60531
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
60532
|
+
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
60533
|
+
var source = arguments[i2];
|
|
60534
|
+
for (var key in source) {
|
|
60535
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
60536
|
+
target[key] = source[key];
|
|
60537
|
+
}
|
|
60538
|
+
}
|
|
60539
|
+
}
|
|
60540
|
+
return target;
|
|
60541
|
+
};
|
|
60542
|
+
return _extends.apply(this, arguments);
|
|
60543
|
+
}
|
|
60544
|
+
function _inheritsLoose(subClass, superClass) {
|
|
60545
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
60546
|
+
subClass.prototype.constructor = subClass;
|
|
60547
|
+
_setPrototypeOf(subClass, superClass);
|
|
60548
|
+
}
|
|
60549
|
+
function _getPrototypeOf(o) {
|
|
60550
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
|
|
60551
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
60552
|
+
};
|
|
60553
|
+
return _getPrototypeOf(o);
|
|
60554
|
+
}
|
|
60555
|
+
function _setPrototypeOf(o, p2) {
|
|
60556
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
60557
|
+
o2.__proto__ = p3;
|
|
60558
|
+
return o2;
|
|
60559
|
+
};
|
|
60560
|
+
return _setPrototypeOf(o, p2);
|
|
60561
|
+
}
|
|
60562
|
+
function _isNativeReflectConstruct() {
|
|
60563
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
60564
|
+
if (Reflect.construct.sham) return false;
|
|
60565
|
+
if (typeof Proxy === "function") return true;
|
|
60566
|
+
try {
|
|
60567
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
60568
|
+
}));
|
|
60569
|
+
return true;
|
|
60570
|
+
} catch (e) {
|
|
60571
|
+
return false;
|
|
60572
|
+
}
|
|
60573
|
+
}
|
|
60574
|
+
function _construct(Parent, args, Class) {
|
|
60575
|
+
if (_isNativeReflectConstruct()) {
|
|
60576
|
+
_construct = Reflect.construct.bind();
|
|
60577
|
+
} else {
|
|
60578
|
+
_construct = function _construct2(Parent2, args2, Class2) {
|
|
60579
|
+
var a = [null];
|
|
60580
|
+
a.push.apply(a, args2);
|
|
60581
|
+
var Constructor = Function.bind.apply(Parent2, a);
|
|
60582
|
+
var instance = new Constructor();
|
|
60583
|
+
if (Class2) _setPrototypeOf(instance, Class2.prototype);
|
|
60584
|
+
return instance;
|
|
60585
|
+
};
|
|
60586
|
+
}
|
|
60587
|
+
return _construct.apply(null, arguments);
|
|
60588
|
+
}
|
|
60589
|
+
function _isNativeFunction(fn) {
|
|
60590
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
60591
|
+
}
|
|
60592
|
+
function _wrapNativeSuper(Class) {
|
|
60593
|
+
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
60594
|
+
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
|
|
60595
|
+
if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
|
|
60596
|
+
if (typeof Class2 !== "function") {
|
|
60597
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
60598
|
+
}
|
|
60599
|
+
if (typeof _cache !== "undefined") {
|
|
60600
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
60601
|
+
_cache.set(Class2, Wrapper);
|
|
60602
|
+
}
|
|
60603
|
+
function Wrapper() {
|
|
60604
|
+
return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
|
|
60605
|
+
}
|
|
60606
|
+
Wrapper.prototype = Object.create(Class2.prototype, {
|
|
60607
|
+
constructor: {
|
|
60608
|
+
value: Wrapper,
|
|
60609
|
+
enumerable: false,
|
|
60610
|
+
writable: true,
|
|
60611
|
+
configurable: true
|
|
60612
|
+
}
|
|
60613
|
+
});
|
|
60614
|
+
return _setPrototypeOf(Wrapper, Class2);
|
|
60615
|
+
};
|
|
60616
|
+
return _wrapNativeSuper(Class);
|
|
60617
|
+
}
|
|
60618
|
+
var formatRegExp = /%[sdj%]/g;
|
|
60619
|
+
var warning = function warning2() {
|
|
60620
|
+
};
|
|
60621
|
+
if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" && typeof window !== "undefined" && typeof document !== "undefined") {
|
|
60622
|
+
warning = function warning3(type4, errors) {
|
|
60623
|
+
if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
|
|
60624
|
+
if (errors.every(function(e) {
|
|
60625
|
+
return typeof e === "string";
|
|
60626
|
+
})) {
|
|
60627
|
+
console.warn(type4, errors);
|
|
60628
|
+
}
|
|
60629
|
+
}
|
|
60630
|
+
};
|
|
60631
|
+
}
|
|
60632
|
+
function convertFieldsError(errors) {
|
|
60633
|
+
if (!errors || !errors.length) return null;
|
|
60634
|
+
var fields = {};
|
|
60635
|
+
errors.forEach(function(error) {
|
|
60636
|
+
var field = error.field;
|
|
60637
|
+
fields[field] = fields[field] || [];
|
|
60638
|
+
fields[field].push(error);
|
|
60639
|
+
});
|
|
60640
|
+
return fields;
|
|
60641
|
+
}
|
|
60642
|
+
function format(template) {
|
|
60643
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
60644
|
+
args[_key - 1] = arguments[_key];
|
|
60645
|
+
}
|
|
60646
|
+
var i2 = 0;
|
|
60647
|
+
var len = args.length;
|
|
60648
|
+
if (typeof template === "function") {
|
|
60649
|
+
return template.apply(null, args);
|
|
60650
|
+
}
|
|
60651
|
+
if (typeof template === "string") {
|
|
60652
|
+
var str = template.replace(formatRegExp, function(x) {
|
|
60653
|
+
if (x === "%%") {
|
|
60654
|
+
return "%";
|
|
60655
|
+
}
|
|
60656
|
+
if (i2 >= len) {
|
|
60657
|
+
return x;
|
|
60658
|
+
}
|
|
60659
|
+
switch (x) {
|
|
60660
|
+
case "%s":
|
|
60661
|
+
return String(args[i2++]);
|
|
60662
|
+
case "%d":
|
|
60663
|
+
return Number(args[i2++]);
|
|
60664
|
+
case "%j":
|
|
60665
|
+
try {
|
|
60666
|
+
return JSON.stringify(args[i2++]);
|
|
60667
|
+
} catch (_) {
|
|
60668
|
+
return "[Circular]";
|
|
60669
|
+
}
|
|
60670
|
+
break;
|
|
60671
|
+
default:
|
|
60672
|
+
return x;
|
|
60673
|
+
}
|
|
60674
|
+
});
|
|
60675
|
+
return str;
|
|
60676
|
+
}
|
|
60677
|
+
return template;
|
|
60678
|
+
}
|
|
60679
|
+
function isNativeStringType(type4) {
|
|
60680
|
+
return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
|
|
60681
|
+
}
|
|
60682
|
+
function isEmptyValue(value, type4) {
|
|
60683
|
+
if (value === void 0 || value === null) {
|
|
60684
|
+
return true;
|
|
60685
|
+
}
|
|
60686
|
+
if (type4 === "array" && Array.isArray(value) && !value.length) {
|
|
60687
|
+
return true;
|
|
60688
|
+
}
|
|
60689
|
+
if (isNativeStringType(type4) && typeof value === "string" && !value) {
|
|
60690
|
+
return true;
|
|
60691
|
+
}
|
|
60692
|
+
return false;
|
|
60693
|
+
}
|
|
60694
|
+
function asyncParallelArray(arr, func, callback) {
|
|
60695
|
+
var results = [];
|
|
60696
|
+
var total = 0;
|
|
60697
|
+
var arrLength = arr.length;
|
|
60698
|
+
function count(errors) {
|
|
60699
|
+
results.push.apply(results, errors || []);
|
|
60700
|
+
total++;
|
|
60701
|
+
if (total === arrLength) {
|
|
60702
|
+
callback(results);
|
|
60703
|
+
}
|
|
60704
|
+
}
|
|
60705
|
+
arr.forEach(function(a) {
|
|
60706
|
+
func(a, count);
|
|
60707
|
+
});
|
|
60708
|
+
}
|
|
60709
|
+
function asyncSerialArray(arr, func, callback) {
|
|
60710
|
+
var index2 = 0;
|
|
60711
|
+
var arrLength = arr.length;
|
|
60712
|
+
function next(errors) {
|
|
60713
|
+
if (errors && errors.length) {
|
|
60714
|
+
callback(errors);
|
|
60715
|
+
return;
|
|
60716
|
+
}
|
|
60717
|
+
var original = index2;
|
|
59662
60718
|
index2 = index2 + 1;
|
|
59663
60719
|
if (original < arrLength) {
|
|
59664
60720
|
func(arr[original], next);
|
|
@@ -59967,8 +61023,8 @@ var rules = {
|
|
|
59967
61023
|
};
|
|
59968
61024
|
var string = function string2(rule, value, callback, source, options) {
|
|
59969
61025
|
var errors = [];
|
|
59970
|
-
var
|
|
59971
|
-
if (
|
|
61026
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61027
|
+
if (validate) {
|
|
59972
61028
|
if (isEmptyValue(value, "string") && !rule.required) {
|
|
59973
61029
|
return callback();
|
|
59974
61030
|
}
|
|
@@ -59986,8 +61042,8 @@ var string = function string2(rule, value, callback, source, options) {
|
|
|
59986
61042
|
};
|
|
59987
61043
|
var method2 = function method3(rule, value, callback, source, options) {
|
|
59988
61044
|
var errors = [];
|
|
59989
|
-
var
|
|
59990
|
-
if (
|
|
61045
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61046
|
+
if (validate) {
|
|
59991
61047
|
if (isEmptyValue(value) && !rule.required) {
|
|
59992
61048
|
return callback();
|
|
59993
61049
|
}
|
|
@@ -60000,8 +61056,8 @@ var method2 = function method3(rule, value, callback, source, options) {
|
|
|
60000
61056
|
};
|
|
60001
61057
|
var number2 = function number3(rule, value, callback, source, options) {
|
|
60002
61058
|
var errors = [];
|
|
60003
|
-
var
|
|
60004
|
-
if (
|
|
61059
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61060
|
+
if (validate) {
|
|
60005
61061
|
if (value === "") {
|
|
60006
61062
|
value = void 0;
|
|
60007
61063
|
}
|
|
@@ -60018,8 +61074,8 @@ var number2 = function number3(rule, value, callback, source, options) {
|
|
|
60018
61074
|
};
|
|
60019
61075
|
var _boolean = function _boolean2(rule, value, callback, source, options) {
|
|
60020
61076
|
var errors = [];
|
|
60021
|
-
var
|
|
60022
|
-
if (
|
|
61077
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61078
|
+
if (validate) {
|
|
60023
61079
|
if (isEmptyValue(value) && !rule.required) {
|
|
60024
61080
|
return callback();
|
|
60025
61081
|
}
|
|
@@ -60032,8 +61088,8 @@ var _boolean = function _boolean2(rule, value, callback, source, options) {
|
|
|
60032
61088
|
};
|
|
60033
61089
|
var regexp2 = function regexp3(rule, value, callback, source, options) {
|
|
60034
61090
|
var errors = [];
|
|
60035
|
-
var
|
|
60036
|
-
if (
|
|
61091
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61092
|
+
if (validate) {
|
|
60037
61093
|
if (isEmptyValue(value) && !rule.required) {
|
|
60038
61094
|
return callback();
|
|
60039
61095
|
}
|
|
@@ -60046,8 +61102,8 @@ var regexp2 = function regexp3(rule, value, callback, source, options) {
|
|
|
60046
61102
|
};
|
|
60047
61103
|
var integer2 = function integer3(rule, value, callback, source, options) {
|
|
60048
61104
|
var errors = [];
|
|
60049
|
-
var
|
|
60050
|
-
if (
|
|
61105
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61106
|
+
if (validate) {
|
|
60051
61107
|
if (isEmptyValue(value) && !rule.required) {
|
|
60052
61108
|
return callback();
|
|
60053
61109
|
}
|
|
@@ -60061,8 +61117,8 @@ var integer2 = function integer3(rule, value, callback, source, options) {
|
|
|
60061
61117
|
};
|
|
60062
61118
|
var floatFn = function floatFn2(rule, value, callback, source, options) {
|
|
60063
61119
|
var errors = [];
|
|
60064
|
-
var
|
|
60065
|
-
if (
|
|
61120
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61121
|
+
if (validate) {
|
|
60066
61122
|
if (isEmptyValue(value) && !rule.required) {
|
|
60067
61123
|
return callback();
|
|
60068
61124
|
}
|
|
@@ -60076,8 +61132,8 @@ var floatFn = function floatFn2(rule, value, callback, source, options) {
|
|
|
60076
61132
|
};
|
|
60077
61133
|
var array2 = function array3(rule, value, callback, source, options) {
|
|
60078
61134
|
var errors = [];
|
|
60079
|
-
var
|
|
60080
|
-
if (
|
|
61135
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61136
|
+
if (validate) {
|
|
60081
61137
|
if ((value === void 0 || value === null) && !rule.required) {
|
|
60082
61138
|
return callback();
|
|
60083
61139
|
}
|
|
@@ -60091,8 +61147,8 @@ var array2 = function array3(rule, value, callback, source, options) {
|
|
|
60091
61147
|
};
|
|
60092
61148
|
var object2 = function object3(rule, value, callback, source, options) {
|
|
60093
61149
|
var errors = [];
|
|
60094
|
-
var
|
|
60095
|
-
if (
|
|
61150
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61151
|
+
if (validate) {
|
|
60096
61152
|
if (isEmptyValue(value) && !rule.required) {
|
|
60097
61153
|
return callback();
|
|
60098
61154
|
}
|
|
@@ -60106,8 +61162,8 @@ var object2 = function object3(rule, value, callback, source, options) {
|
|
|
60106
61162
|
var ENUM = "enum";
|
|
60107
61163
|
var enumerable2 = function enumerable3(rule, value, callback, source, options) {
|
|
60108
61164
|
var errors = [];
|
|
60109
|
-
var
|
|
60110
|
-
if (
|
|
61165
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61166
|
+
if (validate) {
|
|
60111
61167
|
if (isEmptyValue(value) && !rule.required) {
|
|
60112
61168
|
return callback();
|
|
60113
61169
|
}
|
|
@@ -60120,8 +61176,8 @@ var enumerable2 = function enumerable3(rule, value, callback, source, options) {
|
|
|
60120
61176
|
};
|
|
60121
61177
|
var pattern2 = function pattern3(rule, value, callback, source, options) {
|
|
60122
61178
|
var errors = [];
|
|
60123
|
-
var
|
|
60124
|
-
if (
|
|
61179
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61180
|
+
if (validate) {
|
|
60125
61181
|
if (isEmptyValue(value, "string") && !rule.required) {
|
|
60126
61182
|
return callback();
|
|
60127
61183
|
}
|
|
@@ -60134,8 +61190,8 @@ var pattern2 = function pattern3(rule, value, callback, source, options) {
|
|
|
60134
61190
|
};
|
|
60135
61191
|
var date2 = function date3(rule, value, callback, source, options) {
|
|
60136
61192
|
var errors = [];
|
|
60137
|
-
var
|
|
60138
|
-
if (
|
|
61193
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61194
|
+
if (validate) {
|
|
60139
61195
|
if (isEmptyValue(value, "date") && !rule.required) {
|
|
60140
61196
|
return callback();
|
|
60141
61197
|
}
|
|
@@ -60164,8 +61220,8 @@ var required2 = function required3(rule, value, callback, source, options) {
|
|
|
60164
61220
|
var type2 = function type3(rule, value, callback, source, options) {
|
|
60165
61221
|
var ruleType = rule.type;
|
|
60166
61222
|
var errors = [];
|
|
60167
|
-
var
|
|
60168
|
-
if (
|
|
61223
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61224
|
+
if (validate) {
|
|
60169
61225
|
if (isEmptyValue(value, ruleType) && !rule.required) {
|
|
60170
61226
|
return callback();
|
|
60171
61227
|
}
|
|
@@ -60178,8 +61234,8 @@ var type2 = function type3(rule, value, callback, source, options) {
|
|
|
60178
61234
|
};
|
|
60179
61235
|
var any = function any2(rule, value, callback, source, options) {
|
|
60180
61236
|
var errors = [];
|
|
60181
|
-
var
|
|
60182
|
-
if (
|
|
61237
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61238
|
+
if (validate) {
|
|
60183
61239
|
if (isEmptyValue(value) && !rule.required) {
|
|
60184
61240
|
return callback();
|
|
60185
61241
|
}
|
|
@@ -60288,7 +61344,7 @@ var Schema = /* @__PURE__ */ (function() {
|
|
|
60288
61344
|
}
|
|
60289
61345
|
return this._messages;
|
|
60290
61346
|
};
|
|
60291
|
-
_proto.validate = function
|
|
61347
|
+
_proto.validate = function validate(source_, o, oc) {
|
|
60292
61348
|
var _this2 = this;
|
|
60293
61349
|
if (o === void 0) {
|
|
60294
61350
|
o = {};
|
|
@@ -60517,962 +61573,30 @@ Schema.register = function register(type4, validator) {
|
|
|
60517
61573
|
Schema.warning = warning;
|
|
60518
61574
|
Schema.messages = messages;
|
|
60519
61575
|
Schema.validators = validators;
|
|
60520
|
-
|
|
60521
|
-
|
|
60522
|
-
|
|
60523
|
-
NCB_PROVIDE2["DEFAULT_FIELD_DATA"] = "NCB_DefaultFieldData";
|
|
60524
|
-
NCB_PROVIDE2["DATA_RELATION_SHIP"] = "NCB_DataRelationShip";
|
|
60525
|
-
NCB_PROVIDE2["PAGE_DATA_CALL_BACK"] = "NCB_PageDataCallback";
|
|
60526
|
-
NCB_PROVIDE2["FORM_INST_LIST"] = "NCB_FormInstList";
|
|
60527
|
-
NCB_PROVIDE2["MOBILE_FILL_FIELDS_POPUP"] = "NCB_MobileFillFieldsPopup";
|
|
60528
|
-
NCB_PROVIDE2["TMPL_BOM_CONTROLLER_MAP"] = "NCB_TmplBomControllerMap";
|
|
60529
|
-
NCB_PROVIDE2["MATERIAL_CONSUME_TABLE_CONTROLLER"] = "NCB_MaterialConsumeTableController";
|
|
60530
|
-
NCB_PROVIDE2["CHECK_TABLE_COL_INDEX"] = "NCB_CheckTableColIndex";
|
|
60531
|
-
NCB_PROVIDE2["SUB_TABLE_CORE_FACTORY_MAP"] = "NCB_SubTableCoreFactoryMap";
|
|
60532
|
-
NCB_PROVIDE2["SUB_TABLE_CORE"] = "NCB_SubTableCore";
|
|
60533
|
-
NCB_PROVIDE2["PAGER"] = "NCB_Pager";
|
|
60534
|
-
return NCB_PROVIDE2;
|
|
60535
|
-
})(NCB_PROVIDE || {});
|
|
60536
|
-
function mitt(all) {
|
|
60537
|
-
all = all || /* @__PURE__ */ new Map();
|
|
60538
|
-
return {
|
|
60539
|
-
/**
|
|
60540
|
-
* A Map of event names to registered handler functions.
|
|
60541
|
-
*/
|
|
60542
|
-
all,
|
|
60543
|
-
/**
|
|
60544
|
-
* Register an event handler for the given type.
|
|
60545
|
-
* @param {string|symbol} type Type of event to listen for, or `'*'` for all events
|
|
60546
|
-
* @param {Function} handler Function to call in response to given event
|
|
60547
|
-
* @memberOf mitt
|
|
60548
|
-
*/
|
|
60549
|
-
on(type4, handler) {
|
|
60550
|
-
const handlers = all.get(type4);
|
|
60551
|
-
if (handlers) {
|
|
60552
|
-
handlers.push(handler);
|
|
60553
|
-
} else {
|
|
60554
|
-
all.set(type4, [handler]);
|
|
60555
|
-
}
|
|
60556
|
-
},
|
|
60557
|
-
/**
|
|
60558
|
-
* Remove an event handler for the given type.
|
|
60559
|
-
* If `handler` is omitted, all handlers of the given type are removed.
|
|
60560
|
-
* @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
|
|
60561
|
-
* @param {Function} [handler] Handler function to remove
|
|
60562
|
-
* @memberOf mitt
|
|
60563
|
-
*/
|
|
60564
|
-
off(type4, handler) {
|
|
60565
|
-
const handlers = all.get(type4);
|
|
60566
|
-
if (handlers) {
|
|
60567
|
-
if (handler) {
|
|
60568
|
-
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
60569
|
-
} else {
|
|
60570
|
-
all.set(type4, []);
|
|
60571
|
-
}
|
|
60572
|
-
}
|
|
60573
|
-
},
|
|
60574
|
-
/**
|
|
60575
|
-
* Invoke all handlers for the given type.
|
|
60576
|
-
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
60577
|
-
*
|
|
60578
|
-
* Note: Manually firing '*' handlers is not supported.
|
|
60579
|
-
*
|
|
60580
|
-
* @param {string|symbol} type The event type to invoke
|
|
60581
|
-
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
60582
|
-
* @memberOf mitt
|
|
60583
|
-
*/
|
|
60584
|
-
emit(type4, evt) {
|
|
60585
|
-
let handlers = all.get(type4);
|
|
60586
|
-
if (handlers) {
|
|
60587
|
-
handlers.slice().forEach((handler) => {
|
|
60588
|
-
handler(evt);
|
|
60589
|
-
});
|
|
60590
|
-
}
|
|
60591
|
-
handlers = all.get("*");
|
|
60592
|
-
if (handlers) {
|
|
60593
|
-
handlers.slice().forEach((handler) => {
|
|
60594
|
-
handler(type4, evt);
|
|
60595
|
-
});
|
|
60596
|
-
}
|
|
60597
|
-
},
|
|
60598
|
-
/**
|
|
60599
|
-
* Clear all
|
|
60600
|
-
*/
|
|
60601
|
-
clear() {
|
|
60602
|
-
this.all.clear();
|
|
60603
|
-
}
|
|
60604
|
-
};
|
|
60605
|
-
}
|
|
60606
|
-
const emitter = mitt();
|
|
60607
|
-
var EmitterEnum = /* @__PURE__ */ ((EmitterEnum2) => {
|
|
60608
|
-
EmitterEnum2["__on__open_single_annotation_detail_"] = "__on__open_single_annotation_detail_";
|
|
60609
|
-
EmitterEnum2["__on__update_page_dom_"] = "__on__update_page_dom_";
|
|
60610
|
-
EmitterEnum2["__on_select_ebr_doc_instance_id"] = "__on_select_ebr_doc_instance_id";
|
|
60611
|
-
EmitterEnum2["__on_looper_auto_save"] = "__on_looper_auto_save";
|
|
60612
|
-
EmitterEnum2["__on_diff_ebr_form_state"] = "__on_diff_ebr_form_state";
|
|
60613
|
-
return EmitterEnum2;
|
|
60614
|
-
})(EmitterEnum || {});
|
|
60615
|
-
function useNocodeEmitter() {
|
|
60616
|
-
return {
|
|
60617
|
-
emitter,
|
|
60618
|
-
EmitterEnum
|
|
60619
|
-
};
|
|
60620
|
-
}
|
|
60621
|
-
function useCurrentPageFormState() {
|
|
60622
|
-
const formStateMap = inject(NCB_PROVIDE.FROM_DATA);
|
|
60623
|
-
const dataRelationShip = inject(NCB_PROVIDE.DATA_RELATION_SHIP);
|
|
60624
|
-
const currentPageFormState = computed(() => {
|
|
60625
|
-
return formStateMap?.[dataRelationShip?.uniqueId ?? ""] ?? {};
|
|
60626
|
-
});
|
|
60627
|
-
return {
|
|
60628
|
-
currentPageFormState
|
|
60629
|
-
};
|
|
60630
|
-
}
|
|
60631
|
-
function useWidgetStaticAttrs(widget) {
|
|
60632
|
-
const dataRelationShip = inject(NCB_PROVIDE.DATA_RELATION_SHIP);
|
|
60633
|
-
const {
|
|
60634
|
-
field = "",
|
|
60635
|
-
fieldType,
|
|
60636
|
-
bizType,
|
|
60637
|
-
isFieldModel,
|
|
60638
|
-
fieldLink,
|
|
60639
|
-
modelKey = dataRelationShip?.modelKey,
|
|
60640
|
-
refModelKey,
|
|
60641
|
-
placeholder,
|
|
60642
|
-
bindCompStyleType,
|
|
60643
|
-
newSpecificConfig
|
|
60644
|
-
} = widget.props || {};
|
|
60645
|
-
let viewState = widget.props?.viewState;
|
|
60646
|
-
if (fieldType === FIELD_TYPE.ATTACHMENT && viewState === CellWidgetViewState.Auto) {
|
|
60647
|
-
viewState = CellWidgetViewState.Readonly;
|
|
61576
|
+
function resolveKeepExceptionHighlight(formValue, fieldValue) {
|
|
61577
|
+
if (typeof fieldValue === "boolean") {
|
|
61578
|
+
return fieldValue;
|
|
60648
61579
|
}
|
|
60649
|
-
|
|
60650
|
-
|
|
60651
|
-
const newRequired = toRef(widget.props, "required");
|
|
60652
|
-
const newQueryDataRef = computed(() => widget.props.newSpecificConfig?.newQueryData);
|
|
60653
|
-
const customLoaderRef = computed(() => widget.props.newSpecificConfig?.customLoader);
|
|
60654
|
-
const {
|
|
60655
|
-
newFieldName,
|
|
60656
|
-
newModelName,
|
|
60657
|
-
newOptions = [],
|
|
60658
|
-
newUploadConfig = {},
|
|
60659
|
-
newPrecision = 0,
|
|
60660
|
-
newLoadFinished2Options,
|
|
60661
|
-
newTotalCount,
|
|
60662
|
-
newRefRecordNo,
|
|
60663
|
-
newQueryData,
|
|
60664
|
-
newQueryCondition,
|
|
60665
|
-
forcedDisabled,
|
|
60666
|
-
forcedReadonlyText,
|
|
60667
|
-
newPlaceholder,
|
|
60668
|
-
newRulesForRounding,
|
|
60669
|
-
newComponentProps = {},
|
|
60670
|
-
newDisplayRule = void 0,
|
|
60671
|
-
newSnNo = void 0
|
|
60672
|
-
} = newSpecificConfig || {};
|
|
60673
|
-
const targetFieldId = field ? isFieldModel ? fieldLink : field : "";
|
|
60674
|
-
const newDisplayStatus = computed(() => {
|
|
60675
|
-
const readonlyString = viewState === CellWidgetViewState.Disabled || viewState === CellWidgetViewState.Auto ? "readonly-component" : "readonly-text";
|
|
60676
|
-
const editString = readonly.value ? "readonly-component" : "edit-component";
|
|
60677
|
-
if (dataRelationShip?.annSwitchStatus || forcedReadonlyText) return "readonly-text";
|
|
60678
|
-
if (isFieldModel) return readonlyString;
|
|
60679
|
-
const renderMode = dataRelationShip?.renderModeType;
|
|
60680
|
-
const bpmnMap = dataRelationShip?.bpmnFieldAuthMap;
|
|
60681
|
-
const key = `${modelKey}.${field}`;
|
|
60682
|
-
const getFieldAuth = () => bpmnMap?.[key];
|
|
60683
|
-
const resolveFromAuth = (info) => {
|
|
60684
|
-
if (isEmpty(info)) return null;
|
|
60685
|
-
if (info.edit && !info.readonly) return editString;
|
|
60686
|
-
if (info.readonly && !info.edit) return readonlyString;
|
|
60687
|
-
return null;
|
|
60688
|
-
};
|
|
60689
|
-
if (renderMode === RenderModeEnum.FormMode) {
|
|
60690
|
-
if (dataRelationShip?.formType !== FormTypeEnum.PROCESS) {
|
|
60691
|
-
const auth2 = getFieldAuth();
|
|
60692
|
-
const fromAuth2 = resolveFromAuth(auth2);
|
|
60693
|
-
return fromAuth2 ?? editString;
|
|
60694
|
-
}
|
|
60695
|
-
const auth = getFieldAuth();
|
|
60696
|
-
const fromAuth = resolveFromAuth(auth);
|
|
60697
|
-
if (fromAuth) return fromAuth;
|
|
60698
|
-
const bpmnType = dataRelationShip?.bpmnType;
|
|
60699
|
-
if (bpmnType === BpmnNodeTypeEnum.BpmnApproval || bpmnType === BpmnNodeTypeEnum.BpmnJudge) {
|
|
60700
|
-
return readonlyString;
|
|
60701
|
-
}
|
|
60702
|
-
return editString;
|
|
60703
|
-
}
|
|
60704
|
-
if (renderMode === RenderModeEnum.ViewMode) {
|
|
60705
|
-
return readonlyString;
|
|
60706
|
-
}
|
|
60707
|
-
return readonly.value ? "readonly-text" : "edit-component";
|
|
60708
|
-
});
|
|
60709
|
-
const newDisabled = computed(() => {
|
|
60710
|
-
if (newDisplayStatus.value === "edit-component") {
|
|
60711
|
-
return forcedDisabled || disabled.value;
|
|
60712
|
-
}
|
|
60713
|
-
return viewState === CellWidgetViewState.Disabled || disabled.value;
|
|
60714
|
-
});
|
|
60715
|
-
const isAutoLineBreak = computed(() => {
|
|
60716
|
-
if (!isEmpty(widget.style) && has(widget.style, "whiteSpace") && has(widget.style, "wordBreak") && widget.style.whiteSpace === "pre-wrap" && widget.style.wordBreak === "break-all") {
|
|
60717
|
-
return true;
|
|
60718
|
-
}
|
|
60719
|
-
return false;
|
|
60720
|
-
});
|
|
60721
|
-
return {
|
|
60722
|
-
field,
|
|
60723
|
-
fieldType,
|
|
60724
|
-
/** 业务类型 */
|
|
60725
|
-
bizType,
|
|
60726
|
-
modelKey,
|
|
60727
|
-
refModelKey,
|
|
60728
|
-
isFieldModel,
|
|
60729
|
-
fieldLink,
|
|
60730
|
-
targetFieldId,
|
|
60731
|
-
placeholder: newPlaceholder || placeholder,
|
|
60732
|
-
bindCompStyleType,
|
|
60733
|
-
/** 字段名称 */
|
|
60734
|
-
showFieldName: newFieldName,
|
|
60735
|
-
/** 字段所属模型名称 */
|
|
60736
|
-
showModelName: newModelName,
|
|
60737
|
-
/** 是否必填 */
|
|
60738
|
-
showRequired: newRequired,
|
|
60739
|
-
/** 是否禁用 */
|
|
60740
|
-
showDisabled: newDisabled,
|
|
60741
|
-
/** 显示状态 */
|
|
60742
|
-
showDisplayStatus: newDisplayStatus,
|
|
60743
|
-
/** 下拉列表 */
|
|
60744
|
-
options: newOptions,
|
|
60745
|
-
/** 附件、图片配置项 */
|
|
60746
|
-
uploadConfig: newUploadConfig,
|
|
60747
|
-
/** 小数位数 */
|
|
60748
|
-
realPrecision: newPrecision,
|
|
60749
|
-
/** 精度小数的修约规则 */
|
|
60750
|
-
rulesForRounding: newRulesForRounding,
|
|
60751
|
-
/** 记录单号是否是链接 */
|
|
60752
|
-
realRefRecordNo: newRefRecordNo,
|
|
60753
|
-
/** 下拉列表内容是否都加载完成 */
|
|
60754
|
-
loadFinished2Options: newLoadFinished2Options,
|
|
60755
|
-
/** Rdo下拉框内容总数 */
|
|
60756
|
-
newTotalCount,
|
|
60757
|
-
/** 查询条件 */
|
|
60758
|
-
newQueryData,
|
|
60759
|
-
/** 查询条件响应式 */
|
|
60760
|
-
newQueryDataRef,
|
|
60761
|
-
/** 自定义数据源加载函数 */
|
|
60762
|
-
customLoaderRef,
|
|
60763
|
-
/** 查询条件 */
|
|
60764
|
-
queryCondition: newQueryCondition,
|
|
60765
|
-
/** 组件额外参数 */
|
|
60766
|
-
newComponentProps,
|
|
60767
|
-
/** 显示规则 */
|
|
60768
|
-
newDisplayRule,
|
|
60769
|
-
dataRelationShip,
|
|
60770
|
-
/** 是否是自动换行 */
|
|
60771
|
-
isAutoLineBreak,
|
|
60772
|
-
/** 序列号 */
|
|
60773
|
-
newSnNo
|
|
60774
|
-
};
|
|
60775
|
-
}
|
|
60776
|
-
function useCalculateFormula() {
|
|
60777
|
-
const { identify, calculate } = {
|
|
60778
|
-
identify: (...args) => window.NocodeAdapter.utils?.formulaIdentify?.(...args) ?? [],
|
|
60779
|
-
calculate: (...args) => window.NocodeAdapter.utils?.formulaCalculate?.(...args)
|
|
60780
|
-
};
|
|
60781
|
-
const getFieldDataValue = (parseInfo, formData) => {
|
|
60782
|
-
const getTextValue = (processedKey, value) => {
|
|
60783
|
-
const textValue = value ?? formData?.[processedKey] ?? "";
|
|
60784
|
-
return Array.isArray(textValue) ? textValue.join() : textValue;
|
|
60785
|
-
};
|
|
60786
|
-
const { type: type4, processed, hashValue } = parseInfo;
|
|
60787
|
-
if (type4 === "hash") {
|
|
60788
|
-
const tableData = toRaw(formData?.[hashValue] || []);
|
|
60789
|
-
return tableData.filter((d) => !d.deleted_).map((row) => getTextValue(processed, row?.[processed])).filter((i2) => !isNil(i2));
|
|
60790
|
-
}
|
|
60791
|
-
return getTextValue(processed, formData?.[processed]);
|
|
60792
|
-
};
|
|
60793
|
-
const parseFormulaVar = (formulaVar) => {
|
|
60794
|
-
const result = {
|
|
60795
|
-
original: formulaVar,
|
|
60796
|
-
type: "",
|
|
60797
|
-
processed: "",
|
|
60798
|
-
hashValue: "",
|
|
60799
|
-
dataType: ""
|
|
60800
|
-
};
|
|
60801
|
-
if (/^\$([^$]+)\$\.(.+)$/.test(formulaVar)) {
|
|
60802
|
-
const match = formulaVar.match(/^\$([^$]+)\$\.(.+)$/);
|
|
60803
|
-
result.type = "hash";
|
|
60804
|
-
result.processed = match[2];
|
|
60805
|
-
result.hashValue = match[1];
|
|
60806
|
-
result.dataType = "globType";
|
|
60807
|
-
} else if (/^_\.(.+)$/.test(formulaVar)) {
|
|
60808
|
-
const match = formulaVar.match(/^_\.(.+)$/);
|
|
60809
|
-
result.type = "underscore";
|
|
60810
|
-
result.processed = match[1];
|
|
60811
|
-
result.dataType = "currentRowType";
|
|
60812
|
-
} else {
|
|
60813
|
-
result.type = "plain";
|
|
60814
|
-
result.processed = formulaVar;
|
|
60815
|
-
result.dataType = "globType";
|
|
60816
|
-
}
|
|
60817
|
-
return result;
|
|
60818
|
-
};
|
|
60819
|
-
const getParseFormulaVarInfos2 = (expr) => {
|
|
60820
|
-
const rowArgs = expr ? identify(expr) : [];
|
|
60821
|
-
return {
|
|
60822
|
-
rowArgs,
|
|
60823
|
-
parseInfos: rowArgs.map((curr) => parseFormulaVar(curr))
|
|
60824
|
-
};
|
|
60825
|
-
};
|
|
60826
|
-
const calculateFormula2 = async (expr, formData, currentPageFormState) => {
|
|
60827
|
-
const rowArgs = identify(expr);
|
|
60828
|
-
const formulaData = isEmpty(rowArgs) ? {} : rowArgs.reduce((total, curr) => {
|
|
60829
|
-
const parseInfo = parseFormulaVar(curr);
|
|
60830
|
-
total[curr] = getFieldDataValue(
|
|
60831
|
-
parseInfo,
|
|
60832
|
-
parseInfo.dataType === "currentRowType" ? formData : currentPageFormState
|
|
60833
|
-
);
|
|
60834
|
-
return total;
|
|
60835
|
-
}, {});
|
|
60836
|
-
return calculate(expr, formulaData);
|
|
60837
|
-
};
|
|
60838
|
-
const mergeParseInfos = (a = [], b = []) => {
|
|
60839
|
-
const map = /* @__PURE__ */ new Map();
|
|
60840
|
-
const keyOf = (p2) => `${p2.type}||${p2.processed}||${p2.hashValue ?? ""}`;
|
|
60841
|
-
for (const p2 of a || []) map.set(keyOf(p2), p2);
|
|
60842
|
-
for (const p2 of b || []) map.set(keyOf(p2), p2);
|
|
60843
|
-
return Array.from(map.values());
|
|
60844
|
-
};
|
|
60845
|
-
const getMergeParseInfos = (options) => {
|
|
60846
|
-
const { minFormulaExpr, maxFormulaExpr } = options;
|
|
60847
|
-
let minInfos = [];
|
|
60848
|
-
let maxInfos = [];
|
|
60849
|
-
try {
|
|
60850
|
-
if (minFormulaExpr) minInfos = getParseFormulaVarInfos2(minFormulaExpr)?.parseInfos || [];
|
|
60851
|
-
} catch (e) {
|
|
60852
|
-
minInfos = [];
|
|
60853
|
-
}
|
|
60854
|
-
try {
|
|
60855
|
-
if (maxFormulaExpr) maxInfos = getParseFormulaVarInfos2(maxFormulaExpr)?.parseInfos || [];
|
|
60856
|
-
} catch (e) {
|
|
60857
|
-
maxInfos = [];
|
|
60858
|
-
}
|
|
60859
|
-
const merged = mergeParseInfos(minInfos, maxInfos);
|
|
60860
|
-
return merged;
|
|
60861
|
-
};
|
|
60862
|
-
return {
|
|
60863
|
-
identify,
|
|
60864
|
-
getParseFormulaVarInfos: getParseFormulaVarInfos2,
|
|
60865
|
-
calculateFormula: calculateFormula2,
|
|
60866
|
-
getMergeParseInfos
|
|
60867
|
-
};
|
|
60868
|
-
}
|
|
60869
|
-
function setSelectAnnotationId(id, basicInfoItem) {
|
|
60870
|
-
if (!isEmpty(id) && basicInfoItem) {
|
|
60871
|
-
const { emitter: emitter2, EmitterEnum: EmitterEnum2 } = useNocodeEmitter();
|
|
60872
|
-
const newId = id === "gct-nocode-ann-main" ? "" : id;
|
|
60873
|
-
basicInfoItem.annSelectId = newId;
|
|
60874
|
-
emitter2.emit(EmitterEnum2.__on__open_single_annotation_detail_, {
|
|
60875
|
-
cellLocation: newId
|
|
60876
|
-
});
|
|
61580
|
+
if (typeof formValue === "boolean") {
|
|
61581
|
+
return formValue;
|
|
60877
61582
|
}
|
|
61583
|
+
return true;
|
|
60878
61584
|
}
|
|
60879
|
-
function
|
|
60880
|
-
if (
|
|
60881
|
-
|
|
60882
|
-
|
|
60883
|
-
const ids = Array.from(cellDiv.querySelectorAll(".validator-icon")).map((el2) => el2.dataset.ann).filter(Boolean);
|
|
60884
|
-
const validateList = ids.map((id) => basicInfoItem.validatorMessageMap?.[id]).filter(Boolean);
|
|
60885
|
-
const flattenedErrors = validateList.flatMap(
|
|
60886
|
-
(validates) => validates.map(({ field, message: message2 }) => JSON.parse(message2))
|
|
60887
|
-
);
|
|
60888
|
-
const resultMap = flattenedErrors.reduce((acc, item) => {
|
|
60889
|
-
const { showModelName, showModelKey, subFieldKey, showFieldName, targetFieldId, message: message2 } = item;
|
|
60890
|
-
if (!acc[showModelKey]) {
|
|
60891
|
-
acc[showModelKey] = {
|
|
60892
|
-
showModelName,
|
|
60893
|
-
showModelKey,
|
|
60894
|
-
subFieldKey,
|
|
60895
|
-
fields: []
|
|
60896
|
-
};
|
|
60897
|
-
}
|
|
60898
|
-
acc[showModelKey].fields.push({ showFieldName, targetFieldId, message: message2 });
|
|
60899
|
-
return acc;
|
|
60900
|
-
}, {});
|
|
60901
|
-
if (Object.keys(resultMap).length) {
|
|
60902
|
-
const contentVNode = h$1(
|
|
60903
|
-
"div",
|
|
60904
|
-
{ class: "nocode-validator-tooltip-wrapper" },
|
|
60905
|
-
Object.values(resultMap).map(
|
|
60906
|
-
(data) => h$1("div", { class: "nocode-validator-tooltip-container", key: data.showModelKey }, [
|
|
60907
|
-
h$1("div", { class: "nocode-validator-tooltip-header" }, data.showModelName),
|
|
60908
|
-
h$1(
|
|
60909
|
-
"div",
|
|
60910
|
-
{ class: "nocode-validator-tooltip-header-label" },
|
|
60911
|
-
`${data.showModelKey}${data.subFieldKey ? "|" + data.subFieldKey : ""}`
|
|
60912
|
-
),
|
|
60913
|
-
h$1(
|
|
60914
|
-
"ul",
|
|
60915
|
-
{ class: "nocode-validator-tooltip-content" },
|
|
60916
|
-
data.fields.map(
|
|
60917
|
-
(field, index2) => h$1(
|
|
60918
|
-
"li",
|
|
60919
|
-
{ key: `${field.targetFieldId}-${index2}` },
|
|
60920
|
-
`${field.showFieldName}(${field.targetFieldId}):${field.message}`
|
|
60921
|
-
)
|
|
60922
|
-
)
|
|
60923
|
-
)
|
|
60924
|
-
])
|
|
60925
|
-
)
|
|
60926
|
-
);
|
|
60927
|
-
window.window.NocodeAdapter.utils.overlay.popover(
|
|
60928
|
-
event.target,
|
|
60929
|
-
contentVNode,
|
|
60930
|
-
{},
|
|
60931
|
-
{ placement: "top-center" }
|
|
60932
|
-
);
|
|
60933
|
-
}
|
|
61585
|
+
function resolveValidationAdmission(input) {
|
|
61586
|
+
if (input.mode === "display") {
|
|
61587
|
+
if (!input.keepExceptionHighlight) return { admit: false };
|
|
61588
|
+
return { admit: true };
|
|
60934
61589
|
}
|
|
61590
|
+
if (input.blocked) return { admit: false };
|
|
61591
|
+
return { admit: true };
|
|
60935
61592
|
}
|
|
60936
|
-
|
|
60937
|
-
const getWidgetInfo = () => {
|
|
60938
|
-
const { preLocation, props: tdProps } = tdInfo || {};
|
|
60939
|
-
const paper = widgetCenter?.[ComponentTypeEnum.PAPER];
|
|
60940
|
-
const subTable2DList = paper.props.subTable2DList ?? [];
|
|
60941
|
-
const checkTable2DList = paper.props.checkTable2DList ?? [];
|
|
60942
|
-
const fixedTableLenMap = paper.props.fixedTableLenMap ?? {};
|
|
60943
|
-
const getTdIds = (key) => [...basicInfoItem?.mobileTdIdGroups.get(key) || []];
|
|
60944
|
-
const assignWidgetInfo = (fillType, params) => {
|
|
60945
|
-
const { rowSubFieldKey = "", colSubFieldKey = "" } = params;
|
|
60946
|
-
const mainSetKey = rowSubFieldKey !== "gct_mobile_main" ? `gct_mobile_sub.${rowSubFieldKey}` : rowSubFieldKey;
|
|
60947
|
-
const linkSetKey = colSubFieldKey ? `gct_mobile_sub.${colSubFieldKey}` : colSubFieldKey;
|
|
60948
|
-
return {
|
|
60949
|
-
fillType,
|
|
60950
|
-
clickTdId: tdInfo.id,
|
|
60951
|
-
clickSbRowIndex: sbRowIndex,
|
|
60952
|
-
mainWidgetIds: getTdIds(mainSetKey),
|
|
60953
|
-
linkWidgetIds: getTdIds(linkSetKey),
|
|
60954
|
-
subInfo: params
|
|
60955
|
-
};
|
|
60956
|
-
};
|
|
60957
|
-
if (preLocation === ComponentTypeEnum.PAPER) {
|
|
60958
|
-
if (tdProps.isNewFixedTableTd) {
|
|
60959
|
-
const item2 = subTable2DList.find(
|
|
60960
|
-
(i2) => i2.subTable2d && i2.colSubFieldKey === tdProps.fixedTableFieldId
|
|
60961
|
-
);
|
|
60962
|
-
return item2 ? assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE_2D, {
|
|
60963
|
-
...item2,
|
|
60964
|
-
childInitRowLen: 1 * ((fixedTableLenMap?.[item2.colSubFieldKey] ?? 0) + 1)
|
|
60965
|
-
}) : assignWidgetInfo(MobileFillTypeEnum.FIXED_TABLE, {
|
|
60966
|
-
rowSubFieldKey: tdProps.fixedTableFieldId
|
|
60967
|
-
});
|
|
60968
|
-
}
|
|
60969
|
-
if (tdProps.isNewCheckTable2D) {
|
|
60970
|
-
const item2 = checkTable2DList.find(
|
|
60971
|
-
(i2) => i2.checkTable2d && (i2.colSubFieldKey === tdProps.fixedTableFieldId || i2.rowSubFieldKey === tdProps.fixedTableFieldId)
|
|
60972
|
-
);
|
|
60973
|
-
if (item2) {
|
|
60974
|
-
return assignWidgetInfo(MobileFillTypeEnum.CHECK_TABLE_2D, item2);
|
|
60975
|
-
}
|
|
60976
|
-
}
|
|
60977
|
-
return assignWidgetInfo(MobileFillTypeEnum.MAIN_FIELD, { rowSubFieldKey: "gct_mobile_main" });
|
|
60978
|
-
}
|
|
60979
|
-
const subTableFieldId = widgetCenter?.[preLocation]?.props?.field;
|
|
60980
|
-
if (!subTableFieldId) return;
|
|
60981
|
-
const item = subTable2DList.find((i2) => i2.subTable2d && i2.rowSubFieldKey === subTableFieldId);
|
|
60982
|
-
return item ? assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE_2D, {
|
|
60983
|
-
...item,
|
|
60984
|
-
childInitRowLen: 1 * ((fixedTableLenMap?.[item.colSubFieldKey] ?? 0) + 1)
|
|
60985
|
-
}) : assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE, { rowSubFieldKey: subTableFieldId });
|
|
60986
|
-
};
|
|
60987
|
-
if (basicInfoItem) {
|
|
60988
|
-
basicInfoItem.mobileSelectTdId = tdInfo.id;
|
|
60989
|
-
const widgetInfo = getWidgetInfo();
|
|
60990
|
-
callback?.(basicInfoItem, widgetInfo);
|
|
60991
|
-
}
|
|
60992
|
-
}
|
|
60993
|
-
function getSubTableQuickFillInfo(subTableFieldId, mobileTdIdGroups) {
|
|
60994
|
-
const getTdIds = (key) => [...mobileTdIdGroups.get(key) || []];
|
|
60995
|
-
const assignWidgetInfo = (fillType, params) => {
|
|
60996
|
-
const { rowSubFieldKey = "", colSubFieldKey = "" } = params;
|
|
60997
|
-
const mainSetKey = rowSubFieldKey !== "gct_mobile_main" ? `gct_mobile_sub.${rowSubFieldKey}` : rowSubFieldKey;
|
|
60998
|
-
const linkSetKey = colSubFieldKey ? `gct_mobile_sub.${colSubFieldKey}` : colSubFieldKey;
|
|
60999
|
-
return {
|
|
61000
|
-
fillType,
|
|
61001
|
-
mainWidgetIds: getTdIds(mainSetKey),
|
|
61002
|
-
linkWidgetIds: getTdIds(linkSetKey),
|
|
61003
|
-
subInfo: params
|
|
61004
|
-
};
|
|
61005
|
-
};
|
|
61006
|
-
if (!subTableFieldId) return;
|
|
61007
|
-
return assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE, { rowSubFieldKey: subTableFieldId });
|
|
61008
|
-
}
|
|
61009
|
-
const formRules = ref({});
|
|
61010
|
-
const constantRequiredStyles = {
|
|
61011
|
-
"--required-border-color": "rgb(255, 31, 31, 0.36)",
|
|
61012
|
-
"--required-border-hover-color": "rgb(255, 31, 31, 0.86)",
|
|
61013
|
-
"--required-background-color": "rgb(255, 31, 31, 0.04)"
|
|
61014
|
-
};
|
|
61015
|
-
const reliableVerticalTextStyles = {
|
|
61016
|
-
"writing-mode": "horizontal-tb",
|
|
61017
|
-
display: "inline-block",
|
|
61018
|
-
width: "1em",
|
|
61019
|
-
"line-height": "1.2",
|
|
61020
|
-
"white-space": "normal",
|
|
61021
|
-
"word-break": "break-all",
|
|
61022
|
-
"letter-spacing": "0",
|
|
61023
|
-
"text-align": "center"
|
|
61024
|
-
};
|
|
61025
|
-
const isVerticalLrText = (style) => {
|
|
61026
|
-
const mode = style?.writingMode ?? style?.["writing-mode"];
|
|
61027
|
-
return mode === "vertical-lr";
|
|
61028
|
-
};
|
|
61029
|
-
function useValidator(props) {
|
|
61030
|
-
const widget = props.widget;
|
|
61031
|
-
const {
|
|
61032
|
-
showModelName,
|
|
61033
|
-
showFieldName,
|
|
61034
|
-
modelKey,
|
|
61035
|
-
fieldType,
|
|
61036
|
-
targetFieldId,
|
|
61037
|
-
isFieldModel,
|
|
61038
|
-
showRequired,
|
|
61039
|
-
showDisabled,
|
|
61040
|
-
showDisplayStatus,
|
|
61041
|
-
dataRelationShip
|
|
61042
|
-
} = useWidgetStaticAttrs(widget);
|
|
61043
|
-
const sizeStyles = {
|
|
61044
|
-
"--size": `${widget.props.size ?? 12}px`,
|
|
61045
|
-
"--cmp-width": `${widget.props.cmpWidth ?? 0}px`,
|
|
61046
|
-
"--cmp-height": `${widget.props.cmpHeight ?? 0}px`
|
|
61047
|
-
};
|
|
61048
|
-
const showFormItem = computed(() => {
|
|
61049
|
-
if (dataRelationShip?.renderModeType === RenderModeEnum.ViewMode) {
|
|
61050
|
-
return false;
|
|
61051
|
-
}
|
|
61052
|
-
if (widget.component === ComponentTypeEnum.DynValue) {
|
|
61053
|
-
return false;
|
|
61054
|
-
}
|
|
61055
|
-
return widget.formItem;
|
|
61056
|
-
});
|
|
61057
|
-
const rules2 = computed(() => {
|
|
61058
|
-
const RuleProps = [];
|
|
61059
|
-
if (!showFormItem.value) {
|
|
61060
|
-
return RuleProps;
|
|
61061
|
-
}
|
|
61062
|
-
if (!targetFieldId || showDisabled.value || ["readonly-text", "readonly-component"].includes(showDisplayStatus.value)) {
|
|
61063
|
-
return RuleProps;
|
|
61064
|
-
}
|
|
61065
|
-
const {
|
|
61066
|
-
subFieldKey,
|
|
61067
|
-
minlength,
|
|
61068
|
-
regex,
|
|
61069
|
-
regexHint,
|
|
61070
|
-
validateTrue,
|
|
61071
|
-
validateFalse,
|
|
61072
|
-
enableRangeValidate,
|
|
61073
|
-
maxValidateMode,
|
|
61074
|
-
minValidateMode,
|
|
61075
|
-
minValue,
|
|
61076
|
-
maxValue,
|
|
61077
|
-
minFormulaExpr,
|
|
61078
|
-
maxFormulaExpr,
|
|
61079
|
-
minDate,
|
|
61080
|
-
maxDate,
|
|
61081
|
-
minDateFormulaExpr,
|
|
61082
|
-
maxDateFormulaExpr,
|
|
61083
|
-
maxDateValidateMode,
|
|
61084
|
-
minDateValidateMode
|
|
61085
|
-
} = widget.props;
|
|
61086
|
-
const validatorInfo = {
|
|
61087
|
-
showModelName,
|
|
61088
|
-
showModelKey: modelKey,
|
|
61089
|
-
showFieldName,
|
|
61090
|
-
subFieldKey,
|
|
61091
|
-
targetFieldId
|
|
61092
|
-
};
|
|
61093
|
-
const buildError = (message2) => JSON.stringify({ ...validatorInfo, message: message2 });
|
|
61094
|
-
const getCurrentFormData = (_rule, options) => {
|
|
61095
|
-
if (!_rule._subtableFieldId) return options?.formData;
|
|
61096
|
-
const subTableData = options?.formData?.[_rule._subtableFieldId];
|
|
61097
|
-
if (!isNil(_rule._realRowIndex) && isNil(_rule._childSubTableDataIndex)) {
|
|
61098
|
-
return subTableData?.[_rule._realRowIndex];
|
|
61099
|
-
}
|
|
61100
|
-
if (!isNil(_rule._realRowIndex) && !isNil(_rule._childSubTableDataIndex)) {
|
|
61101
|
-
return subTableData?.[_rule._realRowIndex]?.["_2DTABLE_"]?.[_rule._childSubTableDataIndex];
|
|
61102
|
-
}
|
|
61103
|
-
return options?.formData;
|
|
61104
|
-
};
|
|
61105
|
-
const shouldSkipEnumValidation = (_rule, options) => {
|
|
61106
|
-
if (!_rule._belongFieldId || isNil(_rule._optionValue)) {
|
|
61107
|
-
return false;
|
|
61108
|
-
}
|
|
61109
|
-
const _formData_ = getCurrentFormData(_rule, options);
|
|
61110
|
-
const enumFieldValue = renderUtils.getValue(
|
|
61111
|
-
_formData_?.[_rule._belongFieldId],
|
|
61112
|
-
_rule._multiple
|
|
61113
|
-
);
|
|
61114
|
-
const shouldValidate = Array.isArray(enumFieldValue) ? enumFieldValue.includes(_rule._optionValue) : enumFieldValue === _rule._optionValue;
|
|
61115
|
-
return !shouldValidate;
|
|
61116
|
-
};
|
|
61117
|
-
const isEmptyValue2 = (value) => {
|
|
61118
|
-
return value === void 0 || value === null || typeof value === "string" && value.trim() === "" || Array.isArray(value) && value.length === 0;
|
|
61119
|
-
};
|
|
61120
|
-
const createValidationRule = (validator, message2) => ({
|
|
61121
|
-
required: true,
|
|
61122
|
-
validator: (rule, value, callback, source, options) => {
|
|
61123
|
-
if (shouldSkipEnumValidation(rule, options)) {
|
|
61124
|
-
return true;
|
|
61125
|
-
}
|
|
61126
|
-
return validator(rule, value, callback, source, options);
|
|
61127
|
-
},
|
|
61128
|
-
message: message2
|
|
61129
|
-
});
|
|
61130
|
-
if (showRequired.value) {
|
|
61131
|
-
RuleProps.push(
|
|
61132
|
-
createValidationRule(
|
|
61133
|
-
(_rule, value, callback, source, options) => {
|
|
61134
|
-
if (isEmptyValue2(value)) return false;
|
|
61135
|
-
return true;
|
|
61136
|
-
},
|
|
61137
|
-
buildError($t("sys.edhr.fieldRequired"))
|
|
61138
|
-
)
|
|
61139
|
-
);
|
|
61140
|
-
}
|
|
61141
|
-
if (minlength) {
|
|
61142
|
-
RuleProps.push(
|
|
61143
|
-
createValidationRule(
|
|
61144
|
-
(_rule, value, callback, source, options) => {
|
|
61145
|
-
if (isEmptyValue2(value)) return true;
|
|
61146
|
-
return value.length >= minlength;
|
|
61147
|
-
},
|
|
61148
|
-
buildError($t("sys.edhr.fieldLengthNotLessThan", { len: minlength }))
|
|
61149
|
-
)
|
|
61150
|
-
);
|
|
61151
|
-
}
|
|
61152
|
-
if (regex) {
|
|
61153
|
-
RuleProps.push(
|
|
61154
|
-
createValidationRule(
|
|
61155
|
-
(_rule, value, callback, source, options) => {
|
|
61156
|
-
if (isEmptyValue2(value)) return true;
|
|
61157
|
-
return new RegExp(regex).test(value);
|
|
61158
|
-
},
|
|
61159
|
-
buildError(regexHint ?? $t("sys.edhr.fieldFormatError"))
|
|
61160
|
-
)
|
|
61161
|
-
);
|
|
61162
|
-
}
|
|
61163
|
-
if (validateTrue) {
|
|
61164
|
-
RuleProps.push({
|
|
61165
|
-
required: true,
|
|
61166
|
-
validator: (_rule, value) => value === true,
|
|
61167
|
-
message: buildError($t("sys.edhr.fieldValueNeedTrue"))
|
|
61168
|
-
});
|
|
61169
|
-
}
|
|
61170
|
-
if (validateFalse) {
|
|
61171
|
-
RuleProps.push({
|
|
61172
|
-
required: true,
|
|
61173
|
-
validator: (_rule, value) => value === false,
|
|
61174
|
-
message: buildError($t("sys.edhr.fieldValueNeedFalse"))
|
|
61175
|
-
});
|
|
61176
|
-
}
|
|
61177
|
-
if (enableRangeValidate) {
|
|
61178
|
-
if (minValidateMode === RangeValidateMode.Fixed_Number) {
|
|
61179
|
-
RuleProps.push(
|
|
61180
|
-
createValidationRule(
|
|
61181
|
-
(_rule, value, callback, source, options) => {
|
|
61182
|
-
if (isEmptyValue2(value)) return true;
|
|
61183
|
-
const numberValue = Number(value);
|
|
61184
|
-
if (numberValue < minValue) {
|
|
61185
|
-
return false;
|
|
61186
|
-
}
|
|
61187
|
-
return true;
|
|
61188
|
-
},
|
|
61189
|
-
buildError($t("sys.edhr.fieldValueNotLessThan", { val: minValue }))
|
|
61190
|
-
)
|
|
61191
|
-
);
|
|
61192
|
-
}
|
|
61193
|
-
if (minValidateMode === RangeValidateMode.Variable_Validate && minFormulaExpr) {
|
|
61194
|
-
RuleProps.push({
|
|
61195
|
-
required: true,
|
|
61196
|
-
validator: async (_rule, value, callback, source, options) => {
|
|
61197
|
-
if (shouldSkipEnumValidation(_rule, options)) {
|
|
61198
|
-
return Promise.resolve();
|
|
61199
|
-
}
|
|
61200
|
-
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
61201
|
-
const currentFormData = getCurrentFormData(_rule, options);
|
|
61202
|
-
const formulaValue = await calculateFormula2(
|
|
61203
|
-
minFormulaExpr,
|
|
61204
|
-
currentFormData,
|
|
61205
|
-
options?.formData
|
|
61206
|
-
);
|
|
61207
|
-
const parsedMin = parseFloat(formulaValue);
|
|
61208
|
-
if (!isNaN(parsedMin)) {
|
|
61209
|
-
if (isEmptyValue2(value)) {
|
|
61210
|
-
return Promise.resolve();
|
|
61211
|
-
}
|
|
61212
|
-
const numberValue = Number(value);
|
|
61213
|
-
if (numberValue < parsedMin) {
|
|
61214
|
-
return Promise.reject(
|
|
61215
|
-
new Error(buildError($t("sys.edhr.fieldValueNotLessThan", { val: parsedMin })))
|
|
61216
|
-
);
|
|
61217
|
-
}
|
|
61218
|
-
}
|
|
61219
|
-
return Promise.resolve();
|
|
61220
|
-
}
|
|
61221
|
-
});
|
|
61222
|
-
}
|
|
61223
|
-
if (maxValidateMode === RangeValidateMode.Fixed_Number) {
|
|
61224
|
-
RuleProps.push(
|
|
61225
|
-
createValidationRule(
|
|
61226
|
-
(_rule, value, callback, source, options) => {
|
|
61227
|
-
if (isEmptyValue2(value)) return true;
|
|
61228
|
-
const numberValue = Number(value);
|
|
61229
|
-
if (numberValue > maxValue) {
|
|
61230
|
-
return false;
|
|
61231
|
-
}
|
|
61232
|
-
return true;
|
|
61233
|
-
},
|
|
61234
|
-
buildError($t("sys.edhr.fieldValueNoMoreThan", { val: maxValue }))
|
|
61235
|
-
)
|
|
61236
|
-
);
|
|
61237
|
-
}
|
|
61238
|
-
if (maxValidateMode === RangeValidateMode.Variable_Validate && maxFormulaExpr) {
|
|
61239
|
-
RuleProps.push({
|
|
61240
|
-
required: true,
|
|
61241
|
-
validator: async (_rule, value, callback, source, options) => {
|
|
61242
|
-
if (shouldSkipEnumValidation(_rule, options)) {
|
|
61243
|
-
return Promise.resolve();
|
|
61244
|
-
}
|
|
61245
|
-
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
61246
|
-
const currentFormData = getCurrentFormData(_rule, options);
|
|
61247
|
-
const formulaValue = await calculateFormula2(
|
|
61248
|
-
maxFormulaExpr,
|
|
61249
|
-
currentFormData,
|
|
61250
|
-
options?.formData
|
|
61251
|
-
);
|
|
61252
|
-
const parsedMax = parseFloat(formulaValue);
|
|
61253
|
-
if (!isNaN(parsedMax)) {
|
|
61254
|
-
if (isEmptyValue2(value)) {
|
|
61255
|
-
return Promise.resolve();
|
|
61256
|
-
}
|
|
61257
|
-
const numberValue = Number(value);
|
|
61258
|
-
if (numberValue > parsedMax) {
|
|
61259
|
-
return Promise.reject(
|
|
61260
|
-
new Error(buildError($t("sys.edhr.fieldValueNoMoreThan", { val: parsedMax })))
|
|
61261
|
-
);
|
|
61262
|
-
}
|
|
61263
|
-
}
|
|
61264
|
-
return Promise.resolve();
|
|
61265
|
-
}
|
|
61266
|
-
});
|
|
61267
|
-
}
|
|
61268
|
-
if (minDateValidateMode === RangeValidateMode.Fixed_Number && minDate) {
|
|
61269
|
-
RuleProps.push(
|
|
61270
|
-
createValidationRule(
|
|
61271
|
-
(_rule, value, callback, source, options) => {
|
|
61272
|
-
if (isEmptyValue2(value)) return true;
|
|
61273
|
-
const inputTime = dayjs(value).unix();
|
|
61274
|
-
const minTimestamp = dayjs(minDate).unix();
|
|
61275
|
-
if (inputTime < minTimestamp) {
|
|
61276
|
-
return false;
|
|
61277
|
-
}
|
|
61278
|
-
return true;
|
|
61279
|
-
},
|
|
61280
|
-
buildError($t("sys.edhr.fieldValueNotLessThan", { val: minDate }))
|
|
61281
|
-
)
|
|
61282
|
-
);
|
|
61283
|
-
}
|
|
61284
|
-
if (maxDateValidateMode === RangeValidateMode.Fixed_Number && maxDate) {
|
|
61285
|
-
RuleProps.push(
|
|
61286
|
-
createValidationRule(
|
|
61287
|
-
(_rule, value, callback, source, options) => {
|
|
61288
|
-
if (isEmptyValue2(value)) return true;
|
|
61289
|
-
const inputTime = dayjs(value).unix();
|
|
61290
|
-
const maxTimestamp = dayjs(maxDate).unix();
|
|
61291
|
-
if (inputTime > maxTimestamp) {
|
|
61292
|
-
return false;
|
|
61293
|
-
}
|
|
61294
|
-
return true;
|
|
61295
|
-
},
|
|
61296
|
-
buildError($t("sys.edhr.fieldValueNoMoreThan", { val: maxDate }))
|
|
61297
|
-
)
|
|
61298
|
-
);
|
|
61299
|
-
}
|
|
61300
|
-
if (minDateValidateMode === RangeValidateMode.Variable_Validate && minDateFormulaExpr) {
|
|
61301
|
-
RuleProps.push({
|
|
61302
|
-
required: true,
|
|
61303
|
-
validator: async (_rule, value, callback, source, options) => {
|
|
61304
|
-
if (shouldSkipEnumValidation(_rule, options)) {
|
|
61305
|
-
return Promise.resolve();
|
|
61306
|
-
}
|
|
61307
|
-
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
61308
|
-
const currentFormData = getCurrentFormData(_rule, options);
|
|
61309
|
-
const formulaValue = await calculateFormula2(
|
|
61310
|
-
minDateFormulaExpr,
|
|
61311
|
-
currentFormData,
|
|
61312
|
-
options?.formData
|
|
61313
|
-
);
|
|
61314
|
-
if (!isNil(formulaValue) && !isNaN(formulaValue)) {
|
|
61315
|
-
if (isEmptyValue2(value)) {
|
|
61316
|
-
return Promise.resolve();
|
|
61317
|
-
}
|
|
61318
|
-
const inputTime = dayjs(value).unix();
|
|
61319
|
-
const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
61320
|
-
if (inputTime < formulaValue) {
|
|
61321
|
-
return Promise.reject(
|
|
61322
|
-
new Error(
|
|
61323
|
-
buildError(
|
|
61324
|
-
$t("sys.edhr.fieldValueNotLessThan", {
|
|
61325
|
-
val: dayjs.unix(formulaValue).format(fmt)
|
|
61326
|
-
})
|
|
61327
|
-
)
|
|
61328
|
-
)
|
|
61329
|
-
);
|
|
61330
|
-
}
|
|
61331
|
-
}
|
|
61332
|
-
return Promise.resolve();
|
|
61333
|
-
}
|
|
61334
|
-
});
|
|
61335
|
-
}
|
|
61336
|
-
if (maxDateValidateMode === RangeValidateMode.Variable_Validate && maxDateFormulaExpr) {
|
|
61337
|
-
RuleProps.push({
|
|
61338
|
-
required: true,
|
|
61339
|
-
validator: async (_rule, value, callback, source, options) => {
|
|
61340
|
-
if (shouldSkipEnumValidation(_rule, options)) {
|
|
61341
|
-
return Promise.resolve();
|
|
61342
|
-
}
|
|
61343
|
-
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
61344
|
-
const currentFormData = getCurrentFormData(_rule, options);
|
|
61345
|
-
const formulaValue = await calculateFormula2(
|
|
61346
|
-
maxDateFormulaExpr,
|
|
61347
|
-
currentFormData,
|
|
61348
|
-
options?.formData
|
|
61349
|
-
);
|
|
61350
|
-
if (!isNil(formulaValue) && !isNaN(formulaValue)) {
|
|
61351
|
-
if (isEmptyValue2(value)) {
|
|
61352
|
-
return Promise.resolve();
|
|
61353
|
-
}
|
|
61354
|
-
const inputTime = dayjs(value).unix();
|
|
61355
|
-
const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
61356
|
-
if (inputTime > formulaValue) {
|
|
61357
|
-
return Promise.reject(
|
|
61358
|
-
new Error(
|
|
61359
|
-
buildError(
|
|
61360
|
-
$t("sys.edhr.fieldValueNoMoreThan", {
|
|
61361
|
-
val: dayjs.unix(formulaValue).format(fmt)
|
|
61362
|
-
})
|
|
61363
|
-
)
|
|
61364
|
-
)
|
|
61365
|
-
);
|
|
61366
|
-
}
|
|
61367
|
-
}
|
|
61368
|
-
return Promise.resolve();
|
|
61369
|
-
}
|
|
61370
|
-
});
|
|
61371
|
-
}
|
|
61372
|
-
}
|
|
61373
|
-
return RuleProps;
|
|
61374
|
-
});
|
|
61375
|
-
const getRules = (rules22, options) => rules22.map((item) => {
|
|
61376
|
-
return {
|
|
61377
|
-
...item,
|
|
61378
|
-
...options
|
|
61379
|
-
};
|
|
61380
|
-
});
|
|
61381
|
-
const resolveSubtableColIndex = () => {
|
|
61382
|
-
if (!isNil(props.childSubTableDataIndex)) {
|
|
61383
|
-
return props.childSubTableDataIndex;
|
|
61384
|
-
}
|
|
61385
|
-
if (targetFieldId === "value_") {
|
|
61386
|
-
if (!isNil(props.realColIndex)) return props.realColIndex;
|
|
61387
|
-
if (!isNil(props.realRowIndex)) return 0;
|
|
61388
|
-
}
|
|
61389
|
-
return void 0;
|
|
61390
|
-
};
|
|
61391
|
-
const resolveRuleEntry = () => {
|
|
61392
|
-
if (props.subtableFieldId) {
|
|
61393
|
-
if (!isNil(props.realRowIndex)) {
|
|
61394
|
-
const colIdx = resolveSubtableColIndex();
|
|
61395
|
-
if (colIdx !== void 0) {
|
|
61396
|
-
return {
|
|
61397
|
-
key: `${props.subtableFieldId}_${props.realRowIndex}_${targetFieldId}_${colIdx}`,
|
|
61398
|
-
options: {
|
|
61399
|
-
_subtableFieldId: props.subtableFieldId,
|
|
61400
|
-
_realRowIndex: props.realRowIndex,
|
|
61401
|
-
_targetFieldId: targetFieldId,
|
|
61402
|
-
_childSubTableDataIndex: colIdx,
|
|
61403
|
-
_belongFieldId: props.referenceInfo?.belongFieldId,
|
|
61404
|
-
_optionValue: props.referenceInfo?.optionValue,
|
|
61405
|
-
_multiple: props.referenceInfo?.multiple
|
|
61406
|
-
}
|
|
61407
|
-
};
|
|
61408
|
-
}
|
|
61409
|
-
return {
|
|
61410
|
-
key: `${props.subtableFieldId}_${props.realRowIndex}_${targetFieldId}`,
|
|
61411
|
-
options: {
|
|
61412
|
-
_subtableFieldId: props.subtableFieldId,
|
|
61413
|
-
_realRowIndex: props.realRowIndex,
|
|
61414
|
-
_targetFieldId: targetFieldId,
|
|
61415
|
-
_belongFieldId: props.referenceInfo?.belongFieldId,
|
|
61416
|
-
_optionValue: props.referenceInfo?.optionValue,
|
|
61417
|
-
_multiple: props.referenceInfo?.multiple
|
|
61418
|
-
}
|
|
61419
|
-
};
|
|
61420
|
-
}
|
|
61421
|
-
return null;
|
|
61422
|
-
}
|
|
61423
|
-
return {
|
|
61424
|
-
key: targetFieldId,
|
|
61425
|
-
options: {
|
|
61426
|
-
_targetFieldId: targetFieldId,
|
|
61427
|
-
_belongFieldId: props.referenceInfo?.belongFieldId,
|
|
61428
|
-
_optionValue: props.referenceInfo?.optionValue,
|
|
61429
|
-
_multiple: props.referenceInfo?.multiple
|
|
61430
|
-
}
|
|
61431
|
-
};
|
|
61432
|
-
};
|
|
61433
|
-
watch(
|
|
61434
|
-
() => rules2.value,
|
|
61435
|
-
() => {
|
|
61436
|
-
if (!targetFieldId || !rules2.value) return;
|
|
61437
|
-
const entry = resolveRuleEntry();
|
|
61438
|
-
if (!entry) return;
|
|
61439
|
-
if (rules2.value.length === 0) {
|
|
61440
|
-
delete formRules.value[entry.key];
|
|
61441
|
-
return;
|
|
61442
|
-
}
|
|
61443
|
-
formRules.value[entry.key] = getRules(toRaw(rules2.value), entry.options);
|
|
61444
|
-
},
|
|
61445
|
-
{
|
|
61446
|
-
immediate: true,
|
|
61447
|
-
deep: true
|
|
61448
|
-
}
|
|
61449
|
-
);
|
|
61450
|
-
const widgetStyles = computed(() => {
|
|
61451
|
-
if (widget.component === ComponentTypeEnum.DynValue) return {};
|
|
61452
|
-
const requiredActive = showRequired.value && !showDisabled.value && !["readonly-text", "readonly-component"].includes(showDisplayStatus.value);
|
|
61453
|
-
return {
|
|
61454
|
-
...sizeStyles,
|
|
61455
|
-
...requiredActive ? constantRequiredStyles : {},
|
|
61456
|
-
// 竖排文本替换为可靠实现,避免服务端打印时字符重叠
|
|
61457
|
-
...isVerticalLrText(widget.style) ? reliableVerticalTextStyles : {}
|
|
61458
|
-
};
|
|
61459
|
-
});
|
|
61460
|
-
return {
|
|
61461
|
-
widgetStyles,
|
|
61462
|
-
targetFieldId,
|
|
61463
|
-
isFieldModel
|
|
61464
|
-
};
|
|
61465
|
-
}
|
|
61466
|
-
const validate = async (formData, paper) => {
|
|
61467
|
-
if (!paper?.props) return;
|
|
61593
|
+
const flattenFormData = (formData, paper) => {
|
|
61468
61594
|
const subTable2DList = paper.props.subTable2DList ?? [];
|
|
61469
61595
|
const checkTable2DList = paper.props.checkTable2DList ?? [];
|
|
61470
61596
|
const list2D = [].concat(
|
|
61471
61597
|
subTable2DList,
|
|
61472
61598
|
checkTable2DList
|
|
61473
61599
|
);
|
|
61474
|
-
const _formRules_ = toRaw(formRules.value);
|
|
61475
|
-
console.log("_formRules_", _formRules_);
|
|
61476
61600
|
const filterKey = ["_DICT", "_OPCT", "__FOREIGN__", "_2DTABLE_"];
|
|
61477
61601
|
const _formData_ = {};
|
|
61478
61602
|
Object.keys(omit(formData, filterKey)).forEach((key) => {
|
|
@@ -61502,46 +61626,446 @@ const validate = async (formData, paper) => {
|
|
|
61502
61626
|
_formData_[key] = formData[key];
|
|
61503
61627
|
}
|
|
61504
61628
|
});
|
|
61505
|
-
|
|
61506
|
-
|
|
61507
|
-
|
|
61508
|
-
|
|
61509
|
-
|
|
61629
|
+
return _formData_;
|
|
61630
|
+
};
|
|
61631
|
+
function resolveActiveRules(mode, rules2, meta, formKeepExceptionHighlight) {
|
|
61632
|
+
const blocked = !!meta?.blocked;
|
|
61633
|
+
const keepExceptionHighlight = resolveKeepExceptionHighlight(
|
|
61634
|
+
formKeepExceptionHighlight,
|
|
61635
|
+
meta?.keepExceptionHighlight
|
|
61636
|
+
);
|
|
61637
|
+
const decision = resolveValidationAdmission({
|
|
61638
|
+
mode,
|
|
61639
|
+
blocked,
|
|
61640
|
+
keepExceptionHighlight
|
|
61641
|
+
});
|
|
61642
|
+
if (!decision.admit) {
|
|
61643
|
+
return [];
|
|
61644
|
+
}
|
|
61645
|
+
if (mode === "all") return rules2;
|
|
61646
|
+
if (mode === "display") {
|
|
61647
|
+
return blocked ? rules2 : filterRulesByTrigger(rules2, "change");
|
|
61648
|
+
}
|
|
61649
|
+
return filterRulesByTrigger(rules2, mode);
|
|
61650
|
+
}
|
|
61651
|
+
async function runValidation(formData, paper, options = {}) {
|
|
61652
|
+
if (!paper?.props) return;
|
|
61653
|
+
const mode = options.mode ?? "all";
|
|
61654
|
+
const rawRules = getRawFormRules();
|
|
61655
|
+
const rawMeta = getRawFormRuleMeta();
|
|
61656
|
+
const flatData = flattenFormData(formData, paper);
|
|
61657
|
+
const activeRules = {};
|
|
61658
|
+
const editablePaths = [];
|
|
61659
|
+
const livePaths = [];
|
|
61660
|
+
const validatedPaths = [];
|
|
61661
|
+
const ruleKeys = Object.keys(rawRules);
|
|
61662
|
+
for (const key of ruleKeys) {
|
|
61663
|
+
const meta = rawMeta[key];
|
|
61664
|
+
const rawPathRules = rawRules[key] ?? [];
|
|
61665
|
+
const attachCtx = resolveAttachContext(rawPathRules[0], meta?.attach);
|
|
61666
|
+
if (!isAttachFieldActive(attachCtx, formData)) {
|
|
61667
|
+
validatedPaths.push(key);
|
|
61668
|
+
if (!meta?.blocked) {
|
|
61669
|
+
editablePaths.push(key);
|
|
61670
|
+
}
|
|
61671
|
+
if (mode !== "all" && mode !== "display") {
|
|
61672
|
+
livePaths.push(key);
|
|
61673
|
+
}
|
|
61674
|
+
continue;
|
|
61675
|
+
}
|
|
61676
|
+
const rules2 = resolveActiveRules(mode, rawPathRules, meta, options.keepExceptionHighlight);
|
|
61677
|
+
if (!rules2.length) {
|
|
61678
|
+
if (mode === "display") {
|
|
61679
|
+
const isEditableAttachField = !!meta?.attach?.belongFieldId && !meta?.blocked;
|
|
61680
|
+
if (!isEditableAttachField) {
|
|
61681
|
+
validatedPaths.push(key);
|
|
61682
|
+
}
|
|
61683
|
+
}
|
|
61684
|
+
continue;
|
|
61685
|
+
}
|
|
61686
|
+
activeRules[key] = rules2;
|
|
61687
|
+
validatedPaths.push(key);
|
|
61688
|
+
if (!meta?.blocked) {
|
|
61689
|
+
editablePaths.push(key);
|
|
61690
|
+
}
|
|
61691
|
+
if (mode !== "all" && mode !== "display") {
|
|
61692
|
+
livePaths.push(key);
|
|
61693
|
+
}
|
|
61694
|
+
}
|
|
61695
|
+
const validator = new Schema(activeRules);
|
|
61696
|
+
const fields = await new Promise((resolve) => {
|
|
61697
|
+
validator.validate(flatData, { first: false, formData }, (errors, errorFields) => {
|
|
61510
61698
|
if (errors?.length) {
|
|
61511
|
-
resolve(
|
|
61512
|
-
isValid: false,
|
|
61513
|
-
fields
|
|
61514
|
-
});
|
|
61699
|
+
resolve(errorFields);
|
|
61515
61700
|
} else {
|
|
61516
|
-
resolve(
|
|
61701
|
+
resolve(void 0);
|
|
61517
61702
|
}
|
|
61518
61703
|
});
|
|
61519
61704
|
});
|
|
61520
|
-
|
|
61521
|
-
|
|
61522
|
-
|
|
61705
|
+
return {
|
|
61706
|
+
isValid: !fields || Object.keys(fields).length === 0,
|
|
61707
|
+
fields,
|
|
61708
|
+
editablePaths,
|
|
61709
|
+
livePaths,
|
|
61710
|
+
validatedPaths,
|
|
61711
|
+
ruleKeys,
|
|
61712
|
+
flatData
|
|
61713
|
+
};
|
|
61523
61714
|
}
|
|
61524
|
-
function
|
|
61525
|
-
const
|
|
61526
|
-
|
|
61527
|
-
|
|
61528
|
-
|
|
61529
|
-
|
|
61530
|
-
|
|
61531
|
-
|
|
61532
|
-
|
|
61533
|
-
|
|
61534
|
-
|
|
61535
|
-
|
|
61536
|
-
|
|
61537
|
-
|
|
61538
|
-
|
|
61715
|
+
function resolvePayloadForPath(path, flatData) {
|
|
61716
|
+
const rules2 = getRawFormRules()[path];
|
|
61717
|
+
if (!rules2) return null;
|
|
61718
|
+
return {
|
|
61719
|
+
value: flatData[path],
|
|
61720
|
+
rules: rules2
|
|
61721
|
+
};
|
|
61722
|
+
}
|
|
61723
|
+
function clearResolvedManualErrors(map, resolvePayload) {
|
|
61724
|
+
if (!map) return map;
|
|
61725
|
+
const next = { ...map };
|
|
61726
|
+
for (const path of Object.keys(next)) {
|
|
61727
|
+
const payload = resolvePayload(path);
|
|
61728
|
+
if (!payload) continue;
|
|
61729
|
+
const hasManual = filterRulesByTrigger(payload.rules, "manual").length > 0;
|
|
61730
|
+
const hasLive = filterRulesByTrigger(payload.rules, "change").length > 0;
|
|
61731
|
+
if (hasManual && !hasLive && !isEmptyValue$1(payload.value)) {
|
|
61732
|
+
delete next[path];
|
|
61733
|
+
}
|
|
61734
|
+
}
|
|
61735
|
+
return Object.keys(next).length ? next : null;
|
|
61736
|
+
}
|
|
61737
|
+
function mergeLiveValidation(current, liveResult, livePaths, resolvePayload) {
|
|
61738
|
+
const base = current && Object.keys(current).length ? { ...current } : {};
|
|
61739
|
+
for (const path of livePaths) {
|
|
61740
|
+
if (liveResult?.[path]) {
|
|
61741
|
+
base[path] = liveResult[path];
|
|
61742
|
+
continue;
|
|
61743
|
+
}
|
|
61744
|
+
const payload = resolvePayload(path);
|
|
61745
|
+
const keepManualComment = !!payload && filterRulesByTrigger(payload.rules, "manual").length > 0 && isEmptyValue$1(payload.value) && !!base[path]?.length;
|
|
61746
|
+
if (!keepManualComment) {
|
|
61747
|
+
delete base[path];
|
|
61748
|
+
}
|
|
61749
|
+
}
|
|
61750
|
+
const merged = Object.keys(base).length ? base : liveResult;
|
|
61751
|
+
return clearResolvedManualErrors(merged, resolvePayload);
|
|
61752
|
+
}
|
|
61753
|
+
function mergeSubmitValidation(current, submitResult, editablePaths) {
|
|
61754
|
+
const next = current && Object.keys(current).length ? { ...current } : {};
|
|
61755
|
+
for (const path of editablePaths) {
|
|
61756
|
+
if (submitResult?.[path]) {
|
|
61757
|
+
next[path] = submitResult[path];
|
|
61758
|
+
} else {
|
|
61759
|
+
delete next[path];
|
|
61760
|
+
}
|
|
61761
|
+
}
|
|
61762
|
+
return Object.keys(next).length ? next : null;
|
|
61763
|
+
}
|
|
61764
|
+
function pruneValidationComments(current, validPaths) {
|
|
61765
|
+
if (!current) return null;
|
|
61766
|
+
const next = {};
|
|
61767
|
+
for (const path of Object.keys(current)) {
|
|
61768
|
+
if (validPaths.has(path)) {
|
|
61769
|
+
next[path] = current[path];
|
|
61770
|
+
}
|
|
61771
|
+
}
|
|
61772
|
+
return Object.keys(next).length ? next : null;
|
|
61773
|
+
}
|
|
61774
|
+
function mergeDisplayValidation(current, displayResult, ruleKeys, validatedPaths) {
|
|
61775
|
+
const next = current && Object.keys(current).length ? { ...current } : {};
|
|
61776
|
+
const ruleSet = new Set(ruleKeys);
|
|
61777
|
+
const validatedSet = new Set(validatedPaths);
|
|
61778
|
+
for (const path of Object.keys(next)) {
|
|
61779
|
+
if (!ruleSet.has(path)) {
|
|
61780
|
+
delete next[path];
|
|
61781
|
+
}
|
|
61782
|
+
}
|
|
61783
|
+
for (const path of validatedSet) {
|
|
61784
|
+
if (displayResult?.[path]?.length) {
|
|
61785
|
+
next[path] = displayResult[path];
|
|
61786
|
+
} else {
|
|
61787
|
+
delete next[path];
|
|
61788
|
+
}
|
|
61789
|
+
}
|
|
61790
|
+
return Object.keys(next).length ? next : null;
|
|
61791
|
+
}
|
|
61792
|
+
const DEBOUNCE_MS = 300;
|
|
61793
|
+
const schedulersById = /* @__PURE__ */ new Map();
|
|
61794
|
+
function getScheduler(id) {
|
|
61795
|
+
let scheduler = schedulersById.get(id);
|
|
61796
|
+
if (!scheduler) {
|
|
61797
|
+
scheduler = {
|
|
61798
|
+
debounceTimer: null,
|
|
61799
|
+
running: false,
|
|
61800
|
+
pendingTrigger: "change"
|
|
61801
|
+
};
|
|
61802
|
+
schedulersById.set(id, scheduler);
|
|
61803
|
+
}
|
|
61804
|
+
return scheduler;
|
|
61805
|
+
}
|
|
61806
|
+
function clearValidationScheduler(id) {
|
|
61807
|
+
const scheduler = schedulersById.get(id);
|
|
61808
|
+
if (!scheduler) return;
|
|
61809
|
+
if (scheduler.debounceTimer) {
|
|
61810
|
+
clearTimeout(scheduler.debounceTimer);
|
|
61811
|
+
scheduler.debounceTimer = null;
|
|
61812
|
+
}
|
|
61813
|
+
schedulersById.delete(id);
|
|
61814
|
+
}
|
|
61815
|
+
function clearAllValidationSchedulers() {
|
|
61816
|
+
for (const id of [...schedulersById.keys()]) {
|
|
61817
|
+
clearValidationScheduler(id);
|
|
61818
|
+
}
|
|
61819
|
+
}
|
|
61820
|
+
function requestScheduledValidation(id, execute, options = {}) {
|
|
61821
|
+
const { immediate = false, trigger = "change" } = options;
|
|
61822
|
+
const scheduler = getScheduler(id);
|
|
61823
|
+
const run = async (mode) => {
|
|
61824
|
+
if (scheduler.running) {
|
|
61825
|
+
scheduler.pendingTrigger = mode;
|
|
61826
|
+
return;
|
|
61827
|
+
}
|
|
61828
|
+
scheduler.running = true;
|
|
61829
|
+
try {
|
|
61830
|
+
await execute(mode);
|
|
61831
|
+
const pending = scheduler.pendingTrigger;
|
|
61832
|
+
scheduler.pendingTrigger = "change";
|
|
61833
|
+
if (pending !== mode) {
|
|
61834
|
+
await execute(pending);
|
|
61835
|
+
}
|
|
61836
|
+
} finally {
|
|
61837
|
+
scheduler.running = false;
|
|
61838
|
+
}
|
|
61839
|
+
};
|
|
61840
|
+
if (immediate) {
|
|
61841
|
+
if (scheduler.debounceTimer) {
|
|
61842
|
+
clearTimeout(scheduler.debounceTimer);
|
|
61843
|
+
scheduler.debounceTimer = null;
|
|
61844
|
+
}
|
|
61845
|
+
scheduler.pendingTrigger = trigger;
|
|
61846
|
+
void run(trigger);
|
|
61847
|
+
return;
|
|
61848
|
+
}
|
|
61849
|
+
scheduler.pendingTrigger = trigger;
|
|
61850
|
+
if (scheduler.debounceTimer) {
|
|
61851
|
+
clearTimeout(scheduler.debounceTimer);
|
|
61852
|
+
}
|
|
61853
|
+
scheduler.debounceTimer = setTimeout(() => {
|
|
61854
|
+
scheduler.debounceTimer = null;
|
|
61855
|
+
void run(scheduler.pendingTrigger);
|
|
61856
|
+
}, DEBOUNCE_MS);
|
|
61857
|
+
}
|
|
61858
|
+
async function waitForTickSettle() {
|
|
61859
|
+
await nextTick$1();
|
|
61860
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
61861
|
+
}
|
|
61862
|
+
function countAttachRules() {
|
|
61863
|
+
const meta = getRawFormRuleMeta();
|
|
61864
|
+
let n = 0;
|
|
61865
|
+
for (const key of Object.keys(meta)) {
|
|
61866
|
+
if (meta[key]?.attach?.belongFieldId != null) n += 1;
|
|
61867
|
+
}
|
|
61868
|
+
return n;
|
|
61869
|
+
}
|
|
61870
|
+
async function waitForValidationReady(options) {
|
|
61871
|
+
const timeoutMs = options?.timeoutMs ?? 3e3;
|
|
61872
|
+
const intervalMs = options?.intervalMs ?? 50;
|
|
61873
|
+
const stableRounds = options?.stableRounds ?? 4;
|
|
61874
|
+
const minElapsedMs = options?.minElapsedMs ?? 0;
|
|
61875
|
+
await waitForTickSettle();
|
|
61876
|
+
const startedAt = Date.now();
|
|
61877
|
+
const deadline = startedAt + timeoutMs;
|
|
61878
|
+
let lastSignature = "";
|
|
61879
|
+
let stable = 0;
|
|
61880
|
+
while (Date.now() < deadline) {
|
|
61881
|
+
const signature = `${listFormRuleKeys().length}:${countAttachRules()}`;
|
|
61882
|
+
if (signature === lastSignature) {
|
|
61883
|
+
stable += 1;
|
|
61884
|
+
if (stable >= stableRounds && Date.now() - startedAt >= minElapsedMs) {
|
|
61885
|
+
await nextTick$1();
|
|
61886
|
+
await nextTick$1();
|
|
61887
|
+
return;
|
|
61539
61888
|
}
|
|
61540
61889
|
} else {
|
|
61541
|
-
|
|
61890
|
+
lastSignature = signature;
|
|
61891
|
+
stable = 0;
|
|
61542
61892
|
}
|
|
61893
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
61543
61894
|
}
|
|
61544
|
-
|
|
61895
|
+
await nextTick$1();
|
|
61896
|
+
}
|
|
61897
|
+
const contexts = /* @__PURE__ */ new Map();
|
|
61898
|
+
function registerValidationContext(ctx) {
|
|
61899
|
+
contexts.set(ctx.uniqueId, ctx);
|
|
61900
|
+
}
|
|
61901
|
+
function unregisterValidationContext(uniqueId) {
|
|
61902
|
+
clearValidationScheduler(uniqueId);
|
|
61903
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
61904
|
+
cancelStructureChangeTimer(uniqueId);
|
|
61905
|
+
contexts.delete(uniqueId);
|
|
61906
|
+
}
|
|
61907
|
+
function getContext(uniqueId) {
|
|
61908
|
+
return contexts.get(uniqueId);
|
|
61909
|
+
}
|
|
61910
|
+
function resolveFormKeep(ctx) {
|
|
61911
|
+
return resolveKeepExceptionHighlight(ctx.getKeepExceptionHighlight?.(), void 0);
|
|
61912
|
+
}
|
|
61913
|
+
function cancelPendingDisplayTimer(uniqueId) {
|
|
61914
|
+
const prev = displayDebounceTimers.get(uniqueId);
|
|
61915
|
+
if (prev) {
|
|
61916
|
+
clearTimeout(prev);
|
|
61917
|
+
displayDebounceTimers.delete(uniqueId);
|
|
61918
|
+
}
|
|
61919
|
+
}
|
|
61920
|
+
async function executeValidation(ctx, mode) {
|
|
61921
|
+
const paper = ctx.getPaper();
|
|
61922
|
+
if (!paper) return;
|
|
61923
|
+
const formData = ctx.getFormData();
|
|
61924
|
+
const res = await runValidation(formData, paper, {
|
|
61925
|
+
mode,
|
|
61926
|
+
keepExceptionHighlight: resolveFormKeep(ctx)
|
|
61927
|
+
});
|
|
61928
|
+
if (!res) return;
|
|
61929
|
+
const fields = res.fields ?? null;
|
|
61930
|
+
const editablePaths = res.editablePaths ?? [];
|
|
61931
|
+
const livePaths = res.livePaths ?? [];
|
|
61932
|
+
const flatData = res.flatData ?? {};
|
|
61933
|
+
if (mode === "all") {
|
|
61934
|
+
const merged = mergeSubmitValidation(ctx.getComments(), fields, editablePaths);
|
|
61935
|
+
ctx.applyComments(merged);
|
|
61936
|
+
} else if (mode === "display") {
|
|
61937
|
+
const merged = mergeDisplayValidation(
|
|
61938
|
+
ctx.getComments(),
|
|
61939
|
+
fields,
|
|
61940
|
+
res.ruleKeys ?? listFormRuleKeys(),
|
|
61941
|
+
res.validatedPaths ?? Object.keys(fields ?? {})
|
|
61942
|
+
);
|
|
61943
|
+
ctx.applyComments(merged);
|
|
61944
|
+
} else {
|
|
61945
|
+
const merged = mergeLiveValidation(
|
|
61946
|
+
ctx.getComments(),
|
|
61947
|
+
fields,
|
|
61948
|
+
livePaths,
|
|
61949
|
+
(path) => resolvePayloadForPath(path, flatData)
|
|
61950
|
+
);
|
|
61951
|
+
ctx.applyComments(merged);
|
|
61952
|
+
}
|
|
61953
|
+
return res;
|
|
61954
|
+
}
|
|
61955
|
+
async function validateAllFields(uniqueId) {
|
|
61956
|
+
const ctx = getContext(uniqueId);
|
|
61957
|
+
if (!ctx) {
|
|
61958
|
+
return void 0;
|
|
61959
|
+
}
|
|
61960
|
+
return executeValidation(ctx, "all");
|
|
61961
|
+
}
|
|
61962
|
+
async function validateDisplayFields(uniqueId) {
|
|
61963
|
+
const ctx = getContext(uniqueId);
|
|
61964
|
+
if (!ctx) return;
|
|
61965
|
+
return executeValidation(ctx, "display");
|
|
61966
|
+
}
|
|
61967
|
+
const displayDebounceTimers = /* @__PURE__ */ new Map();
|
|
61968
|
+
const DISPLAY_DEBOUNCE_MS = 320;
|
|
61969
|
+
const structureChangeTimers = /* @__PURE__ */ new Map();
|
|
61970
|
+
function cancelStructureChangeTimer(uniqueId) {
|
|
61971
|
+
const prev = structureChangeTimers.get(uniqueId);
|
|
61972
|
+
if (prev) {
|
|
61973
|
+
clearTimeout(prev);
|
|
61974
|
+
structureChangeTimers.delete(uniqueId);
|
|
61975
|
+
}
|
|
61976
|
+
}
|
|
61977
|
+
function scheduleRevalidateAfterStructureChange(uniqueId) {
|
|
61978
|
+
cancelStructureChangeTimer(uniqueId);
|
|
61979
|
+
structureChangeTimers.set(
|
|
61980
|
+
uniqueId,
|
|
61981
|
+
setTimeout(() => {
|
|
61982
|
+
structureChangeTimers.delete(uniqueId);
|
|
61983
|
+
void (async () => {
|
|
61984
|
+
await waitForValidationReady({
|
|
61985
|
+
timeoutMs: 2e3,
|
|
61986
|
+
stableRounds: 3,
|
|
61987
|
+
minElapsedMs: 40
|
|
61988
|
+
});
|
|
61989
|
+
pruneFormValidationComments(uniqueId);
|
|
61990
|
+
requestFullValidation(uniqueId, { trigger: "change" });
|
|
61991
|
+
requestDisplayValidation(uniqueId);
|
|
61992
|
+
})();
|
|
61993
|
+
}, 60)
|
|
61994
|
+
);
|
|
61995
|
+
}
|
|
61996
|
+
function requestDisplayValidation(uniqueId, immediate = false) {
|
|
61997
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
61998
|
+
const run = () => {
|
|
61999
|
+
displayDebounceTimers.delete(uniqueId);
|
|
62000
|
+
void validateDisplayFields(uniqueId);
|
|
62001
|
+
};
|
|
62002
|
+
if (immediate) {
|
|
62003
|
+
run();
|
|
62004
|
+
return;
|
|
62005
|
+
}
|
|
62006
|
+
displayDebounceTimers.set(uniqueId, setTimeout(run, DISPLAY_DEBOUNCE_MS));
|
|
62007
|
+
}
|
|
62008
|
+
function requestFullValidation(uniqueId, options = {}) {
|
|
62009
|
+
const ctx = getContext(uniqueId);
|
|
62010
|
+
if (!ctx) return;
|
|
62011
|
+
requestScheduledValidation(
|
|
62012
|
+
uniqueId,
|
|
62013
|
+
async (trigger) => {
|
|
62014
|
+
await executeValidation(ctx, trigger);
|
|
62015
|
+
},
|
|
62016
|
+
options
|
|
62017
|
+
);
|
|
62018
|
+
}
|
|
62019
|
+
function pruneFormValidationComments(uniqueId) {
|
|
62020
|
+
const ctx = getContext(uniqueId);
|
|
62021
|
+
if (!ctx) return;
|
|
62022
|
+
const validPaths = new Set(listFormRuleKeys());
|
|
62023
|
+
ctx.applyComments(pruneValidationComments(ctx.getComments(), validPaths));
|
|
62024
|
+
}
|
|
62025
|
+
function clearFormRules() {
|
|
62026
|
+
clearAllValidationSchedulers();
|
|
62027
|
+
for (const timer of displayDebounceTimers.values()) {
|
|
62028
|
+
clearTimeout(timer);
|
|
62029
|
+
}
|
|
62030
|
+
displayDebounceTimers.clear();
|
|
62031
|
+
for (const timer of structureChangeTimers.values()) {
|
|
62032
|
+
clearTimeout(timer);
|
|
62033
|
+
}
|
|
62034
|
+
structureChangeTimers.clear();
|
|
62035
|
+
clearFormRules$1();
|
|
62036
|
+
}
|
|
62037
|
+
function deleteSubtableRow(subtableFieldId, realRowIndex) {
|
|
62038
|
+
deleteSubtableRow$1(subtableFieldId, realRowIndex);
|
|
62039
|
+
for (const uniqueId of contexts.keys()) {
|
|
62040
|
+
pruneFormValidationComments(uniqueId);
|
|
62041
|
+
scheduleRevalidateAfterStructureChange(uniqueId);
|
|
62042
|
+
}
|
|
62043
|
+
}
|
|
62044
|
+
function insertSubtableRows(subtableFieldId, insertIndex, count = 1) {
|
|
62045
|
+
insertSubtableRows$1(subtableFieldId, insertIndex, count);
|
|
62046
|
+
for (const uniqueId of contexts.keys()) {
|
|
62047
|
+
pruneFormValidationComments(uniqueId);
|
|
62048
|
+
scheduleRevalidateAfterStructureChange(uniqueId);
|
|
62049
|
+
}
|
|
62050
|
+
}
|
|
62051
|
+
async function settleAndValidateDisplay(uniqueId) {
|
|
62052
|
+
await waitForValidationReady();
|
|
62053
|
+
await validateDisplayFields(uniqueId);
|
|
62054
|
+
}
|
|
62055
|
+
async function settleAfterModeSwitch(uniqueId, options) {
|
|
62056
|
+
const ctx = getContext(uniqueId);
|
|
62057
|
+
if (!ctx) return;
|
|
62058
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
62059
|
+
await waitForValidationReady({ timeoutMs: 4e3, stableRounds: 6, minElapsedMs: 450 });
|
|
62060
|
+
await nextTick$1();
|
|
62061
|
+
await waitForTickSettle();
|
|
62062
|
+
await new Promise((resolve) => setTimeout(resolve, 280));
|
|
62063
|
+
await waitForValidationReady({ timeoutMs: 2500, stableRounds: 5, minElapsedMs: 200 });
|
|
62064
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
62065
|
+
if (options?.runChangeLive) {
|
|
62066
|
+
await executeValidation(ctx, "change");
|
|
62067
|
+
}
|
|
62068
|
+
await validateDisplayFields(uniqueId);
|
|
61545
62069
|
}
|
|
61546
62070
|
const getApi$1 = api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey;
|
|
61547
62071
|
const postApi = api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey;
|
|
@@ -61711,6 +62235,303 @@ function calcFillData(data, fillMapArr) {
|
|
|
61711
62235
|
}
|
|
61712
62236
|
return obj;
|
|
61713
62237
|
}
|
|
62238
|
+
const FormChangeRowCellType = {
|
|
62239
|
+
ADD: "SUBTABLE_ROW_ADD",
|
|
62240
|
+
DEL: "SUBTABLE_ROW_DEL"
|
|
62241
|
+
};
|
|
62242
|
+
const ROW_LOC_RE = /^(.+)__ROW__(ADD|DEL)__(.+)$/;
|
|
62243
|
+
const FIELD_RID_MARK = "__RID__";
|
|
62244
|
+
const FIELD_MARK = "__FIELD__";
|
|
62245
|
+
const COL_MARK = "__COL__";
|
|
62246
|
+
const ROW_LABEL = {
|
|
62247
|
+
dash: "—",
|
|
62248
|
+
add: "新增一行",
|
|
62249
|
+
del: "已删除"
|
|
62250
|
+
};
|
|
62251
|
+
const SNAPSHOT_SKIP = /* @__PURE__ */ new Set([
|
|
62252
|
+
"tempDeleted",
|
|
62253
|
+
FRONT_ROW_KEY,
|
|
62254
|
+
"id_",
|
|
62255
|
+
"group_",
|
|
62256
|
+
"sort_num_",
|
|
62257
|
+
"ref_master_id_",
|
|
62258
|
+
"ref_field_key_",
|
|
62259
|
+
"ref_model_key_",
|
|
62260
|
+
"tenant_id_",
|
|
62261
|
+
"deleted_",
|
|
62262
|
+
"is_confirmed_"
|
|
62263
|
+
]);
|
|
62264
|
+
function rowIdentityKeys(row) {
|
|
62265
|
+
if (!row) return [];
|
|
62266
|
+
return [
|
|
62267
|
+
row[FRONT_ROW_KEY] != null && String(row[FRONT_ROW_KEY]).trim() !== "" ? String(row[FRONT_ROW_KEY]) : void 0,
|
|
62268
|
+
row.id_ != null && row.id_ !== "" ? String(row.id_) : void 0
|
|
62269
|
+
].filter(Boolean);
|
|
62270
|
+
}
|
|
62271
|
+
function getFormChangeRowKey(row) {
|
|
62272
|
+
return rowIdentityKeys(row)[0];
|
|
62273
|
+
}
|
|
62274
|
+
function rowMatchesIdentity(row, ...idents) {
|
|
62275
|
+
const keys2 = rowIdentityKeys(row);
|
|
62276
|
+
return idents.some((id) => id != null && id !== "" && keys2.includes(String(id)));
|
|
62277
|
+
}
|
|
62278
|
+
function buildFormChangeRowLocation(subFieldId, rowKey, op) {
|
|
62279
|
+
return `${subFieldId}__ROW__${op}__${rowKey}`;
|
|
62280
|
+
}
|
|
62281
|
+
function parseFormChangeRowLocation(cellLocation) {
|
|
62282
|
+
if (!cellLocation) return null;
|
|
62283
|
+
const matched = cellLocation.match(ROW_LOC_RE);
|
|
62284
|
+
if (!matched) return null;
|
|
62285
|
+
return {
|
|
62286
|
+
subFieldId: matched[1],
|
|
62287
|
+
op: matched[2],
|
|
62288
|
+
rowKey: matched[3]
|
|
62289
|
+
};
|
|
62290
|
+
}
|
|
62291
|
+
function isFormChangeRowLocation(cellLocation) {
|
|
62292
|
+
return !!parseFormChangeRowLocation(cellLocation);
|
|
62293
|
+
}
|
|
62294
|
+
function getFormChangeRowOp(cellLocation) {
|
|
62295
|
+
return parseFormChangeRowLocation(cellLocation)?.op ?? null;
|
|
62296
|
+
}
|
|
62297
|
+
function isAnnLocationSelected(selectId, loc) {
|
|
62298
|
+
if (!loc || selectId == null) return false;
|
|
62299
|
+
return Array.isArray(selectId) ? selectId.includes(loc) : selectId === loc;
|
|
62300
|
+
}
|
|
62301
|
+
function isFormChangeGhostRow(row) {
|
|
62302
|
+
return !!(row?.deleted_ || row?.__fcOrphanAdd);
|
|
62303
|
+
}
|
|
62304
|
+
function buildStableFieldLocation(subFieldId, rowKey, fieldId, colIdx) {
|
|
62305
|
+
const base = `${subFieldId}${FIELD_RID_MARK}${rowKey}${FIELD_MARK}${fieldId}`;
|
|
62306
|
+
return colIdx === void 0 ? base : `${base}${COL_MARK}${colIdx}`;
|
|
62307
|
+
}
|
|
62308
|
+
function parseStableFieldLocation(cellLocation) {
|
|
62309
|
+
if (!cellLocation || !cellLocation.includes(FIELD_RID_MARK)) return null;
|
|
62310
|
+
const ridAt = cellLocation.indexOf(FIELD_RID_MARK);
|
|
62311
|
+
const subFieldId = cellLocation.slice(0, ridAt);
|
|
62312
|
+
const afterRid = cellLocation.slice(ridAt + FIELD_RID_MARK.length);
|
|
62313
|
+
const fieldAt = afterRid.indexOf(FIELD_MARK);
|
|
62314
|
+
if (fieldAt < 0) return null;
|
|
62315
|
+
const rowKey = afterRid.slice(0, fieldAt);
|
|
62316
|
+
const afterField = afterRid.slice(fieldAt + FIELD_MARK.length);
|
|
62317
|
+
const colAt = afterField.indexOf(COL_MARK);
|
|
62318
|
+
if (colAt >= 0) {
|
|
62319
|
+
return {
|
|
62320
|
+
subFieldId,
|
|
62321
|
+
rowKey,
|
|
62322
|
+
fieldId: afterField.slice(0, colAt),
|
|
62323
|
+
colIdx: Number(afterField.slice(colAt + COL_MARK.length))
|
|
62324
|
+
};
|
|
62325
|
+
}
|
|
62326
|
+
return { subFieldId, rowKey, fieldId: afterField, colIdx: void 0 };
|
|
62327
|
+
}
|
|
62328
|
+
function resolveAnnotationFieldLocation(options) {
|
|
62329
|
+
const { annList, subFieldId, fieldId, row, colIdx } = options;
|
|
62330
|
+
if (!Array.isArray(annList) || !annList.length || !subFieldId) return void 0;
|
|
62331
|
+
if (!rowIdentityKeys(row).length) return void 0;
|
|
62332
|
+
return annList.find((loc) => {
|
|
62333
|
+
const parsed = parseStableFieldLocation(loc);
|
|
62334
|
+
if (!parsed || parsed.subFieldId !== subFieldId || parsed.fieldId !== fieldId) return false;
|
|
62335
|
+
if (colIdx !== void 0 && parsed.colIdx !== colIdx) return false;
|
|
62336
|
+
if (colIdx === void 0 && parsed.colIdx !== void 0) return false;
|
|
62337
|
+
return rowMatchesIdentity(row, parsed.rowKey);
|
|
62338
|
+
});
|
|
62339
|
+
}
|
|
62340
|
+
function shouldSkipSnapshotKey(key) {
|
|
62341
|
+
return SNAPSHOT_SKIP.has(key) || key.startsWith("__fc") || key.startsWith("_") || key.endsWith("_lb_");
|
|
62342
|
+
}
|
|
62343
|
+
function pickRowSnapshot(row) {
|
|
62344
|
+
if (!row) return {};
|
|
62345
|
+
const out = {};
|
|
62346
|
+
Object.keys(row).forEach((key) => {
|
|
62347
|
+
if (shouldSkipSnapshotKey(key)) return;
|
|
62348
|
+
const value = row[key];
|
|
62349
|
+
if (value == null || value === "") return;
|
|
62350
|
+
out[key] = cloneDeep(value);
|
|
62351
|
+
});
|
|
62352
|
+
return out;
|
|
62353
|
+
}
|
|
62354
|
+
function buildRowPayload(rowKey, row, prevId) {
|
|
62355
|
+
return JSON.stringify({
|
|
62356
|
+
rowKey,
|
|
62357
|
+
snapshot: pickRowSnapshot(row),
|
|
62358
|
+
id: row?.id_ ?? prevId
|
|
62359
|
+
});
|
|
62360
|
+
}
|
|
62361
|
+
function parseRowPayload(raw) {
|
|
62362
|
+
if (raw == null || raw === "") return null;
|
|
62363
|
+
try {
|
|
62364
|
+
const parsed = JSON.parse(raw);
|
|
62365
|
+
if (parsed && typeof parsed === "object" && parsed.rowKey) {
|
|
62366
|
+
return {
|
|
62367
|
+
rowKey: String(parsed.rowKey),
|
|
62368
|
+
snapshot: parsed.snapshot && typeof parsed.snapshot === "object" ? parsed.snapshot : {},
|
|
62369
|
+
id: parsed.id
|
|
62370
|
+
};
|
|
62371
|
+
}
|
|
62372
|
+
} catch (e) {
|
|
62373
|
+
}
|
|
62374
|
+
return null;
|
|
62375
|
+
}
|
|
62376
|
+
function recordRowOp(ds, subFieldId, row, op) {
|
|
62377
|
+
if (!ds?.formChangeStatus) return;
|
|
62378
|
+
const rowKey = getFormChangeRowKey(row);
|
|
62379
|
+
if (!rowKey) return;
|
|
62380
|
+
const loc = buildFormChangeRowLocation(subFieldId, rowKey, op);
|
|
62381
|
+
if (op === "DEL") {
|
|
62382
|
+
const addLoc = buildFormChangeRowLocation(subFieldId, rowKey, "ADD");
|
|
62383
|
+
const hadAdd = !!ds.formChangeNewData?.[addLoc];
|
|
62384
|
+
const next = { ...ds.formChangeNewData || {} };
|
|
62385
|
+
delete next[addLoc];
|
|
62386
|
+
delete next[loc];
|
|
62387
|
+
ds.formChangeNewData = next;
|
|
62388
|
+
if (hadAdd) return;
|
|
62389
|
+
}
|
|
62390
|
+
const payload = buildRowPayload(rowKey, row);
|
|
62391
|
+
ds.formChangeNewData = {
|
|
62392
|
+
...ds.formChangeNewData || {},
|
|
62393
|
+
[loc]: {
|
|
62394
|
+
cellLocation: loc,
|
|
62395
|
+
cellType: FormChangeRowCellType[op],
|
|
62396
|
+
beforeValue: op === "DEL" ? payload : "",
|
|
62397
|
+
beforeLabel: ROW_LABEL.dash,
|
|
62398
|
+
afterValue: op === "ADD" ? payload : "",
|
|
62399
|
+
afterLabel: op === "ADD" ? ROW_LABEL.add : ROW_LABEL.del
|
|
62400
|
+
}
|
|
62401
|
+
};
|
|
62402
|
+
}
|
|
62403
|
+
function isRowAddedInCurrentFormChange(dataRelationShip, subFieldId, row) {
|
|
62404
|
+
if (!dataRelationShip?.formChangeStatus || !subFieldId || !row) return false;
|
|
62405
|
+
const rowKey = getFormChangeRowKey(row);
|
|
62406
|
+
if (!rowKey) return false;
|
|
62407
|
+
return !!dataRelationShip.formChangeNewData?.[buildFormChangeRowLocation(subFieldId, rowKey, "ADD")];
|
|
62408
|
+
}
|
|
62409
|
+
function recordSubtableRowAdd(dataRelationShip, subFieldId, rows) {
|
|
62410
|
+
rows?.forEach((row) => recordRowOp(dataRelationShip, subFieldId, row, "ADD"));
|
|
62411
|
+
}
|
|
62412
|
+
function recordSubtableRowDelete(dataRelationShip, subFieldId, row) {
|
|
62413
|
+
if (row) recordRowOp(dataRelationShip, subFieldId, row, "DEL");
|
|
62414
|
+
}
|
|
62415
|
+
function findRowByKey(candidates, rowKey, id) {
|
|
62416
|
+
return candidates.find((row) => rowMatchesIdentity(row, rowKey, id));
|
|
62417
|
+
}
|
|
62418
|
+
function enrichFormChangeRowDetails(formChangeNewData, formState) {
|
|
62419
|
+
if (!formChangeNewData || !formState) return formChangeNewData;
|
|
62420
|
+
Object.values(formChangeNewData).forEach((detail) => {
|
|
62421
|
+
const loc = parseFormChangeRowLocation(detail?.cellLocation);
|
|
62422
|
+
if (!loc) return;
|
|
62423
|
+
const rows = formState[loc.subFieldId];
|
|
62424
|
+
if (!Array.isArray(rows)) return;
|
|
62425
|
+
const isAdd = loc.op === "ADD";
|
|
62426
|
+
const prev = parseRowPayload(isAdd ? detail.afterValue : detail.beforeValue);
|
|
62427
|
+
const row = findRowByKey(rows, loc.rowKey, prev?.id);
|
|
62428
|
+
if (!row) return;
|
|
62429
|
+
const payload = buildRowPayload(loc.rowKey, row, prev?.id);
|
|
62430
|
+
if (isAdd) {
|
|
62431
|
+
detail.afterValue = payload;
|
|
62432
|
+
detail.afterLabel = ROW_LABEL.add;
|
|
62433
|
+
} else {
|
|
62434
|
+
detail.beforeValue = payload;
|
|
62435
|
+
detail.beforeLabel = ROW_LABEL.dash;
|
|
62436
|
+
detail.afterLabel = ROW_LABEL.del;
|
|
62437
|
+
}
|
|
62438
|
+
});
|
|
62439
|
+
return formChangeNewData;
|
|
62440
|
+
}
|
|
62441
|
+
function extractFormChangeRowDetails(items) {
|
|
62442
|
+
const result = [];
|
|
62443
|
+
(items || []).forEach((item) => {
|
|
62444
|
+
(item?.details || []).forEach((detail) => {
|
|
62445
|
+
const loc = parseFormChangeRowLocation(detail?.cellLocation);
|
|
62446
|
+
if (!loc) return;
|
|
62447
|
+
const raw = loc.op === "ADD" ? detail.afterValue : detail.beforeValue;
|
|
62448
|
+
const payload = parseRowPayload(raw) || { rowKey: loc.rowKey, snapshot: {} };
|
|
62449
|
+
result.push({
|
|
62450
|
+
cellLocation: detail.cellLocation,
|
|
62451
|
+
cellType: loc.op === "ADD" ? FormChangeRowCellType.ADD : FormChangeRowCellType.DEL,
|
|
62452
|
+
op: loc.op,
|
|
62453
|
+
subFieldId: loc.subFieldId,
|
|
62454
|
+
rowKey: payload.rowKey || loc.rowKey,
|
|
62455
|
+
snapshot: payload.snapshot || {},
|
|
62456
|
+
id: payload.id != null ? String(payload.id) : void 0
|
|
62457
|
+
});
|
|
62458
|
+
});
|
|
62459
|
+
});
|
|
62460
|
+
return result;
|
|
62461
|
+
}
|
|
62462
|
+
function detailsHaveFormChangeRowOps(details) {
|
|
62463
|
+
return (details || []).some((d) => isFormChangeRowLocation(d?.cellLocation));
|
|
62464
|
+
}
|
|
62465
|
+
function collectFormChangeFieldLocations(items) {
|
|
62466
|
+
const set2 = /* @__PURE__ */ new Set();
|
|
62467
|
+
(items || []).forEach((item) => {
|
|
62468
|
+
(item.details || []).forEach((detail) => {
|
|
62469
|
+
const loc = detail?.cellLocation;
|
|
62470
|
+
if (loc && !isFormChangeRowLocation(loc)) set2.add(loc);
|
|
62471
|
+
});
|
|
62472
|
+
});
|
|
62473
|
+
return Array.from(set2);
|
|
62474
|
+
}
|
|
62475
|
+
function resolveRowFormChangeMark(subFieldId, row, annRowDetails) {
|
|
62476
|
+
if (!rowIdentityKeys(row).length) return null;
|
|
62477
|
+
const details = (annRowDetails || []).filter(
|
|
62478
|
+
(item) => item.subFieldId === subFieldId && rowMatchesIdentity(row, item.rowKey, item.id)
|
|
62479
|
+
);
|
|
62480
|
+
if (!details.length) return null;
|
|
62481
|
+
const foundDel = details.find((item) => item.op === "DEL");
|
|
62482
|
+
const foundAdd = details.find((item) => item.op === "ADD");
|
|
62483
|
+
const hit = row?.deleted_ ? foundDel : foundAdd || foundDel;
|
|
62484
|
+
return hit ? { op: hit.op, cellLocation: hit.cellLocation } : null;
|
|
62485
|
+
}
|
|
62486
|
+
const WM_UI = {
|
|
62487
|
+
ADD: {
|
|
62488
|
+
trClass: "form-change-row-add",
|
|
62489
|
+
wmText: "新增",
|
|
62490
|
+
wmClass: "form-change-row-wm--add"
|
|
62491
|
+
},
|
|
62492
|
+
DEL: {
|
|
62493
|
+
trClass: "form-change-row-del",
|
|
62494
|
+
wmText: "删除",
|
|
62495
|
+
wmClass: "form-change-row-wm--del"
|
|
62496
|
+
},
|
|
62497
|
+
ORPHAN: {
|
|
62498
|
+
trClass: "form-change-row-orphan",
|
|
62499
|
+
wmText: "增后删",
|
|
62500
|
+
wmClass: "form-change-row-wm--orphan"
|
|
62501
|
+
}
|
|
62502
|
+
};
|
|
62503
|
+
function resolveFormChangeRowUi(row, rowMark) {
|
|
62504
|
+
if (!rowMark) {
|
|
62505
|
+
return { trClass: "", wmKind: null, wmText: "", wmClass: "" };
|
|
62506
|
+
}
|
|
62507
|
+
const wmKind = rowMark.op === "DEL" ? "DEL" : row?.__fcOrphanAdd ? "ORPHAN" : "ADD";
|
|
62508
|
+
return { wmKind, ...WM_UI[wmKind] };
|
|
62509
|
+
}
|
|
62510
|
+
function buildFormChangeDisplayRows(subFieldId, currentRows, annRowDetails) {
|
|
62511
|
+
const rows = currentRows || [];
|
|
62512
|
+
const liveRows = rows.filter((row) => !row?.deleted_);
|
|
62513
|
+
const details = (annRowDetails || []).filter((item) => item.subFieldId === subFieldId);
|
|
62514
|
+
if (!details.length) return liveRows;
|
|
62515
|
+
const deletedRows = rows.filter((row) => row?.deleted_);
|
|
62516
|
+
const makeGhost = (detail, orphan = false) => ({
|
|
62517
|
+
...cloneDeep(detail.snapshot || {}),
|
|
62518
|
+
...detail.id != null ? { id_: detail.id } : {},
|
|
62519
|
+
[FRONT_ROW_KEY]: detail.rowKey,
|
|
62520
|
+
...orphan ? { __fcOrphanAdd: true } : { deleted_: true }
|
|
62521
|
+
});
|
|
62522
|
+
const delTail = details.filter((item) => item.op === "DEL").map((item) => findRowByKey(deletedRows, item.rowKey, item.id) || makeGhost(item));
|
|
62523
|
+
const orphanTail = details.filter((item) => item.op === "ADD" && !findRowByKey(liveRows, item.rowKey, item.id)).map((item) => makeGhost(item, true));
|
|
62524
|
+
return [...liveRows, ...delTail, ...orphanTail];
|
|
62525
|
+
}
|
|
62526
|
+
function nextFormChangeRowViewHistoryId(currentId, historyId, items) {
|
|
62527
|
+
if (!historyId || currentId === historyId) {
|
|
62528
|
+
return { historyId: void 0, rowDetails: [] };
|
|
62529
|
+
}
|
|
62530
|
+
const item = (items || []).find((x) => x.id === historyId);
|
|
62531
|
+
const rowDetails = extractFormChangeRowDetails(item ? [item] : []);
|
|
62532
|
+
if (!rowDetails.length) return { historyId: void 0, rowDetails: [] };
|
|
62533
|
+
return { historyId, rowDetails };
|
|
62534
|
+
}
|
|
61714
62535
|
const { getParseFormulaVarInfos, calculateFormula } = useCalculateFormula();
|
|
61715
62536
|
function useNocodeFormWidget(props, emit) {
|
|
61716
62537
|
const widget = props.widget;
|
|
@@ -61866,29 +62687,55 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61866
62687
|
// 修改之后的值(展示值)
|
|
61867
62688
|
};
|
|
61868
62689
|
}
|
|
62690
|
+
function resolveSubtableColIdx() {
|
|
62691
|
+
if (!props.subtableFieldId) return void 0;
|
|
62692
|
+
if (!isNil(props.childSubTableDataIndex)) return props.childSubTableDataIndex;
|
|
62693
|
+
if (targetFieldId === "value_") {
|
|
62694
|
+
if (!isNil(props.realColIndex)) return props.realColIndex;
|
|
62695
|
+
if (!isNil(props.realRowIndex)) return 0;
|
|
62696
|
+
}
|
|
62697
|
+
return void 0;
|
|
62698
|
+
}
|
|
61869
62699
|
function handleOperationLog(callback) {
|
|
61870
|
-
|
|
62700
|
+
if (props.subtableFieldId && isRowAddedInCurrentFormChange(dataRelationShip, props.subtableFieldId, props.formData)) {
|
|
62701
|
+
return;
|
|
62702
|
+
}
|
|
62703
|
+
let operationId = realFieldId.value ?? "";
|
|
62704
|
+
if (props.subtableFieldId && props.formData) {
|
|
62705
|
+
const rowKey = getFormChangeRowKey(props.formData);
|
|
62706
|
+
if (rowKey) {
|
|
62707
|
+
operationId = buildStableFieldLocation(
|
|
62708
|
+
props.subtableFieldId,
|
|
62709
|
+
rowKey,
|
|
62710
|
+
targetFieldId,
|
|
62711
|
+
resolveSubtableColIdx()
|
|
62712
|
+
);
|
|
62713
|
+
}
|
|
62714
|
+
}
|
|
61871
62715
|
let originData;
|
|
61872
62716
|
if (props.subtableFieldId) {
|
|
61873
|
-
|
|
61874
|
-
|
|
61875
|
-
|
|
61876
|
-
|
|
61877
|
-
|
|
62717
|
+
const originRows = dataRelationShip?.formChangeOriginData?.[props.subtableFieldId];
|
|
62718
|
+
const currentKey = getFormChangeRowKey(props.formData);
|
|
62719
|
+
const childIdx = !isNil(props.childSubTableDataIndex) ? props.childSubTableDataIndex : void 0;
|
|
62720
|
+
const originRow = (Array.isArray(originRows) ? originRows.find((item) => {
|
|
62721
|
+
if (item?.deleted_) return false;
|
|
62722
|
+
if (getFormChangeRowKey(item) === currentKey) return true;
|
|
62723
|
+
return childIdx != null && item?._2DTABLE_?.some((child) => getFormChangeRowKey(child) === currentKey);
|
|
62724
|
+
}) : void 0) ?? originRows?.[props.realRowIndex];
|
|
62725
|
+
originData = childIdx != null ? originRow?.["_2DTABLE_"]?.[childIdx] ?? {} : originRow ?? {};
|
|
61878
62726
|
} else {
|
|
61879
62727
|
originData = dataRelationShip?.formChangeOriginData;
|
|
61880
62728
|
}
|
|
61881
62729
|
const newData = getOperationLogData(targetFieldId, originData, callback);
|
|
61882
62730
|
if (dataRelationShip) {
|
|
61883
|
-
dataRelationShip.formChangeNewData =
|
|
62731
|
+
dataRelationShip.formChangeNewData = {
|
|
62732
|
+
...dataRelationShip.formChangeNewData || {},
|
|
61884
62733
|
[operationId]: {
|
|
61885
62734
|
...newData,
|
|
61886
62735
|
cellLocation: operationId,
|
|
61887
|
-
// 单元格坐标
|
|
61888
62736
|
cellType: fieldType
|
|
61889
|
-
// 单元格类型(对应前端组件类型)
|
|
61890
62737
|
}
|
|
61891
|
-
}
|
|
62738
|
+
};
|
|
61892
62739
|
}
|
|
61893
62740
|
}
|
|
61894
62741
|
async function formulaOperationLog() {
|
|
@@ -61915,8 +62762,21 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61915
62762
|
option: optionDetail ?? valueData
|
|
61916
62763
|
});
|
|
61917
62764
|
}
|
|
62765
|
+
const triggerLiveValidation = () => {
|
|
62766
|
+
const uniqueId = dataRelationShip?.uniqueId;
|
|
62767
|
+
if (!uniqueId || dataRelationShip?.renderModeType !== RenderModeEnum.FormMode) {
|
|
62768
|
+
return;
|
|
62769
|
+
}
|
|
62770
|
+
if (eventType === "onChange") {
|
|
62771
|
+
requestFullValidation(uniqueId, { trigger: "change" });
|
|
62772
|
+
requestDisplayValidation(uniqueId);
|
|
62773
|
+
} else if (eventType === "onBlur") {
|
|
62774
|
+
requestFullValidation(uniqueId, { trigger: "blur", immediate: true });
|
|
62775
|
+
}
|
|
62776
|
+
};
|
|
61918
62777
|
if (eventType === "onChange" && dataRelationShip?.formChangeStatus) {
|
|
61919
62778
|
handleOperationLog(callback);
|
|
62779
|
+
triggerLiveValidation();
|
|
61920
62780
|
return;
|
|
61921
62781
|
}
|
|
61922
62782
|
const methodName = isExecuteEvent(eventType);
|
|
@@ -61934,6 +62794,7 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61934
62794
|
}
|
|
61935
62795
|
const { emitter: emitter2, EmitterEnum: EmitterEnum2 } = useNocodeEmitter();
|
|
61936
62796
|
emitter2.emit(EmitterEnum2.__on_looper_auto_save, { changed: true });
|
|
62797
|
+
triggerLiveValidation();
|
|
61937
62798
|
}
|
|
61938
62799
|
const onChange = (callback = () => {
|
|
61939
62800
|
}, valueData, optionDetail) => handleEvent("onChange", callback, valueData, optionDetail);
|
|
@@ -61944,13 +62805,7 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61944
62805
|
const onPressEnter = () => handleEvent("onPressEnter");
|
|
61945
62806
|
const realFieldId = computed(() => {
|
|
61946
62807
|
if (props.subtableFieldId) {
|
|
61947
|
-
|
|
61948
|
-
if (!isNil(props.childSubTableDataIndex)) {
|
|
61949
|
-
colIdx = props.childSubTableDataIndex;
|
|
61950
|
-
} else if (targetFieldId === "value_") {
|
|
61951
|
-
if (!isNil(props.realColIndex)) colIdx = props.realColIndex;
|
|
61952
|
-
else if (!isNil(props.realRowIndex)) colIdx = 0;
|
|
61953
|
-
}
|
|
62808
|
+
const colIdx = resolveSubtableColIdx();
|
|
61954
62809
|
if (colIdx !== void 0) {
|
|
61955
62810
|
return `${props.subtableFieldId}_${props.realRowIndex}_${targetFieldId}_${colIdx}`;
|
|
61956
62811
|
}
|
|
@@ -61960,21 +62815,40 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61960
62815
|
});
|
|
61961
62816
|
const annotationInfo = computed(() => {
|
|
61962
62817
|
const fieldId = realFieldId.value;
|
|
61963
|
-
if (!fieldId) {
|
|
62818
|
+
if (!fieldId && !props.subtableFieldId) {
|
|
61964
62819
|
return false;
|
|
61965
62820
|
}
|
|
62821
|
+
const annRowDetails = dataRelationShip?.annRowDetails;
|
|
62822
|
+
const rowViewActive = !!annRowDetails?.length;
|
|
62823
|
+
if (props.subtableFieldId && props.formData && rowViewActive) {
|
|
62824
|
+
if (isFormChangeGhostRow(props.formData) || resolveRowFormChangeMark(props.subtableFieldId, props.formData, annRowDetails)) {
|
|
62825
|
+
return false;
|
|
62826
|
+
}
|
|
62827
|
+
}
|
|
61966
62828
|
const annList = dataRelationShip?.annCellLocationList;
|
|
61967
62829
|
const validatorList = dataRelationShip?.validatorLocationList;
|
|
61968
|
-
const
|
|
61969
|
-
const
|
|
61970
|
-
|
|
62830
|
+
const colIdx = resolveSubtableColIdx();
|
|
62831
|
+
const matchedAnnLoc = props.subtableFieldId ? resolveAnnotationFieldLocation({
|
|
62832
|
+
annList,
|
|
62833
|
+
subFieldId: props.subtableFieldId,
|
|
62834
|
+
fieldId: targetFieldId,
|
|
62835
|
+
row: props.formData,
|
|
62836
|
+
colIdx
|
|
62837
|
+
}) : dataRelationShip?.annSwitchStatus && Array.isArray(annList) && fieldId && annList.includes(fieldId) ? fieldId : void 0;
|
|
62838
|
+
const annIncluded = !!dataRelationShip?.annSwitchStatus && !!matchedAnnLoc;
|
|
62839
|
+
const isSelected = isAnnLocationSelected(dataRelationShip?.annSelectId, matchedAnnLoc);
|
|
62840
|
+
const isInvalid = !dataRelationShip?.annSwitchStatus && Array.isArray(validatorList) && !!fieldId && validatorList.includes(fieldId);
|
|
61971
62841
|
const annClassList = [];
|
|
61972
|
-
if (annIncluded) {
|
|
61973
|
-
annClassList.push(
|
|
62842
|
+
if (annIncluded && matchedAnnLoc) {
|
|
62843
|
+
annClassList.push(matchedAnnLoc, "annotation-mark");
|
|
61974
62844
|
if (isSelected) annClassList.push("annotation-select");
|
|
61975
62845
|
}
|
|
61976
62846
|
if (annClassList.length || isInvalid) {
|
|
61977
|
-
return {
|
|
62847
|
+
return {
|
|
62848
|
+
annClassList,
|
|
62849
|
+
annFieldId: matchedAnnLoc || fieldId,
|
|
62850
|
+
showValidatorClass: isInvalid
|
|
62851
|
+
};
|
|
61978
62852
|
}
|
|
61979
62853
|
return false;
|
|
61980
62854
|
});
|
|
@@ -62310,27 +63184,27 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
62310
63184
|
case "revo-grid":
|
|
62311
63185
|
return import(
|
|
62312
63186
|
/* webpackMode: "lazy" */
|
|
62313
|
-
"./revo-grid.entry-
|
|
63187
|
+
"./revo-grid.entry-BeRVTVKO.js"
|
|
62314
63188
|
).then(processMod, consoleError);
|
|
62315
63189
|
case "revogr-filter-panel":
|
|
62316
63190
|
return import(
|
|
62317
63191
|
/* webpackMode: "lazy" */
|
|
62318
|
-
"./revogr-filter-panel.entry-
|
|
63192
|
+
"./revogr-filter-panel.entry-BDkhY-74.js"
|
|
62319
63193
|
).then(processMod, consoleError);
|
|
62320
63194
|
case "revogr-attribution_7":
|
|
62321
63195
|
return import(
|
|
62322
63196
|
/* webpackMode: "lazy" */
|
|
62323
|
-
"./revogr-attribution_7.entry-
|
|
63197
|
+
"./revogr-attribution_7.entry-CHtbU2lV.js"
|
|
62324
63198
|
).then(processMod, consoleError);
|
|
62325
63199
|
case "revogr-clipboard_3":
|
|
62326
63200
|
return import(
|
|
62327
63201
|
/* webpackMode: "lazy" */
|
|
62328
|
-
"./revogr-clipboard_3.entry-
|
|
63202
|
+
"./revogr-clipboard_3.entry-DnvQ-Rl7.js"
|
|
62329
63203
|
).then(processMod, consoleError);
|
|
62330
63204
|
case "revogr-data_4":
|
|
62331
63205
|
return import(
|
|
62332
63206
|
/* webpackMode: "lazy" */
|
|
62333
|
-
"./revogr-data_4.entry-
|
|
63207
|
+
"./revogr-data_4.entry-DLRSuaN8.js"
|
|
62334
63208
|
).then(processMod, consoleError);
|
|
62335
63209
|
}
|
|
62336
63210
|
}
|
|
@@ -72401,7 +73275,7 @@ export {
|
|
|
72401
73275
|
ReturnTypeEnum as Z,
|
|
72402
73276
|
_export_sfc as _,
|
|
72403
73277
|
PaperWidgeType as a,
|
|
72404
|
-
|
|
73278
|
+
MobileFillTypeEnum as a$,
|
|
72405
73279
|
PaperSizeMap as a0,
|
|
72406
73280
|
EntityModelCategoryEnum as a1,
|
|
72407
73281
|
CheckDsTypeEnum as a2,
|
|
@@ -72412,174 +73286,207 @@ export {
|
|
|
72412
73286
|
BinarizeMethodOptions as a7,
|
|
72413
73287
|
ParamModelTypeEnum as a8,
|
|
72414
73288
|
JoinModelTypeEum as a9,
|
|
72415
|
-
|
|
72416
|
-
|
|
72417
|
-
|
|
72418
|
-
|
|
72419
|
-
|
|
72420
|
-
|
|
72421
|
-
|
|
72422
|
-
|
|
72423
|
-
|
|
72424
|
-
|
|
72425
|
-
|
|
72426
|
-
|
|
72427
|
-
|
|
72428
|
-
|
|
72429
|
-
|
|
72430
|
-
|
|
72431
|
-
|
|
72432
|
-
|
|
72433
|
-
|
|
72434
|
-
|
|
72435
|
-
|
|
72436
|
-
|
|
72437
|
-
|
|
72438
|
-
|
|
72439
|
-
|
|
72440
|
-
|
|
72441
|
-
|
|
73289
|
+
settleAndValidateDisplay as aA,
|
|
73290
|
+
unregisterValidationContext as aB,
|
|
73291
|
+
clearFormRules as aC,
|
|
73292
|
+
registerValidationContext as aD,
|
|
73293
|
+
requestFullValidation as aE,
|
|
73294
|
+
requestDisplayValidation as aF,
|
|
73295
|
+
closeValidatorPopovers as aG,
|
|
73296
|
+
baseDataUtils as aH,
|
|
73297
|
+
getRawFormRuleMeta as aI,
|
|
73298
|
+
enrichFormChangeRowDetails as aJ,
|
|
73299
|
+
settleAfterModeSwitch as aK,
|
|
73300
|
+
calcUtils as aL,
|
|
73301
|
+
uuid2 as aM,
|
|
73302
|
+
normalizeToArray as aN,
|
|
73303
|
+
safeParseArray as aO,
|
|
73304
|
+
BpmnNodeTypeEnum as aP,
|
|
73305
|
+
mergeByMultiKey as aQ,
|
|
73306
|
+
getRowId as aR,
|
|
73307
|
+
getSubTableQuickFillInfo as aS,
|
|
73308
|
+
BpmnSignatureTypeEnum as aT,
|
|
73309
|
+
ButtonTypeEnum as aU,
|
|
73310
|
+
CHECK_TABLE_MEDPRO_PROTOCOL_KEY as aV,
|
|
73311
|
+
CodeRunner as aW,
|
|
73312
|
+
Config_Fields as aX,
|
|
73313
|
+
ControlStatusEnum as aY,
|
|
73314
|
+
EBR_PROVIDE_ENUM as aZ,
|
|
73315
|
+
FieldSysVarDefaultValueEnum as a_,
|
|
72442
73316
|
sqlUtils as aa,
|
|
72443
73317
|
useWidgetStaticAttrs as ab,
|
|
72444
73318
|
setSelectValidatorId as ac,
|
|
72445
73319
|
setSelectAnnotationId as ad,
|
|
72446
|
-
|
|
72447
|
-
|
|
72448
|
-
|
|
72449
|
-
|
|
72450
|
-
|
|
72451
|
-
|
|
72452
|
-
|
|
72453
|
-
|
|
72454
|
-
|
|
72455
|
-
|
|
72456
|
-
|
|
72457
|
-
|
|
73320
|
+
useNocodeFormWidget as ae,
|
|
73321
|
+
DateFormat as af,
|
|
73322
|
+
renderUtils as ag,
|
|
73323
|
+
BindCmpStyleEnum as ah,
|
|
73324
|
+
DecimalDisplayMode as ai,
|
|
73325
|
+
NCB_PROVIDE as aj,
|
|
73326
|
+
normalizeRefLoaderResult as ak,
|
|
73327
|
+
refUtils as al,
|
|
73328
|
+
getParseRuleInfo as am,
|
|
73329
|
+
getParseRuleValue as an,
|
|
73330
|
+
useCurrentPageFormState as ao,
|
|
73331
|
+
RangeValidateMode as ap,
|
|
72458
73332
|
RenderModeEnum as aq,
|
|
72459
|
-
|
|
72460
|
-
|
|
72461
|
-
|
|
72462
|
-
|
|
72463
|
-
|
|
72464
|
-
|
|
72465
|
-
|
|
72466
|
-
|
|
72467
|
-
|
|
73333
|
+
EFieldBizTypeEnum as ar,
|
|
73334
|
+
FormulaRuleFieldKeyEnum as as,
|
|
73335
|
+
formulaRuleFieldDict as at,
|
|
73336
|
+
useNocodeEmitter as au,
|
|
73337
|
+
fetchHistoryConsume as av,
|
|
73338
|
+
isBomGranted as aw,
|
|
73339
|
+
calcFillData as ax,
|
|
73340
|
+
extractKeywordFromQueryData as ay,
|
|
73341
|
+
transformUtils as az,
|
|
72468
73342
|
PageSizeEnum as b,
|
|
72469
|
-
|
|
72470
|
-
|
|
72471
|
-
|
|
72472
|
-
|
|
72473
|
-
|
|
72474
|
-
|
|
72475
|
-
|
|
72476
|
-
|
|
72477
|
-
|
|
72478
|
-
|
|
72479
|
-
|
|
72480
|
-
|
|
72481
|
-
|
|
72482
|
-
|
|
72483
|
-
|
|
72484
|
-
|
|
72485
|
-
|
|
72486
|
-
|
|
72487
|
-
|
|
72488
|
-
|
|
72489
|
-
|
|
72490
|
-
|
|
72491
|
-
|
|
72492
|
-
|
|
72493
|
-
|
|
72494
|
-
|
|
72495
|
-
|
|
72496
|
-
|
|
72497
|
-
|
|
72498
|
-
|
|
72499
|
-
|
|
72500
|
-
|
|
72501
|
-
|
|
72502
|
-
|
|
72503
|
-
|
|
72504
|
-
|
|
72505
|
-
|
|
72506
|
-
|
|
72507
|
-
|
|
72508
|
-
|
|
72509
|
-
|
|
72510
|
-
|
|
72511
|
-
|
|
72512
|
-
|
|
72513
|
-
|
|
72514
|
-
|
|
72515
|
-
|
|
72516
|
-
|
|
72517
|
-
|
|
72518
|
-
|
|
72519
|
-
|
|
72520
|
-
|
|
72521
|
-
|
|
72522
|
-
|
|
72523
|
-
|
|
72524
|
-
|
|
72525
|
-
|
|
72526
|
-
|
|
72527
|
-
|
|
72528
|
-
|
|
72529
|
-
|
|
72530
|
-
|
|
72531
|
-
|
|
72532
|
-
|
|
73343
|
+
getColumns as b$,
|
|
73344
|
+
OfficeTypeEnum as b0,
|
|
73345
|
+
PosEnum as b1,
|
|
73346
|
+
RangeCompareOp as b2,
|
|
73347
|
+
SummaryApproveHisTypeEnum as b3,
|
|
73348
|
+
applyCheckDsDataToRuntime as b4,
|
|
73349
|
+
applyMedProCheckDsDataToRuntime as b5,
|
|
73350
|
+
buildFormChangeDisplayRows as b6,
|
|
73351
|
+
buildStableFieldLocation as b7,
|
|
73352
|
+
collectFormChangeFieldLocations as b8,
|
|
73353
|
+
deleteSubtableRow as b9,
|
|
73354
|
+
setFormRule as bA,
|
|
73355
|
+
isReferenceOptionActive as bB,
|
|
73356
|
+
validateAllFields as bC,
|
|
73357
|
+
runValidation as bD,
|
|
73358
|
+
stockCheck as bE,
|
|
73359
|
+
materialCheck as bF,
|
|
73360
|
+
judgeUnique as bG,
|
|
73361
|
+
FRONT_ROW_KEY as bH,
|
|
73362
|
+
q as bI,
|
|
73363
|
+
getAugmentedNamespace as bJ,
|
|
73364
|
+
CardControlEnum as bK,
|
|
73365
|
+
EntityModelTypeEnum as bL,
|
|
73366
|
+
FIELD_TYPE_BASIC as bM,
|
|
73367
|
+
FIELD_TYPE_INSPECTION as bN,
|
|
73368
|
+
FIELD_TYPE_LOGIC as bO,
|
|
73369
|
+
FIELD_TYPE_MATERIAL as bP,
|
|
73370
|
+
FIELD_TYPE_PRETREATMENT as bQ,
|
|
73371
|
+
FIELD_TYPE_PRODUCE as bR,
|
|
73372
|
+
FIELD_TYPE_STERILIZATION as bS,
|
|
73373
|
+
FormDesignEnum as bT,
|
|
73374
|
+
RecordNoGenerateEnum as bU,
|
|
73375
|
+
TagTypeEnum as bV,
|
|
73376
|
+
registerInstance as bW,
|
|
73377
|
+
createEvent as bX,
|
|
73378
|
+
getColumnByProp as bY,
|
|
73379
|
+
timeout as bZ,
|
|
73380
|
+
getVisibleSourceItem as b_,
|
|
73381
|
+
detailsHaveFormChangeRowOps as ba,
|
|
73382
|
+
extractFormChangeRowDetails as bb,
|
|
73383
|
+
fetchCheckDsDataForTable as bc,
|
|
73384
|
+
fetchCustomCheckDsData as bd,
|
|
73385
|
+
fetchMedProCheckDsData as be,
|
|
73386
|
+
getFormChangeRowKey as bf,
|
|
73387
|
+
getFormChangeRowOp as bg,
|
|
73388
|
+
getParseRuleConfig as bh,
|
|
73389
|
+
handleOldConfig as bi,
|
|
73390
|
+
insertSubtableRows as bj,
|
|
73391
|
+
isAnnLocationSelected as bk,
|
|
73392
|
+
isFormChangeGhostRow as bl,
|
|
73393
|
+
isMedProSuite as bm,
|
|
73394
|
+
isRowAddedInCurrentFormChange as bn,
|
|
73395
|
+
jsonSchemaUtils as bo,
|
|
73396
|
+
nextFormChangeRowViewHistoryId as bp,
|
|
73397
|
+
recordSubtableRowAdd as bq,
|
|
73398
|
+
recordSubtableRowDelete as br,
|
|
73399
|
+
relocateDeletedRowsToEnd as bs,
|
|
73400
|
+
requestNonMedProCheckDsData as bt,
|
|
73401
|
+
resolveAnnotationFieldLocation as bu,
|
|
73402
|
+
resolveFormChangeRowUi as bv,
|
|
73403
|
+
resolveRowFormChangeMark as bw,
|
|
73404
|
+
setSelectMobileTdId as bx,
|
|
73405
|
+
assembleRules as by,
|
|
73406
|
+
deleteFormRule as bz,
|
|
72533
73407
|
FIELD_TYPE_TRACE as c,
|
|
72534
|
-
|
|
72535
|
-
|
|
72536
|
-
|
|
72537
|
-
|
|
72538
|
-
|
|
72539
|
-
|
|
72540
|
-
|
|
72541
|
-
|
|
72542
|
-
|
|
72543
|
-
|
|
72544
|
-
|
|
72545
|
-
|
|
72546
|
-
|
|
72547
|
-
|
|
72548
|
-
|
|
72549
|
-
|
|
72550
|
-
|
|
72551
|
-
|
|
72552
|
-
|
|
72553
|
-
|
|
72554
|
-
|
|
72555
|
-
|
|
72556
|
-
|
|
72557
|
-
|
|
72558
|
-
|
|
72559
|
-
|
|
72560
|
-
|
|
72561
|
-
|
|
72562
|
-
|
|
72563
|
-
|
|
72564
|
-
|
|
72565
|
-
|
|
72566
|
-
|
|
72567
|
-
|
|
72568
|
-
|
|
72569
|
-
|
|
72570
|
-
|
|
72571
|
-
|
|
72572
|
-
|
|
72573
|
-
|
|
72574
|
-
|
|
72575
|
-
|
|
72576
|
-
|
|
72577
|
-
|
|
72578
|
-
|
|
72579
|
-
|
|
72580
|
-
|
|
72581
|
-
|
|
73408
|
+
getCellRaw as c$,
|
|
73409
|
+
rowTypes as c0,
|
|
73410
|
+
GroupingRowPlugin as c1,
|
|
73411
|
+
StretchColumn as c2,
|
|
73412
|
+
isStretchPlugin as c3,
|
|
73413
|
+
AutoSizeColumnPlugin as c4,
|
|
73414
|
+
FilterPlugin as c5,
|
|
73415
|
+
ExportFilePlugin as c6,
|
|
73416
|
+
SortingPlugin as c7,
|
|
73417
|
+
ColumnMovePlugin as c8,
|
|
73418
|
+
ThemeService as c9,
|
|
73419
|
+
isFilterBtn as cA,
|
|
73420
|
+
ColumnService as cB,
|
|
73421
|
+
MOBILE_CLASS as cC,
|
|
73422
|
+
SELECTION_BORDER_CLASS as cD,
|
|
73423
|
+
getCellData as cE,
|
|
73424
|
+
getCellEditor as cF,
|
|
73425
|
+
getRange as cG,
|
|
73426
|
+
isRangeSingleCell as cH,
|
|
73427
|
+
codesLetter as cI,
|
|
73428
|
+
calculateRowHeaderSize as cJ,
|
|
73429
|
+
ROW_HEADER_TYPE as cK,
|
|
73430
|
+
getScrollbarSize as cL,
|
|
73431
|
+
FOCUS_CLASS as cM,
|
|
73432
|
+
CELL_HANDLER_CLASS as cN,
|
|
73433
|
+
TMP_SELECTION_BG_CLASS as cO,
|
|
73434
|
+
getItemByPosition as cP,
|
|
73435
|
+
EDIT_INPUT_WR as cQ,
|
|
73436
|
+
keyValues as cR,
|
|
73437
|
+
isObject as cS,
|
|
73438
|
+
DRAGG_TEXT as cT,
|
|
73439
|
+
PSEUDO_GROUP_ITEM as cU,
|
|
73440
|
+
GROUP_EXPANDED as cV,
|
|
73441
|
+
GROUP_DEPTH as cW,
|
|
73442
|
+
GROUP_EXPAND_BTN as cX,
|
|
73443
|
+
DATA_ROW as cY,
|
|
73444
|
+
isGroupingColumn as cZ,
|
|
73445
|
+
GROUP_COLUMN_PROP as c_,
|
|
73446
|
+
h as ca,
|
|
73447
|
+
Host as cb,
|
|
73448
|
+
getElement as cc,
|
|
73449
|
+
BasePlugin as cd,
|
|
73450
|
+
reduce as ce,
|
|
73451
|
+
columnTypes as cf,
|
|
73452
|
+
debounce$1 as cg,
|
|
73453
|
+
RESIZE_INTERVAL as ch,
|
|
73454
|
+
DimensionStore as ci,
|
|
73455
|
+
gatherTrimmedItems as cj,
|
|
73456
|
+
getColumnSizes as ck,
|
|
73457
|
+
getItemByIndex as cl,
|
|
73458
|
+
DataStore as cm,
|
|
73459
|
+
getSourceItem as cn,
|
|
73460
|
+
getSourceItemVirtualIndexByProp as co,
|
|
73461
|
+
getColumnType as cp,
|
|
73462
|
+
setSourceByPhysicalIndex as cq,
|
|
73463
|
+
setSourceByVirtualIndex as cr,
|
|
73464
|
+
SelectionStore as cs,
|
|
73465
|
+
cropCellToMax as ct,
|
|
73466
|
+
nextCell as cu,
|
|
73467
|
+
isRowType as cv,
|
|
73468
|
+
ViewportStore as cw,
|
|
73469
|
+
AndOrButton as cx,
|
|
73470
|
+
ReorderButton as cy,
|
|
73471
|
+
TrashButton as cz,
|
|
72582
73472
|
FIELD_TYPE_BUSINESS as d,
|
|
73473
|
+
DATA_COL as d0,
|
|
73474
|
+
CELL_CLASS as d1,
|
|
73475
|
+
Build as d2,
|
|
73476
|
+
isRowDragService as d3,
|
|
73477
|
+
DRAG_ICON_CLASS as d4,
|
|
73478
|
+
DRAGGABLE_CLASS as d5,
|
|
73479
|
+
getCellDataParsed as d6,
|
|
73480
|
+
GROUP_EXPAND_EVENT as d7,
|
|
73481
|
+
isGrouping as d8,
|
|
73482
|
+
HEADER_ROW_CLASS as d9,
|
|
73483
|
+
HEADER_ACTUAL_ROW_CLASS as da,
|
|
73484
|
+
ROW_FOCUSED_CLASS as db,
|
|
73485
|
+
HEADER_SORTABLE_CLASS as dc,
|
|
73486
|
+
MIN_COL_SIZE as dd,
|
|
73487
|
+
FilterButton as de,
|
|
73488
|
+
HeaderCellRenderer as df,
|
|
73489
|
+
HEADER_CLASS as dg,
|
|
72583
73490
|
ComponentTypeEnum as e,
|
|
72584
73491
|
estraverse as f,
|
|
72585
73492
|
SubTableType as g,
|