@gct-paas/excel 0.1.17 → 0.1.19
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-Bt1Le9qP.js} +2 -2
- package/dist/{agg-design-BjqRVeg1.js → agg-design-B_5evAJ0.js} +1 -1
- package/dist/{agg-props-CrdosdGr.js → agg-props-C62Ecenu.js} +1 -1
- package/dist/{agg-style-CfZoOE-b.js → agg-style-Q0xSL8Ye.js} +1 -1
- package/dist/{align-editor-BaNT0jhx.js → align-editor-D_LtYlh3.js} +1 -1
- package/dist/{attach-fields-editor-CThobu8X.js → attach-fields-editor-3v3VNOfe.js} +2 -2
- package/dist/{barcode-design-CHjIeaiJ.js → barcode-design-lusKmMnv.js} +3 -2
- package/dist/base/index.es.js +370 -151
- package/dist/base-font-editor-DmasOst9.js +119 -0
- package/dist/{boolean-design-BYAdX-h5.js → boolean-design-BqGJVhKn.js} +3 -2
- package/dist/{boolean-props-jKvjhdlG.js → boolean-props-DS7J4GHS.js} +3 -3
- package/dist/{boolean-style-RsMRzVBL.js → boolean-style-C9FslVV7.js} +5 -4
- package/dist/cell-upload-BFw5Yg_j.js +33 -0
- package/dist/date-range-editor-PmJBHc8i.js +471 -0
- package/dist/{date-time-design-Du8pmDo-.js → date-time-design-DQ_Z-xUx.js} +1 -1
- package/dist/date-time-props-DfZoJukN.js +105 -0
- package/dist/{date-time-style-DSEnmxAE.js → date-time-style-Doye-MHk.js} +1 -1
- package/dist/{decimal-design-C2GbzP9k.js → decimal-design-Bg-tdrtL.js} +7 -3
- package/dist/{decimal-display-mode-CagizhJW.js → decimal-display-mode-D_K6_XX1.js} +3 -2
- package/dist/{decimal-props-CGLqWy8I.js → decimal-props-4QveEdf3.js} +5 -4
- package/dist/{decimal-style-6j22QKYO.js → decimal-style-B-n8SfAy.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-B3GvGAje.js} +110 -39
- package/dist/{diagonal-design-Cq3oxdHe.js → diagonal-design-B_l3lV5s.js} +2 -2
- package/dist/{double-design-CyXEqcV7.js → double-design-BaWZXLjK.js} +6 -3
- package/dist/{double-props-DaJoio1W.js → double-props-sDsBpAER.js} +4 -4
- package/dist/{double-style-B4lIth-J.js → double-style--oSjQw07.js} +1 -1
- package/dist/{document-sub-table-action-rz6gyez5.js → dynamic-table-action-zLjamAaN.js} +1124 -654
- package/dist/{document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-Bbu6cwRC.js → dynamic-table-action.vue_vue_type_style_index_0_scoped_94e9d614_lang-UooIxEeL.js} +2312 -1402
- package/dist/{edit.utils-CXmmCnxE-DW8ClKe9.js → edit.utils-CXmmCnxE-BrwRVXLT.js} +1 -1
- package/dist/{enum-design-DSx09tOO.js → enum-design-BgVuHvvu.js} +13 -7
- package/dist/{enum-props-CJNuQLJ_.js → enum-props-DYN6LsLg.js} +4 -4
- package/dist/{enum-style-5N5xmgRJ.js → enum-style-D56_-gMw.js} +37 -9
- package/dist/excel.css +1480 -664
- package/dist/{exceljs.min-D9gV8q6H.js → exceljs.min-DQkwXbni.js} +2 -2
- package/dist/{expression-design-BJDbafot.js → expression-design-CIMwIArR.js} +1 -1
- package/dist/{expression-props-BpHbrsle.js → expression-props--l3LwKAM.js} +1 -1
- package/dist/{expression-style-qPh81w7Q.js → expression-style-CjM5oro9.js} +1 -1
- package/dist/{file-design-B7si04Bi.js → file-design-BYcXA55B.js} +1 -1
- package/dist/{file-props-DTtOnHQy.js → file-props-DvsQZUcL.js} +2 -2
- package/dist/{file-style-C6KW_szu.js → file-style-BiWmCsMZ.js} +1 -1
- package/dist/{font-editor-DgGgvmB2.js → font-editor-BaRVmXey.js} +3 -3
- package/dist/{form-annotation-controller-CoABDD4X.js → form-annotation-controller-Zw6OoPLe.js} +80 -23
- package/dist/{image-design-B92Xkcf-.js → image-design-Bad-BXel.js} +3 -2
- package/dist/{image-design-CCfpT4Rp.js → image-design-Dr_w89Hq.js} +2 -2
- package/dist/{image-props-DZgfzMta.js → image-props-4lKEAwDq.js} +1 -1
- package/dist/{image-style-DX6Q_gF4.js → image-style-LoHD1zvr.js} +1 -1
- package/dist/{index-Bnbl3VER.js → index--Bxx_VqV.js} +3 -2
- package/dist/{index-DsASTvC2.js → index-3qfB5NN-.js} +2 -1
- package/dist/{index-CtTSTTkq.js → index-B-2N8GeG.js} +3 -2
- package/dist/{index-Bg-x1hF6.js → index-B3YoA1vo.js} +3 -2
- package/dist/{index-BzhFcvnJ.js → index-B9IMST50.js} +3 -2
- package/dist/{index-Doxcf2Zs.js → index-BSfbsA-W.js} +3 -2
- package/dist/{index-DJISlRXi.js → index-BZYuG4zS.js} +5 -2
- package/dist/{index-DzIKEtWw.js → index-B_VejD7m.js} +4 -1
- package/dist/{index-BXMOCfWv.js → index-Bki98NXv.js} +3 -2
- package/dist/{index-DFgGQBCZ.js → index-Bm6Hdoud.js} +53 -110
- package/dist/{index-CmaPtyCh.js → index-BsUkUBZV.js} +5 -2
- package/dist/{index-BB5uSbo3.js → index-Bsjegt_0.js} +2 -1
- package/dist/{index-rn6aiccW.js → index-ByXwQO9g.js} +6 -3
- package/dist/{index-DOFSbVSN.js → index-C6mtZJIQ.js} +2 -1
- package/dist/{index-DRKvAxuA.js → index-C7KdVTwU.js} +2 -1
- package/dist/{index-tbaOl7Nd.js → index-CEufXc_2.js} +2 -1
- package/dist/{index-D6diRqWG.js → index-CH--dgZ4.js} +3 -2
- package/dist/{index-BEBKoAOg.js → index-COiTpNXf.js} +3 -2
- package/dist/{index-BYl8cK0A.js → index-CP099vf_.js} +2 -1
- package/dist/{index-BhzF0Rp3.js → index-CQ7Hcly4.js} +5 -3
- package/dist/{index-Be7TFwwX.js → index-CcLTIQGc.js} +5 -2
- package/dist/{index-C8qPy1oW.js → index-Ce0SltjH.js} +3 -2
- package/dist/{index-bvhV6lsn.js → index-CqjhgxKH.js} +15 -7
- package/dist/{index-B2iip4UC.js → index-D-mFMP7t.js} +3 -2
- package/dist/{index-IUYnmIJe.js → index-D4Yb4Urx.js} +2 -1
- package/dist/{index-Da7W9uBC.js → index-D9CHdykS.js} +3 -2
- package/dist/{index-DRd2oRK1.js → index-DDnUeBCP.js} +3 -2
- package/dist/{index-XbgrTOMF.js → index-DRYxbbtG.js} +2 -1
- package/dist/{index-Cw_YFCZT.js → index-Dk-CUvB9.js} +3876 -3389
- package/dist/{index-Dsj3FuVs.js → index-DpPrrfLV.js} +3 -2
- package/dist/{index-DgHRTRH5.js → index-Dq72GFzs.js} +3 -2
- package/dist/{index-p-Q3DQmv.js → index-Vx5npC-J.js} +4 -3
- package/dist/{index-CIoB2iny.js → index-pPTh0-mL.js} +2 -1
- package/dist/index.es.js +6 -5
- package/dist/{integer-design-CPzJPZon.js → integer-design-C2EkL0hc.js} +6 -3
- package/dist/{integer-props-deCDvNET.js → integer-props-Cs-CvjQS.js} +5 -4
- package/dist/{integer-style-DwZIRXEW.js → integer-style-BtAfQCAn.js} +1 -1
- package/dist/{mb-render-Bejyn-ep.js → mb-render-CsWNoQnS.js} +1 -1
- package/dist/{number-input-ex-CgwOH18n.js → number-input-ex-eza87s5O.js} +12 -4
- package/dist/{org-props-BeFVQ-QY.js → org-props-BJ6FKaVj.js} +3 -2
- package/dist/{org-style-CLVWLtyd.js → org-style-LRy5QsV5.js} +1 -1
- package/dist/{pagination-design-CT0EQmxW.js → pagination-design-sA-kbILI.js} +3 -2
- package/dist/paper-widget-design-BGY5qu-K.js +4 -0
- package/dist/{qrcode-design-CjOkp2xa.js → qrcode-design-BsWJrsvD.js} +1 -1
- package/dist/{ref-autofill-editor-B2KcQvyt.js → ref-autofill-editor-BbozAOcm.js} +2 -2
- package/dist/{ref-props-DPnt_pys.js → ref-props-BInJu7PN.js} +3 -3
- package/dist/{ref-style-D0XKTtP1.js → ref-style-Dgc_9tko.js} +1 -1
- package/dist/regex-editor-C09XpMhm.js +796 -0
- package/dist/{revo-grid.entry-ztDhASK3.js → revo-grid.entry-BIm5A5wM.js} +1 -1
- package/dist/{revogr-attribution_7.entry-BtXV91vv.js → revogr-attribution_7.entry-B06XF5B_.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-DXpq4oNb.js → revogr-clipboard_3.entry-C8dVJYtR.js} +2 -2
- package/dist/{revogr-data_4.entry-WA1PNcGb.js → revogr-data_4.entry-Dgp6vYqe.js} +2 -2
- package/dist/{revogr-filter-panel.entry-unpVAD7l.js → revogr-filter-panel.entry-xo_juIUc.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-vIUGBOWr.js} +3 -2
- package/dist/{serialnumber-design-ClArHZWU.js → serialnumber-design-mWcys6hI.js} +1 -1
- package/dist/shared/index.es.js +18 -18
- package/dist/{signature-design-Cg2Ejj3g.js → signature-design-Dl-Lv5Z5.js} +5 -2
- package/dist/{signature-props-CNuLBWtc.js → signature-props-DSzpO-_r.js} +3 -3
- package/dist/{signature-style-DtlZdeFB.js → signature-style-Bk34vOsk.js} +1 -1
- package/dist/{single-field-drop-COLR9RIu.js → single-field-drop-CiPUMT9B.js} +2 -2
- package/dist/{size-editor-DyGGEX3s.js → size-editor-B5aunbUM.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/components/border-td.vue.d.ts +1 -0
- package/dist/src/nocode-base/src/components/{document-quick-fill-modal.vue.d.ts → document-quick-fill/dynamic-quick-fill-modal.vue.d.ts} +1 -1
- package/dist/src/nocode-base/src/components/{document-quick-fillin.vue.d.ts → document-quick-fill/fixed-quick-fill-modal.vue.d.ts} +6 -4
- package/dist/src/nocode-base/src/components/document-quick-fill/quick-fill.util.d.ts +17 -0
- package/dist/src/nocode-base/src/components/document-sub-table-action/fixed-table-action.vue.d.ts +13 -0
- package/dist/src/nocode-base/src/components/index.d.ts +4 -3
- 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/material-consume/mc-render.d.ts +3 -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 +39 -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 +16 -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-enum-select.d.ts +2 -0
- 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/render/mc-render.d.ts +3 -1
- package/dist/src/nocode-base/src/types/render/sub-table-render.d.ts +3 -1
- package/dist/src/nocode-base/src/types/widgets/i-paper.d.ts +2 -0
- package/dist/src/nocode-base/src/types/widgets/i-sub-table.d.ts +4 -0
- package/dist/src/nocode-web-render/src/hooks/userFormPrint.d.ts +2 -0
- package/dist/src/nocode-web-render/src/render/index.d.ts +2 -2
- package/dist/src/nocode-web-render/src/render/sub-table/common/scan-modal.vue.d.ts +3 -1
- package/dist/src/nocode-web-render/src/render/sub-table/common/sub-table-render.d.ts +3 -1
- package/dist/src/nocode-web-render/src/render/sub-table/material-consume/index.d.ts +1 -2
- package/dist/src/nocode-web-render/src/render/sub-table/material-consume/mc-web-render.d.ts +3 -1
- package/dist/src/online-form/src/components/version-diff/index/types.d.ts +2 -0
- package/dist/src/online-form/src/utils/field.enum.d.ts +3 -2
- 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 +28 -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 +43 -2
- package/dist/src/{nocode-web-render/src/render/sub-table/material-consume/scan-modal.vue.d.ts → online-form/src/views/designer/modules/panel/comps/confirm-before-delete-config.vue.d.ts} +2 -4
- package/dist/src/online-form/src/views/designer/modules/panel/comps/quick-fill-config.vue.d.ts +8 -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/modules/sheet/sheet-cell.vue.d.ts +1 -0
- package/dist/src/online-form/src/views/designer/types/index.d.ts +4 -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-BIFz5gw1.js} +3 -2
- package/dist/{text-design-490okDpw.js → text-design-C0dORvkP.js} +10 -6
- package/dist/{text-props-Dh4S3iN0.js → text-props-ClHI-4aM.js} +21 -252
- package/dist/{text-style-BGeNrOMv.js → text-style-DANM5fvy.js} +1 -1
- package/dist/{throttle-Cpk1LoGk-BWXeZXFZ.js → throttle-Cpk1LoGk-Da5HSLWc.js} +1 -1
- package/dist/{timediff-design-DEh9xNVa.js → timediff-design-BDCsQIal.js} +2 -1
- package/dist/{trace-design-Dk0irY70.js → trace-design-CKqq1WH_.js} +2 -2
- package/dist/{trace-props-DRBrPqIq.js → trace-props-BI24XFMc.js} +53 -16
- package/dist/{trace-style-6lXlaJ2o.js → trace-style-CX1f7oZH.js} +1 -1
- package/dist/{user-props-yasRJPzM.js → user-props-gF7KPnP8.js} +3 -2
- package/dist/{user-style-dkDUDf63.js → user-style-DIouAMWa.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-DHj-zNxm.js} +3 -2
- package/dist/{version-select-dvsx-Ifv.js → version-select-CL3QQGND.js} +2 -2
- package/dist/web-render/index.es.js +9 -9
- package/dist/{widget-barcode-BfzXe5MQ.js → widget-barcode-DZiCyrQW.js} +5 -4
- package/dist/{widget-diagonal-R5qdvCvE.js → widget-diagonal-D_Oz8te1.js} +3 -3
- package/dist/{widget-image-C0zAtiuf.js → widget-image-TL_SLOap.js} +5 -5
- package/dist/{widget-line-z4TTPDkL.js → widget-line-BQ-qcBUA.js} +3 -2
- package/dist/{widget-pagination-CeO9pmmu.js → widget-pagination-DciJE9qC.js} +6 -5
- package/dist/{widget-power-CP1DLxkZ.js → widget-power-B9KTIpwA.js} +3 -3
- package/dist/{widget-qrcode-Boz_t9l9.js → widget-qrcode-DRoj5rSy.js} +4 -3
- package/dist/{widget-rangelimit-B9kRG_Fa.js → widget-rangelimit-Ckgx3i4r.js} +3 -3
- package/dist/{widget-serialnumber-BBUxx4nB.js → widget-serialnumber-aUkR-0yC.js} +1 -1
- package/dist/{widget-text-qvLZssGe.js → widget-text-CJIT-hY3.js} +5 -5
- package/dist/{widget-timediff-BBmssjfJ.js → widget-timediff-x-RQMdNg.js} +3 -2
- package/package.json +1 -1
- package/dist/base-font-editor-BiSPxwVH.js +0 -83
- package/dist/cell-upload-JxFLM1bV.js +0 -25
- 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
- /package/dist/src/nocode-base/src/components/document-sub-table-action/{document-sub-table-action.vue.d.ts → dynamic-table-action.vue.d.ts} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
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";
|
|
5
|
+
import "ant-design-vue";
|
|
4
6
|
var PlatformEnum = /* @__PURE__ */ ((PlatformEnum2) => {
|
|
5
7
|
PlatformEnum2["INTEGRATION_PAAS_DP"] = "INTEGRATION_PAAS_DP";
|
|
6
8
|
PlatformEnum2["INTEGRATION_PAAS_SI"] = "INTEGRATION_PAAS_SI";
|
|
@@ -161,6 +163,13 @@ var RangeValidateMode = /* @__PURE__ */ ((RangeValidateMode2) => {
|
|
|
161
163
|
RangeValidateMode2["Variable_Validate"] = "VariableValidate";
|
|
162
164
|
return RangeValidateMode2;
|
|
163
165
|
})(RangeValidateMode || {});
|
|
166
|
+
var RangeCompareOp = /* @__PURE__ */ ((RangeCompareOp2) => {
|
|
167
|
+
RangeCompareOp2["LE"] = "le";
|
|
168
|
+
RangeCompareOp2["LT"] = "lt";
|
|
169
|
+
RangeCompareOp2["GE"] = "ge";
|
|
170
|
+
RangeCompareOp2["GT"] = "gt";
|
|
171
|
+
return RangeCompareOp2;
|
|
172
|
+
})(RangeCompareOp || {});
|
|
164
173
|
var DecimalDisplayMode = /* @__PURE__ */ ((DecimalDisplayMode2) => {
|
|
165
174
|
DecimalDisplayMode2["PERCENT"] = "percent";
|
|
166
175
|
DecimalDisplayMode2["ORIGIN"] = "origin";
|
|
@@ -475,28 +484,39 @@ const mergeByMultiKey = (A, B, {
|
|
|
475
484
|
});
|
|
476
485
|
return result;
|
|
477
486
|
};
|
|
487
|
+
const CLIENT_ROW_UID_KEY = "__gct_rv_uid";
|
|
488
|
+
const FRONT_ROW_KEY = "front_row_key_";
|
|
489
|
+
function ensureFrontRowKey(row) {
|
|
490
|
+
if (!row) return "";
|
|
491
|
+
const existing = row[FRONT_ROW_KEY];
|
|
492
|
+
if (existing != null && String(existing).trim() !== "") return String(existing);
|
|
493
|
+
const uid = `r_${Date.now()}_${uuid2(8)}`;
|
|
494
|
+
row[FRONT_ROW_KEY] = uid;
|
|
495
|
+
return uid;
|
|
496
|
+
}
|
|
478
497
|
const getRowId = (row) => {
|
|
479
498
|
if (!row) return "";
|
|
480
|
-
if (
|
|
481
|
-
|
|
482
|
-
if (!row[ROW_UID_KEY]) {
|
|
483
|
-
row[ROW_UID_KEY] = `r_${Date.now()}_${uuid2(8)}`;
|
|
499
|
+
if (row[FRONT_ROW_KEY] != null && String(row[FRONT_ROW_KEY]).trim() !== "") {
|
|
500
|
+
return String(row[FRONT_ROW_KEY]);
|
|
484
501
|
}
|
|
485
|
-
return row
|
|
502
|
+
if (!isNil(row.id_)) return String(row.id_);
|
|
503
|
+
return ensureFrontRowKey(row);
|
|
486
504
|
};
|
|
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;
|
|
505
|
+
function getApi$2() {
|
|
506
|
+
if (typeof globalThis !== "undefined") {
|
|
507
|
+
const globalApi = globalThis._api;
|
|
508
|
+
if (globalApi) {
|
|
509
|
+
return globalApi;
|
|
497
510
|
}
|
|
498
511
|
}
|
|
499
|
-
|
|
512
|
+
return api$1;
|
|
513
|
+
}
|
|
514
|
+
const api = new Proxy(api$1, {
|
|
515
|
+
get(_target, prop) {
|
|
516
|
+
const real = getApi$2();
|
|
517
|
+
return Reflect.get(real, prop, real);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
500
520
|
const baseDataUtils = {
|
|
501
521
|
baseApis: {
|
|
502
522
|
getOneData2SqlView: api.apaas.sqlView.postBizServiceModelKeyBsKey,
|
|
@@ -56592,10 +56612,14 @@ const transformUtils = {
|
|
|
56592
56612
|
const rowData = { ...baseData };
|
|
56593
56613
|
if (payload.isRowSubTable2d) {
|
|
56594
56614
|
const groupKey = `dyn${uuid2(16)}`;
|
|
56595
|
-
const _2DTABLE_ = Array.from({ length: payload.childInitRowLen }, () =>
|
|
56596
|
-
|
|
56597
|
-
|
|
56598
|
-
|
|
56615
|
+
const _2DTABLE_ = Array.from({ length: payload.childInitRowLen }, () => {
|
|
56616
|
+
const child = {
|
|
56617
|
+
...baseData,
|
|
56618
|
+
...pick(subDefaultData, payload.crossFieldKeys)
|
|
56619
|
+
};
|
|
56620
|
+
ensureFrontRowKey(child);
|
|
56621
|
+
return child;
|
|
56622
|
+
});
|
|
56599
56623
|
const extraData = { ...omit(subDefaultData, payload.crossFieldKeys) };
|
|
56600
56624
|
Object.assign(rowData, {
|
|
56601
56625
|
group_: groupKey,
|
|
@@ -56605,6 +56629,7 @@ const transformUtils = {
|
|
|
56605
56629
|
} else {
|
|
56606
56630
|
Object.assign(rowData, subDefaultData);
|
|
56607
56631
|
}
|
|
56632
|
+
ensureFrontRowKey(rowData);
|
|
56608
56633
|
return rowData;
|
|
56609
56634
|
},
|
|
56610
56635
|
/** 数据转成真实提交数据(二维表要平铺) */
|
|
@@ -56615,7 +56640,7 @@ const transformUtils = {
|
|
|
56615
56640
|
materialConsumeTableList = []
|
|
56616
56641
|
} = paper?.props || {};
|
|
56617
56642
|
const list2D = [...subTable2DList, ...checkTable2DList];
|
|
56618
|
-
const filterKeys = ["_DICT", "_OPCT", "__FOREIGN__", "_MCTABLE"];
|
|
56643
|
+
const filterKeys = ["_DICT", "_OPCT", "__FOREIGN__", "_MCTABLE", CLIENT_ROW_UID_KEY];
|
|
56619
56644
|
const realFormData = Object.keys(formData).reduce((acc, fieldKey) => {
|
|
56620
56645
|
const info = list2D.find(
|
|
56621
56646
|
(item) => (item.subTable2d || item.checkTable2d) && item.rowSubFieldKey === fieldKey
|
|
@@ -56644,7 +56669,10 @@ const transformUtils = {
|
|
|
56644
56669
|
)
|
|
56645
56670
|
)
|
|
56646
56671
|
).map((item) => omit(item, "_2DTABLE_"));
|
|
56647
|
-
acc[fieldKey] = arr.every((item) =>
|
|
56672
|
+
acc[fieldKey] = arr.every((item) => {
|
|
56673
|
+
const keys2 = Object.keys(item).filter((key) => key !== FRONT_ROW_KEY);
|
|
56674
|
+
return keys2.length === 1 && has(item, "group_");
|
|
56675
|
+
}) ? [] : arr;
|
|
56648
56676
|
} else if (Array.isArray(formData[fieldKey])) {
|
|
56649
56677
|
acc[fieldKey] = formData[fieldKey].map(
|
|
56650
56678
|
(item) => Object.fromEntries(
|
|
@@ -57297,17 +57325,19 @@ const renderUtils = {
|
|
|
57297
57325
|
return Boolean(parseInt(value));
|
|
57298
57326
|
},
|
|
57299
57327
|
/** 判断一个日期或日期时间字符串是否在最小和最大时间戳之间 */
|
|
57300
|
-
isOutOfRange: (inputStr, minTimestamp, maxTimestamp) => {
|
|
57328
|
+
isOutOfRange: (inputStr, minTimestamp, maxTimestamp, minCompareOp, maxCompareOp) => {
|
|
57301
57329
|
if (isNil(inputStr)) {
|
|
57302
57330
|
return false;
|
|
57303
57331
|
}
|
|
57304
57332
|
const inputTime = dayjs(inputStr).unix();
|
|
57305
57333
|
if (isNaN(inputTime)) return false;
|
|
57306
|
-
if (!isNil(minTimestamp) && !isNaN(minTimestamp)
|
|
57307
|
-
|
|
57334
|
+
if (!isNil(minTimestamp) && !isNaN(minTimestamp)) {
|
|
57335
|
+
const pass = minCompareOp === "gt" ? inputTime > minTimestamp : inputTime >= minTimestamp;
|
|
57336
|
+
if (!pass) return true;
|
|
57308
57337
|
}
|
|
57309
|
-
if (!isNil(maxTimestamp) && !isNaN(maxTimestamp)
|
|
57310
|
-
|
|
57338
|
+
if (!isNil(maxTimestamp) && !isNaN(maxTimestamp)) {
|
|
57339
|
+
const pass = maxCompareOp === "lt" ? inputTime < maxTimestamp : inputTime <= maxTimestamp;
|
|
57340
|
+
if (!pass) return true;
|
|
57311
57341
|
}
|
|
57312
57342
|
return false;
|
|
57313
57343
|
},
|
|
@@ -57444,7 +57474,7 @@ const renderUtils = {
|
|
|
57444
57474
|
FIELD_TYPE.PRODUCT,
|
|
57445
57475
|
FIELD_TYPE.ROUTING_OPERATION,
|
|
57446
57476
|
FIELD_TYPE.MFG_ORDER
|
|
57447
|
-
].includes(fieldType) || [FIELD_TYPE.
|
|
57477
|
+
].includes(fieldType) || [FIELD_TYPE.E_SOP, FIELD_TYPE.E_SOP_VERSION].includes(bizType)) && !subFieldKey && !subModelKey || bizType === FIELD_TYPE.WAREHOUSE || !isNil(defaultValue) && defaultValue !== "";
|
|
57448
57478
|
if (shouldPushDefaultValueField && !useDefaultValueFields[key]) {
|
|
57449
57479
|
useDefaultValueFields[key] = {
|
|
57450
57480
|
fieldId,
|
|
@@ -57741,6 +57771,7 @@ const renderUtils = {
|
|
|
57741
57771
|
case FIELD_TYPE.REF:
|
|
57742
57772
|
case FIELD_TYPE.REF_MULTI:
|
|
57743
57773
|
const isRdo = [FIELD_TYPE.E_SOP].includes(bizType);
|
|
57774
|
+
const isBizType = [FIELD_TYPE.E_SOP].includes(bizType);
|
|
57744
57775
|
const queryCondition = refUtils.generateQueryConditions(field.dataFilter, paramsConfig);
|
|
57745
57776
|
return await getRefList({
|
|
57746
57777
|
modelKey,
|
|
@@ -57749,7 +57780,10 @@ const renderUtils = {
|
|
|
57749
57780
|
queryData: {
|
|
57750
57781
|
...queryCondition.dataFilterFixedQueryData,
|
|
57751
57782
|
...defaultQuery,
|
|
57752
|
-
...newQueryData
|
|
57783
|
+
...newQueryData,
|
|
57784
|
+
...isBizType ? {
|
|
57785
|
+
operating_state_: true
|
|
57786
|
+
} : {}
|
|
57753
57787
|
},
|
|
57754
57788
|
// 库位需要数据联动,初始化不要加载
|
|
57755
57789
|
needDataLink: field.field === "location_id_",
|
|
@@ -59471,195 +59505,1220 @@ const calcUtils = {
|
|
|
59471
59505
|
return pageData;
|
|
59472
59506
|
}
|
|
59473
59507
|
};
|
|
59474
|
-
|
|
59475
|
-
|
|
59476
|
-
|
|
59477
|
-
|
|
59478
|
-
|
|
59479
|
-
|
|
59480
|
-
|
|
59508
|
+
var NCB_PROVIDE = /* @__PURE__ */ ((NCB_PROVIDE2) => {
|
|
59509
|
+
NCB_PROVIDE2["IS_PDF"] = "NCB_IsPdf";
|
|
59510
|
+
NCB_PROVIDE2["FROM_DATA"] = "NCB_FromState";
|
|
59511
|
+
NCB_PROVIDE2["DEFAULT_FIELD_DATA"] = "NCB_DefaultFieldData";
|
|
59512
|
+
NCB_PROVIDE2["DATA_RELATION_SHIP"] = "NCB_DataRelationShip";
|
|
59513
|
+
NCB_PROVIDE2["PAGE_DATA_CALL_BACK"] = "NCB_PageDataCallback";
|
|
59514
|
+
NCB_PROVIDE2["FORM_INST_LIST"] = "NCB_FormInstList";
|
|
59515
|
+
NCB_PROVIDE2["MOBILE_FILL_FIELDS_POPUP"] = "NCB_MobileFillFieldsPopup";
|
|
59516
|
+
NCB_PROVIDE2["TMPL_BOM_CONTROLLER_MAP"] = "NCB_TmplBomControllerMap";
|
|
59517
|
+
NCB_PROVIDE2["MATERIAL_CONSUME_TABLE_CONTROLLER"] = "NCB_MaterialConsumeTableController";
|
|
59518
|
+
NCB_PROVIDE2["CHECK_TABLE_COL_INDEX"] = "NCB_CheckTableColIndex";
|
|
59519
|
+
NCB_PROVIDE2["SUB_TABLE_CORE_FACTORY_MAP"] = "NCB_SubTableCoreFactoryMap";
|
|
59520
|
+
NCB_PROVIDE2["SUB_TABLE_CORE"] = "NCB_SubTableCore";
|
|
59521
|
+
NCB_PROVIDE2["PAGER"] = "NCB_Pager";
|
|
59522
|
+
return NCB_PROVIDE2;
|
|
59523
|
+
})(NCB_PROVIDE || {});
|
|
59524
|
+
function mitt(all) {
|
|
59525
|
+
all = all || /* @__PURE__ */ new Map();
|
|
59526
|
+
return {
|
|
59527
|
+
/**
|
|
59528
|
+
* A Map of event names to registered handler functions.
|
|
59529
|
+
*/
|
|
59530
|
+
all,
|
|
59531
|
+
/**
|
|
59532
|
+
* Register an event handler for the given type.
|
|
59533
|
+
* @param {string|symbol} type Type of event to listen for, or `'*'` for all events
|
|
59534
|
+
* @param {Function} handler Function to call in response to given event
|
|
59535
|
+
* @memberOf mitt
|
|
59536
|
+
*/
|
|
59537
|
+
on(type4, handler) {
|
|
59538
|
+
const handlers = all.get(type4);
|
|
59539
|
+
if (handlers) {
|
|
59540
|
+
handlers.push(handler);
|
|
59541
|
+
} else {
|
|
59542
|
+
all.set(type4, [handler]);
|
|
59543
|
+
}
|
|
59544
|
+
},
|
|
59545
|
+
/**
|
|
59546
|
+
* Remove an event handler for the given type.
|
|
59547
|
+
* If `handler` is omitted, all handlers of the given type are removed.
|
|
59548
|
+
* @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
|
|
59549
|
+
* @param {Function} [handler] Handler function to remove
|
|
59550
|
+
* @memberOf mitt
|
|
59551
|
+
*/
|
|
59552
|
+
off(type4, handler) {
|
|
59553
|
+
const handlers = all.get(type4);
|
|
59554
|
+
if (handlers) {
|
|
59555
|
+
if (handler) {
|
|
59556
|
+
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
59557
|
+
} else {
|
|
59558
|
+
all.set(type4, []);
|
|
59481
59559
|
}
|
|
59482
59560
|
}
|
|
59561
|
+
},
|
|
59562
|
+
/**
|
|
59563
|
+
* Invoke all handlers for the given type.
|
|
59564
|
+
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
59565
|
+
*
|
|
59566
|
+
* Note: Manually firing '*' handlers is not supported.
|
|
59567
|
+
*
|
|
59568
|
+
* @param {string|symbol} type The event type to invoke
|
|
59569
|
+
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
59570
|
+
* @memberOf mitt
|
|
59571
|
+
*/
|
|
59572
|
+
emit(type4, evt) {
|
|
59573
|
+
let handlers = all.get(type4);
|
|
59574
|
+
if (handlers) {
|
|
59575
|
+
handlers.slice().forEach((handler) => {
|
|
59576
|
+
handler(evt);
|
|
59577
|
+
});
|
|
59578
|
+
}
|
|
59579
|
+
handlers = all.get("*");
|
|
59580
|
+
if (handlers) {
|
|
59581
|
+
handlers.slice().forEach((handler) => {
|
|
59582
|
+
handler(type4, evt);
|
|
59583
|
+
});
|
|
59584
|
+
}
|
|
59585
|
+
},
|
|
59586
|
+
/**
|
|
59587
|
+
* Clear all
|
|
59588
|
+
*/
|
|
59589
|
+
clear() {
|
|
59590
|
+
this.all.clear();
|
|
59483
59591
|
}
|
|
59484
|
-
return target;
|
|
59485
59592
|
};
|
|
59486
|
-
return _extends.apply(this, arguments);
|
|
59487
59593
|
}
|
|
59488
|
-
|
|
59489
|
-
|
|
59490
|
-
|
|
59491
|
-
|
|
59492
|
-
|
|
59493
|
-
|
|
59494
|
-
|
|
59495
|
-
|
|
59594
|
+
const emitter = mitt();
|
|
59595
|
+
var EmitterEnum = /* @__PURE__ */ ((EmitterEnum2) => {
|
|
59596
|
+
EmitterEnum2["__on__open_single_annotation_detail_"] = "__on__open_single_annotation_detail_";
|
|
59597
|
+
EmitterEnum2["__on__update_page_dom_"] = "__on__update_page_dom_";
|
|
59598
|
+
EmitterEnum2["__on_select_ebr_doc_instance_id"] = "__on_select_ebr_doc_instance_id";
|
|
59599
|
+
EmitterEnum2["__on_looper_auto_save"] = "__on_looper_auto_save";
|
|
59600
|
+
EmitterEnum2["__on_diff_ebr_form_state"] = "__on_diff_ebr_form_state";
|
|
59601
|
+
return EmitterEnum2;
|
|
59602
|
+
})(EmitterEnum || {});
|
|
59603
|
+
function useNocodeEmitter() {
|
|
59604
|
+
return {
|
|
59605
|
+
emitter,
|
|
59606
|
+
EmitterEnum
|
|
59496
59607
|
};
|
|
59497
|
-
return _getPrototypeOf(o);
|
|
59498
59608
|
}
|
|
59499
|
-
function
|
|
59500
|
-
|
|
59501
|
-
|
|
59502
|
-
|
|
59609
|
+
function useCurrentPageFormState() {
|
|
59610
|
+
const formStateMap = inject(NCB_PROVIDE.FROM_DATA);
|
|
59611
|
+
const dataRelationShip = inject(NCB_PROVIDE.DATA_RELATION_SHIP);
|
|
59612
|
+
const currentPageFormState = computed(() => {
|
|
59613
|
+
return formStateMap?.[dataRelationShip?.uniqueId ?? ""] ?? {};
|
|
59614
|
+
});
|
|
59615
|
+
return {
|
|
59616
|
+
currentPageFormState
|
|
59503
59617
|
};
|
|
59504
|
-
return _setPrototypeOf(o, p2);
|
|
59505
59618
|
}
|
|
59506
|
-
function
|
|
59507
|
-
|
|
59508
|
-
|
|
59509
|
-
|
|
59510
|
-
|
|
59511
|
-
|
|
59512
|
-
|
|
59513
|
-
|
|
59514
|
-
|
|
59515
|
-
|
|
59619
|
+
function useWidgetStaticAttrs(widget) {
|
|
59620
|
+
const dataRelationShip = inject(NCB_PROVIDE.DATA_RELATION_SHIP);
|
|
59621
|
+
const {
|
|
59622
|
+
field = "",
|
|
59623
|
+
fieldType,
|
|
59624
|
+
bizType,
|
|
59625
|
+
isFieldModel,
|
|
59626
|
+
fieldLink,
|
|
59627
|
+
modelKey = dataRelationShip?.modelKey,
|
|
59628
|
+
refModelKey,
|
|
59629
|
+
placeholder,
|
|
59630
|
+
bindCompStyleType,
|
|
59631
|
+
newSpecificConfig
|
|
59632
|
+
} = widget.props || {};
|
|
59633
|
+
let viewState = widget.props?.viewState;
|
|
59634
|
+
if (fieldType === FIELD_TYPE.ATTACHMENT && viewState === CellWidgetViewState.Auto) {
|
|
59635
|
+
viewState = CellWidgetViewState.Readonly;
|
|
59516
59636
|
}
|
|
59517
|
-
|
|
59518
|
-
|
|
59519
|
-
|
|
59520
|
-
|
|
59521
|
-
|
|
59522
|
-
|
|
59523
|
-
|
|
59524
|
-
|
|
59525
|
-
|
|
59526
|
-
|
|
59527
|
-
|
|
59528
|
-
|
|
59637
|
+
const disabled = toRef(widget.props, "disabled");
|
|
59638
|
+
const readonly = toRef(widget.props, "field_readonly");
|
|
59639
|
+
const newRequired = toRef(widget.props, "required");
|
|
59640
|
+
const newQueryDataRef = computed(() => widget.props.newSpecificConfig?.newQueryData);
|
|
59641
|
+
const customLoaderRef = computed(() => widget.props.newSpecificConfig?.customLoader);
|
|
59642
|
+
const {
|
|
59643
|
+
newFieldName,
|
|
59644
|
+
newModelName,
|
|
59645
|
+
newOptions = [],
|
|
59646
|
+
newUploadConfig = {},
|
|
59647
|
+
newPrecision = 0,
|
|
59648
|
+
newLoadFinished2Options,
|
|
59649
|
+
newTotalCount,
|
|
59650
|
+
newRefRecordNo,
|
|
59651
|
+
newQueryData,
|
|
59652
|
+
newQueryCondition,
|
|
59653
|
+
forcedDisabled,
|
|
59654
|
+
forcedReadonlyText,
|
|
59655
|
+
newPlaceholder,
|
|
59656
|
+
newRulesForRounding,
|
|
59657
|
+
newComponentProps = {},
|
|
59658
|
+
newDisplayRule = void 0,
|
|
59659
|
+
newSnNo = void 0
|
|
59660
|
+
} = newSpecificConfig || {};
|
|
59661
|
+
const targetFieldId = field ? isFieldModel ? fieldLink : field : "";
|
|
59662
|
+
const newDisplayStatus = computed(() => {
|
|
59663
|
+
const readonlyString = viewState === CellWidgetViewState.Disabled || viewState === CellWidgetViewState.Auto ? "readonly-component" : "readonly-text";
|
|
59664
|
+
const editString = readonly.value ? "readonly-component" : "edit-component";
|
|
59665
|
+
if (dataRelationShip?.annSwitchStatus || forcedReadonlyText) return "readonly-text";
|
|
59666
|
+
if (isFieldModel) return readonlyString;
|
|
59667
|
+
const renderMode = dataRelationShip?.renderModeType;
|
|
59668
|
+
const bpmnMap = dataRelationShip?.bpmnFieldAuthMap;
|
|
59669
|
+
const key = `${modelKey}.${field}`;
|
|
59670
|
+
const getFieldAuth = () => bpmnMap?.[key];
|
|
59671
|
+
const resolveFromAuth = (info) => {
|
|
59672
|
+
if (isEmpty(info)) return null;
|
|
59673
|
+
if (info.edit && !info.readonly) return editString;
|
|
59674
|
+
if (info.readonly && !info.edit) return readonlyString;
|
|
59675
|
+
return null;
|
|
59529
59676
|
};
|
|
59530
|
-
|
|
59531
|
-
|
|
59532
|
-
|
|
59533
|
-
|
|
59534
|
-
|
|
59535
|
-
}
|
|
59536
|
-
|
|
59537
|
-
|
|
59538
|
-
|
|
59539
|
-
|
|
59540
|
-
|
|
59541
|
-
|
|
59677
|
+
if (renderMode === RenderModeEnum.FormMode) {
|
|
59678
|
+
if (dataRelationShip?.formType !== FormTypeEnum.PROCESS) {
|
|
59679
|
+
const auth2 = getFieldAuth();
|
|
59680
|
+
const fromAuth2 = resolveFromAuth(auth2);
|
|
59681
|
+
return fromAuth2 ?? editString;
|
|
59682
|
+
}
|
|
59683
|
+
const auth = getFieldAuth();
|
|
59684
|
+
const fromAuth = resolveFromAuth(auth);
|
|
59685
|
+
if (fromAuth) return fromAuth;
|
|
59686
|
+
const bpmnType = dataRelationShip?.bpmnType;
|
|
59687
|
+
if (bpmnType === BpmnNodeTypeEnum.BpmnApproval || bpmnType === BpmnNodeTypeEnum.BpmnJudge) {
|
|
59688
|
+
return readonlyString;
|
|
59689
|
+
}
|
|
59690
|
+
return editString;
|
|
59542
59691
|
}
|
|
59543
|
-
if (
|
|
59544
|
-
|
|
59545
|
-
_cache.set(Class2, Wrapper);
|
|
59692
|
+
if (renderMode === RenderModeEnum.ViewMode) {
|
|
59693
|
+
return readonlyString;
|
|
59546
59694
|
}
|
|
59547
|
-
|
|
59548
|
-
|
|
59695
|
+
return readonly.value ? "readonly-text" : "edit-component";
|
|
59696
|
+
});
|
|
59697
|
+
const newDisabled = computed(() => {
|
|
59698
|
+
if (newDisplayStatus.value === "edit-component") {
|
|
59699
|
+
return forcedDisabled || disabled.value;
|
|
59549
59700
|
}
|
|
59550
|
-
|
|
59551
|
-
|
|
59552
|
-
|
|
59553
|
-
|
|
59554
|
-
|
|
59555
|
-
|
|
59556
|
-
|
|
59557
|
-
|
|
59558
|
-
|
|
59701
|
+
return viewState === CellWidgetViewState.Disabled || disabled.value;
|
|
59702
|
+
});
|
|
59703
|
+
const isAutoLineBreak = computed(() => {
|
|
59704
|
+
if (!isEmpty(widget.style) && has(widget.style, "whiteSpace") && has(widget.style, "wordBreak") && widget.style.whiteSpace === "pre-wrap" && widget.style.wordBreak === "break-all") {
|
|
59705
|
+
return true;
|
|
59706
|
+
}
|
|
59707
|
+
return false;
|
|
59708
|
+
});
|
|
59709
|
+
return {
|
|
59710
|
+
field,
|
|
59711
|
+
fieldType,
|
|
59712
|
+
/** 业务类型 */
|
|
59713
|
+
bizType,
|
|
59714
|
+
modelKey,
|
|
59715
|
+
refModelKey,
|
|
59716
|
+
isFieldModel,
|
|
59717
|
+
fieldLink,
|
|
59718
|
+
targetFieldId,
|
|
59719
|
+
// An explicitly empty new placeholder means the user removed the hint.
|
|
59720
|
+
// Do not fall back to the legacy placeholder in that case.
|
|
59721
|
+
placeholder: newPlaceholder !== void 0 && newPlaceholder !== null ? newPlaceholder : placeholder,
|
|
59722
|
+
bindCompStyleType,
|
|
59723
|
+
/** 字段名称 */
|
|
59724
|
+
showFieldName: newFieldName,
|
|
59725
|
+
/** 字段所属模型名称 */
|
|
59726
|
+
showModelName: newModelName,
|
|
59727
|
+
/** 是否必填 */
|
|
59728
|
+
showRequired: newRequired,
|
|
59729
|
+
/** 是否禁用 */
|
|
59730
|
+
showDisabled: newDisabled,
|
|
59731
|
+
/** 显示状态 */
|
|
59732
|
+
showDisplayStatus: newDisplayStatus,
|
|
59733
|
+
/** 下拉列表 */
|
|
59734
|
+
options: newOptions,
|
|
59735
|
+
/** 附件、图片配置项 */
|
|
59736
|
+
uploadConfig: newUploadConfig,
|
|
59737
|
+
/** 小数位数 */
|
|
59738
|
+
realPrecision: newPrecision,
|
|
59739
|
+
/** 精度小数的修约规则 */
|
|
59740
|
+
rulesForRounding: newRulesForRounding,
|
|
59741
|
+
/** 记录单号是否是链接 */
|
|
59742
|
+
realRefRecordNo: newRefRecordNo,
|
|
59743
|
+
/** 下拉列表内容是否都加载完成 */
|
|
59744
|
+
loadFinished2Options: newLoadFinished2Options,
|
|
59745
|
+
/** Rdo下拉框内容总数 */
|
|
59746
|
+
newTotalCount,
|
|
59747
|
+
/** 查询条件 */
|
|
59748
|
+
newQueryData,
|
|
59749
|
+
/** 查询条件响应式 */
|
|
59750
|
+
newQueryDataRef,
|
|
59751
|
+
/** 自定义数据源加载函数 */
|
|
59752
|
+
customLoaderRef,
|
|
59753
|
+
/** 查询条件 */
|
|
59754
|
+
queryCondition: newQueryCondition,
|
|
59755
|
+
/** 组件额外参数 */
|
|
59756
|
+
newComponentProps,
|
|
59757
|
+
/** 显示规则 */
|
|
59758
|
+
newDisplayRule,
|
|
59759
|
+
dataRelationShip,
|
|
59760
|
+
/** 是否是自动换行 */
|
|
59761
|
+
isAutoLineBreak,
|
|
59762
|
+
/** 序列号 */
|
|
59763
|
+
newSnNo
|
|
59559
59764
|
};
|
|
59560
|
-
return _wrapNativeSuper(Class);
|
|
59561
59765
|
}
|
|
59562
|
-
|
|
59563
|
-
|
|
59564
|
-
|
|
59565
|
-
|
|
59566
|
-
|
|
59567
|
-
|
|
59568
|
-
|
|
59569
|
-
|
|
59570
|
-
|
|
59571
|
-
|
|
59572
|
-
|
|
59766
|
+
function useCalculateFormula() {
|
|
59767
|
+
const { identify, calculate } = {
|
|
59768
|
+
identify: (...args) => window.NocodeAdapter.utils?.formulaIdentify?.(...args) ?? [],
|
|
59769
|
+
calculate: (...args) => window.NocodeAdapter.utils?.formulaCalculate?.(...args)
|
|
59770
|
+
};
|
|
59771
|
+
const getFieldDataValue = (parseInfo, formData) => {
|
|
59772
|
+
const getTextValue = (processedKey, value) => {
|
|
59773
|
+
const textValue = value ?? formData?.[processedKey] ?? "";
|
|
59774
|
+
return Array.isArray(textValue) ? textValue.join() : textValue;
|
|
59775
|
+
};
|
|
59776
|
+
const { type: type4, processed, hashValue } = parseInfo;
|
|
59777
|
+
if (type4 === "hash") {
|
|
59778
|
+
const tableData = toRaw(formData?.[hashValue] || []);
|
|
59779
|
+
return tableData.filter((d) => !d.deleted_).map((row) => getTextValue(processed, row?.[processed])).filter((i2) => !isNil(i2));
|
|
59573
59780
|
}
|
|
59781
|
+
return getTextValue(processed, formData?.[processed]);
|
|
59782
|
+
};
|
|
59783
|
+
const parseFormulaVar = (formulaVar) => {
|
|
59784
|
+
const result = {
|
|
59785
|
+
original: formulaVar,
|
|
59786
|
+
type: "",
|
|
59787
|
+
processed: "",
|
|
59788
|
+
hashValue: "",
|
|
59789
|
+
dataType: ""
|
|
59790
|
+
};
|
|
59791
|
+
if (/^\$([^$]+)\$\.(.+)$/.test(formulaVar)) {
|
|
59792
|
+
const match = formulaVar.match(/^\$([^$]+)\$\.(.+)$/);
|
|
59793
|
+
result.type = "hash";
|
|
59794
|
+
result.processed = match[2];
|
|
59795
|
+
result.hashValue = match[1];
|
|
59796
|
+
result.dataType = "globType";
|
|
59797
|
+
} else if (/^_\.(.+)$/.test(formulaVar)) {
|
|
59798
|
+
const match = formulaVar.match(/^_\.(.+)$/);
|
|
59799
|
+
result.type = "underscore";
|
|
59800
|
+
result.processed = match[1];
|
|
59801
|
+
result.dataType = "currentRowType";
|
|
59802
|
+
} else {
|
|
59803
|
+
result.type = "plain";
|
|
59804
|
+
result.processed = formulaVar;
|
|
59805
|
+
result.dataType = "globType";
|
|
59806
|
+
}
|
|
59807
|
+
return result;
|
|
59808
|
+
};
|
|
59809
|
+
const getParseFormulaVarInfos2 = (expr) => {
|
|
59810
|
+
const rowArgs = expr ? identify(expr) : [];
|
|
59811
|
+
return {
|
|
59812
|
+
rowArgs,
|
|
59813
|
+
parseInfos: rowArgs.map((curr) => parseFormulaVar(curr))
|
|
59814
|
+
};
|
|
59815
|
+
};
|
|
59816
|
+
const calculateFormula2 = async (expr, formData, currentPageFormState) => {
|
|
59817
|
+
const rowArgs = identify(expr);
|
|
59818
|
+
const formulaData = isEmpty(rowArgs) ? {} : rowArgs.reduce((total, curr) => {
|
|
59819
|
+
const parseInfo = parseFormulaVar(curr);
|
|
59820
|
+
total[curr] = getFieldDataValue(
|
|
59821
|
+
parseInfo,
|
|
59822
|
+
parseInfo.dataType === "currentRowType" ? formData : currentPageFormState
|
|
59823
|
+
);
|
|
59824
|
+
return total;
|
|
59825
|
+
}, {});
|
|
59826
|
+
return calculate(expr, formulaData);
|
|
59827
|
+
};
|
|
59828
|
+
const mergeParseInfos = (a = [], b = []) => {
|
|
59829
|
+
const map = /* @__PURE__ */ new Map();
|
|
59830
|
+
const keyOf = (p2) => `${p2.type}||${p2.processed}||${p2.hashValue ?? ""}`;
|
|
59831
|
+
for (const p2 of a || []) map.set(keyOf(p2), p2);
|
|
59832
|
+
for (const p2 of b || []) map.set(keyOf(p2), p2);
|
|
59833
|
+
return Array.from(map.values());
|
|
59834
|
+
};
|
|
59835
|
+
const getMergeParseInfos = (options) => {
|
|
59836
|
+
const { minFormulaExpr, maxFormulaExpr } = options;
|
|
59837
|
+
let minInfos = [];
|
|
59838
|
+
let maxInfos = [];
|
|
59839
|
+
try {
|
|
59840
|
+
if (minFormulaExpr) minInfos = getParseFormulaVarInfos2(minFormulaExpr)?.parseInfos || [];
|
|
59841
|
+
} catch (e) {
|
|
59842
|
+
minInfos = [];
|
|
59843
|
+
}
|
|
59844
|
+
try {
|
|
59845
|
+
if (maxFormulaExpr) maxInfos = getParseFormulaVarInfos2(maxFormulaExpr)?.parseInfos || [];
|
|
59846
|
+
} catch (e) {
|
|
59847
|
+
maxInfos = [];
|
|
59848
|
+
}
|
|
59849
|
+
const merged = mergeParseInfos(minInfos, maxInfos);
|
|
59850
|
+
return merged;
|
|
59851
|
+
};
|
|
59852
|
+
return {
|
|
59853
|
+
identify,
|
|
59854
|
+
getParseFormulaVarInfos: getParseFormulaVarInfos2,
|
|
59855
|
+
calculateFormula: calculateFormula2,
|
|
59856
|
+
getMergeParseInfos
|
|
59574
59857
|
};
|
|
59575
59858
|
}
|
|
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;
|
|
59859
|
+
function setSelectAnnotationId(id, basicInfoItem, event) {
|
|
59860
|
+
if (!basicInfoItem) return;
|
|
59861
|
+
const { emitter: emitter2, EmitterEnum: EmitterEnum2 } = useNocodeEmitter();
|
|
59862
|
+
if (event?.target) {
|
|
59863
|
+
const target = event.target;
|
|
59864
|
+
const clickedIcon = target.closest(".annotation-icon");
|
|
59865
|
+
if (clickedIcon) {
|
|
59866
|
+
const cellDiv = target.closest(".cell-wrapper-container");
|
|
59867
|
+
if (cellDiv) {
|
|
59868
|
+
const scope = cellDiv.closest(".combine-fields-area") ?? cellDiv.closest("td") ?? cellDiv;
|
|
59869
|
+
const locations = [
|
|
59870
|
+
...new Set(
|
|
59871
|
+
Array.from(scope.querySelectorAll(".annotation-icon")).map((el2) => el2.dataset.ann).filter((loc) => !!loc)
|
|
59872
|
+
)
|
|
59873
|
+
];
|
|
59874
|
+
if (locations.length) {
|
|
59875
|
+
basicInfoItem.annSelectId = locations.length === 1 ? locations[0] : locations;
|
|
59876
|
+
emitter2.emit(EmitterEnum2.__on__open_single_annotation_detail_, {
|
|
59877
|
+
cellLocation: locations.length === 1 ? locations[0] : locations
|
|
59878
|
+
});
|
|
59879
|
+
return;
|
|
59880
|
+
}
|
|
59617
59881
|
}
|
|
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
59882
|
}
|
|
59648
59883
|
}
|
|
59649
|
-
|
|
59650
|
-
|
|
59884
|
+
if (isEmpty(id)) return;
|
|
59885
|
+
const newId = id === "gct-nocode-ann-main" ? "" : id;
|
|
59886
|
+
basicInfoItem.annSelectId = newId;
|
|
59887
|
+
emitter2.emit(EmitterEnum2.__on__open_single_annotation_detail_, {
|
|
59888
|
+
cellLocation: newId
|
|
59651
59889
|
});
|
|
59652
59890
|
}
|
|
59653
|
-
function
|
|
59654
|
-
|
|
59655
|
-
|
|
59656
|
-
|
|
59657
|
-
|
|
59658
|
-
|
|
59659
|
-
|
|
59660
|
-
|
|
59661
|
-
|
|
59662
|
-
|
|
59891
|
+
function closeValidatorPopovers() {
|
|
59892
|
+
document.querySelectorAll(".nocode-validator-tooltip-wrapper").forEach((node) => {
|
|
59893
|
+
const host = node.closest(".ant-popover, .gct-popover, .popover");
|
|
59894
|
+
host?.remove();
|
|
59895
|
+
});
|
|
59896
|
+
}
|
|
59897
|
+
function setSelectValidatorId(event, basicInfoItem) {
|
|
59898
|
+
if (basicInfoItem && event.target) {
|
|
59899
|
+
closeValidatorPopovers();
|
|
59900
|
+
const cellDiv = event.target.closest(".cell-wrapper-container");
|
|
59901
|
+
if (!cellDiv) return;
|
|
59902
|
+
const clickedIcon = event.target.closest(
|
|
59903
|
+
".validator-icon"
|
|
59904
|
+
);
|
|
59905
|
+
const scope = clickedIcon ? cellDiv.closest(".combine-fields-area") ?? cellDiv.closest("td") ?? cellDiv : cellDiv;
|
|
59906
|
+
const ids = [
|
|
59907
|
+
...new Set(
|
|
59908
|
+
Array.from(scope.querySelectorAll(".validator-icon")).map((el2) => el2.dataset.ann).filter((id) => !!id)
|
|
59909
|
+
)
|
|
59910
|
+
];
|
|
59911
|
+
const validateList = ids.map((id) => basicInfoItem.validatorMessageMap?.[id]).filter(Boolean);
|
|
59912
|
+
const flattenedErrors = validateList.flatMap(
|
|
59913
|
+
(validates) => validates.map(({ field: _field, message: message2 }) => JSON.parse(message2))
|
|
59914
|
+
);
|
|
59915
|
+
const resultMap = flattenedErrors.reduce((acc, item) => {
|
|
59916
|
+
const { showModelName, showModelKey, subFieldKey, showFieldName, targetFieldId, message: message2 } = item;
|
|
59917
|
+
if (!acc[showModelKey]) {
|
|
59918
|
+
acc[showModelKey] = {
|
|
59919
|
+
showModelName,
|
|
59920
|
+
showModelKey,
|
|
59921
|
+
subFieldKey,
|
|
59922
|
+
fields: []
|
|
59923
|
+
};
|
|
59924
|
+
}
|
|
59925
|
+
acc[showModelKey].fields.push({ showFieldName, targetFieldId, message: message2 });
|
|
59926
|
+
return acc;
|
|
59927
|
+
}, {});
|
|
59928
|
+
if (Object.keys(resultMap).length) {
|
|
59929
|
+
const contentVNode = h$1(
|
|
59930
|
+
"div",
|
|
59931
|
+
{ class: "nocode-validator-tooltip-wrapper" },
|
|
59932
|
+
Object.values(resultMap).map(
|
|
59933
|
+
(data) => h$1("div", { class: "nocode-validator-tooltip-container", key: data.showModelKey }, [
|
|
59934
|
+
h$1("div", { class: "nocode-validator-tooltip-header" }, data.showModelName),
|
|
59935
|
+
h$1(
|
|
59936
|
+
"div",
|
|
59937
|
+
{ class: "nocode-validator-tooltip-header-label" },
|
|
59938
|
+
`${data.showModelKey}${data.subFieldKey ? "|" + data.subFieldKey : ""}`
|
|
59939
|
+
),
|
|
59940
|
+
h$1(
|
|
59941
|
+
"ul",
|
|
59942
|
+
{ class: "nocode-validator-tooltip-content" },
|
|
59943
|
+
data.fields.map(
|
|
59944
|
+
(field, index2) => h$1(
|
|
59945
|
+
"li",
|
|
59946
|
+
{ key: `${field.targetFieldId}-${index2}` },
|
|
59947
|
+
`${field.showFieldName}(${field.targetFieldId}):${field.message}`
|
|
59948
|
+
)
|
|
59949
|
+
)
|
|
59950
|
+
)
|
|
59951
|
+
])
|
|
59952
|
+
)
|
|
59953
|
+
);
|
|
59954
|
+
const iconEl = clickedIcon ?? scope.querySelector(".validator-icon");
|
|
59955
|
+
const anchorEl = iconEl ?? cellDiv;
|
|
59956
|
+
window.window.NocodeAdapter.utils.overlay.popover(
|
|
59957
|
+
anchorEl,
|
|
59958
|
+
contentVNode,
|
|
59959
|
+
{},
|
|
59960
|
+
{ placement: "top-center" }
|
|
59961
|
+
);
|
|
59962
|
+
}
|
|
59963
|
+
}
|
|
59964
|
+
}
|
|
59965
|
+
function setSelectMobileTdId(tdInfo, basicInfoItem, widgetCenter, callback, sbRowIndex) {
|
|
59966
|
+
const getWidgetInfo = () => {
|
|
59967
|
+
const { preLocation, props: tdProps } = tdInfo || {};
|
|
59968
|
+
const paper = widgetCenter?.[ComponentTypeEnum.PAPER];
|
|
59969
|
+
const subTable2DList = paper.props.subTable2DList ?? [];
|
|
59970
|
+
const checkTable2DList = paper.props.checkTable2DList ?? [];
|
|
59971
|
+
const fixedTableLenMap = paper.props.fixedTableLenMap ?? {};
|
|
59972
|
+
const getTdIds = (key) => [...basicInfoItem?.mobileTdIdGroups.get(key) || []];
|
|
59973
|
+
const assignWidgetInfo = (fillType, params) => {
|
|
59974
|
+
const { rowSubFieldKey = "", colSubFieldKey = "" } = params;
|
|
59975
|
+
const mainSetKey = rowSubFieldKey !== "gct_mobile_main" ? `gct_mobile_sub.${rowSubFieldKey}` : rowSubFieldKey;
|
|
59976
|
+
const linkSetKey = colSubFieldKey ? `gct_mobile_sub.${colSubFieldKey}` : colSubFieldKey;
|
|
59977
|
+
return {
|
|
59978
|
+
fillType,
|
|
59979
|
+
clickTdId: tdInfo.id,
|
|
59980
|
+
clickSbRowIndex: sbRowIndex,
|
|
59981
|
+
mainWidgetIds: getTdIds(mainSetKey),
|
|
59982
|
+
linkWidgetIds: getTdIds(linkSetKey),
|
|
59983
|
+
subInfo: params
|
|
59984
|
+
};
|
|
59985
|
+
};
|
|
59986
|
+
if (preLocation === ComponentTypeEnum.PAPER) {
|
|
59987
|
+
if (tdProps.isNewFixedTableTd) {
|
|
59988
|
+
const item2 = subTable2DList.find(
|
|
59989
|
+
(i2) => i2.subTable2d && i2.colSubFieldKey === tdProps.fixedTableFieldId
|
|
59990
|
+
);
|
|
59991
|
+
return item2 ? assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE_2D, {
|
|
59992
|
+
...item2,
|
|
59993
|
+
childInitRowLen: 1 * ((fixedTableLenMap?.[item2.colSubFieldKey] ?? 0) + 1)
|
|
59994
|
+
}) : assignWidgetInfo(MobileFillTypeEnum.FIXED_TABLE, {
|
|
59995
|
+
rowSubFieldKey: tdProps.fixedTableFieldId
|
|
59996
|
+
});
|
|
59997
|
+
}
|
|
59998
|
+
if (tdProps.isNewCheckTable2D) {
|
|
59999
|
+
const item2 = checkTable2DList.find(
|
|
60000
|
+
(i2) => i2.checkTable2d && (i2.colSubFieldKey === tdProps.fixedTableFieldId || i2.rowSubFieldKey === tdProps.fixedTableFieldId)
|
|
60001
|
+
);
|
|
60002
|
+
if (item2) {
|
|
60003
|
+
return assignWidgetInfo(MobileFillTypeEnum.CHECK_TABLE_2D, item2);
|
|
60004
|
+
}
|
|
60005
|
+
}
|
|
60006
|
+
return assignWidgetInfo(MobileFillTypeEnum.MAIN_FIELD, { rowSubFieldKey: "gct_mobile_main" });
|
|
60007
|
+
}
|
|
60008
|
+
const subTableFieldId = widgetCenter?.[preLocation]?.props?.field;
|
|
60009
|
+
if (!subTableFieldId) return;
|
|
60010
|
+
const item = subTable2DList.find((i2) => i2.subTable2d && i2.rowSubFieldKey === subTableFieldId);
|
|
60011
|
+
return item ? assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE_2D, {
|
|
60012
|
+
...item,
|
|
60013
|
+
childInitRowLen: 1 * ((fixedTableLenMap?.[item.colSubFieldKey] ?? 0) + 1)
|
|
60014
|
+
}) : assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE, { rowSubFieldKey: subTableFieldId });
|
|
60015
|
+
};
|
|
60016
|
+
if (basicInfoItem) {
|
|
60017
|
+
basicInfoItem.mobileSelectTdId = tdInfo.id;
|
|
60018
|
+
const widgetInfo = getWidgetInfo();
|
|
60019
|
+
callback?.(basicInfoItem, widgetInfo);
|
|
60020
|
+
}
|
|
60021
|
+
}
|
|
60022
|
+
function getSubTableQuickFillInfo(subTableFieldId, mobileTdIdGroups) {
|
|
60023
|
+
const getTdIds = (key) => [...mobileTdIdGroups.get(key) || []];
|
|
60024
|
+
const assignWidgetInfo = (fillType, params) => {
|
|
60025
|
+
const { rowSubFieldKey = "", colSubFieldKey = "" } = params;
|
|
60026
|
+
const mainSetKey = rowSubFieldKey !== "gct_mobile_main" ? `gct_mobile_sub.${rowSubFieldKey}` : rowSubFieldKey;
|
|
60027
|
+
const linkSetKey = colSubFieldKey ? `gct_mobile_sub.${colSubFieldKey}` : colSubFieldKey;
|
|
60028
|
+
return {
|
|
60029
|
+
fillType,
|
|
60030
|
+
mainWidgetIds: getTdIds(mainSetKey),
|
|
60031
|
+
linkWidgetIds: getTdIds(linkSetKey),
|
|
60032
|
+
subInfo: params
|
|
60033
|
+
};
|
|
60034
|
+
};
|
|
60035
|
+
if (!subTableFieldId) return;
|
|
60036
|
+
return assignWidgetInfo(MobileFillTypeEnum.SUB_TABLE, { rowSubFieldKey: subTableFieldId });
|
|
60037
|
+
}
|
|
60038
|
+
const isEmptyValue$1 = (value) => {
|
|
60039
|
+
return value === void 0 || value === null || typeof value === "string" && value.trim() === "" || Array.isArray(value) && value.length === 0;
|
|
60040
|
+
};
|
|
60041
|
+
const compareByOp = (left, right, op) => {
|
|
60042
|
+
switch (op) {
|
|
60043
|
+
case RangeCompareOp.LT:
|
|
60044
|
+
return left < right;
|
|
60045
|
+
case RangeCompareOp.LE:
|
|
60046
|
+
return left <= right;
|
|
60047
|
+
case RangeCompareOp.GT:
|
|
60048
|
+
return left > right;
|
|
60049
|
+
case RangeCompareOp.GE:
|
|
60050
|
+
default:
|
|
60051
|
+
return left >= right;
|
|
60052
|
+
}
|
|
60053
|
+
};
|
|
60054
|
+
const rangeCompareMessage = (op, val) => {
|
|
60055
|
+
switch (op) {
|
|
60056
|
+
case RangeCompareOp.LT:
|
|
60057
|
+
return $t("sys.fieldValueNotGreaterOrEqual", { val });
|
|
60058
|
+
case RangeCompareOp.LE:
|
|
60059
|
+
return $t("sys.fieldValueNoMoreThan", { val });
|
|
60060
|
+
case RangeCompareOp.GT:
|
|
60061
|
+
return $t("sys.fieldValueNotLessOrEqual", { val });
|
|
60062
|
+
case RangeCompareOp.GE:
|
|
60063
|
+
default:
|
|
60064
|
+
return $t("sys.fieldValueNotLessThan", { val });
|
|
60065
|
+
}
|
|
60066
|
+
};
|
|
60067
|
+
const toUnixTimestamp = (input) => {
|
|
60068
|
+
if (isNil(input) || input === "") return null;
|
|
60069
|
+
const asNumber = typeof input === "number" || typeof input === "string" && /^-?\d+(\.\d+)?$/.test(input.trim());
|
|
60070
|
+
if (asNumber) {
|
|
60071
|
+
const n = Number(input);
|
|
60072
|
+
if (Number.isNaN(n)) return null;
|
|
60073
|
+
const parsed2 = n > 1e12 ? dayjs(n) : dayjs.unix(n);
|
|
60074
|
+
return parsed2.isValid() ? parsed2.unix() : null;
|
|
60075
|
+
}
|
|
60076
|
+
const parsed = dayjs(input);
|
|
60077
|
+
return parsed.isValid() ? parsed.unix() : null;
|
|
60078
|
+
};
|
|
60079
|
+
const buildError = (validatorInfo, message2) => JSON.stringify({ ...validatorInfo, message: message2 });
|
|
60080
|
+
const createRule = (validator, message2, trigger = "change") => ({
|
|
60081
|
+
required: true,
|
|
60082
|
+
validator,
|
|
60083
|
+
message: message2,
|
|
60084
|
+
trigger
|
|
60085
|
+
});
|
|
60086
|
+
function relocateDeletedRowsToEnd(rows = []) {
|
|
60087
|
+
const active = [];
|
|
60088
|
+
const deleted = [];
|
|
60089
|
+
for (const row of rows) {
|
|
60090
|
+
if (row?.deleted_) deleted.push(row);
|
|
60091
|
+
else active.push(row);
|
|
60092
|
+
}
|
|
60093
|
+
return [...active, ...deleted];
|
|
60094
|
+
}
|
|
60095
|
+
function getCurrentFormData(_rule, options) {
|
|
60096
|
+
if (!_rule._subtableFieldId) return options?.formData;
|
|
60097
|
+
const subTableData = options?.formData?.[_rule._subtableFieldId];
|
|
60098
|
+
if (!isNil(_rule._realRowIndex) && isNil(_rule._childSubTableDataIndex)) {
|
|
60099
|
+
return subTableData?.[_rule._realRowIndex];
|
|
60100
|
+
}
|
|
60101
|
+
if (!isNil(_rule._realRowIndex) && !isNil(_rule._childSubTableDataIndex)) {
|
|
60102
|
+
return subTableData?.[_rule._realRowIndex]?.["_2DTABLE_"]?.[_rule._childSubTableDataIndex];
|
|
60103
|
+
}
|
|
60104
|
+
return options?.formData;
|
|
60105
|
+
}
|
|
60106
|
+
function isSameOptionValue(current, expected) {
|
|
60107
|
+
if (typeof expected === "boolean") {
|
|
60108
|
+
return renderUtils.getBoolValue(current) === expected;
|
|
60109
|
+
}
|
|
60110
|
+
if (current === void 0 || current === null || current === "") {
|
|
60111
|
+
return false;
|
|
60112
|
+
}
|
|
60113
|
+
return String(current) === String(expected);
|
|
60114
|
+
}
|
|
60115
|
+
function resolveAttachContext(rule, metaAttach) {
|
|
60116
|
+
if (metaAttach?.belongFieldId != null && !isNil(metaAttach.optionValue)) {
|
|
60117
|
+
return {
|
|
60118
|
+
_belongFieldId: metaAttach.belongFieldId,
|
|
60119
|
+
_optionValue: metaAttach.optionValue,
|
|
60120
|
+
_multiple: metaAttach.multiple,
|
|
60121
|
+
_subtableFieldId: metaAttach.subtableFieldId,
|
|
60122
|
+
_realRowIndex: metaAttach.realRowIndex,
|
|
60123
|
+
_childSubTableDataIndex: metaAttach.childSubTableDataIndex
|
|
60124
|
+
};
|
|
60125
|
+
}
|
|
60126
|
+
return rule;
|
|
60127
|
+
}
|
|
60128
|
+
function isAttachFieldActive(rule, formData) {
|
|
60129
|
+
if (!rule?._belongFieldId || isNil(rule._optionValue)) {
|
|
60130
|
+
return true;
|
|
60131
|
+
}
|
|
60132
|
+
const row = getCurrentFormData(rule, { formData });
|
|
60133
|
+
if (rule._subtableFieldId && (isNil(rule._realRowIndex) || !row || row === formData)) {
|
|
60134
|
+
return false;
|
|
60135
|
+
}
|
|
60136
|
+
const raw = row?.[rule._belongFieldId];
|
|
60137
|
+
if (rule._multiple) {
|
|
60138
|
+
const current = renderUtils.getValue(raw, true);
|
|
60139
|
+
if (!Array.isArray(current)) return false;
|
|
60140
|
+
return current.some((v) => isSameOptionValue(v, rule._optionValue));
|
|
60141
|
+
}
|
|
60142
|
+
return isSameOptionValue(raw, rule._optionValue);
|
|
60143
|
+
}
|
|
60144
|
+
function isReferenceOptionActive(referenceInfo, rowFormData) {
|
|
60145
|
+
if (!referenceInfo?.belongFieldId || isNil(referenceInfo.optionValue)) {
|
|
60146
|
+
return true;
|
|
60147
|
+
}
|
|
60148
|
+
return isAttachFieldActive(
|
|
60149
|
+
{
|
|
60150
|
+
_belongFieldId: referenceInfo.belongFieldId,
|
|
60151
|
+
_optionValue: referenceInfo.optionValue,
|
|
60152
|
+
_multiple: referenceInfo.multiple
|
|
60153
|
+
},
|
|
60154
|
+
rowFormData
|
|
60155
|
+
);
|
|
60156
|
+
}
|
|
60157
|
+
function filterRulesByTrigger(rules2, trigger) {
|
|
60158
|
+
return rules2.filter((rule) => {
|
|
60159
|
+
const ruleTrigger = rule.trigger;
|
|
60160
|
+
if (!ruleTrigger) return trigger === "change";
|
|
60161
|
+
if (trigger === "blur") {
|
|
60162
|
+
return ruleTrigger === "blur" || ruleTrigger === "change";
|
|
60163
|
+
}
|
|
60164
|
+
return ruleTrigger === trigger;
|
|
60165
|
+
});
|
|
60166
|
+
}
|
|
60167
|
+
function assembleRules(input) {
|
|
60168
|
+
const { showRequired, fieldType, validatorInfo, props } = input;
|
|
60169
|
+
const {
|
|
60170
|
+
minlength,
|
|
60171
|
+
maxlength,
|
|
60172
|
+
regex,
|
|
60173
|
+
regexHint,
|
|
60174
|
+
validateTrue,
|
|
60175
|
+
validateFalse,
|
|
60176
|
+
enableRangeValidate,
|
|
60177
|
+
maxValidateMode,
|
|
60178
|
+
minValidateMode,
|
|
60179
|
+
maxCompareOp,
|
|
60180
|
+
minCompareOp,
|
|
60181
|
+
minValue,
|
|
60182
|
+
maxValue,
|
|
60183
|
+
minFormulaExpr,
|
|
60184
|
+
maxFormulaExpr,
|
|
60185
|
+
minDate,
|
|
60186
|
+
maxDate,
|
|
60187
|
+
minDateFormulaExpr,
|
|
60188
|
+
maxDateFormulaExpr,
|
|
60189
|
+
maxDateValidateMode,
|
|
60190
|
+
minDateValidateMode
|
|
60191
|
+
} = props;
|
|
60192
|
+
const resolvedMaxCompareOp = maxCompareOp ?? RangeCompareOp.LE;
|
|
60193
|
+
const resolvedMinCompareOp = minCompareOp ?? RangeCompareOp.GE;
|
|
60194
|
+
const RuleProps = [];
|
|
60195
|
+
if (showRequired) {
|
|
60196
|
+
RuleProps.push(
|
|
60197
|
+
createRule(
|
|
60198
|
+
(_rule, value) => !isEmptyValue$1(value),
|
|
60199
|
+
buildError(validatorInfo, $t("sys.fieldRequired")),
|
|
60200
|
+
"manual"
|
|
60201
|
+
)
|
|
60202
|
+
);
|
|
60203
|
+
}
|
|
60204
|
+
if (!isNil(minlength)) {
|
|
60205
|
+
RuleProps.push(
|
|
60206
|
+
createRule((_rule, value) => {
|
|
60207
|
+
if (isEmptyValue$1(value)) return true;
|
|
60208
|
+
return String(value).length >= minlength;
|
|
60209
|
+
}, buildError(validatorInfo, $t("sys.fieldLengthNotLessThan", { len: minlength })))
|
|
60210
|
+
);
|
|
60211
|
+
}
|
|
60212
|
+
if (!isNil(maxlength)) {
|
|
60213
|
+
RuleProps.push(
|
|
60214
|
+
createRule((_rule, value) => {
|
|
60215
|
+
if (isEmptyValue$1(value)) return true;
|
|
60216
|
+
return String(value).length <= maxlength;
|
|
60217
|
+
}, buildError(validatorInfo, $t("sys.fieldLengthNoMoreThan", { len: maxlength })))
|
|
60218
|
+
);
|
|
60219
|
+
}
|
|
60220
|
+
if (regex) {
|
|
60221
|
+
RuleProps.push(
|
|
60222
|
+
createRule((_rule, value) => {
|
|
60223
|
+
if (isEmptyValue$1(value)) return true;
|
|
60224
|
+
return new RegExp(regex).test(value);
|
|
60225
|
+
}, buildError(validatorInfo, regexHint ?? $t("sys.fieldFormatError")))
|
|
60226
|
+
);
|
|
60227
|
+
}
|
|
60228
|
+
if (validateTrue) {
|
|
60229
|
+
RuleProps.push({
|
|
60230
|
+
required: true,
|
|
60231
|
+
trigger: "manual",
|
|
60232
|
+
validator: (_rule, value) => value === true,
|
|
60233
|
+
message: buildError(validatorInfo, $t("sys.fieldValueNeedTrue"))
|
|
60234
|
+
});
|
|
60235
|
+
}
|
|
60236
|
+
if (validateFalse) {
|
|
60237
|
+
RuleProps.push({
|
|
60238
|
+
required: true,
|
|
60239
|
+
trigger: "manual",
|
|
60240
|
+
validator: (_rule, value) => value === false,
|
|
60241
|
+
message: buildError(validatorInfo, $t("sys.fieldValueNeedFalse"))
|
|
60242
|
+
});
|
|
60243
|
+
}
|
|
60244
|
+
if (!enableRangeValidate) {
|
|
60245
|
+
return RuleProps;
|
|
60246
|
+
}
|
|
60247
|
+
if (minValidateMode === RangeValidateMode.Fixed_Number) {
|
|
60248
|
+
RuleProps.push(
|
|
60249
|
+
createRule((_rule, value) => {
|
|
60250
|
+
if (isEmptyValue$1(value)) return true;
|
|
60251
|
+
return compareByOp(Number(value), Number(minValue), resolvedMinCompareOp);
|
|
60252
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, minValue)))
|
|
60253
|
+
);
|
|
60254
|
+
}
|
|
60255
|
+
if (minValidateMode === RangeValidateMode.Variable_Validate && minFormulaExpr) {
|
|
60256
|
+
RuleProps.push({
|
|
60257
|
+
required: true,
|
|
60258
|
+
trigger: "change",
|
|
60259
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60260
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60261
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60262
|
+
const formulaValue = await calculateFormula2(
|
|
60263
|
+
minFormulaExpr,
|
|
60264
|
+
currentFormData,
|
|
60265
|
+
options?.formData
|
|
60266
|
+
);
|
|
60267
|
+
const parsedMin = parseFloat(formulaValue);
|
|
60268
|
+
if (!isNaN(parsedMin)) {
|
|
60269
|
+
if (isEmptyValue$1(value)) {
|
|
60270
|
+
return Promise.resolve();
|
|
60271
|
+
}
|
|
60272
|
+
if (!compareByOp(Number(value), parsedMin, resolvedMinCompareOp)) {
|
|
60273
|
+
return Promise.reject(
|
|
60274
|
+
new Error(
|
|
60275
|
+
buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, parsedMin))
|
|
60276
|
+
)
|
|
60277
|
+
);
|
|
60278
|
+
}
|
|
60279
|
+
}
|
|
60280
|
+
return Promise.resolve();
|
|
60281
|
+
}
|
|
60282
|
+
});
|
|
60283
|
+
}
|
|
60284
|
+
if (maxValidateMode === RangeValidateMode.Fixed_Number) {
|
|
60285
|
+
RuleProps.push(
|
|
60286
|
+
createRule((_rule, value) => {
|
|
60287
|
+
if (isEmptyValue$1(value)) return true;
|
|
60288
|
+
return compareByOp(Number(value), Number(maxValue), resolvedMaxCompareOp);
|
|
60289
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, maxValue)))
|
|
60290
|
+
);
|
|
60291
|
+
}
|
|
60292
|
+
if (maxValidateMode === RangeValidateMode.Variable_Validate && maxFormulaExpr) {
|
|
60293
|
+
RuleProps.push({
|
|
60294
|
+
required: true,
|
|
60295
|
+
trigger: "change",
|
|
60296
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60297
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60298
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60299
|
+
const formulaValue = await calculateFormula2(
|
|
60300
|
+
maxFormulaExpr,
|
|
60301
|
+
currentFormData,
|
|
60302
|
+
options?.formData
|
|
60303
|
+
);
|
|
60304
|
+
const parsedMax = parseFloat(formulaValue);
|
|
60305
|
+
if (!isNaN(parsedMax)) {
|
|
60306
|
+
if (isEmptyValue$1(value)) {
|
|
60307
|
+
return Promise.resolve();
|
|
60308
|
+
}
|
|
60309
|
+
if (!compareByOp(Number(value), parsedMax, resolvedMaxCompareOp)) {
|
|
60310
|
+
return Promise.reject(
|
|
60311
|
+
new Error(
|
|
60312
|
+
buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, parsedMax))
|
|
60313
|
+
)
|
|
60314
|
+
);
|
|
60315
|
+
}
|
|
60316
|
+
}
|
|
60317
|
+
return Promise.resolve();
|
|
60318
|
+
}
|
|
60319
|
+
});
|
|
60320
|
+
}
|
|
60321
|
+
if (minDateValidateMode === RangeValidateMode.Fixed_Number && minDate) {
|
|
60322
|
+
RuleProps.push(
|
|
60323
|
+
createRule((_rule, value) => {
|
|
60324
|
+
if (isEmptyValue$1(value)) return true;
|
|
60325
|
+
const inputTime = dayjs(value).unix();
|
|
60326
|
+
const minTimestamp = dayjs(minDate).unix();
|
|
60327
|
+
if (!dayjs(value).isValid() || !dayjs(minDate).isValid()) return true;
|
|
60328
|
+
return compareByOp(inputTime, minTimestamp, resolvedMinCompareOp);
|
|
60329
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMinCompareOp, minDate)))
|
|
60330
|
+
);
|
|
60331
|
+
}
|
|
60332
|
+
if (maxDateValidateMode === RangeValidateMode.Fixed_Number && maxDate) {
|
|
60333
|
+
RuleProps.push(
|
|
60334
|
+
createRule((_rule, value) => {
|
|
60335
|
+
if (isEmptyValue$1(value)) return true;
|
|
60336
|
+
const inputTime = dayjs(value).unix();
|
|
60337
|
+
const maxTimestamp = dayjs(maxDate).unix();
|
|
60338
|
+
if (!dayjs(value).isValid() || !dayjs(maxDate).isValid()) return true;
|
|
60339
|
+
return compareByOp(inputTime, maxTimestamp, resolvedMaxCompareOp);
|
|
60340
|
+
}, buildError(validatorInfo, rangeCompareMessage(resolvedMaxCompareOp, maxDate)))
|
|
60341
|
+
);
|
|
60342
|
+
}
|
|
60343
|
+
if (minDateValidateMode === RangeValidateMode.Variable_Validate && minDateFormulaExpr) {
|
|
60344
|
+
RuleProps.push({
|
|
60345
|
+
required: true,
|
|
60346
|
+
trigger: "change",
|
|
60347
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60348
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60349
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60350
|
+
const formulaValue = await calculateFormula2(
|
|
60351
|
+
minDateFormulaExpr,
|
|
60352
|
+
currentFormData,
|
|
60353
|
+
options?.formData
|
|
60354
|
+
);
|
|
60355
|
+
const limitTime = toUnixTimestamp(formulaValue);
|
|
60356
|
+
if (limitTime !== null) {
|
|
60357
|
+
if (isEmptyValue$1(value)) {
|
|
60358
|
+
return Promise.resolve();
|
|
60359
|
+
}
|
|
60360
|
+
if (!dayjs(value).isValid()) {
|
|
60361
|
+
return Promise.resolve();
|
|
60362
|
+
}
|
|
60363
|
+
const inputTime = dayjs(value).unix();
|
|
60364
|
+
const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
60365
|
+
if (!compareByOp(inputTime, limitTime, resolvedMinCompareOp)) {
|
|
60366
|
+
return Promise.reject(
|
|
60367
|
+
new Error(
|
|
60368
|
+
buildError(
|
|
60369
|
+
validatorInfo,
|
|
60370
|
+
rangeCompareMessage(resolvedMinCompareOp, dayjs.unix(limitTime).format(fmt))
|
|
60371
|
+
)
|
|
60372
|
+
)
|
|
60373
|
+
);
|
|
60374
|
+
}
|
|
60375
|
+
}
|
|
60376
|
+
return Promise.resolve();
|
|
60377
|
+
}
|
|
60378
|
+
});
|
|
60379
|
+
}
|
|
60380
|
+
if (maxDateValidateMode === RangeValidateMode.Variable_Validate && maxDateFormulaExpr) {
|
|
60381
|
+
RuleProps.push({
|
|
60382
|
+
required: true,
|
|
60383
|
+
trigger: "change",
|
|
60384
|
+
validator: async (_rule, value, _callback, _source, options) => {
|
|
60385
|
+
const { calculateFormula: calculateFormula2 } = useCalculateFormula();
|
|
60386
|
+
const currentFormData = getCurrentFormData(_rule, options);
|
|
60387
|
+
const formulaValue = await calculateFormula2(
|
|
60388
|
+
maxDateFormulaExpr,
|
|
60389
|
+
currentFormData,
|
|
60390
|
+
options?.formData
|
|
60391
|
+
);
|
|
60392
|
+
const limitTime = toUnixTimestamp(formulaValue);
|
|
60393
|
+
if (limitTime !== null) {
|
|
60394
|
+
if (isEmptyValue$1(value)) {
|
|
60395
|
+
return Promise.resolve();
|
|
60396
|
+
}
|
|
60397
|
+
if (!dayjs(value).isValid()) {
|
|
60398
|
+
return Promise.resolve();
|
|
60399
|
+
}
|
|
60400
|
+
const inputTime = dayjs(value).unix();
|
|
60401
|
+
const fmt = fieldType === FIELD_TYPE.DATE_TIME ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
60402
|
+
if (!compareByOp(inputTime, limitTime, resolvedMaxCompareOp)) {
|
|
60403
|
+
return Promise.reject(
|
|
60404
|
+
new Error(
|
|
60405
|
+
buildError(
|
|
60406
|
+
validatorInfo,
|
|
60407
|
+
rangeCompareMessage(resolvedMaxCompareOp, dayjs.unix(limitTime).format(fmt))
|
|
60408
|
+
)
|
|
60409
|
+
)
|
|
60410
|
+
);
|
|
60411
|
+
}
|
|
60412
|
+
}
|
|
60413
|
+
return Promise.resolve();
|
|
60414
|
+
}
|
|
60415
|
+
});
|
|
60416
|
+
}
|
|
60417
|
+
return RuleProps;
|
|
60418
|
+
}
|
|
60419
|
+
const formRules = ref({});
|
|
60420
|
+
const formRuleMeta = ref({});
|
|
60421
|
+
const formRuleOwner = /* @__PURE__ */ new Map();
|
|
60422
|
+
function setFormRule(key, rules2, meta, owner) {
|
|
60423
|
+
formRules.value[key] = rules2;
|
|
60424
|
+
formRuleMeta.value[key] = meta;
|
|
60425
|
+
if (owner !== void 0) formRuleOwner.set(key, owner);
|
|
60426
|
+
}
|
|
60427
|
+
function deleteFormRule(key, owner) {
|
|
60428
|
+
if (owner !== void 0 && formRuleOwner.get(key) !== owner) {
|
|
60429
|
+
return;
|
|
60430
|
+
}
|
|
60431
|
+
delete formRules.value[key];
|
|
60432
|
+
delete formRuleMeta.value[key];
|
|
60433
|
+
formRuleOwner.delete(key);
|
|
60434
|
+
}
|
|
60435
|
+
function clearFormRules$1() {
|
|
60436
|
+
formRules.value = {};
|
|
60437
|
+
formRuleMeta.value = {};
|
|
60438
|
+
formRuleOwner.clear();
|
|
60439
|
+
}
|
|
60440
|
+
function getRawFormRules() {
|
|
60441
|
+
return toRaw(formRules.value);
|
|
60442
|
+
}
|
|
60443
|
+
function getRawFormRuleMeta() {
|
|
60444
|
+
return toRaw(formRuleMeta.value);
|
|
60445
|
+
}
|
|
60446
|
+
function listFormRuleKeys() {
|
|
60447
|
+
return Object.keys(formRules.value);
|
|
60448
|
+
}
|
|
60449
|
+
function deleteSubtableRow$1(subtableFieldId, realRowIndex) {
|
|
60450
|
+
const newFormRules = {};
|
|
60451
|
+
const newFormRuleMeta = {};
|
|
60452
|
+
const newFormRuleOwner = /* @__PURE__ */ new Map();
|
|
60453
|
+
for (const key in formRules.value) {
|
|
60454
|
+
const regex = new RegExp(`^${subtableFieldId}_(\\d+)_`);
|
|
60455
|
+
const match = key.match(regex);
|
|
60456
|
+
if (match) {
|
|
60457
|
+
const rowIndex = parseInt(match[1], 10);
|
|
60458
|
+
if (rowIndex < realRowIndex) {
|
|
60459
|
+
newFormRules[key] = formRules.value[key];
|
|
60460
|
+
if (formRuleMeta.value[key]) {
|
|
60461
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60462
|
+
}
|
|
60463
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60464
|
+
} else if (rowIndex > realRowIndex) {
|
|
60465
|
+
const newKey = key.replace(
|
|
60466
|
+
`${subtableFieldId}_${rowIndex}_`,
|
|
60467
|
+
`${subtableFieldId}_${rowIndex - 1}_`
|
|
60468
|
+
);
|
|
60469
|
+
newFormRules[newKey] = formRules.value[key];
|
|
60470
|
+
if (formRuleMeta.value[key]) {
|
|
60471
|
+
newFormRuleMeta[newKey] = formRuleMeta.value[key];
|
|
60472
|
+
}
|
|
60473
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(newKey, formRuleOwner.get(key));
|
|
60474
|
+
}
|
|
60475
|
+
} else {
|
|
60476
|
+
newFormRules[key] = formRules.value[key];
|
|
60477
|
+
if (formRuleMeta.value[key]) {
|
|
60478
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60479
|
+
}
|
|
60480
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60481
|
+
}
|
|
60482
|
+
}
|
|
60483
|
+
formRules.value = newFormRules;
|
|
60484
|
+
formRuleMeta.value = newFormRuleMeta;
|
|
60485
|
+
formRuleOwner.clear();
|
|
60486
|
+
for (const [k, v] of newFormRuleOwner) formRuleOwner.set(k, v);
|
|
60487
|
+
}
|
|
60488
|
+
function insertSubtableRows$1(subtableFieldId, insertIndex, count = 1) {
|
|
60489
|
+
if (count <= 0) return;
|
|
60490
|
+
const newFormRules = {};
|
|
60491
|
+
const newFormRuleMeta = {};
|
|
60492
|
+
const newFormRuleOwner = /* @__PURE__ */ new Map();
|
|
60493
|
+
const regex = new RegExp(`^${subtableFieldId}_(\\d+)_`);
|
|
60494
|
+
const entries = Object.keys(formRules.value).map((key) => {
|
|
60495
|
+
const match = key.match(regex);
|
|
60496
|
+
return {
|
|
60497
|
+
key,
|
|
60498
|
+
rowIndex: match ? parseInt(match[1], 10) : -1
|
|
60499
|
+
};
|
|
60500
|
+
});
|
|
60501
|
+
entries.sort((a, b) => b.rowIndex - a.rowIndex).forEach(({ key, rowIndex }) => {
|
|
60502
|
+
if (rowIndex < 0) {
|
|
60503
|
+
newFormRules[key] = formRules.value[key];
|
|
60504
|
+
if (formRuleMeta.value[key]) {
|
|
60505
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60506
|
+
}
|
|
60507
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60508
|
+
return;
|
|
60509
|
+
}
|
|
60510
|
+
if (rowIndex < insertIndex) {
|
|
60511
|
+
newFormRules[key] = formRules.value[key];
|
|
60512
|
+
if (formRuleMeta.value[key]) {
|
|
60513
|
+
newFormRuleMeta[key] = formRuleMeta.value[key];
|
|
60514
|
+
}
|
|
60515
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(key, formRuleOwner.get(key));
|
|
60516
|
+
return;
|
|
60517
|
+
}
|
|
60518
|
+
const newKey = key.replace(
|
|
60519
|
+
`${subtableFieldId}_${rowIndex}_`,
|
|
60520
|
+
`${subtableFieldId}_${rowIndex + count}_`
|
|
60521
|
+
);
|
|
60522
|
+
newFormRules[newKey] = formRules.value[key];
|
|
60523
|
+
if (formRuleMeta.value[key]) {
|
|
60524
|
+
newFormRuleMeta[newKey] = formRuleMeta.value[key];
|
|
60525
|
+
}
|
|
60526
|
+
if (formRuleOwner.has(key)) newFormRuleOwner.set(newKey, formRuleOwner.get(key));
|
|
60527
|
+
});
|
|
60528
|
+
formRules.value = newFormRules;
|
|
60529
|
+
formRuleMeta.value = newFormRuleMeta;
|
|
60530
|
+
formRuleOwner.clear();
|
|
60531
|
+
for (const [k, v] of newFormRuleOwner) formRuleOwner.set(k, v);
|
|
60532
|
+
}
|
|
60533
|
+
function _extends() {
|
|
60534
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
60535
|
+
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
60536
|
+
var source = arguments[i2];
|
|
60537
|
+
for (var key in source) {
|
|
60538
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
60539
|
+
target[key] = source[key];
|
|
60540
|
+
}
|
|
60541
|
+
}
|
|
60542
|
+
}
|
|
60543
|
+
return target;
|
|
60544
|
+
};
|
|
60545
|
+
return _extends.apply(this, arguments);
|
|
60546
|
+
}
|
|
60547
|
+
function _inheritsLoose(subClass, superClass) {
|
|
60548
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
60549
|
+
subClass.prototype.constructor = subClass;
|
|
60550
|
+
_setPrototypeOf(subClass, superClass);
|
|
60551
|
+
}
|
|
60552
|
+
function _getPrototypeOf(o) {
|
|
60553
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
|
|
60554
|
+
return o2.__proto__ || Object.getPrototypeOf(o2);
|
|
60555
|
+
};
|
|
60556
|
+
return _getPrototypeOf(o);
|
|
60557
|
+
}
|
|
60558
|
+
function _setPrototypeOf(o, p2) {
|
|
60559
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p3) {
|
|
60560
|
+
o2.__proto__ = p3;
|
|
60561
|
+
return o2;
|
|
60562
|
+
};
|
|
60563
|
+
return _setPrototypeOf(o, p2);
|
|
60564
|
+
}
|
|
60565
|
+
function _isNativeReflectConstruct() {
|
|
60566
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
60567
|
+
if (Reflect.construct.sham) return false;
|
|
60568
|
+
if (typeof Proxy === "function") return true;
|
|
60569
|
+
try {
|
|
60570
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
60571
|
+
}));
|
|
60572
|
+
return true;
|
|
60573
|
+
} catch (e) {
|
|
60574
|
+
return false;
|
|
60575
|
+
}
|
|
60576
|
+
}
|
|
60577
|
+
function _construct(Parent, args, Class) {
|
|
60578
|
+
if (_isNativeReflectConstruct()) {
|
|
60579
|
+
_construct = Reflect.construct.bind();
|
|
60580
|
+
} else {
|
|
60581
|
+
_construct = function _construct2(Parent2, args2, Class2) {
|
|
60582
|
+
var a = [null];
|
|
60583
|
+
a.push.apply(a, args2);
|
|
60584
|
+
var Constructor = Function.bind.apply(Parent2, a);
|
|
60585
|
+
var instance = new Constructor();
|
|
60586
|
+
if (Class2) _setPrototypeOf(instance, Class2.prototype);
|
|
60587
|
+
return instance;
|
|
60588
|
+
};
|
|
60589
|
+
}
|
|
60590
|
+
return _construct.apply(null, arguments);
|
|
60591
|
+
}
|
|
60592
|
+
function _isNativeFunction(fn) {
|
|
60593
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
60594
|
+
}
|
|
60595
|
+
function _wrapNativeSuper(Class) {
|
|
60596
|
+
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
60597
|
+
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
|
|
60598
|
+
if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
|
|
60599
|
+
if (typeof Class2 !== "function") {
|
|
60600
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
60601
|
+
}
|
|
60602
|
+
if (typeof _cache !== "undefined") {
|
|
60603
|
+
if (_cache.has(Class2)) return _cache.get(Class2);
|
|
60604
|
+
_cache.set(Class2, Wrapper);
|
|
60605
|
+
}
|
|
60606
|
+
function Wrapper() {
|
|
60607
|
+
return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
|
|
60608
|
+
}
|
|
60609
|
+
Wrapper.prototype = Object.create(Class2.prototype, {
|
|
60610
|
+
constructor: {
|
|
60611
|
+
value: Wrapper,
|
|
60612
|
+
enumerable: false,
|
|
60613
|
+
writable: true,
|
|
60614
|
+
configurable: true
|
|
60615
|
+
}
|
|
60616
|
+
});
|
|
60617
|
+
return _setPrototypeOf(Wrapper, Class2);
|
|
60618
|
+
};
|
|
60619
|
+
return _wrapNativeSuper(Class);
|
|
60620
|
+
}
|
|
60621
|
+
var formatRegExp = /%[sdj%]/g;
|
|
60622
|
+
var warning = function warning2() {
|
|
60623
|
+
};
|
|
60624
|
+
if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" && typeof window !== "undefined" && typeof document !== "undefined") {
|
|
60625
|
+
warning = function warning3(type4, errors) {
|
|
60626
|
+
if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
|
|
60627
|
+
if (errors.every(function(e) {
|
|
60628
|
+
return typeof e === "string";
|
|
60629
|
+
})) {
|
|
60630
|
+
console.warn(type4, errors);
|
|
60631
|
+
}
|
|
60632
|
+
}
|
|
60633
|
+
};
|
|
60634
|
+
}
|
|
60635
|
+
function convertFieldsError(errors) {
|
|
60636
|
+
if (!errors || !errors.length) return null;
|
|
60637
|
+
var fields = {};
|
|
60638
|
+
errors.forEach(function(error) {
|
|
60639
|
+
var field = error.field;
|
|
60640
|
+
fields[field] = fields[field] || [];
|
|
60641
|
+
fields[field].push(error);
|
|
60642
|
+
});
|
|
60643
|
+
return fields;
|
|
60644
|
+
}
|
|
60645
|
+
function format(template) {
|
|
60646
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
60647
|
+
args[_key - 1] = arguments[_key];
|
|
60648
|
+
}
|
|
60649
|
+
var i2 = 0;
|
|
60650
|
+
var len = args.length;
|
|
60651
|
+
if (typeof template === "function") {
|
|
60652
|
+
return template.apply(null, args);
|
|
60653
|
+
}
|
|
60654
|
+
if (typeof template === "string") {
|
|
60655
|
+
var str = template.replace(formatRegExp, function(x) {
|
|
60656
|
+
if (x === "%%") {
|
|
60657
|
+
return "%";
|
|
60658
|
+
}
|
|
60659
|
+
if (i2 >= len) {
|
|
60660
|
+
return x;
|
|
60661
|
+
}
|
|
60662
|
+
switch (x) {
|
|
60663
|
+
case "%s":
|
|
60664
|
+
return String(args[i2++]);
|
|
60665
|
+
case "%d":
|
|
60666
|
+
return Number(args[i2++]);
|
|
60667
|
+
case "%j":
|
|
60668
|
+
try {
|
|
60669
|
+
return JSON.stringify(args[i2++]);
|
|
60670
|
+
} catch (_) {
|
|
60671
|
+
return "[Circular]";
|
|
60672
|
+
}
|
|
60673
|
+
break;
|
|
60674
|
+
default:
|
|
60675
|
+
return x;
|
|
60676
|
+
}
|
|
60677
|
+
});
|
|
60678
|
+
return str;
|
|
60679
|
+
}
|
|
60680
|
+
return template;
|
|
60681
|
+
}
|
|
60682
|
+
function isNativeStringType(type4) {
|
|
60683
|
+
return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
|
|
60684
|
+
}
|
|
60685
|
+
function isEmptyValue(value, type4) {
|
|
60686
|
+
if (value === void 0 || value === null) {
|
|
60687
|
+
return true;
|
|
60688
|
+
}
|
|
60689
|
+
if (type4 === "array" && Array.isArray(value) && !value.length) {
|
|
60690
|
+
return true;
|
|
60691
|
+
}
|
|
60692
|
+
if (isNativeStringType(type4) && typeof value === "string" && !value) {
|
|
60693
|
+
return true;
|
|
60694
|
+
}
|
|
60695
|
+
return false;
|
|
60696
|
+
}
|
|
60697
|
+
function asyncParallelArray(arr, func, callback) {
|
|
60698
|
+
var results = [];
|
|
60699
|
+
var total = 0;
|
|
60700
|
+
var arrLength = arr.length;
|
|
60701
|
+
function count(errors) {
|
|
60702
|
+
results.push.apply(results, errors || []);
|
|
60703
|
+
total++;
|
|
60704
|
+
if (total === arrLength) {
|
|
60705
|
+
callback(results);
|
|
60706
|
+
}
|
|
60707
|
+
}
|
|
60708
|
+
arr.forEach(function(a) {
|
|
60709
|
+
func(a, count);
|
|
60710
|
+
});
|
|
60711
|
+
}
|
|
60712
|
+
function asyncSerialArray(arr, func, callback) {
|
|
60713
|
+
var index2 = 0;
|
|
60714
|
+
var arrLength = arr.length;
|
|
60715
|
+
function next(errors) {
|
|
60716
|
+
if (errors && errors.length) {
|
|
60717
|
+
callback(errors);
|
|
60718
|
+
return;
|
|
60719
|
+
}
|
|
60720
|
+
var original = index2;
|
|
60721
|
+
index2 = index2 + 1;
|
|
59663
60722
|
if (original < arrLength) {
|
|
59664
60723
|
func(arr[original], next);
|
|
59665
60724
|
} else {
|
|
@@ -59967,8 +61026,8 @@ var rules = {
|
|
|
59967
61026
|
};
|
|
59968
61027
|
var string = function string2(rule, value, callback, source, options) {
|
|
59969
61028
|
var errors = [];
|
|
59970
|
-
var
|
|
59971
|
-
if (
|
|
61029
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61030
|
+
if (validate) {
|
|
59972
61031
|
if (isEmptyValue(value, "string") && !rule.required) {
|
|
59973
61032
|
return callback();
|
|
59974
61033
|
}
|
|
@@ -59986,8 +61045,8 @@ var string = function string2(rule, value, callback, source, options) {
|
|
|
59986
61045
|
};
|
|
59987
61046
|
var method2 = function method3(rule, value, callback, source, options) {
|
|
59988
61047
|
var errors = [];
|
|
59989
|
-
var
|
|
59990
|
-
if (
|
|
61048
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61049
|
+
if (validate) {
|
|
59991
61050
|
if (isEmptyValue(value) && !rule.required) {
|
|
59992
61051
|
return callback();
|
|
59993
61052
|
}
|
|
@@ -60000,8 +61059,8 @@ var method2 = function method3(rule, value, callback, source, options) {
|
|
|
60000
61059
|
};
|
|
60001
61060
|
var number2 = function number3(rule, value, callback, source, options) {
|
|
60002
61061
|
var errors = [];
|
|
60003
|
-
var
|
|
60004
|
-
if (
|
|
61062
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61063
|
+
if (validate) {
|
|
60005
61064
|
if (value === "") {
|
|
60006
61065
|
value = void 0;
|
|
60007
61066
|
}
|
|
@@ -60018,8 +61077,8 @@ var number2 = function number3(rule, value, callback, source, options) {
|
|
|
60018
61077
|
};
|
|
60019
61078
|
var _boolean = function _boolean2(rule, value, callback, source, options) {
|
|
60020
61079
|
var errors = [];
|
|
60021
|
-
var
|
|
60022
|
-
if (
|
|
61080
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61081
|
+
if (validate) {
|
|
60023
61082
|
if (isEmptyValue(value) && !rule.required) {
|
|
60024
61083
|
return callback();
|
|
60025
61084
|
}
|
|
@@ -60032,8 +61091,8 @@ var _boolean = function _boolean2(rule, value, callback, source, options) {
|
|
|
60032
61091
|
};
|
|
60033
61092
|
var regexp2 = function regexp3(rule, value, callback, source, options) {
|
|
60034
61093
|
var errors = [];
|
|
60035
|
-
var
|
|
60036
|
-
if (
|
|
61094
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61095
|
+
if (validate) {
|
|
60037
61096
|
if (isEmptyValue(value) && !rule.required) {
|
|
60038
61097
|
return callback();
|
|
60039
61098
|
}
|
|
@@ -60046,8 +61105,8 @@ var regexp2 = function regexp3(rule, value, callback, source, options) {
|
|
|
60046
61105
|
};
|
|
60047
61106
|
var integer2 = function integer3(rule, value, callback, source, options) {
|
|
60048
61107
|
var errors = [];
|
|
60049
|
-
var
|
|
60050
|
-
if (
|
|
61108
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61109
|
+
if (validate) {
|
|
60051
61110
|
if (isEmptyValue(value) && !rule.required) {
|
|
60052
61111
|
return callback();
|
|
60053
61112
|
}
|
|
@@ -60061,8 +61120,8 @@ var integer2 = function integer3(rule, value, callback, source, options) {
|
|
|
60061
61120
|
};
|
|
60062
61121
|
var floatFn = function floatFn2(rule, value, callback, source, options) {
|
|
60063
61122
|
var errors = [];
|
|
60064
|
-
var
|
|
60065
|
-
if (
|
|
61123
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61124
|
+
if (validate) {
|
|
60066
61125
|
if (isEmptyValue(value) && !rule.required) {
|
|
60067
61126
|
return callback();
|
|
60068
61127
|
}
|
|
@@ -60076,8 +61135,8 @@ var floatFn = function floatFn2(rule, value, callback, source, options) {
|
|
|
60076
61135
|
};
|
|
60077
61136
|
var array2 = function array3(rule, value, callback, source, options) {
|
|
60078
61137
|
var errors = [];
|
|
60079
|
-
var
|
|
60080
|
-
if (
|
|
61138
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61139
|
+
if (validate) {
|
|
60081
61140
|
if ((value === void 0 || value === null) && !rule.required) {
|
|
60082
61141
|
return callback();
|
|
60083
61142
|
}
|
|
@@ -60091,8 +61150,8 @@ var array2 = function array3(rule, value, callback, source, options) {
|
|
|
60091
61150
|
};
|
|
60092
61151
|
var object2 = function object3(rule, value, callback, source, options) {
|
|
60093
61152
|
var errors = [];
|
|
60094
|
-
var
|
|
60095
|
-
if (
|
|
61153
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61154
|
+
if (validate) {
|
|
60096
61155
|
if (isEmptyValue(value) && !rule.required) {
|
|
60097
61156
|
return callback();
|
|
60098
61157
|
}
|
|
@@ -60106,8 +61165,8 @@ var object2 = function object3(rule, value, callback, source, options) {
|
|
|
60106
61165
|
var ENUM = "enum";
|
|
60107
61166
|
var enumerable2 = function enumerable3(rule, value, callback, source, options) {
|
|
60108
61167
|
var errors = [];
|
|
60109
|
-
var
|
|
60110
|
-
if (
|
|
61168
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61169
|
+
if (validate) {
|
|
60111
61170
|
if (isEmptyValue(value) && !rule.required) {
|
|
60112
61171
|
return callback();
|
|
60113
61172
|
}
|
|
@@ -60120,8 +61179,8 @@ var enumerable2 = function enumerable3(rule, value, callback, source, options) {
|
|
|
60120
61179
|
};
|
|
60121
61180
|
var pattern2 = function pattern3(rule, value, callback, source, options) {
|
|
60122
61181
|
var errors = [];
|
|
60123
|
-
var
|
|
60124
|
-
if (
|
|
61182
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61183
|
+
if (validate) {
|
|
60125
61184
|
if (isEmptyValue(value, "string") && !rule.required) {
|
|
60126
61185
|
return callback();
|
|
60127
61186
|
}
|
|
@@ -60134,8 +61193,8 @@ var pattern2 = function pattern3(rule, value, callback, source, options) {
|
|
|
60134
61193
|
};
|
|
60135
61194
|
var date2 = function date3(rule, value, callback, source, options) {
|
|
60136
61195
|
var errors = [];
|
|
60137
|
-
var
|
|
60138
|
-
if (
|
|
61196
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61197
|
+
if (validate) {
|
|
60139
61198
|
if (isEmptyValue(value, "date") && !rule.required) {
|
|
60140
61199
|
return callback();
|
|
60141
61200
|
}
|
|
@@ -60164,8 +61223,8 @@ var required2 = function required3(rule, value, callback, source, options) {
|
|
|
60164
61223
|
var type2 = function type3(rule, value, callback, source, options) {
|
|
60165
61224
|
var ruleType = rule.type;
|
|
60166
61225
|
var errors = [];
|
|
60167
|
-
var
|
|
60168
|
-
if (
|
|
61226
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61227
|
+
if (validate) {
|
|
60169
61228
|
if (isEmptyValue(value, ruleType) && !rule.required) {
|
|
60170
61229
|
return callback();
|
|
60171
61230
|
}
|
|
@@ -60178,8 +61237,8 @@ var type2 = function type3(rule, value, callback, source, options) {
|
|
|
60178
61237
|
};
|
|
60179
61238
|
var any = function any2(rule, value, callback, source, options) {
|
|
60180
61239
|
var errors = [];
|
|
60181
|
-
var
|
|
60182
|
-
if (
|
|
61240
|
+
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
|
|
61241
|
+
if (validate) {
|
|
60183
61242
|
if (isEmptyValue(value) && !rule.required) {
|
|
60184
61243
|
return callback();
|
|
60185
61244
|
}
|
|
@@ -60288,7 +61347,7 @@ var Schema = /* @__PURE__ */ (function() {
|
|
|
60288
61347
|
}
|
|
60289
61348
|
return this._messages;
|
|
60290
61349
|
};
|
|
60291
|
-
_proto.validate = function
|
|
61350
|
+
_proto.validate = function validate(source_, o, oc) {
|
|
60292
61351
|
var _this2 = this;
|
|
60293
61352
|
if (o === void 0) {
|
|
60294
61353
|
o = {};
|
|
@@ -60517,962 +61576,30 @@ Schema.register = function register(type4, validator) {
|
|
|
60517
61576
|
Schema.warning = warning;
|
|
60518
61577
|
Schema.messages = messages;
|
|
60519
61578
|
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;
|
|
61579
|
+
function resolveKeepExceptionHighlight(formValue, fieldValue) {
|
|
61580
|
+
if (typeof fieldValue === "boolean") {
|
|
61581
|
+
return fieldValue;
|
|
60648
61582
|
}
|
|
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
|
-
});
|
|
61583
|
+
if (typeof formValue === "boolean") {
|
|
61584
|
+
return formValue;
|
|
60877
61585
|
}
|
|
61586
|
+
return true;
|
|
60878
61587
|
}
|
|
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
|
-
}
|
|
61588
|
+
function resolveValidationAdmission(input) {
|
|
61589
|
+
if (input.mode === "display") {
|
|
61590
|
+
if (!input.keepExceptionHighlight) return { admit: false };
|
|
61591
|
+
return { admit: true };
|
|
60934
61592
|
}
|
|
61593
|
+
if (input.blocked) return { admit: false };
|
|
61594
|
+
return { admit: true };
|
|
60935
61595
|
}
|
|
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;
|
|
61596
|
+
const flattenFormData = (formData, paper) => {
|
|
61468
61597
|
const subTable2DList = paper.props.subTable2DList ?? [];
|
|
61469
61598
|
const checkTable2DList = paper.props.checkTable2DList ?? [];
|
|
61470
61599
|
const list2D = [].concat(
|
|
61471
61600
|
subTable2DList,
|
|
61472
61601
|
checkTable2DList
|
|
61473
61602
|
);
|
|
61474
|
-
const _formRules_ = toRaw(formRules.value);
|
|
61475
|
-
console.log("_formRules_", _formRules_);
|
|
61476
61603
|
const filterKey = ["_DICT", "_OPCT", "__FOREIGN__", "_2DTABLE_"];
|
|
61477
61604
|
const _formData_ = {};
|
|
61478
61605
|
Object.keys(omit(formData, filterKey)).forEach((key) => {
|
|
@@ -61502,46 +61629,446 @@ const validate = async (formData, paper) => {
|
|
|
61502
61629
|
_formData_[key] = formData[key];
|
|
61503
61630
|
}
|
|
61504
61631
|
});
|
|
61505
|
-
|
|
61506
|
-
|
|
61507
|
-
|
|
61508
|
-
|
|
61509
|
-
|
|
61632
|
+
return _formData_;
|
|
61633
|
+
};
|
|
61634
|
+
function resolveActiveRules(mode, rules2, meta, formKeepExceptionHighlight) {
|
|
61635
|
+
const blocked = !!meta?.blocked;
|
|
61636
|
+
const keepExceptionHighlight = resolveKeepExceptionHighlight(
|
|
61637
|
+
formKeepExceptionHighlight,
|
|
61638
|
+
meta?.keepExceptionHighlight
|
|
61639
|
+
);
|
|
61640
|
+
const decision = resolveValidationAdmission({
|
|
61641
|
+
mode,
|
|
61642
|
+
blocked,
|
|
61643
|
+
keepExceptionHighlight
|
|
61644
|
+
});
|
|
61645
|
+
if (!decision.admit) {
|
|
61646
|
+
return [];
|
|
61647
|
+
}
|
|
61648
|
+
if (mode === "all") return rules2;
|
|
61649
|
+
if (mode === "display") {
|
|
61650
|
+
return blocked ? rules2 : filterRulesByTrigger(rules2, "change");
|
|
61651
|
+
}
|
|
61652
|
+
return filterRulesByTrigger(rules2, mode);
|
|
61653
|
+
}
|
|
61654
|
+
async function runValidation(formData, paper, options = {}) {
|
|
61655
|
+
if (!paper?.props) return;
|
|
61656
|
+
const mode = options.mode ?? "all";
|
|
61657
|
+
const rawRules = getRawFormRules();
|
|
61658
|
+
const rawMeta = getRawFormRuleMeta();
|
|
61659
|
+
const flatData = flattenFormData(formData, paper);
|
|
61660
|
+
const activeRules = {};
|
|
61661
|
+
const editablePaths = [];
|
|
61662
|
+
const livePaths = [];
|
|
61663
|
+
const validatedPaths = [];
|
|
61664
|
+
const ruleKeys = Object.keys(rawRules);
|
|
61665
|
+
for (const key of ruleKeys) {
|
|
61666
|
+
const meta = rawMeta[key];
|
|
61667
|
+
const rawPathRules = rawRules[key] ?? [];
|
|
61668
|
+
const attachCtx = resolveAttachContext(rawPathRules[0], meta?.attach);
|
|
61669
|
+
if (!isAttachFieldActive(attachCtx, formData)) {
|
|
61670
|
+
validatedPaths.push(key);
|
|
61671
|
+
if (!meta?.blocked) {
|
|
61672
|
+
editablePaths.push(key);
|
|
61673
|
+
}
|
|
61674
|
+
if (mode !== "all" && mode !== "display") {
|
|
61675
|
+
livePaths.push(key);
|
|
61676
|
+
}
|
|
61677
|
+
continue;
|
|
61678
|
+
}
|
|
61679
|
+
const rules2 = resolveActiveRules(mode, rawPathRules, meta, options.keepExceptionHighlight);
|
|
61680
|
+
if (!rules2.length) {
|
|
61681
|
+
if (mode === "display") {
|
|
61682
|
+
const isEditableAttachField = !!meta?.attach?.belongFieldId && !meta?.blocked;
|
|
61683
|
+
if (!isEditableAttachField) {
|
|
61684
|
+
validatedPaths.push(key);
|
|
61685
|
+
}
|
|
61686
|
+
}
|
|
61687
|
+
continue;
|
|
61688
|
+
}
|
|
61689
|
+
activeRules[key] = rules2;
|
|
61690
|
+
validatedPaths.push(key);
|
|
61691
|
+
if (!meta?.blocked) {
|
|
61692
|
+
editablePaths.push(key);
|
|
61693
|
+
}
|
|
61694
|
+
if (mode !== "all" && mode !== "display") {
|
|
61695
|
+
livePaths.push(key);
|
|
61696
|
+
}
|
|
61697
|
+
}
|
|
61698
|
+
const validator = new Schema(activeRules);
|
|
61699
|
+
const fields = await new Promise((resolve) => {
|
|
61700
|
+
validator.validate(flatData, { first: false, formData }, (errors, errorFields) => {
|
|
61510
61701
|
if (errors?.length) {
|
|
61511
|
-
resolve(
|
|
61512
|
-
isValid: false,
|
|
61513
|
-
fields
|
|
61514
|
-
});
|
|
61702
|
+
resolve(errorFields);
|
|
61515
61703
|
} else {
|
|
61516
|
-
resolve(
|
|
61704
|
+
resolve(void 0);
|
|
61517
61705
|
}
|
|
61518
61706
|
});
|
|
61519
61707
|
});
|
|
61520
|
-
|
|
61521
|
-
|
|
61522
|
-
|
|
61708
|
+
return {
|
|
61709
|
+
isValid: !fields || Object.keys(fields).length === 0,
|
|
61710
|
+
fields,
|
|
61711
|
+
editablePaths,
|
|
61712
|
+
livePaths,
|
|
61713
|
+
validatedPaths,
|
|
61714
|
+
ruleKeys,
|
|
61715
|
+
flatData
|
|
61716
|
+
};
|
|
61523
61717
|
}
|
|
61524
|
-
function
|
|
61525
|
-
const
|
|
61526
|
-
|
|
61527
|
-
|
|
61528
|
-
|
|
61529
|
-
|
|
61530
|
-
|
|
61531
|
-
|
|
61532
|
-
|
|
61533
|
-
|
|
61534
|
-
|
|
61535
|
-
|
|
61536
|
-
|
|
61537
|
-
|
|
61538
|
-
|
|
61718
|
+
function resolvePayloadForPath(path, flatData) {
|
|
61719
|
+
const rules2 = getRawFormRules()[path];
|
|
61720
|
+
if (!rules2) return null;
|
|
61721
|
+
return {
|
|
61722
|
+
value: flatData[path],
|
|
61723
|
+
rules: rules2
|
|
61724
|
+
};
|
|
61725
|
+
}
|
|
61726
|
+
function clearResolvedManualErrors(map, resolvePayload) {
|
|
61727
|
+
if (!map) return map;
|
|
61728
|
+
const next = { ...map };
|
|
61729
|
+
for (const path of Object.keys(next)) {
|
|
61730
|
+
const payload = resolvePayload(path);
|
|
61731
|
+
if (!payload) continue;
|
|
61732
|
+
const hasManual = filterRulesByTrigger(payload.rules, "manual").length > 0;
|
|
61733
|
+
const hasLive = filterRulesByTrigger(payload.rules, "change").length > 0;
|
|
61734
|
+
if (hasManual && !hasLive && !isEmptyValue$1(payload.value)) {
|
|
61735
|
+
delete next[path];
|
|
61736
|
+
}
|
|
61737
|
+
}
|
|
61738
|
+
return Object.keys(next).length ? next : null;
|
|
61739
|
+
}
|
|
61740
|
+
function mergeLiveValidation(current, liveResult, livePaths, resolvePayload) {
|
|
61741
|
+
const base = current && Object.keys(current).length ? { ...current } : {};
|
|
61742
|
+
for (const path of livePaths) {
|
|
61743
|
+
if (liveResult?.[path]) {
|
|
61744
|
+
base[path] = liveResult[path];
|
|
61745
|
+
continue;
|
|
61746
|
+
}
|
|
61747
|
+
const payload = resolvePayload(path);
|
|
61748
|
+
const keepManualComment = !!payload && filterRulesByTrigger(payload.rules, "manual").length > 0 && isEmptyValue$1(payload.value) && !!base[path]?.length;
|
|
61749
|
+
if (!keepManualComment) {
|
|
61750
|
+
delete base[path];
|
|
61751
|
+
}
|
|
61752
|
+
}
|
|
61753
|
+
const merged = Object.keys(base).length ? base : liveResult;
|
|
61754
|
+
return clearResolvedManualErrors(merged, resolvePayload);
|
|
61755
|
+
}
|
|
61756
|
+
function mergeSubmitValidation(current, submitResult, editablePaths) {
|
|
61757
|
+
const next = current && Object.keys(current).length ? { ...current } : {};
|
|
61758
|
+
for (const path of editablePaths) {
|
|
61759
|
+
if (submitResult?.[path]) {
|
|
61760
|
+
next[path] = submitResult[path];
|
|
61761
|
+
} else {
|
|
61762
|
+
delete next[path];
|
|
61763
|
+
}
|
|
61764
|
+
}
|
|
61765
|
+
return Object.keys(next).length ? next : null;
|
|
61766
|
+
}
|
|
61767
|
+
function pruneValidationComments(current, validPaths) {
|
|
61768
|
+
if (!current) return null;
|
|
61769
|
+
const next = {};
|
|
61770
|
+
for (const path of Object.keys(current)) {
|
|
61771
|
+
if (validPaths.has(path)) {
|
|
61772
|
+
next[path] = current[path];
|
|
61773
|
+
}
|
|
61774
|
+
}
|
|
61775
|
+
return Object.keys(next).length ? next : null;
|
|
61776
|
+
}
|
|
61777
|
+
function mergeDisplayValidation(current, displayResult, ruleKeys, validatedPaths) {
|
|
61778
|
+
const next = current && Object.keys(current).length ? { ...current } : {};
|
|
61779
|
+
const ruleSet = new Set(ruleKeys);
|
|
61780
|
+
const validatedSet = new Set(validatedPaths);
|
|
61781
|
+
for (const path of Object.keys(next)) {
|
|
61782
|
+
if (!ruleSet.has(path)) {
|
|
61783
|
+
delete next[path];
|
|
61784
|
+
}
|
|
61785
|
+
}
|
|
61786
|
+
for (const path of validatedSet) {
|
|
61787
|
+
if (displayResult?.[path]?.length) {
|
|
61788
|
+
next[path] = displayResult[path];
|
|
61789
|
+
} else {
|
|
61790
|
+
delete next[path];
|
|
61791
|
+
}
|
|
61792
|
+
}
|
|
61793
|
+
return Object.keys(next).length ? next : null;
|
|
61794
|
+
}
|
|
61795
|
+
const DEBOUNCE_MS = 300;
|
|
61796
|
+
const schedulersById = /* @__PURE__ */ new Map();
|
|
61797
|
+
function getScheduler(id) {
|
|
61798
|
+
let scheduler = schedulersById.get(id);
|
|
61799
|
+
if (!scheduler) {
|
|
61800
|
+
scheduler = {
|
|
61801
|
+
debounceTimer: null,
|
|
61802
|
+
running: false,
|
|
61803
|
+
pendingTrigger: "change"
|
|
61804
|
+
};
|
|
61805
|
+
schedulersById.set(id, scheduler);
|
|
61806
|
+
}
|
|
61807
|
+
return scheduler;
|
|
61808
|
+
}
|
|
61809
|
+
function clearValidationScheduler(id) {
|
|
61810
|
+
const scheduler = schedulersById.get(id);
|
|
61811
|
+
if (!scheduler) return;
|
|
61812
|
+
if (scheduler.debounceTimer) {
|
|
61813
|
+
clearTimeout(scheduler.debounceTimer);
|
|
61814
|
+
scheduler.debounceTimer = null;
|
|
61815
|
+
}
|
|
61816
|
+
schedulersById.delete(id);
|
|
61817
|
+
}
|
|
61818
|
+
function clearAllValidationSchedulers() {
|
|
61819
|
+
for (const id of [...schedulersById.keys()]) {
|
|
61820
|
+
clearValidationScheduler(id);
|
|
61821
|
+
}
|
|
61822
|
+
}
|
|
61823
|
+
function requestScheduledValidation(id, execute, options = {}) {
|
|
61824
|
+
const { immediate = false, trigger = "change" } = options;
|
|
61825
|
+
const scheduler = getScheduler(id);
|
|
61826
|
+
const run = async (mode) => {
|
|
61827
|
+
if (scheduler.running) {
|
|
61828
|
+
scheduler.pendingTrigger = mode;
|
|
61829
|
+
return;
|
|
61830
|
+
}
|
|
61831
|
+
scheduler.running = true;
|
|
61832
|
+
try {
|
|
61833
|
+
await execute(mode);
|
|
61834
|
+
const pending = scheduler.pendingTrigger;
|
|
61835
|
+
scheduler.pendingTrigger = "change";
|
|
61836
|
+
if (pending !== mode) {
|
|
61837
|
+
await execute(pending);
|
|
61838
|
+
}
|
|
61839
|
+
} finally {
|
|
61840
|
+
scheduler.running = false;
|
|
61841
|
+
}
|
|
61842
|
+
};
|
|
61843
|
+
if (immediate) {
|
|
61844
|
+
if (scheduler.debounceTimer) {
|
|
61845
|
+
clearTimeout(scheduler.debounceTimer);
|
|
61846
|
+
scheduler.debounceTimer = null;
|
|
61847
|
+
}
|
|
61848
|
+
scheduler.pendingTrigger = trigger;
|
|
61849
|
+
void run(trigger);
|
|
61850
|
+
return;
|
|
61851
|
+
}
|
|
61852
|
+
scheduler.pendingTrigger = trigger;
|
|
61853
|
+
if (scheduler.debounceTimer) {
|
|
61854
|
+
clearTimeout(scheduler.debounceTimer);
|
|
61855
|
+
}
|
|
61856
|
+
scheduler.debounceTimer = setTimeout(() => {
|
|
61857
|
+
scheduler.debounceTimer = null;
|
|
61858
|
+
void run(scheduler.pendingTrigger);
|
|
61859
|
+
}, DEBOUNCE_MS);
|
|
61860
|
+
}
|
|
61861
|
+
async function waitForTickSettle() {
|
|
61862
|
+
await nextTick$1();
|
|
61863
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
61864
|
+
}
|
|
61865
|
+
function countAttachRules() {
|
|
61866
|
+
const meta = getRawFormRuleMeta();
|
|
61867
|
+
let n = 0;
|
|
61868
|
+
for (const key of Object.keys(meta)) {
|
|
61869
|
+
if (meta[key]?.attach?.belongFieldId != null) n += 1;
|
|
61870
|
+
}
|
|
61871
|
+
return n;
|
|
61872
|
+
}
|
|
61873
|
+
async function waitForValidationReady(options) {
|
|
61874
|
+
const timeoutMs = options?.timeoutMs ?? 3e3;
|
|
61875
|
+
const intervalMs = options?.intervalMs ?? 50;
|
|
61876
|
+
const stableRounds = options?.stableRounds ?? 4;
|
|
61877
|
+
const minElapsedMs = options?.minElapsedMs ?? 0;
|
|
61878
|
+
await waitForTickSettle();
|
|
61879
|
+
const startedAt = Date.now();
|
|
61880
|
+
const deadline = startedAt + timeoutMs;
|
|
61881
|
+
let lastSignature = "";
|
|
61882
|
+
let stable = 0;
|
|
61883
|
+
while (Date.now() < deadline) {
|
|
61884
|
+
const signature = `${listFormRuleKeys().length}:${countAttachRules()}`;
|
|
61885
|
+
if (signature === lastSignature) {
|
|
61886
|
+
stable += 1;
|
|
61887
|
+
if (stable >= stableRounds && Date.now() - startedAt >= minElapsedMs) {
|
|
61888
|
+
await nextTick$1();
|
|
61889
|
+
await nextTick$1();
|
|
61890
|
+
return;
|
|
61539
61891
|
}
|
|
61540
61892
|
} else {
|
|
61541
|
-
|
|
61893
|
+
lastSignature = signature;
|
|
61894
|
+
stable = 0;
|
|
61542
61895
|
}
|
|
61896
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
61543
61897
|
}
|
|
61544
|
-
|
|
61898
|
+
await nextTick$1();
|
|
61899
|
+
}
|
|
61900
|
+
const contexts = /* @__PURE__ */ new Map();
|
|
61901
|
+
function registerValidationContext(ctx) {
|
|
61902
|
+
contexts.set(ctx.uniqueId, ctx);
|
|
61903
|
+
}
|
|
61904
|
+
function unregisterValidationContext(uniqueId) {
|
|
61905
|
+
clearValidationScheduler(uniqueId);
|
|
61906
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
61907
|
+
cancelStructureChangeTimer(uniqueId);
|
|
61908
|
+
contexts.delete(uniqueId);
|
|
61909
|
+
}
|
|
61910
|
+
function getContext(uniqueId) {
|
|
61911
|
+
return contexts.get(uniqueId);
|
|
61912
|
+
}
|
|
61913
|
+
function resolveFormKeep(ctx) {
|
|
61914
|
+
return resolveKeepExceptionHighlight(ctx.getKeepExceptionHighlight?.(), void 0);
|
|
61915
|
+
}
|
|
61916
|
+
function cancelPendingDisplayTimer(uniqueId) {
|
|
61917
|
+
const prev = displayDebounceTimers.get(uniqueId);
|
|
61918
|
+
if (prev) {
|
|
61919
|
+
clearTimeout(prev);
|
|
61920
|
+
displayDebounceTimers.delete(uniqueId);
|
|
61921
|
+
}
|
|
61922
|
+
}
|
|
61923
|
+
async function executeValidation(ctx, mode) {
|
|
61924
|
+
const paper = ctx.getPaper();
|
|
61925
|
+
if (!paper) return;
|
|
61926
|
+
const formData = ctx.getFormData();
|
|
61927
|
+
const res = await runValidation(formData, paper, {
|
|
61928
|
+
mode,
|
|
61929
|
+
keepExceptionHighlight: resolveFormKeep(ctx)
|
|
61930
|
+
});
|
|
61931
|
+
if (!res) return;
|
|
61932
|
+
const fields = res.fields ?? null;
|
|
61933
|
+
const editablePaths = res.editablePaths ?? [];
|
|
61934
|
+
const livePaths = res.livePaths ?? [];
|
|
61935
|
+
const flatData = res.flatData ?? {};
|
|
61936
|
+
if (mode === "all") {
|
|
61937
|
+
const merged = mergeSubmitValidation(ctx.getComments(), fields, editablePaths);
|
|
61938
|
+
ctx.applyComments(merged);
|
|
61939
|
+
} else if (mode === "display") {
|
|
61940
|
+
const merged = mergeDisplayValidation(
|
|
61941
|
+
ctx.getComments(),
|
|
61942
|
+
fields,
|
|
61943
|
+
res.ruleKeys ?? listFormRuleKeys(),
|
|
61944
|
+
res.validatedPaths ?? Object.keys(fields ?? {})
|
|
61945
|
+
);
|
|
61946
|
+
ctx.applyComments(merged);
|
|
61947
|
+
} else {
|
|
61948
|
+
const merged = mergeLiveValidation(
|
|
61949
|
+
ctx.getComments(),
|
|
61950
|
+
fields,
|
|
61951
|
+
livePaths,
|
|
61952
|
+
(path) => resolvePayloadForPath(path, flatData)
|
|
61953
|
+
);
|
|
61954
|
+
ctx.applyComments(merged);
|
|
61955
|
+
}
|
|
61956
|
+
return res;
|
|
61957
|
+
}
|
|
61958
|
+
async function validateAllFields(uniqueId) {
|
|
61959
|
+
const ctx = getContext(uniqueId);
|
|
61960
|
+
if (!ctx) {
|
|
61961
|
+
return void 0;
|
|
61962
|
+
}
|
|
61963
|
+
return executeValidation(ctx, "all");
|
|
61964
|
+
}
|
|
61965
|
+
async function validateDisplayFields(uniqueId) {
|
|
61966
|
+
const ctx = getContext(uniqueId);
|
|
61967
|
+
if (!ctx) return;
|
|
61968
|
+
return executeValidation(ctx, "display");
|
|
61969
|
+
}
|
|
61970
|
+
const displayDebounceTimers = /* @__PURE__ */ new Map();
|
|
61971
|
+
const DISPLAY_DEBOUNCE_MS = 320;
|
|
61972
|
+
const structureChangeTimers = /* @__PURE__ */ new Map();
|
|
61973
|
+
function cancelStructureChangeTimer(uniqueId) {
|
|
61974
|
+
const prev = structureChangeTimers.get(uniqueId);
|
|
61975
|
+
if (prev) {
|
|
61976
|
+
clearTimeout(prev);
|
|
61977
|
+
structureChangeTimers.delete(uniqueId);
|
|
61978
|
+
}
|
|
61979
|
+
}
|
|
61980
|
+
function scheduleRevalidateAfterStructureChange(uniqueId) {
|
|
61981
|
+
cancelStructureChangeTimer(uniqueId);
|
|
61982
|
+
structureChangeTimers.set(
|
|
61983
|
+
uniqueId,
|
|
61984
|
+
setTimeout(() => {
|
|
61985
|
+
structureChangeTimers.delete(uniqueId);
|
|
61986
|
+
void (async () => {
|
|
61987
|
+
await waitForValidationReady({
|
|
61988
|
+
timeoutMs: 2e3,
|
|
61989
|
+
stableRounds: 3,
|
|
61990
|
+
minElapsedMs: 40
|
|
61991
|
+
});
|
|
61992
|
+
pruneFormValidationComments(uniqueId);
|
|
61993
|
+
requestFullValidation(uniqueId, { trigger: "change" });
|
|
61994
|
+
requestDisplayValidation(uniqueId);
|
|
61995
|
+
})();
|
|
61996
|
+
}, 60)
|
|
61997
|
+
);
|
|
61998
|
+
}
|
|
61999
|
+
function requestDisplayValidation(uniqueId, immediate = false) {
|
|
62000
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
62001
|
+
const run = () => {
|
|
62002
|
+
displayDebounceTimers.delete(uniqueId);
|
|
62003
|
+
void validateDisplayFields(uniqueId);
|
|
62004
|
+
};
|
|
62005
|
+
if (immediate) {
|
|
62006
|
+
run();
|
|
62007
|
+
return;
|
|
62008
|
+
}
|
|
62009
|
+
displayDebounceTimers.set(uniqueId, setTimeout(run, DISPLAY_DEBOUNCE_MS));
|
|
62010
|
+
}
|
|
62011
|
+
function requestFullValidation(uniqueId, options = {}) {
|
|
62012
|
+
const ctx = getContext(uniqueId);
|
|
62013
|
+
if (!ctx) return;
|
|
62014
|
+
requestScheduledValidation(
|
|
62015
|
+
uniqueId,
|
|
62016
|
+
async (trigger) => {
|
|
62017
|
+
await executeValidation(ctx, trigger);
|
|
62018
|
+
},
|
|
62019
|
+
options
|
|
62020
|
+
);
|
|
62021
|
+
}
|
|
62022
|
+
function pruneFormValidationComments(uniqueId) {
|
|
62023
|
+
const ctx = getContext(uniqueId);
|
|
62024
|
+
if (!ctx) return;
|
|
62025
|
+
const validPaths = new Set(listFormRuleKeys());
|
|
62026
|
+
ctx.applyComments(pruneValidationComments(ctx.getComments(), validPaths));
|
|
62027
|
+
}
|
|
62028
|
+
function clearFormRules() {
|
|
62029
|
+
clearAllValidationSchedulers();
|
|
62030
|
+
for (const timer of displayDebounceTimers.values()) {
|
|
62031
|
+
clearTimeout(timer);
|
|
62032
|
+
}
|
|
62033
|
+
displayDebounceTimers.clear();
|
|
62034
|
+
for (const timer of structureChangeTimers.values()) {
|
|
62035
|
+
clearTimeout(timer);
|
|
62036
|
+
}
|
|
62037
|
+
structureChangeTimers.clear();
|
|
62038
|
+
clearFormRules$1();
|
|
62039
|
+
}
|
|
62040
|
+
function deleteSubtableRow(subtableFieldId, realRowIndex) {
|
|
62041
|
+
deleteSubtableRow$1(subtableFieldId, realRowIndex);
|
|
62042
|
+
for (const uniqueId of contexts.keys()) {
|
|
62043
|
+
pruneFormValidationComments(uniqueId);
|
|
62044
|
+
scheduleRevalidateAfterStructureChange(uniqueId);
|
|
62045
|
+
}
|
|
62046
|
+
}
|
|
62047
|
+
function insertSubtableRows(subtableFieldId, insertIndex, count = 1) {
|
|
62048
|
+
insertSubtableRows$1(subtableFieldId, insertIndex, count);
|
|
62049
|
+
for (const uniqueId of contexts.keys()) {
|
|
62050
|
+
pruneFormValidationComments(uniqueId);
|
|
62051
|
+
scheduleRevalidateAfterStructureChange(uniqueId);
|
|
62052
|
+
}
|
|
62053
|
+
}
|
|
62054
|
+
async function settleAndValidateDisplay(uniqueId) {
|
|
62055
|
+
await waitForValidationReady();
|
|
62056
|
+
await validateDisplayFields(uniqueId);
|
|
62057
|
+
}
|
|
62058
|
+
async function settleAfterModeSwitch(uniqueId, options) {
|
|
62059
|
+
const ctx = getContext(uniqueId);
|
|
62060
|
+
if (!ctx) return;
|
|
62061
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
62062
|
+
await waitForValidationReady({ timeoutMs: 4e3, stableRounds: 6, minElapsedMs: 450 });
|
|
62063
|
+
await nextTick$1();
|
|
62064
|
+
await waitForTickSettle();
|
|
62065
|
+
await new Promise((resolve) => setTimeout(resolve, 280));
|
|
62066
|
+
await waitForValidationReady({ timeoutMs: 2500, stableRounds: 5, minElapsedMs: 200 });
|
|
62067
|
+
cancelPendingDisplayTimer(uniqueId);
|
|
62068
|
+
if (options?.runChangeLive) {
|
|
62069
|
+
await executeValidation(ctx, "change");
|
|
62070
|
+
}
|
|
62071
|
+
await validateDisplayFields(uniqueId);
|
|
61545
62072
|
}
|
|
61546
62073
|
const getApi$1 = api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey;
|
|
61547
62074
|
const postApi = api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey;
|
|
@@ -61711,6 +62238,303 @@ function calcFillData(data, fillMapArr) {
|
|
|
61711
62238
|
}
|
|
61712
62239
|
return obj;
|
|
61713
62240
|
}
|
|
62241
|
+
const FormChangeRowCellType = {
|
|
62242
|
+
ADD: "SUBTABLE_ROW_ADD",
|
|
62243
|
+
DEL: "SUBTABLE_ROW_DEL"
|
|
62244
|
+
};
|
|
62245
|
+
const ROW_LOC_RE = /^(.+)__ROW__(ADD|DEL)__(.+)$/;
|
|
62246
|
+
const FIELD_RID_MARK = "__RID__";
|
|
62247
|
+
const FIELD_MARK = "__FIELD__";
|
|
62248
|
+
const COL_MARK = "__COL__";
|
|
62249
|
+
const ROW_LABEL = {
|
|
62250
|
+
dash: "—",
|
|
62251
|
+
add: "新增一行",
|
|
62252
|
+
del: "已删除"
|
|
62253
|
+
};
|
|
62254
|
+
const SNAPSHOT_SKIP = /* @__PURE__ */ new Set([
|
|
62255
|
+
"tempDeleted",
|
|
62256
|
+
FRONT_ROW_KEY,
|
|
62257
|
+
"id_",
|
|
62258
|
+
"group_",
|
|
62259
|
+
"sort_num_",
|
|
62260
|
+
"ref_master_id_",
|
|
62261
|
+
"ref_field_key_",
|
|
62262
|
+
"ref_model_key_",
|
|
62263
|
+
"tenant_id_",
|
|
62264
|
+
"deleted_",
|
|
62265
|
+
"is_confirmed_"
|
|
62266
|
+
]);
|
|
62267
|
+
function rowIdentityKeys(row) {
|
|
62268
|
+
if (!row) return [];
|
|
62269
|
+
return [
|
|
62270
|
+
row[FRONT_ROW_KEY] != null && String(row[FRONT_ROW_KEY]).trim() !== "" ? String(row[FRONT_ROW_KEY]) : void 0,
|
|
62271
|
+
row.id_ != null && row.id_ !== "" ? String(row.id_) : void 0
|
|
62272
|
+
].filter(Boolean);
|
|
62273
|
+
}
|
|
62274
|
+
function getFormChangeRowKey(row) {
|
|
62275
|
+
return rowIdentityKeys(row)[0];
|
|
62276
|
+
}
|
|
62277
|
+
function rowMatchesIdentity(row, ...idents) {
|
|
62278
|
+
const keys2 = rowIdentityKeys(row);
|
|
62279
|
+
return idents.some((id) => id != null && id !== "" && keys2.includes(String(id)));
|
|
62280
|
+
}
|
|
62281
|
+
function buildFormChangeRowLocation(subFieldId, rowKey, op) {
|
|
62282
|
+
return `${subFieldId}__ROW__${op}__${rowKey}`;
|
|
62283
|
+
}
|
|
62284
|
+
function parseFormChangeRowLocation(cellLocation) {
|
|
62285
|
+
if (!cellLocation) return null;
|
|
62286
|
+
const matched = cellLocation.match(ROW_LOC_RE);
|
|
62287
|
+
if (!matched) return null;
|
|
62288
|
+
return {
|
|
62289
|
+
subFieldId: matched[1],
|
|
62290
|
+
op: matched[2],
|
|
62291
|
+
rowKey: matched[3]
|
|
62292
|
+
};
|
|
62293
|
+
}
|
|
62294
|
+
function isFormChangeRowLocation(cellLocation) {
|
|
62295
|
+
return !!parseFormChangeRowLocation(cellLocation);
|
|
62296
|
+
}
|
|
62297
|
+
function getFormChangeRowOp(cellLocation) {
|
|
62298
|
+
return parseFormChangeRowLocation(cellLocation)?.op ?? null;
|
|
62299
|
+
}
|
|
62300
|
+
function isAnnLocationSelected(selectId, loc) {
|
|
62301
|
+
if (!loc || selectId == null) return false;
|
|
62302
|
+
return Array.isArray(selectId) ? selectId.includes(loc) : selectId === loc;
|
|
62303
|
+
}
|
|
62304
|
+
function isFormChangeGhostRow(row) {
|
|
62305
|
+
return !!(row?.deleted_ || row?.__fcOrphanAdd);
|
|
62306
|
+
}
|
|
62307
|
+
function buildStableFieldLocation(subFieldId, rowKey, fieldId, colIdx) {
|
|
62308
|
+
const base = `${subFieldId}${FIELD_RID_MARK}${rowKey}${FIELD_MARK}${fieldId}`;
|
|
62309
|
+
return colIdx === void 0 ? base : `${base}${COL_MARK}${colIdx}`;
|
|
62310
|
+
}
|
|
62311
|
+
function parseStableFieldLocation(cellLocation) {
|
|
62312
|
+
if (!cellLocation || !cellLocation.includes(FIELD_RID_MARK)) return null;
|
|
62313
|
+
const ridAt = cellLocation.indexOf(FIELD_RID_MARK);
|
|
62314
|
+
const subFieldId = cellLocation.slice(0, ridAt);
|
|
62315
|
+
const afterRid = cellLocation.slice(ridAt + FIELD_RID_MARK.length);
|
|
62316
|
+
const fieldAt = afterRid.indexOf(FIELD_MARK);
|
|
62317
|
+
if (fieldAt < 0) return null;
|
|
62318
|
+
const rowKey = afterRid.slice(0, fieldAt);
|
|
62319
|
+
const afterField = afterRid.slice(fieldAt + FIELD_MARK.length);
|
|
62320
|
+
const colAt = afterField.indexOf(COL_MARK);
|
|
62321
|
+
if (colAt >= 0) {
|
|
62322
|
+
return {
|
|
62323
|
+
subFieldId,
|
|
62324
|
+
rowKey,
|
|
62325
|
+
fieldId: afterField.slice(0, colAt),
|
|
62326
|
+
colIdx: Number(afterField.slice(colAt + COL_MARK.length))
|
|
62327
|
+
};
|
|
62328
|
+
}
|
|
62329
|
+
return { subFieldId, rowKey, fieldId: afterField, colIdx: void 0 };
|
|
62330
|
+
}
|
|
62331
|
+
function resolveAnnotationFieldLocation(options) {
|
|
62332
|
+
const { annList, subFieldId, fieldId, row, colIdx } = options;
|
|
62333
|
+
if (!Array.isArray(annList) || !annList.length || !subFieldId) return void 0;
|
|
62334
|
+
if (!rowIdentityKeys(row).length) return void 0;
|
|
62335
|
+
return annList.find((loc) => {
|
|
62336
|
+
const parsed = parseStableFieldLocation(loc);
|
|
62337
|
+
if (!parsed || parsed.subFieldId !== subFieldId || parsed.fieldId !== fieldId) return false;
|
|
62338
|
+
if (colIdx !== void 0 && parsed.colIdx !== colIdx) return false;
|
|
62339
|
+
if (colIdx === void 0 && parsed.colIdx !== void 0) return false;
|
|
62340
|
+
return rowMatchesIdentity(row, parsed.rowKey);
|
|
62341
|
+
});
|
|
62342
|
+
}
|
|
62343
|
+
function shouldSkipSnapshotKey(key) {
|
|
62344
|
+
return SNAPSHOT_SKIP.has(key) || key.startsWith("__fc") || key.startsWith("_") || key.endsWith("_lb_");
|
|
62345
|
+
}
|
|
62346
|
+
function pickRowSnapshot(row) {
|
|
62347
|
+
if (!row) return {};
|
|
62348
|
+
const out = {};
|
|
62349
|
+
Object.keys(row).forEach((key) => {
|
|
62350
|
+
if (shouldSkipSnapshotKey(key)) return;
|
|
62351
|
+
const value = row[key];
|
|
62352
|
+
if (value == null || value === "") return;
|
|
62353
|
+
out[key] = cloneDeep(value);
|
|
62354
|
+
});
|
|
62355
|
+
return out;
|
|
62356
|
+
}
|
|
62357
|
+
function buildRowPayload(rowKey, row, prevId) {
|
|
62358
|
+
return JSON.stringify({
|
|
62359
|
+
rowKey,
|
|
62360
|
+
snapshot: pickRowSnapshot(row),
|
|
62361
|
+
id: row?.id_ ?? prevId
|
|
62362
|
+
});
|
|
62363
|
+
}
|
|
62364
|
+
function parseRowPayload(raw) {
|
|
62365
|
+
if (raw == null || raw === "") return null;
|
|
62366
|
+
try {
|
|
62367
|
+
const parsed = JSON.parse(raw);
|
|
62368
|
+
if (parsed && typeof parsed === "object" && parsed.rowKey) {
|
|
62369
|
+
return {
|
|
62370
|
+
rowKey: String(parsed.rowKey),
|
|
62371
|
+
snapshot: parsed.snapshot && typeof parsed.snapshot === "object" ? parsed.snapshot : {},
|
|
62372
|
+
id: parsed.id
|
|
62373
|
+
};
|
|
62374
|
+
}
|
|
62375
|
+
} catch (e) {
|
|
62376
|
+
}
|
|
62377
|
+
return null;
|
|
62378
|
+
}
|
|
62379
|
+
function recordRowOp(ds, subFieldId, row, op) {
|
|
62380
|
+
if (!ds?.formChangeStatus) return;
|
|
62381
|
+
const rowKey = getFormChangeRowKey(row);
|
|
62382
|
+
if (!rowKey) return;
|
|
62383
|
+
const loc = buildFormChangeRowLocation(subFieldId, rowKey, op);
|
|
62384
|
+
if (op === "DEL") {
|
|
62385
|
+
const addLoc = buildFormChangeRowLocation(subFieldId, rowKey, "ADD");
|
|
62386
|
+
const hadAdd = !!ds.formChangeNewData?.[addLoc];
|
|
62387
|
+
const next = { ...ds.formChangeNewData || {} };
|
|
62388
|
+
delete next[addLoc];
|
|
62389
|
+
delete next[loc];
|
|
62390
|
+
ds.formChangeNewData = next;
|
|
62391
|
+
if (hadAdd) return;
|
|
62392
|
+
}
|
|
62393
|
+
const payload = buildRowPayload(rowKey, row);
|
|
62394
|
+
ds.formChangeNewData = {
|
|
62395
|
+
...ds.formChangeNewData || {},
|
|
62396
|
+
[loc]: {
|
|
62397
|
+
cellLocation: loc,
|
|
62398
|
+
cellType: FormChangeRowCellType[op],
|
|
62399
|
+
beforeValue: op === "DEL" ? payload : "",
|
|
62400
|
+
beforeLabel: ROW_LABEL.dash,
|
|
62401
|
+
afterValue: op === "ADD" ? payload : "",
|
|
62402
|
+
afterLabel: op === "ADD" ? ROW_LABEL.add : ROW_LABEL.del
|
|
62403
|
+
}
|
|
62404
|
+
};
|
|
62405
|
+
}
|
|
62406
|
+
function isRowAddedInCurrentFormChange(dataRelationShip, subFieldId, row) {
|
|
62407
|
+
if (!dataRelationShip?.formChangeStatus || !subFieldId || !row) return false;
|
|
62408
|
+
const rowKey = getFormChangeRowKey(row);
|
|
62409
|
+
if (!rowKey) return false;
|
|
62410
|
+
return !!dataRelationShip.formChangeNewData?.[buildFormChangeRowLocation(subFieldId, rowKey, "ADD")];
|
|
62411
|
+
}
|
|
62412
|
+
function recordSubtableRowAdd(dataRelationShip, subFieldId, rows) {
|
|
62413
|
+
rows?.forEach((row) => recordRowOp(dataRelationShip, subFieldId, row, "ADD"));
|
|
62414
|
+
}
|
|
62415
|
+
function recordSubtableRowDelete(dataRelationShip, subFieldId, row) {
|
|
62416
|
+
if (row) recordRowOp(dataRelationShip, subFieldId, row, "DEL");
|
|
62417
|
+
}
|
|
62418
|
+
function findRowByKey(candidates, rowKey, id) {
|
|
62419
|
+
return candidates.find((row) => rowMatchesIdentity(row, rowKey, id));
|
|
62420
|
+
}
|
|
62421
|
+
function enrichFormChangeRowDetails(formChangeNewData, formState) {
|
|
62422
|
+
if (!formChangeNewData || !formState) return formChangeNewData;
|
|
62423
|
+
Object.values(formChangeNewData).forEach((detail) => {
|
|
62424
|
+
const loc = parseFormChangeRowLocation(detail?.cellLocation);
|
|
62425
|
+
if (!loc) return;
|
|
62426
|
+
const rows = formState[loc.subFieldId];
|
|
62427
|
+
if (!Array.isArray(rows)) return;
|
|
62428
|
+
const isAdd = loc.op === "ADD";
|
|
62429
|
+
const prev = parseRowPayload(isAdd ? detail.afterValue : detail.beforeValue);
|
|
62430
|
+
const row = findRowByKey(rows, loc.rowKey, prev?.id);
|
|
62431
|
+
if (!row) return;
|
|
62432
|
+
const payload = buildRowPayload(loc.rowKey, row, prev?.id);
|
|
62433
|
+
if (isAdd) {
|
|
62434
|
+
detail.afterValue = payload;
|
|
62435
|
+
detail.afterLabel = ROW_LABEL.add;
|
|
62436
|
+
} else {
|
|
62437
|
+
detail.beforeValue = payload;
|
|
62438
|
+
detail.beforeLabel = ROW_LABEL.dash;
|
|
62439
|
+
detail.afterLabel = ROW_LABEL.del;
|
|
62440
|
+
}
|
|
62441
|
+
});
|
|
62442
|
+
return formChangeNewData;
|
|
62443
|
+
}
|
|
62444
|
+
function extractFormChangeRowDetails(items) {
|
|
62445
|
+
const result = [];
|
|
62446
|
+
(items || []).forEach((item) => {
|
|
62447
|
+
(item?.details || []).forEach((detail) => {
|
|
62448
|
+
const loc = parseFormChangeRowLocation(detail?.cellLocation);
|
|
62449
|
+
if (!loc) return;
|
|
62450
|
+
const raw = loc.op === "ADD" ? detail.afterValue : detail.beforeValue;
|
|
62451
|
+
const payload = parseRowPayload(raw) || { rowKey: loc.rowKey, snapshot: {} };
|
|
62452
|
+
result.push({
|
|
62453
|
+
cellLocation: detail.cellLocation,
|
|
62454
|
+
cellType: loc.op === "ADD" ? FormChangeRowCellType.ADD : FormChangeRowCellType.DEL,
|
|
62455
|
+
op: loc.op,
|
|
62456
|
+
subFieldId: loc.subFieldId,
|
|
62457
|
+
rowKey: payload.rowKey || loc.rowKey,
|
|
62458
|
+
snapshot: payload.snapshot || {},
|
|
62459
|
+
id: payload.id != null ? String(payload.id) : void 0
|
|
62460
|
+
});
|
|
62461
|
+
});
|
|
62462
|
+
});
|
|
62463
|
+
return result;
|
|
62464
|
+
}
|
|
62465
|
+
function detailsHaveFormChangeRowOps(details) {
|
|
62466
|
+
return (details || []).some((d) => isFormChangeRowLocation(d?.cellLocation));
|
|
62467
|
+
}
|
|
62468
|
+
function collectFormChangeFieldLocations(items) {
|
|
62469
|
+
const set2 = /* @__PURE__ */ new Set();
|
|
62470
|
+
(items || []).forEach((item) => {
|
|
62471
|
+
(item.details || []).forEach((detail) => {
|
|
62472
|
+
const loc = detail?.cellLocation;
|
|
62473
|
+
if (loc && !isFormChangeRowLocation(loc)) set2.add(loc);
|
|
62474
|
+
});
|
|
62475
|
+
});
|
|
62476
|
+
return Array.from(set2);
|
|
62477
|
+
}
|
|
62478
|
+
function resolveRowFormChangeMark(subFieldId, row, annRowDetails) {
|
|
62479
|
+
if (!rowIdentityKeys(row).length) return null;
|
|
62480
|
+
const details = (annRowDetails || []).filter(
|
|
62481
|
+
(item) => item.subFieldId === subFieldId && rowMatchesIdentity(row, item.rowKey, item.id)
|
|
62482
|
+
);
|
|
62483
|
+
if (!details.length) return null;
|
|
62484
|
+
const foundDel = details.find((item) => item.op === "DEL");
|
|
62485
|
+
const foundAdd = details.find((item) => item.op === "ADD");
|
|
62486
|
+
const hit = row?.deleted_ ? foundDel : foundAdd || foundDel;
|
|
62487
|
+
return hit ? { op: hit.op, cellLocation: hit.cellLocation } : null;
|
|
62488
|
+
}
|
|
62489
|
+
const WM_UI = {
|
|
62490
|
+
ADD: {
|
|
62491
|
+
trClass: "form-change-row-add",
|
|
62492
|
+
wmText: "新增",
|
|
62493
|
+
wmClass: "form-change-row-wm--add"
|
|
62494
|
+
},
|
|
62495
|
+
DEL: {
|
|
62496
|
+
trClass: "form-change-row-del",
|
|
62497
|
+
wmText: "删除",
|
|
62498
|
+
wmClass: "form-change-row-wm--del"
|
|
62499
|
+
},
|
|
62500
|
+
ORPHAN: {
|
|
62501
|
+
trClass: "form-change-row-orphan",
|
|
62502
|
+
wmText: "增后删",
|
|
62503
|
+
wmClass: "form-change-row-wm--orphan"
|
|
62504
|
+
}
|
|
62505
|
+
};
|
|
62506
|
+
function resolveFormChangeRowUi(row, rowMark) {
|
|
62507
|
+
if (!rowMark) {
|
|
62508
|
+
return { trClass: "", wmKind: null, wmText: "", wmClass: "" };
|
|
62509
|
+
}
|
|
62510
|
+
const wmKind = rowMark.op === "DEL" ? "DEL" : row?.__fcOrphanAdd ? "ORPHAN" : "ADD";
|
|
62511
|
+
return { wmKind, ...WM_UI[wmKind] };
|
|
62512
|
+
}
|
|
62513
|
+
function buildFormChangeDisplayRows(subFieldId, currentRows, annRowDetails) {
|
|
62514
|
+
const rows = currentRows || [];
|
|
62515
|
+
const liveRows = rows.filter((row) => !row?.deleted_);
|
|
62516
|
+
const details = (annRowDetails || []).filter((item) => item.subFieldId === subFieldId);
|
|
62517
|
+
if (!details.length) return liveRows;
|
|
62518
|
+
const deletedRows = rows.filter((row) => row?.deleted_);
|
|
62519
|
+
const makeGhost = (detail, orphan = false) => ({
|
|
62520
|
+
...cloneDeep(detail.snapshot || {}),
|
|
62521
|
+
...detail.id != null ? { id_: detail.id } : {},
|
|
62522
|
+
[FRONT_ROW_KEY]: detail.rowKey,
|
|
62523
|
+
...orphan ? { __fcOrphanAdd: true } : { deleted_: true }
|
|
62524
|
+
});
|
|
62525
|
+
const delTail = details.filter((item) => item.op === "DEL").map((item) => findRowByKey(deletedRows, item.rowKey, item.id) || makeGhost(item));
|
|
62526
|
+
const orphanTail = details.filter((item) => item.op === "ADD" && !findRowByKey(liveRows, item.rowKey, item.id)).map((item) => makeGhost(item, true));
|
|
62527
|
+
return [...liveRows, ...delTail, ...orphanTail];
|
|
62528
|
+
}
|
|
62529
|
+
function nextFormChangeRowViewHistoryId(currentId, historyId, items) {
|
|
62530
|
+
if (!historyId || currentId === historyId) {
|
|
62531
|
+
return { historyId: void 0, rowDetails: [] };
|
|
62532
|
+
}
|
|
62533
|
+
const item = (items || []).find((x) => x.id === historyId);
|
|
62534
|
+
const rowDetails = extractFormChangeRowDetails(item ? [item] : []);
|
|
62535
|
+
if (!rowDetails.length) return { historyId: void 0, rowDetails: [] };
|
|
62536
|
+
return { historyId, rowDetails };
|
|
62537
|
+
}
|
|
61714
62538
|
const { getParseFormulaVarInfos, calculateFormula } = useCalculateFormula();
|
|
61715
62539
|
function useNocodeFormWidget(props, emit) {
|
|
61716
62540
|
const widget = props.widget;
|
|
@@ -61866,29 +62690,55 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61866
62690
|
// 修改之后的值(展示值)
|
|
61867
62691
|
};
|
|
61868
62692
|
}
|
|
62693
|
+
function resolveSubtableColIdx() {
|
|
62694
|
+
if (!props.subtableFieldId) return void 0;
|
|
62695
|
+
if (!isNil(props.childSubTableDataIndex)) return props.childSubTableDataIndex;
|
|
62696
|
+
if (targetFieldId === "value_") {
|
|
62697
|
+
if (!isNil(props.realColIndex)) return props.realColIndex;
|
|
62698
|
+
if (!isNil(props.realRowIndex)) return 0;
|
|
62699
|
+
}
|
|
62700
|
+
return void 0;
|
|
62701
|
+
}
|
|
61869
62702
|
function handleOperationLog(callback) {
|
|
61870
|
-
|
|
62703
|
+
if (props.subtableFieldId && isRowAddedInCurrentFormChange(dataRelationShip, props.subtableFieldId, props.formData)) {
|
|
62704
|
+
return;
|
|
62705
|
+
}
|
|
62706
|
+
let operationId = realFieldId.value ?? "";
|
|
62707
|
+
if (props.subtableFieldId && props.formData) {
|
|
62708
|
+
const rowKey = getFormChangeRowKey(props.formData);
|
|
62709
|
+
if (rowKey) {
|
|
62710
|
+
operationId = buildStableFieldLocation(
|
|
62711
|
+
props.subtableFieldId,
|
|
62712
|
+
rowKey,
|
|
62713
|
+
targetFieldId,
|
|
62714
|
+
resolveSubtableColIdx()
|
|
62715
|
+
);
|
|
62716
|
+
}
|
|
62717
|
+
}
|
|
61871
62718
|
let originData;
|
|
61872
62719
|
if (props.subtableFieldId) {
|
|
61873
|
-
|
|
61874
|
-
|
|
61875
|
-
|
|
61876
|
-
|
|
61877
|
-
|
|
62720
|
+
const originRows = dataRelationShip?.formChangeOriginData?.[props.subtableFieldId];
|
|
62721
|
+
const currentKey = getFormChangeRowKey(props.formData);
|
|
62722
|
+
const childIdx = !isNil(props.childSubTableDataIndex) ? props.childSubTableDataIndex : void 0;
|
|
62723
|
+
const originRow = (Array.isArray(originRows) ? originRows.find((item) => {
|
|
62724
|
+
if (item?.deleted_) return false;
|
|
62725
|
+
if (getFormChangeRowKey(item) === currentKey) return true;
|
|
62726
|
+
return childIdx != null && item?._2DTABLE_?.some((child) => getFormChangeRowKey(child) === currentKey);
|
|
62727
|
+
}) : void 0) ?? originRows?.[props.realRowIndex];
|
|
62728
|
+
originData = childIdx != null ? originRow?.["_2DTABLE_"]?.[childIdx] ?? {} : originRow ?? {};
|
|
61878
62729
|
} else {
|
|
61879
62730
|
originData = dataRelationShip?.formChangeOriginData;
|
|
61880
62731
|
}
|
|
61881
62732
|
const newData = getOperationLogData(targetFieldId, originData, callback);
|
|
61882
62733
|
if (dataRelationShip) {
|
|
61883
|
-
dataRelationShip.formChangeNewData =
|
|
62734
|
+
dataRelationShip.formChangeNewData = {
|
|
62735
|
+
...dataRelationShip.formChangeNewData || {},
|
|
61884
62736
|
[operationId]: {
|
|
61885
62737
|
...newData,
|
|
61886
62738
|
cellLocation: operationId,
|
|
61887
|
-
// 单元格坐标
|
|
61888
62739
|
cellType: fieldType
|
|
61889
|
-
// 单元格类型(对应前端组件类型)
|
|
61890
62740
|
}
|
|
61891
|
-
}
|
|
62741
|
+
};
|
|
61892
62742
|
}
|
|
61893
62743
|
}
|
|
61894
62744
|
async function formulaOperationLog() {
|
|
@@ -61915,8 +62765,21 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61915
62765
|
option: optionDetail ?? valueData
|
|
61916
62766
|
});
|
|
61917
62767
|
}
|
|
62768
|
+
const triggerLiveValidation = () => {
|
|
62769
|
+
const uniqueId = dataRelationShip?.uniqueId;
|
|
62770
|
+
if (!uniqueId || dataRelationShip?.renderModeType !== RenderModeEnum.FormMode) {
|
|
62771
|
+
return;
|
|
62772
|
+
}
|
|
62773
|
+
if (eventType === "onChange") {
|
|
62774
|
+
requestFullValidation(uniqueId, { trigger: "change" });
|
|
62775
|
+
requestDisplayValidation(uniqueId);
|
|
62776
|
+
} else if (eventType === "onBlur") {
|
|
62777
|
+
requestFullValidation(uniqueId, { trigger: "blur", immediate: true });
|
|
62778
|
+
}
|
|
62779
|
+
};
|
|
61918
62780
|
if (eventType === "onChange" && dataRelationShip?.formChangeStatus) {
|
|
61919
62781
|
handleOperationLog(callback);
|
|
62782
|
+
triggerLiveValidation();
|
|
61920
62783
|
return;
|
|
61921
62784
|
}
|
|
61922
62785
|
const methodName = isExecuteEvent(eventType);
|
|
@@ -61934,6 +62797,7 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61934
62797
|
}
|
|
61935
62798
|
const { emitter: emitter2, EmitterEnum: EmitterEnum2 } = useNocodeEmitter();
|
|
61936
62799
|
emitter2.emit(EmitterEnum2.__on_looper_auto_save, { changed: true });
|
|
62800
|
+
triggerLiveValidation();
|
|
61937
62801
|
}
|
|
61938
62802
|
const onChange = (callback = () => {
|
|
61939
62803
|
}, valueData, optionDetail) => handleEvent("onChange", callback, valueData, optionDetail);
|
|
@@ -61944,13 +62808,7 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61944
62808
|
const onPressEnter = () => handleEvent("onPressEnter");
|
|
61945
62809
|
const realFieldId = computed(() => {
|
|
61946
62810
|
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
|
-
}
|
|
62811
|
+
const colIdx = resolveSubtableColIdx();
|
|
61954
62812
|
if (colIdx !== void 0) {
|
|
61955
62813
|
return `${props.subtableFieldId}_${props.realRowIndex}_${targetFieldId}_${colIdx}`;
|
|
61956
62814
|
}
|
|
@@ -61960,21 +62818,40 @@ function useNocodeFormWidget(props, emit) {
|
|
|
61960
62818
|
});
|
|
61961
62819
|
const annotationInfo = computed(() => {
|
|
61962
62820
|
const fieldId = realFieldId.value;
|
|
61963
|
-
if (!fieldId) {
|
|
62821
|
+
if (!fieldId && !props.subtableFieldId) {
|
|
61964
62822
|
return false;
|
|
61965
62823
|
}
|
|
62824
|
+
const annRowDetails = dataRelationShip?.annRowDetails;
|
|
62825
|
+
const rowViewActive = !!annRowDetails?.length;
|
|
62826
|
+
if (props.subtableFieldId && props.formData && rowViewActive) {
|
|
62827
|
+
if (isFormChangeGhostRow(props.formData) || resolveRowFormChangeMark(props.subtableFieldId, props.formData, annRowDetails)) {
|
|
62828
|
+
return false;
|
|
62829
|
+
}
|
|
62830
|
+
}
|
|
61966
62831
|
const annList = dataRelationShip?.annCellLocationList;
|
|
61967
62832
|
const validatorList = dataRelationShip?.validatorLocationList;
|
|
61968
|
-
const
|
|
61969
|
-
const
|
|
61970
|
-
|
|
62833
|
+
const colIdx = resolveSubtableColIdx();
|
|
62834
|
+
const matchedAnnLoc = props.subtableFieldId ? resolveAnnotationFieldLocation({
|
|
62835
|
+
annList,
|
|
62836
|
+
subFieldId: props.subtableFieldId,
|
|
62837
|
+
fieldId: targetFieldId,
|
|
62838
|
+
row: props.formData,
|
|
62839
|
+
colIdx
|
|
62840
|
+
}) : dataRelationShip?.annSwitchStatus && Array.isArray(annList) && fieldId && annList.includes(fieldId) ? fieldId : void 0;
|
|
62841
|
+
const annIncluded = !!dataRelationShip?.annSwitchStatus && !!matchedAnnLoc;
|
|
62842
|
+
const isSelected = isAnnLocationSelected(dataRelationShip?.annSelectId, matchedAnnLoc);
|
|
62843
|
+
const isInvalid = !dataRelationShip?.annSwitchStatus && Array.isArray(validatorList) && !!fieldId && validatorList.includes(fieldId);
|
|
61971
62844
|
const annClassList = [];
|
|
61972
|
-
if (annIncluded) {
|
|
61973
|
-
annClassList.push(
|
|
62845
|
+
if (annIncluded && matchedAnnLoc) {
|
|
62846
|
+
annClassList.push(matchedAnnLoc, "annotation-mark");
|
|
61974
62847
|
if (isSelected) annClassList.push("annotation-select");
|
|
61975
62848
|
}
|
|
61976
62849
|
if (annClassList.length || isInvalid) {
|
|
61977
|
-
return {
|
|
62850
|
+
return {
|
|
62851
|
+
annClassList,
|
|
62852
|
+
annFieldId: matchedAnnLoc || fieldId,
|
|
62853
|
+
showValidatorClass: isInvalid
|
|
62854
|
+
};
|
|
61978
62855
|
}
|
|
61979
62856
|
return false;
|
|
61980
62857
|
});
|
|
@@ -62310,27 +63187,27 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
62310
63187
|
case "revo-grid":
|
|
62311
63188
|
return import(
|
|
62312
63189
|
/* webpackMode: "lazy" */
|
|
62313
|
-
"./revo-grid.entry-
|
|
63190
|
+
"./revo-grid.entry-BIm5A5wM.js"
|
|
62314
63191
|
).then(processMod, consoleError);
|
|
62315
63192
|
case "revogr-filter-panel":
|
|
62316
63193
|
return import(
|
|
62317
63194
|
/* webpackMode: "lazy" */
|
|
62318
|
-
"./revogr-filter-panel.entry-
|
|
63195
|
+
"./revogr-filter-panel.entry-xo_juIUc.js"
|
|
62319
63196
|
).then(processMod, consoleError);
|
|
62320
63197
|
case "revogr-attribution_7":
|
|
62321
63198
|
return import(
|
|
62322
63199
|
/* webpackMode: "lazy" */
|
|
62323
|
-
"./revogr-attribution_7.entry-
|
|
63200
|
+
"./revogr-attribution_7.entry-B06XF5B_.js"
|
|
62324
63201
|
).then(processMod, consoleError);
|
|
62325
63202
|
case "revogr-clipboard_3":
|
|
62326
63203
|
return import(
|
|
62327
63204
|
/* webpackMode: "lazy" */
|
|
62328
|
-
"./revogr-clipboard_3.entry-
|
|
63205
|
+
"./revogr-clipboard_3.entry-C8dVJYtR.js"
|
|
62329
63206
|
).then(processMod, consoleError);
|
|
62330
63207
|
case "revogr-data_4":
|
|
62331
63208
|
return import(
|
|
62332
63209
|
/* webpackMode: "lazy" */
|
|
62333
|
-
"./revogr-data_4.entry-
|
|
63210
|
+
"./revogr-data_4.entry-Dgp6vYqe.js"
|
|
62334
63211
|
).then(processMod, consoleError);
|
|
62335
63212
|
}
|
|
62336
63213
|
}
|
|
@@ -72373,13 +73250,13 @@ function X(e) {
|
|
|
72373
73250
|
const P = defineCustomElements?.(), q = defineAsyncComponent(async () => (X(P) && await P, U));
|
|
72374
73251
|
export {
|
|
72375
73252
|
ImageDisplayModeEnum as $,
|
|
72376
|
-
|
|
73253
|
+
SignatureTimeTypeEnum as A,
|
|
72377
73254
|
BwipCodeType as B,
|
|
72378
73255
|
CreateType as C,
|
|
72379
|
-
|
|
72380
|
-
|
|
73256
|
+
SignShowTypeEnum as D,
|
|
73257
|
+
SignatureTypeEnum as E,
|
|
72381
73258
|
FIELD_TYPE as F,
|
|
72382
|
-
|
|
73259
|
+
useNamespace as G,
|
|
72383
73260
|
PlatformEnum as H,
|
|
72384
73261
|
FieldIconMap as I,
|
|
72385
73262
|
CellWidgetViewState as J,
|
|
@@ -72401,7 +73278,7 @@ export {
|
|
|
72401
73278
|
ReturnTypeEnum as Z,
|
|
72402
73279
|
_export_sfc as _,
|
|
72403
73280
|
PaperWidgeType as a,
|
|
72404
|
-
|
|
73281
|
+
OfficeTypeEnum as a$,
|
|
72405
73282
|
PaperSizeMap as a0,
|
|
72406
73283
|
EntityModelCategoryEnum as a1,
|
|
72407
73284
|
CheckDsTypeEnum as a2,
|
|
@@ -72412,174 +73289,207 @@ export {
|
|
|
72412
73289
|
BinarizeMethodOptions as a7,
|
|
72413
73290
|
ParamModelTypeEnum as a8,
|
|
72414
73291
|
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
|
-
|
|
73292
|
+
settleAndValidateDisplay as aA,
|
|
73293
|
+
unregisterValidationContext as aB,
|
|
73294
|
+
clearFormRules as aC,
|
|
73295
|
+
registerValidationContext as aD,
|
|
73296
|
+
requestFullValidation as aE,
|
|
73297
|
+
requestDisplayValidation as aF,
|
|
73298
|
+
closeValidatorPopovers as aG,
|
|
73299
|
+
baseDataUtils as aH,
|
|
73300
|
+
getRawFormRuleMeta as aI,
|
|
73301
|
+
enrichFormChangeRowDetails as aJ,
|
|
73302
|
+
settleAfterModeSwitch as aK,
|
|
73303
|
+
calcUtils as aL,
|
|
73304
|
+
uuid2 as aM,
|
|
73305
|
+
normalizeToArray as aN,
|
|
73306
|
+
safeParseArray as aO,
|
|
73307
|
+
BpmnNodeTypeEnum as aP,
|
|
73308
|
+
mergeByMultiKey as aQ,
|
|
73309
|
+
getRowId as aR,
|
|
73310
|
+
BpmnSignatureTypeEnum as aS,
|
|
73311
|
+
ButtonTypeEnum as aT,
|
|
73312
|
+
CHECK_TABLE_MEDPRO_PROTOCOL_KEY as aU,
|
|
73313
|
+
CodeRunner as aV,
|
|
73314
|
+
Config_Fields as aW,
|
|
73315
|
+
ControlStatusEnum as aX,
|
|
73316
|
+
EBR_PROVIDE_ENUM as aY,
|
|
73317
|
+
FieldSysVarDefaultValueEnum as aZ,
|
|
73318
|
+
MobileFillTypeEnum as a_,
|
|
72442
73319
|
sqlUtils as aa,
|
|
72443
73320
|
useWidgetStaticAttrs as ab,
|
|
72444
73321
|
setSelectValidatorId as ac,
|
|
72445
73322
|
setSelectAnnotationId as ad,
|
|
72446
|
-
|
|
72447
|
-
|
|
72448
|
-
|
|
72449
|
-
|
|
72450
|
-
|
|
72451
|
-
|
|
72452
|
-
|
|
72453
|
-
|
|
72454
|
-
|
|
72455
|
-
|
|
72456
|
-
|
|
72457
|
-
|
|
73323
|
+
useNocodeFormWidget as ae,
|
|
73324
|
+
DateFormat as af,
|
|
73325
|
+
renderUtils as ag,
|
|
73326
|
+
BindCmpStyleEnum as ah,
|
|
73327
|
+
DecimalDisplayMode as ai,
|
|
73328
|
+
NCB_PROVIDE as aj,
|
|
73329
|
+
normalizeRefLoaderResult as ak,
|
|
73330
|
+
refUtils as al,
|
|
73331
|
+
getParseRuleInfo as am,
|
|
73332
|
+
getParseRuleValue as an,
|
|
73333
|
+
useCurrentPageFormState as ao,
|
|
73334
|
+
RangeValidateMode as ap,
|
|
72458
73335
|
RenderModeEnum as aq,
|
|
72459
|
-
|
|
72460
|
-
|
|
72461
|
-
|
|
72462
|
-
|
|
72463
|
-
|
|
72464
|
-
|
|
72465
|
-
|
|
72466
|
-
|
|
72467
|
-
|
|
73336
|
+
EFieldBizTypeEnum as ar,
|
|
73337
|
+
FormulaRuleFieldKeyEnum as as,
|
|
73338
|
+
formulaRuleFieldDict as at,
|
|
73339
|
+
useNocodeEmitter as au,
|
|
73340
|
+
fetchHistoryConsume as av,
|
|
73341
|
+
isBomGranted as aw,
|
|
73342
|
+
calcFillData as ax,
|
|
73343
|
+
extractKeywordFromQueryData as ay,
|
|
73344
|
+
transformUtils as az,
|
|
72468
73345
|
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
|
-
|
|
73346
|
+
getColumns as b$,
|
|
73347
|
+
PosEnum as b0,
|
|
73348
|
+
RangeCompareOp as b1,
|
|
73349
|
+
SummaryApproveHisTypeEnum as b2,
|
|
73350
|
+
applyCheckDsDataToRuntime as b3,
|
|
73351
|
+
applyMedProCheckDsDataToRuntime as b4,
|
|
73352
|
+
buildFormChangeDisplayRows as b5,
|
|
73353
|
+
buildStableFieldLocation as b6,
|
|
73354
|
+
collectFormChangeFieldLocations as b7,
|
|
73355
|
+
deleteSubtableRow as b8,
|
|
73356
|
+
detailsHaveFormChangeRowOps as b9,
|
|
73357
|
+
setFormRule as bA,
|
|
73358
|
+
isReferenceOptionActive as bB,
|
|
73359
|
+
validateAllFields as bC,
|
|
73360
|
+
runValidation as bD,
|
|
73361
|
+
stockCheck as bE,
|
|
73362
|
+
materialCheck as bF,
|
|
73363
|
+
judgeUnique as bG,
|
|
73364
|
+
FRONT_ROW_KEY as bH,
|
|
73365
|
+
q as bI,
|
|
73366
|
+
getAugmentedNamespace as bJ,
|
|
73367
|
+
CardControlEnum as bK,
|
|
73368
|
+
EntityModelTypeEnum as bL,
|
|
73369
|
+
FIELD_TYPE_BASIC as bM,
|
|
73370
|
+
FIELD_TYPE_INSPECTION as bN,
|
|
73371
|
+
FIELD_TYPE_LOGIC as bO,
|
|
73372
|
+
FIELD_TYPE_MATERIAL as bP,
|
|
73373
|
+
FIELD_TYPE_PRETREATMENT as bQ,
|
|
73374
|
+
FIELD_TYPE_PRODUCE as bR,
|
|
73375
|
+
FIELD_TYPE_STERILIZATION as bS,
|
|
73376
|
+
FormDesignEnum as bT,
|
|
73377
|
+
RecordNoGenerateEnum as bU,
|
|
73378
|
+
TagTypeEnum as bV,
|
|
73379
|
+
registerInstance as bW,
|
|
73380
|
+
createEvent as bX,
|
|
73381
|
+
getColumnByProp as bY,
|
|
73382
|
+
timeout as bZ,
|
|
73383
|
+
getVisibleSourceItem as b_,
|
|
73384
|
+
extractFormChangeRowDetails as ba,
|
|
73385
|
+
fetchCheckDsDataForTable as bb,
|
|
73386
|
+
fetchCustomCheckDsData as bc,
|
|
73387
|
+
fetchMedProCheckDsData as bd,
|
|
73388
|
+
getFormChangeRowKey as be,
|
|
73389
|
+
getFormChangeRowOp as bf,
|
|
73390
|
+
getParseRuleConfig as bg,
|
|
73391
|
+
getSubTableQuickFillInfo as bh,
|
|
73392
|
+
handleOldConfig as bi,
|
|
73393
|
+
insertSubtableRows as bj,
|
|
73394
|
+
isAnnLocationSelected as bk,
|
|
73395
|
+
isFormChangeGhostRow as bl,
|
|
73396
|
+
isMedProSuite as bm,
|
|
73397
|
+
isRowAddedInCurrentFormChange as bn,
|
|
73398
|
+
jsonSchemaUtils as bo,
|
|
73399
|
+
nextFormChangeRowViewHistoryId as bp,
|
|
73400
|
+
recordSubtableRowAdd as bq,
|
|
73401
|
+
recordSubtableRowDelete as br,
|
|
73402
|
+
relocateDeletedRowsToEnd as bs,
|
|
73403
|
+
requestNonMedProCheckDsData as bt,
|
|
73404
|
+
resolveAnnotationFieldLocation as bu,
|
|
73405
|
+
resolveFormChangeRowUi as bv,
|
|
73406
|
+
resolveRowFormChangeMark as bw,
|
|
73407
|
+
setSelectMobileTdId as bx,
|
|
73408
|
+
assembleRules as by,
|
|
73409
|
+
deleteFormRule as bz,
|
|
72533
73410
|
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
|
-
|
|
73411
|
+
getCellRaw as c$,
|
|
73412
|
+
rowTypes as c0,
|
|
73413
|
+
GroupingRowPlugin as c1,
|
|
73414
|
+
StretchColumn as c2,
|
|
73415
|
+
isStretchPlugin as c3,
|
|
73416
|
+
AutoSizeColumnPlugin as c4,
|
|
73417
|
+
FilterPlugin as c5,
|
|
73418
|
+
ExportFilePlugin as c6,
|
|
73419
|
+
SortingPlugin as c7,
|
|
73420
|
+
ColumnMovePlugin as c8,
|
|
73421
|
+
ThemeService as c9,
|
|
73422
|
+
isFilterBtn as cA,
|
|
73423
|
+
ColumnService as cB,
|
|
73424
|
+
MOBILE_CLASS as cC,
|
|
73425
|
+
SELECTION_BORDER_CLASS as cD,
|
|
73426
|
+
getCellData as cE,
|
|
73427
|
+
getCellEditor as cF,
|
|
73428
|
+
getRange as cG,
|
|
73429
|
+
isRangeSingleCell as cH,
|
|
73430
|
+
codesLetter as cI,
|
|
73431
|
+
calculateRowHeaderSize as cJ,
|
|
73432
|
+
ROW_HEADER_TYPE as cK,
|
|
73433
|
+
getScrollbarSize as cL,
|
|
73434
|
+
FOCUS_CLASS as cM,
|
|
73435
|
+
CELL_HANDLER_CLASS as cN,
|
|
73436
|
+
TMP_SELECTION_BG_CLASS as cO,
|
|
73437
|
+
getItemByPosition as cP,
|
|
73438
|
+
EDIT_INPUT_WR as cQ,
|
|
73439
|
+
keyValues as cR,
|
|
73440
|
+
isObject as cS,
|
|
73441
|
+
DRAGG_TEXT as cT,
|
|
73442
|
+
PSEUDO_GROUP_ITEM as cU,
|
|
73443
|
+
GROUP_EXPANDED as cV,
|
|
73444
|
+
GROUP_DEPTH as cW,
|
|
73445
|
+
GROUP_EXPAND_BTN as cX,
|
|
73446
|
+
DATA_ROW as cY,
|
|
73447
|
+
isGroupingColumn as cZ,
|
|
73448
|
+
GROUP_COLUMN_PROP as c_,
|
|
73449
|
+
h as ca,
|
|
73450
|
+
Host as cb,
|
|
73451
|
+
getElement as cc,
|
|
73452
|
+
BasePlugin as cd,
|
|
73453
|
+
reduce as ce,
|
|
73454
|
+
columnTypes as cf,
|
|
73455
|
+
debounce$1 as cg,
|
|
73456
|
+
RESIZE_INTERVAL as ch,
|
|
73457
|
+
DimensionStore as ci,
|
|
73458
|
+
gatherTrimmedItems as cj,
|
|
73459
|
+
getColumnSizes as ck,
|
|
73460
|
+
getItemByIndex as cl,
|
|
73461
|
+
DataStore as cm,
|
|
73462
|
+
getSourceItem as cn,
|
|
73463
|
+
getSourceItemVirtualIndexByProp as co,
|
|
73464
|
+
getColumnType as cp,
|
|
73465
|
+
setSourceByPhysicalIndex as cq,
|
|
73466
|
+
setSourceByVirtualIndex as cr,
|
|
73467
|
+
SelectionStore as cs,
|
|
73468
|
+
cropCellToMax as ct,
|
|
73469
|
+
nextCell as cu,
|
|
73470
|
+
isRowType as cv,
|
|
73471
|
+
ViewportStore as cw,
|
|
73472
|
+
AndOrButton as cx,
|
|
73473
|
+
ReorderButton as cy,
|
|
73474
|
+
TrashButton as cz,
|
|
72582
73475
|
FIELD_TYPE_BUSINESS as d,
|
|
73476
|
+
DATA_COL as d0,
|
|
73477
|
+
CELL_CLASS as d1,
|
|
73478
|
+
Build as d2,
|
|
73479
|
+
isRowDragService as d3,
|
|
73480
|
+
DRAG_ICON_CLASS as d4,
|
|
73481
|
+
DRAGGABLE_CLASS as d5,
|
|
73482
|
+
getCellDataParsed as d6,
|
|
73483
|
+
GROUP_EXPAND_EVENT as d7,
|
|
73484
|
+
isGrouping as d8,
|
|
73485
|
+
HEADER_ROW_CLASS as d9,
|
|
73486
|
+
HEADER_ACTUAL_ROW_CLASS as da,
|
|
73487
|
+
ROW_FOCUSED_CLASS as db,
|
|
73488
|
+
HEADER_SORTABLE_CLASS as dc,
|
|
73489
|
+
MIN_COL_SIZE as dd,
|
|
73490
|
+
FilterButton as de,
|
|
73491
|
+
HeaderCellRenderer as df,
|
|
73492
|
+
HEADER_CLASS as dg,
|
|
72583
73493
|
ComponentTypeEnum as e,
|
|
72584
73494
|
estraverse as f,
|
|
72585
73495
|
SubTableType as g,
|
|
@@ -72589,17 +73499,17 @@ export {
|
|
|
72589
73499
|
commonjsGlobal as k,
|
|
72590
73500
|
getDefaultExportFromCjs as l,
|
|
72591
73501
|
PaperWidgeValueType as m,
|
|
72592
|
-
|
|
73502
|
+
useCalculateFormula as n,
|
|
72593
73503
|
onlineFormMasterModelTypeEnum as o,
|
|
72594
73504
|
parse as p,
|
|
72595
|
-
|
|
73505
|
+
FIELD_TYPE_WAREHOUSE as q,
|
|
72596
73506
|
requireEstraverse as r,
|
|
72597
73507
|
src as s,
|
|
72598
|
-
|
|
72599
|
-
|
|
72600
|
-
|
|
72601
|
-
|
|
72602
|
-
|
|
72603
|
-
|
|
72604
|
-
|
|
73508
|
+
FieldDefaultValueTypeEnum as t,
|
|
73509
|
+
useModal as u,
|
|
73510
|
+
FormTypeEnum as v,
|
|
73511
|
+
mitt as w,
|
|
73512
|
+
LabelPosition as x,
|
|
73513
|
+
BooleanShowMode as y,
|
|
73514
|
+
SignatureNumberTypeEnum as z
|
|
72605
73515
|
};
|