cloud-web-corejs 1.0.276 → 1.0.277
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/package.json +28 -24
- package/src/App.vue +73 -71
- package/src/api/user.js +21 -0
- package/src/components/baseArea/index.vue +82 -27
- package/src/components/baseTabs/mixins.js +5 -1
- package/src/components/luckysheet/dialog.vue +1 -1
- package/src/components/micro-view-host/contract.js +66 -0
- package/src/components/micro-view-host/index.vue +148 -0
- package/src/components/table/tableForm.vue +16 -5
- package/src/components/table/tableFormMixin.js +35 -7
- package/src/components/vb-tabs/x-tabs.vue +167 -143
- package/src/components/wf/content.vue +14 -0
- package/src/components/wf/content2.vue +4 -2
- package/src/components/wf/wf.js +74 -23
- package/src/components/wf/wfActionDropdown.vue +85 -0
- package/src/components/wf/wfActionItems.js +136 -0
- package/src/components/wf/wfAutoConfirm.js +55 -0
- package/src/components/wf/wfButtonName.js +60 -0
- package/src/components/wf/wfUserRange.js +53 -0
- package/src/components/wf/wfUtil.js +373 -295
- package/src/components/xform/XFormTabContainer//346/226/260/345/242/236/351/241/265/347/255/276/346/250/241/345/274/217-/346/234/200/347/273/210/345/256/236/347/216/260.md +195 -0
- package/src/components/xform/docs/2026-07 table/344/270/216excelExport/344/277/256/345/244/215/345/217/212/345/257/274/345/207/272/344/274/230/345/214/226.md" +57 -0
- package/src/components/xform/docs/2026-07 /346/216/222/346/237/245/344/277/256/345/244/215/350/256/260/345/275/225.md" +73 -0
- package/src/components/xform/docs/autocomplete /350/207/252/345/212/250/345/256/214/346/210/220/347/273/204/344/273/266/350/257/264/346/230/216.md" +126 -0
- package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +986 -0
- package/src/components/xform/docs//346/225/260/346/215/256/350/241/250/346/240/274/345/212/250/346/200/201/345/210/227 JSON /350/257/264/346/230/216.md" +657 -0
- package/src/components/xform/docs//346/240/221/350/241/250rowField/346/224/266/346/225/233-/350/220/275/345/234/260/346/226/207/346/241/243.md +1427 -0
- package/src/components/xform/form-designer/designer.js +2085 -2025
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +9 -11
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +76 -75
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +10 -4
- package/src/components/xform/form-designer/form-widget/container-widget/detail-plain-widget.vue +76 -0
- package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +59 -5
- package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +38 -17
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +138 -13
- package/src/components/xform/form-designer/form-widget/dialog/formFieldDialog.vue +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1774 -1772
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +2 -3
- package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +66 -53
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +287 -214
- package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +76 -66
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +208 -124
- package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +11 -2
- package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +7 -6
- package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +43 -19
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +680 -372
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +879 -763
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +17 -2
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/relative-default-mixin.js +107 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/relativeDateUtil.js +321 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +77 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +13 -0
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +13 -8
- package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +4 -9
- package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +3 -0
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +120 -120
- package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +4 -0
- package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +11 -0
- package/src/components/xform/form-designer/form-widget/field-widget/switch-widget.vue +9 -1
- package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +7 -3
- package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +4 -2
- package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +36 -5
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +338 -374
- package/src/components/xform/form-designer/form-widget/index.vue +6 -1
- package/src/components/xform/form-designer/form-widget/indexMixin.js +29 -25
- package/src/components/xform/form-designer/index.vue +194 -191
- package/src/components/xform/form-designer/indexMixin.js +860 -847
- package/src/components/xform/form-designer/setting-panel/dataSource-setting.vue +397 -397
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +602 -601
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +1790 -1483
- package/src/components/xform/form-designer/setting-panel/index.vue +2 -7
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +370 -335
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +585 -544
- package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/alignType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/buttonIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -125
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1151 -957
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +96 -74
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-plain/detail-plain-editor.vue +75 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +14 -13
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/container-h5-card/h5-card-editor.vue +124 -124
- package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +26 -31
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -119
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tabClass-editor.vue +45 -45
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +340 -342
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree-pane/tree-pane-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/cancelButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/okButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/title-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/containerClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/customClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/descriptionsItems-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +6 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/dsName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/echartHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -50
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +7 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +84 -85
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindActions.js +262 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +97 -88
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +188 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/icon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +27 -10
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/checkStrictly-editor.vue +11 -13
- package/src/components/xform/form-designer/setting-panel/property-editor/field-common/keyName-editor.vue +74 -67
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +27 -5
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +35 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +35 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -59
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +11 -11
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +10 -10
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +12 -12
- package/src/components/xform/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +29 -29
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script/script-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/fontSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +74 -74
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +34 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-timeLimit-editor.vue +53 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +35 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchField-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -176
- package/src/components/xform/form-designer/setting-panel/property-editor/fixedQuery-editor.vue +39 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +41 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +972 -972
- package/src/components/xform/form-designer/setting-panel/property-editor/iconClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/label-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelAlign-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/maxLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/min-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/minLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +15 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/prefixIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/relative-default-block.vue +369 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/rows-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/space-editor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/step-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTableClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTitClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/suffixIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +2 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadTip-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadURL-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/urlValueEnabled-editor.vue +91 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/widgetWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +374 -351
- package/src/components/xform/form-designer/toolbar-panel/index.vue +266 -103
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +655 -589
- package/src/components/xform/form-designer/widget-panel/index.vue +391 -341
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +351 -308
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4642 -4028
- package/src/components/xform/form-render/container-item/containerItemMixin.js +76 -61
- package/src/components/xform/form-render/container-item/data-table-item.vue +24 -13
- package/src/components/xform/form-render/container-item/data-table-mixin.js +5927 -3400
- package/src/components/xform/form-render/container-item/detail-h5-item.vue +173 -173
- package/src/components/xform/form-render/container-item/detail-item.vue +446 -224
- package/src/components/xform/form-render/container-item/detail-plain-item.vue +92 -0
- package/src/components/xform/form-render/container-item/list-h5-item.vue +1186 -411
- package/src/components/xform/form-render/container-item/tab-item.vue +129 -125
- package/src/components/xform/form-render/container-item/table-item.vue +0 -3
- package/src/components/xform/form-render/container-item/table2-item.vue +18 -10
- package/src/components/xform/form-render/dynamicDialogRender.js +140 -99
- package/src/components/xform/form-render/index.vue +8 -8
- package/src/components/xform/form-render/indexMixin.js +5299 -3766
- package/src/components/xform/form-render/refMixin.js +14 -11
- package/src/components/xform/lang/en-US.js +473 -438
- package/src/components/xform/lang/en-US_extension.js +4 -0
- package/src/components/xform/lang/zh-CN.js +646 -620
- package/src/components/xform/mixins/defaultHandle.js +363 -26
- package/src/components/xform/mixins/scriptHttp.js +54 -51
- package/src/components/xform/utils/attachmentValueUtil.js +239 -0
- package/src/components/xform/utils/fixedQueryUtil.js +93 -0
- package/src/components/xform/utils/format.js +195 -169
- package/src/components/xform/utils/queryParamUtil.js +84 -0
- package/src/components/xform/utils/tableColumnHelper.js +7 -8
- package/src/components/xform/utils/util.js +1663 -1551
- package/src/components/xform/utils/validators.js +100 -48
- package/src/index.js +403 -89
- package/src/layout/components/AppMain.vue +147 -119
- package/src/layout/components/Sidebar/default.vue +109 -59
- package/src/layout/components/TagsView/index.vue +1 -1
- package/src/layout/components/extractedCode/queryDialog.vue +33 -26
- package/src/layout/components/extractedCode/viewDialog.vue +207 -193
- package/src/layout/components/langTool.vue +128 -123
- package/src/layout/defaultLayout.vue +170 -158
- package/src/mixins/wf/index.js +40 -38
- package/src/public-path.js +38 -0
- package/src/router/modules/system.js +4 -0
- package/src/store/config/index.js +945 -669
- package/src/utils/pdfUtil.js +428 -70
- package/src/views/bd/setting/bd_company_env/dialog.vue +1 -1
- package/src/views/bd/setting/formVersion/button.vue +5 -0
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +21 -10
- package/src/views/bd/setting/formVersion/link.vue +5 -0
- package/src/views/bd/setting/form_script/edit.vue +1 -0
- package/src/views/bd/setting/form_script/edit1.vue +1 -0
- package/src/views/bd/setting/form_script/form_list.vue +1 -0
- package/src/views/bd/setting/form_script/list.vue +1 -0
- package/src/views/bd/setting/form_script/list1.vue +2 -0
- package/src/views/bd/setting/form_template/edit.vue +1 -0
- package/src/views/bd/setting/form_template/list.vue +2 -0
- package/src/views/bd/setting/form_template/mixins/edit.js +77 -74
- package/src/views/bd/setting/table_model/edit.vue +16 -29
- package/src/views/bd/setting/table_model/list.vue +1 -0
- package/src/views/bd/setting/table_model/mixins/edit.js +295 -149
- package/src/views/bd/setting/table_model/mixins/zdDialog.js +32 -0
- package/src/views/support/export_template/list.vue +1 -1
- package/src/views/user/company_info/edit.vue +149 -88
- package/src/views/user/form/form_template/dialog.vue +1 -1
- package/src/views/user/form/form_template/itemList.vue +1 -1
- package/src/views/user/form/form_template/list.vue +1 -1
- package/src/views/user/form/form_template_field/dialog.vue +1 -1
- package/src/views/user/form/form_type/dialog.vue +1 -1
- package/src/views/user/form/form_type/list.vue +1 -1
- package/src/views/user/form/report_requestaccess/dialog.vue +1 -1
- package/src/views/user/form/report_requestaccess/list.vue +1 -1
- package/src/views/user/form/vform/designer.vue +51 -22
- package/src/views/user/form/vform/render.vue +21 -23
- package/src/views/user/form/view/list.vue +134 -37
- package/src/views/user/wf/wfReport/index.vue +24 -1
- package/src/views/user/wf/wf_manage/list.vue +8 -4
- package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +0 -209
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +0 -1639
- package/src/views/bd/setting/table_model/mixins/edit copy.js +0 -903
- package/src/views/user/menu/voc_list.vue +0 -686
|
@@ -7,16 +7,27 @@ import {
|
|
|
7
7
|
getReportGlobalMap,
|
|
8
8
|
getAccessUrl,
|
|
9
9
|
generateId,
|
|
10
|
-
trim
|
|
10
|
+
trim,
|
|
11
|
+
isArrayValueWidgetType,
|
|
12
|
+
isAttachmentWidgetType,
|
|
13
|
+
isEmptyArrayFieldValue,
|
|
11
14
|
} from "../../../../../components/xform/utils/util";
|
|
12
|
-
import FormValidators, {
|
|
15
|
+
import FormValidators, {
|
|
16
|
+
getRegExp,
|
|
17
|
+
} from "../../../../../components/xform/utils/validators";
|
|
18
|
+
import {
|
|
19
|
+
CLICK_BIND,
|
|
20
|
+
getClickBindAction,
|
|
21
|
+
} from "../../setting-panel/property-editor/field-button/clickBindActions";
|
|
13
22
|
import scriptHttpMixin from "../../../../../components/xform/mixins/scriptHttp";
|
|
14
23
|
import defaultHandleMixin from "../../../../../components/xform/mixins/defaultHandle";
|
|
15
24
|
|
|
16
25
|
import {
|
|
17
|
-
fieldIsUsedInFormula,
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
fieldIsUsedInFormula,
|
|
27
|
+
calculateFormula,
|
|
28
|
+
recalculateFormulaOnSubFormRowDelete,
|
|
29
|
+
} from "@base/components/xform/utils/formula-util";
|
|
30
|
+
import * as formulajs from "@formulajs/formulajs";
|
|
20
31
|
import settingConfig from "@/settings.js";
|
|
21
32
|
|
|
22
33
|
let modules = {};
|
|
@@ -45,7 +56,7 @@ modules = {
|
|
|
45
56
|
formItemProp: {
|
|
46
57
|
type: String,
|
|
47
58
|
default: null,
|
|
48
|
-
}
|
|
59
|
+
},
|
|
49
60
|
},
|
|
50
61
|
provide() {
|
|
51
62
|
return {
|
|
@@ -67,6 +78,8 @@ modules = {
|
|
|
67
78
|
"getReportTemplate",
|
|
68
79
|
"getObjectFieldFlag",
|
|
69
80
|
"getObjectName",
|
|
81
|
+
"setCETriggerFlag",
|
|
82
|
+
"clearCETriggerFlag",
|
|
70
83
|
],
|
|
71
84
|
data: function () {
|
|
72
85
|
return {
|
|
@@ -77,7 +90,7 @@ modules = {
|
|
|
77
90
|
|
|
78
91
|
disabled: false,
|
|
79
92
|
hidden: false,
|
|
80
|
-
readonly: false
|
|
93
|
+
readonly: false,
|
|
81
94
|
};
|
|
82
95
|
},
|
|
83
96
|
beforeDestroy() {
|
|
@@ -105,8 +118,7 @@ modules = {
|
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
120
|
},
|
|
108
|
-
mounted() {
|
|
109
|
-
},
|
|
121
|
+
mounted() {},
|
|
110
122
|
/*watch: {
|
|
111
123
|
currentValue(val) {
|
|
112
124
|
this.initFieldModel(true);
|
|
@@ -162,44 +174,141 @@ modules = {
|
|
|
162
174
|
let currentValue = currentData[this.fieldKeyName];
|
|
163
175
|
return currentValue;
|
|
164
176
|
},
|
|
165
|
-
setFormScriptEnabled(value){
|
|
166
|
-
this.field.options.formScriptEnabled = value || false
|
|
177
|
+
setFormScriptEnabled(value) {
|
|
178
|
+
this.field.options.formScriptEnabled = value || false;
|
|
167
179
|
},
|
|
168
|
-
getOptionLabel(){
|
|
180
|
+
getOptionLabel() {
|
|
169
181
|
if (this.fieldModel === null) {
|
|
170
|
-
return null
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
const selectedItems = this.getSelectedOptionItems();
|
|
185
|
+
const items =
|
|
186
|
+
selectedItems == null
|
|
187
|
+
? []
|
|
188
|
+
: Array.isArray(selectedItems)
|
|
189
|
+
? selectedItems
|
|
190
|
+
: [selectedItems];
|
|
191
|
+
const labelField = this.getOptionItemLabelKey();
|
|
192
|
+
return items.map((item) => this.$t1(item[labelField])).join(",");
|
|
193
|
+
},
|
|
194
|
+
getSelectedOptionItems() {
|
|
195
|
+
const fieldType = this.field.type;
|
|
196
|
+
const isOptionField =
|
|
197
|
+
fieldType === "select" ||
|
|
198
|
+
fieldType === "radio" ||
|
|
199
|
+
fieldType === "checkbox";
|
|
200
|
+
if (!isOptionField) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
const isMultiple =
|
|
204
|
+
fieldType === "checkbox" ||
|
|
205
|
+
(fieldType === "select" && this.field.options.multiple);
|
|
206
|
+
if (
|
|
207
|
+
this.fieldModel === null ||
|
|
208
|
+
this.fieldModel === undefined ||
|
|
209
|
+
this.fieldModel === ""
|
|
210
|
+
) {
|
|
211
|
+
return isMultiple ? [] : null;
|
|
212
|
+
}
|
|
213
|
+
let resultList = [];
|
|
214
|
+
let valueField = this.getOptionItemValueKey();
|
|
215
|
+
this.field.options.optionItems.forEach((oItem) => {
|
|
216
|
+
if (
|
|
217
|
+
oItem[valueField] === this.fieldModel ||
|
|
218
|
+
this.findInArray(this.fieldModel, oItem[valueField]) !== -1
|
|
219
|
+
) {
|
|
220
|
+
resultList.push(oItem);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
return isMultiple
|
|
224
|
+
? resultList
|
|
225
|
+
: resultList.length > 0
|
|
226
|
+
? resultList[0]
|
|
227
|
+
: null;
|
|
228
|
+
},
|
|
229
|
+
// ===================== 表单对比:差异判定与展示 =====================
|
|
230
|
+
/**
|
|
231
|
+
* 差异判定:用「原始存储值」比较(下拉/关联按 code/id 比),可被具体 widget override。
|
|
232
|
+
*/
|
|
233
|
+
compareEquals: function (a, b) {
|
|
234
|
+
const isEmpty = (v) =>
|
|
235
|
+
v === null ||
|
|
236
|
+
v === undefined ||
|
|
237
|
+
v === "" ||
|
|
238
|
+
(Array.isArray(v) && v.length === 0);
|
|
239
|
+
if (isEmpty(a) && isEmpty(b)) return true;
|
|
240
|
+
if (isEmpty(a) || isEmpty(b)) return false;
|
|
241
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
242
|
+
if (a.length !== b.length) return false;
|
|
243
|
+
const sa = a.map((x) => String(x)).sort();
|
|
244
|
+
const sb = b.map((x) => String(x)).sort();
|
|
245
|
+
return sa.every((x, i) => x === sb[i]);
|
|
246
|
+
}
|
|
247
|
+
if (typeof a === "object" || typeof b === "object") {
|
|
248
|
+
try {
|
|
249
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
250
|
+
} catch (e) {
|
|
251
|
+
return a === b;
|
|
252
|
+
}
|
|
182
253
|
}
|
|
254
|
+
return String(a) === String(b);
|
|
255
|
+
},
|
|
256
|
+
/**
|
|
257
|
+
* 把「任意原始值」解析成展示文本(label),用于对比 popover 展示旧值。
|
|
258
|
+
* 下拉/单选/多选按 optionItems 解析 code→label;其它类型返回原值。
|
|
259
|
+
*/
|
|
260
|
+
resolveDisplayValue: function (rawValue) {
|
|
261
|
+
if (rawValue === null || rawValue === undefined || rawValue === "") {
|
|
262
|
+
return rawValue;
|
|
263
|
+
}
|
|
264
|
+
// 凡是有 optionItems 的映射组件(select/radio/checkbox/status/dropdown 等)
|
|
265
|
+
// 统一按 optionItems 做 code→label;关联/switch/cascader 等在各自 widget override。
|
|
266
|
+
let optionItems = this.field.options.optionItems;
|
|
267
|
+
if (Array.isArray(optionItems) && optionItems.length) {
|
|
268
|
+
const labelField = this.getOptionItemLabelKey();
|
|
269
|
+
const valueField = this.getOptionItemValueKey();
|
|
270
|
+
const values = Array.isArray(rawValue) ? rawValue : [rawValue];
|
|
271
|
+
const labels = values.map((val) => {
|
|
272
|
+
const item = optionItems.find((o) => o[valueField] === val);
|
|
273
|
+
return item ? this.$t1(item[labelField]) : val;
|
|
274
|
+
});
|
|
275
|
+
return labels.join(",");
|
|
276
|
+
}
|
|
277
|
+
return rawValue;
|
|
278
|
+
},
|
|
279
|
+
/**
|
|
280
|
+
* 对比「变更前」展示值:给出原单的行/主表对象,返回该字段应展示的旧 label。
|
|
281
|
+
* 默认按本字段存储键取原始值再 resolveDisplayValue;关联搜索类组件(值存 id、
|
|
282
|
+
* label 存在同行的伴随字段)在各自 mixin override,从 oldRow 里取伴随 label 字段。
|
|
283
|
+
* @param {Object} oldRow 原单主表对象或子表行对象
|
|
284
|
+
*/
|
|
285
|
+
resolveCompareOldDisplay: function (oldRow) {
|
|
286
|
+
let raw = oldRow ? oldRow[this.fieldKeyName] : undefined;
|
|
287
|
+
return this.resolveDisplayValue(raw);
|
|
183
288
|
},
|
|
184
289
|
initValueWatchEvent() {
|
|
185
290
|
if (!this.designer) {
|
|
186
|
-
this.$watch(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
291
|
+
this.$watch(
|
|
292
|
+
() => {
|
|
293
|
+
let currentData =
|
|
294
|
+
this.tableParam && this.tableParam.row
|
|
295
|
+
? this.tableParam.row
|
|
296
|
+
: this.formModel;
|
|
297
|
+
let currentValue = currentData[this.fieldKeyName];
|
|
298
|
+
return currentValue;
|
|
299
|
+
},
|
|
300
|
+
(newValue, oldValue) => {
|
|
301
|
+
if (oldValue !== undefined) {
|
|
302
|
+
this.initFieldModel(true);
|
|
303
|
+
}
|
|
195
304
|
}
|
|
196
|
-
|
|
305
|
+
);
|
|
197
306
|
}
|
|
198
307
|
},
|
|
199
308
|
initFieldAttrs() {
|
|
200
|
-
this.setDisabled(this.field.options.disabled)
|
|
201
|
-
this.setHidden(this.field.options.hidden)
|
|
202
|
-
this.setReadonly(this.field.options.readonly)
|
|
309
|
+
this.setDisabled(this.field.options.disabled);
|
|
310
|
+
this.setHidden(this.field.options.hidden);
|
|
311
|
+
this.setReadonly(this.field.options.readonly);
|
|
203
312
|
},
|
|
204
313
|
initConfig() {
|
|
205
314
|
/*if (this.designState) {
|
|
@@ -220,7 +329,6 @@ modules = {
|
|
|
220
329
|
}
|
|
221
330
|
|
|
222
331
|
}*/
|
|
223
|
-
|
|
224
332
|
/*this.field.options = Object.assign(
|
|
225
333
|
{},
|
|
226
334
|
config.options,
|
|
@@ -234,7 +342,7 @@ modules = {
|
|
|
234
342
|
e.forEach(function (e, n) {
|
|
235
343
|
e === t && (i = n);
|
|
236
344
|
}),
|
|
237
|
-
|
|
345
|
+
i
|
|
238
346
|
);
|
|
239
347
|
},
|
|
240
348
|
getPropName: function () {
|
|
@@ -243,13 +351,13 @@ modules = {
|
|
|
243
351
|
} else {
|
|
244
352
|
return this.subFormItemFlag && !this.designState
|
|
245
353
|
? this.subFormName +
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
354
|
+
"." +
|
|
355
|
+
this.subFormRowIndex +
|
|
356
|
+
"." +
|
|
357
|
+
this.fieldKeyName
|
|
250
358
|
: this.getObjectFieldFlag() && !this.designState
|
|
251
|
-
|
|
252
|
-
|
|
359
|
+
? this.getObjectName() + "." + this.fieldKeyName
|
|
360
|
+
: this.fieldKeyName;
|
|
253
361
|
}
|
|
254
362
|
},
|
|
255
363
|
initFieldModel: function (flag) {
|
|
@@ -283,30 +391,57 @@ modules = {
|
|
|
283
391
|
let widgetType = this.field.type;
|
|
284
392
|
if (widgetType === "number") {
|
|
285
393
|
nullValue = undefined;
|
|
286
|
-
} else if (
|
|
394
|
+
} else if (
|
|
395
|
+
widgetType === "checkbox" ||
|
|
396
|
+
(widgetType === "select" && this.field.options.multiple) ||
|
|
397
|
+
isAttachmentWidgetType(widgetType)
|
|
398
|
+
) {
|
|
287
399
|
nullValue = [];
|
|
288
|
-
} else if (
|
|
400
|
+
} else if (
|
|
401
|
+
widgetType === "time-range" ||
|
|
402
|
+
widgetType === "date-range" ||
|
|
403
|
+
(widgetType === "date" && this.field.options.type === "dates")
|
|
404
|
+
) {
|
|
289
405
|
nullValue = [];
|
|
290
406
|
}
|
|
291
407
|
if (void 0 === currentData[this.fieldKeyName]) {
|
|
292
408
|
this.$set(currentData, this.fieldKeyName, nullValue);
|
|
293
409
|
}
|
|
410
|
+
if (
|
|
411
|
+
widgetType === "number" &&
|
|
412
|
+
currentData[this.fieldKeyName] === null
|
|
413
|
+
) {
|
|
414
|
+
this.$set(currentData, this.fieldKeyName, undefined);
|
|
415
|
+
}
|
|
294
416
|
if (flag) {
|
|
295
417
|
this.fieldModel = currentData[this.fieldKeyName];
|
|
296
|
-
} else if (
|
|
418
|
+
} else if (
|
|
419
|
+
currentData[this.fieldKeyName] !== null &&
|
|
420
|
+
currentData[this.fieldKeyName] !== undefined
|
|
421
|
+
) {
|
|
297
422
|
this.fieldModel = currentData[this.fieldKeyName];
|
|
298
423
|
} else {
|
|
424
|
+
if (widgetType === "number") {
|
|
425
|
+
this.fieldModel = undefined;
|
|
426
|
+
}
|
|
299
427
|
if (!dataId) {
|
|
300
428
|
//新增
|
|
301
|
-
if (
|
|
302
|
-
|
|
429
|
+
if (
|
|
430
|
+
!this.designState &&
|
|
431
|
+
this.hasVabsearchFlag() &&
|
|
432
|
+
!this.field.options.multipleChoices
|
|
433
|
+
) {
|
|
434
|
+
let searchDialogConfig =
|
|
435
|
+
this.field.options.searchDialogConfig || {};
|
|
303
436
|
if (this.field.options.userDefaultVabSearch) {
|
|
304
437
|
let userInfo = this.getFormRef().getUserInfo();
|
|
305
438
|
let valueSourceField = "id";
|
|
306
439
|
let labelSourceField = "nick_name";
|
|
307
440
|
if (this.field.options.clickBindEvent === "1") {
|
|
308
|
-
if (searchDialogConfig.valueSourceField)
|
|
309
|
-
|
|
441
|
+
if (searchDialogConfig.valueSourceField)
|
|
442
|
+
valueSourceField = searchDialogConfig.valueSourceField;
|
|
443
|
+
if (searchDialogConfig.labelSourceField)
|
|
444
|
+
labelSourceField = searchDialogConfig.labelSourceField;
|
|
310
445
|
}
|
|
311
446
|
this.initValue(userInfo[valueSourceField] ?? null);
|
|
312
447
|
this.setShowValue(userInfo[labelSourceField] ?? null);
|
|
@@ -316,8 +451,10 @@ modules = {
|
|
|
316
451
|
let valueSourceField = "id";
|
|
317
452
|
let labelSourceField = "name";
|
|
318
453
|
if (this.field.options.clickBindEvent === "1") {
|
|
319
|
-
if (searchDialogConfig.valueSourceField)
|
|
320
|
-
|
|
454
|
+
if (searchDialogConfig.valueSourceField)
|
|
455
|
+
valueSourceField = searchDialogConfig.valueSourceField;
|
|
456
|
+
if (searchDialogConfig.labelSourceField)
|
|
457
|
+
labelSourceField = searchDialogConfig.labelSourceField;
|
|
321
458
|
}
|
|
322
459
|
this.initValue(saleOrgDTO[valueSourceField] ?? null);
|
|
323
460
|
this.setShowValue(saleOrgDTO[labelSourceField] ?? null);
|
|
@@ -365,23 +502,23 @@ modules = {
|
|
|
365
502
|
initFileList: function () {
|
|
366
503
|
("picture-upload" !== this.field.type &&
|
|
367
504
|
"file-upload" !== this.field.type) ||
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
505
|
+
!0 === this.designState ||
|
|
506
|
+
(this.fieldModel &&
|
|
507
|
+
(Array.isArray(this.fieldModel)
|
|
508
|
+
? (this.fileList = baseRefUtil.deepClone(this.fieldModel))
|
|
509
|
+
: this.fileList.splice(
|
|
510
|
+
0,
|
|
511
|
+
0,
|
|
512
|
+
baseRefUtil.deepClone(this.fieldModel)
|
|
513
|
+
)));
|
|
377
514
|
},
|
|
378
515
|
handleCreatedEnterEvent() {
|
|
379
516
|
this.handleCustomEvent(this.field.options.onCreatedEnter);
|
|
380
517
|
},
|
|
381
518
|
initEventHandler() {
|
|
382
519
|
this.designState ||
|
|
383
|
-
|
|
384
|
-
|
|
520
|
+
(this.$on("setFormData", (o) => {
|
|
521
|
+
/*if (!this.subFormItemFlag)
|
|
385
522
|
if (
|
|
386
523
|
!!this.getObjectFieldFlag()
|
|
387
524
|
&& !this.designState
|
|
@@ -393,8 +530,8 @@ modules = {
|
|
|
393
530
|
: e[this.fieldKeyName]
|
|
394
531
|
);
|
|
395
532
|
} else this.setValue(o[this.fieldKeyName]);*/
|
|
396
|
-
|
|
397
|
-
|
|
533
|
+
this.subFormItemFlag || this.setValue(o[this.fieldKeyName]);
|
|
534
|
+
}),
|
|
398
535
|
this.$on("field-value-changed", (o) => {
|
|
399
536
|
if (this.subFormItemFlag) {
|
|
400
537
|
let e = this.formModel[this.subFormName];
|
|
@@ -426,44 +563,73 @@ modules = {
|
|
|
426
563
|
!this.subFormName && !s
|
|
427
564
|
? this.setValue(u, !0)
|
|
428
565
|
: this.subFormName === s &&
|
|
429
|
-
|
|
430
|
-
|
|
566
|
+
this.subFormRowId === c &&
|
|
567
|
+
this.setValue(u, !0);
|
|
431
568
|
}),
|
|
432
|
-
|
|
433
569
|
/* 执行计算公式运算 */
|
|
434
|
-
this.$on(
|
|
435
|
-
if (
|
|
436
|
-
|
|
437
|
-
|
|
570
|
+
this.$on("calculate-formula", (newValue, sourceWidget) => {
|
|
571
|
+
if (
|
|
572
|
+
!!this.field.options.formulaEnabled &&
|
|
573
|
+
!!this.field.options.formula
|
|
574
|
+
) {
|
|
575
|
+
let changedFieldRef = sourceWidget;
|
|
576
|
+
const changedFieldName = sourceWidget.field.options.name;
|
|
438
577
|
//检查计算公式是否包含当前修改字段
|
|
439
|
-
if (
|
|
440
|
-
|
|
578
|
+
if (
|
|
579
|
+
fieldIsUsedInFormula(
|
|
580
|
+
changedFieldName,
|
|
581
|
+
this.field.options.formula,
|
|
582
|
+
this.getFormRef(),
|
|
583
|
+
this
|
|
584
|
+
)
|
|
585
|
+
) {
|
|
441
586
|
/* 计算公式的计算改成延时执行,否则当子表单开启默认创建新行后,子表单字段的计算公式中使用到主表单字段则会出现计算错误!! */
|
|
442
587
|
//calculateFormula(this.getFormRef(), this.getGlobalDsv(), formulajs, this, changedFieldRef)
|
|
443
588
|
|
|
444
589
|
setTimeout(() => {
|
|
445
|
-
calculateFormula(
|
|
446
|
-
|
|
590
|
+
calculateFormula(
|
|
591
|
+
this.getFormRef(),
|
|
592
|
+
this.getGlobalDsv(),
|
|
593
|
+
formulajs,
|
|
594
|
+
this,
|
|
595
|
+
changedFieldRef
|
|
596
|
+
);
|
|
597
|
+
}, 200);
|
|
447
598
|
}
|
|
448
599
|
}
|
|
449
600
|
}),
|
|
450
|
-
|
|
451
601
|
/* 删除子表单行后重新执行计算公式运算 */
|
|
452
|
-
this.$on(
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (
|
|
456
|
-
|
|
602
|
+
this.$on(
|
|
603
|
+
"calculate-formula-sfRowDeleted",
|
|
604
|
+
(newValue, deletedFieldName) => {
|
|
605
|
+
if (
|
|
606
|
+
!!this.field.options.formulaEnabled &&
|
|
607
|
+
!!this.field.options.formula
|
|
608
|
+
) {
|
|
609
|
+
//检查计算公式是否包含当前修改字段
|
|
610
|
+
if (
|
|
611
|
+
fieldIsUsedInFormula(
|
|
612
|
+
deletedFieldName,
|
|
613
|
+
this.field.options.formula,
|
|
614
|
+
this.getFormRef()
|
|
615
|
+
)
|
|
616
|
+
) {
|
|
617
|
+
recalculateFormulaOnSubFormRowDelete(
|
|
618
|
+
this.getFormRef(),
|
|
619
|
+
this.getGlobalDsv(),
|
|
620
|
+
formulajs,
|
|
621
|
+
this
|
|
622
|
+
);
|
|
623
|
+
}
|
|
457
624
|
}
|
|
458
625
|
}
|
|
459
|
-
|
|
460
|
-
|
|
626
|
+
),
|
|
461
627
|
this.$on("loadOptionItemsFromDataSet", (o) => {
|
|
462
628
|
this.loadOptionItemsFromDataSet(o), (this.dataSetLoadedFlag = !0);
|
|
463
629
|
}),
|
|
464
630
|
this.$on("reloadOptionItems", (o) => {
|
|
465
631
|
(o.length === 0 || o.indexOf(this.field.options.name) > -1) &&
|
|
466
|
-
|
|
632
|
+
this.initOptionItems(!0);
|
|
467
633
|
}));
|
|
468
634
|
},
|
|
469
635
|
getEventParam() {
|
|
@@ -484,20 +650,20 @@ modules = {
|
|
|
484
650
|
funtionStr
|
|
485
651
|
);
|
|
486
652
|
let that = this;
|
|
487
|
-
try{
|
|
653
|
+
try {
|
|
488
654
|
return e.call(
|
|
489
655
|
this,
|
|
490
656
|
...eventParam.eventParamValues,
|
|
491
657
|
...eventParamValues
|
|
492
658
|
);
|
|
493
|
-
}catch(error){
|
|
494
|
-
if(settingConfig.fontErrorTipEnabled){
|
|
659
|
+
} catch (error) {
|
|
660
|
+
if (settingConfig.fontErrorTipEnabled) {
|
|
495
661
|
that.$errorMsg({
|
|
496
662
|
rmid: that.$t1("前端脚本异常"),
|
|
497
663
|
content: error.message,
|
|
498
|
-
type:
|
|
499
|
-
_errorMsg: error.stack
|
|
500
|
-
})
|
|
664
|
+
type: "error",
|
|
665
|
+
_errorMsg: error.stack,
|
|
666
|
+
});
|
|
501
667
|
}
|
|
502
668
|
throw error;
|
|
503
669
|
}
|
|
@@ -508,7 +674,6 @@ modules = {
|
|
|
508
674
|
},
|
|
509
675
|
handleOnMounted: function () {
|
|
510
676
|
this.handleCustomEvent(this.field.options.onMounted);
|
|
511
|
-
this.autoExcScript();
|
|
512
677
|
},
|
|
513
678
|
registerToRefList: function (e) {
|
|
514
679
|
/* null !== this.refList && this.field.options.name && (this.tableParam && !this.designState ? (e
|
|
@@ -520,7 +685,7 @@ modules = {
|
|
|
520
685
|
if (this.tableParam && !this.designState) {
|
|
521
686
|
let row = this.tableParam.row;
|
|
522
687
|
if (!row._X_ROW_KEY) {
|
|
523
|
-
row._X_ROW_KEY = "row_" + generateId()
|
|
688
|
+
row._X_ROW_KEY = "row_" + generateId();
|
|
524
689
|
}
|
|
525
690
|
let keyVal = row._X_ROW_KEY;
|
|
526
691
|
e && delete this.refList[e + "_" + keyVal];
|
|
@@ -536,21 +701,25 @@ modules = {
|
|
|
536
701
|
this.refList[this.field.options.name] = this;
|
|
537
702
|
if (this.widgetKeyNameMap) {
|
|
538
703
|
if (!this.widgetKeyNameMap[this.fieldKeyName]) {
|
|
539
|
-
this.widgetKeyNameMap[this.fieldKeyName] = [
|
|
704
|
+
this.widgetKeyNameMap[this.fieldKeyName] = [
|
|
705
|
+
this.field.options.name,
|
|
706
|
+
];
|
|
540
707
|
} else {
|
|
541
|
-
this.widgetKeyNameMap[this.fieldKeyName].push(
|
|
708
|
+
this.widgetKeyNameMap[this.fieldKeyName].push(
|
|
709
|
+
this.field.options.name
|
|
710
|
+
);
|
|
542
711
|
}
|
|
543
712
|
}
|
|
544
713
|
}
|
|
545
714
|
}
|
|
546
715
|
},
|
|
547
716
|
getTableRef() {
|
|
548
|
-
let tableRef = this.getWidgetRef(this.parentWidget.options.name)
|
|
717
|
+
let tableRef = this.getWidgetRef(this.parentWidget.options.name);
|
|
549
718
|
return tableRef;
|
|
550
719
|
},
|
|
551
720
|
getWidgetRefByTableRow(index, name) {
|
|
552
721
|
let tableRef = this.getTableRef();
|
|
553
|
-
return tableRef.getWidgetRefByTableRow(index, name)
|
|
722
|
+
return tableRef.getWidgetRefByTableRow(index, name);
|
|
554
723
|
},
|
|
555
724
|
getWidgetRefByTableParam(param) {
|
|
556
725
|
let tableParam = param || this.tableParam;
|
|
@@ -560,19 +729,25 @@ modules = {
|
|
|
560
729
|
unregisterFromRefList: function () {
|
|
561
730
|
if (null !== this.refList && this.field.options.name) {
|
|
562
731
|
let e = this.field.options.name;
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
732
|
+
// 注销 key 必须与 registerToRefList 对齐:行内组件用 name + "_" + row._X_ROW_KEY,
|
|
733
|
+
// 否则行组件销毁时删不掉引用,widgetRefList 里会残留指向旧行的“幽灵”组件,
|
|
734
|
+
// 导致数组必填等校验读到旧空行而误报。
|
|
735
|
+
let key =
|
|
736
|
+
this.tableParam && !this.designState
|
|
737
|
+
? e + "_" + this.tableParam.row._X_ROW_KEY
|
|
738
|
+
: e;
|
|
739
|
+
// 仅当该 key 仍指向当前实例时才删除,避免同 key 重建时误删新注册的实例。
|
|
740
|
+
if (this.refList[key] === this) {
|
|
741
|
+
delete this.refList[key];
|
|
742
|
+
}
|
|
566
743
|
}
|
|
567
744
|
},
|
|
568
745
|
initOptionItemsHandle() {
|
|
569
|
-
if(this.tableParam){
|
|
570
|
-
if(this.field._syncInited){
|
|
571
|
-
this.handleCustomEvent(
|
|
572
|
-
this.field.options.formScriptSuccess
|
|
573
|
-
);
|
|
746
|
+
if (this.tableParam) {
|
|
747
|
+
if (this.field._syncInited) {
|
|
748
|
+
this.handleCustomEvent(this.field.options.formScriptSuccess);
|
|
574
749
|
}
|
|
575
|
-
return
|
|
750
|
+
return;
|
|
576
751
|
}
|
|
577
752
|
this.initGloatOptionItems(true);
|
|
578
753
|
},
|
|
@@ -602,25 +777,18 @@ modules = {
|
|
|
602
777
|
let tableParam = this.tableParam;
|
|
603
778
|
if (formScriptEnabled) {
|
|
604
779
|
if (initFlag && tableParam) {
|
|
605
|
-
let optionItems = this.getOptionItemsFlag()
|
|
780
|
+
let optionItems = this.getOptionItemsFlag();
|
|
606
781
|
if (optionItems !== undefined) {
|
|
607
|
-
return
|
|
782
|
+
return;
|
|
608
783
|
}
|
|
609
|
-
this.setOptionItemsFlag(null)
|
|
784
|
+
this.setOptionItemsFlag(null);
|
|
610
785
|
}
|
|
611
786
|
let accessParam = this.handleCustomEvent(
|
|
612
787
|
this.field.options.formScriptParam
|
|
613
788
|
);
|
|
614
789
|
return this.formHttp({
|
|
615
790
|
scriptCode: scriptCode,
|
|
616
|
-
data: {
|
|
617
|
-
formCode: formCode,
|
|
618
|
-
formVersion: reportTemplate.formVersion,
|
|
619
|
-
taBm: this.fieldKeyName,
|
|
620
|
-
data: {
|
|
621
|
-
...accessParam,
|
|
622
|
-
},
|
|
623
|
-
},
|
|
791
|
+
data: this.buildFormScriptData(reportTemplate, { ...accessParam }),
|
|
624
792
|
callback: (res) => {
|
|
625
793
|
let rows = res.objx?.records || res.objx || [];
|
|
626
794
|
this.loadGloatOptions(rows, initFlag);
|
|
@@ -637,19 +805,19 @@ modules = {
|
|
|
637
805
|
if (initFlag && tableParam) {
|
|
638
806
|
let optionItems = this.getOptionItemsFlag();
|
|
639
807
|
if (optionItems !== undefined) {
|
|
640
|
-
return
|
|
808
|
+
return;
|
|
641
809
|
}
|
|
642
|
-
this.setOptionItemsFlag(null)
|
|
810
|
+
this.setOptionItemsFlag(null);
|
|
643
811
|
}
|
|
644
812
|
let accessParam = this.handleCustomEvent(
|
|
645
813
|
this.field.options.formScriptParam
|
|
646
814
|
);
|
|
647
815
|
this.$getBaseDicts({
|
|
648
816
|
code: commonAttributeCode,
|
|
649
|
-
data:{
|
|
650
|
-
...accessParam
|
|
817
|
+
data: {
|
|
818
|
+
...accessParam,
|
|
651
819
|
},
|
|
652
|
-
success: ({dicts, dictMap}) => {
|
|
820
|
+
success: ({ dicts, dictMap }) => {
|
|
653
821
|
this.loadGloatOptions(dicts, initFlag);
|
|
654
822
|
this.handleCustomEvent(
|
|
655
823
|
this.field.options.formScriptSuccess,
|
|
@@ -685,21 +853,21 @@ modules = {
|
|
|
685
853
|
this.getOptionItemValueKey()
|
|
686
854
|
);
|
|
687
855
|
// this.field.options.optionItems = optionItems
|
|
688
|
-
this.setOptionItems(optionItems)
|
|
856
|
+
this.setOptionItems(optionItems);
|
|
689
857
|
let tableParam = this.tableParam;
|
|
690
858
|
if (tableParam) {
|
|
691
859
|
if (initFlag) {
|
|
692
|
-
this.setOptionItemsFlag(true)
|
|
860
|
+
this.setOptionItemsFlag(true);
|
|
693
861
|
}
|
|
694
|
-
this.loadTableOtions(optionItems)
|
|
862
|
+
this.loadTableOtions(optionItems);
|
|
695
863
|
}
|
|
696
864
|
},
|
|
697
|
-
setOptionItems(rows){
|
|
698
|
-
let formScriptEnabledTypes = [
|
|
865
|
+
setOptionItems(rows) {
|
|
866
|
+
let formScriptEnabledTypes = ["select", "checkbox", "radio", "cascader"];
|
|
699
867
|
let widgetType = this.field.type;
|
|
700
|
-
if(formScriptEnabledTypes.includes(widgetType)){
|
|
868
|
+
if (formScriptEnabledTypes.includes(widgetType)) {
|
|
701
869
|
this.field.options.optionItems = rows || [];
|
|
702
|
-
}else if(widgetType=="status"){
|
|
870
|
+
} else if (widgetType == "status") {
|
|
703
871
|
this.field.options.statusParam = rows || [];
|
|
704
872
|
}
|
|
705
873
|
},
|
|
@@ -713,31 +881,37 @@ modules = {
|
|
|
713
881
|
this.getOptionItemValueKey()
|
|
714
882
|
);
|
|
715
883
|
let widgetName = this.field.options.name;
|
|
716
|
-
let tableWidgetName = tableParam.column.params.tableWidgetName
|
|
884
|
+
let tableWidgetName = tableParam.column.params.tableWidgetName;
|
|
717
885
|
let tableTarget = this.getWidgetRef(tableWidgetName);
|
|
718
|
-
tableTarget.loopHandleWidgetByName(
|
|
719
|
-
|
|
720
|
-
|
|
886
|
+
tableTarget.loopHandleWidgetByName(
|
|
887
|
+
widgetName,
|
|
888
|
+
(row, widget, target) => {
|
|
889
|
+
widget.options.optionItems = optionItems;
|
|
890
|
+
}
|
|
891
|
+
);
|
|
721
892
|
if (tableParam.column.params.widget) {
|
|
722
893
|
if (tableParam.column.params.widget.options.name === widgetName) {
|
|
723
|
-
tableParam.column.params.widget.options.optionItems = optionItems
|
|
894
|
+
tableParam.column.params.widget.options.optionItems = optionItems;
|
|
724
895
|
}
|
|
725
|
-
|
|
726
896
|
}
|
|
727
897
|
if (tableParam.column.params.editWidget) {
|
|
728
898
|
if (tableParam.column.params.editWidget.options.name === widgetName) {
|
|
729
|
-
tableParam.column.params.editWidget.options.optionItems =
|
|
899
|
+
tableParam.column.params.editWidget.options.optionItems =
|
|
900
|
+
optionItems;
|
|
730
901
|
}
|
|
731
902
|
}
|
|
732
903
|
if (tableParam.column.params.widgetList?.length) {
|
|
733
|
-
this.loopHandleWidget(
|
|
734
|
-
|
|
735
|
-
|
|
904
|
+
this.loopHandleWidget(
|
|
905
|
+
tableParam.column.params.widgetList,
|
|
906
|
+
(item1) => {
|
|
907
|
+
if (item1.options.name === widgetName) {
|
|
908
|
+
item1.options.optionItems = optionItems;
|
|
909
|
+
}
|
|
736
910
|
}
|
|
737
|
-
|
|
911
|
+
);
|
|
738
912
|
}
|
|
739
913
|
|
|
740
|
-
delete tableParam.column.params[widgetName]
|
|
914
|
+
delete tableParam.column.params[widgetName];
|
|
741
915
|
}
|
|
742
916
|
},
|
|
743
917
|
async initOptionItems(gloatFlag) {
|
|
@@ -763,14 +937,7 @@ modules = {
|
|
|
763
937
|
);
|
|
764
938
|
return this.formHttp({
|
|
765
939
|
scriptCode: scriptCode,
|
|
766
|
-
data: {
|
|
767
|
-
formCode: formCode,
|
|
768
|
-
formVersion: reportTemplate.formVersion,
|
|
769
|
-
taBm: this.fieldKeyName,
|
|
770
|
-
data: {
|
|
771
|
-
...accessParam,
|
|
772
|
-
},
|
|
773
|
-
},
|
|
940
|
+
data: this.buildFormScriptData(reportTemplate, { ...accessParam }),
|
|
774
941
|
callback: (res) => {
|
|
775
942
|
let rows = res.objx || [];
|
|
776
943
|
this.loadOptions(rows);
|
|
@@ -786,7 +953,7 @@ modules = {
|
|
|
786
953
|
if (!commonAttributeCode) return;
|
|
787
954
|
this.$getBaseDicts({
|
|
788
955
|
code: commonAttributeCode,
|
|
789
|
-
success: ({dicts, dictMap}) => {
|
|
956
|
+
success: ({ dicts, dictMap }) => {
|
|
790
957
|
this.loadOptions(dicts);
|
|
791
958
|
this.handleCustomEvent(
|
|
792
959
|
this.field.options.formScriptSuccess,
|
|
@@ -802,16 +969,16 @@ modules = {
|
|
|
802
969
|
},
|
|
803
970
|
refreshDefaultValue: function () {
|
|
804
971
|
!0 === this.designState &&
|
|
805
|
-
|
|
806
|
-
|
|
972
|
+
void 0 !== this.field.options.defaultValue &&
|
|
973
|
+
(this.fieldModel = this.field.options.defaultValue);
|
|
807
974
|
},
|
|
808
975
|
|
|
809
976
|
clearFieldRules() {
|
|
810
977
|
if (!this.field.formItemFlag) {
|
|
811
|
-
return
|
|
978
|
+
return;
|
|
812
979
|
}
|
|
813
980
|
|
|
814
|
-
this.rules && this.rules.splice(0, this.rules.length)
|
|
981
|
+
this.rules && this.rules.splice(0, this.rules.length); //清空已有
|
|
815
982
|
},
|
|
816
983
|
|
|
817
984
|
getValidateDefaultMsg(labelCode, vldName) {
|
|
@@ -826,78 +993,129 @@ modules = {
|
|
|
826
993
|
chinese: "[{label}]只能输入中文字符",
|
|
827
994
|
email: "[{label}]邮箱格式有误",
|
|
828
995
|
url: "[{label}]URL格式有误",
|
|
829
|
-
required: "[{label}]不能为空"
|
|
830
|
-
}
|
|
831
|
-
let result = null
|
|
832
|
-
let value = map[vldName]
|
|
996
|
+
required: "[{label}]不能为空",
|
|
997
|
+
};
|
|
998
|
+
let result = null;
|
|
999
|
+
let value = map[vldName];
|
|
833
1000
|
if (!value) {
|
|
834
|
-
value = "[{label}]invalid value"
|
|
1001
|
+
value = "[{label}]invalid value";
|
|
835
1002
|
}
|
|
836
|
-
result = this.$t1(value, {label});
|
|
837
|
-
return result
|
|
1003
|
+
result = this.$t1(value, { label });
|
|
1004
|
+
return result;
|
|
1005
|
+
},
|
|
1006
|
+
resolveFieldValidateLabelCode() {
|
|
1007
|
+
if (this.field.options.label) {
|
|
1008
|
+
return this.field.options.label;
|
|
1009
|
+
}
|
|
1010
|
+
const columnConfig =
|
|
1011
|
+
this.columnConfig || this.tableParam?.column?.params?.columnConfig;
|
|
1012
|
+
if (columnConfig?.label) {
|
|
1013
|
+
return columnConfig.label;
|
|
1014
|
+
}
|
|
1015
|
+
return (
|
|
1016
|
+
(this.field.options.keyNameEnabled && this.field.options.keyName) ||
|
|
1017
|
+
this.field.options.name ||
|
|
1018
|
+
""
|
|
1019
|
+
);
|
|
838
1020
|
},
|
|
839
1021
|
getValidationHintMsg() {
|
|
840
|
-
let vldName = this.field.options.validation
|
|
1022
|
+
let vldName = this.field.options.validation;
|
|
841
1023
|
if (this.field.options.validationHint) {
|
|
842
|
-
return this.$t1(this.field.options.validationHint)
|
|
1024
|
+
return this.$t1(this.field.options.validationHint);
|
|
843
1025
|
} else {
|
|
844
|
-
return this.getValidateDefaultMsg(
|
|
1026
|
+
return this.getValidateDefaultMsg(
|
|
1027
|
+
this.resolveFieldValidateLabelCode(),
|
|
1028
|
+
vldName
|
|
1029
|
+
);
|
|
845
1030
|
}
|
|
846
1031
|
},
|
|
847
1032
|
getRequiredHintMsg() {
|
|
848
1033
|
if (this.field.options.requiredHint) {
|
|
849
|
-
return this.$t1(this.field.options.requiredHint)
|
|
1034
|
+
return this.$t1(this.field.options.requiredHint);
|
|
850
1035
|
} else {
|
|
851
|
-
return this.getValidateDefaultMsg(
|
|
1036
|
+
return this.getValidateDefaultMsg(
|
|
1037
|
+
this.resolveFieldValidateLabelCode(),
|
|
1038
|
+
"required"
|
|
1039
|
+
);
|
|
852
1040
|
}
|
|
853
1041
|
},
|
|
854
1042
|
buildFieldRules() {
|
|
855
1043
|
if (!this.field.formItemFlag || this.field.options.hidden) {
|
|
856
|
-
return
|
|
1044
|
+
return;
|
|
857
1045
|
}
|
|
858
1046
|
|
|
859
|
-
this.rules.splice(0, this.rules.length)
|
|
1047
|
+
this.rules.splice(0, this.rules.length); //清空已有
|
|
860
1048
|
if (!!this.field.options.required) {
|
|
861
|
-
this.
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1049
|
+
if (isArrayValueWidgetType(this.field.type, this.field.options)) {
|
|
1050
|
+
this.rules.push({
|
|
1051
|
+
validator: (rule, value, callback) => {
|
|
1052
|
+
const actualValue =
|
|
1053
|
+
typeof this.getCurrentValue === "function"
|
|
1054
|
+
? this.getCurrentValue()
|
|
1055
|
+
: value;
|
|
1056
|
+
if (
|
|
1057
|
+
isEmptyArrayFieldValue(
|
|
1058
|
+
actualValue,
|
|
1059
|
+
this.field.type,
|
|
1060
|
+
this.field.options
|
|
1061
|
+
)
|
|
1062
|
+
) {
|
|
1063
|
+
callback(new Error(this.getRequiredHintMsg()));
|
|
1064
|
+
} else {
|
|
1065
|
+
callback();
|
|
1066
|
+
}
|
|
1067
|
+
},
|
|
1068
|
+
trigger: ["change", "blur"],
|
|
1069
|
+
});
|
|
1070
|
+
} else {
|
|
1071
|
+
this.rules.push({
|
|
1072
|
+
required: true,
|
|
1073
|
+
//trigger: ['blur', 'change'],
|
|
1074
|
+
trigger: [
|
|
1075
|
+
"blur",
|
|
1076
|
+
] /* 去掉change事件触发校验,change事件触发时formModel数据尚未更新,导致radio/checkbox必填校验出错!! */,
|
|
1077
|
+
message: this.getRequiredHintMsg(),
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
867
1080
|
}
|
|
868
1081
|
|
|
869
1082
|
if (!!this.field.options.validation) {
|
|
870
|
-
let vldName = this.field.options.validation
|
|
1083
|
+
let vldName = this.field.options.validation;
|
|
871
1084
|
if (!!FormValidators[vldName]) {
|
|
872
1085
|
this.rules.push({
|
|
873
1086
|
validator: FormValidators[vldName],
|
|
874
|
-
trigger: [
|
|
1087
|
+
trigger: ["blur", "change"],
|
|
875
1088
|
label: this.field.options.label,
|
|
876
1089
|
// errorMsg: this.field.options.validationHint
|
|
877
|
-
errorMsg: this.getValidationHintMsg()
|
|
878
|
-
})
|
|
1090
|
+
errorMsg: this.getValidationHintMsg(),
|
|
1091
|
+
});
|
|
879
1092
|
} else {
|
|
880
1093
|
this.rules.push({
|
|
881
|
-
validator: FormValidators[
|
|
882
|
-
trigger: [
|
|
1094
|
+
validator: FormValidators["regExp"],
|
|
1095
|
+
trigger: ["blur", "change"],
|
|
883
1096
|
regExp: vldName,
|
|
884
1097
|
label: this.field.options.label,
|
|
885
1098
|
// errorMsg: this.field.options.validationHint
|
|
886
|
-
errorMsg: this.getValidationHintMsg()
|
|
887
|
-
})
|
|
1099
|
+
errorMsg: this.getValidationHintMsg(),
|
|
1100
|
+
});
|
|
888
1101
|
}
|
|
889
1102
|
}
|
|
890
1103
|
|
|
891
1104
|
if (!!this.field.options.onValidate) {
|
|
892
1105
|
let customFn = (rule, value, callback) => {
|
|
893
|
-
let tmpFunc = new Function(
|
|
894
|
-
|
|
895
|
-
|
|
1106
|
+
let tmpFunc = new Function(
|
|
1107
|
+
"rule",
|
|
1108
|
+
"value",
|
|
1109
|
+
"callback",
|
|
1110
|
+
this.field.options.onValidate
|
|
1111
|
+
);
|
|
1112
|
+
return tmpFunc.call(this, rule, value, callback);
|
|
1113
|
+
};
|
|
896
1114
|
this.rules.push({
|
|
897
1115
|
validator: customFn,
|
|
898
|
-
trigger: [
|
|
899
|
-
label: this.field.options.label
|
|
900
|
-
})
|
|
1116
|
+
trigger: ["blur", "change"],
|
|
1117
|
+
label: this.field.options.label,
|
|
1118
|
+
});
|
|
901
1119
|
}
|
|
902
1120
|
},
|
|
903
1121
|
|
|
@@ -906,14 +1124,14 @@ modules = {
|
|
|
906
1124
|
*/
|
|
907
1125
|
disableChangeValidate() {
|
|
908
1126
|
if (!this.rules) {
|
|
909
|
-
return
|
|
1127
|
+
return;
|
|
910
1128
|
}
|
|
911
1129
|
|
|
912
|
-
this.rules.forEach(rule => {
|
|
1130
|
+
this.rules.forEach((rule) => {
|
|
913
1131
|
if (!!rule.trigger) {
|
|
914
|
-
rule.trigger.splice(0, rule.trigger.length)
|
|
1132
|
+
rule.trigger.splice(0, rule.trigger.length);
|
|
915
1133
|
}
|
|
916
|
-
})
|
|
1134
|
+
});
|
|
917
1135
|
},
|
|
918
1136
|
|
|
919
1137
|
/**
|
|
@@ -921,72 +1139,89 @@ modules = {
|
|
|
921
1139
|
*/
|
|
922
1140
|
enableChangeValidate() {
|
|
923
1141
|
if (!this.rules) {
|
|
924
|
-
return
|
|
1142
|
+
return;
|
|
925
1143
|
}
|
|
926
1144
|
|
|
927
|
-
this.rules.forEach(rule => {
|
|
1145
|
+
this.rules.forEach((rule) => {
|
|
928
1146
|
if (!!rule.trigger) {
|
|
929
|
-
rule.trigger.push(
|
|
930
|
-
rule.trigger.push(
|
|
1147
|
+
rule.trigger.push("blur");
|
|
1148
|
+
rule.trigger.push("change");
|
|
931
1149
|
}
|
|
932
|
-
})
|
|
1150
|
+
});
|
|
933
1151
|
},
|
|
934
1152
|
|
|
935
1153
|
disableOptionOfList(optionList, optionValue) {
|
|
936
|
-
if (!!optionList &&
|
|
1154
|
+
if (!!optionList && optionList.length > 0) {
|
|
937
1155
|
let valueKey = this.getOptionItemValueKey();
|
|
938
|
-
optionList.forEach(opt => {
|
|
1156
|
+
optionList.forEach((opt) => {
|
|
939
1157
|
if (opt[valueKey] === optionValue) {
|
|
940
|
-
opt.disabled = true
|
|
1158
|
+
opt.disabled = true;
|
|
941
1159
|
}
|
|
942
1160
|
|
|
943
1161
|
if (opt.children && Array.isArray(opt.children)) {
|
|
944
|
-
this.disableOptionOfList(opt.children, optionValue)
|
|
1162
|
+
this.disableOptionOfList(opt.children, optionValue);
|
|
945
1163
|
}
|
|
946
|
-
})
|
|
947
|
-
this.$forceUpdate()
|
|
1164
|
+
});
|
|
1165
|
+
this.$forceUpdate();
|
|
948
1166
|
}
|
|
949
1167
|
},
|
|
950
1168
|
|
|
951
1169
|
enableOptionOfList(optionList, optionValue) {
|
|
952
|
-
if (!!optionList &&
|
|
1170
|
+
if (!!optionList && optionList.length > 0) {
|
|
953
1171
|
let valueKey = this.getOptionItemValueKey();
|
|
954
|
-
optionList.forEach(opt => {
|
|
1172
|
+
optionList.forEach((opt) => {
|
|
955
1173
|
if (opt[valueKey] === optionValue) {
|
|
956
|
-
opt.disabled = false
|
|
1174
|
+
opt.disabled = false;
|
|
957
1175
|
}
|
|
958
1176
|
|
|
959
1177
|
if (opt.children && Array.isArray(opt.children)) {
|
|
960
|
-
this.enableOptionOfList(opt.children, optionValue)
|
|
1178
|
+
this.enableOptionOfList(opt.children, optionValue);
|
|
961
1179
|
}
|
|
962
|
-
})
|
|
963
|
-
this.$forceUpdate()
|
|
1180
|
+
});
|
|
1181
|
+
this.$forceUpdate();
|
|
964
1182
|
}
|
|
965
1183
|
},
|
|
966
1184
|
|
|
967
|
-
|
|
968
1185
|
emitFieldDataChange(newValue, oldValue) {
|
|
969
|
-
if (this.designState) return
|
|
970
|
-
this.$emit(
|
|
1186
|
+
if (this.designState) return;
|
|
1187
|
+
this.$emit("field-value-changed", [newValue, oldValue]);
|
|
971
1188
|
|
|
972
1189
|
/* 同步更新keyName属性一致的字段组件值!! */
|
|
973
1190
|
if (this.field.options.keyNameEnabled) {
|
|
974
|
-
this.getFormRef().broadcast(
|
|
975
|
-
|
|
976
|
-
|
|
1191
|
+
this.getFormRef().broadcast("FieldWidget", "sync-field-value", [
|
|
1192
|
+
this.field.options.name,
|
|
1193
|
+
this.field.options.keyName,
|
|
1194
|
+
this.subFormName,
|
|
1195
|
+
this.subFormRowId,
|
|
1196
|
+
newValue,
|
|
1197
|
+
this.getObjectName(),
|
|
1198
|
+
]);
|
|
977
1199
|
} else {
|
|
978
|
-
this.getFormRef().broadcast(
|
|
979
|
-
|
|
980
|
-
|
|
1200
|
+
this.getFormRef().broadcast("FieldWidget", "sync-field-value", [
|
|
1201
|
+
this.field.options.name,
|
|
1202
|
+
this.field.options.name,
|
|
1203
|
+
this.subFormName,
|
|
1204
|
+
this.subFormRowId,
|
|
1205
|
+
newValue,
|
|
1206
|
+
this.getObjectName(),
|
|
1207
|
+
]);
|
|
981
1208
|
}
|
|
982
1209
|
|
|
983
|
-
if (this.field.type ===
|
|
984
|
-
this.getFormRef().broadcast(
|
|
1210
|
+
if (this.field.type === "number") {
|
|
1211
|
+
this.getFormRef().broadcast("FieldWidget", "calculate-formula", [
|
|
1212
|
+
newValue,
|
|
1213
|
+
this,
|
|
1214
|
+
]); //触发计算公式计算
|
|
985
1215
|
}
|
|
986
1216
|
|
|
987
1217
|
/* 必须用dispatch向指定父组件派发消息!! */
|
|
988
|
-
this.dispatch(
|
|
989
|
-
|
|
1218
|
+
this.dispatch("VFormRender", "fieldChange", [
|
|
1219
|
+
this.field.options.name,
|
|
1220
|
+
newValue,
|
|
1221
|
+
oldValue,
|
|
1222
|
+
this.subFormName,
|
|
1223
|
+
this.subFormRowIndex,
|
|
1224
|
+
]);
|
|
990
1225
|
},
|
|
991
1226
|
syncUpdateFormModel: function (e) {
|
|
992
1227
|
if (!this.designState)
|
|
@@ -998,17 +1233,31 @@ modules = {
|
|
|
998
1233
|
i[this.fieldKeyName] = e;
|
|
999
1234
|
} else this.formModel[this.fieldKeyName] = e;
|
|
1000
1235
|
},
|
|
1236
|
+
onFieldChangeEvent(value) {
|
|
1237
|
+
if (!!this.designState) {
|
|
1238
|
+
//设计状态不触发事件
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
this.setCETriggerFlag(); //设置用户触发事件标志
|
|
1243
|
+
this.handleChangeEvent(value);
|
|
1244
|
+
setTimeout(() => {
|
|
1245
|
+
this.clearCETriggerFlag(); //复位用户触发事件标志
|
|
1246
|
+
}, 200);
|
|
1247
|
+
},
|
|
1001
1248
|
handleChangeEvent: function (e) {
|
|
1002
1249
|
let widgetType = this.field.type;
|
|
1003
|
-
if(widgetType === "select"){
|
|
1004
|
-
if(e===""){
|
|
1005
|
-
|
|
1006
|
-
|
|
1250
|
+
if (widgetType === "select") {
|
|
1251
|
+
if (e === "") {
|
|
1252
|
+
e = this.field.options.multiple ? [] : null;
|
|
1253
|
+
this.fieldModel = e;
|
|
1007
1254
|
}
|
|
1008
|
-
}else if(widgetType === "number"){
|
|
1009
|
-
if(e===undefined){
|
|
1010
|
-
|
|
1011
|
-
|
|
1255
|
+
} else if (widgetType === "number") {
|
|
1256
|
+
if (e === undefined || e === null) {
|
|
1257
|
+
// 清空存 null:undefined 会被 JSON.stringify 丢弃,字段不进请求体,
|
|
1258
|
+
// 后台按“未传即不更新”处理导致清空无法落库;null 可序列化并被后台置空。
|
|
1259
|
+
e = null;
|
|
1260
|
+
this.fieldModel = e;
|
|
1012
1261
|
}
|
|
1013
1262
|
}
|
|
1014
1263
|
|
|
@@ -1020,7 +1269,7 @@ modules = {
|
|
|
1020
1269
|
handleFocusCustomEvent: function (e) {
|
|
1021
1270
|
if (
|
|
1022
1271
|
((this.oldFieldValue = baseRefUtil.deepClone(this.fieldModel)),
|
|
1023
|
-
|
|
1272
|
+
this.field.options.onFocus)
|
|
1024
1273
|
) {
|
|
1025
1274
|
let t = new Function("event", this.field.options.onFocus);
|
|
1026
1275
|
t.call(this, e);
|
|
@@ -1035,8 +1284,8 @@ modules = {
|
|
|
1035
1284
|
handleInputCustomEvent: function (e) {
|
|
1036
1285
|
if (
|
|
1037
1286
|
(this.syncUpdateFormModel(e),
|
|
1038
|
-
|
|
1039
|
-
|
|
1287
|
+
this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]),
|
|
1288
|
+
this.field.options.onInput)
|
|
1040
1289
|
) {
|
|
1041
1290
|
let t = new Function("value", this.field.options.onInput);
|
|
1042
1291
|
t.call(this, e);
|
|
@@ -1066,29 +1315,57 @@ modules = {
|
|
|
1066
1315
|
this.handleCustomClickEvent();
|
|
1067
1316
|
}
|
|
1068
1317
|
},
|
|
1318
|
+
/**
|
|
1319
|
+
* 点击绑定事件的上下文。链接模式(flag=true)下所有配置统一从
|
|
1320
|
+
* widgetTextLinkConfig.options 读,不再出现「动作取链接的、前置脚本取主控件的」分裂。
|
|
1321
|
+
*/
|
|
1322
|
+
getClickBindContext(flag) {
|
|
1323
|
+
let linkOptions = this.field.options.widgetTextLinkConfig?.options;
|
|
1324
|
+
let optionModel = flag ? linkOptions || {} : this.field.options;
|
|
1325
|
+
return {
|
|
1326
|
+
vm: this,
|
|
1327
|
+
flag: !!flag,
|
|
1328
|
+
field: this.field,
|
|
1329
|
+
widgetType: this.field.type,
|
|
1330
|
+
optionModel,
|
|
1331
|
+
tableParam: this.tableParam,
|
|
1332
|
+
rowData: this.tableParam?.row || null,
|
|
1333
|
+
formRef: this.getFormRef(),
|
|
1334
|
+
actionValue: optionModel.clickBindEvent,
|
|
1335
|
+
// 链接模式优先用自己的前置脚本,未配则回落主控件(保持存量行为)
|
|
1336
|
+
beforeScript:
|
|
1337
|
+
optionModel.onBeforeClickButton
|
|
1338
|
+
?? this.field.options.onBeforeClickButton,
|
|
1339
|
+
};
|
|
1340
|
+
},
|
|
1069
1341
|
handleCustomClickEvent: function (flag) {
|
|
1070
|
-
let
|
|
1071
|
-
let
|
|
1342
|
+
let ctx = this.getClickBindContext(flag);
|
|
1343
|
+
let action = getClickBindAction(ctx.actionValue);
|
|
1344
|
+
if (!action) return;
|
|
1072
1345
|
|
|
1346
|
+
// done 幂等:脚本里调了 done() 又没 return false,也只执行一次
|
|
1347
|
+
let fired = false;
|
|
1073
1348
|
const done = () => {
|
|
1074
|
-
if (
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
if (
|
|
1083
|
-
|
|
1084
|
-
done();
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
done();
|
|
1349
|
+
if (fired) return;
|
|
1350
|
+
fired = true;
|
|
1351
|
+
action.run(ctx);
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1354
|
+
if (!ctx.beforeScript) return done();
|
|
1355
|
+
let ret = this.handleCustomEvent(ctx.beforeScript, ["done"], [done]);
|
|
1356
|
+
if (ret === false) return; // 脚本显式接管
|
|
1357
|
+
if (ret && typeof ret.then === "function") {
|
|
1358
|
+
ret.then((result) => {
|
|
1359
|
+
if (result !== false) done();
|
|
1360
|
+
});
|
|
1361
|
+
return;
|
|
1088
1362
|
}
|
|
1363
|
+
done();
|
|
1089
1364
|
},
|
|
1090
1365
|
handleAddTableDataEvent(flag) {
|
|
1091
|
-
let optionModel = !flag
|
|
1366
|
+
let optionModel = !flag
|
|
1367
|
+
? this.field.options
|
|
1368
|
+
: this.field.options.widgetTextLinkConfig?.options || {};
|
|
1092
1369
|
|
|
1093
1370
|
let addTableDataConfig = optionModel.addTableDataConfig || {};
|
|
1094
1371
|
if (!addTableDataConfig.tableRef) return;
|
|
@@ -1115,7 +1392,9 @@ modules = {
|
|
|
1115
1392
|
},
|
|
1116
1393
|
handleButtonWidgetClick: function (event, flag) {
|
|
1117
1394
|
if (!this.designState) {
|
|
1118
|
-
let onClick = !flag
|
|
1395
|
+
let onClick = !flag
|
|
1396
|
+
? this.field.options.onClick
|
|
1397
|
+
: this.field.options.widgetTextLinkConfig?.options?.onClick;
|
|
1119
1398
|
if (onClick) {
|
|
1120
1399
|
let tableParam = this.tableParam;
|
|
1121
1400
|
let eventParamNames = ["event"];
|
|
@@ -1124,11 +1403,7 @@ modules = {
|
|
|
1124
1403
|
eventParamNames = ["row", "rowIndex", "event"];
|
|
1125
1404
|
eventParamValues = [tableParam.row, tableParam.rowIndex, event];
|
|
1126
1405
|
}
|
|
1127
|
-
this.handleCustomEvent(
|
|
1128
|
-
onClick,
|
|
1129
|
-
eventParamNames,
|
|
1130
|
-
eventParamValues
|
|
1131
|
-
);
|
|
1406
|
+
this.handleCustomEvent(onClick, eventParamNames, eventParamValues);
|
|
1132
1407
|
} else {
|
|
1133
1408
|
if (!flag) this.dispatch("VFormRender", "buttonClick", [this]);
|
|
1134
1409
|
}
|
|
@@ -1140,7 +1415,9 @@ modules = {
|
|
|
1140
1415
|
let tableData = searchDialogConfig.tableData || [];
|
|
1141
1416
|
},
|
|
1142
1417
|
openSearchDialog(tableParam, flag) {
|
|
1143
|
-
let optionModel = !flag
|
|
1418
|
+
let optionModel = !flag
|
|
1419
|
+
? this.field.options
|
|
1420
|
+
: this.field.options.widgetTextLinkConfig?.options || {};
|
|
1144
1421
|
let searchDialogConfig = optionModel.searchDialogConfig || {};
|
|
1145
1422
|
let formCode = searchDialogConfig.formCode;
|
|
1146
1423
|
let tableData = searchDialogConfig.tableData || [];
|
|
@@ -1148,12 +1425,14 @@ modules = {
|
|
|
1148
1425
|
|
|
1149
1426
|
let rows = [];
|
|
1150
1427
|
if (this.hasVabsearchFlag()) {
|
|
1151
|
-
if (this.
|
|
1428
|
+
if (this.getMultipleChoices(flag)) {
|
|
1152
1429
|
let fieldKeyName = this.fieldKeyName;
|
|
1153
1430
|
let valueField = trim(this.field.options.valueField || fieldKeyName);
|
|
1154
|
-
let vabSearchName = trim(
|
|
1155
|
-
|
|
1156
|
-
|
|
1431
|
+
let vabSearchName = trim(
|
|
1432
|
+
this.field.options.vabSearchName || fieldKeyName
|
|
1433
|
+
);
|
|
1434
|
+
let valueSourceField = trim(searchDialogConfig.valueSourceField);
|
|
1435
|
+
let labelSourceField = trim(searchDialogConfig.labelSourceField);
|
|
1157
1436
|
|
|
1158
1437
|
rows = (this.fieldModel || []).map((row) => {
|
|
1159
1438
|
return {
|
|
@@ -1167,39 +1446,65 @@ modules = {
|
|
|
1167
1446
|
// dialogQueryParam.
|
|
1168
1447
|
let queryParam = null;
|
|
1169
1448
|
if (searchDialogConfig.dialogQueryParam) {
|
|
1170
|
-
queryParam = this.handleCustomEvent(
|
|
1449
|
+
queryParam = this.handleCustomEvent(
|
|
1450
|
+
searchDialogConfig.dialogQueryParam
|
|
1451
|
+
);
|
|
1171
1452
|
}
|
|
1172
1453
|
let dialogCustomParam = {};
|
|
1173
1454
|
if (searchDialogConfig.dialogCustomParam) {
|
|
1174
|
-
dialogCustomParam =
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
this.
|
|
1455
|
+
dialogCustomParam =
|
|
1456
|
+
this.handleCustomEvent(searchDialogConfig.dialogCustomParam) || {};
|
|
1457
|
+
}
|
|
1458
|
+
let dialogParam = Object.assign(
|
|
1459
|
+
{
|
|
1460
|
+
formCode: formCode,
|
|
1461
|
+
rows,
|
|
1462
|
+
queryParam,
|
|
1463
|
+
multiple: this.getMultipleChoices(flag),
|
|
1464
|
+
confirm: (rows) => {
|
|
1465
|
+
this.handleConfirmSearchDialog(rows, false, flag);
|
|
1466
|
+
},
|
|
1183
1467
|
},
|
|
1184
|
-
|
|
1468
|
+
dialogCustomParam
|
|
1469
|
+
);
|
|
1185
1470
|
this.getFormRef().openSearchDialog(dialogParam);
|
|
1186
1471
|
},
|
|
1187
1472
|
handleClearSearchDialog() {
|
|
1473
|
+
// 清除入口只存在于 vabsearch 主控件(onSearchClear),链接模式没有清除按钮
|
|
1188
1474
|
let clickBindEvent = this.field.options.clickBindEvent;
|
|
1189
|
-
if (clickBindEvent ===
|
|
1475
|
+
if (clickBindEvent === CLICK_BIND.SEARCH_DIALOG) {
|
|
1190
1476
|
this.handleConfirmSearchDialog(null, true);
|
|
1191
1477
|
}
|
|
1192
1478
|
},
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1479
|
+
/**
|
|
1480
|
+
* 「是否多选」唯一读取口径。
|
|
1481
|
+
* 搜索类控件(vabsearch/singerSearch/multiSearch)的 multipleChoices 是结构性的
|
|
1482
|
+
* ——它决定字段值是数组还是标量——所以以控件自身的为准;其它控件读选择弹框配置。
|
|
1483
|
+
* 此前开弹框读 searchDialogConfig、回填读 field.options,两个开关不一致时会出现
|
|
1484
|
+
* 「弹框能多选、回填只落一条」。
|
|
1485
|
+
*/
|
|
1486
|
+
getMultipleChoices(flag) {
|
|
1487
|
+
let optionModel = !flag
|
|
1488
|
+
? this.field.options
|
|
1489
|
+
: this.field.options.widgetTextLinkConfig?.options || {};
|
|
1490
|
+
return (
|
|
1491
|
+
this.field.options.multipleChoices
|
|
1492
|
+
?? optionModel.searchDialogConfig?.multipleChoices
|
|
1493
|
+
?? false
|
|
1494
|
+
);
|
|
1196
1495
|
},
|
|
1197
1496
|
hasVabsearchFlag() {
|
|
1198
|
-
return
|
|
1497
|
+
return (
|
|
1498
|
+
this.field.type === "vabsearch" ||
|
|
1499
|
+
this.field.type === "singerSearch" ||
|
|
1500
|
+
this.field.type === "multiSearch"
|
|
1501
|
+
);
|
|
1199
1502
|
},
|
|
1200
1503
|
handleConfirmSearchDialog(rows, isClear, flag) {
|
|
1201
1504
|
if (!isClear && !rows.length) return;
|
|
1202
|
-
let optionModel = !flag
|
|
1505
|
+
let optionModel = !flag
|
|
1506
|
+
? this.field.options
|
|
1507
|
+
: this.field.options.widgetTextLinkConfig?.options || {};
|
|
1203
1508
|
|
|
1204
1509
|
let tableParam = this.tableParam;
|
|
1205
1510
|
let searchDialogConfig = optionModel.searchDialogConfig || {};
|
|
@@ -1207,15 +1512,16 @@ modules = {
|
|
|
1207
1512
|
let tableData = searchDialogConfig.tableData || [];
|
|
1208
1513
|
let formModel = this.formModel;
|
|
1209
1514
|
let row = rows && rows.length ? rows[0] : null;
|
|
1210
|
-
let multipleChoices =
|
|
1211
|
-
optionModel.searchDialogConfig.multipleChoices || false;
|
|
1515
|
+
let multipleChoices = searchDialogConfig.multipleChoices || false;
|
|
1212
1516
|
|
|
1213
|
-
let valueSourceField = trim(searchDialogConfig.valueSourceField)
|
|
1214
|
-
let labelSourceField = trim(searchDialogConfig.labelSourceField)
|
|
1517
|
+
let valueSourceField = trim(searchDialogConfig.valueSourceField);
|
|
1518
|
+
let labelSourceField = trim(searchDialogConfig.labelSourceField);
|
|
1215
1519
|
if (this.hasVabsearchFlag()) {
|
|
1216
1520
|
let fieldKeyName = this.fieldKeyName;
|
|
1217
1521
|
let valueField = trim(this.field.options.valueField || fieldKeyName);
|
|
1218
|
-
let vabSearchName = trim(
|
|
1522
|
+
let vabSearchName = trim(
|
|
1523
|
+
this.field.options.vabSearchName || fieldKeyName
|
|
1524
|
+
);
|
|
1219
1525
|
if (tableParam) {
|
|
1220
1526
|
let rowData = tableParam.row;
|
|
1221
1527
|
if (this.getMultipleChoices()) {
|
|
@@ -1224,29 +1530,27 @@ modules = {
|
|
|
1224
1530
|
} else {
|
|
1225
1531
|
rowData[fieldKeyName] = rows.map((item) => {
|
|
1226
1532
|
let newData = {};
|
|
1227
|
-
newData[valueField] =
|
|
1228
|
-
|
|
1229
|
-
newData[vabSearchName] =
|
|
1230
|
-
item[labelSourceField] ?? null;
|
|
1533
|
+
newData[valueField] = item[valueSourceField] ?? null;
|
|
1534
|
+
newData[vabSearchName] = item[labelSourceField] ?? null;
|
|
1231
1535
|
tableData.forEach((item1) => {
|
|
1232
|
-
let targetFormField = trim(
|
|
1233
|
-
|
|
1536
|
+
let targetFormField = trim(
|
|
1537
|
+
item1.targetFormField || item1.targetField
|
|
1538
|
+
);
|
|
1539
|
+
let sourceField = trim(item1.sourceField);
|
|
1234
1540
|
newData[targetFormField] = item[sourceField];
|
|
1235
1541
|
});
|
|
1236
1542
|
return newData;
|
|
1237
1543
|
});
|
|
1238
1544
|
}
|
|
1239
1545
|
} else {
|
|
1240
|
-
rowData[fieldKeyName] = !isClear
|
|
1241
|
-
? row[valueSourceField]
|
|
1242
|
-
: null;
|
|
1546
|
+
rowData[fieldKeyName] = !isClear ? row[valueSourceField] : null;
|
|
1243
1547
|
if (labelSourceField)
|
|
1244
|
-
rowData[vabSearchName] = !isClear
|
|
1245
|
-
? row[labelSourceField]
|
|
1246
|
-
: null;
|
|
1548
|
+
rowData[vabSearchName] = !isClear ? row[labelSourceField] : null;
|
|
1247
1549
|
tableData.forEach((item) => {
|
|
1248
|
-
let targetFormField = trim(
|
|
1249
|
-
|
|
1550
|
+
let targetFormField = trim(
|
|
1551
|
+
item.targetFormField || item.targetField
|
|
1552
|
+
);
|
|
1553
|
+
let sourceField = trim(item.sourceField);
|
|
1250
1554
|
if (!isClear) {
|
|
1251
1555
|
rowData[targetFormField] = row[sourceField];
|
|
1252
1556
|
} else {
|
|
@@ -1262,13 +1566,13 @@ modules = {
|
|
|
1262
1566
|
} else {
|
|
1263
1567
|
rowData = rows.map((item) => {
|
|
1264
1568
|
let newData = {};
|
|
1265
|
-
newData[valueField] =
|
|
1266
|
-
|
|
1267
|
-
newData[vabSearchName] =
|
|
1268
|
-
item[labelSourceField] ?? null;
|
|
1569
|
+
newData[valueField] = item[valueSourceField] ?? null;
|
|
1570
|
+
newData[vabSearchName] = item[labelSourceField] ?? null;
|
|
1269
1571
|
tableData.forEach((item1) => {
|
|
1270
|
-
let targetFormField = trim(
|
|
1271
|
-
|
|
1572
|
+
let targetFormField = trim(
|
|
1573
|
+
item1.targetFormField || item1.targetField
|
|
1574
|
+
);
|
|
1575
|
+
let sourceField = trim(item1.sourceField);
|
|
1272
1576
|
newData[targetFormField] = item[sourceField];
|
|
1273
1577
|
});
|
|
1274
1578
|
return newData;
|
|
@@ -1279,20 +1583,16 @@ modules = {
|
|
|
1279
1583
|
/* this.fieldModel = !isClear
|
|
1280
1584
|
? row[valueSourceField]
|
|
1281
1585
|
: null; */
|
|
1282
|
-
let value = !isClear
|
|
1283
|
-
|
|
1284
|
-
: null
|
|
1285
|
-
this.setValue(value)
|
|
1586
|
+
let value = !isClear ? row[valueSourceField] : null;
|
|
1587
|
+
this.setValue(value);
|
|
1286
1588
|
if (labelSourceField) {
|
|
1287
|
-
this.setShowValue(
|
|
1288
|
-
!isClear ? row[labelSourceField] : null
|
|
1289
|
-
);
|
|
1589
|
+
this.setShowValue(!isClear ? row[labelSourceField] : null);
|
|
1290
1590
|
}
|
|
1291
1591
|
tableData.forEach((item) => {
|
|
1292
1592
|
// formModel[item.targetField] = row[item.sourceField]
|
|
1293
1593
|
let value = !isClear ? row[item.sourceField] ?? null : null;
|
|
1294
|
-
let targetField = trim(item.targetField)
|
|
1295
|
-
let targetFormField = trim(item.targetFormField)
|
|
1594
|
+
let targetField = trim(item.targetField);
|
|
1595
|
+
let targetFormField = trim(item.targetFormField);
|
|
1296
1596
|
if (targetField) {
|
|
1297
1597
|
this.getWidgetRef(targetField).setValue(value);
|
|
1298
1598
|
} else if (targetFormField) {
|
|
@@ -1307,8 +1607,10 @@ modules = {
|
|
|
1307
1607
|
let addRows = rows.map((rowData) => {
|
|
1308
1608
|
let itemData = {};
|
|
1309
1609
|
tableData.forEach((item) => {
|
|
1310
|
-
let targetFormField = trim(
|
|
1311
|
-
|
|
1610
|
+
let targetFormField = trim(
|
|
1611
|
+
item.targetFormField || item.targetField
|
|
1612
|
+
);
|
|
1613
|
+
let sourceField = trim(item.sourceField);
|
|
1312
1614
|
itemData[targetFormField] = rowData[sourceField];
|
|
1313
1615
|
});
|
|
1314
1616
|
return itemData;
|
|
@@ -1320,18 +1622,16 @@ modules = {
|
|
|
1320
1622
|
);
|
|
1321
1623
|
} else if (!multipleChoices) {
|
|
1322
1624
|
tableData.forEach((item) => {
|
|
1323
|
-
let value = row[item.sourceField] ?? null;
|
|
1625
|
+
let value = !isClear && row ? row[item.sourceField] ?? null : null;
|
|
1324
1626
|
// formModel[item.targetField] = value
|
|
1325
1627
|
// this.getWidgetRef(item.targetField).setValue(value);
|
|
1326
|
-
let targetField = trim(item.targetField)
|
|
1327
|
-
let targetFormField = trim(item.targetFormField)
|
|
1628
|
+
let targetField = trim(item.targetField);
|
|
1629
|
+
let targetFormField = trim(item.targetFormField);
|
|
1328
1630
|
if (targetField) {
|
|
1329
1631
|
this.getWidgetRef(targetField).setValue(value);
|
|
1330
1632
|
} else if (targetFormField) {
|
|
1331
1633
|
formModel[targetFormField] = value;
|
|
1332
1634
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
1635
|
});
|
|
1336
1636
|
// this.$forceUpdate();
|
|
1337
1637
|
}
|
|
@@ -1360,26 +1660,26 @@ modules = {
|
|
|
1360
1660
|
let i = this.refList[e];
|
|
1361
1661
|
return (
|
|
1362
1662
|
!i &&
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1663
|
+
t &&
|
|
1664
|
+
this.$message.error(this.i18nt("render.hint.refNotFound") + e),
|
|
1665
|
+
i
|
|
1366
1666
|
);
|
|
1367
1667
|
},
|
|
1368
1668
|
getFieldEditor: function () {
|
|
1369
1669
|
return this.$refs["fieldEditor"];
|
|
1370
1670
|
},
|
|
1371
1671
|
initValue: function (e) {
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1672
|
+
let value = e ?? null;
|
|
1673
|
+
let currentData =
|
|
1674
|
+
this.tableParam && this.tableParam.row
|
|
1675
|
+
? this.tableParam.row
|
|
1676
|
+
: this.formModel;
|
|
1677
|
+
if (void 0 === currentData[this.fieldKeyName]) {
|
|
1678
|
+
this.$set(currentData, this.fieldKeyName, null);
|
|
1679
|
+
}
|
|
1680
|
+
this.fieldModel = value;
|
|
1681
|
+
this.initFileList();
|
|
1682
|
+
this.syncUpdateFormModel(value);
|
|
1383
1683
|
},
|
|
1384
1684
|
setValue: function (e) {
|
|
1385
1685
|
if (this.field.formItemFlag) {
|
|
@@ -1407,10 +1707,10 @@ modules = {
|
|
|
1407
1707
|
if (!this.subFormItemFlag) {
|
|
1408
1708
|
let e = this.field.options.defaultValue;
|
|
1409
1709
|
this.setValue(e),
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1710
|
+
("picture-upload" !== this.field.type &&
|
|
1711
|
+
"file-upload" !== this.field.type) ||
|
|
1712
|
+
(this.$refs["fieldEditor"].clearFiles(),
|
|
1713
|
+
this.fileList.splice(0, this.fileList.length));
|
|
1414
1714
|
}
|
|
1415
1715
|
},
|
|
1416
1716
|
setWidgetOption: function (e, t) {
|
|
@@ -1443,23 +1743,29 @@ modules = {
|
|
|
1443
1743
|
},
|
|
1444
1744
|
focus: function () {
|
|
1445
1745
|
this.getFieldEditor() &&
|
|
1446
|
-
|
|
1447
|
-
|
|
1746
|
+
this.getFieldEditor().focus &&
|
|
1747
|
+
this.getFieldEditor().focus();
|
|
1448
1748
|
},
|
|
1449
1749
|
clearSelectedOptions: function () {
|
|
1450
1750
|
("checkbox" !== this.field.type &&
|
|
1451
1751
|
"radio" !== this.field.type &&
|
|
1452
1752
|
"select" !== this.field.type) ||
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
},
|
|
1458
|
-
getOptionItemValueKey(){
|
|
1459
|
-
|
|
1753
|
+
("checkbox" === this.field.type ||
|
|
1754
|
+
("select" === this.field.type && this.field.options.multiple)
|
|
1755
|
+
? (this.fieldModel = [])
|
|
1756
|
+
: (this.fieldModel = ""));
|
|
1757
|
+
},
|
|
1758
|
+
getOptionItemValueKey() {
|
|
1759
|
+
if (this.field.options.commonAttributeEnabled) {
|
|
1760
|
+
return this.field.options.valueKey || "sn";
|
|
1761
|
+
}
|
|
1762
|
+
return this.field.options.valueKey || "value";
|
|
1460
1763
|
},
|
|
1461
|
-
getOptionItemLabelKey(){
|
|
1462
|
-
|
|
1764
|
+
getOptionItemLabelKey() {
|
|
1765
|
+
if (this.field.options.commonAttributeEnabled) {
|
|
1766
|
+
return this.field.options.labelKey || "value";
|
|
1767
|
+
}
|
|
1768
|
+
return this.field.options.labelKey || "label";
|
|
1463
1769
|
},
|
|
1464
1770
|
loadRowGloatOptions: function (e) {
|
|
1465
1771
|
let optionItems = baseRefUtil.translateOptionItems(
|
|
@@ -1469,10 +1775,9 @@ modules = {
|
|
|
1469
1775
|
this.getOptionItemValueKey()
|
|
1470
1776
|
);
|
|
1471
1777
|
// this.field.options.optionItems = optionItems
|
|
1472
|
-
this.setOptionItems(optionItems)
|
|
1778
|
+
this.setOptionItems(optionItems);
|
|
1473
1779
|
},
|
|
1474
1780
|
loadOptions: function (e, rowOptionFlag) {
|
|
1475
|
-
debugger
|
|
1476
1781
|
let optionItems = baseRefUtil.translateOptionItems(
|
|
1477
1782
|
e,
|
|
1478
1783
|
this.field.type,
|
|
@@ -1480,18 +1785,18 @@ modules = {
|
|
|
1480
1785
|
this.getOptionItemValueKey()
|
|
1481
1786
|
);
|
|
1482
1787
|
// this.field.options.optionItems = optionItems
|
|
1483
|
-
this.setOptionItems(optionItems)
|
|
1788
|
+
this.setOptionItems(optionItems);
|
|
1484
1789
|
},
|
|
1485
1790
|
getOptionKey() {
|
|
1486
|
-
let key = "optionItems-" + this.field.options.name
|
|
1791
|
+
let key = "optionItems-" + this.field.options.name;
|
|
1487
1792
|
return key;
|
|
1488
1793
|
},
|
|
1489
1794
|
getOptionItemsFlag: function () {
|
|
1490
|
-
let key = this.getOptionKey()
|
|
1795
|
+
let key = this.getOptionKey();
|
|
1491
1796
|
return this.getGlobalParam(key);
|
|
1492
1797
|
},
|
|
1493
1798
|
setOptionItemsFlag: function (flag) {
|
|
1494
|
-
let key = this.getOptionKey()
|
|
1799
|
+
let key = this.getOptionKey();
|
|
1495
1800
|
return this.setGlobalParam(key, flag);
|
|
1496
1801
|
},
|
|
1497
1802
|
reloadOptions: function (e) {
|
|
@@ -1502,7 +1807,7 @@ modules = {
|
|
|
1502
1807
|
this.getOptionItemValueKey()
|
|
1503
1808
|
);
|
|
1504
1809
|
// this.field.options.optionItems = optionItems;
|
|
1505
|
-
this.setOptionItems(optionItems)
|
|
1810
|
+
this.setOptionItems(optionItems);
|
|
1506
1811
|
},
|
|
1507
1812
|
getOptions: function () {
|
|
1508
1813
|
return this.getOptionItems();
|
|
@@ -1548,7 +1853,7 @@ modules = {
|
|
|
1548
1853
|
this.field.options.customClass.map(function (i, n) {
|
|
1549
1854
|
i === e && (t = n);
|
|
1550
1855
|
}),
|
|
1551
|
-
|
|
1856
|
+
t > -1 && this.field.options.customClass.splice(t, 1);
|
|
1552
1857
|
}
|
|
1553
1858
|
},
|
|
1554
1859
|
async initAccess() {
|
|
@@ -1571,10 +1876,21 @@ modules = {
|
|
|
1571
1876
|
if (!dsModel.headers) dsModel.headers = [];
|
|
1572
1877
|
if (!dsModel.params) dsModel.params = [];
|
|
1573
1878
|
if (!dsModel.data) dsModel.data = [];
|
|
1574
|
-
if (
|
|
1575
|
-
|
|
1879
|
+
if (
|
|
1880
|
+
dsModel.dataHandlerCode === null ||
|
|
1881
|
+
dsModel.dataHandlerCode === undefined
|
|
1882
|
+
)
|
|
1883
|
+
dsModel.dataHandlerCode = "";
|
|
1884
|
+
if (
|
|
1885
|
+
dsModel.configHandlerCode === null ||
|
|
1886
|
+
dsModel.configHandlerCode === undefined
|
|
1887
|
+
)
|
|
1576
1888
|
dsModel.configHandlerCode = "";
|
|
1577
|
-
if (
|
|
1889
|
+
if (
|
|
1890
|
+
dsModel.errorHandlerCode === null ||
|
|
1891
|
+
dsModel.errorHandlerCode === undefined
|
|
1892
|
+
)
|
|
1893
|
+
dsModel.errorHandlerCode = "";
|
|
1578
1894
|
|
|
1579
1895
|
requestAccess.dsModel = dsModel;
|
|
1580
1896
|
this.requestAccess = requestAccess;
|
|
@@ -1614,13 +1930,6 @@ modules = {
|
|
|
1614
1930
|
},
|
|
1615
1931
|
});
|
|
1616
1932
|
},
|
|
1617
|
-
autoExcScript() {
|
|
1618
|
-
if (!this.designState && this.field.options.accessAutoExc) {
|
|
1619
|
-
this.scriptHttp({
|
|
1620
|
-
options: this.field.options,
|
|
1621
|
-
});
|
|
1622
|
-
}
|
|
1623
|
-
},
|
|
1624
1933
|
addInterval(handler, timeout) {
|
|
1625
1934
|
let timer = setInterval(handler, timeout);
|
|
1626
1935
|
this.timerMap[timer] = timer;
|
|
@@ -1656,13 +1965,12 @@ modules = {
|
|
|
1656
1965
|
showAText() {
|
|
1657
1966
|
this.widgetTextFlag = 3;
|
|
1658
1967
|
},
|
|
1659
|
-
getAuthCode(){
|
|
1968
|
+
getAuthCode() {
|
|
1660
1969
|
let formRef = this.getFormRef();
|
|
1661
|
-
if(formRef){
|
|
1970
|
+
if (formRef) {
|
|
1662
1971
|
return formRef.reportTemplate.formCode + ":" + this.field.options.name;
|
|
1663
1972
|
}
|
|
1664
|
-
|
|
1665
|
-
}
|
|
1973
|
+
},
|
|
1666
1974
|
},
|
|
1667
1975
|
};
|
|
1668
1976
|
|