@gct-paas/excel 0.1.0 → 0.1.1
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/README.md +9 -12
- package/dist/Scrollbar-B03peMkg.js +4851 -0
- package/dist/{agg-design-DWIMjEFt.js → agg-design-TY6bw773.js} +1 -1
- package/dist/{agg-props-DIGVuiAa.js → agg-props-BP6ebrkg.js} +1 -1
- package/dist/{agg-style-DlzoL0bC.js → agg-style-Boe0wZpC.js} +1 -1
- package/dist/{align-editor-ScnNPek-.js → align-editor-BJnNlh17.js} +1 -1
- package/dist/{attach-fields-editor-D9OGMSPM.js → attach-fields-editor-sLbxGVa5.js} +3 -4
- package/dist/{barcode-design-DnpsOpYP.js → barcode-design-Dw6Fawyd.js} +6 -4
- package/dist/base/index.d.ts +1 -0
- package/dist/base/index.es.js +4095 -137
- package/dist/{base-font-editor-B5vjmXrI.js → base-font-editor-PcA-lLrM.js} +3 -3
- package/dist/{boolean-design-BH6ZgOfX.js → boolean-design-C6kCxcau.js} +6 -4
- package/dist/{boolean-props-DO08nUUl.js → boolean-props-CDv966ML.js} +4 -4
- package/dist/{boolean-style-B0KZHMId.js → boolean-style-DSo2KNU9.js} +8 -4
- package/dist/{cell-upload-7FJulof-.js → cell-upload-B75edlb1.js} +3 -3
- package/dist/{date-format-editor-dKlZ1BtF.js → date-format-editor-B4kyj8d4.js} +3 -4
- package/dist/{date-time-design-CTMy_f8u.js → date-time-design-CEzOl4VQ.js} +1 -2
- package/dist/{date-time-props-Bi1QXvJc.js → date-time-props-2Spc7-nD.js} +7 -6
- package/dist/{date-time-style-C4RYfnSX.js → date-time-style-eDhjVKXK.js} +1 -1
- package/dist/{decimal-design-DQ_UVmC2.js → decimal-design-9zPlMQeR.js} +1 -1
- package/dist/{decimal-display-mode-CcPkHB5x.js → decimal-display-mode-BwQvXjYM.js} +7 -4
- package/dist/{decimal-props-mTLDaVNL.js → decimal-props-D6gWZQS2.js} +5 -6
- package/dist/{decimal-style-DpUp6S2P.js → decimal-style-BSmJ__JJ.js} +1 -1
- package/dist/{default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-BIW4XxoA.js → default-value-editor.vue_vue_type_script_setup_true_name_default-value-editor_lang-DChBBAdl.js} +7 -5
- package/dist/{diagonal-design-CY_Znj5B.js → diagonal-design-CSShf9oU.js} +3 -3
- package/dist/{index-CfpMuCWW.js → document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-CRHt8g_6.js} +48303 -48392
- package/dist/{double-design-BPS3g1PG.js → double-design-B47Ui8Tf.js} +1 -1
- package/dist/{double-props-3Nr9HK6o.js → double-props-BXrUIA33.js} +4 -5
- package/dist/{double-style-fbwalibj.js → double-style-DNHerXvB.js} +1 -1
- package/dist/{edit.utils-CXmmCnxE-DBxW-dJF.js → edit.utils-CXmmCnxE-BaswarHv.js} +1 -1
- package/dist/{enum-design-BbBJ8RgJ.js → enum-design-S0FDbkIJ.js} +3 -4
- package/dist/{enum-props-DWXPyfcY.js → enum-props-DSHvCsX8.js} +9 -10
- package/dist/{enum-style-Cjl2-1cH.js → enum-style-CymSjOf9.js} +2 -2
- package/dist/excel.css +19817 -19817
- package/dist/{expression-design-SALSc8oz.js → expression-design-CxhDs-iW.js} +1 -1
- package/dist/{expression-props-DrBlBbh8.js → expression-props-D3doisK_.js} +1 -1
- package/dist/{expression-style-3epADkjE.js → expression-style-CwIasd6-.js} +1 -1
- package/dist/{file-design-DW3po1Zv.js → file-design-m-nNectv.js} +1 -1
- package/dist/{file-props-CLCHi5eO.js → file-props-i0juzKr3.js} +6 -4
- package/dist/{file-style-CSq3-qvW.js → file-style-BKREaYYI.js} +1 -1
- package/dist/{font-editor-DRJmXq8Z.js → font-editor-D_B6876L.js} +4 -4
- package/dist/form-annotation-controller-1BVpK7G9.js +651 -0
- package/dist/{image-design-EChtZtaq.js → image-design-C1N0UFcU.js} +7 -3
- package/dist/{image-design-SgYselU_.js → image-design-J5H8brer.js} +2 -2
- package/dist/{image-props-B451Gpqm.js → image-props-DAVhvZ4D.js} +1 -1
- package/dist/{image-style-BUVdkbCo.js → image-style-BcZz2fRn.js} +1 -1
- package/dist/{index-BGx1e8c7.js → index-2YSPfDqf.js} +5 -1
- package/dist/{index-CmWECosU.js → index-8frlENRk.js} +5 -1
- package/dist/{index-7yBmRQKF.js → index-B6jaI9Cc.js} +5 -1
- package/dist/{index-DdNE7bdh.js → index-BDSBNtti.js} +6 -2
- package/dist/{index-DKSr3-x3.js → index-BEgV29u5.js} +6 -2
- package/dist/{index-XHxr4hJa.js → index-Bbk8XFW3.js} +10226 -14301
- package/dist/{index-BE-tOMeW.js → index-Bc5GzFtM.js} +5 -1
- package/dist/{index-Lqv2fLln.js → index-Bd6tvXIP.js} +5 -1
- package/dist/{index-Iqfr9fTa.js → index-BgWmNF7J.js} +5 -1
- package/dist/{index-CwBWpKxd.js → index-Bh94YBll.js} +6 -2
- package/dist/{index-DJw46W_F.js → index-BsEmE3P9.js} +5 -1
- package/dist/{index-BdZ61aX_.js → index-C5CD6R34.js} +5 -3
- package/dist/{index-OSOTLvUC.js → index-CAMonT9s.js} +5 -3
- package/dist/{index-CdU4ZUtc.js → index-CBGFlXbA.js} +5 -1
- package/dist/{index-w1jyFW86.js → index-CD2-0ytB.js} +5 -1
- package/dist/{index-Cw0Yk_J2.js → index-CV8w5uD3.js} +5 -1
- package/dist/{index-CiEHZ2UL.js → index-CXzZayON.js} +5 -1
- package/dist/{index-DMDavNNp.js → index-Cz4GMH6V.js} +5 -1
- package/dist/{index-BiSfT142.js → index-D4JPNxZ_.js} +5 -1
- package/dist/{index-D1rRrOu8.js → index-D9vGUjD-.js} +5 -1
- package/dist/{index-BDgjwIk3.js → index-DCBWk2YD.js} +5 -1
- package/dist/{index-Cf-WiRlN.js → index-DD8pUlGk.js} +5 -1
- package/dist/{index-C71U7k6u.js → index-DJ4W6D00.js} +5 -1
- package/dist/{index-ph_-8i8Z.js → index-DPWvW9RW.js} +5 -1
- package/dist/{index-BfYX5wcI.js → index-D_NYroJT.js} +5 -1
- package/dist/{index-Bn-1MkMp.js → index-Gp_BO_6x.js} +6 -2
- package/dist/{index-C7XhsNAR.js → index-QlhJ9cCU.js} +5 -1
- package/dist/{index-B8wQ0lKk.js → index-R31WURxN.js} +5 -1
- package/dist/{index-C1hQP7e9.js → index-RXv4PPqO.js} +5 -1
- package/dist/{index-4jx1amDZ.js → index-TO-xtQQ-.js} +5982 -5895
- package/dist/{index-JAEvidu-.js → index-djFDCrYr.js} +5 -1
- package/dist/{index-n1btN66R.js → index-lbT4zbIX.js} +5 -1
- package/dist/{index-D33d2yaI.js → index-x7LqeyTP.js} +6 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1 -1
- package/dist/{integer-design-BzfsWtYJ.js → integer-design-5HpbwSMC.js} +1 -1
- package/dist/{integer-props-HFGj00uq.js → integer-props-CjJ48n84.js} +11 -12
- package/dist/{integer-style-CXnNiXBf.js → integer-style-Df3Ir8uR.js} +1 -1
- package/dist/{number-input-ex-BBYCCtb0.js → number-input-ex-A9ofHi7P.js} +2 -2
- package/dist/{org-props-DIPAV6_G.js → org-props-B-U2NZK0.js} +6 -2
- package/dist/{org-style-CxmWh_lK.js → org-style-mSip6Z4A.js} +1 -1
- package/dist/{pagination-design-Dmm1vFcD.js → pagination-design-B5G88uJP.js} +6 -2
- package/dist/paper-widget-design-CRIH6-sl.js +4 -0
- package/dist/{qrcode-design-CYE3Zc1S.js → qrcode-design-BjneALzu.js} +1 -1
- package/dist/{ref-autofill-editor-BrhHeEgk.js → ref-autofill-editor-BtaYTq4J.js} +5 -7
- package/dist/{ref-props-BQGfsopp.js → ref-props-CQvjcfUS.js} +4 -5
- package/dist/{ref-style-BKqW27bd.js → ref-style-lOjyHS6G.js} +1 -1
- package/dist/{revo-grid.entry-w1ybyIqW.js → revo-grid.entry-b_K3XgLT.js} +1 -1
- package/dist/{revogr-attribution_7.entry-Bm1yMQEW.js → revogr-attribution_7.entry-nUfaMLUj.js} +3 -3
- package/dist/{revogr-clipboard_3.entry-BTapNW_r.js → revogr-clipboard_3.entry-DVMLrYz4.js} +2 -2
- package/dist/{revogr-data_4.entry-C_JHDdpT.js → revogr-data_4.entry-z9cNZuX5.js} +2 -2
- package/dist/{revogr-filter-panel.entry-EZOB34a4.js → revogr-filter-panel.entry-Dxpd0jpR.js} +1 -1
- package/dist/{select-render-type-editor.vue_vue_type_script_setup_true_lang-DQ3opkvz.js → select-render-type-editor.vue_vue_type_script_setup_true_lang-Dph5IkLk.js} +6 -2
- package/dist/{serialnumber-design-Bf1-wuWo.js → serialnumber-design-RqaSxqVj.js} +2 -2
- package/dist/{signature-design-DJ-gHYV5.js → signature-design-CYPco1hW.js} +1 -1
- package/dist/{signature-props-DMvP8ZI_.js → signature-props-0khgkO7O.js} +7 -6
- package/dist/{signature-style-BA0EeVy4.js → signature-style-CmQ_YXd9.js} +1 -1
- package/dist/{single-field-drop-C72WkkXN.js → single-field-drop-BAWSxi-H.js} +3 -3
- package/dist/{size-editor-BV2kb5r0.js → size-editor-BAC_00ot.js} +1 -1
- package/dist/src/adapter/adapter.d.ts +1 -1
- package/dist/src/adapter/adapter.d.ts.map +1 -1
- package/dist/src/adapter/setup.d.ts.map +1 -1
- package/dist/src/nocode-base/src/types/common/base.d.ts.map +1 -1
- package/dist/src/nocode-web-render/src/render/parse-rule/add-rule-btn.vue.d.ts.map +1 -1
- package/dist/src/nocode-web-render/src/render/parse-rule/parse-rule-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/components/device/hook.d.ts +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/agg/agg.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/boolean/boolean.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-dependency.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-design.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-event.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-formula.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-props.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/cell-widget-style.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/common/comp-size-editor/comp-size-editor.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/date-time/date-time.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/decimal/decimal.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/double/double.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/enum/enum.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/expression/expression.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/file/file.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/image/image.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/integer/integer.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/org/org.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/ref/ref.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/signature/signature.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/text/text.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/trace/trace.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__cell_widgets__/user/user.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/barcode/barcode.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/base.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/container/container-item.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/container/container-render.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/diagonal/diagonal.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/image/image.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/line/line.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/pagination/pagination.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/paper-widget-design.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/paper-widget-props.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/power/power.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/qrcode/qrcode.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/rangelimit/rangelimit.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/serialnumber/serialnumber.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/text/text.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/__widgets__/timediff/timediff.config.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/apaas-collect.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/hooks/reverse-modeling/scan-field.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/hooks/useSpreadSheet.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/base/drag/cells-drop.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/base/drag/use-drop.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/base/field-config.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/modals/add-dependency-modal/add-dependency-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/modals/param-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/modals/table-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/comps/signature-config/config-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/comps/sub-table-list.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/add-ipaas/ipaas-param-config.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/data-source-field-map.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/data-source-model-link.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/data-source-title.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/common/param-field-link.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/hooks/useObjectInit.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/panel/panel-data-init-config/object-init/object-init-modal.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/sheet/sheet-cell.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/sheet/sheet-data-group-2d.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/sheet/sheet-dynamic-tr.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/modules/toolkit/toolkit-content-param.vue.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/types/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/utils/dom-parser.d.ts.map +1 -1
- package/dist/src/online-form/src/views/designer/utils/xlsx-parser.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_common_/rangelimit/use-rangelimit.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/datepicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/datetimepicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/department/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/enum-select/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/input/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/inputdouble/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/inputnumber/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/select/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/sign/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/switch/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/textarea/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/timepicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/trace/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/upload-file/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/upload-image/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_field_/userpicker/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/barcode/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/combine-fields/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/diagonal/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/dyn-value/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/image/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/line/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/power/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/qrcode/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/ro/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/serialnumber/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/sub-table/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/_widget_/timediff/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/paper/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/td/index.d.ts.map +1 -1
- package/dist/src/online-form/src/views/render/__components__/tr/index.d.ts.map +1 -1
- package/dist/{text-design-CMeRZOLz.js → text-design-C4UxhqJ6.js} +3 -3
- package/dist/{text-design-D8ytOdCE.js → text-design-DRjeVXe4.js} +6 -4
- package/dist/{text-props-Bwec10Bj.js → text-props-Dkba8iN0.js} +3 -4
- package/dist/{text-style-DUtxGMF_.js → text-style-DNLowaEr.js} +1 -1
- package/dist/{throttle-Cpk1LoGk-BE-DFShS.js → throttle-Cpk1LoGk-CSn6EgZj.js} +1 -1
- package/dist/{timediff-design-Bh2KjAqU.js → timediff-design-DfO1K8VM.js} +5 -1
- package/dist/{trace-design-BfkLkVEr.js → trace-design-sDW_1e1T.js} +3 -4
- package/dist/{trace-props-BGy27o42.js → trace-props-DUHH5u3j.js} +9 -6
- package/dist/{trace-style-DjlUSE3I.js → trace-style-fZihSUwd.js} +1 -1
- package/dist/{user-props-QOHxGObK.js → user-props-DIDwd7iH.js} +6 -2
- package/dist/{user-style-CvNqToP9.js → user-style-CCPt_J69.js} +1 -1
- package/dist/{value-editor.vue_vue_type_style_index_0_lang-DWp1s_Sq.js → value-editor.vue_vue_type_style_index_0_lang-DCnAPQSg.js} +5 -3
- package/dist/web-render/index.d.ts +1 -0
- package/dist/web-render/index.es.js +50 -135
- package/dist/{widget-barcode-DYOkoyS1.js → widget-barcode-7gC77_4m.js} +8 -4
- package/dist/{widget-diagonal-C-YsPxKf.js → widget-diagonal-MA7a_BaK.js} +6 -6
- package/dist/{widget-image-DUXTJPFJ.js → widget-image-FF-o9t3r.js} +8 -6
- package/dist/{widget-line-D5_w-6zu.js → widget-line-4mmBTGDW.js} +6 -2
- package/dist/{widget-pagination-xLLmOYJ9.js → widget-pagination-D8P-Y1gU.js} +9 -5
- package/dist/{widget-power-BfTxwePG.js → widget-power-DBZrpD6s.js} +4 -5
- package/dist/{widget-qrcode-4rMzuAvE.js → widget-qrcode-BXM3oQoT.js} +7 -3
- package/dist/{widget-rangelimit-DedzcMn8.js → widget-rangelimit-CCiGmchP.js} +4 -5
- package/dist/{widget-serialnumber-BBI-_uRN.js → widget-serialnumber-CEbbsNR-.js} +1 -1
- package/dist/{widget-text-CeldfZiZ.js → widget-text-CZpXhRyM.js} +5 -5
- package/dist/{widget-timediff-DJ4WeBNm.js → widget-timediff-D71b_fcM.js} +6 -4
- package/package.json +8 -4
- package/dist/Scrollbar-Bl_rv9eK.js +0 -8827
- package/dist/paper-widget-design-DvqHvRJ4.js +0 -4
- package/dist/uuid-CvPXRkky.js +0 -534
|
@@ -0,0 +1,4851 @@
|
|
|
1
|
+
import { computed, markRaw, ref, onUnmounted, watch, toRef, reactive, inject, provide, defineComponent, openBlock, createElementBlock, mergeProps, unref, createElementVNode, normalizeClass, renderSlot, createVNode, toDisplayString, createCommentVNode, onMounted, onBeforeMount, resolveComponent, createBlock, withCtx, Fragment, renderList, createTextVNode, toRaw, normalizeStyle, resolveDynamicComponent } from "vue";
|
|
2
|
+
import { cloneDeep, has, merge, defaults, pickBy, isNil, mergeWith, debounce, omit, last, pick } from "lodash-es";
|
|
3
|
+
import { f as ComponentTypeEnum, F as FIELD_TYPE, aU as ButtonTypeEnum, q as FormTypeEnum, aN as safeParseArray, aw as RenderModeEnum, aP as mergeByMultiKey, aT as BpmnSignatureTypeEnum, aO as BpmnNodeTypeEnum, bh as stockCheck, au as getParseRuleInfo, av as getParseRuleValue, bi as materialCheck, aE as calcFillData, az as FormulaRuleFieldKeyEnum, bj as judgeUnique, M as useFormModel, i as SubTableType, bk as getRowId, ai as useCurrentPageFormState, $ as Dependency_ENUM, Z as ASSIGNMENTSTRATEGY_ENUM, bl as watchDebounced, aL as uuid2, a6 as DeviceLink, D as useNamespace, _ as _export_sfc, ap as NCB_PROVIDE, af as useWidgetStaticAttrs, bg as setSelectMobileTdId, j as CellType, b7 as deleteSubtableRow, aG as transformUtils, A as useModal, bm as q, aR as getSubTableQuickFillInfo, bn as _sfc_main$7 } from "./document-quick-fillin.vue_vue_type_style_index_0_scoped_a18386ab_lang-CRHt8g_6.js";
|
|
4
|
+
import { api } from "@gct-paas/api";
|
|
5
|
+
import dayjs from "dayjs";
|
|
6
|
+
import "ant-design-vue";
|
|
7
|
+
var MaterialConsumptionPatternEnum = /* @__PURE__ */ ((MaterialConsumptionPatternEnum2) => {
|
|
8
|
+
MaterialConsumptionPatternEnum2["RECORD"] = "record";
|
|
9
|
+
MaterialConsumptionPatternEnum2["BOM"] = "bom";
|
|
10
|
+
return MaterialConsumptionPatternEnum2;
|
|
11
|
+
})(MaterialConsumptionPatternEnum || {});
|
|
12
|
+
function useStyles(widget, isArea = false) {
|
|
13
|
+
const otherClass = computed(() => {
|
|
14
|
+
if (!widget.style) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const cls = [];
|
|
18
|
+
if (widget.style["textAlign"]) {
|
|
19
|
+
if (widget.style["textAlign"] === "center") {
|
|
20
|
+
cls.push("m-justify-center");
|
|
21
|
+
}
|
|
22
|
+
if (widget.style["textAlign"] === "left") {
|
|
23
|
+
cls.push("m-justify-start");
|
|
24
|
+
}
|
|
25
|
+
if (widget.style["textAlign"] === "right") {
|
|
26
|
+
cls.push("m-justify-end");
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
cls.push("m-justify-start");
|
|
30
|
+
}
|
|
31
|
+
if (widget.style["verticalAlign"]) {
|
|
32
|
+
if (widget.style["verticalAlign"] === "middle") {
|
|
33
|
+
cls.push(isArea ? "m-content-center" : "m-items-center");
|
|
34
|
+
}
|
|
35
|
+
if (widget.style["verticalAlign"] === "top") {
|
|
36
|
+
cls.push(isArea ? "m-content-start" : "m-items-start");
|
|
37
|
+
}
|
|
38
|
+
if (widget.style["verticalAlign"] === "bottom") {
|
|
39
|
+
cls.push(isArea ? "m-content-end" : "m-items-end");
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
cls.push(isArea ? "m-content-start" : "m-items-start");
|
|
43
|
+
}
|
|
44
|
+
return cls;
|
|
45
|
+
});
|
|
46
|
+
return { otherClass };
|
|
47
|
+
}
|
|
48
|
+
const commonUtils = {
|
|
49
|
+
/** 列表转成树 */
|
|
50
|
+
listTransformTree: (list) => {
|
|
51
|
+
const cloneData = cloneDeep(list);
|
|
52
|
+
const result = [];
|
|
53
|
+
const map = /* @__PURE__ */ new Map();
|
|
54
|
+
cloneData.forEach((item) => {
|
|
55
|
+
map.set(item.id, { ...item, selectable: item.type === "DOC", children: [] });
|
|
56
|
+
});
|
|
57
|
+
cloneData.forEach((item) => {
|
|
58
|
+
const node = map.get(item.id);
|
|
59
|
+
if (item.rootNode) {
|
|
60
|
+
result.push(node);
|
|
61
|
+
} else {
|
|
62
|
+
const parent = map.get(item.parentId);
|
|
63
|
+
if (parent) {
|
|
64
|
+
parent.children.push(node);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return result;
|
|
69
|
+
},
|
|
70
|
+
findFirstDoc: (tree, ofId) => {
|
|
71
|
+
const cloneTree = cloneDeep(tree);
|
|
72
|
+
const queue = [...cloneTree];
|
|
73
|
+
while (queue.length > 0) {
|
|
74
|
+
const node = queue.shift();
|
|
75
|
+
if (node.type === "DOC" || !node.type) {
|
|
76
|
+
if (ofId) {
|
|
77
|
+
if (node.id === ofId || node.tmplId === ofId) {
|
|
78
|
+
return node;
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
return node;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (node.children && node.children.length > 0) {
|
|
85
|
+
queue.push(...node.children);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
},
|
|
90
|
+
uuid2: (len, radix) => {
|
|
91
|
+
const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
|
|
92
|
+
let uuid = [], i;
|
|
93
|
+
radix = radix || chars.length;
|
|
94
|
+
if (len) {
|
|
95
|
+
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
|
|
96
|
+
} else {
|
|
97
|
+
let r;
|
|
98
|
+
uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
|
|
99
|
+
uuid[14] = "4";
|
|
100
|
+
for (i = 0; i < 36; i++) {
|
|
101
|
+
if (!uuid[i]) {
|
|
102
|
+
r = 0 | Math.random() * 16;
|
|
103
|
+
uuid[i] = chars[i == 19 ? r & 3 | 8 : r];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return uuid.join("");
|
|
108
|
+
},
|
|
109
|
+
isEmptyValue: (value) => {
|
|
110
|
+
return value === void 0 || value === null || typeof value === "string" && value.trim() === "" || Array.isArray(value) && value.length === 0;
|
|
111
|
+
},
|
|
112
|
+
get gctInstanceStatusTheme() {
|
|
113
|
+
return {
|
|
114
|
+
"gct-nocode-instance-status--stash": {
|
|
115
|
+
textColor: "#F77E4A",
|
|
116
|
+
background: "rgba(247,126,74,0.1)",
|
|
117
|
+
iconBackground: "#FFC837",
|
|
118
|
+
placeholder: $t("sys.edhr.formInsStatusEnum.STASH")
|
|
119
|
+
},
|
|
120
|
+
"gct-nocode-instance-status--partial-submit": {
|
|
121
|
+
textColor: "#FFAA00",
|
|
122
|
+
background: "rgba(255,170,0,0.1)",
|
|
123
|
+
iconBackground: "#FFD666",
|
|
124
|
+
placeholder: $t("sys.appDesigner.approval.button.PartialSubmit")
|
|
125
|
+
},
|
|
126
|
+
"gct-nocode-instance-status--finish": {
|
|
127
|
+
textColor: "#309C41",
|
|
128
|
+
background: "rgba(48,156,65,0.1)",
|
|
129
|
+
iconBackground: "#76DA57",
|
|
130
|
+
placeholder: $t("sys.bpmn.flowNodeInstStatus.COMPLETED")
|
|
131
|
+
},
|
|
132
|
+
"gct-nocode-instance-status--abnormal": {
|
|
133
|
+
textColor: "#F54547",
|
|
134
|
+
background: " rgba(245,69,71,0.1)",
|
|
135
|
+
iconBackground: "#FF6776",
|
|
136
|
+
placeholder: $t("sys.bpmn.flowNodeInstStatus.EXCEPTION")
|
|
137
|
+
},
|
|
138
|
+
"gct-nocode-instance-status--not-filled": {
|
|
139
|
+
textColor: "#6D82B0",
|
|
140
|
+
background: "#E6EEFF",
|
|
141
|
+
iconBackground: "#B4C8F4",
|
|
142
|
+
placeholder: $t("sys.edhr.instanceStatus2DhrEnum.UNFILLED")
|
|
143
|
+
},
|
|
144
|
+
"gct-nocode-instance-status--running": {
|
|
145
|
+
textColor: "#13C2C2",
|
|
146
|
+
background: "rgba(19,194,194,0.1)",
|
|
147
|
+
iconBackground: "#13C2C2",
|
|
148
|
+
placeholder: $t("sys.bpmn.bizNodeInstStatus.running")
|
|
149
|
+
},
|
|
150
|
+
"gct-nocode-instance-status--already-filled": {
|
|
151
|
+
textColor: "#026AC8",
|
|
152
|
+
background: " rgba(2,106,200,0.1)",
|
|
153
|
+
iconBackground: "#026AC8",
|
|
154
|
+
placeholder: $t("sys.edhr.instanceStatus2DhrEnum.FILLED")
|
|
155
|
+
},
|
|
156
|
+
"gct-nocode-instance-status--invalid": {
|
|
157
|
+
textColor: "#737A87",
|
|
158
|
+
background: "#E5E5E5",
|
|
159
|
+
iconBackground: "#C3C3C3",
|
|
160
|
+
placeholder: $t("sys.edhr.dhrLogType.ABANDON")
|
|
161
|
+
},
|
|
162
|
+
"gct-nocode-instance-status--archived": {
|
|
163
|
+
textColor: "#dda200",
|
|
164
|
+
background: "#faf3df",
|
|
165
|
+
iconBackground: "#dda200",
|
|
166
|
+
placeholder: $t("sys.edhr.recordBook.archived")
|
|
167
|
+
},
|
|
168
|
+
"gct-nocode-instance-status--tmpl": {
|
|
169
|
+
textColor: "#742fb2",
|
|
170
|
+
background: "#f9f2ff",
|
|
171
|
+
iconBackground: "#742fb2",
|
|
172
|
+
placeholder: $t("sys.appDesigner.template")
|
|
173
|
+
},
|
|
174
|
+
"gct-nocode-instance-status--in-audit": {
|
|
175
|
+
textColor: "#FF52C5",
|
|
176
|
+
background: "rgba(255,82,197, 0.1)",
|
|
177
|
+
iconBackground: "#FF52C5",
|
|
178
|
+
placeholder: $t("sys.edhr.instanceStatus2FormEnum.IN_AUDIT")
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
function useOnlineFormActionButton() {
|
|
184
|
+
const baseBtn = [
|
|
185
|
+
{
|
|
186
|
+
type: "Cancel",
|
|
187
|
+
customTitle: $t("sys.cancelText"),
|
|
188
|
+
title: $t("sys.cancelText"),
|
|
189
|
+
enable: 1,
|
|
190
|
+
buttonType: "builtin",
|
|
191
|
+
isCustom: false
|
|
192
|
+
}
|
|
193
|
+
];
|
|
194
|
+
const processFormBtnGroup = [
|
|
195
|
+
{
|
|
196
|
+
type: ButtonTypeEnum.Return,
|
|
197
|
+
title: $t("sys.appDesigner.approval.button.Return"),
|
|
198
|
+
api: api.apaas.onlineForm.postProcessReturn
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
type: ButtonTypeEnum.Reassign,
|
|
202
|
+
title: $t("sys.appDesigner.approval.button.Reassign"),
|
|
203
|
+
style: {
|
|
204
|
+
type: "primary"
|
|
205
|
+
},
|
|
206
|
+
api: api.apaas.onlineForm.postProcessReassign
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
type: ButtonTypeEnum.Save,
|
|
210
|
+
title: $t("sys.saveText"),
|
|
211
|
+
style: {
|
|
212
|
+
type: "primary"
|
|
213
|
+
},
|
|
214
|
+
api: api.apaas.onlineForm.postProcessSave
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: ButtonTypeEnum.PartialSubmit,
|
|
218
|
+
title: $t("sys.appDesigner.approval.button.PartialSubmit"),
|
|
219
|
+
style: {
|
|
220
|
+
type: "primary"
|
|
221
|
+
},
|
|
222
|
+
api: api.apaas.onlineForm.postProcessPartialSubmit
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
type: ButtonTypeEnum.Submit,
|
|
226
|
+
title: $t("sys.submit"),
|
|
227
|
+
style: {
|
|
228
|
+
type: "primary"
|
|
229
|
+
},
|
|
230
|
+
api: api.apaas.onlineForm.postProcessSubmit
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
type: ButtonTypeEnum.Approve,
|
|
234
|
+
title: $t("sys.appDesigner.approval.button.Approve"),
|
|
235
|
+
style: {
|
|
236
|
+
type: "primary"
|
|
237
|
+
},
|
|
238
|
+
api: api.apaas.onlineForm.postProcessApprove
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
type: ButtonTypeEnum.Qualified,
|
|
242
|
+
title: $t("sys.appDesigner.approval.button.Qualified"),
|
|
243
|
+
api: api.apaas.onlineForm.postProcessApproveQualification
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
type: ButtonTypeEnum.Unqualified,
|
|
247
|
+
title: $t("sys.appDesigner.approval.button.Unqualified"),
|
|
248
|
+
api: api.apaas.onlineForm.postProcessApprove
|
|
249
|
+
}
|
|
250
|
+
];
|
|
251
|
+
const formChangeBtnGroup = [
|
|
252
|
+
{
|
|
253
|
+
type: ButtonTypeEnum.Return,
|
|
254
|
+
title: $t("sys.appDesigner.approval.button.Return"),
|
|
255
|
+
api: api.apaas.form.postChangeProcessReturn,
|
|
256
|
+
medproApi: window.NocodeAdapter.apis?.postMedproFormChangeProcessReturn
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: ButtonTypeEnum.Reassign,
|
|
260
|
+
title: $t("sys.appDesigner.approval.button.Reassign"),
|
|
261
|
+
style: {
|
|
262
|
+
type: "primary"
|
|
263
|
+
},
|
|
264
|
+
api: api.apaas.form.postChangeProcessReassign,
|
|
265
|
+
medproApi: window.NocodeAdapter.apis?.postMedproFormChangeProcessReassign
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: ButtonTypeEnum.Approve,
|
|
269
|
+
title: $t("sys.appDesigner.approval.button.Approve"),
|
|
270
|
+
style: {
|
|
271
|
+
type: "primary"
|
|
272
|
+
},
|
|
273
|
+
api: api.apaas.form.postChangeProcessApprove,
|
|
274
|
+
medproApi: window.NocodeAdapter.apis?.postMedproFormChangeProcessApprove
|
|
275
|
+
}
|
|
276
|
+
];
|
|
277
|
+
function renderActionButton(showButtons, buttonConfig, options) {
|
|
278
|
+
const { formType, inDrawer, isViewPage, isRecordFill, processOperation } = options || {};
|
|
279
|
+
const _baseBtn = inDrawer && !isViewPage ? baseBtn.slice() : [];
|
|
280
|
+
if (!formType || formType === FormTypeEnum.TEXT || formType === FormTypeEnum.VIEW) {
|
|
281
|
+
return [];
|
|
282
|
+
}
|
|
283
|
+
if (options.isFormChangeApprovalPage) {
|
|
284
|
+
const buttonMap = safeParseArray(buttonConfig).reduce((acc, current) => {
|
|
285
|
+
acc[current.type] = current;
|
|
286
|
+
return acc;
|
|
287
|
+
}, {});
|
|
288
|
+
return formChangeBtnGroup.filter((info) => showButtons.includes(info.type)).map((item) => {
|
|
289
|
+
const btn = buttonMap?.[item.type];
|
|
290
|
+
if (btn && btn.enable) {
|
|
291
|
+
return {
|
|
292
|
+
...btn,
|
|
293
|
+
style: {
|
|
294
|
+
...item.style,
|
|
295
|
+
...btn.style
|
|
296
|
+
},
|
|
297
|
+
buttonType: "builtin",
|
|
298
|
+
customTitle: btn.alias || item.title || $t("sys.pageDesigner.button"),
|
|
299
|
+
belongFormChangeApproval: true,
|
|
300
|
+
api: options.isMedPro ? item.medproApi : item.api
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
}).filter((i) => i);
|
|
304
|
+
}
|
|
305
|
+
if (formType === FormTypeEnum.BASE || formType === FormTypeEnum.FILE) {
|
|
306
|
+
if (options.modeType === RenderModeEnum.ViewMode) {
|
|
307
|
+
return [];
|
|
308
|
+
}
|
|
309
|
+
return _baseBtn.concat(
|
|
310
|
+
mergeByMultiKey(safeParseArray(buttonConfig), safeParseArray(processOperation), {
|
|
311
|
+
keyFields: ["type", "buttonType"]
|
|
312
|
+
}).filter((btn) => {
|
|
313
|
+
return Boolean(btn.enable) && (!isRecordFill || btn.buttonType === "builtin" && (btn.type === ButtonTypeEnum.Save || btn.type === ButtonTypeEnum.Submit));
|
|
314
|
+
}).map((btn) => {
|
|
315
|
+
const isSaveOrSubmit = btn.buttonType === "builtin" && [ButtonTypeEnum.Submit, ButtonTypeEnum.Save, ButtonTypeEnum.PartialSubmit].includes(
|
|
316
|
+
btn.type
|
|
317
|
+
);
|
|
318
|
+
return {
|
|
319
|
+
...btn,
|
|
320
|
+
...isSaveOrSubmit && {
|
|
321
|
+
style: {
|
|
322
|
+
type: "primary",
|
|
323
|
+
...btn.style
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
customTitle: btn.alias || btn.title || $t("sys.pageDesigner.button"),
|
|
327
|
+
signatureType: btn.signatureType || BpmnSignatureTypeEnum.None,
|
|
328
|
+
api: btn.type === ButtonTypeEnum.PartialSubmit ? api.apaas.onlineForm.postPartialSubmit : btn.type === ButtonTypeEnum.Save ? api.apaas.onlineForm.postStash : api.apaas.onlineForm.postBaseSubmit
|
|
329
|
+
};
|
|
330
|
+
}).sort((a, b) => a.buttonType === b.buttonType ? 0 : a.buttonType === "custom" ? 1 : -1)
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
if (formType === FormTypeEnum.PROCESS && options.bpmnType !== BpmnNodeTypeEnum.BpmnEnd) {
|
|
334
|
+
if (isViewPage || options.modeType === RenderModeEnum.ViewMode) {
|
|
335
|
+
return [];
|
|
336
|
+
}
|
|
337
|
+
const mergedBtns = mergeByMultiKey(
|
|
338
|
+
safeParseArray(buttonConfig),
|
|
339
|
+
safeParseArray(processOperation)
|
|
340
|
+
);
|
|
341
|
+
const custonBuiltinBtns = mergedBtns.filter((e) => e.isCustomBuiltin);
|
|
342
|
+
const buttonMap = mergedBtns.reduce((acc, current) => {
|
|
343
|
+
acc[current.type] = current;
|
|
344
|
+
return acc;
|
|
345
|
+
}, {});
|
|
346
|
+
const customButton = Object.values(buttonMap).filter(
|
|
347
|
+
(btn) => btn.enable && has(btn, "isCustom") && btn.isCustom && showButtons.includes(btn.type)
|
|
348
|
+
).map((item) => {
|
|
349
|
+
const btn = buttonMap?.[item.type];
|
|
350
|
+
return {
|
|
351
|
+
...btn,
|
|
352
|
+
buttonType: "custom",
|
|
353
|
+
customTitle: btn.alias || item.title || $t("sys.pageDesigner.button"),
|
|
354
|
+
api: api.apaas.onlineForm.postProcessJump
|
|
355
|
+
};
|
|
356
|
+
});
|
|
357
|
+
return _baseBtn.concat(customButton).concat(
|
|
358
|
+
// 流程表单内置按钮
|
|
359
|
+
processFormBtnGroup.filter((info) => showButtons.includes(info.type)).map((item) => {
|
|
360
|
+
const btn = buttonMap?.[item.type];
|
|
361
|
+
if (btn && btn.enable && !btn.isCustom) {
|
|
362
|
+
return {
|
|
363
|
+
...btn,
|
|
364
|
+
style: {
|
|
365
|
+
...item.style,
|
|
366
|
+
...btn.style
|
|
367
|
+
},
|
|
368
|
+
buttonType: "builtin",
|
|
369
|
+
customTitle: btn.alias || item.title || $t("sys.pageDesigner.button"),
|
|
370
|
+
api: item.api
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
}).filter((i) => i)
|
|
374
|
+
).concat(
|
|
375
|
+
custonBuiltinBtns.filter((e) => showButtons.includes(e.type)).map((e) => {
|
|
376
|
+
const btn = buttonMap?.[e.type];
|
|
377
|
+
const processBtn = processFormBtnGroup.find((f) => f.type === e.sourceType) || {};
|
|
378
|
+
if (btn && btn.enable && btn.isCustomBuiltin) {
|
|
379
|
+
return {
|
|
380
|
+
...btn,
|
|
381
|
+
style: {
|
|
382
|
+
...processBtn.style,
|
|
383
|
+
...btn.style
|
|
384
|
+
},
|
|
385
|
+
buttonType: "builtin",
|
|
386
|
+
cusBuiltinType: btn.type,
|
|
387
|
+
type: btn.sourceType,
|
|
388
|
+
customTitle: btn.alias || processBtn.title || $t("sys.pageDesigner.button"),
|
|
389
|
+
api: processBtn.api
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
}).filter((i) => i)
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
return _baseBtn;
|
|
396
|
+
}
|
|
397
|
+
const autoSaveButtonMap = {
|
|
398
|
+
[FormTypeEnum.BASE]: {
|
|
399
|
+
type: ButtonTypeEnum.Save,
|
|
400
|
+
title: $t("sys.saveText"),
|
|
401
|
+
customTitle: $t("sys.saveText"),
|
|
402
|
+
buttonType: "builtin",
|
|
403
|
+
api: api.apaas.onlineForm.postStash
|
|
404
|
+
},
|
|
405
|
+
[FormTypeEnum.PROCESS]: {
|
|
406
|
+
type: ButtonTypeEnum.Save,
|
|
407
|
+
title: $t("sys.saveText"),
|
|
408
|
+
customTitle: $t("sys.saveText"),
|
|
409
|
+
buttonType: "builtin",
|
|
410
|
+
api: api.apaas.onlineForm.postProcessSave
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
return {
|
|
414
|
+
renderActionButton,
|
|
415
|
+
autoSaveButtonMap
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
const useOnlineFormTransformField2Component = (fieldType) => {
|
|
419
|
+
return {
|
|
420
|
+
[FIELD_TYPE.TEXT]: {
|
|
421
|
+
cmpKey: ComponentTypeEnum.Input
|
|
422
|
+
},
|
|
423
|
+
[FIELD_TYPE.LONG_TEXT]: {
|
|
424
|
+
cmpKey: ComponentTypeEnum.Textarea
|
|
425
|
+
},
|
|
426
|
+
[FIELD_TYPE.INTEGER]: {
|
|
427
|
+
cmpKey: ComponentTypeEnum.Inputnumber
|
|
428
|
+
},
|
|
429
|
+
[FIELD_TYPE.LONG]: {
|
|
430
|
+
cmpKey: ComponentTypeEnum.Inputnumber
|
|
431
|
+
},
|
|
432
|
+
[FIELD_TYPE.DOUBLE]: {
|
|
433
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
434
|
+
},
|
|
435
|
+
[FIELD_TYPE.DECIMAL]: {
|
|
436
|
+
cmpKey: ComponentTypeEnum.Inputnumber
|
|
437
|
+
},
|
|
438
|
+
[FIELD_TYPE.BOOLEAN]: {
|
|
439
|
+
cmpKey: ComponentTypeEnum.Switch
|
|
440
|
+
},
|
|
441
|
+
[FIELD_TYPE.SERIAL]: {
|
|
442
|
+
cmpKey: ComponentTypeEnum.Input
|
|
443
|
+
},
|
|
444
|
+
[FIELD_TYPE.IMAGE]: {
|
|
445
|
+
cmpKey: ComponentTypeEnum.UploadImage
|
|
446
|
+
},
|
|
447
|
+
[FIELD_TYPE.SIGNATURE]: {
|
|
448
|
+
cmpKey: ComponentTypeEnum.Sign
|
|
449
|
+
},
|
|
450
|
+
[FIELD_TYPE.ATTACHMENT]: {
|
|
451
|
+
cmpKey: ComponentTypeEnum.UploadFile
|
|
452
|
+
},
|
|
453
|
+
[FIELD_TYPE.USER]: {
|
|
454
|
+
cmpKey: ComponentTypeEnum.Userpicker
|
|
455
|
+
},
|
|
456
|
+
[FIELD_TYPE.USER_MULTI]: {
|
|
457
|
+
cmpKey: ComponentTypeEnum.Userpicker
|
|
458
|
+
},
|
|
459
|
+
[FIELD_TYPE.ORG]: {
|
|
460
|
+
cmpKey: ComponentTypeEnum.Department
|
|
461
|
+
},
|
|
462
|
+
[FIELD_TYPE.ORG_MULTI]: {
|
|
463
|
+
cmpKey: ComponentTypeEnum.Department
|
|
464
|
+
},
|
|
465
|
+
[FIELD_TYPE.ENUM]: {
|
|
466
|
+
cmpKey: ComponentTypeEnum.EnumSelect
|
|
467
|
+
},
|
|
468
|
+
[FIELD_TYPE.ENUM_MULTI]: {
|
|
469
|
+
cmpKey: ComponentTypeEnum.EnumSelect
|
|
470
|
+
},
|
|
471
|
+
[FIELD_TYPE.OPTION]: {
|
|
472
|
+
cmpKey: ComponentTypeEnum.EnumSelect
|
|
473
|
+
},
|
|
474
|
+
[FIELD_TYPE.OPTION_MULTI]: {
|
|
475
|
+
cmpKey: ComponentTypeEnum.EnumSelect
|
|
476
|
+
},
|
|
477
|
+
[FIELD_TYPE.REF]: {
|
|
478
|
+
cmpKey: ComponentTypeEnum.Select
|
|
479
|
+
},
|
|
480
|
+
[FIELD_TYPE.REF_MULTI]: {
|
|
481
|
+
cmpKey: ComponentTypeEnum.Select
|
|
482
|
+
},
|
|
483
|
+
[FIELD_TYPE.MODEL_RELATION]: {
|
|
484
|
+
cmpKey: ComponentTypeEnum.Select
|
|
485
|
+
},
|
|
486
|
+
[FIELD_TYPE.WAREHOUSE]: {
|
|
487
|
+
cmpKey: ComponentTypeEnum.Select
|
|
488
|
+
},
|
|
489
|
+
[FIELD_TYPE.LOCATION]: {
|
|
490
|
+
cmpKey: ComponentTypeEnum.Select
|
|
491
|
+
},
|
|
492
|
+
[FIELD_TYPE.DATE]: {
|
|
493
|
+
cmpKey: ComponentTypeEnum.Datepicker
|
|
494
|
+
},
|
|
495
|
+
[FIELD_TYPE.DATE_TIME]: {
|
|
496
|
+
cmpKey: ComponentTypeEnum.DateTimepicker
|
|
497
|
+
},
|
|
498
|
+
[FIELD_TYPE.TIME]: {
|
|
499
|
+
cmpKey: ComponentTypeEnum.Timepicker
|
|
500
|
+
},
|
|
501
|
+
[FIELD_TYPE.EXPRESSION]: {
|
|
502
|
+
cmpKey: ComponentTypeEnum.EXPRESSION
|
|
503
|
+
},
|
|
504
|
+
[FIELD_TYPE.AGG]: {
|
|
505
|
+
cmpKey: ComponentTypeEnum.AGG
|
|
506
|
+
},
|
|
507
|
+
[FIELD_TYPE.MATERIAL_NO]: {
|
|
508
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
509
|
+
},
|
|
510
|
+
[FIELD_TYPE.STERILIZE_LOT]: {
|
|
511
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
512
|
+
},
|
|
513
|
+
[FIELD_TYPE.MATERIAL_LOT]: {
|
|
514
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
515
|
+
},
|
|
516
|
+
[FIELD_TYPE.RELATED_LOT_NO]: {
|
|
517
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
518
|
+
},
|
|
519
|
+
[FIELD_TYPE.PRODUCT]: {
|
|
520
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
521
|
+
},
|
|
522
|
+
[FIELD_TYPE.DEVICE]: {
|
|
523
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
524
|
+
},
|
|
525
|
+
[FIELD_TYPE.MFG_ORDER]: {
|
|
526
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
527
|
+
},
|
|
528
|
+
[FIELD_TYPE.RECORD_NO]: {
|
|
529
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
530
|
+
},
|
|
531
|
+
[FIELD_TYPE.TRACE_DATE]: {
|
|
532
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
533
|
+
},
|
|
534
|
+
[FIELD_TYPE.ORDER_NO]: {
|
|
535
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
536
|
+
},
|
|
537
|
+
[FIELD_TYPE.EXTERNAL_REF_NO]: {
|
|
538
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
539
|
+
},
|
|
540
|
+
[FIELD_TYPE.SHOPFLOOR]: {
|
|
541
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
542
|
+
},
|
|
543
|
+
[FIELD_TYPE.ROUTING_OPERATION]: {
|
|
544
|
+
cmpKey: ComponentTypeEnum.Select
|
|
545
|
+
},
|
|
546
|
+
[FIELD_TYPE.GOOD_QTY]: {
|
|
547
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
548
|
+
},
|
|
549
|
+
[FIELD_TYPE.NOT_GOOD_QTY]: {
|
|
550
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
551
|
+
},
|
|
552
|
+
[FIELD_TYPE.REPORT_START_TIME]: {
|
|
553
|
+
cmpKey: ComponentTypeEnum.DateTimepicker
|
|
554
|
+
},
|
|
555
|
+
[FIELD_TYPE.REPORT_END_TIME]: {
|
|
556
|
+
cmpKey: ComponentTypeEnum.DateTimepicker
|
|
557
|
+
},
|
|
558
|
+
[FIELD_TYPE.WORK_HOURS]: {
|
|
559
|
+
cmpKey: ComponentTypeEnum.Inputnumber
|
|
560
|
+
},
|
|
561
|
+
[FIELD_TYPE.PRODUCTION_DATE]: {
|
|
562
|
+
cmpKey: ComponentTypeEnum.Datepicker
|
|
563
|
+
},
|
|
564
|
+
[FIELD_TYPE.REPORTER]: {
|
|
565
|
+
cmpKey: ComponentTypeEnum.Sign
|
|
566
|
+
},
|
|
567
|
+
[FIELD_TYPE.NOT_GOOD_REASON]: {
|
|
568
|
+
cmpKey: ComponentTypeEnum.Select
|
|
569
|
+
},
|
|
570
|
+
[FIELD_TYPE.NOT_GOOD_GROUP]: {
|
|
571
|
+
cmpKey: ComponentTypeEnum.Select
|
|
572
|
+
},
|
|
573
|
+
[FIELD_TYPE.SCRAP_REASON]: {
|
|
574
|
+
cmpKey: ComponentTypeEnum.Select
|
|
575
|
+
},
|
|
576
|
+
[FIELD_TYPE.SCRAP_GROUP]: {
|
|
577
|
+
cmpKey: ComponentTypeEnum.Select
|
|
578
|
+
},
|
|
579
|
+
[FIELD_TYPE.SCRAP_QTY]: {
|
|
580
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
581
|
+
},
|
|
582
|
+
[FIELD_TYPE.SCRAP_MATERIAL]: {
|
|
583
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
584
|
+
},
|
|
585
|
+
[FIELD_TYPE.SCRAP_MATERIAL_NO]: {
|
|
586
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
587
|
+
},
|
|
588
|
+
[FIELD_TYPE.DESTRUCTIVE_TEST_QTY]: {
|
|
589
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
590
|
+
},
|
|
591
|
+
[FIELD_TYPE.PRODUCT_CHECK_QTY]: {
|
|
592
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
593
|
+
},
|
|
594
|
+
[FIELD_TYPE.MATERIAL_CHECK_QTY]: {
|
|
595
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
596
|
+
},
|
|
597
|
+
[FIELD_TYPE.QTY_REQUIRED]: {
|
|
598
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
599
|
+
},
|
|
600
|
+
[FIELD_TYPE.QTY_CONSUMED]: {
|
|
601
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
602
|
+
},
|
|
603
|
+
[FIELD_TYPE.QTY]: {
|
|
604
|
+
cmpKey: ComponentTypeEnum.InputDouble
|
|
605
|
+
},
|
|
606
|
+
[FIELD_TYPE.DEVICE_REF]: {
|
|
607
|
+
cmpKey: ComponentTypeEnum.Select
|
|
608
|
+
},
|
|
609
|
+
[FIELD_TYPE.DEVICE_REF_MULTI]: {
|
|
610
|
+
cmpKey: ComponentTypeEnum.Select
|
|
611
|
+
},
|
|
612
|
+
[FIELD_TYPE.WAREHOUSE_RECEIPT_NO]: {
|
|
613
|
+
cmpKey: ComponentTypeEnum.Input
|
|
614
|
+
},
|
|
615
|
+
[FIELD_TYPE.WAREHOUSE_RECEIPT_DATE]: {
|
|
616
|
+
cmpKey: ComponentTypeEnum.Datepicker
|
|
617
|
+
},
|
|
618
|
+
[FIELD_TYPE.WAREHOUSE_MANAGER]: {
|
|
619
|
+
cmpKey: ComponentTypeEnum.Sign
|
|
620
|
+
},
|
|
621
|
+
[FIELD_TYPE.OF_INST_NUM]: {
|
|
622
|
+
cmpKey: ComponentTypeEnum.Inputnumber
|
|
623
|
+
},
|
|
624
|
+
[FIELD_TYPE.E_SOP]: {
|
|
625
|
+
cmpKey: ComponentTypeEnum.Trace
|
|
626
|
+
}
|
|
627
|
+
}[fieldType];
|
|
628
|
+
};
|
|
629
|
+
class BomEntryValidator {
|
|
630
|
+
constructor(bomEntry, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo, mcPattern) {
|
|
631
|
+
this.bomEntry = bomEntry;
|
|
632
|
+
this.enableSequenceLoading = enableSequenceLoading;
|
|
633
|
+
this.materialNoNum = materialNoNum;
|
|
634
|
+
this.historyData = historyData;
|
|
635
|
+
this.mainMaterialNo = mainMaterialNo;
|
|
636
|
+
this.mcPattern = mcPattern;
|
|
637
|
+
this.productIds.push(this.bomEntry.product_id_);
|
|
638
|
+
this.productCodes[this.bomEntry.product_id_] = this.bomEntry.product_code_;
|
|
639
|
+
if (this.bomEntry.substitute_material_enabled_ && this.bomEntry.substitute_material_entries_) {
|
|
640
|
+
this.bomEntry.substitute_material_entries_.forEach((i) => {
|
|
641
|
+
this.productIds.push(i.product_id_);
|
|
642
|
+
this.productCodes[i.product_id_] = i.product_code_;
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
this.hasConsumed = this.calcQtyConsumed(this.historyData);
|
|
646
|
+
this.total = this.materialNoNum * this.bomEntry.qty_required_;
|
|
647
|
+
}
|
|
648
|
+
bomEntry;
|
|
649
|
+
enableSequenceLoading;
|
|
650
|
+
materialNoNum;
|
|
651
|
+
historyData;
|
|
652
|
+
mainMaterialNo;
|
|
653
|
+
mcPattern;
|
|
654
|
+
/** 该明细使用到的产品的id集合 */
|
|
655
|
+
productIds = [];
|
|
656
|
+
/** 物料和code的映射 */
|
|
657
|
+
productCodes = {};
|
|
658
|
+
/** 历史数据中已经消耗的 */
|
|
659
|
+
hasConsumed = 0;
|
|
660
|
+
/** 需求总量 */
|
|
661
|
+
total = 0;
|
|
662
|
+
/** 剩于可消耗数量 */
|
|
663
|
+
get remainingNum() {
|
|
664
|
+
return this.total - this.hasConsumed;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* 翻译物料的code
|
|
668
|
+
* @param productId
|
|
669
|
+
* @return {*}
|
|
670
|
+
*/
|
|
671
|
+
translateProductCode(productId) {
|
|
672
|
+
return this.productCodes[productId];
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
*过滤出该组明细的数据
|
|
676
|
+
* @param arr
|
|
677
|
+
* @return {*}
|
|
678
|
+
*/
|
|
679
|
+
filterGroupData(arr) {
|
|
680
|
+
return arr.filter((i) => this.productIds.includes(i.product_id_));
|
|
681
|
+
}
|
|
682
|
+
validateSubstitute(arr) {
|
|
683
|
+
const groupData = this.filterGroupData(arr);
|
|
684
|
+
if (!this.bomEntry.substitute_material_enabled_) {
|
|
685
|
+
const notMain = groupData.find((i) => i.product_id_ !== this.bomEntry.product_id_);
|
|
686
|
+
if (notMain) {
|
|
687
|
+
throw new Error($t("sys.edhr.mcTable.onlyMainMaterialCanSelect"));
|
|
688
|
+
}
|
|
689
|
+
} else if (this.bomEntry.substitute_policy_ === "only_one") {
|
|
690
|
+
const idSet = new Set(groupData.map((i) => i.product_id_));
|
|
691
|
+
if (idSet.size > 1) {
|
|
692
|
+
throw new Error($t("sys.edhr.mcTable.notAllowMixSubstituteMaterial"));
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
validateLotMixing(arr) {
|
|
697
|
+
if (!this.bomEntry.lot_mixing_enabled_) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
if (this.bomEntry.type_ !== "by_lot") {
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
const groupData = this.filterGroupData(arr);
|
|
704
|
+
const maxTimes = this.bomEntry.lot_mixing_times_;
|
|
705
|
+
const set = /* @__PURE__ */ new Set();
|
|
706
|
+
let errorMsg = "";
|
|
707
|
+
groupData.find((i) => {
|
|
708
|
+
set.add(i.material_no_);
|
|
709
|
+
if (set.size > maxTimes) {
|
|
710
|
+
errorMsg = $t("sys.edhr.mcTable.overMaterialMaxError", {
|
|
711
|
+
product: this.translateProductCode(this.bomEntry.product_id_),
|
|
712
|
+
max: maxTimes
|
|
713
|
+
});
|
|
714
|
+
return true;
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
if (errorMsg) {
|
|
718
|
+
throw new Error(errorMsg);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* 校验数量
|
|
723
|
+
* @param arr
|
|
724
|
+
* @return {*}
|
|
725
|
+
*/
|
|
726
|
+
async validateNum(arr) {
|
|
727
|
+
if (!this.bomEntry.qty_validation_enabled_) {
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
if (this.bomEntry.type_ === "view") {
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
const consumeNum = this.calcQtyConsumed(arr);
|
|
734
|
+
if (consumeNum === 0) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
if (["eq", "lte"].includes(this.bomEntry.qty_validation_rule_) && consumeNum > this.remainingNum) {
|
|
738
|
+
throw new Error($t("sys.edhr.mcTable.overMaterialConsumeError"));
|
|
739
|
+
}
|
|
740
|
+
if (this.bomEntry.qty_validation_rule_ === "bounds") {
|
|
741
|
+
const groupData = this.filterGroupData(arr);
|
|
742
|
+
const consumeSum = consumeNum + this.hasConsumed;
|
|
743
|
+
const { max } = await this.calcCustomNumberLimit(groupData[0]);
|
|
744
|
+
if (consumeSum > max) {
|
|
745
|
+
throw new Error(
|
|
746
|
+
$t("sys.edhr.mcTable.overBoundsMaxError", {
|
|
747
|
+
product: this.bomEntry.product_code_,
|
|
748
|
+
max
|
|
749
|
+
})
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* 校验库存
|
|
757
|
+
* @param row 当前行数据
|
|
758
|
+
*/
|
|
759
|
+
async validateStock(row) {
|
|
760
|
+
await stockCheck({ row, entry: this.bomEntry, mainMaterialNo: this.mainMaterialNo });
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* 计算已经消耗的数量之和
|
|
764
|
+
* @param arr
|
|
765
|
+
* @return {*}
|
|
766
|
+
*/
|
|
767
|
+
calcQtyConsumed(arr = this.historyData) {
|
|
768
|
+
const groupData = this.filterGroupData(arr);
|
|
769
|
+
return groupData.reduce((acc, cur) => acc + (cur.qty_ ?? 0), 0);
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* 计算自定义的数量校验的最大值和最小值
|
|
773
|
+
* @param data
|
|
774
|
+
* @return {*}
|
|
775
|
+
*/
|
|
776
|
+
async calcCustomNumberLimit(data) {
|
|
777
|
+
async function getValue(str) {
|
|
778
|
+
if (!str) {
|
|
779
|
+
return void 0;
|
|
780
|
+
}
|
|
781
|
+
try {
|
|
782
|
+
const json = JSON.parse(str);
|
|
783
|
+
if (json.expr) {
|
|
784
|
+
return await window.gct_expression.execute(json.expr, {
|
|
785
|
+
qty_required_: data.qty_required_
|
|
786
|
+
});
|
|
787
|
+
} else {
|
|
788
|
+
console.warn("没有配置表达式");
|
|
789
|
+
}
|
|
790
|
+
} catch (error) {
|
|
791
|
+
console.error("parse expression error", error);
|
|
792
|
+
return void 0;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
const max = await getValue(this.bomEntry.max_value_);
|
|
796
|
+
const min = await getValue(this.bomEntry.min_value_);
|
|
797
|
+
return { max, min };
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* 按顺序投料用
|
|
801
|
+
* 检查数据中的当前明细的填报是否已经完成
|
|
802
|
+
* @param arr
|
|
803
|
+
*/
|
|
804
|
+
async validateHasCompleted(arr) {
|
|
805
|
+
const groupData = this.filterGroupData(arr);
|
|
806
|
+
const message = $t("sys.edhr.mcTable.sequenceLoadingError", {
|
|
807
|
+
product: this.bomEntry.product_code_
|
|
808
|
+
});
|
|
809
|
+
if (!groupData.length) {
|
|
810
|
+
if (!this.bomEntry.force_loading_enabled_) {
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
throw new Error(message);
|
|
814
|
+
}
|
|
815
|
+
if (this.bomEntry.type_ === "view") {
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
const consumeNum = this.calcQtyConsumed(groupData);
|
|
819
|
+
if (!this.bomEntry.qty_validation_enabled_ && consumeNum) {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
switch (this.bomEntry.qty_validation_rule_) {
|
|
823
|
+
// 等于的时候要相等才算填报完成,小于的时候报错,大于由修改的时候报错,这边不报错
|
|
824
|
+
case "eq":
|
|
825
|
+
if (consumeNum < this.remainingNum) {
|
|
826
|
+
throw new Error(message);
|
|
827
|
+
}
|
|
828
|
+
break;
|
|
829
|
+
// 大于等于的时候要大于等于才算完成
|
|
830
|
+
case "gte":
|
|
831
|
+
if (consumeNum < this.remainingNum) {
|
|
832
|
+
throw new Error(message);
|
|
833
|
+
}
|
|
834
|
+
break;
|
|
835
|
+
// 小于等于的时候要小于等于有值就算算完成
|
|
836
|
+
case "lte":
|
|
837
|
+
if (consumeNum <= 0) {
|
|
838
|
+
throw new Error(message);
|
|
839
|
+
}
|
|
840
|
+
break;
|
|
841
|
+
case "bounds":
|
|
842
|
+
const consumeSum = consumeNum + this.hasConsumed;
|
|
843
|
+
const { min } = await this.calcCustomNumberLimit(groupData[0]);
|
|
844
|
+
if (consumeSum < min) {
|
|
845
|
+
throw new Error(message);
|
|
846
|
+
}
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
class BomEntriesValidator {
|
|
852
|
+
constructor(entries, enableSequenceLoading, materialNoNum, historyData, mainMaterialNo, mcPattern) {
|
|
853
|
+
this.entries = entries;
|
|
854
|
+
this.enableSequenceLoading = enableSequenceLoading;
|
|
855
|
+
this.materialNoNum = materialNoNum;
|
|
856
|
+
this.historyData = historyData;
|
|
857
|
+
this.mainMaterialNo = mainMaterialNo;
|
|
858
|
+
this.mcPattern = mcPattern;
|
|
859
|
+
this.bomEntryValidators = entries.map(
|
|
860
|
+
(i) => new BomEntryValidator(
|
|
861
|
+
i,
|
|
862
|
+
enableSequenceLoading,
|
|
863
|
+
materialNoNum,
|
|
864
|
+
historyData,
|
|
865
|
+
mainMaterialNo,
|
|
866
|
+
mcPattern
|
|
867
|
+
)
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
entries;
|
|
871
|
+
enableSequenceLoading;
|
|
872
|
+
materialNoNum;
|
|
873
|
+
historyData;
|
|
874
|
+
mainMaterialNo;
|
|
875
|
+
mcPattern;
|
|
876
|
+
bomEntryValidators;
|
|
877
|
+
/**
|
|
878
|
+
* 翻译物料的code
|
|
879
|
+
* @param productId
|
|
880
|
+
* @return {*}
|
|
881
|
+
*/
|
|
882
|
+
translateProductCode(productId) {
|
|
883
|
+
if (!productId) {
|
|
884
|
+
return "";
|
|
885
|
+
}
|
|
886
|
+
const util = this.findUtilByProductId(productId);
|
|
887
|
+
if (util) {
|
|
888
|
+
return util.translateProductCode(productId);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* 找到物料对应的validator
|
|
893
|
+
* @param productId
|
|
894
|
+
* @return {*}
|
|
895
|
+
*/
|
|
896
|
+
findUtilByProductId(productId) {
|
|
897
|
+
return this.bomEntryValidators.find((i) => i.productIds.includes(productId));
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* 检验是否符合顺序投料的顺序要求
|
|
901
|
+
* @param row 当前编辑的行
|
|
902
|
+
* @param arr 所有的数据
|
|
903
|
+
* @return {*}
|
|
904
|
+
*/
|
|
905
|
+
async validateSequenceLoading(row, arr) {
|
|
906
|
+
if (!this.enableSequenceLoading) {
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
const util = row ? this.findUtilByProductId(row.product_id_) : void 0;
|
|
910
|
+
for (const item of this.bomEntryValidators) {
|
|
911
|
+
if (item === util) {
|
|
912
|
+
break;
|
|
913
|
+
} else {
|
|
914
|
+
await item.validateHasCompleted(arr);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* 校验物料是否在bom里被使用
|
|
920
|
+
* @param row 单行的数据
|
|
921
|
+
*/
|
|
922
|
+
validateInBom(row) {
|
|
923
|
+
if (this.mcPattern === MaterialConsumptionPatternEnum.RECORD) {
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
if (!row.product_id_) {
|
|
927
|
+
throw new Error($t("sys.edhr.mcTable.materialEmptyError"));
|
|
928
|
+
}
|
|
929
|
+
const util = this.findUtilByProductId(row.product_id_);
|
|
930
|
+
if (!util) {
|
|
931
|
+
const name = row.product_id__lb_ ? JSON.parse(row.product_id__lb_).join(",") : "";
|
|
932
|
+
throw new Error(
|
|
933
|
+
$t("sys.edhr.mcTable.productNotDefine", {
|
|
934
|
+
product: name
|
|
935
|
+
})
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* 检查数据是否完整
|
|
941
|
+
* @param arr
|
|
942
|
+
*/
|
|
943
|
+
validateDataCompleted(row) {
|
|
944
|
+
this.validateInBom(row);
|
|
945
|
+
const util = this.findUtilByProductId(row.product_id_);
|
|
946
|
+
const { type_ } = util.bomEntry;
|
|
947
|
+
if (type_ === "view") {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
if (type_ === "by_lot" && !row.material_no_) {
|
|
951
|
+
throw new Error(
|
|
952
|
+
$t("sys.edhr.mcTable.materialNoEmptyError", {
|
|
953
|
+
product: this.translateProductCode(row.product_id_)
|
|
954
|
+
})
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
if (!row.qty_) {
|
|
958
|
+
throw new Error(
|
|
959
|
+
$t("sys.edhr.mcTable.materialNumEmptyError", {
|
|
960
|
+
product: this.translateProductCode(row.product_id_)
|
|
961
|
+
})
|
|
962
|
+
);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* 校验替代料校验
|
|
967
|
+
* @param arr
|
|
968
|
+
*/
|
|
969
|
+
validateSubstitute(arr) {
|
|
970
|
+
this.bomEntryValidators.forEach((i) => {
|
|
971
|
+
i.validateSubstitute(arr);
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* 校验混批校验
|
|
976
|
+
* @param arr
|
|
977
|
+
*/
|
|
978
|
+
validateLotMixing(arr) {
|
|
979
|
+
this.bomEntryValidators.forEach((i) => {
|
|
980
|
+
i.validateLotMixing(arr);
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* 校验数量
|
|
985
|
+
* @param arr
|
|
986
|
+
*/
|
|
987
|
+
async validateNum(arr) {
|
|
988
|
+
const validatePromises = this.bomEntryValidators.map((i) => i.validateNum(arr));
|
|
989
|
+
await Promise.all(validatePromises);
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* 校验库存消耗
|
|
993
|
+
* @param row
|
|
994
|
+
*/
|
|
995
|
+
async validateStock(row) {
|
|
996
|
+
const find = this.findUtilByProductId(row.product_id_);
|
|
997
|
+
await find.validateStock(row);
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* 检验整个数组是否符合bom配置的要求
|
|
1001
|
+
* @param arr
|
|
1002
|
+
*/
|
|
1003
|
+
async validate(arr) {
|
|
1004
|
+
const editRow = arr.find((i) => !i.is_confirmed_);
|
|
1005
|
+
if (!editRow) {
|
|
1006
|
+
throw new Error($t("sys.edhr.mcTable.noEditingRow"));
|
|
1007
|
+
}
|
|
1008
|
+
this.validateInBom(editRow);
|
|
1009
|
+
await this.validateSequenceLoading(editRow, arr);
|
|
1010
|
+
this.validateSubstitute(arr);
|
|
1011
|
+
this.validateLotMixing(arr);
|
|
1012
|
+
this.validateDataCompleted(editRow);
|
|
1013
|
+
await this.validateNum(arr);
|
|
1014
|
+
if (editRow) {
|
|
1015
|
+
await this.validateStock(editRow);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* 检查扫描数据是否可以插入
|
|
1020
|
+
* @param arr
|
|
1021
|
+
*/
|
|
1022
|
+
async validateScanCanInsert(arr) {
|
|
1023
|
+
const editRow = arr.find((i) => !i.is_confirmed_);
|
|
1024
|
+
if (!editRow) {
|
|
1025
|
+
throw new Error($t("sys.edhr.mcTable.noEditingRow"));
|
|
1026
|
+
}
|
|
1027
|
+
if (this.mcPattern === MaterialConsumptionPatternEnum.RECORD) {
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
this.validateInBom(editRow);
|
|
1031
|
+
await this.validateSequenceLoading(editRow, arr);
|
|
1032
|
+
this.validateSubstitute(arr);
|
|
1033
|
+
this.validateLotMixing(arr);
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* 把扫描数据按情况插入到数组的位置,返回新数组
|
|
1037
|
+
* @param row
|
|
1038
|
+
* @param arr
|
|
1039
|
+
* @return {*}
|
|
1040
|
+
*/
|
|
1041
|
+
mergeRowInArr(row, arr) {
|
|
1042
|
+
this.validateInBom(row);
|
|
1043
|
+
const newArr = cloneDeep(arr).filter((i) => i.product_id_);
|
|
1044
|
+
const util = this.findUtilByProductId(row.product_id_);
|
|
1045
|
+
const sameIndex = newArr.findLastIndex((i) => {
|
|
1046
|
+
if (row.product_id_ !== i.product_id_) {
|
|
1047
|
+
return false;
|
|
1048
|
+
}
|
|
1049
|
+
if (i.material_no_) {
|
|
1050
|
+
return i.material_no_ === row.material_no_;
|
|
1051
|
+
} else {
|
|
1052
|
+
return true;
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
if (sameIndex >= 0) {
|
|
1056
|
+
const oldQty = newArr[sameIndex].qty_ ?? 0;
|
|
1057
|
+
const newQty = oldQty + (row.qty_ ?? 0);
|
|
1058
|
+
merge(newArr[sameIndex], row, { qty_: newQty });
|
|
1059
|
+
return newArr;
|
|
1060
|
+
}
|
|
1061
|
+
if (util) {
|
|
1062
|
+
const sameGroupIndex = newArr.findLastIndex((i) => {
|
|
1063
|
+
return util.productIds.includes(i.product_id_);
|
|
1064
|
+
});
|
|
1065
|
+
if (sameGroupIndex >= 0) {
|
|
1066
|
+
newArr.splice(sameGroupIndex + 1, 0, row);
|
|
1067
|
+
return newArr;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
newArr.push(row);
|
|
1071
|
+
return newArr;
|
|
1072
|
+
}
|
|
1073
|
+
/**
|
|
1074
|
+
* 获取BOM里面所有的主料,替换料的id集合
|
|
1075
|
+
*/
|
|
1076
|
+
getAllMaterialIds() {
|
|
1077
|
+
const result = /* @__PURE__ */ new Set();
|
|
1078
|
+
this.bomEntryValidators.forEach((i) => {
|
|
1079
|
+
i.productIds.forEach((i2) => {
|
|
1080
|
+
result.add(i2);
|
|
1081
|
+
});
|
|
1082
|
+
});
|
|
1083
|
+
return Array.from(result).map((i) => i.split(":").pop());
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
const calculate$1 = (...args) => window.NocodeAdapter.utils?.formulaCalculate?.(...args);
|
|
1087
|
+
class MCDataUtil {
|
|
1088
|
+
static allFields = [
|
|
1089
|
+
"product_id_",
|
|
1090
|
+
"material_no_",
|
|
1091
|
+
"qty_consumed_",
|
|
1092
|
+
"qty_",
|
|
1093
|
+
"qty_required_",
|
|
1094
|
+
"routing_operation_id_",
|
|
1095
|
+
"expiration_date_",
|
|
1096
|
+
"qty_required_uom_id_",
|
|
1097
|
+
"qty_uom_id_",
|
|
1098
|
+
"qty_transfer_"
|
|
1099
|
+
];
|
|
1100
|
+
static editMCTable(row, data) {
|
|
1101
|
+
if (!row._MCTABLE) {
|
|
1102
|
+
row._MCTABLE = {};
|
|
1103
|
+
}
|
|
1104
|
+
merge(row, { _MCTABLE: data });
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* 数组转对象并付统一的值
|
|
1108
|
+
* @static
|
|
1109
|
+
* @param arr
|
|
1110
|
+
* @param [keyVal=true]
|
|
1111
|
+
* @return {*}
|
|
1112
|
+
*/
|
|
1113
|
+
static arrToObj(arr, keyVal = true) {
|
|
1114
|
+
return arr.reduce((acc, key) => {
|
|
1115
|
+
acc[key] = keyVal;
|
|
1116
|
+
return acc;
|
|
1117
|
+
}, keyVal);
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* 设置禁用字段
|
|
1121
|
+
* @static
|
|
1122
|
+
* @param opts 参数
|
|
1123
|
+
*/
|
|
1124
|
+
static setFieldsDisabled(opts) {
|
|
1125
|
+
const { row, keys = this.allFields, disabled = true } = opts;
|
|
1126
|
+
this.editMCTable(row, { fieldDisabled: this.arrToObj(keys, disabled) });
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* 设置行数据的编辑状态
|
|
1130
|
+
* @static
|
|
1131
|
+
* @param row
|
|
1132
|
+
* @param editing
|
|
1133
|
+
*/
|
|
1134
|
+
static setRowEditing(row, editing) {
|
|
1135
|
+
row.is_confirmed_ = !editing;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
function toParseRuleConfig(value) {
|
|
1139
|
+
if (!value) {
|
|
1140
|
+
return void 0;
|
|
1141
|
+
}
|
|
1142
|
+
try {
|
|
1143
|
+
return JSON.parse(value);
|
|
1144
|
+
} catch (e) {
|
|
1145
|
+
return {
|
|
1146
|
+
parsingRuleId: value
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
class MaterialConsumeTableController {
|
|
1151
|
+
constructor(tmplBomController, tmplBom) {
|
|
1152
|
+
this.tmplBomController = tmplBomController;
|
|
1153
|
+
this.tmplBom = tmplBom;
|
|
1154
|
+
this.initScanRule(this.tmplBom.barcode_parsing_rules_id_);
|
|
1155
|
+
markRaw(this);
|
|
1156
|
+
this.bomEntriesValidator = new BomEntriesValidator(
|
|
1157
|
+
this.actualBomEntries,
|
|
1158
|
+
this.enableSequenceLoading,
|
|
1159
|
+
this.materialNoNum,
|
|
1160
|
+
this.tmplBomController.historyData,
|
|
1161
|
+
this.tmplBomController.materialNo,
|
|
1162
|
+
this.mcPattern
|
|
1163
|
+
);
|
|
1164
|
+
}
|
|
1165
|
+
tmplBomController;
|
|
1166
|
+
tmplBom;
|
|
1167
|
+
/**
|
|
1168
|
+
* 绘制UI工具,需要pc移动端替换对应的实现类
|
|
1169
|
+
* @static
|
|
1170
|
+
*/
|
|
1171
|
+
static get render() {
|
|
1172
|
+
return window.NocodeAdapter.mcRender;
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* 之前提交的数据(跨表处理的情况)
|
|
1176
|
+
*/
|
|
1177
|
+
beforeData = [];
|
|
1178
|
+
/** 表格数据引用对象 */
|
|
1179
|
+
tableDataRef;
|
|
1180
|
+
/**
|
|
1181
|
+
* 子表组件的信息
|
|
1182
|
+
*/
|
|
1183
|
+
widget;
|
|
1184
|
+
/** 表单模型控制器 */
|
|
1185
|
+
formModelController;
|
|
1186
|
+
/** 当前 paper 上配置的单位转化规则(由组件 setup 注入) */
|
|
1187
|
+
unitConversionRules = [];
|
|
1188
|
+
/** 主表 formState(由组件 setup 注入),用于读取主表字段值 */
|
|
1189
|
+
mainFormState = ref({});
|
|
1190
|
+
/** 批次数量 */
|
|
1191
|
+
get materialNoNum() {
|
|
1192
|
+
return this.tmplBomController.materialNoNum;
|
|
1193
|
+
}
|
|
1194
|
+
/** 物料消耗模式(自身没有配置的话取环境的默认值) */
|
|
1195
|
+
get mcPattern() {
|
|
1196
|
+
return this.tmplBom.material_consumption_pattern_ ?? this.tmplBomController.defaultMCPattern;
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* 解析规则数据对象
|
|
1200
|
+
*/
|
|
1201
|
+
scanRuleInfo;
|
|
1202
|
+
/** 解析规则映射配置 */
|
|
1203
|
+
scanRuleProps;
|
|
1204
|
+
/**
|
|
1205
|
+
* 解析规则配置
|
|
1206
|
+
*/
|
|
1207
|
+
get scanRules() {
|
|
1208
|
+
return this.scanRuleInfo.rules_;
|
|
1209
|
+
}
|
|
1210
|
+
bomEntriesValidator;
|
|
1211
|
+
/**
|
|
1212
|
+
* 是否求用顺序投料
|
|
1213
|
+
* @readonly
|
|
1214
|
+
*/
|
|
1215
|
+
get enableSequenceLoading() {
|
|
1216
|
+
if (this.tmplBom.personal_bom_enabled_) {
|
|
1217
|
+
return this.tmplBom.sequence_loading_enabled_;
|
|
1218
|
+
}
|
|
1219
|
+
return this.tmplBomController.enableSequenceLoading;
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* 实际使用的数据(过滤掉打deleted_标签的数据)
|
|
1223
|
+
*/
|
|
1224
|
+
get actualTableData() {
|
|
1225
|
+
return this.tableDataRef.value.filter((i) => !i.deleted_);
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* 修改表格数据(保留打deleted_标签的数据)
|
|
1229
|
+
*/
|
|
1230
|
+
set actualTableData(value) {
|
|
1231
|
+
const deletedArr = this.tableDataRef.value.filter((i) => i.deleted_);
|
|
1232
|
+
this.tableDataRef.value = [...value, ...deletedArr];
|
|
1233
|
+
}
|
|
1234
|
+
/** 错误信息 */
|
|
1235
|
+
error(message) {
|
|
1236
|
+
MaterialConsumeTableController.render.message({
|
|
1237
|
+
type: "error",
|
|
1238
|
+
content: message
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* 初始化扫描解析规则
|
|
1243
|
+
* @param id (老数据是id,新数据是json对象字符串)
|
|
1244
|
+
*/
|
|
1245
|
+
async initScanRule(id) {
|
|
1246
|
+
if (!id) {
|
|
1247
|
+
return;
|
|
1248
|
+
}
|
|
1249
|
+
this.scanRuleProps = toParseRuleConfig(id);
|
|
1250
|
+
this.scanRuleInfo = await getParseRuleInfo({ id: this.scanRuleProps.parsingRuleId });
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* 变更条码规则
|
|
1254
|
+
*/
|
|
1255
|
+
async changeScanRule() {
|
|
1256
|
+
const { id_, base_id_ } = this.scanRuleInfo ?? {};
|
|
1257
|
+
const newConfig = await MaterialConsumeTableController.render.openChangeRuleModal({
|
|
1258
|
+
config: this.scanRuleProps,
|
|
1259
|
+
subModelKey: this.widget.props.modelKey,
|
|
1260
|
+
formModelController: this.formModelController
|
|
1261
|
+
});
|
|
1262
|
+
if (newConfig) {
|
|
1263
|
+
this.scanRuleProps = newConfig;
|
|
1264
|
+
this.scanRuleInfo = await getParseRuleInfo({ id: this.scanRuleProps.parsingRuleId });
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* 是否人为指定物料
|
|
1269
|
+
* @readonly
|
|
1270
|
+
*/
|
|
1271
|
+
get isPersonalBom() {
|
|
1272
|
+
return this.tmplBom.personal_bom_enabled_;
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* 实际使用的bom明细信息(排序)
|
|
1276
|
+
* @readonly
|
|
1277
|
+
*/
|
|
1278
|
+
get actualBomEntries() {
|
|
1279
|
+
const entries = this.isPersonalBom ? this.tmplBom.entries_ : this.tmplBomController.bomEntries;
|
|
1280
|
+
return (entries ?? []).sort(
|
|
1281
|
+
(a, b) => (a.operation_sort_num_ ?? 0) - (b.operation_sort_num_ ?? 0)
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* 根据bom明细构造子表数据(初始化时)
|
|
1286
|
+
*/
|
|
1287
|
+
calcFormState() {
|
|
1288
|
+
if (this.tmplBom.material_loading_model_enabled_) ;
|
|
1289
|
+
else if (this.isPersonalBom || this.tmplBom.bom_init_enabled_) {
|
|
1290
|
+
return this.tmplBom.entries_.map((i) => {
|
|
1291
|
+
return {
|
|
1292
|
+
product_id_: i.product_id_,
|
|
1293
|
+
qty_required_: i.qty_required_ * this.materialNoNum
|
|
1294
|
+
// routing_operation_id_: this.tmplBomController.operationId,
|
|
1295
|
+
};
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* 根据数据计算需要禁用的字段
|
|
1301
|
+
* @param row
|
|
1302
|
+
* @return {*}
|
|
1303
|
+
*/
|
|
1304
|
+
calcDisabledFields(row) {
|
|
1305
|
+
const disabledKeys = ["qty_consumed_"];
|
|
1306
|
+
const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD;
|
|
1307
|
+
if (!isRecordPattern) {
|
|
1308
|
+
disabledKeys.push("qty_required_");
|
|
1309
|
+
}
|
|
1310
|
+
if (row.product_id_) {
|
|
1311
|
+
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
1312
|
+
if (util?.bomEntry.type_ === "view") {
|
|
1313
|
+
disabledKeys.push("material_no_", "qty_");
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
return disabledKeys;
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* 获取bom内主物料,替换物料查询的算子
|
|
1320
|
+
* @return {*}
|
|
1321
|
+
*/
|
|
1322
|
+
getProductQuery() {
|
|
1323
|
+
if (this.mcPattern === MaterialConsumptionPatternEnum.RECORD) {
|
|
1324
|
+
return void 0;
|
|
1325
|
+
}
|
|
1326
|
+
return {
|
|
1327
|
+
"id_.in": this.bomEntriesValidator.getAllMaterialIds()
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* 是否是第一行且物料是空行
|
|
1332
|
+
* @return {*}
|
|
1333
|
+
*/
|
|
1334
|
+
isFirstBlankRow() {
|
|
1335
|
+
return this.actualTableData.length === 1 && !this.actualTableData[0].product_id_;
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* 解析扫码的数据
|
|
1339
|
+
* 并判断是否能存入表中,返回对象则表示可以存入
|
|
1340
|
+
* @param str
|
|
1341
|
+
*/
|
|
1342
|
+
async parseScanStr(str) {
|
|
1343
|
+
if (!this.isFirstBlankRow() && this.hasEditingRow()) {
|
|
1344
|
+
return;
|
|
1345
|
+
}
|
|
1346
|
+
const isRecordPattern = this.mcPattern === MaterialConsumptionPatternEnum.RECORD;
|
|
1347
|
+
const data = getParseRuleValue(str, this.scanRules);
|
|
1348
|
+
console.log("parseScanStr", data);
|
|
1349
|
+
const arr = await materialCheck({
|
|
1350
|
+
material_no_: data.materialCode,
|
|
1351
|
+
production_identification_name_: data.lot,
|
|
1352
|
+
qty_: data.qty,
|
|
1353
|
+
validate_: data.expiration,
|
|
1354
|
+
// 记录模式传null,后台就不校验了
|
|
1355
|
+
bom_entries_: isRecordPattern ? null : this.actualBomEntries,
|
|
1356
|
+
operation_id_: this.tmplBomController.operationId
|
|
1357
|
+
}) || (isRecordPattern ? [{ productionIdentificationName: data.lot }] : null);
|
|
1358
|
+
if (!arr) {
|
|
1359
|
+
this.error($t("sys.edhr.mcTable.notInBom"));
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
let materialData = arr[0];
|
|
1363
|
+
if (arr.length > 1 && !isRecordPattern) {
|
|
1364
|
+
const ids = this.actualTableData.map((i) => i.product_id_);
|
|
1365
|
+
const find = arr.find((j) => ids.includes(j.materialId));
|
|
1366
|
+
if (!find) {
|
|
1367
|
+
throw new Error($t("sys.edhr.mcTable.noMatchMaterial"));
|
|
1368
|
+
}
|
|
1369
|
+
materialData = find;
|
|
1370
|
+
}
|
|
1371
|
+
const row = {
|
|
1372
|
+
product_id_: materialData.materialId,
|
|
1373
|
+
material_no_: materialData.productionIdentificationName,
|
|
1374
|
+
qty_: data.qty,
|
|
1375
|
+
is_confirmed_: false
|
|
1376
|
+
};
|
|
1377
|
+
if (isRecordPattern && !row.product_id_) {
|
|
1378
|
+
row._scanFallback = true;
|
|
1379
|
+
}
|
|
1380
|
+
if (this.scanRuleProps?.fillMapArr?.length) {
|
|
1381
|
+
const fillData = calcFillData(data, this.scanRuleProps.fillMapArr);
|
|
1382
|
+
console.log("fillData", fillData);
|
|
1383
|
+
Object.assign(row, fillData);
|
|
1384
|
+
}
|
|
1385
|
+
if (data.expiration) {
|
|
1386
|
+
row.expiration_date_ = dayjs(data.expiration).format("YYYY-MM-DD");
|
|
1387
|
+
}
|
|
1388
|
+
this.setDefaultValue(row);
|
|
1389
|
+
try {
|
|
1390
|
+
const newArr = this.bomEntriesValidator.mergeRowInArr(row, this.actualTableData);
|
|
1391
|
+
await this.bomEntriesValidator.validateScanCanInsert(newArr);
|
|
1392
|
+
if (this.isOnlyEmptyRow()) {
|
|
1393
|
+
const firstRow = this.actualTableData[0];
|
|
1394
|
+
defaults(row, firstRow);
|
|
1395
|
+
}
|
|
1396
|
+
this.tableDataRef.value = newArr;
|
|
1397
|
+
const editingRow = this.actualTableData.find((i) => !i.is_confirmed_);
|
|
1398
|
+
if (editingRow && row.product_id_) {
|
|
1399
|
+
this.confirm(editingRow);
|
|
1400
|
+
}
|
|
1401
|
+
} catch (e) {
|
|
1402
|
+
console.error(e);
|
|
1403
|
+
if (e.message) {
|
|
1404
|
+
this.error(e.message);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
/** 扫描是否已经打开 */
|
|
1409
|
+
isScanOpen = false;
|
|
1410
|
+
/**
|
|
1411
|
+
* 打开扫描弹窗
|
|
1412
|
+
* @param opts
|
|
1413
|
+
*/
|
|
1414
|
+
async openScanModal(opts) {
|
|
1415
|
+
if (this.isScanOpen) {
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
if (!this.scanRuleInfo) {
|
|
1419
|
+
this.error($t("sys.edhr.mcTable.scanRuleNotFound"));
|
|
1420
|
+
return;
|
|
1421
|
+
}
|
|
1422
|
+
const { title } = opts;
|
|
1423
|
+
this.isScanOpen = true;
|
|
1424
|
+
await MaterialConsumeTableController.render.openScanModal({
|
|
1425
|
+
title,
|
|
1426
|
+
onScan: async (str) => {
|
|
1427
|
+
console.log("onScan", str);
|
|
1428
|
+
await this.parseScanStr(str);
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
this.isScanOpen = false;
|
|
1432
|
+
}
|
|
1433
|
+
/**
|
|
1434
|
+
* 打开扫描弹窗
|
|
1435
|
+
* @param opts
|
|
1436
|
+
*/
|
|
1437
|
+
async openBomModal() {
|
|
1438
|
+
if (!this.actualBomEntries) {
|
|
1439
|
+
return;
|
|
1440
|
+
}
|
|
1441
|
+
await MaterialConsumeTableController.render.openBomModal({
|
|
1442
|
+
bomList: this.actualBomEntries,
|
|
1443
|
+
onSubstitute: async () => {
|
|
1444
|
+
console.log("一键导入数据逻辑");
|
|
1445
|
+
}
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* 消耗表组件setup时调用
|
|
1450
|
+
* @param opts
|
|
1451
|
+
*/
|
|
1452
|
+
async setup(opts) {
|
|
1453
|
+
this.tableDataRef = opts.tableDataRef;
|
|
1454
|
+
this.widget = opts.widget;
|
|
1455
|
+
this.formModelController = opts.formModelController;
|
|
1456
|
+
this.unitConversionRules = opts.unitConversionRules ?? [];
|
|
1457
|
+
this.mainFormState = opts.mainFormState ?? ref({});
|
|
1458
|
+
console.log("setup", this.tableDataRef);
|
|
1459
|
+
if (this.actualTableData.length === 1) {
|
|
1460
|
+
const firstRow = this.actualTableData[0];
|
|
1461
|
+
if (!firstRow.product_id_) {
|
|
1462
|
+
MCDataUtil.setRowEditing(firstRow, true);
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
onUnmounted(() => {
|
|
1466
|
+
MaterialConsumeTableController.render.destroyAllModals();
|
|
1467
|
+
});
|
|
1468
|
+
}
|
|
1469
|
+
/** 校验有效期 */
|
|
1470
|
+
validateExpiration(row) {
|
|
1471
|
+
if (row.expiration_date_) {
|
|
1472
|
+
if (dayjs(row.expiration_date_).endOf("day").isBefore(dayjs())) {
|
|
1473
|
+
throw new Error($t("sys.edhr.mcTable.expirationError"));
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* 单位转化规则钩子
|
|
1479
|
+
* 触发时机:扫码插入自动确认、手动点确认按钮(均汇聚到 confirm)
|
|
1480
|
+
*
|
|
1481
|
+
* 规则匹配:只取第一条满足条件的规则(find)
|
|
1482
|
+
* 字段来源:
|
|
1483
|
+
* - formulaRuleInput(输入值):固定读子表 row.qty_
|
|
1484
|
+
* - targetField 含 '.':子表字段 tableField.fieldKey,读 row[fieldKey]
|
|
1485
|
+
* - targetField 不含 '.':主表字段,读 mainFormState[fieldKey]
|
|
1486
|
+
*/
|
|
1487
|
+
async applyUnitConversionRules(row) {
|
|
1488
|
+
if (!this.unitConversionRules?.length) return;
|
|
1489
|
+
const { qty_uom_id_, qty_required_uom_id_, product_id_ } = row;
|
|
1490
|
+
if (!qty_uom_id_ || !qty_required_uom_id_) return;
|
|
1491
|
+
const matchedRule = this.unitConversionRules.find((r) => {
|
|
1492
|
+
const { materialConsumeField, targetUnitId: targetUnitId2, sourceUnitId, materialId } = r;
|
|
1493
|
+
if (qty_required_uom_id_ !== sourceUnitId || qty_uom_id_ !== targetUnitId2) return false;
|
|
1494
|
+
if (materialId && product_id_ !== materialId) return false;
|
|
1495
|
+
if (materialConsumeField && materialConsumeField !== this.widget.props.field) return false;
|
|
1496
|
+
return true;
|
|
1497
|
+
});
|
|
1498
|
+
if (!matchedRule) return;
|
|
1499
|
+
const { transformFields, formulaContent, targetUnitId } = matchedRule;
|
|
1500
|
+
const formData = transformFields.reduce((acc, cur) => {
|
|
1501
|
+
if (!cur.targetField) return acc;
|
|
1502
|
+
if (cur.sourceField === FormulaRuleFieldKeyEnum.INPUT) {
|
|
1503
|
+
acc[cur.sourceField] = row.qty_;
|
|
1504
|
+
} else if (cur.targetField.includes(".")) {
|
|
1505
|
+
const fieldKey = cur.targetField.split(".").pop();
|
|
1506
|
+
acc[cur.sourceField] = row[fieldKey];
|
|
1507
|
+
} else {
|
|
1508
|
+
acc[cur.sourceField] = this.mainFormState.value?.[cur.targetField];
|
|
1509
|
+
}
|
|
1510
|
+
return acc;
|
|
1511
|
+
}, {});
|
|
1512
|
+
try {
|
|
1513
|
+
const res = await calculate$1(formulaContent, formData);
|
|
1514
|
+
Object.assign(row, {
|
|
1515
|
+
qty_transfer_: res,
|
|
1516
|
+
qty_transfer_uom_id_: targetUnitId,
|
|
1517
|
+
transfer_formula_: formulaContent
|
|
1518
|
+
});
|
|
1519
|
+
} catch (e) {
|
|
1520
|
+
console.error("[applyUnitConversionRules] calculate failed", e);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* 校验数据,并退出编辑
|
|
1525
|
+
* @param row
|
|
1526
|
+
*/
|
|
1527
|
+
async confirm(row) {
|
|
1528
|
+
try {
|
|
1529
|
+
if (this.mcPattern === MaterialConsumptionPatternEnum.RECORD) {
|
|
1530
|
+
if (!row.product_id_) {
|
|
1531
|
+
throw new Error($t("sys.edhr.mcTable.materialEmptyError"));
|
|
1532
|
+
}
|
|
1533
|
+
this.validateExpiration(row);
|
|
1534
|
+
} else {
|
|
1535
|
+
await this.bomEntriesValidator.validate(this.actualTableData);
|
|
1536
|
+
}
|
|
1537
|
+
const isUnique = await judgeUnique({
|
|
1538
|
+
modelKey: this.widget.props.modelKey,
|
|
1539
|
+
data: this.actualTableData
|
|
1540
|
+
});
|
|
1541
|
+
if (!isUnique) {
|
|
1542
|
+
throw new Error($t("当前数据与已有的数据存在重复的唯一字段,请修改后重试"));
|
|
1543
|
+
}
|
|
1544
|
+
await this.applyUnitConversionRules(row);
|
|
1545
|
+
MCDataUtil.setRowEditing(row, false);
|
|
1546
|
+
} catch (e) {
|
|
1547
|
+
if (e.message) {
|
|
1548
|
+
this.error(e.message);
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* 生成校验清单格式的报错
|
|
1554
|
+
* @param message
|
|
1555
|
+
* @return {*}
|
|
1556
|
+
*/
|
|
1557
|
+
calcErrorObj(message) {
|
|
1558
|
+
return {
|
|
1559
|
+
field: this.widget.props.field + "_0_product_id_",
|
|
1560
|
+
message: JSON.stringify({
|
|
1561
|
+
message,
|
|
1562
|
+
showFieldName: $t("sys.model.product"),
|
|
1563
|
+
showModelKey: this.widget.props.modelKey,
|
|
1564
|
+
showModelName: this.widget.props.tableTitle,
|
|
1565
|
+
subFieldKey: this.widget.props.field,
|
|
1566
|
+
targetFieldId: "product_id_"
|
|
1567
|
+
})
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
/**
|
|
1571
|
+
* 是否是单独一行空数据
|
|
1572
|
+
*/
|
|
1573
|
+
isOnlyEmptyRow() {
|
|
1574
|
+
if (this.actualTableData.length === 1) {
|
|
1575
|
+
const row = this.actualTableData[0];
|
|
1576
|
+
const data = pickBy(row, (v, k) => ["product_id_"].includes(k) && !isNil(v) && v !== "");
|
|
1577
|
+
console.log("isOnlyEmptyRow", data);
|
|
1578
|
+
return Object.keys(data).length === 0;
|
|
1579
|
+
}
|
|
1580
|
+
return false;
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* 提交的时候的校验
|
|
1584
|
+
*/
|
|
1585
|
+
async submitValidate() {
|
|
1586
|
+
if (this.isOnlyEmptyRow()) {
|
|
1587
|
+
return;
|
|
1588
|
+
}
|
|
1589
|
+
let errorObj;
|
|
1590
|
+
const hasEditing = this.hasEditingRow(false);
|
|
1591
|
+
if (hasEditing) {
|
|
1592
|
+
errorObj = this.calcErrorObj($t("sys.edhr.mcTable.hasEditingRow"));
|
|
1593
|
+
}
|
|
1594
|
+
try {
|
|
1595
|
+
this.bomEntriesValidator.validateSequenceLoading(void 0, this.actualTableData);
|
|
1596
|
+
} catch (e) {
|
|
1597
|
+
if (e.message) {
|
|
1598
|
+
errorObj = this.calcErrorObj(e.message);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
return errorObj;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* 是否有正在编辑的行
|
|
1605
|
+
* @return {*}
|
|
1606
|
+
*/
|
|
1607
|
+
hasEditingRow(showMessage = true) {
|
|
1608
|
+
const hasEditing = this.actualTableData.some((i) => !i.is_confirmed_);
|
|
1609
|
+
if (hasEditing && showMessage) {
|
|
1610
|
+
this.error($t("sys.edhr.mcTable.onlyOneEditingRow"));
|
|
1611
|
+
}
|
|
1612
|
+
return hasEditing;
|
|
1613
|
+
}
|
|
1614
|
+
/**
|
|
1615
|
+
* 选中行开启编辑
|
|
1616
|
+
* @param row
|
|
1617
|
+
*/
|
|
1618
|
+
editRow(row) {
|
|
1619
|
+
if (this.hasEditingRow()) {
|
|
1620
|
+
return;
|
|
1621
|
+
}
|
|
1622
|
+
const isLast = this.actualTableData[this.actualTableData.length - 1] === row;
|
|
1623
|
+
if (this.enableSequenceLoading && !isLast) {
|
|
1624
|
+
this.error($t("sys.edhr.mcTable.onlyLastRowCanEdit"));
|
|
1625
|
+
return;
|
|
1626
|
+
}
|
|
1627
|
+
MCDataUtil.setRowEditing(row, true);
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
* 更新整个数组的所有行的已消耗数量
|
|
1631
|
+
* @param row
|
|
1632
|
+
*/
|
|
1633
|
+
updateRowConsumed() {
|
|
1634
|
+
const modifySingleRow = (index) => {
|
|
1635
|
+
const row = this.actualTableData[index];
|
|
1636
|
+
if (!row.product_id_) {
|
|
1637
|
+
row.qty_consumed_ = 0 + (row.qty_ ?? 0);
|
|
1638
|
+
return;
|
|
1639
|
+
}
|
|
1640
|
+
let total = 0;
|
|
1641
|
+
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
1642
|
+
const beforeArr = this.actualTableData.slice(0, index + 1);
|
|
1643
|
+
if (util) {
|
|
1644
|
+
total += util.hasConsumed;
|
|
1645
|
+
const filterGroupData = util.filterGroupData(beforeArr);
|
|
1646
|
+
filterGroupData.forEach((i) => {
|
|
1647
|
+
total += i.qty_ ?? 0;
|
|
1648
|
+
});
|
|
1649
|
+
row.qty_consumed_ = total;
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
for (let index = 0; index < this.actualTableData.length; index++) {
|
|
1653
|
+
modifySingleRow(index);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
/**
|
|
1657
|
+
* 设置默认值,如工序,需求数量/已消耗数量
|
|
1658
|
+
* @param row
|
|
1659
|
+
*/
|
|
1660
|
+
setDefaultValue(row) {
|
|
1661
|
+
if (!row.routing_operation_id_) {
|
|
1662
|
+
row.routing_operation_id_ = this.tmplBomController.operationId;
|
|
1663
|
+
}
|
|
1664
|
+
if (row.product_id_) {
|
|
1665
|
+
const util = this.bomEntriesValidator.findUtilByProductId(row.product_id_);
|
|
1666
|
+
if (util) {
|
|
1667
|
+
row.qty_required_ = util.total;
|
|
1668
|
+
row.qty_consumed_ = util.hasConsumed;
|
|
1669
|
+
row.bom_entry_id_ = util.bomEntry.id_;
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
/**
|
|
1674
|
+
* 统一处理表格内部的字段的值变更
|
|
1675
|
+
* @param opts
|
|
1676
|
+
*/
|
|
1677
|
+
handleChange(opts) {
|
|
1678
|
+
const { field, row, value, option } = opts;
|
|
1679
|
+
console.log("handleChange", opts);
|
|
1680
|
+
if (field === "product_id_") {
|
|
1681
|
+
if (row._scanFallback) {
|
|
1682
|
+
return;
|
|
1683
|
+
}
|
|
1684
|
+
row.material_no_ = void 0;
|
|
1685
|
+
row.qty_ = void 0;
|
|
1686
|
+
row.qty_consumed_ = void 0;
|
|
1687
|
+
row.qty_required_ = void 0;
|
|
1688
|
+
this.setDefaultValue(row);
|
|
1689
|
+
} else if (field === "material_no_") {
|
|
1690
|
+
row.product_id_ = option.product_id_;
|
|
1691
|
+
this.setDefaultValue(row);
|
|
1692
|
+
} else if (field === "qty_") {
|
|
1693
|
+
this.updateRowConsumed();
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
function useMaterialBalance() {
|
|
1698
|
+
async function getConsumeData({ cloneRuntimeJson, operationId, materialNo }) {
|
|
1699
|
+
const balanceTables = cloneRuntimeJson?.paper?.props?.materialBalanceTableList;
|
|
1700
|
+
if (!balanceTables?.length || !materialNo || !operationId) return {};
|
|
1701
|
+
const res = await api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey(
|
|
1702
|
+
{
|
|
1703
|
+
modelCategory: "entity",
|
|
1704
|
+
bsKey: "get_material_consume_group_product",
|
|
1705
|
+
modelKey: "em_material_consume"
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
routing_operation_id_: operationId,
|
|
1709
|
+
material_no_: materialNo
|
|
1710
|
+
}
|
|
1711
|
+
);
|
|
1712
|
+
return balanceTables.reduce((obj, e) => {
|
|
1713
|
+
obj[e.masterSubField] = res?.data.map((e2) => {
|
|
1714
|
+
const productDict = res?.dict?.product_id_ || {};
|
|
1715
|
+
return {
|
|
1716
|
+
...e2,
|
|
1717
|
+
product_id_label: productDict[e2.product_id_]
|
|
1718
|
+
};
|
|
1719
|
+
});
|
|
1720
|
+
return obj;
|
|
1721
|
+
}, {});
|
|
1722
|
+
}
|
|
1723
|
+
function openConsumeModal(data) {
|
|
1724
|
+
window.NocodeAdapter.mbRender?.openConsumeModal(cloneDeep(data));
|
|
1725
|
+
}
|
|
1726
|
+
function destoryConsumeModal() {
|
|
1727
|
+
window.NocodeAdapter.mbRender?.destoryConsumeModal();
|
|
1728
|
+
}
|
|
1729
|
+
return {
|
|
1730
|
+
getConsumeData,
|
|
1731
|
+
openConsumeModal,
|
|
1732
|
+
destoryConsumeModal
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
var SubTableActionEnum = /* @__PURE__ */ ((SubTableActionEnum2) => {
|
|
1736
|
+
SubTableActionEnum2["QuickFillRowCurrent"] = "quickFillRowCurrent";
|
|
1737
|
+
SubTableActionEnum2["InsertRowBefore"] = "insertRowBefore";
|
|
1738
|
+
SubTableActionEnum2["InsertRowAfter"] = "insertRowAfter";
|
|
1739
|
+
SubTableActionEnum2["Insert1RowAfter"] = "insert1RowAfter";
|
|
1740
|
+
SubTableActionEnum2["CopyRowAfter"] = "copyRowAfter";
|
|
1741
|
+
SubTableActionEnum2["CopyRow2Last"] = "copyRow2Last";
|
|
1742
|
+
SubTableActionEnum2["DeleteRowCurrent"] = "deleteRowCurrent";
|
|
1743
|
+
SubTableActionEnum2["CONFIRM"] = "CONFIRM";
|
|
1744
|
+
SubTableActionEnum2["SCAN"] = "SCAN";
|
|
1745
|
+
SubTableActionEnum2["VIEW_BOM"] = "VIEW_BOM";
|
|
1746
|
+
SubTableActionEnum2["CHANGE_PARSE_RULE"] = "CHANGE_PARSE_RULE";
|
|
1747
|
+
SubTableActionEnum2["RowEdit"] = "rowEdit";
|
|
1748
|
+
return SubTableActionEnum2;
|
|
1749
|
+
})(SubTableActionEnum || {});
|
|
1750
|
+
var SubTableActionMenuTypeEnum = /* @__PURE__ */ ((SubTableActionMenuTypeEnum2) => {
|
|
1751
|
+
SubTableActionMenuTypeEnum2["DIVIDER"] = "divider";
|
|
1752
|
+
SubTableActionMenuTypeEnum2["SUBTITLE"] = "subtitle";
|
|
1753
|
+
SubTableActionMenuTypeEnum2["ACTION"] = "action";
|
|
1754
|
+
SubTableActionMenuTypeEnum2["SUBMENU"] = "submenu";
|
|
1755
|
+
return SubTableActionMenuTypeEnum2;
|
|
1756
|
+
})(SubTableActionMenuTypeEnum || {});
|
|
1757
|
+
function getMenuByAction(type) {
|
|
1758
|
+
const map = {
|
|
1759
|
+
[SubTableActionEnum.SCAN]: {
|
|
1760
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1761
|
+
key: SubTableActionEnum.SCAN,
|
|
1762
|
+
label: "条码扫描",
|
|
1763
|
+
icon: "size24 icon-saoma1"
|
|
1764
|
+
},
|
|
1765
|
+
[SubTableActionEnum.VIEW_BOM]: {
|
|
1766
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1767
|
+
key: SubTableActionEnum.VIEW_BOM,
|
|
1768
|
+
label: "BOM查看",
|
|
1769
|
+
icon: "size24 icon-a-bom11"
|
|
1770
|
+
},
|
|
1771
|
+
[SubTableActionEnum.CHANGE_PARSE_RULE]: {
|
|
1772
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1773
|
+
key: SubTableActionEnum.CHANGE_PARSE_RULE,
|
|
1774
|
+
label: "条码解析规则变更",
|
|
1775
|
+
icon: "icon-tiaomajiexi"
|
|
1776
|
+
},
|
|
1777
|
+
[SubTableActionEnum.QuickFillRowCurrent]: {
|
|
1778
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1779
|
+
key: SubTableActionEnum.QuickFillRowCurrent,
|
|
1780
|
+
label: "快速填报",
|
|
1781
|
+
icon: "icon-zhongxinbianjidangqianhang"
|
|
1782
|
+
},
|
|
1783
|
+
[SubTableActionEnum.RowEdit]: {
|
|
1784
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1785
|
+
key: SubTableActionEnum.RowEdit,
|
|
1786
|
+
label: "重新编辑当前行",
|
|
1787
|
+
icon: "icon-zhongxinbianjidangqianhang"
|
|
1788
|
+
},
|
|
1789
|
+
[SubTableActionEnum.Insert1RowAfter]: {
|
|
1790
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1791
|
+
key: SubTableActionEnum.Insert1RowAfter,
|
|
1792
|
+
label: "加一行",
|
|
1793
|
+
icon: "icon-jiayihang"
|
|
1794
|
+
},
|
|
1795
|
+
[SubTableActionEnum.CopyRowAfter]: {
|
|
1796
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1797
|
+
key: SubTableActionEnum.CopyRowAfter,
|
|
1798
|
+
label: "复制到下一行",
|
|
1799
|
+
icon: "icon-fuzhidaoxiayihang"
|
|
1800
|
+
},
|
|
1801
|
+
[SubTableActionEnum.CopyRow2Last]: {
|
|
1802
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1803
|
+
key: SubTableActionEnum.CopyRow2Last,
|
|
1804
|
+
label: "复制到最后",
|
|
1805
|
+
icon: "icon-fuzhidaozuihou"
|
|
1806
|
+
},
|
|
1807
|
+
[SubTableActionEnum.InsertRowBefore]: {
|
|
1808
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1809
|
+
key: SubTableActionEnum.InsertRowBefore,
|
|
1810
|
+
label: "在上方插入行",
|
|
1811
|
+
icon: "icon-shangfangcharuhang"
|
|
1812
|
+
},
|
|
1813
|
+
[SubTableActionEnum.InsertRowAfter]: {
|
|
1814
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1815
|
+
key: SubTableActionEnum.InsertRowAfter,
|
|
1816
|
+
label: "在下方插入行",
|
|
1817
|
+
icon: "icon-xiafangcharuhang"
|
|
1818
|
+
},
|
|
1819
|
+
[SubTableActionEnum.DeleteRowCurrent]: {
|
|
1820
|
+
type: SubTableActionMenuTypeEnum.ACTION,
|
|
1821
|
+
key: SubTableActionEnum.DeleteRowCurrent,
|
|
1822
|
+
label: "删除行",
|
|
1823
|
+
icon: "size24 icon-a-shanchubiaoge"
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
return map[type];
|
|
1827
|
+
}
|
|
1828
|
+
function getCopySubMenu() {
|
|
1829
|
+
return {
|
|
1830
|
+
type: SubTableActionMenuTypeEnum.SUBMENU,
|
|
1831
|
+
key: "copy",
|
|
1832
|
+
label: "复制",
|
|
1833
|
+
icon: "icon-fuzhi2",
|
|
1834
|
+
children: [
|
|
1835
|
+
getMenuByAction(SubTableActionEnum.CopyRowAfter),
|
|
1836
|
+
getMenuByAction(SubTableActionEnum.CopyRow2Last)
|
|
1837
|
+
]
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
function getInsertSubMenu() {
|
|
1841
|
+
return {
|
|
1842
|
+
type: SubTableActionMenuTypeEnum.SUBMENU,
|
|
1843
|
+
key: "insert",
|
|
1844
|
+
label: "插入",
|
|
1845
|
+
icon: "icon-charu",
|
|
1846
|
+
children: [
|
|
1847
|
+
getMenuByAction(SubTableActionEnum.InsertRowBefore),
|
|
1848
|
+
getMenuByAction(SubTableActionEnum.InsertRowAfter)
|
|
1849
|
+
]
|
|
1850
|
+
};
|
|
1851
|
+
}
|
|
1852
|
+
function mergeOverrideArrays(object, ...sources) {
|
|
1853
|
+
return mergeWith(object, ...sources, (objValue, srcValue) => {
|
|
1854
|
+
if (Array.isArray(srcValue)) {
|
|
1855
|
+
return srcValue;
|
|
1856
|
+
}
|
|
1857
|
+
return void 0;
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
class TdHandler {
|
|
1861
|
+
/** 修改过后才有 */
|
|
1862
|
+
newTd;
|
|
1863
|
+
/** 原始的Td */
|
|
1864
|
+
oldTd;
|
|
1865
|
+
get td() {
|
|
1866
|
+
return this.newTd || this.oldTd;
|
|
1867
|
+
}
|
|
1868
|
+
constructor(oldTd) {
|
|
1869
|
+
this.oldTd = oldTd;
|
|
1870
|
+
}
|
|
1871
|
+
/** 是否是隐藏字段 */
|
|
1872
|
+
get isHidden() {
|
|
1873
|
+
return this.td.cellHidden;
|
|
1874
|
+
}
|
|
1875
|
+
/** 字段key */
|
|
1876
|
+
get fieldKey() {
|
|
1877
|
+
return this.td.cellWidget?.props.field;
|
|
1878
|
+
}
|
|
1879
|
+
/** 是否是字段的td */
|
|
1880
|
+
get isField() {
|
|
1881
|
+
return !!this.fieldKey;
|
|
1882
|
+
}
|
|
1883
|
+
/** 是否是可见的字段td */
|
|
1884
|
+
get isVisibleField() {
|
|
1885
|
+
return !this.isHidden && this.isField;
|
|
1886
|
+
}
|
|
1887
|
+
/** 修改时触发,克隆一个新的 */
|
|
1888
|
+
cloneTd() {
|
|
1889
|
+
if (!this.newTd) {
|
|
1890
|
+
this.newTd = cloneDeep(this.td);
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
/** 字段是否禁用 */
|
|
1894
|
+
get fieldDisabled() {
|
|
1895
|
+
return !!this.td.cellWidget.props.disabled;
|
|
1896
|
+
}
|
|
1897
|
+
set fieldDisabled(val) {
|
|
1898
|
+
this.cloneTd();
|
|
1899
|
+
this.td.cellWidget.props.disabled = val;
|
|
1900
|
+
if (val) {
|
|
1901
|
+
this.td.cellWidget.props.readonly = false;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
/** 字段的是否只读 */
|
|
1905
|
+
get fieldReadonly() {
|
|
1906
|
+
return !!this.td.cellWidget.props.readonly;
|
|
1907
|
+
}
|
|
1908
|
+
set fieldReadonly(val) {
|
|
1909
|
+
this.cloneTd();
|
|
1910
|
+
this.td.cellWidget.props.readonly = val;
|
|
1911
|
+
if (val) {
|
|
1912
|
+
this.td.cellWidget.props.disabled = false;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
/** 字段的是否必填 */
|
|
1916
|
+
get fieldRequired() {
|
|
1917
|
+
return !!this.td.cellWidget.props.readonly;
|
|
1918
|
+
}
|
|
1919
|
+
set fieldRequired(val) {
|
|
1920
|
+
this.cloneTd();
|
|
1921
|
+
this.td.cellWidget.props.required = val;
|
|
1922
|
+
}
|
|
1923
|
+
/** 修改过后给修改后的,没修改给原始的 */
|
|
1924
|
+
getCurrentTd() {
|
|
1925
|
+
return this.td;
|
|
1926
|
+
}
|
|
1927
|
+
/** 合并修改 */
|
|
1928
|
+
mergeTd(newTd) {
|
|
1929
|
+
this.cloneTd();
|
|
1930
|
+
mergeOverrideArrays(this.td, newTd);
|
|
1931
|
+
}
|
|
1932
|
+
/** 字段额外的查询条件 */
|
|
1933
|
+
get fieldQuery() {
|
|
1934
|
+
return this.td.cellWidget.props.newSpecificConfig?.newQueryData;
|
|
1935
|
+
}
|
|
1936
|
+
set fieldQuery(newQueryData) {
|
|
1937
|
+
this.mergeTd({ cellWidget: { props: { newSpecificConfig: { newQueryData } } } });
|
|
1938
|
+
}
|
|
1939
|
+
/** 字段自定义数据源加载函数 */
|
|
1940
|
+
get fieldCustomLoader() {
|
|
1941
|
+
return this.td.cellWidget.props.newSpecificConfig?.customLoader;
|
|
1942
|
+
}
|
|
1943
|
+
set fieldCustomLoader(customLoader) {
|
|
1944
|
+
this.mergeTd({ cellWidget: { props: { newSpecificConfig: { customLoader } } } });
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
class SubTableCore {
|
|
1948
|
+
constructor(params, factory) {
|
|
1949
|
+
this.factory = factory;
|
|
1950
|
+
this.ctx = params;
|
|
1951
|
+
this.compSetup = this.compSetup.bind(this);
|
|
1952
|
+
this.onScan = this.onScan.bind(this);
|
|
1953
|
+
}
|
|
1954
|
+
factory;
|
|
1955
|
+
/**上下文参数 */
|
|
1956
|
+
ctx;
|
|
1957
|
+
/** 页面级上下文 */
|
|
1958
|
+
get pageCtx() {
|
|
1959
|
+
return this.factory.ctx;
|
|
1960
|
+
}
|
|
1961
|
+
/** 消息,弹窗等工具 */
|
|
1962
|
+
get openUtil() {
|
|
1963
|
+
return window.NocodeAdapter.openUtil;
|
|
1964
|
+
}
|
|
1965
|
+
/** 是否显示快速填报 */
|
|
1966
|
+
get quickFill() {
|
|
1967
|
+
return !!this.ctx.widget.props.quickFill;
|
|
1968
|
+
}
|
|
1969
|
+
/** 子表在主表里的字段key */
|
|
1970
|
+
get subFieldKey() {
|
|
1971
|
+
return this.ctx.widget.props.field;
|
|
1972
|
+
}
|
|
1973
|
+
/** 子表的模型key */
|
|
1974
|
+
get subModelKey() {
|
|
1975
|
+
return this.ctx.widget.props.subModelKey;
|
|
1976
|
+
}
|
|
1977
|
+
/** 业务表的配置 */
|
|
1978
|
+
get bizTableConfig() {
|
|
1979
|
+
return this.ctx.widget.props.bizTableConfig;
|
|
1980
|
+
}
|
|
1981
|
+
/** 表单是否暂存或者提交过 */
|
|
1982
|
+
get isDataProcessed() {
|
|
1983
|
+
return ["STASH", "SUBMIT"].includes(this.pageCtx.docInfo.dataStatus);
|
|
1984
|
+
}
|
|
1985
|
+
/** 绘制UI相关工具 */
|
|
1986
|
+
get render() {
|
|
1987
|
+
return window.NocodeAdapter.subTableRender;
|
|
1988
|
+
}
|
|
1989
|
+
/** 表单模型控制器 */
|
|
1990
|
+
formModelController;
|
|
1991
|
+
// ! UI函数开始
|
|
1992
|
+
/** 错误信息 */
|
|
1993
|
+
error(params) {
|
|
1994
|
+
this.openUtil.message({
|
|
1995
|
+
type: "error",
|
|
1996
|
+
...params
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
/** 成功信息 */
|
|
2000
|
+
success(params) {
|
|
2001
|
+
this.openUtil.message({
|
|
2002
|
+
type: "success",
|
|
2003
|
+
...params
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
/** 警告信息 */
|
|
2007
|
+
warning(params) {
|
|
2008
|
+
this.openUtil.message({
|
|
2009
|
+
type: "warning",
|
|
2010
|
+
...params
|
|
2011
|
+
});
|
|
2012
|
+
}
|
|
2013
|
+
// ! UI函数结束
|
|
2014
|
+
/**
|
|
2015
|
+
* 执行异步初始化
|
|
2016
|
+
*/
|
|
2017
|
+
async init() {
|
|
2018
|
+
if (this.bizTableConfig?.barcodeParsingRules) {
|
|
2019
|
+
this.scanRuleProps = this.bizTableConfig?.barcodeParsingRules;
|
|
2020
|
+
this.scanRuleInfo = await getParseRuleInfo({ id: this.scanRuleProps.parsingRuleId });
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
// ! 表格数据操作开始
|
|
2024
|
+
/**表单数据 */
|
|
2025
|
+
formState;
|
|
2026
|
+
get tableData() {
|
|
2027
|
+
return this.formState[this.subFieldKey];
|
|
2028
|
+
}
|
|
2029
|
+
set tableData(value) {
|
|
2030
|
+
const deletedArr = this.formState[this.subFieldKey].filter((i) => i.deleted_);
|
|
2031
|
+
this.formState[this.subFieldKey] = [...value, ...deletedArr];
|
|
2032
|
+
this.updateCalcCallback();
|
|
2033
|
+
}
|
|
2034
|
+
/**
|
|
2035
|
+
* 实际使用的数据(过滤掉打deleted_标签的数据)
|
|
2036
|
+
*/
|
|
2037
|
+
get showTableData() {
|
|
2038
|
+
return this.tableData.filter((i) => !i.deleted_);
|
|
2039
|
+
}
|
|
2040
|
+
/** 更新页面 */
|
|
2041
|
+
updateCalcCallback;
|
|
2042
|
+
// ! 表格数据操作结束
|
|
2043
|
+
/** 子表组件的setup的时候 */
|
|
2044
|
+
async compSetup(params) {
|
|
2045
|
+
this.formModelController = useFormModel().injectController();
|
|
2046
|
+
this.formState = params.formState;
|
|
2047
|
+
this.updateCalcCallback = params.updateCalcCallback;
|
|
2048
|
+
}
|
|
2049
|
+
/** 子表组件的unmount的时候 */
|
|
2050
|
+
async compUnmount() {
|
|
2051
|
+
this.render.destroyAllModals();
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* 计算子表字段的默认值映射
|
|
2055
|
+
* - key是字段的key
|
|
2056
|
+
* - value可以是直接值,也可以是回调返回一个动漫值
|
|
2057
|
+
*/
|
|
2058
|
+
calcDefaultMap() {
|
|
2059
|
+
return {};
|
|
2060
|
+
}
|
|
2061
|
+
/**
|
|
2062
|
+
* 初始化表单数据
|
|
2063
|
+
* @param params
|
|
2064
|
+
*/
|
|
2065
|
+
handleInitializeFormState(_params) {
|
|
2066
|
+
return void 0;
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* 计算每行的行操作的菜单
|
|
2070
|
+
* @param rowData
|
|
2071
|
+
*/
|
|
2072
|
+
calcSubTableActionMenu(params) {
|
|
2073
|
+
const menus = [
|
|
2074
|
+
this.quickFill && this.ctx.widget.props.tableType === SubTableType.DEFAULT ? getMenuByAction(SubTableActionEnum.QuickFillRowCurrent) : void 0,
|
|
2075
|
+
getMenuByAction(SubTableActionEnum.Insert1RowAfter),
|
|
2076
|
+
getCopySubMenu(),
|
|
2077
|
+
getInsertSubMenu(),
|
|
2078
|
+
...params.showDelBtn ? [
|
|
2079
|
+
{
|
|
2080
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
2081
|
+
},
|
|
2082
|
+
getMenuByAction(SubTableActionEnum.DeleteRowCurrent)
|
|
2083
|
+
] : []
|
|
2084
|
+
].filter(Boolean);
|
|
2085
|
+
return menus;
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* 处理行操作菜单点击事件
|
|
2089
|
+
* @param params
|
|
2090
|
+
*/
|
|
2091
|
+
handleMenuClick(params) {
|
|
2092
|
+
const { actionKey } = params;
|
|
2093
|
+
if (actionKey === SubTableActionEnum.SCAN) {
|
|
2094
|
+
this.openScanModal();
|
|
2095
|
+
} else if (actionKey === SubTableActionEnum.CHANGE_PARSE_RULE) {
|
|
2096
|
+
this.changeScanRule();
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
/**
|
|
2100
|
+
* 处理字段的 td
|
|
2101
|
+
* 可以修改 td 的属性
|
|
2102
|
+
* @param params
|
|
2103
|
+
*/
|
|
2104
|
+
handleFieldTd(params) {
|
|
2105
|
+
const { tdHandler, ...commonParams } = params;
|
|
2106
|
+
const fieldStatus = this.calcFieldStatus({
|
|
2107
|
+
...commonParams
|
|
2108
|
+
});
|
|
2109
|
+
if (fieldStatus) {
|
|
2110
|
+
if (!isNil(fieldStatus.disabled)) {
|
|
2111
|
+
tdHandler.fieldDisabled = fieldStatus.disabled;
|
|
2112
|
+
}
|
|
2113
|
+
if (!isNil(fieldStatus.readonly)) {
|
|
2114
|
+
tdHandler.fieldReadonly = fieldStatus.readonly;
|
|
2115
|
+
}
|
|
2116
|
+
if (!isNil(fieldStatus.required)) {
|
|
2117
|
+
tdHandler.fieldRequired = fieldStatus.required;
|
|
2118
|
+
}
|
|
2119
|
+
}
|
|
2120
|
+
const newQueryData = this.calcFieldQuery({
|
|
2121
|
+
...commonParams
|
|
2122
|
+
});
|
|
2123
|
+
if (newQueryData) {
|
|
2124
|
+
tdHandler.fieldQuery = newQueryData;
|
|
2125
|
+
}
|
|
2126
|
+
const customLoader = this.calcFieldDataSource({
|
|
2127
|
+
...commonParams
|
|
2128
|
+
});
|
|
2129
|
+
if (customLoader) {
|
|
2130
|
+
tdHandler.fieldCustomLoader = customLoader;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* 计算字段的状态
|
|
2135
|
+
* - undefined的字段就不修改,走原来的
|
|
2136
|
+
* @param params
|
|
2137
|
+
* @return {*}
|
|
2138
|
+
*/
|
|
2139
|
+
calcFieldStatus(params) {
|
|
2140
|
+
const result = {};
|
|
2141
|
+
return result;
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* 计算字段的查询条件,如果返回值有值则修改到td的newQueryData里
|
|
2145
|
+
* @param params
|
|
2146
|
+
* @return {*}
|
|
2147
|
+
*/
|
|
2148
|
+
calcFieldQuery(_params) {
|
|
2149
|
+
return void 0;
|
|
2150
|
+
}
|
|
2151
|
+
/**
|
|
2152
|
+
* 计算字段的自定义数据源加载函数,如果返回值有值则注入到 td 的 customLoader 里
|
|
2153
|
+
* @param params
|
|
2154
|
+
* @return {*}
|
|
2155
|
+
*/
|
|
2156
|
+
calcFieldDataSource(_params) {
|
|
2157
|
+
return void 0;
|
|
2158
|
+
}
|
|
2159
|
+
/**
|
|
2160
|
+
* 计算获得新的 td 信息
|
|
2161
|
+
* 用于控制字段的属性和状态
|
|
2162
|
+
* @param params
|
|
2163
|
+
* @return {*}
|
|
2164
|
+
*/
|
|
2165
|
+
calcNewTdInfo(params) {
|
|
2166
|
+
const tdHandler = new TdHandler(params.oldTdInfo);
|
|
2167
|
+
if (tdHandler.isField) {
|
|
2168
|
+
this.handleFieldTd({
|
|
2169
|
+
rowData: params.rowData,
|
|
2170
|
+
field: tdHandler.fieldKey,
|
|
2171
|
+
tdHandler
|
|
2172
|
+
});
|
|
2173
|
+
}
|
|
2174
|
+
return tdHandler.getCurrentTd();
|
|
2175
|
+
}
|
|
2176
|
+
/**
|
|
2177
|
+
* 处理字段的值变化
|
|
2178
|
+
* @param params
|
|
2179
|
+
*/
|
|
2180
|
+
handleChange(params) {
|
|
2181
|
+
console.log("handleChange", params);
|
|
2182
|
+
}
|
|
2183
|
+
// ! 扫码逻辑开始
|
|
2184
|
+
/** 扫描是否已经打开 */
|
|
2185
|
+
isScanOpen = false;
|
|
2186
|
+
/**
|
|
2187
|
+
* 解析规则数据对象
|
|
2188
|
+
*/
|
|
2189
|
+
scanRuleInfo;
|
|
2190
|
+
/** 解析规则配置对象 */
|
|
2191
|
+
scanRuleProps;
|
|
2192
|
+
/**
|
|
2193
|
+
* 变更条码规则
|
|
2194
|
+
*/
|
|
2195
|
+
async changeScanRule() {
|
|
2196
|
+
const newConfig = await this.render.openChangeRuleModal({
|
|
2197
|
+
config: this.scanRuleProps,
|
|
2198
|
+
subModelKey: this.subModelKey,
|
|
2199
|
+
formModelController: this.formModelController
|
|
2200
|
+
});
|
|
2201
|
+
if (newConfig) {
|
|
2202
|
+
this.scanRuleProps = newConfig;
|
|
2203
|
+
this.scanRuleInfo = await getParseRuleInfo({ id: newConfig.parsingRuleId });
|
|
2204
|
+
}
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* 打开扫描弹窗
|
|
2208
|
+
* @param opts
|
|
2209
|
+
*/
|
|
2210
|
+
async openScanModal() {
|
|
2211
|
+
if (this.isScanOpen) {
|
|
2212
|
+
return;
|
|
2213
|
+
}
|
|
2214
|
+
if (!this.scanRuleInfo) {
|
|
2215
|
+
this.error({ content: $t("sys.edhr.mcTable.scanRuleNotFound") });
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
this.isScanOpen = true;
|
|
2219
|
+
await this.render.openScanModal({
|
|
2220
|
+
title: this.ctx.widget.props.tableTitle,
|
|
2221
|
+
onScan: this.onScan
|
|
2222
|
+
});
|
|
2223
|
+
this.isScanOpen = false;
|
|
2224
|
+
}
|
|
2225
|
+
/**
|
|
2226
|
+
* 处理扫码弹窗回调
|
|
2227
|
+
* 参数由扫码弹窗决定
|
|
2228
|
+
*/
|
|
2229
|
+
onScan(params) {
|
|
2230
|
+
console.log("onScan", params);
|
|
2231
|
+
const data = getParseRuleValue(params.str, this.scanRuleInfo.rules_);
|
|
2232
|
+
console.log("parseScanData", data);
|
|
2233
|
+
}
|
|
2234
|
+
// ! 扫码逻辑结束
|
|
2235
|
+
/**
|
|
2236
|
+
* 按钮点击逻辑前处理
|
|
2237
|
+
* 可以报错拦截后续逻辑
|
|
2238
|
+
* @param params
|
|
2239
|
+
*/
|
|
2240
|
+
async beforeBtnClick(params) {
|
|
2241
|
+
console.log(this.ctx.widget.props.tableTitle, "处理表单按钮点击事件", params);
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
function useFormulaExpWatcher(options) {
|
|
2245
|
+
const {
|
|
2246
|
+
props,
|
|
2247
|
+
currentPageFormState,
|
|
2248
|
+
needMinValidateCalc,
|
|
2249
|
+
needMaxValidateCalc,
|
|
2250
|
+
onCalculateFormula,
|
|
2251
|
+
onMinComputed,
|
|
2252
|
+
onMaxComputed,
|
|
2253
|
+
debounceMs = 200,
|
|
2254
|
+
returnType = "string"
|
|
2255
|
+
} = options;
|
|
2256
|
+
let calcReqId = 0;
|
|
2257
|
+
async function computeMinMaxOnce() {
|
|
2258
|
+
const myId = ++calcReqId;
|
|
2259
|
+
const getValue = (v) => {
|
|
2260
|
+
if (returnType === "number") {
|
|
2261
|
+
const parsed = v == null ? null : parseFloat(String(v));
|
|
2262
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
2263
|
+
}
|
|
2264
|
+
return v;
|
|
2265
|
+
};
|
|
2266
|
+
if (needMinValidateCalc) {
|
|
2267
|
+
try {
|
|
2268
|
+
const v = await onCalculateFormula("min");
|
|
2269
|
+
if (myId !== calcReqId) return;
|
|
2270
|
+
onMinComputed?.(getValue(v));
|
|
2271
|
+
} catch (e) {
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
if (needMaxValidateCalc) {
|
|
2275
|
+
try {
|
|
2276
|
+
const v = await onCalculateFormula("max");
|
|
2277
|
+
if (myId !== calcReqId) return;
|
|
2278
|
+
onMaxComputed?.(getValue(v));
|
|
2279
|
+
} catch (e) {
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
const debouncedCompute = debounce(computeMinMaxOnce, debounceMs);
|
|
2284
|
+
const topStops = [];
|
|
2285
|
+
const hashRowStops = /* @__PURE__ */ new Map();
|
|
2286
|
+
const clearAllStops = () => {
|
|
2287
|
+
while (topStops.length) {
|
|
2288
|
+
const s = topStops.shift();
|
|
2289
|
+
try {
|
|
2290
|
+
s && s();
|
|
2291
|
+
} catch (e) {
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
for (const [, rowMap] of hashRowStops) {
|
|
2295
|
+
for (const stop2 of rowMap.values()) {
|
|
2296
|
+
try {
|
|
2297
|
+
stop2 && stop2();
|
|
2298
|
+
} catch (e) {
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
hashRowStops.clear();
|
|
2303
|
+
debouncedCompute.cancel?.();
|
|
2304
|
+
calcReqId++;
|
|
2305
|
+
};
|
|
2306
|
+
const setupWatchesFromMerged = (parseInfos = []) => {
|
|
2307
|
+
if (!needMinValidateCalc && !needMaxValidateCalc) return;
|
|
2308
|
+
if (!Array.isArray(parseInfos) || parseInfos.length === 0) {
|
|
2309
|
+
debouncedCompute();
|
|
2310
|
+
return;
|
|
2311
|
+
}
|
|
2312
|
+
for (const p of parseInfos) {
|
|
2313
|
+
const { type, processed, hashValue } = p;
|
|
2314
|
+
if (type === "plain") {
|
|
2315
|
+
const stop2 = watch(
|
|
2316
|
+
() => currentPageFormState.value?.[processed],
|
|
2317
|
+
() => {
|
|
2318
|
+
console.log("plain");
|
|
2319
|
+
debouncedCompute();
|
|
2320
|
+
},
|
|
2321
|
+
{ immediate: true }
|
|
2322
|
+
);
|
|
2323
|
+
topStops.push(stop2);
|
|
2324
|
+
} else if (type === "underscore") {
|
|
2325
|
+
const stop2 = watch(
|
|
2326
|
+
() => props.formData?.[processed],
|
|
2327
|
+
() => {
|
|
2328
|
+
console.log("underscore");
|
|
2329
|
+
debouncedCompute();
|
|
2330
|
+
},
|
|
2331
|
+
{ immediate: true }
|
|
2332
|
+
);
|
|
2333
|
+
topStops.push(stop2);
|
|
2334
|
+
} else if (type === "hash") {
|
|
2335
|
+
if (!hashRowStops.has(hashValue)) hashRowStops.set(hashValue, /* @__PURE__ */ new Map());
|
|
2336
|
+
const rowMap = hashRowStops.get(hashValue);
|
|
2337
|
+
const stopLen = watch(
|
|
2338
|
+
() => currentPageFormState.value?.[hashValue]?.length ?? 0,
|
|
2339
|
+
() => {
|
|
2340
|
+
const arr = currentPageFormState.value?.[hashValue];
|
|
2341
|
+
for (const row of arr) {
|
|
2342
|
+
const rid = `${getRowId(row)}_${processed}`;
|
|
2343
|
+
if (!rowMap.has(rid)) {
|
|
2344
|
+
const stopPerRow = watch(
|
|
2345
|
+
() => [row?.[processed], row?.deleted_],
|
|
2346
|
+
() => {
|
|
2347
|
+
debouncedCompute();
|
|
2348
|
+
},
|
|
2349
|
+
{ immediate: true }
|
|
2350
|
+
);
|
|
2351
|
+
rowMap.set(rid, stopPerRow);
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
const existingIds = new Set(arr.map(getRowId));
|
|
2355
|
+
for (const r of Array.from(rowMap.keys())) {
|
|
2356
|
+
if (!existingIds.has(r)) {
|
|
2357
|
+
const rid = `${r}_${processed}`;
|
|
2358
|
+
const s = rowMap.get(rid);
|
|
2359
|
+
s && s();
|
|
2360
|
+
rowMap.delete(rid);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
debouncedCompute();
|
|
2364
|
+
},
|
|
2365
|
+
{ immediate: true }
|
|
2366
|
+
);
|
|
2367
|
+
topStops.push(stopLen);
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
debouncedCompute();
|
|
2371
|
+
};
|
|
2372
|
+
const stop = () => {
|
|
2373
|
+
clearAllStops();
|
|
2374
|
+
};
|
|
2375
|
+
return {
|
|
2376
|
+
setupWatchesFromMerged,
|
|
2377
|
+
stop
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2380
|
+
const identify = (...args) => window.NocodeAdapter.utils?.formulaIdentify?.(...args) ?? [];
|
|
2381
|
+
const calculate = (...args) => window.NocodeAdapter.utils?.formulaCalculate?.(...args);
|
|
2382
|
+
function useDependency(widget, props) {
|
|
2383
|
+
const { field, isFieldModel, fieldLink, subModelKey, newSpecificConfig } = widget.props;
|
|
2384
|
+
const fieldWidget = ref(subModelKey ? cloneDeep(props.widget) : props.widget);
|
|
2385
|
+
watch(
|
|
2386
|
+
() => props.widget.props,
|
|
2387
|
+
(newProps) => {
|
|
2388
|
+
Object.assign(fieldWidget.value.props, newProps);
|
|
2389
|
+
}
|
|
2390
|
+
);
|
|
2391
|
+
const { currentPageFormState } = useCurrentPageFormState();
|
|
2392
|
+
const targetFieldId = field ? isFieldModel ? fieldLink : field : "";
|
|
2393
|
+
const configDependency = widget.props.componentDependency?.configDependency || {};
|
|
2394
|
+
const readonly_expression = configDependency[Dependency_ENUM.READONLY]?.expression;
|
|
2395
|
+
const readonly_value = configDependency[Dependency_ENUM.READONLY]?.value;
|
|
2396
|
+
if (readonly_value && readonly_expression) {
|
|
2397
|
+
insetDep(
|
|
2398
|
+
{
|
|
2399
|
+
expression: readonly_expression,
|
|
2400
|
+
formState: currentPageFormState.value
|
|
2401
|
+
},
|
|
2402
|
+
(res) => {
|
|
2403
|
+
fieldWidget.value.props.field_readonly = !!res;
|
|
2404
|
+
}
|
|
2405
|
+
);
|
|
2406
|
+
}
|
|
2407
|
+
const field_required = widget.props?.newSpecificConfig?.newRequired;
|
|
2408
|
+
const required_expression = configDependency[Dependency_ENUM.REQUIRED]?.expression;
|
|
2409
|
+
const required_value = configDependency[Dependency_ENUM.REQUIRED]?.value;
|
|
2410
|
+
if (!field_required && required_value && required_expression) {
|
|
2411
|
+
insetDep(
|
|
2412
|
+
{
|
|
2413
|
+
expression: required_expression,
|
|
2414
|
+
formState: currentPageFormState.value
|
|
2415
|
+
},
|
|
2416
|
+
(res) => {
|
|
2417
|
+
fieldWidget.value.props.required = !!res;
|
|
2418
|
+
}
|
|
2419
|
+
);
|
|
2420
|
+
}
|
|
2421
|
+
if (field_required) {
|
|
2422
|
+
fieldWidget.value.props.required = true;
|
|
2423
|
+
}
|
|
2424
|
+
const field_disabled = widget.props.disabled;
|
|
2425
|
+
const disabled_expression = configDependency[Dependency_ENUM.DISABLED]?.expression;
|
|
2426
|
+
const disabled_value = configDependency[Dependency_ENUM.DISABLED]?.value;
|
|
2427
|
+
if (!field_disabled && disabled_value && disabled_expression) {
|
|
2428
|
+
insetDep(
|
|
2429
|
+
{
|
|
2430
|
+
expression: disabled_expression,
|
|
2431
|
+
formState: currentPageFormState.value
|
|
2432
|
+
},
|
|
2433
|
+
(res) => {
|
|
2434
|
+
fieldWidget.value.props.disabled = !!res;
|
|
2435
|
+
}
|
|
2436
|
+
);
|
|
2437
|
+
}
|
|
2438
|
+
const assignment_expression = configDependency[Dependency_ENUM.ASSIGNMENT]?.expression;
|
|
2439
|
+
const strategy = configDependency[Dependency_ENUM.ASSIGNMENT]?.strategy;
|
|
2440
|
+
if (assignment_expression) {
|
|
2441
|
+
insetDep(
|
|
2442
|
+
{
|
|
2443
|
+
expression: assignment_expression,
|
|
2444
|
+
formState: currentPageFormState.value
|
|
2445
|
+
},
|
|
2446
|
+
(res) => {
|
|
2447
|
+
const formattedValue = formatDateCompliance(res, newSpecificConfig?.mappingType);
|
|
2448
|
+
props.formData[field] = formattedValue;
|
|
2449
|
+
}
|
|
2450
|
+
);
|
|
2451
|
+
}
|
|
2452
|
+
if (!props.formData._OPCT) {
|
|
2453
|
+
props.formData._OPCT = { _DICT: {} };
|
|
2454
|
+
}
|
|
2455
|
+
const formRowData = toRef(() => {
|
|
2456
|
+
if (isFieldModel) {
|
|
2457
|
+
return props.formData._OPCT;
|
|
2458
|
+
}
|
|
2459
|
+
return props.formData;
|
|
2460
|
+
});
|
|
2461
|
+
const value = computed({
|
|
2462
|
+
get() {
|
|
2463
|
+
if (targetFieldId) {
|
|
2464
|
+
return formRowData.value[targetFieldId];
|
|
2465
|
+
}
|
|
2466
|
+
return "";
|
|
2467
|
+
},
|
|
2468
|
+
set(val) {
|
|
2469
|
+
if (targetFieldId && !!assignment_expression && strategy === ASSIGNMENTSTRATEGY_ENUM.alwaysCover)
|
|
2470
|
+
return;
|
|
2471
|
+
formRowData.value[targetFieldId] = val;
|
|
2472
|
+
}
|
|
2473
|
+
});
|
|
2474
|
+
function insetDep({ expression, formState }, callback) {
|
|
2475
|
+
if (!expression || expression === "true") {
|
|
2476
|
+
callback(true);
|
|
2477
|
+
return;
|
|
2478
|
+
}
|
|
2479
|
+
const identifyArgs = identify(expression);
|
|
2480
|
+
const cacheFormFields = computed(() => {
|
|
2481
|
+
return identifyArgs.reduce((total, i) => {
|
|
2482
|
+
const value2 = i.startsWith("_.") ? props.formData[i.slice(2)] : formState[i];
|
|
2483
|
+
total[i] = value2;
|
|
2484
|
+
return total;
|
|
2485
|
+
}, {});
|
|
2486
|
+
});
|
|
2487
|
+
watchDebounced(
|
|
2488
|
+
cacheFormFields,
|
|
2489
|
+
() => {
|
|
2490
|
+
calculate(expression, cacheFormFields.value).then(callback);
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
debounce: 200,
|
|
2494
|
+
immediate: true,
|
|
2495
|
+
deep: true
|
|
2496
|
+
}
|
|
2497
|
+
);
|
|
2498
|
+
}
|
|
2499
|
+
return { value, formRowData, targetFieldId, fieldWidget };
|
|
2500
|
+
}
|
|
2501
|
+
function formatDateCompliance(value, fieldTypeVal) {
|
|
2502
|
+
if (!value) {
|
|
2503
|
+
return value === 0 || value === false ? value : null;
|
|
2504
|
+
}
|
|
2505
|
+
const valueStr = String(value).trim();
|
|
2506
|
+
if (fieldTypeVal === FIELD_TYPE.DATE) {
|
|
2507
|
+
const dateMatch = valueStr.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
2508
|
+
if (!dateMatch) {
|
|
2509
|
+
return "";
|
|
2510
|
+
}
|
|
2511
|
+
return dateMatch[1];
|
|
2512
|
+
}
|
|
2513
|
+
if (fieldTypeVal === FIELD_TYPE.DATE_TIME) {
|
|
2514
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(valueStr)) {
|
|
2515
|
+
return `${valueStr} 00:00:00`;
|
|
2516
|
+
}
|
|
2517
|
+
if (/^\d{4}-\d{2}-\d{2}\s\d{1,2}:\d{2}:\d{2}$/.test(valueStr)) {
|
|
2518
|
+
return valueStr;
|
|
2519
|
+
}
|
|
2520
|
+
if (/^\d{4}-\d{2}-\d{2}\s\d{1,2}:\d{2}$/.test(valueStr)) {
|
|
2521
|
+
return `${valueStr}:00`;
|
|
2522
|
+
}
|
|
2523
|
+
return "";
|
|
2524
|
+
}
|
|
2525
|
+
if (fieldTypeVal === FIELD_TYPE.TIME) {
|
|
2526
|
+
const timeMatch = valueStr.match(/(\d{1,2}:\d{2}(?::\d{2})?)/);
|
|
2527
|
+
if (timeMatch) {
|
|
2528
|
+
return timeMatch[1];
|
|
2529
|
+
}
|
|
2530
|
+
return "";
|
|
2531
|
+
}
|
|
2532
|
+
return value;
|
|
2533
|
+
}
|
|
2534
|
+
class DeviceLinkTmplUtil {
|
|
2535
|
+
/**
|
|
2536
|
+
* 创建模板数据
|
|
2537
|
+
* @param type
|
|
2538
|
+
* @return {*}
|
|
2539
|
+
*/
|
|
2540
|
+
static createTmpl(type) {
|
|
2541
|
+
const tmpl = {
|
|
2542
|
+
id: uuid2(16),
|
|
2543
|
+
type
|
|
2544
|
+
};
|
|
2545
|
+
if (type === DeviceLink.TmplTypeEnum.AI_OCR) {
|
|
2546
|
+
Object.assign(tmpl, {
|
|
2547
|
+
identifyParams: [
|
|
2548
|
+
{
|
|
2549
|
+
prompt: void 0,
|
|
2550
|
+
formField: void 0
|
|
2551
|
+
}
|
|
2552
|
+
],
|
|
2553
|
+
denoiseMethod: DeviceLink.DenoiseMethodEnum.GAUSSIAN,
|
|
2554
|
+
binarizeMethod: DeviceLink.BinarizeMethodEnum.ADAPTIVE
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
return tmpl;
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* 计算完整的提示词
|
|
2561
|
+
* @static
|
|
2562
|
+
* @param tmpl
|
|
2563
|
+
* @return {*}
|
|
2564
|
+
*/
|
|
2565
|
+
static calcEntirePrompt(tmpl) {
|
|
2566
|
+
const paramsStr = tmpl.identifyParams?.map((item) => {
|
|
2567
|
+
return `图中${item.prompt}绑定${item.formField?.split(".")[1]}字段`;
|
|
2568
|
+
}).join(",");
|
|
2569
|
+
const jsonObj = tmpl.identifyParams?.reduce((acc, cur) => {
|
|
2570
|
+
acc[cur.formField?.split(".")[1]] = {
|
|
2571
|
+
value: null
|
|
2572
|
+
};
|
|
2573
|
+
return acc;
|
|
2574
|
+
}, {});
|
|
2575
|
+
const result = `这是一台${tmpl.deviceName ?? ""}设备/仪器图片,${paramsStr},请识别图片中的读数,以
|
|
2576
|
+
${JSON.stringify(
|
|
2577
|
+
jsonObj,
|
|
2578
|
+
null,
|
|
2579
|
+
2
|
|
2580
|
+
)}
|
|
2581
|
+
格式返回,${tmpl.extraPrompt ?? ""}`;
|
|
2582
|
+
return result;
|
|
2583
|
+
}
|
|
2584
|
+
/** 平台设备互联接口对象转换格式 */
|
|
2585
|
+
static transfer2DeviceLink(data) {
|
|
2586
|
+
const result = {
|
|
2587
|
+
id: data.id,
|
|
2588
|
+
name: data.name,
|
|
2589
|
+
type: data.type,
|
|
2590
|
+
params: data.schema ? [] : void 0
|
|
2591
|
+
};
|
|
2592
|
+
if (data.schema) {
|
|
2593
|
+
const params = [];
|
|
2594
|
+
const obj = JSON.parse(data.schema);
|
|
2595
|
+
for (const key in obj.properties) {
|
|
2596
|
+
const temp = {
|
|
2597
|
+
code: key,
|
|
2598
|
+
name: obj.properties[key].description || $t("sys.developer.devive.arrayMapping"),
|
|
2599
|
+
type: obj.properties[key].type,
|
|
2600
|
+
remark: obj.properties[key].remark,
|
|
2601
|
+
children: []
|
|
2602
|
+
};
|
|
2603
|
+
if (obj.properties[key].items && obj.properties[key].items.properties) {
|
|
2604
|
+
temp.children = [];
|
|
2605
|
+
for (const subkey in obj.properties[key].items.properties) {
|
|
2606
|
+
temp.children.push({
|
|
2607
|
+
code: subkey,
|
|
2608
|
+
name: obj.properties[key].items.properties[subkey].description,
|
|
2609
|
+
type: obj.properties[key].items.properties[subkey].type,
|
|
2610
|
+
remark: obj.properties[key].remark
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
params.push(temp);
|
|
2615
|
+
}
|
|
2616
|
+
result.params = params;
|
|
2617
|
+
}
|
|
2618
|
+
return result;
|
|
2619
|
+
}
|
|
2620
|
+
/**
|
|
2621
|
+
* 通过设备id转换成IDeviceLink结构
|
|
2622
|
+
* - 请求获取完整的带参数的数据
|
|
2623
|
+
* - 把参数数据转换成IDeviceLink结构
|
|
2624
|
+
* @static
|
|
2625
|
+
* @param deviceId
|
|
2626
|
+
*/
|
|
2627
|
+
static async getDeviceLink(deviceId) {
|
|
2628
|
+
const res = await api.platform.deviceInterconnection.getInfo({ id: deviceId });
|
|
2629
|
+
if (!res) {
|
|
2630
|
+
return;
|
|
2631
|
+
}
|
|
2632
|
+
return this.transfer2DeviceLink(res);
|
|
2633
|
+
}
|
|
2634
|
+
/**
|
|
2635
|
+
* 初始化设备字段和表单字段映射关系
|
|
2636
|
+
* @static
|
|
2637
|
+
* @param deviceLink
|
|
2638
|
+
*/
|
|
2639
|
+
static initDevice2FormFieldMap(deviceLink) {
|
|
2640
|
+
const fieldMap = [];
|
|
2641
|
+
deviceLink.params?.forEach((item) => {
|
|
2642
|
+
fieldMap.push({
|
|
2643
|
+
isSubField: item.type === "Array",
|
|
2644
|
+
deviceField: item.code,
|
|
2645
|
+
deviceLinkParams: cloneDeep(omit(item, ["children"])),
|
|
2646
|
+
// 冗余参数自身的信息,不存子数据
|
|
2647
|
+
formField: void 0,
|
|
2648
|
+
children: item.children?.map((subItem) => {
|
|
2649
|
+
return {
|
|
2650
|
+
deviceField: subItem.code,
|
|
2651
|
+
deviceLinkParams: cloneDeep(subItem),
|
|
2652
|
+
formField: void 0
|
|
2653
|
+
};
|
|
2654
|
+
})
|
|
2655
|
+
});
|
|
2656
|
+
});
|
|
2657
|
+
return fieldMap;
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
class DeviceConnector {
|
|
2661
|
+
state = reactive({
|
|
2662
|
+
unMqttTopicMap: {},
|
|
2663
|
+
focusFieldKey: null,
|
|
2664
|
+
cacheFieldData: {}
|
|
2665
|
+
});
|
|
2666
|
+
/** 初始化连接器,重置清空数据 */
|
|
2667
|
+
init() {
|
|
2668
|
+
this.clear();
|
|
2669
|
+
}
|
|
2670
|
+
/**
|
|
2671
|
+
* 取消订阅mqtt
|
|
2672
|
+
* @param id
|
|
2673
|
+
*/
|
|
2674
|
+
unsubscribeMqtt(id) {
|
|
2675
|
+
const unMqtt = this.state.unMqttTopicMap[id];
|
|
2676
|
+
if (unMqtt) {
|
|
2677
|
+
unMqtt();
|
|
2678
|
+
Reflect.deleteProperty(this.state.unMqttTopicMap, id);
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* 清空数据,清楚mqtt订阅等
|
|
2683
|
+
*/
|
|
2684
|
+
clear() {
|
|
2685
|
+
Object.keys(this.state.unMqttTopicMap).forEach((id) => {
|
|
2686
|
+
this.unsubscribeMqtt(id);
|
|
2687
|
+
});
|
|
2688
|
+
this.state.unMqttTopicMap = {};
|
|
2689
|
+
this.state.cacheFieldData = {};
|
|
2690
|
+
this.state.focusFieldKey = null;
|
|
2691
|
+
}
|
|
2692
|
+
/**
|
|
2693
|
+
* 添加缓存的聚焦时填充的字段数据
|
|
2694
|
+
* @param map
|
|
2695
|
+
* @param value
|
|
2696
|
+
*/
|
|
2697
|
+
addCachedFocusValue(params) {
|
|
2698
|
+
this.state.cacheFieldData[params.uniqueKey] = params;
|
|
2699
|
+
}
|
|
2700
|
+
/**
|
|
2701
|
+
* 判断字段是否被聚焦
|
|
2702
|
+
* @param field
|
|
2703
|
+
* @return {*}
|
|
2704
|
+
*/
|
|
2705
|
+
hasCachedFocusValue(field) {
|
|
2706
|
+
return Object.values(this.state.cacheFieldData).some((item) => item.fieldKeys.includes(field));
|
|
2707
|
+
}
|
|
2708
|
+
/**
|
|
2709
|
+
* 获取被缓存的聚焦时填充的字段数据
|
|
2710
|
+
* @param field
|
|
2711
|
+
*/
|
|
2712
|
+
getCachedFocusValue(field) {
|
|
2713
|
+
if (!this.hasCachedFocusValue(field)) {
|
|
2714
|
+
return;
|
|
2715
|
+
}
|
|
2716
|
+
const key = Object.keys(this.state.cacheFieldData).find((k) => {
|
|
2717
|
+
return this.state.cacheFieldData[k].fieldKeys.includes(field);
|
|
2718
|
+
});
|
|
2719
|
+
if (key) {
|
|
2720
|
+
const cacheData = this.state.cacheFieldData[key];
|
|
2721
|
+
delete this.state.cacheFieldData[key];
|
|
2722
|
+
return cacheData.value;
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
class FormTmplConfigController {
|
|
2727
|
+
/** 为了方便挂载到 word 中去 */
|
|
2728
|
+
TmplUtil = DeviceLinkTmplUtil;
|
|
2729
|
+
/** 设备连接器 */
|
|
2730
|
+
deviceConnector = new DeviceConnector();
|
|
2731
|
+
constructor() {
|
|
2732
|
+
this.initPermissions();
|
|
2733
|
+
}
|
|
2734
|
+
/** 存储响应式变量 */
|
|
2735
|
+
state = reactive({
|
|
2736
|
+
tmpls: [],
|
|
2737
|
+
runningTmpls: [],
|
|
2738
|
+
IOTPermission: false,
|
|
2739
|
+
OCRPermission: false
|
|
2740
|
+
});
|
|
2741
|
+
/** 表单模板id */
|
|
2742
|
+
tmplId = "";
|
|
2743
|
+
/** 是否手动模式,手动模式不触发接口 */
|
|
2744
|
+
isManual = false;
|
|
2745
|
+
/**
|
|
2746
|
+
* 初始化权限
|
|
2747
|
+
*/
|
|
2748
|
+
async initPermissions() {
|
|
2749
|
+
this.state.IOTPermission = await api.platform.license.getModuleAuth({ module: "IOT" }) || false;
|
|
2750
|
+
this.state.OCRPermission = await api.apaas.onlineFormTmpl.getIsOcrGranted() || false;
|
|
2751
|
+
}
|
|
2752
|
+
/**
|
|
2753
|
+
* 初始化
|
|
2754
|
+
*
|
|
2755
|
+
* @param opts
|
|
2756
|
+
* - tmplId 表单模板id
|
|
2757
|
+
*/
|
|
2758
|
+
async init(opts) {
|
|
2759
|
+
this.isManual = !!opts.isManual;
|
|
2760
|
+
this.tmplId = opts.tmplId;
|
|
2761
|
+
this.state.runningTmpls = [];
|
|
2762
|
+
if (!this.isManual) {
|
|
2763
|
+
await this.load();
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
/**
|
|
2767
|
+
* 设置获取到的配置数据字符串
|
|
2768
|
+
* @param configStr
|
|
2769
|
+
*/
|
|
2770
|
+
setConfigStr(configStr) {
|
|
2771
|
+
console.log("配置信息", configStr);
|
|
2772
|
+
const config = configStr ? JSON.parse(configStr) : {};
|
|
2773
|
+
this.state.tmpls = config.tmpls || [];
|
|
2774
|
+
}
|
|
2775
|
+
getConfigStr() {
|
|
2776
|
+
const cloneTmpls = cloneDeep(this.state.tmpls);
|
|
2777
|
+
cloneTmpls.forEach((tmpl) => {
|
|
2778
|
+
if (tmpl.type === DeviceLink.TmplTypeEnum.AI_OCR) {
|
|
2779
|
+
tmpl.runtimePrompt = this.TmplUtil.calcEntirePrompt(tmpl);
|
|
2780
|
+
}
|
|
2781
|
+
});
|
|
2782
|
+
const config = {
|
|
2783
|
+
tmpls: cloneTmpls
|
|
2784
|
+
};
|
|
2785
|
+
console.log("保存数据", config);
|
|
2786
|
+
return JSON.stringify(config);
|
|
2787
|
+
}
|
|
2788
|
+
/** 调用接口加载数据 */
|
|
2789
|
+
async load() {
|
|
2790
|
+
const res = await api.apaas.onlineFormTmpl.getGetCommunicationConfig({ id: this.tmplId });
|
|
2791
|
+
this.setConfigStr(res);
|
|
2792
|
+
}
|
|
2793
|
+
/** 调用接口保存数据 */
|
|
2794
|
+
async save() {
|
|
2795
|
+
const configStr = this.getConfigStr();
|
|
2796
|
+
await api.apaas.onlineFormTmpl.postUpdateCommunicationConfigId(
|
|
2797
|
+
{ id: this.tmplId },
|
|
2798
|
+
{ communicationConfig: configStr }
|
|
2799
|
+
);
|
|
2800
|
+
}
|
|
2801
|
+
/** 调用接口刷新数据 */
|
|
2802
|
+
async refresh() {
|
|
2803
|
+
await this.load();
|
|
2804
|
+
}
|
|
2805
|
+
/** 添加或更新模板,并且调用接口保存并刷新数据 */
|
|
2806
|
+
async createOrUpdate(tmpl) {
|
|
2807
|
+
const index = this.state.tmpls.findIndex((item) => item.id === tmpl.id);
|
|
2808
|
+
if (index > -1) {
|
|
2809
|
+
this.state.tmpls[index] = tmpl;
|
|
2810
|
+
} else {
|
|
2811
|
+
this.state.tmpls.push(tmpl);
|
|
2812
|
+
}
|
|
2813
|
+
if (!this.isManual) {
|
|
2814
|
+
await this.save();
|
|
2815
|
+
await this.refresh();
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
/** 缓存运行中的模板 */
|
|
2819
|
+
cacheRunningTmpl(tmpl) {
|
|
2820
|
+
if (tmpl.type === DeviceLink.TmplTypeEnum.DEVICE_INTERCONNECTION) {
|
|
2821
|
+
const index = this.state.runningTmpls.findIndex((item) => item.id === tmpl.id);
|
|
2822
|
+
if (index > -1) {
|
|
2823
|
+
this.state.runningTmpls[index] = tmpl;
|
|
2824
|
+
} else {
|
|
2825
|
+
this.state.runningTmpls.push(tmpl);
|
|
2826
|
+
}
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
/**
|
|
2830
|
+
* disconnect断开连接,取消mqtt订阅,并且从运行中的模板中移除
|
|
2831
|
+
* @param tmpl
|
|
2832
|
+
*/
|
|
2833
|
+
disconnect(tmpl) {
|
|
2834
|
+
this.deviceConnector.unsubscribeMqtt(tmpl.id);
|
|
2835
|
+
const index = this.state.runningTmpls.findIndex((item) => item.id === tmpl.id);
|
|
2836
|
+
if (index > -1) {
|
|
2837
|
+
this.state.runningTmpls.splice(index, 1);
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
const FormTmplConfigControllerKey = "GctFormTmplConfigController";
|
|
2842
|
+
function useFormTmplConfig() {
|
|
2843
|
+
function provideController(c = new FormTmplConfigController()) {
|
|
2844
|
+
provide(FormTmplConfigControllerKey, c);
|
|
2845
|
+
return c;
|
|
2846
|
+
}
|
|
2847
|
+
function injectController() {
|
|
2848
|
+
return inject(FormTmplConfigControllerKey);
|
|
2849
|
+
}
|
|
2850
|
+
return {
|
|
2851
|
+
provideController,
|
|
2852
|
+
injectController
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2855
|
+
const _hoisted_1$6 = ["data-merge", "data-fill-direction"];
|
|
2856
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2857
|
+
__name: "border-td",
|
|
2858
|
+
props: {
|
|
2859
|
+
border: {},
|
|
2860
|
+
borderAttrs: { default: [] },
|
|
2861
|
+
isEmpty: { type: Boolean },
|
|
2862
|
+
showDefaultBorder: { type: Boolean },
|
|
2863
|
+
autoMerge: { type: Boolean },
|
|
2864
|
+
fillDirection: {}
|
|
2865
|
+
},
|
|
2866
|
+
setup(__props) {
|
|
2867
|
+
const ns = useNamespace("border-td");
|
|
2868
|
+
const props = __props;
|
|
2869
|
+
const showBorderClass = computed(() => {
|
|
2870
|
+
const arr = [...props.borderAttrs];
|
|
2871
|
+
if (props.border) {
|
|
2872
|
+
if (props.border.left) {
|
|
2873
|
+
arr.push("cbl");
|
|
2874
|
+
}
|
|
2875
|
+
if (props.border.right) {
|
|
2876
|
+
arr.push("cbr");
|
|
2877
|
+
}
|
|
2878
|
+
if (props.border.top) {
|
|
2879
|
+
arr.push("cbt");
|
|
2880
|
+
}
|
|
2881
|
+
if (props.border.bottom) {
|
|
2882
|
+
arr.push("cbb");
|
|
2883
|
+
}
|
|
2884
|
+
if (props.border.boldLeft) {
|
|
2885
|
+
arr.push("bold-left");
|
|
2886
|
+
}
|
|
2887
|
+
if (props.border.boldRight) {
|
|
2888
|
+
arr.push("bold-right");
|
|
2889
|
+
}
|
|
2890
|
+
if (props.border.boldTop) {
|
|
2891
|
+
arr.push("bold-top");
|
|
2892
|
+
}
|
|
2893
|
+
if (props.border.boldBottom) {
|
|
2894
|
+
arr.push("bold-bottom");
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
return arr;
|
|
2898
|
+
});
|
|
2899
|
+
const isFirefox = computed(() => {
|
|
2900
|
+
return window.navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
|
|
2901
|
+
});
|
|
2902
|
+
return (_ctx, _cache) => {
|
|
2903
|
+
return openBlock(), createElementBlock("td", mergeProps(_ctx.$attrs, {
|
|
2904
|
+
class: [
|
|
2905
|
+
unref(ns).b(),
|
|
2906
|
+
__props.isEmpty && unref(ns).m("empty"),
|
|
2907
|
+
__props.showDefaultBorder && unref(ns).m("default"),
|
|
2908
|
+
showBorderClass.value,
|
|
2909
|
+
isFirefox.value && unref(ns).m("is-firefox")
|
|
2910
|
+
],
|
|
2911
|
+
"data-merge": __props.autoMerge || null,
|
|
2912
|
+
"data-fill-direction": __props.fillDirection
|
|
2913
|
+
}), [
|
|
2914
|
+
createElementVNode("div", {
|
|
2915
|
+
class: normalizeClass([unref(ns).b("content")])
|
|
2916
|
+
}, [
|
|
2917
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
2918
|
+
], 2)
|
|
2919
|
+
], 16, _hoisted_1$6);
|
|
2920
|
+
};
|
|
2921
|
+
}
|
|
2922
|
+
});
|
|
2923
|
+
const BorderTD = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-e30f9394"]]);
|
|
2924
|
+
const _sfc_main$5 = {};
|
|
2925
|
+
const _hoisted_1$5 = { class: "nocode-loading" };
|
|
2926
|
+
function _sfc_render$1(_ctx, _cache) {
|
|
2927
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [..._cache[0] || (_cache[0] = [
|
|
2928
|
+
createElementVNode("div", { class: "nocode-shape shape-1" }, null, -1),
|
|
2929
|
+
createElementVNode("div", { class: "nocode-shape shape-2" }, null, -1),
|
|
2930
|
+
createElementVNode("div", { class: "nocode-shape shape-3" }, null, -1),
|
|
2931
|
+
createElementVNode("div", { class: "nocode-shape shape-4" }, null, -1)
|
|
2932
|
+
])]);
|
|
2933
|
+
}
|
|
2934
|
+
const DocumentLoading = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$1], ["__scopeId", "data-v-d8b64b7b"]]);
|
|
2935
|
+
const _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACNCAYAAADyzTVBAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAFZiSURBVHgB7b1JrKVZkiZk5/zDnd7gY3h4REZFVGZlQWVl04AKVN0LKrsZxBqoRTGLBRsQINEgWLQoqVuUEGzo3rBDJQSCKqRGsEI0ZCYIGhWZnV1dOURmRkZ4RoTP45vv/YdzsM/Mzv//7/p9PoQ/9wiPdy3i+b33nwezY2afDYdoTWta05rWtKY1rWlNa1rTmta0pjWtaU1rWtOa1rSmNa1pTWv6ElCMMeO/Ef/N+O8c/21++9vfzmlNK8nRmr6wxMyL9+PtL+O/kv8K/hvtLWijPapndWxmFMMGZX6TYrPVBNpuq3guONqmELFuKzq/GVgQ+GBbFGkjhDDj32NyMc8yPx+X5Z2iKO5UdXh41FQ/y13+v757ZfZ/OOcinXFaC8hLImPu7Ec/Iv+bvylMPea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CVEFS2lVAAAAAElFTkSuQmCC";
|
|
2936
|
+
const _hoisted_1$4 = { class: "nocode-document-layout-wrapper" };
|
|
2937
|
+
const _hoisted_2 = {
|
|
2938
|
+
key: 0,
|
|
2939
|
+
class: "nocode-common-loading-warp"
|
|
2940
|
+
};
|
|
2941
|
+
const _hoisted_3 = {
|
|
2942
|
+
key: 1,
|
|
2943
|
+
class: "nocode-document-layout-container"
|
|
2944
|
+
};
|
|
2945
|
+
const _hoisted_4 = {
|
|
2946
|
+
key: 2,
|
|
2947
|
+
class: "nocode-common-loading-warp"
|
|
2948
|
+
};
|
|
2949
|
+
const _hoisted_5 = { class: "w200px text-center color-[#666]" };
|
|
2950
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2951
|
+
__name: "document-layout",
|
|
2952
|
+
props: {
|
|
2953
|
+
loading: { type: Boolean },
|
|
2954
|
+
hasData: { type: Boolean }
|
|
2955
|
+
},
|
|
2956
|
+
setup(__props) {
|
|
2957
|
+
return (_ctx, _cache) => {
|
|
2958
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2959
|
+
__props.loading ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
2960
|
+
createVNode(DocumentLoading)
|
|
2961
|
+
])) : __props.hasData ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2962
|
+
renderSlot(_ctx.$slots, "default")
|
|
2963
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
2964
|
+
createElementVNode("div", _hoisted_5, [
|
|
2965
|
+
_cache[0] || (_cache[0] = createElementVNode("img", {
|
|
2966
|
+
class: "w100% h100%",
|
|
2967
|
+
src: _imports_0,
|
|
2968
|
+
alt: ""
|
|
2969
|
+
}, null, -1)),
|
|
2970
|
+
createElementVNode("span", null, toDisplayString(_ctx.$t("sys.noData")), 1)
|
|
2971
|
+
])
|
|
2972
|
+
]))
|
|
2973
|
+
]);
|
|
2974
|
+
};
|
|
2975
|
+
}
|
|
2976
|
+
});
|
|
2977
|
+
const DocumentSubTable = /* @__PURE__ */ defineComponent({
|
|
2978
|
+
name: "NocodeDocumentSubTable",
|
|
2979
|
+
props: {
|
|
2980
|
+
subInfo: {
|
|
2981
|
+
type: Object,
|
|
2982
|
+
required: true
|
|
2983
|
+
},
|
|
2984
|
+
/** 二维表相关信息 */
|
|
2985
|
+
subTable2dItem: {
|
|
2986
|
+
type: Object
|
|
2987
|
+
},
|
|
2988
|
+
widget: {
|
|
2989
|
+
type: Object,
|
|
2990
|
+
required: true
|
|
2991
|
+
},
|
|
2992
|
+
formData: {
|
|
2993
|
+
type: Object,
|
|
2994
|
+
required: true
|
|
2995
|
+
},
|
|
2996
|
+
/** 组件信息中心 */
|
|
2997
|
+
widgetCenter: {
|
|
2998
|
+
type: Object,
|
|
2999
|
+
required: true
|
|
3000
|
+
},
|
|
3001
|
+
start: {
|
|
3002
|
+
type: Number,
|
|
3003
|
+
required: true
|
|
3004
|
+
},
|
|
3005
|
+
end: {
|
|
3006
|
+
type: Number,
|
|
3007
|
+
required: true
|
|
3008
|
+
},
|
|
3009
|
+
/** 是否是移动端渲染 */
|
|
3010
|
+
isMobile: {
|
|
3011
|
+
type: Boolean
|
|
3012
|
+
},
|
|
3013
|
+
subTableCore: {
|
|
3014
|
+
type: SubTableCore
|
|
3015
|
+
}
|
|
3016
|
+
},
|
|
3017
|
+
setup(props, {
|
|
3018
|
+
emit,
|
|
3019
|
+
expose,
|
|
3020
|
+
slots
|
|
3021
|
+
}) {
|
|
3022
|
+
const defaultDataMap = inject(NCB_PROVIDE.DEFAULT_FIELD_DATA);
|
|
3023
|
+
const updateCalcCallback = inject(NCB_PROVIDE.PAGE_DATA_CALL_BACK);
|
|
3024
|
+
const openFillFieldsModal = inject(NCB_PROVIDE.MOBILE_FILL_FIELDS_POPUP);
|
|
3025
|
+
const {
|
|
3026
|
+
showDisplayStatus,
|
|
3027
|
+
dataRelationShip
|
|
3028
|
+
} = useWidgetStaticAttrs(props.widget);
|
|
3029
|
+
const subTableCore = props.subTableCore;
|
|
3030
|
+
provide(NCB_PROVIDE.SUB_TABLE_CORE, subTableCore);
|
|
3031
|
+
const {
|
|
3032
|
+
field = "",
|
|
3033
|
+
colsWidth,
|
|
3034
|
+
dynamicIds,
|
|
3035
|
+
isRowSubTable2d,
|
|
3036
|
+
childInitRowLen,
|
|
3037
|
+
quickFill,
|
|
3038
|
+
subModelType
|
|
3039
|
+
} = reactive(props.widget.props);
|
|
3040
|
+
const {
|
|
3041
|
+
openConsumeModal,
|
|
3042
|
+
destoryConsumeModal
|
|
3043
|
+
} = useMaterialBalance();
|
|
3044
|
+
const lastDynRowIdx = dynamicIds.length - 1;
|
|
3045
|
+
const lastDynamicId = last(dynamicIds);
|
|
3046
|
+
const realFormState = toRef(() => props.formData);
|
|
3047
|
+
const modelValue = computed({
|
|
3048
|
+
get() {
|
|
3049
|
+
return realFormState.value[field] ?? [];
|
|
3050
|
+
},
|
|
3051
|
+
set(val) {
|
|
3052
|
+
realFormState.value[field] = val;
|
|
3053
|
+
}
|
|
3054
|
+
});
|
|
3055
|
+
subTableCore.compSetup({
|
|
3056
|
+
formState: props.formData,
|
|
3057
|
+
updateCalcCallback: () => {
|
|
3058
|
+
updateCalcCallback?.(dataRelationShip?.uniqueId);
|
|
3059
|
+
}
|
|
3060
|
+
});
|
|
3061
|
+
const dataInfo = computed(() => {
|
|
3062
|
+
const visibleToRealIndexMap = {};
|
|
3063
|
+
const filterValue = [];
|
|
3064
|
+
modelValue.value.forEach((item, realIndex) => {
|
|
3065
|
+
if (!item.deleted_) {
|
|
3066
|
+
const visibleIndex = filterValue.length;
|
|
3067
|
+
visibleToRealIndexMap[visibleIndex] = realIndex;
|
|
3068
|
+
filterValue.push(item);
|
|
3069
|
+
}
|
|
3070
|
+
});
|
|
3071
|
+
return {
|
|
3072
|
+
tableData: filterValue.slice(props.start, props.end),
|
|
3073
|
+
hasSubData: filterValue.length > 1,
|
|
3074
|
+
isEndRow: props.end === filterValue.length,
|
|
3075
|
+
visibleToRealIndexMap
|
|
3076
|
+
};
|
|
3077
|
+
});
|
|
3078
|
+
const currentFieldDefaultData = computed(() => {
|
|
3079
|
+
return defaultDataMap?.[dataRelationShip?.uniqueId ?? ""] ?? {};
|
|
3080
|
+
});
|
|
3081
|
+
const showAction = computed(() => {
|
|
3082
|
+
if (props.isMobile) {
|
|
3083
|
+
return false;
|
|
3084
|
+
}
|
|
3085
|
+
if (dataRelationShip?.formChangeStatus) {
|
|
3086
|
+
return false;
|
|
3087
|
+
}
|
|
3088
|
+
return showDisplayStatus.value === "edit-component";
|
|
3089
|
+
});
|
|
3090
|
+
computed(() => showAction.value && quickFill);
|
|
3091
|
+
const handleDeleteRow = (rowData, dataIdx) => {
|
|
3092
|
+
deleteSubtableRow(field, props.start + dataIdx);
|
|
3093
|
+
if (rowData.id_ || rowData.group_ && rowData._2DTABLE_.some((item) => item.id_)) {
|
|
3094
|
+
rowData.deleted_ = true;
|
|
3095
|
+
} else {
|
|
3096
|
+
rowData.tempDeleted = true;
|
|
3097
|
+
modelValue.value = modelValue.value.filter((d) => !d.tempDeleted);
|
|
3098
|
+
}
|
|
3099
|
+
modelValue.value = [...modelValue.value];
|
|
3100
|
+
updateCalcCallback?.(dataRelationShip?.uniqueId);
|
|
3101
|
+
};
|
|
3102
|
+
const handleAddRow = ({
|
|
3103
|
+
index,
|
|
3104
|
+
position = "after",
|
|
3105
|
+
rowNum = 1,
|
|
3106
|
+
actionType,
|
|
3107
|
+
rowData,
|
|
3108
|
+
quickFillDatas
|
|
3109
|
+
}) => {
|
|
3110
|
+
const newRowsData = actionType === "copyRow" ? [cloneDeep(omit(rowData, "id_"))] : Array.from({
|
|
3111
|
+
length: rowNum
|
|
3112
|
+
}, (_, index2) => transformUtils.addSubTableRowItem({
|
|
3113
|
+
defaultData: currentFieldDefaultData.value,
|
|
3114
|
+
quickFillData: quickFillDatas?.[index2],
|
|
3115
|
+
subFieldId: field,
|
|
3116
|
+
isRowSubTable2d,
|
|
3117
|
+
childInitRowLen,
|
|
3118
|
+
crossFieldKeys: props.subTable2dItem?.crossFieldKeys
|
|
3119
|
+
}));
|
|
3120
|
+
const visibleIndex = props.start + index;
|
|
3121
|
+
const realIndex = dataInfo.value.visibleToRealIndexMap[visibleIndex];
|
|
3122
|
+
let insertIndex = 0;
|
|
3123
|
+
switch (position) {
|
|
3124
|
+
case "before":
|
|
3125
|
+
insertIndex = realIndex;
|
|
3126
|
+
break;
|
|
3127
|
+
case "after":
|
|
3128
|
+
insertIndex = realIndex + 1;
|
|
3129
|
+
break;
|
|
3130
|
+
case "last":
|
|
3131
|
+
insertIndex = modelValue.value.length;
|
|
3132
|
+
break;
|
|
3133
|
+
}
|
|
3134
|
+
if (actionType === "currentRow") {
|
|
3135
|
+
const firstData = newRowsData.shift();
|
|
3136
|
+
merge(rowData, firstData);
|
|
3137
|
+
}
|
|
3138
|
+
modelValue.value.splice(insertIndex, 0, ...newRowsData);
|
|
3139
|
+
updateCalcCallback?.(dataRelationShip?.uniqueId);
|
|
3140
|
+
};
|
|
3141
|
+
const handleDefaultClick = (rowData, dataIdx) => {
|
|
3142
|
+
const {
|
|
3143
|
+
fieldId
|
|
3144
|
+
} = props.subInfo;
|
|
3145
|
+
if (subModelType === "MATERIAL_BALANCE") {
|
|
3146
|
+
const subData = realFormState.value[fieldId] || [];
|
|
3147
|
+
openConsumeModal(subData);
|
|
3148
|
+
}
|
|
3149
|
+
};
|
|
3150
|
+
const handleMenuClick = (rowData, dataIdx) => ({
|
|
3151
|
+
key,
|
|
3152
|
+
actionValue
|
|
3153
|
+
}) => {
|
|
3154
|
+
switch (key) {
|
|
3155
|
+
case "insertRowBefore":
|
|
3156
|
+
handleAddRow({
|
|
3157
|
+
index: dataIdx,
|
|
3158
|
+
position: "before",
|
|
3159
|
+
rowNum: actionValue?.upRowNum || 1,
|
|
3160
|
+
quickFillDatas: actionValue?.data,
|
|
3161
|
+
actionType: "prevRow",
|
|
3162
|
+
rowData
|
|
3163
|
+
});
|
|
3164
|
+
break;
|
|
3165
|
+
case "insert1RowAfter":
|
|
3166
|
+
case "insertRowAfter":
|
|
3167
|
+
handleAddRow({
|
|
3168
|
+
index: dataIdx,
|
|
3169
|
+
position: "after",
|
|
3170
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3171
|
+
quickFillDatas: actionValue?.data,
|
|
3172
|
+
actionType: "nextRow",
|
|
3173
|
+
rowData
|
|
3174
|
+
});
|
|
3175
|
+
break;
|
|
3176
|
+
case "insertRowCurrent":
|
|
3177
|
+
handleAddRow({
|
|
3178
|
+
index: dataIdx,
|
|
3179
|
+
position: "after",
|
|
3180
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3181
|
+
quickFillDatas: actionValue?.data,
|
|
3182
|
+
actionType: "currentRow",
|
|
3183
|
+
rowData
|
|
3184
|
+
});
|
|
3185
|
+
break;
|
|
3186
|
+
case "copyRowAfter":
|
|
3187
|
+
handleAddRow({
|
|
3188
|
+
index: dataIdx,
|
|
3189
|
+
position: "after",
|
|
3190
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3191
|
+
quickFillDatas: actionValue?.data,
|
|
3192
|
+
actionType: "copyRow",
|
|
3193
|
+
rowData
|
|
3194
|
+
});
|
|
3195
|
+
break;
|
|
3196
|
+
case "copyRow2Last":
|
|
3197
|
+
handleAddRow({
|
|
3198
|
+
index: dataIdx,
|
|
3199
|
+
position: "last",
|
|
3200
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3201
|
+
quickFillDatas: actionValue?.data,
|
|
3202
|
+
actionType: "copyRow",
|
|
3203
|
+
rowData
|
|
3204
|
+
});
|
|
3205
|
+
break;
|
|
3206
|
+
case "deleteRowCurrent":
|
|
3207
|
+
handleDeleteRow(rowData, dataIdx);
|
|
3208
|
+
break;
|
|
3209
|
+
case "default":
|
|
3210
|
+
handleDefaultClick();
|
|
3211
|
+
break;
|
|
3212
|
+
default:
|
|
3213
|
+
subTableCore.handleMenuClick({
|
|
3214
|
+
rowData,
|
|
3215
|
+
dataIdx,
|
|
3216
|
+
actionKey: key
|
|
3217
|
+
});
|
|
3218
|
+
}
|
|
3219
|
+
};
|
|
3220
|
+
const renderTr2Td = (trKey, trData, rowData, {
|
|
3221
|
+
showDelBtn,
|
|
3222
|
+
showActionMenu,
|
|
3223
|
+
dataIdx,
|
|
3224
|
+
dynHeight
|
|
3225
|
+
}) => {
|
|
3226
|
+
const menus = subTableCore?.calcSubTableActionMenu({
|
|
3227
|
+
rowData,
|
|
3228
|
+
showDelBtn
|
|
3229
|
+
});
|
|
3230
|
+
return createVNode("tr", {
|
|
3231
|
+
"key": trKey,
|
|
3232
|
+
"height": dynHeight || trData.props.height
|
|
3233
|
+
}, [trData.nextIds.map((tdId, tdIdx) => {
|
|
3234
|
+
let tdInfo = props.widgetCenter[tdId];
|
|
3235
|
+
if (subTableCore) {
|
|
3236
|
+
tdInfo = subTableCore.calcNewTdInfo({
|
|
3237
|
+
oldTdInfo: tdInfo,
|
|
3238
|
+
rowData
|
|
3239
|
+
});
|
|
3240
|
+
}
|
|
3241
|
+
const tdAttrs = {
|
|
3242
|
+
key: tdId,
|
|
3243
|
+
id: tdId,
|
|
3244
|
+
hidden: tdInfo.cellHidden,
|
|
3245
|
+
borderAttrs: tdInfo.props.sourceBorderAttrs,
|
|
3246
|
+
autoMerge: tdInfo.fillDirection === "x" ? tdInfo.xAutoMerge : tdInfo.autoMerge,
|
|
3247
|
+
fillDirection: tdInfo.fillDirection,
|
|
3248
|
+
...pick(tdInfo.props, ["rowspan", "colspan", "class"])
|
|
3249
|
+
};
|
|
3250
|
+
const realTdAttrInfo = props.subInfo.mergeBlock?.[tdId];
|
|
3251
|
+
if (realTdAttrInfo) {
|
|
3252
|
+
Object.assign(tdAttrs, {
|
|
3253
|
+
...pick(realTdAttrInfo, ["rowspan", "colspan", "borderAttrs"]),
|
|
3254
|
+
hidden: false
|
|
3255
|
+
});
|
|
3256
|
+
}
|
|
3257
|
+
if (tdInfo.cellValueType) {
|
|
3258
|
+
if (props.isMobile) {
|
|
3259
|
+
Object.assign(tdAttrs, {
|
|
3260
|
+
onClick: setSelectMobileTdId.bind(null, tdInfo, dataRelationShip, props.widgetCenter, openFillFieldsModal, props.start + dataIdx)
|
|
3261
|
+
});
|
|
3262
|
+
}
|
|
3263
|
+
const subWidgetAttrs = {
|
|
3264
|
+
formData: rowData
|
|
3265
|
+
};
|
|
3266
|
+
if (dataIdx !== -1) {
|
|
3267
|
+
Object.assign(subWidgetAttrs, {
|
|
3268
|
+
subtableFieldId: field,
|
|
3269
|
+
realRowIndex: Number(props.start ?? 0) + dataIdx,
|
|
3270
|
+
pageRowIndex: dataIdx
|
|
3271
|
+
});
|
|
3272
|
+
}
|
|
3273
|
+
if (tdInfo.props.isNewFixedTableInDyn) {
|
|
3274
|
+
const cellFixedTableDataIdx = tdInfo.cellFixedTableDataIdx ?? 0;
|
|
3275
|
+
Object.assign(subWidgetAttrs, {
|
|
3276
|
+
formData: rowData?.["_2DTABLE_"]?.[cellFixedTableDataIdx] ?? {},
|
|
3277
|
+
childSubTableDataIndex: cellFixedTableDataIdx
|
|
3278
|
+
});
|
|
3279
|
+
}
|
|
3280
|
+
return createVNode(BorderTD, mergeProps({
|
|
3281
|
+
"style": tdInfo.style
|
|
3282
|
+
}, tdAttrs, {
|
|
3283
|
+
"isEmpty": true
|
|
3284
|
+
}), {
|
|
3285
|
+
default: () => [tdInfo.cellValueType !== CellType.Default || tdInfo.cellWidget.props.value ? slots.widget?.({
|
|
3286
|
+
tdInfo,
|
|
3287
|
+
...subWidgetAttrs
|
|
3288
|
+
}) : null]
|
|
3289
|
+
});
|
|
3290
|
+
}
|
|
3291
|
+
if (realTdAttrInfo && tdInfo.cellHidden) {
|
|
3292
|
+
return createVNode(BorderTD, mergeProps({
|
|
3293
|
+
"style": tdInfo.style
|
|
3294
|
+
}, tdAttrs, {
|
|
3295
|
+
"isEmpty": true
|
|
3296
|
+
}), null);
|
|
3297
|
+
}
|
|
3298
|
+
}), showAction.value && showActionMenu ? createVNode("div", {
|
|
3299
|
+
"class": "sub-table-action-bar"
|
|
3300
|
+
}, [slots.subAction?.({
|
|
3301
|
+
noPopover: subModelType === "MATERIAL_BALANCE",
|
|
3302
|
+
showDelBtn,
|
|
3303
|
+
showQuickFillBtn: quickFill,
|
|
3304
|
+
menus,
|
|
3305
|
+
subTableFieldId: field,
|
|
3306
|
+
mobileTdIdGroups: dataRelationShip?.mobileTdIdGroups,
|
|
3307
|
+
handleMenuClick: handleMenuClick(rowData, dataIdx)
|
|
3308
|
+
})]) : null]);
|
|
3309
|
+
};
|
|
3310
|
+
onUnmounted(() => {
|
|
3311
|
+
destoryConsumeModal();
|
|
3312
|
+
subTableCore.compUnmount();
|
|
3313
|
+
});
|
|
3314
|
+
return () => createVNode("div", {
|
|
3315
|
+
"class": "cmp-sub-table"
|
|
3316
|
+
}, [createVNode("table", {
|
|
3317
|
+
"class": "sub-table-wrapper",
|
|
3318
|
+
"cellpadding": "0",
|
|
3319
|
+
"cellspacing": "0"
|
|
3320
|
+
}, [createVNode("colgroup", null, [colsWidth.map((cw, cwIdx) => createVNode("col", {
|
|
3321
|
+
"key": cwIdx,
|
|
3322
|
+
"width": cw
|
|
3323
|
+
}, null))]), createVNode("tbody", null, [props.subInfo.containerIds.map((trId, trIdx) => {
|
|
3324
|
+
const trInfo = props.widgetCenter[trId];
|
|
3325
|
+
if (trInfo.props.identifier !== "dynamicTr") {
|
|
3326
|
+
const dynHeight = props.subInfo.dynamicRowHeights?.[trId];
|
|
3327
|
+
return renderTr2Td(trId, trInfo, realFormState.value, {
|
|
3328
|
+
showDelBtn: false,
|
|
3329
|
+
showActionMenu: false,
|
|
3330
|
+
dataIdx: -1,
|
|
3331
|
+
dynHeight
|
|
3332
|
+
});
|
|
3333
|
+
}
|
|
3334
|
+
if (trId === lastDynamicId) {
|
|
3335
|
+
const lastDataIdx = dataInfo.value.tableData.length - 1;
|
|
3336
|
+
return dataInfo.value.tableData.map((data, dataIdx) => {
|
|
3337
|
+
return dynamicIds.map((rowId, rowIdx) => {
|
|
3338
|
+
const isLast = dataIdx === lastDataIdx && rowIdx === lastDynRowIdx;
|
|
3339
|
+
const showDelBtn = dataInfo.value.hasSubData && rowIdx === lastDynRowIdx;
|
|
3340
|
+
dataInfo.value.isEndRow && isLast;
|
|
3341
|
+
const showActionMenu = rowIdx === lastDynRowIdx;
|
|
3342
|
+
const row = props.widgetCenter[rowId];
|
|
3343
|
+
const dynHeight = props.subInfo.dynamicRowHeights?.[rowId]?.[dataIdx];
|
|
3344
|
+
return renderTr2Td(`${dataIdx}_${rowIdx}`, row, data, {
|
|
3345
|
+
showDelBtn,
|
|
3346
|
+
showActionMenu,
|
|
3347
|
+
dataIdx,
|
|
3348
|
+
dynHeight
|
|
3349
|
+
});
|
|
3350
|
+
});
|
|
3351
|
+
});
|
|
3352
|
+
}
|
|
3353
|
+
})])])]);
|
|
3354
|
+
}
|
|
3355
|
+
});
|
|
3356
|
+
function mergeMarkedTd() {
|
|
3357
|
+
const markedTds = document.querySelectorAll('td[data-merge="true"]');
|
|
3358
|
+
if (!markedTds.length) return;
|
|
3359
|
+
const tableSet = /* @__PURE__ */ new Set();
|
|
3360
|
+
markedTds.forEach((td) => {
|
|
3361
|
+
const table = td.closest("table");
|
|
3362
|
+
if (table) tableSet.add(table);
|
|
3363
|
+
});
|
|
3364
|
+
tableSet.forEach((table) => {
|
|
3365
|
+
const rows = Array.from(
|
|
3366
|
+
table.querySelectorAll('tr:has(>td[data-merge="true"])')
|
|
3367
|
+
);
|
|
3368
|
+
if (rows.length <= 1) return;
|
|
3369
|
+
const mergeColIndexSet = /* @__PURE__ */ new Set();
|
|
3370
|
+
rows.forEach((tr) => {
|
|
3371
|
+
Array.from(tr.children).forEach((element, index) => {
|
|
3372
|
+
const td = element;
|
|
3373
|
+
if (td.tagName === "TD" && td.hasAttribute("data-merge")) {
|
|
3374
|
+
mergeColIndexSet.add(index);
|
|
3375
|
+
}
|
|
3376
|
+
});
|
|
3377
|
+
});
|
|
3378
|
+
mergeColIndexSet.forEach((colIndex) => {
|
|
3379
|
+
let lastTd = null;
|
|
3380
|
+
let lastText = "";
|
|
3381
|
+
let rowspan = 1;
|
|
3382
|
+
rows.forEach((tr) => {
|
|
3383
|
+
const td = tr.children[colIndex];
|
|
3384
|
+
if (!td || !td.hasAttribute("data-merge")) {
|
|
3385
|
+
lastTd = null;
|
|
3386
|
+
lastText = "";
|
|
3387
|
+
rowspan = 1;
|
|
3388
|
+
return;
|
|
3389
|
+
}
|
|
3390
|
+
const text = td.innerText.trim();
|
|
3391
|
+
if (!lastTd) {
|
|
3392
|
+
lastTd = td;
|
|
3393
|
+
lastText = text;
|
|
3394
|
+
rowspan = 1;
|
|
3395
|
+
return;
|
|
3396
|
+
}
|
|
3397
|
+
if (text && text === lastText) {
|
|
3398
|
+
rowspan++;
|
|
3399
|
+
lastTd.setAttribute("rowspan", String(rowspan));
|
|
3400
|
+
td.style.display = "none";
|
|
3401
|
+
} else {
|
|
3402
|
+
lastTd = td;
|
|
3403
|
+
lastText = text;
|
|
3404
|
+
rowspan = 1;
|
|
3405
|
+
}
|
|
3406
|
+
});
|
|
3407
|
+
});
|
|
3408
|
+
});
|
|
3409
|
+
}
|
|
3410
|
+
function waitDomStable(el, idle = 100, timeout = 2e3, __isPrintRender) {
|
|
3411
|
+
return new Promise((resolve) => {
|
|
3412
|
+
let timer;
|
|
3413
|
+
let requestTimer = null;
|
|
3414
|
+
let isDoneExecuted = false;
|
|
3415
|
+
const sendRequest = () => {
|
|
3416
|
+
if (isDoneExecuted) {
|
|
3417
|
+
if (requestTimer) {
|
|
3418
|
+
clearInterval(requestTimer);
|
|
3419
|
+
requestTimer = null;
|
|
3420
|
+
}
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
console.log("发起定时请求...");
|
|
3424
|
+
__isPrintRender && fetch("/gct-apaas/api/mergeCell/mockrequest");
|
|
3425
|
+
};
|
|
3426
|
+
const observer = new MutationObserver(() => {
|
|
3427
|
+
clearTimeout(timer);
|
|
3428
|
+
timer = window.setTimeout(done, idle);
|
|
3429
|
+
});
|
|
3430
|
+
const done = () => {
|
|
3431
|
+
isDoneExecuted = true;
|
|
3432
|
+
if (requestTimer) {
|
|
3433
|
+
clearInterval(requestTimer);
|
|
3434
|
+
requestTimer = null;
|
|
3435
|
+
}
|
|
3436
|
+
observer.disconnect();
|
|
3437
|
+
resolve();
|
|
3438
|
+
};
|
|
3439
|
+
observer.observe(el, {
|
|
3440
|
+
childList: true,
|
|
3441
|
+
subtree: true,
|
|
3442
|
+
attributes: true
|
|
3443
|
+
});
|
|
3444
|
+
timer = window.setTimeout(done, timeout);
|
|
3445
|
+
requestTimer = window.setInterval(sendRequest, 500);
|
|
3446
|
+
sendRequest();
|
|
3447
|
+
});
|
|
3448
|
+
}
|
|
3449
|
+
var MaterialConsumeActionType = /* @__PURE__ */ ((MaterialConsumeActionType2) => {
|
|
3450
|
+
MaterialConsumeActionType2["CONFIRM"] = "CONFIRM";
|
|
3451
|
+
MaterialConsumeActionType2["SCAN"] = "SCAN";
|
|
3452
|
+
MaterialConsumeActionType2["VIEW_BOM"] = "VIEW_BOM";
|
|
3453
|
+
MaterialConsumeActionType2["CHANGE_PARSE_RULE"] = "CHANGE_PARSE_RULE";
|
|
3454
|
+
return MaterialConsumeActionType2;
|
|
3455
|
+
})(MaterialConsumeActionType || {});
|
|
3456
|
+
const _hoisted_1$3 = {
|
|
3457
|
+
key: 0,
|
|
3458
|
+
class: "material-consume-action-bar"
|
|
3459
|
+
};
|
|
3460
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3461
|
+
__name: "material-consume-action",
|
|
3462
|
+
props: {
|
|
3463
|
+
showBom: { type: Boolean, default: false },
|
|
3464
|
+
showScanBtn: { type: Boolean, default: false },
|
|
3465
|
+
showConfirmBtn: { type: Boolean, default: true },
|
|
3466
|
+
rowData: {}
|
|
3467
|
+
},
|
|
3468
|
+
emits: ["doAction"],
|
|
3469
|
+
setup(__props, { emit: __emit }) {
|
|
3470
|
+
const props = __props;
|
|
3471
|
+
const emit = __emit;
|
|
3472
|
+
const isEditing = computed(() => {
|
|
3473
|
+
return !props.rowData.is_confirmed_;
|
|
3474
|
+
});
|
|
3475
|
+
const AllMenus = Object.values(MaterialConsumeActionType).map((e) => ({
|
|
3476
|
+
key: e,
|
|
3477
|
+
label: $t(`sys.edhr.materialConsumeAction.${e}`)
|
|
3478
|
+
}));
|
|
3479
|
+
computed(() => {
|
|
3480
|
+
return AllMenus.filter((e) => {
|
|
3481
|
+
if (e.key === MaterialConsumeActionType.CONFIRM) {
|
|
3482
|
+
return false;
|
|
3483
|
+
}
|
|
3484
|
+
return true;
|
|
3485
|
+
});
|
|
3486
|
+
});
|
|
3487
|
+
const handleConfirm = () => {
|
|
3488
|
+
emit("doAction", MaterialConsumeActionType.CONFIRM, props.rowData);
|
|
3489
|
+
};
|
|
3490
|
+
return (_ctx, _cache) => {
|
|
3491
|
+
return __props.showConfirmBtn && isEditing.value ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
3492
|
+
createElementVNode("div", {
|
|
3493
|
+
class: "sub-table-btn btn-confirm",
|
|
3494
|
+
onClick: handleConfirm
|
|
3495
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
3496
|
+
createElementVNode("i", { class: "iconfont icon-tijiao1" }, null, -1)
|
|
3497
|
+
])])
|
|
3498
|
+
])) : createCommentVNode("", true);
|
|
3499
|
+
};
|
|
3500
|
+
}
|
|
3501
|
+
});
|
|
3502
|
+
const MaterialConsumeAction = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-18b5f02d"]]);
|
|
3503
|
+
const MaterialConsumeTable = /* @__PURE__ */ defineComponent({
|
|
3504
|
+
name: "NocodeMaterialConsumeTable",
|
|
3505
|
+
props: {
|
|
3506
|
+
subInfo: {
|
|
3507
|
+
type: Object,
|
|
3508
|
+
required: true
|
|
3509
|
+
},
|
|
3510
|
+
widget: {
|
|
3511
|
+
type: Object,
|
|
3512
|
+
required: true
|
|
3513
|
+
},
|
|
3514
|
+
formData: {
|
|
3515
|
+
type: Object,
|
|
3516
|
+
required: true
|
|
3517
|
+
},
|
|
3518
|
+
/** 组件信息中心 */
|
|
3519
|
+
widgetCenter: {
|
|
3520
|
+
type: Object,
|
|
3521
|
+
required: true
|
|
3522
|
+
},
|
|
3523
|
+
start: {
|
|
3524
|
+
type: Number,
|
|
3525
|
+
required: true
|
|
3526
|
+
},
|
|
3527
|
+
end: {
|
|
3528
|
+
type: Number,
|
|
3529
|
+
required: true
|
|
3530
|
+
},
|
|
3531
|
+
tableController: {
|
|
3532
|
+
type: Object
|
|
3533
|
+
},
|
|
3534
|
+
/** 是否是移动端渲染 */
|
|
3535
|
+
isMobile: {
|
|
3536
|
+
type: Boolean
|
|
3537
|
+
}
|
|
3538
|
+
},
|
|
3539
|
+
setup(props, {
|
|
3540
|
+
emit,
|
|
3541
|
+
expose,
|
|
3542
|
+
slots
|
|
3543
|
+
}) {
|
|
3544
|
+
const defaultDataMap = inject(NCB_PROVIDE.DEFAULT_FIELD_DATA);
|
|
3545
|
+
const updateCalcCallback = inject(NCB_PROVIDE.PAGE_DATA_CALL_BACK);
|
|
3546
|
+
const openFillFieldsModal = inject(NCB_PROVIDE.MOBILE_FILL_FIELDS_POPUP);
|
|
3547
|
+
const {
|
|
3548
|
+
showDisplayStatus,
|
|
3549
|
+
dataRelationShip
|
|
3550
|
+
} = useWidgetStaticAttrs(props);
|
|
3551
|
+
const formModelController = useFormModel().injectController();
|
|
3552
|
+
const tableController = props.tableController;
|
|
3553
|
+
const paperWidget = inject(NCB_PROVIDE.PAGER, null);
|
|
3554
|
+
const unitConversionRules = paperWidget?.props?.unitConversionRules ?? [];
|
|
3555
|
+
const {
|
|
3556
|
+
currentPageFormState
|
|
3557
|
+
} = useCurrentPageFormState();
|
|
3558
|
+
provide(NCB_PROVIDE.MATERIAL_CONSUME_TABLE_CONTROLLER, tableController);
|
|
3559
|
+
const {
|
|
3560
|
+
field = "",
|
|
3561
|
+
colsWidth,
|
|
3562
|
+
dynamicIds,
|
|
3563
|
+
isRowSubTable2d,
|
|
3564
|
+
childInitRowLen,
|
|
3565
|
+
quickFill
|
|
3566
|
+
} = reactive(props.widget.props);
|
|
3567
|
+
const lastDynRowIdx = dynamicIds.length - 1;
|
|
3568
|
+
const lastDynamicId = last(dynamicIds);
|
|
3569
|
+
const realFormState = toRef(() => props.formData);
|
|
3570
|
+
const modelValue = computed({
|
|
3571
|
+
get() {
|
|
3572
|
+
return realFormState.value[field] ?? [];
|
|
3573
|
+
},
|
|
3574
|
+
set(val) {
|
|
3575
|
+
realFormState.value[field] = val;
|
|
3576
|
+
updateCalcCallback?.(dataRelationShip?.uniqueId);
|
|
3577
|
+
}
|
|
3578
|
+
});
|
|
3579
|
+
tableController.setup({
|
|
3580
|
+
tableDataRef: modelValue,
|
|
3581
|
+
widget: props.widget,
|
|
3582
|
+
formModelController,
|
|
3583
|
+
unitConversionRules,
|
|
3584
|
+
mainFormState: currentPageFormState
|
|
3585
|
+
});
|
|
3586
|
+
const dataInfo = computed(() => {
|
|
3587
|
+
const visibleToRealIndexMap = {};
|
|
3588
|
+
const filterValue = [];
|
|
3589
|
+
modelValue.value.forEach((item, realIndex) => {
|
|
3590
|
+
if (!item.deleted_) {
|
|
3591
|
+
const visibleIndex = filterValue.length;
|
|
3592
|
+
visibleToRealIndexMap[visibleIndex] = realIndex;
|
|
3593
|
+
filterValue.push(item);
|
|
3594
|
+
}
|
|
3595
|
+
});
|
|
3596
|
+
return {
|
|
3597
|
+
tableData: filterValue.slice(props.start, props.end),
|
|
3598
|
+
hasSubData: filterValue.length > 1,
|
|
3599
|
+
isEndRow: props.end === filterValue.length,
|
|
3600
|
+
visibleToRealIndexMap
|
|
3601
|
+
};
|
|
3602
|
+
});
|
|
3603
|
+
const currentFieldDefaultData = computed(() => {
|
|
3604
|
+
return defaultDataMap?.[dataRelationShip?.uniqueId ?? ""] ?? {};
|
|
3605
|
+
});
|
|
3606
|
+
const isFormChange = computed(() => {
|
|
3607
|
+
return dataRelationShip?.formChangeStatus;
|
|
3608
|
+
});
|
|
3609
|
+
const showAction = computed(() => {
|
|
3610
|
+
if (props.isMobile) {
|
|
3611
|
+
return false;
|
|
3612
|
+
}
|
|
3613
|
+
return showDisplayStatus.value === "edit-component";
|
|
3614
|
+
});
|
|
3615
|
+
computed(() => showAction.value && quickFill);
|
|
3616
|
+
const handleDeleteRow = (rowData, dataIdx) => {
|
|
3617
|
+
deleteSubtableRow(field, props.start + dataIdx);
|
|
3618
|
+
if (rowData.id_ || rowData.group_ && rowData._2DTABLE_.some((item) => item.id_)) {
|
|
3619
|
+
rowData.deleted_ = true;
|
|
3620
|
+
} else {
|
|
3621
|
+
rowData.tempDeleted = true;
|
|
3622
|
+
modelValue.value = modelValue.value.filter((d) => !d.tempDeleted);
|
|
3623
|
+
}
|
|
3624
|
+
modelValue.value = [...modelValue.value];
|
|
3625
|
+
};
|
|
3626
|
+
const handleAddRow = ({
|
|
3627
|
+
index,
|
|
3628
|
+
position = "after",
|
|
3629
|
+
rowNum = 1,
|
|
3630
|
+
actionType,
|
|
3631
|
+
rowData,
|
|
3632
|
+
quickFillDatas
|
|
3633
|
+
}) => {
|
|
3634
|
+
if (!isFormChange.value && tableController.hasEditingRow()) {
|
|
3635
|
+
return;
|
|
3636
|
+
}
|
|
3637
|
+
const newRowsData = actionType === "copyRow" ? [cloneDeep(omit(rowData, "id_"))] : Array.from({
|
|
3638
|
+
length: rowNum
|
|
3639
|
+
}, (_, index2) => transformUtils.addSubTableRowItem({
|
|
3640
|
+
defaultData: currentFieldDefaultData.value,
|
|
3641
|
+
quickFillData: quickFillDatas?.[index2],
|
|
3642
|
+
subFieldId: field,
|
|
3643
|
+
isRowSubTable2d,
|
|
3644
|
+
childInitRowLen
|
|
3645
|
+
}));
|
|
3646
|
+
newRowsData.forEach((rowData2) => {
|
|
3647
|
+
rowData2.is_confirmed_ = false;
|
|
3648
|
+
});
|
|
3649
|
+
const visibleIndex = props.start + index;
|
|
3650
|
+
const realIndex = dataInfo.value.visibleToRealIndexMap[visibleIndex];
|
|
3651
|
+
let insertIndex = 0;
|
|
3652
|
+
switch (position) {
|
|
3653
|
+
case "before":
|
|
3654
|
+
insertIndex = realIndex;
|
|
3655
|
+
break;
|
|
3656
|
+
case "after":
|
|
3657
|
+
insertIndex = realIndex + 1;
|
|
3658
|
+
break;
|
|
3659
|
+
case "last":
|
|
3660
|
+
insertIndex = modelValue.value.length;
|
|
3661
|
+
break;
|
|
3662
|
+
}
|
|
3663
|
+
if (actionType === "currentRow") {
|
|
3664
|
+
const firstData = newRowsData.shift();
|
|
3665
|
+
merge(rowData, firstData);
|
|
3666
|
+
}
|
|
3667
|
+
modelValue.value.splice(insertIndex, 0, ...newRowsData);
|
|
3668
|
+
updateCalcCallback?.(dataRelationShip?.uniqueId);
|
|
3669
|
+
};
|
|
3670
|
+
const handleAction = (action, rowData) => {
|
|
3671
|
+
console.log("action", action);
|
|
3672
|
+
switch (action) {
|
|
3673
|
+
case MaterialConsumeActionType.CONFIRM:
|
|
3674
|
+
tableController.confirm(rowData);
|
|
3675
|
+
break;
|
|
3676
|
+
case MaterialConsumeActionType.SCAN:
|
|
3677
|
+
tableController.openScanModal({
|
|
3678
|
+
title: props.widget.props.tableTitle
|
|
3679
|
+
});
|
|
3680
|
+
break;
|
|
3681
|
+
case MaterialConsumeActionType.VIEW_BOM:
|
|
3682
|
+
tableController.openBomModal();
|
|
3683
|
+
break;
|
|
3684
|
+
case MaterialConsumeActionType.CHANGE_PARSE_RULE:
|
|
3685
|
+
tableController.changeScanRule();
|
|
3686
|
+
break;
|
|
3687
|
+
}
|
|
3688
|
+
};
|
|
3689
|
+
const getNewTdInfo = (tdInfo, rowData) => {
|
|
3690
|
+
if (tdInfo.cellHidden || !tdInfo?.cellWidget?.props?.field) {
|
|
3691
|
+
return tdInfo;
|
|
3692
|
+
}
|
|
3693
|
+
const fieldKey = tdInfo.cellWidget.props.field;
|
|
3694
|
+
if (!MCDataUtil.allFields.includes(fieldKey)) {
|
|
3695
|
+
return tdInfo;
|
|
3696
|
+
}
|
|
3697
|
+
const cloneData = cloneDeep(tdInfo);
|
|
3698
|
+
if (tdInfo.cellWidget.props.field === "material_no_") {
|
|
3699
|
+
cloneData.cellWidget.props.newSpecificConfig.newOptions = [];
|
|
3700
|
+
merge(cloneData.cellWidget.props.newSpecificConfig, {
|
|
3701
|
+
newQueryData: {
|
|
3702
|
+
"product_id_.versionIn": rowData.product_id_ ? [rowData.product_id_.split(":").pop()] : null
|
|
3703
|
+
}
|
|
3704
|
+
});
|
|
3705
|
+
}
|
|
3706
|
+
if (fieldKey === "qty_uom_id_" || fieldKey === "qty_required_uom_id_") {
|
|
3707
|
+
cloneData.cellWidget.props.quickSearchField = ["name_.like", "code_.like"];
|
|
3708
|
+
cloneData.cellWidget.props.quickSearchExp = "OR(name_.like,code_.like)";
|
|
3709
|
+
}
|
|
3710
|
+
if (isFormChange.value) {
|
|
3711
|
+
return cloneData;
|
|
3712
|
+
}
|
|
3713
|
+
const isEditing = !rowData.is_confirmed_;
|
|
3714
|
+
let disabled = !isEditing;
|
|
3715
|
+
const disabledKeys = tableController.calcDisabledFields(rowData);
|
|
3716
|
+
if (disabledKeys.includes(fieldKey)) {
|
|
3717
|
+
disabled = true;
|
|
3718
|
+
}
|
|
3719
|
+
cloneData.cellWidget.props.disabled = disabled;
|
|
3720
|
+
if (cloneData.cellWidget.props.disabled) {
|
|
3721
|
+
cloneData.cellWidget.props.required = false;
|
|
3722
|
+
}
|
|
3723
|
+
return cloneData;
|
|
3724
|
+
};
|
|
3725
|
+
const handleMenuClick = (rowData, dataIdx) => ({
|
|
3726
|
+
key,
|
|
3727
|
+
actionValue
|
|
3728
|
+
}) => {
|
|
3729
|
+
switch (key) {
|
|
3730
|
+
case "rowEdit":
|
|
3731
|
+
tableController.editRow(rowData);
|
|
3732
|
+
break;
|
|
3733
|
+
case "insertRowBefore":
|
|
3734
|
+
handleAddRow({
|
|
3735
|
+
index: dataIdx,
|
|
3736
|
+
position: "before",
|
|
3737
|
+
rowNum: actionValue?.upRowNum || 1,
|
|
3738
|
+
quickFillDatas: actionValue?.data,
|
|
3739
|
+
actionType: "prevRow",
|
|
3740
|
+
rowData
|
|
3741
|
+
});
|
|
3742
|
+
break;
|
|
3743
|
+
case "insert1RowAfter":
|
|
3744
|
+
case "insertRowAfter":
|
|
3745
|
+
handleAddRow({
|
|
3746
|
+
index: dataIdx,
|
|
3747
|
+
position: "after",
|
|
3748
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3749
|
+
quickFillDatas: actionValue?.data,
|
|
3750
|
+
actionType: "nextRow",
|
|
3751
|
+
rowData
|
|
3752
|
+
});
|
|
3753
|
+
break;
|
|
3754
|
+
case "insertRowCurrent":
|
|
3755
|
+
handleAddRow({
|
|
3756
|
+
index: dataIdx,
|
|
3757
|
+
position: "after",
|
|
3758
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3759
|
+
quickFillDatas: actionValue?.data,
|
|
3760
|
+
actionType: "currentRow",
|
|
3761
|
+
rowData
|
|
3762
|
+
});
|
|
3763
|
+
break;
|
|
3764
|
+
case "copyRowAfter":
|
|
3765
|
+
handleAddRow({
|
|
3766
|
+
index: dataIdx,
|
|
3767
|
+
position: "after",
|
|
3768
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3769
|
+
quickFillDatas: actionValue?.data,
|
|
3770
|
+
actionType: "copyRow",
|
|
3771
|
+
rowData
|
|
3772
|
+
});
|
|
3773
|
+
tableController.updateRowConsumed();
|
|
3774
|
+
break;
|
|
3775
|
+
case "copyRow2Last":
|
|
3776
|
+
handleAddRow({
|
|
3777
|
+
index: dataIdx,
|
|
3778
|
+
position: "last",
|
|
3779
|
+
rowNum: actionValue?.downRowNum || 1,
|
|
3780
|
+
quickFillDatas: actionValue?.data,
|
|
3781
|
+
actionType: "copyRow",
|
|
3782
|
+
rowData
|
|
3783
|
+
});
|
|
3784
|
+
tableController.updateRowConsumed();
|
|
3785
|
+
break;
|
|
3786
|
+
case "deleteRowCurrent":
|
|
3787
|
+
handleDeleteRow(rowData, dataIdx);
|
|
3788
|
+
tableController.updateRowConsumed();
|
|
3789
|
+
break;
|
|
3790
|
+
default:
|
|
3791
|
+
handleAction(key, rowData);
|
|
3792
|
+
}
|
|
3793
|
+
};
|
|
3794
|
+
const renderTr2Td = (trKey, trData, rowData, {
|
|
3795
|
+
showDelBtn,
|
|
3796
|
+
showActionMenu,
|
|
3797
|
+
showScanBtn,
|
|
3798
|
+
showEditBtn,
|
|
3799
|
+
dataIdx,
|
|
3800
|
+
dynHeight
|
|
3801
|
+
}) => {
|
|
3802
|
+
const menus = [{
|
|
3803
|
+
type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
3804
|
+
label: "业务操作"
|
|
3805
|
+
}, showScanBtn ? getMenuByAction(SubTableActionEnum.SCAN) : void 0, tableController.actualBomEntries?.length ? getMenuByAction(SubTableActionEnum.VIEW_BOM) : void 0, getMenuByAction(SubTableActionEnum.CHANGE_PARSE_RULE), {
|
|
3806
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
3807
|
+
}, {
|
|
3808
|
+
type: SubTableActionMenuTypeEnum.SUBTITLE,
|
|
3809
|
+
label: "行编辑"
|
|
3810
|
+
}, showEditBtn ? getMenuByAction(SubTableActionEnum.RowEdit) : void 0, getMenuByAction(SubTableActionEnum.Insert1RowAfter), getCopySubMenu(), ...showDelBtn ? [{
|
|
3811
|
+
type: SubTableActionMenuTypeEnum.DIVIDER
|
|
3812
|
+
}, getMenuByAction(SubTableActionEnum.DeleteRowCurrent)] : []].filter(Boolean);
|
|
3813
|
+
return createVNode("tr", {
|
|
3814
|
+
"key": trKey,
|
|
3815
|
+
"height": dynHeight || trData.props.height
|
|
3816
|
+
}, [trData.nextIds.map((tdId, tdIdx) => {
|
|
3817
|
+
const tdInfo = getNewTdInfo(props.widgetCenter[tdId], rowData);
|
|
3818
|
+
const tdAttrs = {
|
|
3819
|
+
key: tdId,
|
|
3820
|
+
id: tdId,
|
|
3821
|
+
hidden: tdInfo.cellHidden,
|
|
3822
|
+
borderAttrs: tdInfo.props.sourceBorderAttrs,
|
|
3823
|
+
autoMerge: tdInfo.fillDirection === "x" ? tdInfo.xAutoMerge : tdInfo.autoMerge,
|
|
3824
|
+
fillDirection: tdInfo.fillDirection,
|
|
3825
|
+
...pick(tdInfo.props, ["rowspan", "colspan", "class"])
|
|
3826
|
+
};
|
|
3827
|
+
const realTdAttrInfo = props.subInfo.mergeBlock?.[tdId];
|
|
3828
|
+
if (realTdAttrInfo) {
|
|
3829
|
+
Object.assign(tdAttrs, {
|
|
3830
|
+
...pick(realTdAttrInfo, ["rowspan", "colspan", "borderAttrs"]),
|
|
3831
|
+
hidden: false
|
|
3832
|
+
});
|
|
3833
|
+
}
|
|
3834
|
+
if (tdInfo.cellValueType) {
|
|
3835
|
+
if (props.isMobile) {
|
|
3836
|
+
Object.assign(tdAttrs, {
|
|
3837
|
+
onClick: setSelectMobileTdId.bind(null, tdInfo, dataRelationShip, props.widgetCenter, openFillFieldsModal, props.start + dataIdx)
|
|
3838
|
+
});
|
|
3839
|
+
}
|
|
3840
|
+
const subWidgetAttrs = {
|
|
3841
|
+
formData: rowData
|
|
3842
|
+
};
|
|
3843
|
+
if (dataIdx !== -1) {
|
|
3844
|
+
Object.assign(subWidgetAttrs, {
|
|
3845
|
+
subtableFieldId: field,
|
|
3846
|
+
realRowIndex: Number(props.start ?? 0) + dataIdx,
|
|
3847
|
+
pageRowIndex: dataIdx
|
|
3848
|
+
});
|
|
3849
|
+
}
|
|
3850
|
+
if (tdInfo.props.isNewFixedTableInDyn) {
|
|
3851
|
+
const cellFixedTableDataIdx = tdInfo.cellFixedTableDataIdx ?? 0;
|
|
3852
|
+
Object.assign(subWidgetAttrs, {
|
|
3853
|
+
formData: rowData?.["_2DTABLE_"]?.[cellFixedTableDataIdx] ?? {},
|
|
3854
|
+
childSubTableDataIndex: cellFixedTableDataIdx
|
|
3855
|
+
});
|
|
3856
|
+
}
|
|
3857
|
+
return createVNode(BorderTD, mergeProps({
|
|
3858
|
+
"style": tdInfo.style
|
|
3859
|
+
}, tdAttrs, {
|
|
3860
|
+
"isEmpty": true
|
|
3861
|
+
}), {
|
|
3862
|
+
default: () => [tdInfo.cellValueType !== CellType.Default || tdInfo.cellWidget.props.value ? slots.widget?.({
|
|
3863
|
+
tdInfo,
|
|
3864
|
+
...subWidgetAttrs
|
|
3865
|
+
}) : null]
|
|
3866
|
+
});
|
|
3867
|
+
}
|
|
3868
|
+
if (realTdAttrInfo && tdInfo.cellHidden) {
|
|
3869
|
+
return createVNode(BorderTD, mergeProps({
|
|
3870
|
+
"style": tdInfo.style
|
|
3871
|
+
}, tdAttrs, {
|
|
3872
|
+
"isEmpty": true
|
|
3873
|
+
}), null);
|
|
3874
|
+
}
|
|
3875
|
+
}), showAction.value && showActionMenu && createVNode("div", {
|
|
3876
|
+
"class": "sub-table-action-bar"
|
|
3877
|
+
}, [slots.subAction?.({
|
|
3878
|
+
menus,
|
|
3879
|
+
subTableFieldId: field,
|
|
3880
|
+
mobileTdIdGroups: dataRelationShip?.mobileTdIdGroups,
|
|
3881
|
+
handleMenuClick: handleMenuClick(rowData, dataIdx)
|
|
3882
|
+
}), createVNode(MaterialConsumeAction, {
|
|
3883
|
+
"showConfirmBtn": !isFormChange.value,
|
|
3884
|
+
"rowData": rowData,
|
|
3885
|
+
"onDoAction": handleAction
|
|
3886
|
+
}, null)])]);
|
|
3887
|
+
};
|
|
3888
|
+
return () => createVNode("div", {
|
|
3889
|
+
"class": "cmp-sub-table"
|
|
3890
|
+
}, [createVNode("table", {
|
|
3891
|
+
"class": "sub-table-wrapper",
|
|
3892
|
+
"cellpadding": "0",
|
|
3893
|
+
"cellspacing": "0"
|
|
3894
|
+
}, [createVNode("colgroup", null, [colsWidth.map((cw, cwIdx) => createVNode("col", {
|
|
3895
|
+
"key": cwIdx,
|
|
3896
|
+
"width": cw
|
|
3897
|
+
}, null))]), createVNode("tbody", null, [props.subInfo.containerIds.map((trId, trIdx) => {
|
|
3898
|
+
const trInfo = props.widgetCenter[trId];
|
|
3899
|
+
console.log("trInfo", trInfo);
|
|
3900
|
+
if (trInfo.props.identifier !== "dynamicTr") {
|
|
3901
|
+
const dynHeight = props.subInfo.dynamicRowHeights?.[trId];
|
|
3902
|
+
return renderTr2Td(trId, trInfo, realFormState.value, {
|
|
3903
|
+
showDelBtn: false,
|
|
3904
|
+
showActionMenu: false,
|
|
3905
|
+
dataIdx: -1,
|
|
3906
|
+
dynHeight
|
|
3907
|
+
});
|
|
3908
|
+
}
|
|
3909
|
+
if (trId === lastDynamicId) {
|
|
3910
|
+
const lastDataIdx = dataInfo.value.tableData.length - 1;
|
|
3911
|
+
return dataInfo.value.tableData.map((data, dataIdx) => {
|
|
3912
|
+
return dynamicIds.map((rowId, rowIdx) => {
|
|
3913
|
+
const isLastDynRow = rowIdx === lastDynRowIdx;
|
|
3914
|
+
const isLast = dataIdx === lastDataIdx && isLastDynRow;
|
|
3915
|
+
const showDelBtn = dataInfo.value.hasSubData && isLastDynRow && // 开启了顺序投料时,只有最后一行可以删除
|
|
3916
|
+
(tableController.enableSequenceLoading ? isLast : true);
|
|
3917
|
+
const showScanBtn = isLast;
|
|
3918
|
+
dataInfo.value.isEndRow && isLast;
|
|
3919
|
+
const showActionMenu = isLastDynRow;
|
|
3920
|
+
const showEditBtn = !isFormChange.value && (tableController.enableSequenceLoading ? isLast : true) && data.is_confirmed_;
|
|
3921
|
+
const row = props.widgetCenter[rowId];
|
|
3922
|
+
const dynHeight = props.subInfo.dynamicRowHeights?.[rowId]?.[dataIdx];
|
|
3923
|
+
return renderTr2Td(`${dataIdx}_${rowIdx}`, row, data, {
|
|
3924
|
+
showDelBtn,
|
|
3925
|
+
showActionMenu,
|
|
3926
|
+
showScanBtn,
|
|
3927
|
+
showEditBtn,
|
|
3928
|
+
dataIdx,
|
|
3929
|
+
dynHeight
|
|
3930
|
+
});
|
|
3931
|
+
});
|
|
3932
|
+
});
|
|
3933
|
+
}
|
|
3934
|
+
})])])]);
|
|
3935
|
+
}
|
|
3936
|
+
});
|
|
3937
|
+
const DocumentPaper = /* @__PURE__ */ defineComponent({
|
|
3938
|
+
name: "NocodeDocumentPaper",
|
|
3939
|
+
props: {
|
|
3940
|
+
/** 页面内容信息 */
|
|
3941
|
+
page: {
|
|
3942
|
+
type: Object,
|
|
3943
|
+
required: true
|
|
3944
|
+
},
|
|
3945
|
+
/** 映射信息 */
|
|
3946
|
+
basicInfo: {
|
|
3947
|
+
type: Object,
|
|
3948
|
+
required: true
|
|
3949
|
+
},
|
|
3950
|
+
/** 表单数据 */
|
|
3951
|
+
formState: {
|
|
3952
|
+
type: Object,
|
|
3953
|
+
required: true
|
|
3954
|
+
},
|
|
3955
|
+
/** 模板数据中心 */
|
|
3956
|
+
widgetCenter: {
|
|
3957
|
+
type: Object,
|
|
3958
|
+
required: true
|
|
3959
|
+
},
|
|
3960
|
+
/** 是否是移动端渲染 */
|
|
3961
|
+
isMobile: {
|
|
3962
|
+
type: Boolean
|
|
3963
|
+
},
|
|
3964
|
+
selfInfoList: {
|
|
3965
|
+
type: Array
|
|
3966
|
+
}
|
|
3967
|
+
},
|
|
3968
|
+
setup(props, {
|
|
3969
|
+
expose,
|
|
3970
|
+
slots
|
|
3971
|
+
}) {
|
|
3972
|
+
provide(NCB_PROVIDE.DATA_RELATION_SHIP, props.basicInfo);
|
|
3973
|
+
provide(NCB_PROVIDE.FORM_INST_LIST, props.selfInfoList);
|
|
3974
|
+
const tmplBomCMap = inject(NCB_PROVIDE.TMPL_BOM_CONTROLLER_MAP);
|
|
3975
|
+
const tmplBomController = computed(() => tmplBomCMap.value?.[props.basicInfo?.uniqueId]);
|
|
3976
|
+
const subTableCoreFactoryMap = inject(NCB_PROVIDE.SUB_TABLE_CORE_FACTORY_MAP);
|
|
3977
|
+
const subTableCoreFactory = computed(() => subTableCoreFactoryMap.value?.[props.basicInfo?.uniqueId]);
|
|
3978
|
+
const mainTableRef = ref();
|
|
3979
|
+
const isPdfMode = inject(NCB_PROVIDE.IS_PDF, false);
|
|
3980
|
+
const openFillFieldsModal = inject(NCB_PROVIDE.MOBILE_FILL_FIELDS_POPUP);
|
|
3981
|
+
const widget = props.widgetCenter?.[ComponentTypeEnum.PAPER];
|
|
3982
|
+
const {
|
|
3983
|
+
pageMargins,
|
|
3984
|
+
pageSize,
|
|
3985
|
+
pageWidth,
|
|
3986
|
+
pageHeight,
|
|
3987
|
+
colsWidth,
|
|
3988
|
+
subTable2DList
|
|
3989
|
+
} = widget.props;
|
|
3990
|
+
provide(NCB_PROVIDE.PAGER, widget);
|
|
3991
|
+
const size = [pageWidth, pageHeight];
|
|
3992
|
+
const sortSize = size.slice().sort();
|
|
3993
|
+
const isLandscape = JSON.stringify(size) !== JSON.stringify(sortSize);
|
|
3994
|
+
const orientation = isLandscape ? "landscape" : "portrait";
|
|
3995
|
+
const resultSize = isLandscape && isPdfMode ? sortSize : size;
|
|
3996
|
+
const paddings = pageMargins?.split(" ");
|
|
3997
|
+
const config = {
|
|
3998
|
+
cls: orientation,
|
|
3999
|
+
style: {
|
|
4000
|
+
width: `${resultSize[0]}mm`,
|
|
4001
|
+
height: `${resultSize[1]}mm`
|
|
4002
|
+
}
|
|
4003
|
+
};
|
|
4004
|
+
const paperStyles = {
|
|
4005
|
+
width: `${pageWidth}mm`,
|
|
4006
|
+
minWidth: `${pageWidth}mm`,
|
|
4007
|
+
height: `${pageHeight}mm`,
|
|
4008
|
+
padding: pageMargins,
|
|
4009
|
+
"--pageWidth": `-${pageWidth}mm`
|
|
4010
|
+
};
|
|
4011
|
+
const overlayStyle = {
|
|
4012
|
+
["--offset-top"]: paddings?.[0] || "0px",
|
|
4013
|
+
["--offset-right"]: paddings?.[1] || "0px",
|
|
4014
|
+
["--offset-bottom"]: paddings?.[2] || "0px",
|
|
4015
|
+
["--offset-left"]: paddings?.[3] || "0px"
|
|
4016
|
+
};
|
|
4017
|
+
const getWidgetAttrs = (tdInfo) => {
|
|
4018
|
+
const attrInfo = {
|
|
4019
|
+
formData: props.formState
|
|
4020
|
+
};
|
|
4021
|
+
const field = tdInfo.props.fixedTableFieldId ?? "";
|
|
4022
|
+
if (tdInfo.props.isNewFixedTableTd) {
|
|
4023
|
+
const cellFixedTableDataIdx = tdInfo.cellFixedTableDataIdx ?? 0;
|
|
4024
|
+
Object.assign(attrInfo, {
|
|
4025
|
+
formData: props.formState?.[field]?.[cellFixedTableDataIdx] ?? {},
|
|
4026
|
+
subtableFieldId: field,
|
|
4027
|
+
realRowIndex: cellFixedTableDataIdx,
|
|
4028
|
+
pageRowIndex: cellFixedTableDataIdx
|
|
4029
|
+
});
|
|
4030
|
+
} else if (tdInfo.props.isNewCheckTable2D) {
|
|
4031
|
+
const {
|
|
4032
|
+
checkTableType
|
|
4033
|
+
} = tdInfo.props;
|
|
4034
|
+
const rowIdx = tdInfo.cellCheckTableDataRowIdx ?? 0;
|
|
4035
|
+
const colIdx = tdInfo.cellCheckTableDataColIdx ?? 0;
|
|
4036
|
+
const baseInfo = {
|
|
4037
|
+
subtableFieldId: field,
|
|
4038
|
+
realRowIndex: rowIdx,
|
|
4039
|
+
pageRowIndex: rowIdx,
|
|
4040
|
+
/** 检验表列坐标,与 realRowIndex 解耦,不改变原有 formData 绑定逻辑 */
|
|
4041
|
+
realColIndex: colIdx
|
|
4042
|
+
};
|
|
4043
|
+
switch (checkTableType) {
|
|
4044
|
+
case "col":
|
|
4045
|
+
baseInfo.formData = props.formState?.[field]?.[colIdx] ?? {};
|
|
4046
|
+
baseInfo.realRowIndex = colIdx;
|
|
4047
|
+
baseInfo.pageRowIndex = colIdx;
|
|
4048
|
+
break;
|
|
4049
|
+
case "row":
|
|
4050
|
+
baseInfo.formData = props.formState?.[field]?.[rowIdx] ?? {};
|
|
4051
|
+
break;
|
|
4052
|
+
case "child":
|
|
4053
|
+
baseInfo.formData = props.formState?.[field]?.[rowIdx]?.["_2DTABLE_"]?.[colIdx] ?? {};
|
|
4054
|
+
baseInfo.childSubTableDataIndex = colIdx;
|
|
4055
|
+
break;
|
|
4056
|
+
}
|
|
4057
|
+
Object.assign(attrInfo, baseInfo);
|
|
4058
|
+
}
|
|
4059
|
+
return attrInfo;
|
|
4060
|
+
};
|
|
4061
|
+
onMounted(async () => {
|
|
4062
|
+
if (props.basicInfo.renderModeType === RenderModeEnum.ViewMode) {
|
|
4063
|
+
await waitDomStable(mainTableRef.value, void 0, void 0, props.basicInfo.__isPrintRender);
|
|
4064
|
+
mergeMarkedTd();
|
|
4065
|
+
}
|
|
4066
|
+
});
|
|
4067
|
+
return () => createVNode("div", {
|
|
4068
|
+
"class": ["cmp-paper-wrapper", pageSize, config.cls, {
|
|
4069
|
+
"print-view": isPdfMode
|
|
4070
|
+
}],
|
|
4071
|
+
"style": {
|
|
4072
|
+
...config.style,
|
|
4073
|
+
...overlayStyle
|
|
4074
|
+
},
|
|
4075
|
+
"data-nocode-orientation": config.cls,
|
|
4076
|
+
"data-nocode-width": pageWidth,
|
|
4077
|
+
"data-nocode-height": pageHeight
|
|
4078
|
+
}, [createVNode("div", {
|
|
4079
|
+
"class": "cmp-paper",
|
|
4080
|
+
"style": paperStyles
|
|
4081
|
+
}, [createVNode("div", {
|
|
4082
|
+
"class": "cmp-paper-overlay"
|
|
4083
|
+
}, [slots.annotation?.(), widget.headerWidgets && createVNode("div", {
|
|
4084
|
+
"class": "paper-header"
|
|
4085
|
+
}, [slots.overlay?.({
|
|
4086
|
+
widgets: widget.headerWidgets
|
|
4087
|
+
})]), widget.footerWidgets && createVNode("div", {
|
|
4088
|
+
"class": "paper-footer"
|
|
4089
|
+
}, [slots.overlay?.({
|
|
4090
|
+
widgets: widget.footerWidgets
|
|
4091
|
+
})]), widget.watermarks && createVNode("div", {
|
|
4092
|
+
"class": "paper-watermark"
|
|
4093
|
+
}, [slots.overlay?.({
|
|
4094
|
+
widgets: widget.watermarks
|
|
4095
|
+
})])]), createVNode("div", {
|
|
4096
|
+
"class": "cmp-paper-container"
|
|
4097
|
+
}, [createVNode("table", {
|
|
4098
|
+
"ref": mainTableRef,
|
|
4099
|
+
"class": "main-table-wrapper",
|
|
4100
|
+
"cellpadding": "0",
|
|
4101
|
+
"cellspacing": "0"
|
|
4102
|
+
}, [createVNode("colgroup", null, [colsWidth.map((cw, cwIdx) => createVNode("col", {
|
|
4103
|
+
"key": cwIdx,
|
|
4104
|
+
"width": cw
|
|
4105
|
+
}, null))]), createVNode("tbody", null, [props.page.containerIds.map((trId, trIdx) => {
|
|
4106
|
+
const trInfo = props.widgetCenter[trId];
|
|
4107
|
+
const tdIds = trInfo.nextIds;
|
|
4108
|
+
const height = props.page.dynamicRowHeights?.[trId] || trInfo.props.height;
|
|
4109
|
+
return createVNode("tr", {
|
|
4110
|
+
"key": `${trId}_${trIdx}`,
|
|
4111
|
+
"height": height
|
|
4112
|
+
}, [tdIds.map((tdId, tdIdx) => {
|
|
4113
|
+
const tdInfo = props.widgetCenter[tdId];
|
|
4114
|
+
const tdAttrs = {
|
|
4115
|
+
key: tdId,
|
|
4116
|
+
id: tdId,
|
|
4117
|
+
hidden: tdInfo.cellHidden,
|
|
4118
|
+
borderAttrs: tdInfo.props.sourceBorderAttrs,
|
|
4119
|
+
autoMerge: tdInfo.fillDirection === "x" ? tdInfo.xAutoMerge : tdInfo.autoMerge,
|
|
4120
|
+
fillDirection: tdInfo.fillDirection,
|
|
4121
|
+
...pick(tdInfo.props, ["rowspan", "colspan", "class"])
|
|
4122
|
+
};
|
|
4123
|
+
const realTdAttrInfo = props.page.mergeBlock?.[tdId];
|
|
4124
|
+
const dynamicConfig = {};
|
|
4125
|
+
if (realTdAttrInfo) {
|
|
4126
|
+
Object.assign(tdAttrs, {
|
|
4127
|
+
...pick(realTdAttrInfo, ["rowspan", "colspan", "borderAttrs"]),
|
|
4128
|
+
hidden: false
|
|
4129
|
+
});
|
|
4130
|
+
Object.assign(dynamicConfig, {
|
|
4131
|
+
...pick(realTdAttrInfo, ["visibleText", "sourceTdId", "isDynRo"])
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
4134
|
+
const subInfo = props.page.subTableMap?.[tdId];
|
|
4135
|
+
if (subInfo && subInfo.wrapperTdId === tdId) {
|
|
4136
|
+
const subWidget = props.widgetCenter[subInfo.widgetId];
|
|
4137
|
+
const field = subWidget.props.field ?? "";
|
|
4138
|
+
const relationObj = props.page.relation[field] ?? {};
|
|
4139
|
+
const subTable2dItem = subTable2DList.find((item) => item.subTable2d && item.rowSubFieldKey === field);
|
|
4140
|
+
if (subWidget.props.isMaterialConsumeTable) {
|
|
4141
|
+
const tableController = tmplBomController.value?.tableControllers[subWidget.props.materialConsumeTableId];
|
|
4142
|
+
if (tableController) {
|
|
4143
|
+
return createVNode("td", mergeProps({
|
|
4144
|
+
"style": tdInfo.style
|
|
4145
|
+
}, tdAttrs), [createVNode(MaterialConsumeTable, {
|
|
4146
|
+
"subInfo": subInfo,
|
|
4147
|
+
"widget": subWidget,
|
|
4148
|
+
"formData": props.formState,
|
|
4149
|
+
"widgetCenter": props.widgetCenter,
|
|
4150
|
+
"start": relationObj?.start,
|
|
4151
|
+
"end": relationObj.end,
|
|
4152
|
+
"isMobile": props.isMobile,
|
|
4153
|
+
"tableController": tableController
|
|
4154
|
+
}, {
|
|
4155
|
+
widget: (subProps) => slots.widget?.(subProps),
|
|
4156
|
+
subAction: (subProps) => slots.subAction?.(subProps)
|
|
4157
|
+
})]);
|
|
4158
|
+
}
|
|
4159
|
+
}
|
|
4160
|
+
const subTableCore = subTableCoreFactory.value?.getSubCoreByTid(subInfo.widgetId);
|
|
4161
|
+
return createVNode("td", mergeProps({
|
|
4162
|
+
"style": tdInfo.style
|
|
4163
|
+
}, tdAttrs), [createVNode(DocumentSubTable, {
|
|
4164
|
+
"subInfo": subInfo,
|
|
4165
|
+
"widget": subWidget,
|
|
4166
|
+
"subTable2dItem": subTable2dItem,
|
|
4167
|
+
"formData": props.formState,
|
|
4168
|
+
"widgetCenter": props.widgetCenter,
|
|
4169
|
+
"start": relationObj?.start,
|
|
4170
|
+
"end": relationObj.end,
|
|
4171
|
+
"isMobile": props.isMobile,
|
|
4172
|
+
"subTableCore": subTableCore
|
|
4173
|
+
}, {
|
|
4174
|
+
widget: (subProps) => slots.widget?.(subProps),
|
|
4175
|
+
subAction: (subProps) => slots.subAction?.(subProps)
|
|
4176
|
+
})]);
|
|
4177
|
+
}
|
|
4178
|
+
if (tdInfo.cellValueType) {
|
|
4179
|
+
const widgetAttrs = getWidgetAttrs(tdInfo);
|
|
4180
|
+
if (props.isMobile) {
|
|
4181
|
+
Object.assign(tdAttrs, {
|
|
4182
|
+
onClick: setSelectMobileTdId.bind(null, tdInfo, props.basicInfo, props.widgetCenter, openFillFieldsModal, -1)
|
|
4183
|
+
});
|
|
4184
|
+
}
|
|
4185
|
+
return createVNode(BorderTD, mergeProps({
|
|
4186
|
+
"style": tdInfo.style
|
|
4187
|
+
}, tdAttrs, {
|
|
4188
|
+
"isEmpty": true
|
|
4189
|
+
}), {
|
|
4190
|
+
default: () => [tdInfo.cellValueType !== CellType.Default || tdInfo.cellWidget.props.value ? slots.widget?.({
|
|
4191
|
+
tdInfo,
|
|
4192
|
+
...widgetAttrs,
|
|
4193
|
+
dynamicConfig
|
|
4194
|
+
}) : null]
|
|
4195
|
+
});
|
|
4196
|
+
}
|
|
4197
|
+
if (realTdAttrInfo && tdInfo.cellHidden) {
|
|
4198
|
+
const sourceTdInfo = props.widgetCenter[dynamicConfig?.sourceTdId];
|
|
4199
|
+
const widgetAttrs = getWidgetAttrs(tdInfo);
|
|
4200
|
+
return createVNode(BorderTD, mergeProps({
|
|
4201
|
+
"style": tdInfo.style
|
|
4202
|
+
}, tdAttrs, {
|
|
4203
|
+
"isEmpty": true
|
|
4204
|
+
}), {
|
|
4205
|
+
default: () => [dynamicConfig?.isDynRo ? slots.widget?.({
|
|
4206
|
+
tdInfo: sourceTdInfo,
|
|
4207
|
+
...widgetAttrs,
|
|
4208
|
+
dynamicConfig
|
|
4209
|
+
}) : null]
|
|
4210
|
+
});
|
|
4211
|
+
}
|
|
4212
|
+
})]);
|
|
4213
|
+
})])])])])]);
|
|
4214
|
+
}
|
|
4215
|
+
});
|
|
4216
|
+
const _hoisted_1$2 = { class: "document-quick-fill-container" };
|
|
4217
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
4218
|
+
__name: "document-quick-fill-modal",
|
|
4219
|
+
props: {
|
|
4220
|
+
columns: {},
|
|
4221
|
+
modal: {},
|
|
4222
|
+
callback: {}
|
|
4223
|
+
},
|
|
4224
|
+
setup(__props) {
|
|
4225
|
+
const props = __props;
|
|
4226
|
+
const rows = ref([]);
|
|
4227
|
+
function makeEmptyRow() {
|
|
4228
|
+
return Object.fromEntries(props.columns.map((c) => [c.prop, ""]));
|
|
4229
|
+
}
|
|
4230
|
+
function initRows(count = 10) {
|
|
4231
|
+
rows.value = Array.from({ length: count }, () => makeEmptyRow());
|
|
4232
|
+
}
|
|
4233
|
+
onBeforeMount(() => {
|
|
4234
|
+
initRows(200);
|
|
4235
|
+
});
|
|
4236
|
+
function processRows(rows2 = []) {
|
|
4237
|
+
const isBlank = (v) => v === null || v === void 0 || typeof v === "string" && v.trim() === "" || Array.isArray(v) && v.length === 0;
|
|
4238
|
+
const roundToScale = (num, scale) => {
|
|
4239
|
+
if (scale == null) return num;
|
|
4240
|
+
const factor = Math.pow(10, scale);
|
|
4241
|
+
return Math.round(num * factor) / factor;
|
|
4242
|
+
};
|
|
4243
|
+
const parseNumber = (v, { integer = false, scale = null } = {}) => {
|
|
4244
|
+
if (v === null || v === void 0) return null;
|
|
4245
|
+
if (typeof v === "number") {
|
|
4246
|
+
if (!Number.isFinite(v)) return null;
|
|
4247
|
+
if (integer && !Number.isInteger(v)) return null;
|
|
4248
|
+
const n2 = scale != null ? roundToScale(v, scale) : v;
|
|
4249
|
+
return Number.isFinite(n2) ? n2 : null;
|
|
4250
|
+
}
|
|
4251
|
+
let s = String(v).trim();
|
|
4252
|
+
if (s === "") return null;
|
|
4253
|
+
s = s.replace(/,/g, "");
|
|
4254
|
+
if (/^[\(\(].+[\)\)]$/.test(s)) {
|
|
4255
|
+
s = "-" + s.replace(/^[\(\(]|[\)\)]$/g, "");
|
|
4256
|
+
}
|
|
4257
|
+
const n = Number(s);
|
|
4258
|
+
if (!Number.isFinite(n)) return null;
|
|
4259
|
+
if (integer) {
|
|
4260
|
+
if (!Number.isInteger(n)) return null;
|
|
4261
|
+
return n;
|
|
4262
|
+
} else {
|
|
4263
|
+
return scale != null ? roundToScale(n, scale) : n;
|
|
4264
|
+
}
|
|
4265
|
+
};
|
|
4266
|
+
const parseToDate = (v) => {
|
|
4267
|
+
if (v === null || v === void 0 || v === "") return null;
|
|
4268
|
+
if (typeof v === "string") {
|
|
4269
|
+
let s = v.trim();
|
|
4270
|
+
if (s === "") return null;
|
|
4271
|
+
s = s.replace(/-/g, "/");
|
|
4272
|
+
if (/^\d{1,2}:\d{2}(:\d{2})?$/.test(s)) {
|
|
4273
|
+
const today = /* @__PURE__ */ new Date();
|
|
4274
|
+
const datePart = `${today.getFullYear()}/${today.getMonth() + 1}/${today.getDate()}`;
|
|
4275
|
+
s = `${datePart} ${s}`;
|
|
4276
|
+
}
|
|
4277
|
+
const d = new Date(s);
|
|
4278
|
+
return isNaN(d) ? null : d;
|
|
4279
|
+
}
|
|
4280
|
+
return null;
|
|
4281
|
+
};
|
|
4282
|
+
const buildOptionLookup = (opts = []) => {
|
|
4283
|
+
const map = /* @__PURE__ */ new Map();
|
|
4284
|
+
for (const o of opts) {
|
|
4285
|
+
const val = o.value != null ? String(o.value) : void 0;
|
|
4286
|
+
const text = o.text != null ? String(o.text) : void 0;
|
|
4287
|
+
const label = o.label != null ? String(o.label) : void 0;
|
|
4288
|
+
if (val !== void 0) map.set(val, val);
|
|
4289
|
+
if (text !== void 0) map.set(text, val || text);
|
|
4290
|
+
if (label !== void 0) map.set(label, val || label);
|
|
4291
|
+
}
|
|
4292
|
+
return map;
|
|
4293
|
+
};
|
|
4294
|
+
const pad2 = (n) => String(n).padStart(2, "0");
|
|
4295
|
+
const formatDate = (d) => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
|
|
4296
|
+
const formatTime = (d) => `${pad2(d.getHours())}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}`;
|
|
4297
|
+
const formatDateTime = (d) => `${formatDate(d)} ${formatTime(d)}`;
|
|
4298
|
+
const out = rows2.map((row) => {
|
|
4299
|
+
const newRow = { ...row };
|
|
4300
|
+
for (const f of props.columns) {
|
|
4301
|
+
const val = row[f.prop];
|
|
4302
|
+
switch (f.fieldType) {
|
|
4303
|
+
case FIELD_TYPE.INTEGER:
|
|
4304
|
+
case FIELD_TYPE.LONG:
|
|
4305
|
+
{
|
|
4306
|
+
const n = parseNumber(val, { integer: true });
|
|
4307
|
+
newRow[f.prop] = isBlank(n) ? void 0 : n;
|
|
4308
|
+
}
|
|
4309
|
+
break;
|
|
4310
|
+
case FIELD_TYPE.DOUBLE:
|
|
4311
|
+
case FIELD_TYPE.DECIMAL:
|
|
4312
|
+
{
|
|
4313
|
+
const n = parseNumber(val, { integer: false, scale: null });
|
|
4314
|
+
newRow[f.prop] = isBlank(n) ? void 0 : n;
|
|
4315
|
+
}
|
|
4316
|
+
break;
|
|
4317
|
+
case FIELD_TYPE.DATE:
|
|
4318
|
+
{
|
|
4319
|
+
const d = parseToDate(val);
|
|
4320
|
+
newRow[f.prop] = d ? formatDate(d) : isBlank(val) ? void 0 : val;
|
|
4321
|
+
}
|
|
4322
|
+
break;
|
|
4323
|
+
case FIELD_TYPE.TIME:
|
|
4324
|
+
{
|
|
4325
|
+
const d = parseToDate(val);
|
|
4326
|
+
newRow[f.prop] = d ? formatTime(d) : isBlank(val) ? void 0 : val;
|
|
4327
|
+
}
|
|
4328
|
+
break;
|
|
4329
|
+
case FIELD_TYPE.DATE_TIME:
|
|
4330
|
+
{
|
|
4331
|
+
const d = parseToDate(val);
|
|
4332
|
+
newRow[f.prop] = d ? formatDateTime(d) : isBlank(val) ? void 0 : val;
|
|
4333
|
+
}
|
|
4334
|
+
break;
|
|
4335
|
+
case FIELD_TYPE.OPTION_MULTI:
|
|
4336
|
+
{
|
|
4337
|
+
const lookup = buildOptionLookup(f.newOptions);
|
|
4338
|
+
if (typeof val === "string") {
|
|
4339
|
+
const tokens = val.split(/[;,]/).map((s) => s.trim()).filter((s) => s !== "");
|
|
4340
|
+
const arr = tokens.map((t) => lookup.get(t)).filter((v) => v !== void 0);
|
|
4341
|
+
newRow[f.prop] = arr.length ? arr.join(",") : void 0;
|
|
4342
|
+
} else {
|
|
4343
|
+
newRow[f.prop] = isBlank(val) ? void 0 : val;
|
|
4344
|
+
}
|
|
4345
|
+
}
|
|
4346
|
+
break;
|
|
4347
|
+
case FIELD_TYPE.OPTION:
|
|
4348
|
+
{
|
|
4349
|
+
const lookup = buildOptionLookup(f.newOptions);
|
|
4350
|
+
if (isBlank(val)) {
|
|
4351
|
+
newRow[f.prop] = void 0;
|
|
4352
|
+
} else {
|
|
4353
|
+
const tokens = val.split(/[;,]/).map((s) => s.trim()).filter((s) => s !== "");
|
|
4354
|
+
const normalized = lookup.get(tokens?.[0]);
|
|
4355
|
+
newRow[f.prop] = normalized !== void 0 ? normalized : void 0;
|
|
4356
|
+
}
|
|
4357
|
+
}
|
|
4358
|
+
break;
|
|
4359
|
+
default:
|
|
4360
|
+
newRow[f.prop] = isBlank(val) ? void 0 : val;
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
return newRow;
|
|
4364
|
+
}).filter((row) => {
|
|
4365
|
+
return props.columns.some((f) => {
|
|
4366
|
+
const v = row[f.prop];
|
|
4367
|
+
if (v === 0 || v === false) return true;
|
|
4368
|
+
return !isBlank(v);
|
|
4369
|
+
});
|
|
4370
|
+
});
|
|
4371
|
+
return out;
|
|
4372
|
+
}
|
|
4373
|
+
async function onSave() {
|
|
4374
|
+
try {
|
|
4375
|
+
return {
|
|
4376
|
+
ok: true,
|
|
4377
|
+
params: {
|
|
4378
|
+
data: processRows(unref(rows.value))
|
|
4379
|
+
}
|
|
4380
|
+
};
|
|
4381
|
+
} catch (err) {
|
|
4382
|
+
console.warn(err);
|
|
4383
|
+
}
|
|
4384
|
+
return {
|
|
4385
|
+
ok: false
|
|
4386
|
+
};
|
|
4387
|
+
}
|
|
4388
|
+
useModal(onSave);
|
|
4389
|
+
return (_ctx, _cache) => {
|
|
4390
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
4391
|
+
_cache[0] || (_cache[0] = createElementVNode("div", { class: "quick-fill-tips" }, [
|
|
4392
|
+
createElementVNode("i", { class: "iconfont icon-zhuyi" }),
|
|
4393
|
+
createElementVNode("ul", { class: "tips-list" }, [
|
|
4394
|
+
createElementVNode("li", null, "可将Excel内容粘贴到表格中,支持使用复制、粘贴、删除快捷键"),
|
|
4395
|
+
createElementVNode("li", null, "表单中支持快速填报的字段类型:文本、长文本、整数、长整数、小数、精度小数、日期、时间、日期时间、LOT/SN、报废物料批次、枚举单选、枚举多选(选项间以“,”分割)"),
|
|
4396
|
+
createElementVNode("li", null, "当前快速填报最多支持200行")
|
|
4397
|
+
])
|
|
4398
|
+
], -1)),
|
|
4399
|
+
createVNode(unref(q), {
|
|
4400
|
+
class: "cell-border",
|
|
4401
|
+
range: "",
|
|
4402
|
+
resize: "",
|
|
4403
|
+
colSize: 200,
|
|
4404
|
+
source: rows.value,
|
|
4405
|
+
columns: __props.columns,
|
|
4406
|
+
theme: "material",
|
|
4407
|
+
"hide-attribution": "",
|
|
4408
|
+
"apply-on-close": true,
|
|
4409
|
+
"row-headers": { prop: "rowIndex", name: "序号", size: 60 }
|
|
4410
|
+
}, null, 8, ["source", "columns"])
|
|
4411
|
+
]);
|
|
4412
|
+
};
|
|
4413
|
+
}
|
|
4414
|
+
});
|
|
4415
|
+
const DocumentQuickFillModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b95f66b0"]]);
|
|
4416
|
+
const _hoisted_1$1 = {
|
|
4417
|
+
key: 1,
|
|
4418
|
+
class: "sub-table-action__subtitle"
|
|
4419
|
+
};
|
|
4420
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
4421
|
+
__name: "sub-table-action",
|
|
4422
|
+
props: {
|
|
4423
|
+
showDelBtn: { type: Boolean, default: false },
|
|
4424
|
+
showQuickFillBtn: { type: Boolean, default: false },
|
|
4425
|
+
showInsertMultiple: { type: Boolean, default: false },
|
|
4426
|
+
showEditBtn: { type: Boolean, default: false },
|
|
4427
|
+
isMaterialConsume: { type: Boolean, default: false },
|
|
4428
|
+
showBom: { type: Boolean, default: false },
|
|
4429
|
+
showScanBtn: { type: Boolean, default: false },
|
|
4430
|
+
showConfirmBtn: { type: Boolean, default: false },
|
|
4431
|
+
noPopover: { type: Boolean, default: false },
|
|
4432
|
+
menus: {}
|
|
4433
|
+
},
|
|
4434
|
+
emits: ["menuClick"],
|
|
4435
|
+
setup(__props, { emit: __emit }) {
|
|
4436
|
+
const props = __props;
|
|
4437
|
+
const emit = __emit;
|
|
4438
|
+
computed(() => {
|
|
4439
|
+
const menus = [
|
|
4440
|
+
...props.isMaterialConsume ? [
|
|
4441
|
+
{
|
|
4442
|
+
type: "subtitle",
|
|
4443
|
+
label: "业务操作"
|
|
4444
|
+
},
|
|
4445
|
+
{
|
|
4446
|
+
show: props.showScanBtn,
|
|
4447
|
+
type: "action",
|
|
4448
|
+
key: SubTableActionEnum.SCAN,
|
|
4449
|
+
label: "条码扫描",
|
|
4450
|
+
icon: "size24 icon-saoma1"
|
|
4451
|
+
},
|
|
4452
|
+
{
|
|
4453
|
+
show: props.showBom,
|
|
4454
|
+
type: "action",
|
|
4455
|
+
key: SubTableActionEnum.VIEW_BOM,
|
|
4456
|
+
label: "BOM查看",
|
|
4457
|
+
icon: "size24 icon-a-bom11"
|
|
4458
|
+
},
|
|
4459
|
+
{
|
|
4460
|
+
type: "action",
|
|
4461
|
+
key: SubTableActionEnum.CHANGE_PARSE_RULE,
|
|
4462
|
+
label: "条码解析规则变更",
|
|
4463
|
+
icon: "icon-tiaomajiexi"
|
|
4464
|
+
},
|
|
4465
|
+
{
|
|
4466
|
+
type: "divider"
|
|
4467
|
+
},
|
|
4468
|
+
{
|
|
4469
|
+
type: "subtitle",
|
|
4470
|
+
label: "行编辑"
|
|
4471
|
+
}
|
|
4472
|
+
] : [],
|
|
4473
|
+
{
|
|
4474
|
+
show: props.showQuickFillBtn,
|
|
4475
|
+
type: "action",
|
|
4476
|
+
key: SubTableActionEnum.QuickFillRowCurrent,
|
|
4477
|
+
label: "快速填报",
|
|
4478
|
+
icon: "icon-zhongxinbianjidangqianhang"
|
|
4479
|
+
},
|
|
4480
|
+
{
|
|
4481
|
+
show: props.showEditBtn,
|
|
4482
|
+
type: "action",
|
|
4483
|
+
key: SubTableActionEnum.RowEdit,
|
|
4484
|
+
label: "重新编辑当前行",
|
|
4485
|
+
icon: "icon-zhongxinbianjidangqianhang"
|
|
4486
|
+
},
|
|
4487
|
+
{
|
|
4488
|
+
type: "action",
|
|
4489
|
+
key: SubTableActionEnum.InsertRowAfter,
|
|
4490
|
+
label: "加一行",
|
|
4491
|
+
icon: "icon-jiayihang"
|
|
4492
|
+
},
|
|
4493
|
+
{
|
|
4494
|
+
type: "submenu",
|
|
4495
|
+
key: "copy",
|
|
4496
|
+
label: "复制",
|
|
4497
|
+
icon: "icon-fuzhi2",
|
|
4498
|
+
children: [
|
|
4499
|
+
{
|
|
4500
|
+
type: "action",
|
|
4501
|
+
key: SubTableActionEnum.CopyRowAfter,
|
|
4502
|
+
label: "复制到下一行",
|
|
4503
|
+
icon: "icon-fuzhidaoxiayihang"
|
|
4504
|
+
},
|
|
4505
|
+
{
|
|
4506
|
+
type: "action",
|
|
4507
|
+
key: SubTableActionEnum.CopyRow2Last,
|
|
4508
|
+
label: "复制到最后",
|
|
4509
|
+
icon: "icon-fuzhidaozuihou"
|
|
4510
|
+
}
|
|
4511
|
+
]
|
|
4512
|
+
},
|
|
4513
|
+
{
|
|
4514
|
+
show: props.showInsertMultiple,
|
|
4515
|
+
type: "submenu",
|
|
4516
|
+
key: "insert",
|
|
4517
|
+
label: "插入",
|
|
4518
|
+
icon: "icon-charu",
|
|
4519
|
+
children: [
|
|
4520
|
+
{
|
|
4521
|
+
type: "action",
|
|
4522
|
+
key: SubTableActionEnum.InsertRowBefore,
|
|
4523
|
+
label: "在上方插入行",
|
|
4524
|
+
icon: "icon-shangfangcharuhang"
|
|
4525
|
+
},
|
|
4526
|
+
{
|
|
4527
|
+
type: "action",
|
|
4528
|
+
key: SubTableActionEnum.InsertRowAfter,
|
|
4529
|
+
label: "在下方插入行",
|
|
4530
|
+
icon: "icon-xiafangcharuhang"
|
|
4531
|
+
}
|
|
4532
|
+
]
|
|
4533
|
+
},
|
|
4534
|
+
...props.showDelBtn ? [
|
|
4535
|
+
{
|
|
4536
|
+
type: "divider"
|
|
4537
|
+
},
|
|
4538
|
+
{
|
|
4539
|
+
type: "action",
|
|
4540
|
+
key: SubTableActionEnum.DeleteRowCurrent,
|
|
4541
|
+
label: "删除行",
|
|
4542
|
+
icon: "size24 icon-a-shanchubiaoge"
|
|
4543
|
+
}
|
|
4544
|
+
] : []
|
|
4545
|
+
];
|
|
4546
|
+
return menus.filter((i) => i.show !== false);
|
|
4547
|
+
});
|
|
4548
|
+
const stopRefPropagation = (vm) => {
|
|
4549
|
+
if (!vm?.$el) {
|
|
4550
|
+
return;
|
|
4551
|
+
}
|
|
4552
|
+
vm.$el.addEventListener("click", (e) => {
|
|
4553
|
+
e.stopPropagation();
|
|
4554
|
+
});
|
|
4555
|
+
};
|
|
4556
|
+
const defaultValues = {
|
|
4557
|
+
upRowNum: 1,
|
|
4558
|
+
downRowNum: 1
|
|
4559
|
+
};
|
|
4560
|
+
const formState = reactive(Object.assign({}, defaultValues));
|
|
4561
|
+
const inputCommonProps = {
|
|
4562
|
+
ref: stopRefPropagation,
|
|
4563
|
+
class: "sub-table-action__menu-num-input",
|
|
4564
|
+
size: "small",
|
|
4565
|
+
min: 1,
|
|
4566
|
+
precision: 0
|
|
4567
|
+
};
|
|
4568
|
+
const reset = () => {
|
|
4569
|
+
Object.assign(formState, defaultValues);
|
|
4570
|
+
};
|
|
4571
|
+
const handleClick = ({ key }) => {
|
|
4572
|
+
console.log("click ", key);
|
|
4573
|
+
const actionValue = cloneDeep(toRaw(formState));
|
|
4574
|
+
emit("menuClick", { key, actionValue });
|
|
4575
|
+
reset();
|
|
4576
|
+
};
|
|
4577
|
+
return (_ctx, _cache) => {
|
|
4578
|
+
const _component_a_menu_divider = resolveComponent("a-menu-divider");
|
|
4579
|
+
const _component_a_input_number = resolveComponent("a-input-number");
|
|
4580
|
+
const _component_a_menu_item = resolveComponent("a-menu-item");
|
|
4581
|
+
const _component_a_sub_menu = resolveComponent("a-sub-menu");
|
|
4582
|
+
const _component_a_menu = resolveComponent("a-menu");
|
|
4583
|
+
const _component_a_popover = resolveComponent("a-popover");
|
|
4584
|
+
return !__props.noPopover ? (openBlock(), createBlock(_component_a_popover, {
|
|
4585
|
+
key: 0,
|
|
4586
|
+
class: "sub-table-action",
|
|
4587
|
+
placement: "bottomRight",
|
|
4588
|
+
overlayClassName: "sub-table-action__popover"
|
|
4589
|
+
}, {
|
|
4590
|
+
content: withCtx(() => [
|
|
4591
|
+
createVNode(_component_a_menu, {
|
|
4592
|
+
class: "sub-table-action__menu",
|
|
4593
|
+
mode: "vertical",
|
|
4594
|
+
onClick: handleClick,
|
|
4595
|
+
selectedKeys: []
|
|
4596
|
+
}, {
|
|
4597
|
+
default: withCtx(() => [
|
|
4598
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.menus, (menu) => {
|
|
4599
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
4600
|
+
key: menu.key
|
|
4601
|
+
}, [
|
|
4602
|
+
menu.type === "divider" ? (openBlock(), createBlock(_component_a_menu_divider, { key: 0 })) : menu.type === "subtitle" ? (openBlock(), createElementBlock("div", _hoisted_1$1, toDisplayString(menu.label), 1)) : menu.type === "submenu" ? (openBlock(), createBlock(_component_a_sub_menu, {
|
|
4603
|
+
popupClassName: "sub-table-action__submenu-popup",
|
|
4604
|
+
key: menu.key
|
|
4605
|
+
}, {
|
|
4606
|
+
icon: withCtx(() => [
|
|
4607
|
+
createElementVNode("i", {
|
|
4608
|
+
class: normalizeClass(["sub-table-action__icon", "iconfont", menu.icon])
|
|
4609
|
+
}, null, 2)
|
|
4610
|
+
]),
|
|
4611
|
+
title: withCtx(() => [
|
|
4612
|
+
createTextVNode(toDisplayString(menu.label), 1)
|
|
4613
|
+
]),
|
|
4614
|
+
default: withCtx(() => [
|
|
4615
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(menu.children, (child) => {
|
|
4616
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
4617
|
+
key: child.key
|
|
4618
|
+
}, [
|
|
4619
|
+
child.type === "action" ? (openBlock(), createBlock(_component_a_menu_item, {
|
|
4620
|
+
class: "sub-table-action__menu-item",
|
|
4621
|
+
key: child.key
|
|
4622
|
+
}, {
|
|
4623
|
+
icon: withCtx(() => [
|
|
4624
|
+
createElementVNode("i", {
|
|
4625
|
+
class: normalizeClass(["sub-table-action__icon", "iconfont", child.icon])
|
|
4626
|
+
}, null, 2)
|
|
4627
|
+
]),
|
|
4628
|
+
default: withCtx(() => [
|
|
4629
|
+
createTextVNode(toDisplayString(child.label) + " ", 1),
|
|
4630
|
+
child.key === unref(SubTableActionEnum).InsertRowBefore ? (openBlock(), createBlock(_component_a_input_number, mergeProps({
|
|
4631
|
+
key: 0,
|
|
4632
|
+
ref_for: true
|
|
4633
|
+
}, inputCommonProps, {
|
|
4634
|
+
value: formState.upRowNum,
|
|
4635
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => formState.upRowNum = $event)
|
|
4636
|
+
}), null, 16, ["value"])) : child.key === unref(SubTableActionEnum).InsertRowAfter ? (openBlock(), createBlock(_component_a_input_number, mergeProps({
|
|
4637
|
+
key: 1,
|
|
4638
|
+
ref_for: true
|
|
4639
|
+
}, inputCommonProps, {
|
|
4640
|
+
value: formState.downRowNum,
|
|
4641
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => formState.downRowNum = $event)
|
|
4642
|
+
}), null, 16, ["value"])) : createCommentVNode("", true)
|
|
4643
|
+
]),
|
|
4644
|
+
_: 2
|
|
4645
|
+
}, 1024)) : createCommentVNode("", true)
|
|
4646
|
+
], 64);
|
|
4647
|
+
}), 128))
|
|
4648
|
+
]),
|
|
4649
|
+
_: 2
|
|
4650
|
+
}, 1024)) : (openBlock(), createBlock(_component_a_menu_item, {
|
|
4651
|
+
class: "sub-table-action__menu-item",
|
|
4652
|
+
key: menu.key
|
|
4653
|
+
}, {
|
|
4654
|
+
icon: withCtx(() => [
|
|
4655
|
+
createElementVNode("i", {
|
|
4656
|
+
class: normalizeClass(["sub-table-action__icon", "iconfont", menu.icon])
|
|
4657
|
+
}, null, 2)
|
|
4658
|
+
]),
|
|
4659
|
+
default: withCtx(() => [
|
|
4660
|
+
createTextVNode(toDisplayString(menu.label), 1)
|
|
4661
|
+
]),
|
|
4662
|
+
_: 2
|
|
4663
|
+
}, 1024))
|
|
4664
|
+
], 64);
|
|
4665
|
+
}), 128))
|
|
4666
|
+
]),
|
|
4667
|
+
_: 1
|
|
4668
|
+
})
|
|
4669
|
+
]),
|
|
4670
|
+
default: withCtx(() => [
|
|
4671
|
+
_cache[3] || (_cache[3] = createElementVNode("div", { class: "more-btn" }, [
|
|
4672
|
+
createElementVNode("i", { class: "iconfont icon-gengduo2" })
|
|
4673
|
+
], -1))
|
|
4674
|
+
]),
|
|
4675
|
+
_: 1
|
|
4676
|
+
})) : (openBlock(), createElementBlock("div", {
|
|
4677
|
+
key: 1,
|
|
4678
|
+
class: "more-btn",
|
|
4679
|
+
onClick: _cache[2] || (_cache[2] = ($event) => emit("menuClick", { key: "default" }))
|
|
4680
|
+
}, [..._cache[4] || (_cache[4] = [
|
|
4681
|
+
createElementVNode("i", { class: "iconfont icon-gengduo2" }, null, -1)
|
|
4682
|
+
])]));
|
|
4683
|
+
};
|
|
4684
|
+
}
|
|
4685
|
+
});
|
|
4686
|
+
const SubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-db4201e3"]]);
|
|
4687
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4688
|
+
__name: "document-sub-table-action",
|
|
4689
|
+
props: {
|
|
4690
|
+
subTableFieldId: {},
|
|
4691
|
+
mobileTdIdGroups: {},
|
|
4692
|
+
widgetCenter: {},
|
|
4693
|
+
handleMenuClick: {},
|
|
4694
|
+
showDelBtn: { type: Boolean },
|
|
4695
|
+
showQuickFillBtn: { type: Boolean },
|
|
4696
|
+
showInsertMultiple: { type: Boolean, default: true },
|
|
4697
|
+
showEditBtn: { type: Boolean },
|
|
4698
|
+
isMaterialConsume: { type: Boolean },
|
|
4699
|
+
showBom: { type: Boolean },
|
|
4700
|
+
showScanBtn: { type: Boolean },
|
|
4701
|
+
showConfirmBtn: { type: Boolean },
|
|
4702
|
+
noPopover: { type: Boolean },
|
|
4703
|
+
menus: {}
|
|
4704
|
+
},
|
|
4705
|
+
setup(__props) {
|
|
4706
|
+
const props = __props;
|
|
4707
|
+
const fieldColumn = computed(() => {
|
|
4708
|
+
const info = getSubTableQuickFillInfo(props.subTableFieldId, props.mobileTdIdGroups);
|
|
4709
|
+
if (!info?.mainWidgetIds?.length) return [];
|
|
4710
|
+
const allowed = /* @__PURE__ */ new Set([
|
|
4711
|
+
FIELD_TYPE.TEXT,
|
|
4712
|
+
FIELD_TYPE.LONG_TEXT,
|
|
4713
|
+
FIELD_TYPE.INTEGER,
|
|
4714
|
+
FIELD_TYPE.LONG,
|
|
4715
|
+
FIELD_TYPE.DOUBLE,
|
|
4716
|
+
FIELD_TYPE.DECIMAL,
|
|
4717
|
+
FIELD_TYPE.DATE,
|
|
4718
|
+
FIELD_TYPE.TIME,
|
|
4719
|
+
FIELD_TYPE.DATE_TIME,
|
|
4720
|
+
FIELD_TYPE.OPTION,
|
|
4721
|
+
FIELD_TYPE.OPTION_MULTI,
|
|
4722
|
+
FIELD_TYPE.MATERIAL_NO,
|
|
4723
|
+
FIELD_TYPE.STERILIZE_LOT,
|
|
4724
|
+
FIELD_TYPE.MATERIAL_LOT,
|
|
4725
|
+
FIELD_TYPE.RELATED_LOT_NO,
|
|
4726
|
+
FIELD_TYPE.SCRAP_MATERIAL_NO
|
|
4727
|
+
]);
|
|
4728
|
+
return info.mainWidgetIds.flatMap((tdId) => {
|
|
4729
|
+
const widget = props.widgetCenter?.[tdId];
|
|
4730
|
+
if (!widget) return [];
|
|
4731
|
+
const { cellWidget, cellValueType } = widget;
|
|
4732
|
+
if (cellValueType !== CellType.Field) return [];
|
|
4733
|
+
if (!cellWidget || cellWidget.component === ComponentTypeEnum.CombineFields) return [];
|
|
4734
|
+
const wProps = cellWidget.props || {};
|
|
4735
|
+
const { isFieldModel, field, fieldType, newSpecificConfig } = wProps;
|
|
4736
|
+
if (isFieldModel) return [];
|
|
4737
|
+
if (!allowed.has(fieldType)) return [];
|
|
4738
|
+
return {
|
|
4739
|
+
fieldType,
|
|
4740
|
+
field,
|
|
4741
|
+
name: newSpecificConfig?.newFieldName,
|
|
4742
|
+
prop: field,
|
|
4743
|
+
newOptions: newSpecificConfig?.newOptions
|
|
4744
|
+
};
|
|
4745
|
+
});
|
|
4746
|
+
});
|
|
4747
|
+
const onMenuClick = async ({ key, actionValue }) => {
|
|
4748
|
+
if (key === "quickFillRowCurrent") {
|
|
4749
|
+
const res = await window.NocodeAdapter.utils.overlay.modal(
|
|
4750
|
+
DocumentQuickFillModal,
|
|
4751
|
+
{ columns: fieldColumn.value },
|
|
4752
|
+
{ title: "快速填报", width: "1060px" }
|
|
4753
|
+
);
|
|
4754
|
+
console.log("res", res);
|
|
4755
|
+
if (res.ok && res.params && res.params.data.length) {
|
|
4756
|
+
props.handleMenuClick?.({
|
|
4757
|
+
key: "insertRowCurrent",
|
|
4758
|
+
actionValue: {
|
|
4759
|
+
upRowNum: 1,
|
|
4760
|
+
downRowNum: res.params.data.length,
|
|
4761
|
+
data: res.params.data
|
|
4762
|
+
}
|
|
4763
|
+
});
|
|
4764
|
+
}
|
|
4765
|
+
} else {
|
|
4766
|
+
props.handleMenuClick?.({ key, actionValue });
|
|
4767
|
+
}
|
|
4768
|
+
};
|
|
4769
|
+
return (_ctx, _cache) => {
|
|
4770
|
+
return openBlock(), createBlock(SubTableAction, {
|
|
4771
|
+
showDelBtn: __props.showDelBtn,
|
|
4772
|
+
showQuickFillBtn: __props.showQuickFillBtn,
|
|
4773
|
+
noPopover: __props.noPopover,
|
|
4774
|
+
showBom: __props.showBom,
|
|
4775
|
+
showConfirmBtn: __props.showConfirmBtn,
|
|
4776
|
+
showEditBtn: __props.showEditBtn,
|
|
4777
|
+
showInsertMultiple: __props.showInsertMultiple,
|
|
4778
|
+
showScanBtn: __props.showScanBtn,
|
|
4779
|
+
isMaterialConsume: __props.isMaterialConsume,
|
|
4780
|
+
menus: __props.menus,
|
|
4781
|
+
onMenuClick
|
|
4782
|
+
}, null, 8, ["showDelBtn", "showQuickFillBtn", "noPopover", "showBom", "showConfirmBtn", "showEditBtn", "showInsertMultiple", "showScanBtn", "isMaterialConsume", "menus"]);
|
|
4783
|
+
};
|
|
4784
|
+
}
|
|
4785
|
+
});
|
|
4786
|
+
const DocumentSubTableAction = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1a0e170d"]]);
|
|
4787
|
+
const _hoisted_1 = { class: "scrollbar" };
|
|
4788
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4789
|
+
const _component_bar = resolveComponent("bar");
|
|
4790
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
4791
|
+
createElementVNode("div", {
|
|
4792
|
+
ref: "wrap",
|
|
4793
|
+
class: normalizeClass([_ctx.wrapClass, "scrollbar__wrap", _ctx.native ? "" : "scrollbar__wrap--hidden-default"]),
|
|
4794
|
+
style: normalizeStyle(_ctx.style),
|
|
4795
|
+
onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.handleScroll && _ctx.handleScroll(...args))
|
|
4796
|
+
}, [
|
|
4797
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
4798
|
+
ref: "resize",
|
|
4799
|
+
class: normalizeClass(["scrollbar__view", _ctx.viewClass]),
|
|
4800
|
+
style: normalizeStyle(_ctx.viewStyle)
|
|
4801
|
+
}, {
|
|
4802
|
+
default: withCtx(() => [
|
|
4803
|
+
renderSlot(_ctx.$slots, "default")
|
|
4804
|
+
]),
|
|
4805
|
+
_: 3
|
|
4806
|
+
}, 8, ["class", "style"]))
|
|
4807
|
+
], 38),
|
|
4808
|
+
!_ctx.native ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4809
|
+
createVNode(_component_bar, {
|
|
4810
|
+
move: _ctx.moveX,
|
|
4811
|
+
size: _ctx.sizeWidth
|
|
4812
|
+
}, null, 8, ["move", "size"]),
|
|
4813
|
+
createVNode(_component_bar, {
|
|
4814
|
+
vertical: "",
|
|
4815
|
+
move: _ctx.moveY,
|
|
4816
|
+
size: _ctx.sizeHeight
|
|
4817
|
+
}, null, 8, ["move", "size"])
|
|
4818
|
+
], 64)) : createCommentVNode("", true)
|
|
4819
|
+
]);
|
|
4820
|
+
}
|
|
4821
|
+
const Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render]]);
|
|
4822
|
+
export {
|
|
4823
|
+
BorderTD as B,
|
|
4824
|
+
DeviceLinkTmplUtil as D,
|
|
4825
|
+
FormTmplConfigController as F,
|
|
4826
|
+
MaterialConsumptionPatternEnum as M,
|
|
4827
|
+
Scrollbar as S,
|
|
4828
|
+
_sfc_main$4 as _,
|
|
4829
|
+
useFormTmplConfig as a,
|
|
4830
|
+
useFormulaExpWatcher as b,
|
|
4831
|
+
useStyles as c,
|
|
4832
|
+
useDependency as d,
|
|
4833
|
+
DocumentPaper as e,
|
|
4834
|
+
DocumentSubTableAction as f,
|
|
4835
|
+
MaterialConsumeTableController as g,
|
|
4836
|
+
SubTableCore as h,
|
|
4837
|
+
SubTableActionMenuTypeEnum as i,
|
|
4838
|
+
getMenuByAction as j,
|
|
4839
|
+
SubTableActionEnum as k,
|
|
4840
|
+
getCopySubMenu as l,
|
|
4841
|
+
getInsertSubMenu as m,
|
|
4842
|
+
useMaterialBalance as n,
|
|
4843
|
+
commonUtils as o,
|
|
4844
|
+
DocumentLoading as p,
|
|
4845
|
+
_imports_0 as q,
|
|
4846
|
+
DocumentQuickFillModal as r,
|
|
4847
|
+
DeviceConnector as s,
|
|
4848
|
+
MCDataUtil as t,
|
|
4849
|
+
useOnlineFormTransformField2Component as u,
|
|
4850
|
+
useOnlineFormActionButton as v
|
|
4851
|
+
};
|