cloud-web-corejs 1.0.54-dev.63 → 1.0.54-dev.630
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 +21 -13
- package/src/App.vue +30 -34
- package/src/api/user.js +16 -0
- package/src/components/Qrcode/fileParse.vue +0 -1
- package/src/components/Tinymce/index.vue +112 -71
- package/src/components/VabUpload/image-viewer.vue +2 -2
- package/src/components/VabUpload/index.js +49 -1
- package/src/components/VabUpload/mixins.js +1822 -2
- package/src/components/VabUpload/propertiesDialog.vue +1 -1
- package/src/components/VabUpload/view.vue +209 -120
- package/src/components/advancedSearchDialog/mixins.js +28 -1
- package/src/components/base-textarea/index.vue +104 -0
- package/src/components/baseAlert/index.js +44 -1
- package/src/components/baseAlert/index.vue +24 -20
- package/src/components/baseAlert/mixins.js +61 -1
- package/src/components/baseAttachment/index.vue +49 -40
- package/src/components/baseAttachment/install.js +21 -5
- package/src/components/baseAttachment/mixins.js +310 -1
- package/src/components/baseInputBatch/mixins.js +58 -1
- package/src/components/baseInputExport/index.vue +21 -14
- package/src/components/baseInputExport/mixins.js +391 -1
- package/src/components/baseTabs/index.vue +16 -8
- package/src/components/baseTabs/mixins.js +166 -1
- package/src/components/cnPrint/index.js +44 -1
- package/src/components/cnPrint/mixins.js +189 -1
- package/src/components/code-editor/index.vue +102 -63
- package/src/components/confirmDialog/index.js +41 -1
- package/src/components/confirmDialog/index.vue +24 -17
- package/src/components/confirmDialog/mixins.js +31 -1
- package/src/components/errorMsg/index.js +44 -1
- package/src/components/errorMsg/index.vue +78 -70
- package/src/components/errorMsg/mixins.js +101 -5
- package/src/components/excelExport/button.vue +86 -24
- package/src/components/excelExport/exportFieldDialog.vue +215 -81
- package/src/components/excelExport/index.js +6 -6
- package/src/components/excelExport/index.vue +108 -26
- package/src/components/excelExport/mixins.js +970 -2
- package/src/components/excelImport/index.js +13 -13
- package/src/components/excelImport/mixins.js +2 -1
- package/src/components/fileLibrary/fileObjAuthDialog.vue +179 -89
- package/src/components/fileLibrary/fileObjAuthEditDialog.vue +6 -0
- package/src/components/fileLibrary/filterDialog.vue +454 -0
- package/src/components/fileLibrary/index.vue +605 -262
- package/src/components/fileLibrary/mixins/categoryMoveDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileCategoryDialogMixins.js +1 -1
- package/src/components/fileLibrary/mixins/fileHistoryDialogMixins.js +2 -2
- package/src/components/fileLibrary/mixins/fileObjAuthDialogMixin.js +339 -211
- package/src/components/fileLibrary/mixins/fileObjAuthEditDialogMixin.js +31 -27
- package/src/components/fileLibrary/mixins/fileObjAuthEditMixin.js +4 -4
- package/src/components/fileLibrary/mixins/indexMixins.js +220 -101
- package/src/components/fileLibrary/mixins/propertiesDialogMixins.js +64 -4
- package/src/components/fileLibrary/mixins/recycleBinDialogMixins.js +3 -3
- package/src/components/fileLibrary/propertiesDialog.vue +113 -74
- package/src/components/fileLibrary/shareDialog.vue +1 -1
- package/src/components/formOplog/mixins.js +85 -4
- package/src/components/hiprint/css/bootstrap.min.css +6 -0
- package/src/components/hiprint/fonts/glyphicons-halflings-regular.eot +0 -0
- package/src/components/hiprint/fonts/glyphicons-halflings-regular.svg +288 -0
- package/src/components/hiprint/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff +0 -0
- package/src/components/hiprint/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/src/components/hiprint/hiprint.bundle.js +7 -2
- package/src/components/hiprint/view/design/index.vue +140 -47
- package/src/components/hiprint/view/design/mixins.js +611 -1
- package/src/components/hiprint/view/design/preview.vue +75 -52
- package/src/components/hiprint/view/json-view.vue +31 -31
- package/src/components/jdPrint/index.js +44 -1
- package/src/components/jdPrint/mixins.js +208 -1
- package/src/components/jsonImport/index.js +187 -17
- package/src/components/jsonImport/mixins.js +333 -1
- package/src/components/langImport/index.js +80 -1
- package/src/components/langImport/mixins.js +500 -16
- package/src/components/langTag/mixins/addButton.js +51 -5
- package/src/components/langTag/mixins/deleteButton.js +55 -5
- package/src/components/langTag/mixins/view.js +47 -5
- package/src/components/luckysheet/dialog.vue +159 -0
- package/src/components/luckysheet/export.js +595 -0
- package/src/components/luckysheet/fileUtils.js +147 -0
- package/src/components/luckysheet/index.js +72 -0
- package/src/components/luckysheet/templateJson.js +12078 -0
- package/src/components/luckysheet/view.vue +210 -0
- package/src/components/obsUpload/index.js +34 -0
- package/src/components/obsUpload/index.vue +231 -0
- package/src/components/obsUpload/mixins.js +1476 -0
- package/src/components/onlineTalk/mixins.js +852 -1
- package/src/components/oplogTable/mixins.js +83 -4
- package/src/components/pddPrint/index.js +44 -1
- package/src/components/pddPrint/mixins.js +252 -1
- package/src/components/projectTag/mixins/addButton.js +52 -1
- package/src/components/projectTag/mixins/deleteButton.js +52 -1
- package/src/components/projectTag/mixins/view.js +43 -1
- package/src/components/scriptDescription/button.vue +12 -4
- package/src/components/scriptDescription/mixins.js +30 -1
- package/src/components/scriptTest/mixins.js +90 -1
- package/src/components/statusTag/mixins.js +66 -1
- package/src/components/table/CellSlot.vue +1 -0
- package/src/components/table/config.js +74 -1
- package/src/components/table/index.js +1156 -11
- package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js +11028 -0
- package/src/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css +200 -0
- package/src/components/table/tableForm.vue +99 -63
- package/src/components/table/tableFormMixin.js +285 -1
- package/src/components/table/util/index.js +339 -0
- package/src/components/table/vxeFilter/index.js +154 -1
- package/src/components/table/vxeFilter/mixin.js +308 -6
- package/src/components/tempStorage/index.vue +76 -55
- package/src/components/tempStorage/tempStorageDialog.vue +179 -54
- package/src/components/vb-tabs/x-tabs.vue +56 -30
- package/src/components/vipPrint/index.js +44 -1
- package/src/components/vipPrint/mixins.js +268 -1
- package/src/components/wf/addOpinionButton.vue +57 -0
- package/src/components/wf/content.vue +834 -362
- package/src/components/wf/mixins/addOpinionButton.js +53 -0
- package/src/components/wf/mixins/setCandidateButton.js +161 -0
- package/src/components/wf/mixins/setCandidateDialog.js +213 -1
- package/src/components/wf/mixins/setCandidateDialog2.js +252 -0
- package/src/components/wf/mixins/wfFlowEleScriptDialog.js +131 -0
- package/src/components/wf/mixins/wfTaskUserRangeDialog.js +69 -0
- package/src/components/wf/setCandidateButton.vue +40 -0
- package/src/components/wf/setCandidateDialog.vue +10 -0
- package/src/components/wf/setCandidateDialog2.vue +105 -0
- package/src/components/wf/wf.js +2156 -1
- package/src/components/wf/wfFlowEleScriptDialog.vue +89 -0
- package/src/components/wf/wfStartDialog.vue +66 -42
- package/src/components/wf/wfTaskUserRangeDialog.vue +65 -0
- package/src/components/wf/wfUtil.js +279 -1
- package/src/components/xform/form-designer/designer.js +1995 -9
- package/src/components/xform/form-designer/form-widget/components/gantt/index.vue +434 -0
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +1 -1
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +9 -8
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +4 -1
- package/src/components/xform/form-designer/form-widget/container-widget/detail-pane-widget.vue +3 -2
- package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +3 -3
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog copy.vue +971 -0
- package/src/components/xform/form-designer/form-widget/dialog/baseFormulaDialog.vue +971 -0
- package/src/components/xform/form-designer/form-widget/dialog/exportDialog.vue +13 -0
- package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +301 -0
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +85 -48
- package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +5 -1
- package/src/components/xform/form-designer/form-widget/dialog/formulaDialog.vue +799 -0
- package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +30 -7
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1762 -9
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +222 -75
- package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +2 -2
- package/src/components/xform/form-designer/form-widget/field-widget/a-text-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +32 -4
- package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +19 -1
- package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +40 -28
- package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +18 -7
- package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +4 -1
- package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +95 -0
- package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +13 -2
- package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +30 -4
- package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +133 -0
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +86 -0
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +170 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +25 -997
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +705 -379
- package/src/components/xform/form-designer/form-widget/field-widget/gantt-widget.vue +964 -0
- package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +6 -2
- package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +22 -11
- package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +90 -0
- package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +7 -2
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +40 -10
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +58 -91
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +8 -1
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +179 -0
- package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +53 -0
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +114 -81
- package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +186 -0
- package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +55 -28
- package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +119 -0
- package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +154 -47
- package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +26 -6
- package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +2 -2
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +86 -0
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +92 -0
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +24 -9
- package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +53 -0
- package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -0
- package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +12 -1
- package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +8 -3
- package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +31 -17
- package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +38 -37
- package/src/components/xform/form-designer/form-widget/field-widget/tableexportbuttonwidget.vue +99 -0
- package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +147 -0
- package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +106 -33
- package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +2 -2
- package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +3 -171
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +191 -66
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +753 -0
- package/src/components/xform/form-designer/form-widget/indexMixin.js +1 -1
- package/src/components/xform/form-designer/indexMixin.js +3 -772
- package/src/components/xform/form-designer/refMixinDesign.js +1 -28
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +981 -172
- package/src/components/xform/form-designer/setting-panel/index.vue +4 -0
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +1 -1
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +537 -302
- package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/autoValueEnabled-editor.vue +38 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +6 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +28 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +41 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +125 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +956 -1042
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/exportItemColumns-dialog.vue +432 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/onCheckboxChange-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +1193 -520
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-pane/detail-pane-editor.vue +3 -3
- 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-list-h5/list-h5-editor.vue +0 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +31 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/copyButton-editor.vue +36 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +32 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +133 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin.js +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onAfterConfirmFile-editor.vue +5 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onClick-editor.vue +23 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +35 -20
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +64 -5
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-item-editor.vue +21 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +25 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +5 -5
- package/src/components/xform/form-designer/setting-panel/property-editor/field-gantt/gantt-editor.vue +36 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +77 -20
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +96 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +44 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -0
- 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-static-text/preWrap-editor.vue +23 -0
- 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 +67 -41
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +56 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +71 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +24 -8
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +13 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +33 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +66 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +89 -19
- package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +137 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +721 -466
- package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +20 -11
- package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-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/labelTooltip-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/multiple-editor.vue +19 -14
- 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 +126 -50
- package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
- 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/project-tag-editor.vue +349 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/required-editor.vue +10 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/showRuleFlag-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +42 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +305 -19
- package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/wfFlag-editor.vue +372 -50
- package/src/components/xform/form-designer/setting-panel/property-editor/widgetShowRuleFlag-editor.vue +263 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +33 -11
- package/src/components/xform/form-designer/toolbar-panel/index.vue +12 -11
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -1
- package/src/components/xform/form-designer/widget-panel/index.vue +21 -1
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +19 -18
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1729 -918
- package/src/components/xform/form-render/container-item/containerItemMixin.js +12 -11
- package/src/components/xform/form-render/container-item/data-table-item.vue +206 -198
- package/src/components/xform/form-render/container-item/data-table-mixin.js +3326 -1685
- package/src/components/xform/form-render/container-item/detail-item.vue +72 -48
- package/src/components/xform/form-render/container-item/detail-pane-item.vue +17 -3
- package/src/components/xform/form-render/container-item/grid-col-item.vue +10 -3
- package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
- package/src/components/xform/form-render/container-item/list-h5-item.vue +1 -9
- package/src/components/xform/form-render/container-item/list-h5-item2.vue +1 -8
- package/src/components/xform/form-render/container-item/tab-item.vue +62 -25
- package/src/components/xform/form-render/container-item/table-cell-item.vue +38 -32
- package/src/components/xform/form-render/container-item/table-item.vue +4 -2
- package/src/components/xform/form-render/container-item/table2-cell-item.vue +53 -34
- package/src/components/xform/form-render/container-item/table2-item.vue +167 -92
- package/src/components/xform/form-render/container-item/tree-item.vue +32 -11
- package/src/components/xform/form-render/dynamicDialogRender.js +1 -1
- package/src/components/xform/form-render/index.vue +77 -20
- package/src/components/xform/form-render/indexMixin.js +3719 -12
- package/src/components/xform/form-render/refMixin.js +3 -3
- package/src/components/xform/lang/zh-CN.js +29 -4
- package/src/components/xform/mixins/defaultHandle.js +367 -2
- package/src/components/xform/mixins/scriptHttp.js +3 -1
- package/src/components/xform/utils/emitter.js +4 -4
- package/src/components/xform/utils/formHttp.js +162 -0
- package/src/components/xform/utils/format.js +41 -34
- package/src/components/xform/utils/formula-util.js +969 -0
- package/src/components/xform/utils/smart-vue-i18n/index.js +2 -1
- package/src/components/xform/utils/util.js +1475 -1
- package/src/components/xform/utils/validators.js +2 -5
- package/src/components/xform/utils/vue2js-generator.js +2 -2
- package/src/components/xhsPrint/index.js +44 -1
- package/src/components/xhsPrint/mixins.js +269 -1
- package/src/directive/LimitNumber/index.js +125 -1
- package/src/directive/el-dialog-center/index.js +34 -1
- package/src/directive/el-drag-dialog/drag.js +86 -1
- package/src/directive/el-readonly/index.js +15 -1
- package/src/directive/permission/hasPermi.js +34 -1
- package/src/index.js +215 -190
- package/src/lang/index.js +56 -51
- package/src/lang/locale/en/login.js +20 -0
- package/src/lang/locale/zh/login.js +20 -0
- package/src/layout/components/AppMain.vue +8 -1
- package/src/layout/components/Sidebar/default.vue +1432 -1222
- package/src/layout/components/Sidebar/index.vue +6 -1
- package/src/layout/components/TagsView/index.vue +43 -12
- package/src/layout/components/createCompany/createCompanyDialog.vue +157 -0
- package/src/layout/components/extractedCode/createDialog.vue +92 -0
- package/src/layout/components/extractedCode/queryDialog.vue +103 -0
- package/src/layout/components/extractedCode/viewDialog.vue +207 -0
- package/src/layout/components/langTool.vue +32 -29
- package/src/layout/components/watermark/index.vue +83 -0
- package/src/layout/defaultLayout.vue +17 -9
- package/src/mixins/selectDialog/index.js +266 -1
- package/src/mixins/tableTree/index.js +199 -4
- package/src/mixins/wf/index.js +33 -1
- package/src/permission.js +135 -18
- package/src/resources/js/base/common.js +109 -109
- package/src/router/modules/customer.js +0 -15
- package/src/router/modules/system.js +4 -0
- package/src/store/config/index.js +667 -1
- package/src/store/getters.js +4 -1
- package/src/store/modules/permission.js +46 -41
- package/src/store/modules/settings.js +1 -1
- package/src/store/modules/tagsView.js +5 -8
- package/src/store/modules/user.js +367 -16
- package/src/utils/aes.js +2 -1
- package/src/utils/auth.js +1 -1
- package/src/utils/global.js +1 -1
- package/src/utils/index.js +2 -3
- package/src/utils/keepAlive.js +1 -1
- package/src/utils/pddLog.js +92 -0
- package/src/utils/pdfUtil.js +71 -0
- package/src/utils/request.js +1 -1
- package/src/utils/vab.js +1268 -27
- package/src/utils/validate.js +1 -1
- package/src/utils/wf.js +4 -4
- package/src/views/bd/setting/bd_attach_setting/edit.vue +5 -5
- package/src/views/bd/setting/bd_attach_setting/list.vue +28 -55
- package/src/views/bd/setting/bd_attach_setting/mixins/dialog.js +84 -1
- package/src/views/bd/setting/bd_attach_setting/mixins/edit.js +116 -5
- package/src/views/bd/setting/bd_attach_setting/mixins/list.js +239 -1
- package/src/views/bd/setting/bd_company_env/dialog.vue +174 -0
- package/src/views/bd/setting/bd_company_env/edit.vue +193 -0
- package/src/views/bd/setting/bd_company_env/list.vue +175 -0
- package/src/views/bd/setting/config_manage/list.vue +83 -0
- package/src/views/bd/setting/formVersion/button.vue +55 -0
- package/src/views/bd/setting/formVersion/compareDialog.vue +287 -0
- package/src/views/bd/setting/formVersion/fieldCompare.vue +54 -0
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +400 -0
- package/src/views/bd/setting/formVersion/link.vue +58 -0
- package/src/views/bd/setting/formVersion/preformDialog.vue +86 -0
- package/src/views/bd/setting/formVersion/reverButton.vue +82 -0
- package/src/views/bd/setting/form_import_log/edit.vue +130 -0
- package/src/views/bd/setting/form_import_log/list.vue +211 -0
- package/src/views/bd/setting/form_script/edit.vue +196 -74
- package/src/views/bd/setting/form_script/edit1.vue +410 -187
- package/src/views/bd/setting/form_script/form_list.vue +118 -37
- package/src/views/bd/setting/form_script/list.vue +90 -21
- package/src/views/bd/setting/form_script/list1.vue +200 -118
- package/src/views/bd/setting/form_script/mixins/dialog.js +130 -1
- package/src/views/bd/setting/form_script/mixins/edit.js +265 -7
- package/src/views/bd/setting/form_script/mixins/edit1.js +259 -9
- package/src/views/bd/setting/form_script/mixins/form_list.js +322 -14
- package/src/views/bd/setting/form_script/mixins/list.js +278 -4
- package/src/views/bd/setting/form_script/mixins/list1.js +480 -14
- package/src/views/bd/setting/form_script/mixins/list2.js +10 -1
- package/src/views/bd/setting/form_script/mixins/otherAuthDialog.js +194 -0
- package/src/views/bd/setting/form_script/mixins/preformDialog.js +34 -1
- package/src/views/bd/setting/form_script/otherAuthDialog.vue +83 -0
- package/src/views/bd/setting/form_template/batchWfObjConfigDialog.vue +2 -2
- package/src/views/bd/setting/form_template/edit.vue +355 -184
- package/src/views/bd/setting/form_template/editWfObjConfigDialog.vue +2 -2
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +171 -0
- package/src/views/bd/setting/form_template/list.vue +296 -214
- package/src/views/bd/setting/form_template/mixins/batchWfObjConfigDialog.js +11 -9
- package/src/views/bd/setting/form_template/mixins/dialog.js +103 -1
- package/src/views/bd/setting/form_template/mixins/edit.js +277 -9
- package/src/views/bd/setting/form_template/mixins/editWfObjConfigDialog.js +92 -1
- package/src/views/bd/setting/form_template/mixins/ftHistoryDialog.js +91 -1
- package/src/views/bd/setting/form_template/mixins/itemEdit.js +104 -1
- package/src/views/bd/setting/form_template/mixins/itemList.js +234 -1
- package/src/views/bd/setting/form_template/mixins/list.js +672 -22
- package/src/views/bd/setting/form_template/mixins/list2.js +411 -0
- package/src/views/bd/setting/form_template/mixins/otherAuthDialog.js +193 -0
- package/src/views/bd/setting/form_template/mixins/preformDialog.js +28 -3
- package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -7
- package/src/views/bd/setting/form_template/otherAuthDialog.vue +83 -0
- package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +4 -4
- package/src/views/bd/setting/form_template/wf_list.vue +161 -127
- package/src/views/bd/setting/logic_param/edit.vue +146 -0
- package/src/views/bd/setting/logic_param/edit1.vue +106 -0
- package/src/views/bd/setting/logic_param/edit2.vue +139 -0
- package/src/views/bd/setting/logic_param/list.vue +74 -0
- package/src/views/bd/setting/logic_param/list1.vue +12 -0
- package/src/views/bd/setting/logic_param/list2.vue +12 -0
- package/src/views/bd/setting/logic_param/mixins/edit.js +93 -0
- package/src/views/bd/setting/logic_param/mixins/list.js +376 -0
- package/src/views/bd/setting/menu_kind/list.vue +172 -83
- package/src/views/bd/setting/menu_kind/mixins/authDialog.js +300 -7
- package/src/views/bd/setting/menu_kind/mixins/dialog.js +139 -1
- package/src/views/bd/setting/menu_kind/mixins/list.js +201 -1
- package/src/views/bd/setting/push_data/edit.vue +139 -0
- package/src/views/bd/setting/push_data/list.vue +283 -0
- package/src/views/bd/setting/push_data_h/edit.vue +153 -0
- package/src/views/bd/setting/push_data_h/list.vue +293 -0
- package/src/views/bd/setting/request_async_setting/edit.vue +320 -0
- package/src/views/bd/setting/request_async_setting/list.vue +372 -0
- package/src/views/bd/setting/request_setting/edit.vue +300 -0
- package/src/views/bd/setting/request_setting/list.vue +311 -0
- package/src/views/bd/setting/table_model/edit.vue +1073 -426
- package/src/views/bd/setting/table_model/list.vue +213 -128
- package/src/views/bd/setting/table_model/mixins/dialog.js +71 -1
- package/src/views/bd/setting/table_model/mixins/edit.js +1284 -13
- package/src/views/bd/setting/table_model/mixins/list.js +441 -14
- package/src/views/bd/setting/table_model/mixins/otherAuthDialog.js +201 -0
- package/src/views/bd/setting/table_model/mixins/zdDialog.js +108 -1
- package/src/views/bd/setting/table_model/otherAuthDialog.vue +83 -0
- package/src/views/bd/setting/utils/index.js +60 -1
- package/src/views/user/access_log/list.vue +418 -349
- package/src/views/user/area/dialog.vue +223 -117
- package/src/views/user/area/list.vue +318 -0
- package/src/views/user/bill_setting/edit.vue +1 -1
- package/src/views/user/bill_setting/list.vue +1 -1
- package/src/views/user/common_attribute/itemEdit.vue +2 -2
- package/src/views/user/common_attribute/list.vue +5 -2
- package/src/views/user/common_script/edit.vue +1 -1
- package/src/views/user/common_script/list.vue +1 -1
- package/src/views/user/company_info/dialog.vue +195 -163
- package/src/views/user/company_info/edit.vue +1 -1
- package/src/views/user/extend_datasource/dialog.vue +3 -0
- package/src/views/user/extend_datasource/edit.vue +2 -1
- package/src/views/user/extend_datasource/list.vue +3 -0
- package/src/views/user/fieldTranslation/editDialog.vue +8 -8
- package/src/views/user/fieldTranslation/list.vue +33 -33
- package/src/views/user/form/vform/designer.vue +790 -749
- package/src/views/user/form/vform/out_render.vue +1 -1
- package/src/views/user/form/vform/render.vue +67 -37
- package/src/views/user/form/view/edit.vue +38 -37
- package/src/views/user/form/view/list.vue +270 -49
- package/src/views/user/home/default.vue +1026 -979
- package/src/views/user/home/dev.vue +29 -0
- package/src/views/user/home/index.vue +18 -7
- package/src/views/user/login/default.vue +165 -36
- package/src/views/user/login/index.vue +4 -6
- package/src/views/user/login/indexMixin.js +186 -9
- package/src/views/user/menu/list.vue +27 -1
- package/src/views/user/notify_message/dialog.vue +44 -22
- package/src/views/user/notify_template/edit.vue +188 -187
- package/src/views/user/notify_template/edit2.vue +176 -0
- package/src/views/user/notify_template/list.vue +4 -1
- package/src/views/user/notify_template/list2.vue +190 -0
- package/src/views/user/outLink/form_view.vue +211 -211
- package/src/views/user/outLink/index.vue +67 -11
- package/src/views/user/position/list.vue +4 -4
- package/src/views/user/project_tag/dialog.vue +9 -4
- package/src/views/user/project_tag/edit.vue +2 -2
- package/src/views/user/project_tag/list.vue +9 -4
- package/src/views/user/push_setting/list.vue +2 -2
- package/src/views/user/request_setting/edit.vue +258 -0
- package/src/views/user/request_setting/list.vue +248 -0
- package/src/views/user/role/authConfig.vue +89 -0
- package/src/views/user/role/dialog.vue +70 -48
- package/src/views/user/role/edit.vue +609 -429
- package/src/views/user/role/list.vue +4 -4
- package/src/views/user/sale_org/dialog.vue +1 -1
- package/src/views/user/sale_org/list.vue +4 -1
- package/src/views/user/system_notice/infoDialog.vue +2 -1
- package/src/views/user/user/dialog.vue +46 -23
- package/src/views/user/user/edit.vue +1338 -1021
- package/src/views/user/user/form_dialog.vue +158 -0
- package/src/views/user/user/form_info.vue +210 -0
- package/src/views/user/user/info.vue +253 -140
- package/src/views/user/user/list.vue +652 -563
- package/src/views/user/user/modifyPasswordDialog.vue +64 -53
- package/src/views/user/wf/wfReport/index.vue +619 -0
- package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -0
- package/src/views/user/wf/wf_manage/list.vue +379 -250
- package/src/views/user/wf/wf_manage/wfContentDialog.vue +25 -22
- package/src/views/user/wf/wf_obj_config/importItemDialog.vue +109 -0
- package/src/views/user/wf/wf_obj_config/itemEdit.vue +25 -1
- package/src/views/user/wf/wf_obj_config/list.vue +114 -9
- package/src/views/user/wf/wf_obj_config/wfBizDataSettingDialog.vue +2 -2
- package/src/views/user/wf/wf_transfer_setting/edit.vue +282 -0
- package/src/views/user/wf/wf_transfer_setting/list.vue +319 -0
- package/src/views/user/workbench_menu/list.vue +555 -0
- package/src/utils/renderUtils.js +0 -76
|
@@ -1,1685 +1,3326 @@
|
|
|
1
|
-
import emitter from
|
|
2
|
-
import i18n from
|
|
3
|
-
import refMixin from
|
|
4
|
-
import containerItemMixin from
|
|
5
|
-
|
|
6
|
-
import * as formatUtil from
|
|
7
|
-
import tableConfig from
|
|
8
|
-
import {extendDeeply} from "../../../../utils/index.js";
|
|
9
|
-
import {
|
|
10
|
-
assembleAxiosConfig,
|
|
11
|
-
getReportGlobalMap,
|
|
12
|
-
generateId
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
let
|
|
269
|
-
let
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
let
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
this.
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
this.
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
let
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
return
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
let
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
let
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
let
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
if (this.widget.options.
|
|
1226
|
-
let
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
let
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
let
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
this.
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
this.
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
let
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1
|
+
import emitter from "../../../../components/xform/utils/emitter";
|
|
2
|
+
import i18n from "../../../../components/xform/utils/i18n";
|
|
3
|
+
import refMixin from "../../../../components/xform/form-render/refMixin";
|
|
4
|
+
import containerItemMixin from "./containerItemMixin";
|
|
5
|
+
|
|
6
|
+
import * as formatUtil from "../../../../components/xform/utils/format.js";
|
|
7
|
+
import tableConfig from "../../../../components/table/config.js";
|
|
8
|
+
import { extendDeeply } from "../../../../utils/index.js";
|
|
9
|
+
import {
|
|
10
|
+
assembleAxiosConfig,
|
|
11
|
+
getReportGlobalMap,
|
|
12
|
+
generateId,
|
|
13
|
+
deepClone,
|
|
14
|
+
loopHandleWidget,
|
|
15
|
+
columnFormatMap,
|
|
16
|
+
traverseAllWidgetsNew,
|
|
17
|
+
} from "../../../../components/xform/utils/util";
|
|
18
|
+
import { tableTreeMixins } from "../../../../mixins/tableTree/index.js";
|
|
19
|
+
|
|
20
|
+
let modules = {};
|
|
21
|
+
const baseRefUtil = {
|
|
22
|
+
emitter,
|
|
23
|
+
i18n,
|
|
24
|
+
refMixin,
|
|
25
|
+
containerItemMixin,
|
|
26
|
+
formatUtil,
|
|
27
|
+
assembleAxiosConfig,
|
|
28
|
+
tableConfig,
|
|
29
|
+
getReportGlobalMap,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
modules = {
|
|
33
|
+
mixins: [
|
|
34
|
+
baseRefUtil.emitter,
|
|
35
|
+
baseRefUtil.i18n,
|
|
36
|
+
baseRefUtil.refMixin,
|
|
37
|
+
baseRefUtil.containerItemMixin,
|
|
38
|
+
tableTreeMixins,
|
|
39
|
+
],
|
|
40
|
+
componentName: "ContainerItem",
|
|
41
|
+
props: {
|
|
42
|
+
widget: Object,
|
|
43
|
+
parentWidget: Object,
|
|
44
|
+
parentList: Array,
|
|
45
|
+
indexOfParentList: Number,
|
|
46
|
+
subFormRowIndex: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: -1,
|
|
49
|
+
},
|
|
50
|
+
subFormColIndex: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: -1,
|
|
53
|
+
},
|
|
54
|
+
subFormRowId: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
inject: [
|
|
60
|
+
"refList",
|
|
61
|
+
"sfRefList",
|
|
62
|
+
"globalModel",
|
|
63
|
+
"getFormConfig",
|
|
64
|
+
"getGlobalDsv",
|
|
65
|
+
"previewState",
|
|
66
|
+
],
|
|
67
|
+
data: function () {
|
|
68
|
+
let that = this;
|
|
69
|
+
return {
|
|
70
|
+
fieldModel: [],
|
|
71
|
+
selectedIndices: [],
|
|
72
|
+
pageSize: this.widget.options.pagination.pageSize,
|
|
73
|
+
pageSizes: this.widget.options.pagination.pageSizes,
|
|
74
|
+
currentPage: this.widget.options.pagination.currentPage,
|
|
75
|
+
total: this.widget.options.pagination.total,
|
|
76
|
+
formData: {
|
|
77
|
+
saleOrgName: "",
|
|
78
|
+
loginAccount: "",
|
|
79
|
+
mobile: "",
|
|
80
|
+
enabled: 1,
|
|
81
|
+
},
|
|
82
|
+
vxeOption: {},
|
|
83
|
+
requestAccess: null,
|
|
84
|
+
/* columnFormatMap: {
|
|
85
|
+
editInput: "input",
|
|
86
|
+
editNumber: "number",
|
|
87
|
+
editDate: "date",
|
|
88
|
+
editSelect: "select",
|
|
89
|
+
editSearch: "vabsearch",
|
|
90
|
+
editAttachment: "baseAttachment",
|
|
91
|
+
editStatus: "status",
|
|
92
|
+
aText: "a-text",
|
|
93
|
+
aLink: "a-link",
|
|
94
|
+
editDelete: "a-link",
|
|
95
|
+
editButton: "a-link",
|
|
96
|
+
button: "button",
|
|
97
|
+
addSiblingEditRow: "a-link",
|
|
98
|
+
addChildTreeRow: "a-link",
|
|
99
|
+
moveUpRow: "a-link",
|
|
100
|
+
moveDownRow: "a-link",
|
|
101
|
+
removeTreeRow: "a-link",
|
|
102
|
+
text: "text",
|
|
103
|
+
checkbox: "checkbox",
|
|
104
|
+
radio: "radio",
|
|
105
|
+
}, */
|
|
106
|
+
dataTableConfig: {},
|
|
107
|
+
widgets: [],
|
|
108
|
+
editWidgets: [],
|
|
109
|
+
|
|
110
|
+
sortParentRow: null,
|
|
111
|
+
sortRows: [],
|
|
112
|
+
showTreeMoveDialog: false,
|
|
113
|
+
tableConfig: {},
|
|
114
|
+
showTableFormDialogContent: true,
|
|
115
|
+
widgetMap: {},
|
|
116
|
+
rowWidgetList: [],
|
|
117
|
+
|
|
118
|
+
rowIdData: [],
|
|
119
|
+
fieldSchemaMap: {},
|
|
120
|
+
fieldSchemaData: [],
|
|
121
|
+
eventConfig: {},
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
watch: {
|
|
125
|
+
fieldModel(val) {
|
|
126
|
+
this.formModel[this.fieldKeyName] = val || [];
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
computed: {
|
|
130
|
+
hasWf() {
|
|
131
|
+
return this.getFormRef().hasWf || false;
|
|
132
|
+
},
|
|
133
|
+
tableDatas: {
|
|
134
|
+
cache: !1,
|
|
135
|
+
get: function () {
|
|
136
|
+
return this.globalModel.formModel[this.fieldKeyName] || [];
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
formConfig: function () {
|
|
140
|
+
return this.getFormConfig();
|
|
141
|
+
},
|
|
142
|
+
paginationLayout: function () {
|
|
143
|
+
return this.widget.options.smallPagination
|
|
144
|
+
? "prev, pager, next"
|
|
145
|
+
: "total, sizes, prev, pager, next, jumper";
|
|
146
|
+
},
|
|
147
|
+
customClass: function () {
|
|
148
|
+
return this.widget.options.customClass || "";
|
|
149
|
+
},
|
|
150
|
+
singleRowSelectFlag: function () {
|
|
151
|
+
return !this.widget.options.showCheckBox;
|
|
152
|
+
},
|
|
153
|
+
buttonsColumnFixed: function () {
|
|
154
|
+
return void 0 === this.widget.options.buttonsColumnFixed
|
|
155
|
+
? "right"
|
|
156
|
+
: !!this.widget.options.buttonsColumnFixed &&
|
|
157
|
+
this.widget.options.buttonsColumnFixed;
|
|
158
|
+
},
|
|
159
|
+
formModel: {
|
|
160
|
+
cache: !1,
|
|
161
|
+
get: function () {
|
|
162
|
+
return this.globalModel.formModel;
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
formDataId() {
|
|
166
|
+
let formRef = this.getFormRef();
|
|
167
|
+
return formRef.dataId;
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
created: function () {
|
|
171
|
+
if (!this.formModel[this.fieldKeyName])
|
|
172
|
+
this.formModel[this.fieldKeyName] = [];
|
|
173
|
+
this.initRefList();
|
|
174
|
+
// this.initConfig();
|
|
175
|
+
this.initTableCustomEvent();
|
|
176
|
+
this.initEventHandler();
|
|
177
|
+
this.registerTableRefList();
|
|
178
|
+
this.handleOnCreated();
|
|
179
|
+
},
|
|
180
|
+
mounted: async function () {
|
|
181
|
+
this.handleOnMounted();
|
|
182
|
+
this.initColumnWidgetConfig(() => {
|
|
183
|
+
this.initTableList();
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
beforeDestroy: function () {
|
|
187
|
+
this.unregisterFromRefList();
|
|
188
|
+
},
|
|
189
|
+
methods: {
|
|
190
|
+
initTableCustomEvent() {
|
|
191
|
+
let tableConfig =
|
|
192
|
+
this.handleCustomEvent(this.widget.options.tableConfig) || {};
|
|
193
|
+
this.eventConfig = tableConfig.eventConfig || {};
|
|
194
|
+
},
|
|
195
|
+
getTableColumnStatusWidgetLabelKey(obj) {
|
|
196
|
+
let widget = this.getTableColumnWidget(obj);
|
|
197
|
+
return widget ? this.getOptionItemLabelKey(widget) : null;
|
|
198
|
+
},
|
|
199
|
+
getOptionItemValueKey(widget) {
|
|
200
|
+
return widget.options.valueKey || "value";
|
|
201
|
+
},
|
|
202
|
+
getOptionItemLabelKey(widget) {
|
|
203
|
+
return widget.options.labelKey || "label";
|
|
204
|
+
},
|
|
205
|
+
getTableColumnWidget(obj) {
|
|
206
|
+
let item = this.fieldSchemaMap[obj.row._X_ROW_KEY];
|
|
207
|
+
return item ? item[obj.column.params?.widget.id] : null;
|
|
208
|
+
},
|
|
209
|
+
isShowColumnStatusWidget(obj, item) {
|
|
210
|
+
let widget = this.getTableColumnWidget(obj);
|
|
211
|
+
let valueKey = widget.options.valueKey || "value";
|
|
212
|
+
return (
|
|
213
|
+
obj.row[this.getTableColumnWidgetFieldKeyName(obj)] === item[valueKey]
|
|
214
|
+
);
|
|
215
|
+
},
|
|
216
|
+
getTableColumnWidgetFieldKeyName(obj) {
|
|
217
|
+
let widget = this.getTableColumnWidget(obj);
|
|
218
|
+
return widget ? this.getFieldKeyName(widget) : null;
|
|
219
|
+
},
|
|
220
|
+
initColumnWidgetConfig(callback) {
|
|
221
|
+
let tableColumns = this.widget.options.tableColumns;
|
|
222
|
+
let requests = [];
|
|
223
|
+
this.loodHandleColumns(tableColumns, (row) => {
|
|
224
|
+
requests.push(this.handleColumnWidgetConfig(row.widget));
|
|
225
|
+
requests.push(this.handleColumnWidgetConfig(row.editWidget));
|
|
226
|
+
let widgetList = row.widgetList;
|
|
227
|
+
if (widgetList && widgetList.length) {
|
|
228
|
+
traverseAllWidgetsNew(widgetList, (widget) => {
|
|
229
|
+
requests.push(this.handleColumnWidgetConfig(widget));
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
if (requests.length) {
|
|
234
|
+
Promise.all(requests).then(() => {
|
|
235
|
+
callback();
|
|
236
|
+
});
|
|
237
|
+
} else {
|
|
238
|
+
callback();
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
fillColumnWidgetOptionItems(widget, rows) {
|
|
242
|
+
let widgetType = widget.type;
|
|
243
|
+
let formScriptEnabledTypes = ["select", "checkbox", "radio"];
|
|
244
|
+
if (formScriptEnabledTypes.includes(widgetType)) {
|
|
245
|
+
widget.options.optionItems = rows || [];
|
|
246
|
+
} else if (widgetType === "status") {
|
|
247
|
+
widget.options.statusParam = rows || [];
|
|
248
|
+
}
|
|
249
|
+
widget._syncInited = true;
|
|
250
|
+
},
|
|
251
|
+
async handleColumnWidgetConfig(widget, callback) {
|
|
252
|
+
if (!widget) return;
|
|
253
|
+
let widgetType = widget.type;
|
|
254
|
+
let formScriptEnabledTypes = ["select", "checkbox", "radio", "status"];
|
|
255
|
+
if (!formScriptEnabledTypes.includes(widgetType)) return;
|
|
256
|
+
|
|
257
|
+
let formScriptEnabled = widget.options.formScriptEnabled || false;
|
|
258
|
+
let commonAttributeEnabled =
|
|
259
|
+
widget.options.commonAttributeEnabled || false;
|
|
260
|
+
let commonAttributeCode = widget.options.commonAttributeCode;
|
|
261
|
+
if (commonAttributeEnabled) {
|
|
262
|
+
if (!commonAttributeCode) return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (!formScriptEnabled && !commonAttributeEnabled) return;
|
|
266
|
+
|
|
267
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
|
268
|
+
let formCode = reportTemplate.formCode;
|
|
269
|
+
let scriptCode = widget.options.formScriptCode || "getList";
|
|
270
|
+
let fieldKeyName = this.getFieldKeyName(widget);
|
|
271
|
+
|
|
272
|
+
if (formScriptEnabled) {
|
|
273
|
+
let accessParam = this.handleCustomEvent(
|
|
274
|
+
widget.options.formScriptParam
|
|
275
|
+
);
|
|
276
|
+
return this.formHttp({
|
|
277
|
+
scriptCode: scriptCode,
|
|
278
|
+
data: {
|
|
279
|
+
formCode: formCode,
|
|
280
|
+
formVersion: reportTemplate.formVersion,
|
|
281
|
+
taBm: fieldKeyName,
|
|
282
|
+
data: {
|
|
283
|
+
...accessParam,
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
success: (res) => {
|
|
287
|
+
let rows = res.objx?.records || res.objx || [];
|
|
288
|
+
this.fillColumnWidgetOptionItems(widget, rows);
|
|
289
|
+
},
|
|
290
|
+
});
|
|
291
|
+
} else if (commonAttributeEnabled) {
|
|
292
|
+
let accessParam = this.handleCustomEvent(
|
|
293
|
+
widget.options.formScriptParam
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
return this.$getBaseDicts({
|
|
297
|
+
code: commonAttributeCode,
|
|
298
|
+
data: {
|
|
299
|
+
...accessParam,
|
|
300
|
+
},
|
|
301
|
+
success: ({ dicts, dictMap }) => {
|
|
302
|
+
this.fillColumnWidgetOptionItems(widget, dicts);
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
initConfig() {
|
|
308
|
+
let formRef = this.getFormRef();
|
|
309
|
+
this.widget.options.tableColumns.forEach((row) => {
|
|
310
|
+
let type = columnFormatMap[row.formatS];
|
|
311
|
+
if (type && row.columnOption && !row.widget) {
|
|
312
|
+
let fieldWidget = formRef.copyNewFieldWidget(
|
|
313
|
+
formRef.getFieldWidgetByType(type)
|
|
314
|
+
);
|
|
315
|
+
fieldWidget.options = row.columnOption;
|
|
316
|
+
row.widget = fieldWidget;
|
|
317
|
+
}
|
|
318
|
+
let type2 = columnFormatMap[row.editFormatS];
|
|
319
|
+
if (type2 && row.editColumnOption && !row.editWidget) {
|
|
320
|
+
let fieldWidget = formRef.copyNewFieldWidget(
|
|
321
|
+
formRef.getFieldWidgetByType(type2)
|
|
322
|
+
);
|
|
323
|
+
fieldWidget.options = row.editColumnOption;
|
|
324
|
+
row.editWidget = fieldWidget;
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
},
|
|
328
|
+
registerTableRefList() {
|
|
329
|
+
this.sfRefList[this.widget.options.name] = this;
|
|
330
|
+
},
|
|
331
|
+
getRowRefKey(row, name) {
|
|
332
|
+
let keyVal = row._X_ROW_KEY;
|
|
333
|
+
let key = name + "_" + keyVal;
|
|
334
|
+
return key;
|
|
335
|
+
},
|
|
336
|
+
getWidgetByTableRow(index, name) {
|
|
337
|
+
// let target = this.getWidgetRefByTableRow(index, name)
|
|
338
|
+
// let widget = target.field || target.widget;
|
|
339
|
+
// let row = this.getGridTable().getTableData().fullData[index];
|
|
340
|
+
let formRows = this.formModel[this.fieldKeyName];
|
|
341
|
+
let row = formRows[index];
|
|
342
|
+
let widget = this.getWidgetByTableRowData(row, name);
|
|
343
|
+
return widget;
|
|
344
|
+
},
|
|
345
|
+
getWidgetRefByTableRow(index, name) {
|
|
346
|
+
// let row = this.getGridTable().getTableData().fullData[index];
|
|
347
|
+
let formRows = this.formModel[this.fieldKeyName];
|
|
348
|
+
let row = formRows[index];
|
|
349
|
+
return this.getWidgetRefByTableRowData(row, name);
|
|
350
|
+
},
|
|
351
|
+
getWidgetByTableRowData(row, name) {
|
|
352
|
+
let target = this.getWidgetRefByTableRowData(row, name);
|
|
353
|
+
let widget = target.field || target.widget;
|
|
354
|
+
return widget;
|
|
355
|
+
},
|
|
356
|
+
getWidgetRefByTableRowData(row, name) {
|
|
357
|
+
let key = this.getRowRefKey(row, name);
|
|
358
|
+
return this.getWidgetRef(key);
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
getWidgetRefByTableParam(tableParam) {
|
|
362
|
+
let params = tableParam.column.params;
|
|
363
|
+
let name = params.widget.options.name;
|
|
364
|
+
// let key = this.getRowRefKey(tableParam.row, name);
|
|
365
|
+
return this.getWidgetRefByTableRowData(tableParam.row, name);
|
|
366
|
+
// return this.getWidgetRef(key);
|
|
367
|
+
},
|
|
368
|
+
getRowWidget(rowParam, fieldWidget) {
|
|
369
|
+
let row = rowParam.row;
|
|
370
|
+
let params = rowParam.column.params;
|
|
371
|
+
let widgetId = fieldWidget ? fieldWidget.id : params.widget.id;
|
|
372
|
+
let widget = this.fieldSchemaMap[row._X_ROW_KEY][widgetId];
|
|
373
|
+
return widget;
|
|
374
|
+
},
|
|
375
|
+
loopHandleWidgetByName(name, callback) {
|
|
376
|
+
let rows = this.getValue();
|
|
377
|
+
rows.forEach((row, index) => {
|
|
378
|
+
let target = this.getWidgetRefByTableRow(index, name);
|
|
379
|
+
if (target) {
|
|
380
|
+
let widget = target.field || target.widget;
|
|
381
|
+
callback(row, widget, target);
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
},
|
|
385
|
+
getRowWidgetOption(rowParam, fieldWidget) {
|
|
386
|
+
let widget = this.getRowWidget(rowParam, fieldWidget);
|
|
387
|
+
let field = widget.category === "container" ? "widget" : "field";
|
|
388
|
+
let option = {
|
|
389
|
+
[field]: widget,
|
|
390
|
+
};
|
|
391
|
+
return option;
|
|
392
|
+
},
|
|
393
|
+
getRowWidgetKey(rowParam, fieldWidget) {
|
|
394
|
+
let widget = this.getRowWidget(rowParam, fieldWidget);
|
|
395
|
+
let key = widget.id;
|
|
396
|
+
return key;
|
|
397
|
+
},
|
|
398
|
+
getGridTableName() {
|
|
399
|
+
let formCode = this.getFormRef().reportTemplate.formCode;
|
|
400
|
+
let tableName = formCode + "_" + this.widget.options.name;
|
|
401
|
+
return tableName;
|
|
402
|
+
},
|
|
403
|
+
updateFormField: function () {
|
|
404
|
+
let rows = this.fieldModel || [];
|
|
405
|
+
let formRows = this.formModel[this.fieldKeyName];
|
|
406
|
+
if (formRows) {
|
|
407
|
+
this.formModel[this.fieldKeyName].splice(0, formRows.length);
|
|
408
|
+
this.formModel[this.fieldKeyName].push(...rows);
|
|
409
|
+
} else {
|
|
410
|
+
this.formModel[this.fieldKeyName] = rows;
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
initFieldSchema(val) {
|
|
414
|
+
let rows = val || [];
|
|
415
|
+
// 处理树结构数据排序
|
|
416
|
+
this.formModel[this.fieldKeyName] = rows;
|
|
417
|
+
this.fieldModel = rows;
|
|
418
|
+
this.initRowIdData(true);
|
|
419
|
+
this.initFieldSchemaData();
|
|
420
|
+
},
|
|
421
|
+
initValue(val) {
|
|
422
|
+
// this.clearRowWidgets()
|
|
423
|
+
let rows = val || [];
|
|
424
|
+
// this.handleNullValue(rows);
|
|
425
|
+
rows.forEach((row, index) => {
|
|
426
|
+
row._X_ROW_KEY = "row_" + generateId();
|
|
427
|
+
});
|
|
428
|
+
this.formModel[this.fieldKeyName] = rows;
|
|
429
|
+
this.fieldModel = rows;
|
|
430
|
+
this.initRowIdData(true);
|
|
431
|
+
this.initFieldSchemaData(true);
|
|
432
|
+
},
|
|
433
|
+
handleTreeData(rows) {
|
|
434
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
|
435
|
+
if (isTreeTable) {
|
|
436
|
+
let $grid = this.getGridTable();
|
|
437
|
+
if (!$grid) return;
|
|
438
|
+
let parentField = $grid.treeConfig.parentField;
|
|
439
|
+
if (parentField) {
|
|
440
|
+
// 构建树结构并排序
|
|
441
|
+
let sortedRows = [];
|
|
442
|
+
let nodeMap = new Map();
|
|
443
|
+
|
|
444
|
+
// 第一步:构建节点映射
|
|
445
|
+
rows.forEach((row) => {
|
|
446
|
+
if (row.id !== undefined && row.id !== null) {
|
|
447
|
+
nodeMap.set(row.id, row);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// 第二步:按层次排序,先根节点,然后子节点
|
|
452
|
+
rows.forEach((row) => {
|
|
453
|
+
let parentValue = row[parentField];
|
|
454
|
+
// 根节点(parentField为null、undefined、空字符串或0)
|
|
455
|
+
if (
|
|
456
|
+
parentValue === null ||
|
|
457
|
+
parentValue === undefined ||
|
|
458
|
+
parentValue === "" ||
|
|
459
|
+
parentValue === 0
|
|
460
|
+
) {
|
|
461
|
+
sortedRows.push(row);
|
|
462
|
+
// 递归添加子节点
|
|
463
|
+
this.addChildNodes(row.id, nodeMap, parentField, sortedRows);
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
// 如果没有找到根节点,返回原始数组
|
|
468
|
+
if (sortedRows.length === 0) {
|
|
469
|
+
return rows;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
return sortedRows;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return rows;
|
|
476
|
+
},
|
|
477
|
+
addChildNodes(parentId, nodeMap, parentField, sortedRows) {
|
|
478
|
+
// 遍历所有节点,找出当前父节点的子节点
|
|
479
|
+
for (let [id, node] of nodeMap.entries()) {
|
|
480
|
+
// 处理parentField值的类型转换,确保比较正确
|
|
481
|
+
let nodeParentValue = node[parentField];
|
|
482
|
+
let targetParentId = parentId;
|
|
483
|
+
|
|
484
|
+
// 转换为相同类型进行比较
|
|
485
|
+
if (typeof nodeParentValue !== typeof targetParentId) {
|
|
486
|
+
nodeParentValue = String(nodeParentValue);
|
|
487
|
+
targetParentId = String(targetParentId);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
if (nodeParentValue === targetParentId) {
|
|
491
|
+
sortedRows.push(node);
|
|
492
|
+
// 递归添加子节点的子节点
|
|
493
|
+
this.addChildNodes(id, nodeMap, parentField, sortedRows);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
setValue(val) {
|
|
498
|
+
// console.log("rows:",val);
|
|
499
|
+
this.clearRowWidgets();
|
|
500
|
+
let rows = val || [];
|
|
501
|
+
rows.forEach((row, index) => {
|
|
502
|
+
if (!row._X_ROW_KEY) {
|
|
503
|
+
row._X_ROW_KEY = "row_" + generateId();
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
this.formModel[this.fieldKeyName] = rows;
|
|
507
|
+
let $grid = this.getGridTable();
|
|
508
|
+
this.fieldModel = rows;
|
|
509
|
+
|
|
510
|
+
this.initRowIdData();
|
|
511
|
+
this.initFieldSchemaData();
|
|
512
|
+
// $grid.loadData(rows);
|
|
513
|
+
},
|
|
514
|
+
getValue() {
|
|
515
|
+
return this.formModel[this.fieldKeyName];
|
|
516
|
+
},
|
|
517
|
+
getFieldKeyName(widget) {
|
|
518
|
+
let o = widget.options.name;
|
|
519
|
+
return (widget.options.keyNameEnabled && widget.options.keyName) || o;
|
|
520
|
+
},
|
|
521
|
+
selectWidget: function (e) {
|
|
522
|
+
this.designer.setSelected(e);
|
|
523
|
+
},
|
|
524
|
+
getFormatterValue(cellValue, formatS) {
|
|
525
|
+
switch (formatS) {
|
|
526
|
+
case "d1":
|
|
527
|
+
return baseRefUtil.formatUtil.formatDate1(cellValue);
|
|
528
|
+
case "d2":
|
|
529
|
+
return baseRefUtil.formatUtil.formatDate2(cellValue);
|
|
530
|
+
case "d3":
|
|
531
|
+
return baseRefUtil.formatUtil.formatDate3(cellValue);
|
|
532
|
+
case "d4":
|
|
533
|
+
return baseRefUtil.formatUtil.formatDate4(cellValue);
|
|
534
|
+
case "d5":
|
|
535
|
+
return baseRefUtil.formatUtil.formatDate4(cellValue);
|
|
536
|
+
case "n1":
|
|
537
|
+
return baseRefUtil.formatUtil.formatNumber1(cellValue);
|
|
538
|
+
case "n2":
|
|
539
|
+
return baseRefUtil.formatUtil.formatNumber2(cellValue);
|
|
540
|
+
case "n3":
|
|
541
|
+
return baseRefUtil.formatUtil.formatNumber3(cellValue);
|
|
542
|
+
case "n4":
|
|
543
|
+
return baseRefUtil.formatUtil.formatNumber4(cellValue);
|
|
544
|
+
case "n5":
|
|
545
|
+
return baseRefUtil.formatUtil.formatNumber5(cellValue);
|
|
546
|
+
case "n6":
|
|
547
|
+
return baseRefUtil.formatUtil.formatNumber6(cellValue);
|
|
548
|
+
case "n7":
|
|
549
|
+
return baseRefUtil.formatUtil.formatNumber7(cellValue);
|
|
550
|
+
}
|
|
551
|
+
return cellValue;
|
|
552
|
+
},
|
|
553
|
+
formatterValue: function ({ cellValue, row, column }) {
|
|
554
|
+
if (cellValue === null || cellValue === undefined) return cellValue;
|
|
555
|
+
|
|
556
|
+
if (column.params && column.params.formatS) {
|
|
557
|
+
return this.getFormatterValue(cellValue, column.params.formatS);
|
|
558
|
+
}
|
|
559
|
+
return cellValue;
|
|
560
|
+
},
|
|
561
|
+
getRowIndex: function (e) {
|
|
562
|
+
return this.widget.options.tableData.lastIndexOf(e);
|
|
563
|
+
},
|
|
564
|
+
setTableColumns: function (e) {
|
|
565
|
+
let t = this;
|
|
566
|
+
(this.widget.options.tableColumns = e),
|
|
567
|
+
this.$nextTick(function () {
|
|
568
|
+
t.$refs.dataTable.doLayout();
|
|
569
|
+
});
|
|
570
|
+
},
|
|
571
|
+
setTableColumn: function (e) {
|
|
572
|
+
this.setTableColumns(e);
|
|
573
|
+
},
|
|
574
|
+
getTableData: function () {
|
|
575
|
+
return this.widget.options.tableData;
|
|
576
|
+
},
|
|
577
|
+
resetForm(options) {
|
|
578
|
+
let formData = this.formModel;
|
|
579
|
+
let ignoreFields = options?.ignoreFields || [];
|
|
580
|
+
this.widget.widgetList.forEach((subWidget) => {
|
|
581
|
+
if (
|
|
582
|
+
!ignoreFields.length ||
|
|
583
|
+
!ignoreFields.includes(subWidget.options.name)
|
|
584
|
+
) {
|
|
585
|
+
let widgetRef = this.getWidgetRef(subWidget.options.name);
|
|
586
|
+
if (widgetRef && widgetRef.setValue) widgetRef.setValue(null);
|
|
587
|
+
if (this.isVabsearchFlagWidget(subWidget))
|
|
588
|
+
widgetRef.setShowValue(null);
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
},
|
|
592
|
+
searchEvent() {
|
|
593
|
+
this.getGridTable().commitProxy("reload");
|
|
594
|
+
},
|
|
595
|
+
async resetEvent(options) {
|
|
596
|
+
this.resetForm(options);
|
|
597
|
+
this.getGridTable().commitProxy("reload");
|
|
598
|
+
},
|
|
599
|
+
handleSearchClick() {
|
|
600
|
+
if (this.widget.options.onSearchTable) {
|
|
601
|
+
this.handleCustomEvent(this.widget.options.onSearchTable);
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
this.searchEvent();
|
|
605
|
+
},
|
|
606
|
+
handleResetClick() {
|
|
607
|
+
if (this.widget.options.onResetTable) {
|
|
608
|
+
this.handleCustomEvent(this.widget.options.onResetTable);
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
this.resetEvent();
|
|
612
|
+
},
|
|
613
|
+
openEditDialog(row, param, option) {
|
|
614
|
+
let formRef = this.getFormRef();
|
|
615
|
+
let formConfig = this.formConfig;
|
|
616
|
+
let formCode = null;
|
|
617
|
+
if (row?.id) {
|
|
618
|
+
formCode = formConfig.editFormCode;
|
|
619
|
+
} else {
|
|
620
|
+
formCode = formConfig.addFormCode || formConfig.editFormCode;
|
|
621
|
+
}
|
|
622
|
+
let parentTarget = formRef.$attrs["parent-target"];
|
|
623
|
+
parentTarget &&
|
|
624
|
+
parentTarget.$attrs.openEditDialog &&
|
|
625
|
+
parentTarget.$attrs.openEditDialog(row, param, {
|
|
626
|
+
formCode,
|
|
627
|
+
...option,
|
|
628
|
+
});
|
|
629
|
+
},
|
|
630
|
+
importExcel() {},
|
|
631
|
+
getGrid(that, tableRef) {
|
|
632
|
+
let $grid;
|
|
633
|
+
if (Array.isArray(that.$refs[tableRef])) {
|
|
634
|
+
$grid = that.$refs[tableRef][0];
|
|
635
|
+
} else {
|
|
636
|
+
$grid = that.$refs[tableRef];
|
|
637
|
+
}
|
|
638
|
+
return $grid;
|
|
639
|
+
},
|
|
640
|
+
getTableCondition: function () {
|
|
641
|
+
if (this.widget.options.tableCondition) {
|
|
642
|
+
let e = new Function(this.widget.options.tableCondition);
|
|
643
|
+
return e.call(this);
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
getSearchCondition: function () {
|
|
647
|
+
let extraAccessData = this.extraAccessData || {};
|
|
648
|
+
let searchFormData = this.getSearchFormData();
|
|
649
|
+
let defaultData = {};
|
|
650
|
+
|
|
651
|
+
// let globalReqData = baseRefUtil.getReportGlobalMap();//全局请求参数
|
|
652
|
+
let tableCondition = this.getTableCondition();
|
|
653
|
+
let conditions = {
|
|
654
|
+
...defaultData,
|
|
655
|
+
...tableCondition,
|
|
656
|
+
...searchFormData,
|
|
657
|
+
...extraAccessData,
|
|
658
|
+
// ...globalReqData
|
|
659
|
+
};
|
|
660
|
+
return conditions;
|
|
661
|
+
},
|
|
662
|
+
createColumns() {
|
|
663
|
+
let rowWidgetList = [];
|
|
664
|
+
let tableColumns = this.widget.options.tableColumns;
|
|
665
|
+
let newColumns = [];
|
|
666
|
+
if (!this.widget.options.hideGridCheckBox) {
|
|
667
|
+
newColumns.push({
|
|
668
|
+
type: "checkbox",
|
|
669
|
+
width: 48,
|
|
670
|
+
resizable: false,
|
|
671
|
+
fixed: "left",
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
let tableWidgetName = this.widget.options.name;
|
|
676
|
+
let isEditTable = this.widget.options.isEditTable || false;
|
|
677
|
+
const createColumn = (t, isChild) => {
|
|
678
|
+
let filterable = t.filterable ?? true;
|
|
679
|
+
let filterType = filterable ? null : false;
|
|
680
|
+
let col = {
|
|
681
|
+
fixed: !!t.fixed && t.fixed,
|
|
682
|
+
field: t.prop,
|
|
683
|
+
title: this.getI18nLabel(t.label),
|
|
684
|
+
sortable: t.sortable,
|
|
685
|
+
filterType,
|
|
686
|
+
align: t.align ? t.align : "center",
|
|
687
|
+
formatter: this.formatterValue,
|
|
688
|
+
params: {
|
|
689
|
+
title: this.getI18nLabel(t.label),
|
|
690
|
+
formatS: t.formatS,
|
|
691
|
+
columnId: t.columnId,
|
|
692
|
+
exportType: t.exportType,
|
|
693
|
+
isItemLine: t.isItemLine,
|
|
694
|
+
footerDataType: t.footerDataType,
|
|
695
|
+
footerMethodConfg: t.footerMethodConfg,
|
|
696
|
+
widgetList: t.widgetList,
|
|
697
|
+
tableWidgetName,
|
|
698
|
+
},
|
|
699
|
+
visible: t.show,
|
|
700
|
+
slots: {},
|
|
701
|
+
};
|
|
702
|
+
if (t.required) {
|
|
703
|
+
col.title = col.title;
|
|
704
|
+
/* if(!isEditTable){
|
|
705
|
+
col.titlePrefix = {
|
|
706
|
+
icon: "vxe-cell--required-icon"
|
|
707
|
+
}
|
|
708
|
+
} */
|
|
709
|
+
col.titlePrefix = {
|
|
710
|
+
icon: "vxe-cell--required-icon",
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
if (t.treeNode) {
|
|
714
|
+
col.treeNode = true;
|
|
715
|
+
}
|
|
716
|
+
if (t.children && t.children.length) {
|
|
717
|
+
col.align = "center";
|
|
718
|
+
delete col.field;
|
|
719
|
+
let childColumns = t.children.map((child) => {
|
|
720
|
+
return createColumn(child, true);
|
|
721
|
+
});
|
|
722
|
+
col.children = childColumns;
|
|
723
|
+
|
|
724
|
+
col.sortable = false;
|
|
725
|
+
col.filterType = false;
|
|
726
|
+
} else {
|
|
727
|
+
col.width = t.width;
|
|
728
|
+
if (isChild) {
|
|
729
|
+
if (col.title && col.field) {
|
|
730
|
+
if (filterable) {
|
|
731
|
+
col.filters = [
|
|
732
|
+
{
|
|
733
|
+
data: {},
|
|
734
|
+
},
|
|
735
|
+
];
|
|
736
|
+
col.filterRender = {
|
|
737
|
+
name: "FilterContent",
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
col = addColumProperty(col, t);
|
|
744
|
+
|
|
745
|
+
if (col.params.widget) {
|
|
746
|
+
rowWidgetList.push(col.params.widget);
|
|
747
|
+
}
|
|
748
|
+
if (col.params.editWidget) {
|
|
749
|
+
rowWidgetList.push(col.params.editWidget);
|
|
750
|
+
}
|
|
751
|
+
if (col.params.widgetList && col.params.widgetList.length) {
|
|
752
|
+
col.params.widgetList.forEach((item) => {
|
|
753
|
+
rowWidgetList.push(item);
|
|
754
|
+
});
|
|
755
|
+
}
|
|
756
|
+
return col;
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
const addColumProperty = (col, t) => {
|
|
760
|
+
/*let columnOption;
|
|
761
|
+
let widget;
|
|
762
|
+
let columnWidgetConfig = this.getColumnWidgetConfig(t);
|
|
763
|
+
let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
|
|
764
|
+
if (columnSelectedWidget) {
|
|
765
|
+
widget = columnSelectedWidget;
|
|
766
|
+
columnOption = widget.options;
|
|
767
|
+
} else {
|
|
768
|
+
columnOption = {};
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
let {columnSelectedWidget: editWidget} = this.getColumnWidgetConfig(
|
|
772
|
+
t,
|
|
773
|
+
true
|
|
774
|
+
);*/
|
|
775
|
+
|
|
776
|
+
let widget = t.widget ?? null;
|
|
777
|
+
let editWidget = t.editWidget ?? null;
|
|
778
|
+
let columnOption = {};
|
|
779
|
+
if (widget) {
|
|
780
|
+
columnOption = widget.options;
|
|
781
|
+
}
|
|
782
|
+
let params = {
|
|
783
|
+
...columnOption,
|
|
784
|
+
widget,
|
|
785
|
+
formatS: t.formatS,
|
|
786
|
+
required: t.required || false,
|
|
787
|
+
columnConfig: t,
|
|
788
|
+
editWidget,
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
Object.assign(col.params, params);
|
|
792
|
+
let types = [
|
|
793
|
+
"input",
|
|
794
|
+
"number",
|
|
795
|
+
"text",
|
|
796
|
+
"select",
|
|
797
|
+
"checkbox",
|
|
798
|
+
"radio",
|
|
799
|
+
"status",
|
|
800
|
+
"vabsearch",
|
|
801
|
+
"date",
|
|
802
|
+
"textarea",
|
|
803
|
+
];
|
|
804
|
+
if (widget && types.includes(widget.type)) {
|
|
805
|
+
const func = (obj) => {
|
|
806
|
+
let value = obj.row[obj.column.field];
|
|
807
|
+
let fieldWidget = null;
|
|
808
|
+
if (!!obj.column?.params?.widget) {
|
|
809
|
+
fieldWidget = this.getRowWidget(obj);
|
|
810
|
+
}
|
|
811
|
+
if (fieldWidget && !fieldWidget.options.hidden) {
|
|
812
|
+
let widgetType = fieldWidget.type;
|
|
813
|
+
if (["input", "number", "textarea"].includes(widgetType)) {
|
|
814
|
+
return value;
|
|
815
|
+
}
|
|
816
|
+
let widgetRef = this.getWidgetRefByTableParam(obj);
|
|
817
|
+
if ("text" === widgetType) {
|
|
818
|
+
return widgetRef ? widgetRef.showVaule : value;
|
|
819
|
+
} else if ("select" === widgetType) {
|
|
820
|
+
return this.getOptionLabel(fieldWidget, value);
|
|
821
|
+
} else if ("checkbox" === widgetType) {
|
|
822
|
+
return this.getOptionLabel(fieldWidget, value);
|
|
823
|
+
} else if ("radio" === widgetType) {
|
|
824
|
+
return this.getOptionLabel(fieldWidget, value);
|
|
825
|
+
} else if ("status" === widgetType) {
|
|
826
|
+
let statusParam = fieldWidget.options.statusParam || [];
|
|
827
|
+
let statusItem = statusParam.find(
|
|
828
|
+
(item) => item.value === value
|
|
829
|
+
);
|
|
830
|
+
return statusItem ? this.$t1(statusItem.label) : null;
|
|
831
|
+
} else if ("vabsearch" === widgetType) {
|
|
832
|
+
let result = null;
|
|
833
|
+
let currentData = obj.row;
|
|
834
|
+
let fieldKeyName = this.getFieldKeyName(fieldWidget);
|
|
835
|
+
let vabSearchName = fieldWidget.options.vabSearchName;
|
|
836
|
+
let multipleChoices =
|
|
837
|
+
fieldWidget.options.multipleChoices || false;
|
|
838
|
+
let labelField = vabSearchName || fieldKeyName;
|
|
839
|
+
if (!multipleChoices) {
|
|
840
|
+
result = currentData[labelField] ?? null;
|
|
841
|
+
} else {
|
|
842
|
+
if (value) {
|
|
843
|
+
result = value.map((item) => item[labelField]).join(",");
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return result;
|
|
847
|
+
} else if ("date" === widgetType) {
|
|
848
|
+
let dateType = fieldWidget.options.type;
|
|
849
|
+
if (["date", "week"].includes(dateType)) {
|
|
850
|
+
return value ? value.substring(0, 10) : null;
|
|
851
|
+
} else if (dateType === "dates") {
|
|
852
|
+
if (value) {
|
|
853
|
+
if (Array.isArray(value)) {
|
|
854
|
+
return value
|
|
855
|
+
.map((item) => item.substring(0, 10))
|
|
856
|
+
.join(",");
|
|
857
|
+
} else {
|
|
858
|
+
return value;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
return null;
|
|
862
|
+
} else {
|
|
863
|
+
return value;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
} else {
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
col.slots.filterVal = func;
|
|
871
|
+
}
|
|
872
|
+
if (!col.children || !col.children.length) {
|
|
873
|
+
if (t.formatS === "render") {
|
|
874
|
+
let r = t.render ? new Function("params", "h", t.render) : null;
|
|
875
|
+
col.slots.default = (params, h) => {
|
|
876
|
+
return r ? r.call(this, params, h) : "";
|
|
877
|
+
};
|
|
878
|
+
} else if (widget) {
|
|
879
|
+
// col.slots.default = columnSelectedWidget.id;
|
|
880
|
+
col.slots.default = "widget";
|
|
881
|
+
} else if (t.formatS === "editTreeButtonGroup") {
|
|
882
|
+
col.slots.default = "editTreeButtonGroup";
|
|
883
|
+
} else if (t.formatS === "widgetRender") {
|
|
884
|
+
col.slots.default = "widgetList";
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
if (editWidget) {
|
|
888
|
+
col.editRender = { name: "input" };
|
|
889
|
+
// col.slots.edit = editWidget.id;
|
|
890
|
+
col.slots.edit = "editWidget";
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
if (t.tableColumnConfig) {
|
|
894
|
+
let tableColumnConfig =
|
|
895
|
+
this.handleCustomEvent(t.tableColumnConfig) || {};
|
|
896
|
+
col = extendDeeply(col, tableColumnConfig);
|
|
897
|
+
}
|
|
898
|
+
return col;
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
let formRef = this.getFormRef();
|
|
902
|
+
tableColumns.forEach((t) => {
|
|
903
|
+
let col = createColumn(t);
|
|
904
|
+
newColumns.push(col);
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
/* let tableConfig = this.tableConfig;
|
|
908
|
+
let flag = tableConfig?.config?.toolbarConfig?.custom !== false;
|
|
909
|
+
if (
|
|
910
|
+
baseRefUtil.tableConfig &&
|
|
911
|
+
baseRefUtil.tableConfig.className === "list-table" &&
|
|
912
|
+
flag
|
|
913
|
+
) {
|
|
914
|
+
if (tableColumns.length) {
|
|
915
|
+
let tableColumn = tableColumns[tableColumns.length - 1];
|
|
916
|
+
if (tableColumn.fixed !== "right") {
|
|
917
|
+
newColumns.push({
|
|
918
|
+
width: 47,
|
|
919
|
+
title: "",
|
|
920
|
+
fixed: "right",
|
|
921
|
+
sortable: false,
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
} */
|
|
926
|
+
this.rowWidgetList = rowWidgetList;
|
|
927
|
+
return this.$baseLodash.cloneDeep(newColumns);
|
|
928
|
+
},
|
|
929
|
+
//begin
|
|
930
|
+
getOptionLabel(fieldWidget, fieldModel) {
|
|
931
|
+
if (fieldModel === null) {
|
|
932
|
+
return null;
|
|
933
|
+
} else {
|
|
934
|
+
let resultList = [];
|
|
935
|
+
let labelField = fieldWidget.options.labelKey || "label";
|
|
936
|
+
let valueField = fieldWidget.options.valueKey || "value";
|
|
937
|
+
fieldWidget.options.optionItems.forEach((oItem) => {
|
|
938
|
+
if (
|
|
939
|
+
oItem[valueField] === fieldModel ||
|
|
940
|
+
this.findInArray(fieldModel, oItem[valueField]) !== -1
|
|
941
|
+
) {
|
|
942
|
+
resultList.push(this.$t1(oItem[labelField]));
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
return resultList.join(",");
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
findInArray: function (e, t) {
|
|
949
|
+
if (!Array.isArray(e)) return -1;
|
|
950
|
+
var i = -1;
|
|
951
|
+
return (
|
|
952
|
+
e.forEach(function (e, n) {
|
|
953
|
+
e === t && (i = n);
|
|
954
|
+
}),
|
|
955
|
+
i
|
|
956
|
+
);
|
|
957
|
+
},
|
|
958
|
+
//end
|
|
959
|
+
|
|
960
|
+
async initTableList() {
|
|
961
|
+
let that = this;
|
|
962
|
+
let tableOption = null;
|
|
963
|
+
let path = null;
|
|
964
|
+
let paramFun = null;
|
|
965
|
+
// let mainDataSetDTO = null;
|
|
966
|
+
let requestAccess = this.requestAccess;
|
|
967
|
+
let tableRef = this.getTableRef();
|
|
968
|
+
let formDataModel = this.getFormRef().formDataModel;
|
|
969
|
+
let isQueryTable = this.widget.options.isQueryTable || false;
|
|
970
|
+
let isDataPage = this.widget.options.accessReturnType === "2";
|
|
971
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
|
972
|
+
let formCode = reportTemplate.formCode;
|
|
973
|
+
let dataId = this.formDataId;
|
|
974
|
+
let accessScript = this.widget.options.accessScript;
|
|
975
|
+
let searchColumns = null;
|
|
976
|
+
|
|
977
|
+
let isQueryAllPage = !this.widget.options.isNotQueryAllPage;
|
|
978
|
+
|
|
979
|
+
let tableConfig =
|
|
980
|
+
this.handleCustomEvent(this.widget.options.tableConfig) || {};
|
|
981
|
+
this.tableConfig = tableConfig;
|
|
982
|
+
|
|
983
|
+
let tableConfig2 = this.$baseLodash.cloneDeep(tableConfig);
|
|
984
|
+
delete tableConfig2.config;
|
|
985
|
+
delete tableConfig2.eventConfig;
|
|
986
|
+
|
|
987
|
+
if (isQueryTable) {
|
|
988
|
+
path = "#";
|
|
989
|
+
paramFun = () => {
|
|
990
|
+
let conditions = this.getSearchCondition();
|
|
991
|
+
let $grid = this.getGridTable();
|
|
992
|
+
if (this.widget.options.showPagination) {
|
|
993
|
+
let proxyInfo = $grid.getProxyInfo();
|
|
994
|
+
let searchCount = true;
|
|
995
|
+
let isQueryAllPage = $grid.isQueryAllPage;
|
|
996
|
+
if (isQueryAllPage === false) {
|
|
997
|
+
searchCount = false;
|
|
998
|
+
}
|
|
999
|
+
let pager = proxyInfo ? proxyInfo.pager : null;
|
|
1000
|
+
if (pager) {
|
|
1001
|
+
conditions.current = pager.currentPage;
|
|
1002
|
+
conditions.size = pager.pageSize;
|
|
1003
|
+
conditions.searchCount = searchCount;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/*let formData = {
|
|
1008
|
+
accessCode: requestAccess.accessCode,
|
|
1009
|
+
conditions: conditions
|
|
1010
|
+
};*/
|
|
1011
|
+
let formData = conditions;
|
|
1012
|
+
return formData;
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
searchColumns = [];
|
|
1016
|
+
let widgetList = this.widget.widgetList;
|
|
1017
|
+
|
|
1018
|
+
let getDateItem = (widget) => {
|
|
1019
|
+
let options = widget.options;
|
|
1020
|
+
|
|
1021
|
+
let dateConfig = {
|
|
1022
|
+
format: options.format,
|
|
1023
|
+
valueFormat: options.valueFormat ?? null,
|
|
1024
|
+
};
|
|
1025
|
+
let typeMap = {
|
|
1026
|
+
input: { type: "input" },
|
|
1027
|
+
number: { type: "number" },
|
|
1028
|
+
inputBatch: { type: "inputBatch" },
|
|
1029
|
+
date: {
|
|
1030
|
+
type: "date",
|
|
1031
|
+
widgetType: options.type,
|
|
1032
|
+
widgetConfig: dateConfig,
|
|
1033
|
+
},
|
|
1034
|
+
time: {
|
|
1035
|
+
type: "time",
|
|
1036
|
+
widgetConfig: {
|
|
1037
|
+
...dateConfig,
|
|
1038
|
+
valueFormat: "HH:mm:ss",
|
|
1039
|
+
},
|
|
1040
|
+
},
|
|
1041
|
+
"date-range": {
|
|
1042
|
+
type: "date",
|
|
1043
|
+
widgetType: "daterange",
|
|
1044
|
+
widgetConfig: { ...dateConfig, isRange: true },
|
|
1045
|
+
},
|
|
1046
|
+
"time-range": {
|
|
1047
|
+
type: "time",
|
|
1048
|
+
widgetConfig: {
|
|
1049
|
+
...dateConfig,
|
|
1050
|
+
isRange: true,
|
|
1051
|
+
valueFormat: "HH:mm:ss",
|
|
1052
|
+
},
|
|
1053
|
+
},
|
|
1054
|
+
};
|
|
1055
|
+
let item = typeMap[widget.type] || {};
|
|
1056
|
+
return item;
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
widgetList.forEach((widget) => {
|
|
1060
|
+
if ("container" !== widget.category) {
|
|
1061
|
+
let options = widget.options;
|
|
1062
|
+
let item = getDateItem(widget);
|
|
1063
|
+
let type = item.type ?? null;
|
|
1064
|
+
// let widgetType = item.widgetType ?? widgetType;
|
|
1065
|
+
// let isRange = item.isRange || false;
|
|
1066
|
+
searchColumns.push({
|
|
1067
|
+
title: this.getI18nLabel(options.label),
|
|
1068
|
+
field: this.getFieldKeyName(widget),
|
|
1069
|
+
// type,
|
|
1070
|
+
// widgetType,
|
|
1071
|
+
// isRange,
|
|
1072
|
+
common: true,
|
|
1073
|
+
disabled: options.disabled,
|
|
1074
|
+
defaultValueEnabled: !!type,
|
|
1075
|
+
slot: options.name,
|
|
1076
|
+
widget: widget,
|
|
1077
|
+
formItem: false,
|
|
1078
|
+
...item,
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
let formRef = this.getFormRef();
|
|
1085
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
|
1086
|
+
this.dataTableConfig = dataTableConfig;
|
|
1087
|
+
|
|
1088
|
+
let columns = this.createColumns();
|
|
1089
|
+
this.widgets = columns
|
|
1090
|
+
.filter((column) => !!column?.params?.widget)
|
|
1091
|
+
.map((column) => column.params.widget);
|
|
1092
|
+
this.editWidgets = columns
|
|
1093
|
+
.filter((column) => !!column?.params?.editWidget)
|
|
1094
|
+
.map((column) => column.params.editWidget);
|
|
1095
|
+
|
|
1096
|
+
let height =
|
|
1097
|
+
this.widget.options.tableHeight || (isQueryTable ? "auto" : null);
|
|
1098
|
+
if (
|
|
1099
|
+
!this.widget.options.tableHeight &&
|
|
1100
|
+
isQueryTable &&
|
|
1101
|
+
this.previewState
|
|
1102
|
+
) {
|
|
1103
|
+
height = "550px";
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
let formConfig = this.formConfig;
|
|
1107
|
+
let scriptCode = this.getScriptCode();
|
|
1108
|
+
|
|
1109
|
+
let otherParam = {};
|
|
1110
|
+
let attachmentType = this.getAttachmentType();
|
|
1111
|
+
if (attachmentType.length) {
|
|
1112
|
+
otherParam.attachmentType = attachmentType;
|
|
1113
|
+
}
|
|
1114
|
+
let thirdtabm = this.getThirdtabm();
|
|
1115
|
+
if (thirdtabm.length) {
|
|
1116
|
+
otherParam.thirdtabm = thirdtabm;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
let pagerConfig = {};
|
|
1120
|
+
let editDefaultRow, treeNodeParam, treeConfig;
|
|
1121
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
|
1122
|
+
if (isTreeTable) {
|
|
1123
|
+
pagerConfig.pagerClass = "is--hidden";
|
|
1124
|
+
if (this.widget.options.editDefaultRow) {
|
|
1125
|
+
editDefaultRow = this.handleCustomEvent(
|
|
1126
|
+
this.widget.options.editDefaultRow
|
|
1127
|
+
);
|
|
1128
|
+
}
|
|
1129
|
+
treeNodeParam = (row) => {
|
|
1130
|
+
return {
|
|
1131
|
+
[this.widget.options.parentField]: row.id,
|
|
1132
|
+
};
|
|
1133
|
+
};
|
|
1134
|
+
treeConfig = {
|
|
1135
|
+
lazy: false,
|
|
1136
|
+
children: "f_children",
|
|
1137
|
+
hasChild: "f_has_child", // 设置是否有子节点标识
|
|
1138
|
+
parentField: "f_parent",
|
|
1139
|
+
transform: true,
|
|
1140
|
+
expandAll: true,
|
|
1141
|
+
loadMethod: ({ $table, row }) => {
|
|
1142
|
+
// 模拟后台接口
|
|
1143
|
+
let $grid = that.getGridTable();
|
|
1144
|
+
let parentField = $grid.treeConfig.parentField;
|
|
1145
|
+
return new Promise((resolve, reject) => {
|
|
1146
|
+
let treeParam = tableConfig?.treeNodeParam;
|
|
1147
|
+
let reqPram = {};
|
|
1148
|
+
if (treeParam) {
|
|
1149
|
+
reqPram = treeParam(row) || {};
|
|
1150
|
+
}
|
|
1151
|
+
Object.assign(reqPram, {
|
|
1152
|
+
[parentField]: row.id,
|
|
1153
|
+
});
|
|
1154
|
+
let accessParam = that.getAccessParam() || {};
|
|
1155
|
+
let defaultOption = that.getHttpConfigForUser();
|
|
1156
|
+
that.formHttp({
|
|
1157
|
+
scriptCode: scriptCode,
|
|
1158
|
+
data: {
|
|
1159
|
+
formCode: formCode,
|
|
1160
|
+
formVersion: reportTemplate.formVersion,
|
|
1161
|
+
taBm: that.fieldKeyName,
|
|
1162
|
+
data: {
|
|
1163
|
+
...reqPram,
|
|
1164
|
+
...otherParam,
|
|
1165
|
+
...accessParam,
|
|
1166
|
+
},
|
|
1167
|
+
},
|
|
1168
|
+
callback: (res) => {
|
|
1169
|
+
if (res.type === "success") {
|
|
1170
|
+
let items = this.handleTreeData(
|
|
1171
|
+
res.objx?.records || res.objx || []
|
|
1172
|
+
);
|
|
1173
|
+
if (res.objx?.records !== undefined) {
|
|
1174
|
+
res.objx.records = items;
|
|
1175
|
+
} else {
|
|
1176
|
+
res.objx = items;
|
|
1177
|
+
}
|
|
1178
|
+
let rows = res.objx
|
|
1179
|
+
? res.objx.records || res.objx || []
|
|
1180
|
+
: [];
|
|
1181
|
+
// let rows = res.objx
|
|
1182
|
+
// ? res.objx.records || res.objx || []
|
|
1183
|
+
// : [];
|
|
1184
|
+
// that.handleNullValue(rows);
|
|
1185
|
+
that.initExportFieldSchemaData(rows);
|
|
1186
|
+
/* rows.forEach((row, index) => {
|
|
1187
|
+
if (!row._X_ROW_KEY) {
|
|
1188
|
+
row._X_ROW_KEY = "row_" + generateId();
|
|
1189
|
+
}
|
|
1190
|
+
}); */
|
|
1191
|
+
|
|
1192
|
+
let hasChildField = $grid.treeConfig.hasChild;
|
|
1193
|
+
if (row[hasChildField] && !rows.length) {
|
|
1194
|
+
row[hasChildField] = false;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
resolve(rows);
|
|
1198
|
+
/* let treeCallback = tableConfig?.treeCallback;
|
|
1199
|
+
if (treeCallback) {
|
|
1200
|
+
that.$nextTick(() => {
|
|
1201
|
+
setTimeout(function () {
|
|
1202
|
+
treeCallback(rows);
|
|
1203
|
+
}, 0);
|
|
1204
|
+
});
|
|
1205
|
+
} */
|
|
1206
|
+
that.$nextTick(() => {
|
|
1207
|
+
setTimeout(function () {
|
|
1208
|
+
dataTableConfig.callback &&
|
|
1209
|
+
dataTableConfig.callback(rows);
|
|
1210
|
+
tableOption.callback && tableOption.callback(rows);
|
|
1211
|
+
tableConfig.treeCallback &&
|
|
1212
|
+
tableConfig.treeCallback(rows);
|
|
1213
|
+
}, 0);
|
|
1214
|
+
});
|
|
1215
|
+
} else {
|
|
1216
|
+
reject(res);
|
|
1217
|
+
}
|
|
1218
|
+
},
|
|
1219
|
+
});
|
|
1220
|
+
});
|
|
1221
|
+
},
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
let editOpts = {};
|
|
1225
|
+
if (this.widget.options.isEditTable) {
|
|
1226
|
+
// let editRules = {};
|
|
1227
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1228
|
+
if (!item.children?.length) {
|
|
1229
|
+
let editWidget = item.editWidget;
|
|
1230
|
+
if (editWidget && editWidget.options.required) {
|
|
1231
|
+
let formField = this.getFieldKeyName(editWidget);
|
|
1232
|
+
/* editRules[formField] = [
|
|
1233
|
+
{ required: true, message: `[${editWidget.options.label}]不能为空` }
|
|
1234
|
+
]; */
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
});
|
|
1238
|
+
editOpts = {
|
|
1239
|
+
keepSource: true,
|
|
1240
|
+
editConfig: {
|
|
1241
|
+
trigger: "manual",
|
|
1242
|
+
mode: "row",
|
|
1243
|
+
showStatus: true,
|
|
1244
|
+
autoClear: false,
|
|
1245
|
+
},
|
|
1246
|
+
// editRules
|
|
1247
|
+
};
|
|
1248
|
+
}
|
|
1249
|
+
let showFooter = this.widget.options.showGridFooter || false;
|
|
1250
|
+
let otherConfig = {};
|
|
1251
|
+
if (this.widget.options.hideGridCheckBox) {
|
|
1252
|
+
otherConfig.checkBoxRequired = false;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
let gridPageSize = this.widget.options.gridPageSize;
|
|
1256
|
+
if (gridPageSize === 1) {
|
|
1257
|
+
gridPageSize = null;
|
|
1258
|
+
}
|
|
1259
|
+
let gridPageSizeList = this.widget.options.gridPageSizeList || [];
|
|
1260
|
+
if (!gridPageSizeList || !gridPageSizeList.length) {
|
|
1261
|
+
pagerConfig.pageSizes = [50, 100, 200, 500];
|
|
1262
|
+
if (!gridPageSize) gridPageSize = 100;
|
|
1263
|
+
pagerConfig.pageSize = gridPageSize;
|
|
1264
|
+
} else {
|
|
1265
|
+
pagerConfig.pageSizes = gridPageSizeList
|
|
1266
|
+
.filter((item) => item.value)
|
|
1267
|
+
.map((item) => item.value);
|
|
1268
|
+
if (!gridPageSize) gridPageSize = pagerConfig.pageSizes[0];
|
|
1269
|
+
pagerConfig.pageSize = gridPageSize;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
//标题颜色
|
|
1273
|
+
let headerCellStyle = null;
|
|
1274
|
+
let tableColumns = this.widget.options.tableColumns;
|
|
1275
|
+
let colorMap = {};
|
|
1276
|
+
let flag = 0;
|
|
1277
|
+
/* tableColumns.forEach(item=>{
|
|
1278
|
+
if(item.labelColor){
|
|
1279
|
+
flag = 1;
|
|
1280
|
+
colorMap[item.columnId] = item.labelColor
|
|
1281
|
+
}
|
|
1282
|
+
}) */
|
|
1283
|
+
|
|
1284
|
+
this.loodHandleColumns(tableColumns, (item) => {
|
|
1285
|
+
if (item.labelColor) {
|
|
1286
|
+
flag = 1;
|
|
1287
|
+
colorMap[item.columnId] = item.labelColor;
|
|
1288
|
+
}
|
|
1289
|
+
});
|
|
1290
|
+
|
|
1291
|
+
if (flag) {
|
|
1292
|
+
headerCellStyle = (rowParam) => {
|
|
1293
|
+
let columnId = rowParam.column?.params?.columnId;
|
|
1294
|
+
if (columnId) {
|
|
1295
|
+
let color = colorMap[rowParam.column.params.columnId];
|
|
1296
|
+
if (color) {
|
|
1297
|
+
return `color:${color};`;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
let exportItemConfig = null;
|
|
1304
|
+
if (
|
|
1305
|
+
this.widget.options.exportItemColumns &&
|
|
1306
|
+
this.widget.options.exportItemColumns.length > 0
|
|
1307
|
+
) {
|
|
1308
|
+
let formatKeys = [
|
|
1309
|
+
"d1",
|
|
1310
|
+
"d2",
|
|
1311
|
+
"d3",
|
|
1312
|
+
"d4",
|
|
1313
|
+
"d5",
|
|
1314
|
+
"n1",
|
|
1315
|
+
"n2",
|
|
1316
|
+
"n3",
|
|
1317
|
+
"n4",
|
|
1318
|
+
"n5",
|
|
1319
|
+
"n6",
|
|
1320
|
+
"n7",
|
|
1321
|
+
];
|
|
1322
|
+
let exportItemColumns = this.widget.options.exportItemColumns.map(
|
|
1323
|
+
(item) => {
|
|
1324
|
+
let columnSlots = null;
|
|
1325
|
+
let columnParams = {};
|
|
1326
|
+
if (item.formatS === "render") {
|
|
1327
|
+
let r = item.render
|
|
1328
|
+
? new Function("params", "h", item.render)
|
|
1329
|
+
: null;
|
|
1330
|
+
columnSlots = {
|
|
1331
|
+
default: (params, h) => {
|
|
1332
|
+
return r ? r.call(this, params, h) : "";
|
|
1333
|
+
},
|
|
1334
|
+
};
|
|
1335
|
+
} else if (formatKeys.includes(item.formatS)) {
|
|
1336
|
+
columnSlots = {
|
|
1337
|
+
default: (params, h) => {
|
|
1338
|
+
let cellValue = params.row[params.column.field];
|
|
1339
|
+
return this.getFormatterValue(cellValue, item.formatS);
|
|
1340
|
+
},
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
if (item.exportType) {
|
|
1344
|
+
columnParams.exportType = item.exportType;
|
|
1345
|
+
}
|
|
1346
|
+
return {
|
|
1347
|
+
id: item.id,
|
|
1348
|
+
title: item.title,
|
|
1349
|
+
field: item.field,
|
|
1350
|
+
params: columnParams,
|
|
1351
|
+
slots: columnSlots,
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1354
|
+
);
|
|
1355
|
+
exportItemConfig = {
|
|
1356
|
+
scriptCode:
|
|
1357
|
+
this.widget.options.exportItemScriptCode ||
|
|
1358
|
+
this.widget.options.formScriptCode,
|
|
1359
|
+
columns: exportItemColumns,
|
|
1360
|
+
param: () => {
|
|
1361
|
+
if (this.widget.options.exportItemParam) {
|
|
1362
|
+
return this.handleCustomParam(
|
|
1363
|
+
this.widget.options.exportItemParam
|
|
1364
|
+
);
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
let rowConfig = {};
|
|
1370
|
+
if (this.widget.options.tableRowHeight) {
|
|
1371
|
+
rowConfig.height = this.widget.options.tableRowHeight;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
tableOption = {
|
|
1375
|
+
// vue: this,
|
|
1376
|
+
tableRef: tableRef,
|
|
1377
|
+
tableName: this.getGridTableName(),
|
|
1378
|
+
customAlign: false,
|
|
1379
|
+
param: paramFun,
|
|
1380
|
+
columns: columns,
|
|
1381
|
+
searchColumns: searchColumns,
|
|
1382
|
+
isQueryAllPage,
|
|
1383
|
+
exportItemConfig,
|
|
1384
|
+
vform: true,
|
|
1385
|
+
...(dataTableConfig.otherConfig || {}),
|
|
1386
|
+
config: {
|
|
1387
|
+
height: height,
|
|
1388
|
+
showFooter,
|
|
1389
|
+
pagerConfig,
|
|
1390
|
+
treeConfig,
|
|
1391
|
+
rowConfig,
|
|
1392
|
+
headerCellStyle,
|
|
1393
|
+
...editOpts,
|
|
1394
|
+
...dataTableConfig.config,
|
|
1395
|
+
|
|
1396
|
+
/*rowConfig:{
|
|
1397
|
+
height: 40
|
|
1398
|
+
},*/
|
|
1399
|
+
/*scrollX: {
|
|
1400
|
+
gt: 30,
|
|
1401
|
+
oSize: 10, //<!-- 每次渲染额外10行(缓冲区) -->
|
|
1402
|
+
rSize: 20 //<!-- 每次渲染30行(可视区行数) -->
|
|
1403
|
+
},
|
|
1404
|
+
scrollY: {
|
|
1405
|
+
gt: 100, //<!-- 超过100行启用虚拟滚动 -->
|
|
1406
|
+
oSize: 10, //<!-- 每次渲染额外10行(缓冲区) -->
|
|
1407
|
+
rSize: 30 //<!-- 每次渲染30行(可视区行数) -->
|
|
1408
|
+
}*/
|
|
1409
|
+
},
|
|
1410
|
+
exportAjax: (param, options) => {
|
|
1411
|
+
let $grid = this.getGridTable();
|
|
1412
|
+
let pageSize = param.size;
|
|
1413
|
+
let currentPage = param.current;
|
|
1414
|
+
let page = { pageSize, currentPage };
|
|
1415
|
+
let customParam = {
|
|
1416
|
+
config: {
|
|
1417
|
+
modal: false,
|
|
1418
|
+
},
|
|
1419
|
+
export: true,
|
|
1420
|
+
exportParam: options,
|
|
1421
|
+
};
|
|
1422
|
+
return $grid.$options.propsData.proxyConfig.ajax.query.call(this, {
|
|
1423
|
+
page,
|
|
1424
|
+
param,
|
|
1425
|
+
customParam,
|
|
1426
|
+
});
|
|
1427
|
+
},
|
|
1428
|
+
// treeNodeUrl,
|
|
1429
|
+
editDefaultRow,
|
|
1430
|
+
treeNodeParam,
|
|
1431
|
+
...otherConfig,
|
|
1432
|
+
// ...tableConfig2
|
|
1433
|
+
};
|
|
1434
|
+
|
|
1435
|
+
if (isQueryTable) {
|
|
1436
|
+
/*if(this.widget.options.isTreeTable){
|
|
1437
|
+
tableOption.config.pagerConfig.autoHidden = false;
|
|
1438
|
+
}*/
|
|
1439
|
+
tableOption.path = path;
|
|
1440
|
+
tableOption.config.proxyConfig = {
|
|
1441
|
+
props: {
|
|
1442
|
+
result: isDataPage ? "objx.records" : "objx", // 配置响应结果列表字段
|
|
1443
|
+
total: isDataPage ? "objx.total" : "objx.length", // 配置响应结果总页数字段
|
|
1444
|
+
},
|
|
1445
|
+
ajax: {
|
|
1446
|
+
// 接收 Promise 对象
|
|
1447
|
+
query: ({ page, sorts, filters, form, param, customParam }) => {
|
|
1448
|
+
let scriptCode = this.getScriptCode();
|
|
1449
|
+
let $grid = this.getGridTable();
|
|
1450
|
+
let originOption = $grid.params.originOption;
|
|
1451
|
+
let formData = {};
|
|
1452
|
+
|
|
1453
|
+
if (customParam?.exportParam?.type !== "exportItem") {
|
|
1454
|
+
//非导出明细
|
|
1455
|
+
formData = tableOption.param ? tableOption.param() || {} : {};
|
|
1456
|
+
}
|
|
1457
|
+
const queryParams = Object.assign({}, formData);
|
|
1458
|
+
|
|
1459
|
+
// 处理排序条件
|
|
1460
|
+
/*if (sorts) {
|
|
1461
|
+
const firstSort = sorts[0];
|
|
1462
|
+
if (firstSort) {
|
|
1463
|
+
queryParams.sort = firstSort.property;
|
|
1464
|
+
queryParams.order = firstSort.order;
|
|
1465
|
+
}
|
|
1466
|
+
}*/
|
|
1467
|
+
|
|
1468
|
+
// 处理筛选条件
|
|
1469
|
+
if (filters) {
|
|
1470
|
+
filters.forEach(({ property, values }) => {
|
|
1471
|
+
queryParams[property] = values.join(",");
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
if (page.pageSize !== undefined) {
|
|
1476
|
+
queryParams["size"] = page.pageSize;
|
|
1477
|
+
queryParams["current"] = page.currentPage;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
// let $grid = this.getGridTable();
|
|
1481
|
+
let isQueryAllPage = $grid.isQueryAllPage;
|
|
1482
|
+
let pathStr1 = "";
|
|
1483
|
+
/* if (isQueryAllPage === false) {
|
|
1484
|
+
queryParams.searchCount = false;
|
|
1485
|
+
} */
|
|
1486
|
+
queryParams.searchCount = isQueryAllPage !== false;
|
|
1487
|
+
Object.assign(queryParams, param);
|
|
1488
|
+
|
|
1489
|
+
// let formRef = that.getFormRef();
|
|
1490
|
+
// let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
|
1491
|
+
if (that.dataTableConfig.queryParam) {
|
|
1492
|
+
Object.assign(queryParams, that.dataTableConfig.queryParam);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
let reqPath = typeof path === "function" ? path() : path;
|
|
1496
|
+
let accessReturnType =
|
|
1497
|
+
this.widget.options.accessReturnType || "2";
|
|
1498
|
+
|
|
1499
|
+
return new Promise((resolve, reject) => {
|
|
1500
|
+
let reqData = {
|
|
1501
|
+
...queryParams,
|
|
1502
|
+
};
|
|
1503
|
+
if (scriptCode) {
|
|
1504
|
+
let index = 0;
|
|
1505
|
+
let toDo = () => {
|
|
1506
|
+
// let f = new Function("dataId", "formCode", "param", "done", accessScript);
|
|
1507
|
+
let done = (res) => {
|
|
1508
|
+
// this.clearRowWidgets();
|
|
1509
|
+
|
|
1510
|
+
let items = this.handleTreeData(
|
|
1511
|
+
res.objx?.records || res.objx || []
|
|
1512
|
+
);
|
|
1513
|
+
if (res.objx?.records !== undefined) {
|
|
1514
|
+
res.objx.records = items;
|
|
1515
|
+
} else {
|
|
1516
|
+
res.objx = items;
|
|
1517
|
+
}
|
|
1518
|
+
let rows = res.objx
|
|
1519
|
+
? res.objx.records || res.objx || []
|
|
1520
|
+
: [];
|
|
1521
|
+
// that.handleNullValue(rows);
|
|
1522
|
+
if (customParam?.export) {
|
|
1523
|
+
//导出
|
|
1524
|
+
this.initExportFieldSchemaData(rows);
|
|
1525
|
+
} else {
|
|
1526
|
+
this.initValue(rows);
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
resolve(res);
|
|
1530
|
+
if (res.type === "success") {
|
|
1531
|
+
if (that.widget.options.isTreeTable) {
|
|
1532
|
+
if (rows.length > 0) {
|
|
1533
|
+
let fullAllDataRowMap =
|
|
1534
|
+
$grid.$refs.xTable.fullAllDataRowMap;
|
|
1535
|
+
let parentField = $grid.treeConfig.parentField;
|
|
1536
|
+
let expandAll = $grid.treeConfig.expandAll || false;
|
|
1537
|
+
let isLazy = $grid.treeConfig.lazy;
|
|
1538
|
+
let expandIds = rows
|
|
1539
|
+
.filter((item) => item[parentField])
|
|
1540
|
+
.map((item) => item[parentField]);
|
|
1541
|
+
let expandRows = expandIds.length
|
|
1542
|
+
? rows.filter((item) =>
|
|
1543
|
+
expandIds.includes(item.id)
|
|
1544
|
+
)
|
|
1545
|
+
: [];
|
|
1546
|
+
if (expandAll && expandRows.length) {
|
|
1547
|
+
that.$nextTick(() => {
|
|
1548
|
+
setTimeout(function () {
|
|
1549
|
+
$grid.treeConfig.lazy = false;
|
|
1550
|
+
$grid.setTreeExpand(expandRows, true);
|
|
1551
|
+
expandRows.forEach((lineData) => {
|
|
1552
|
+
if (
|
|
1553
|
+
$grid.$refs.xTable.isTreeExpandByRow(
|
|
1554
|
+
lineData
|
|
1555
|
+
)
|
|
1556
|
+
) {
|
|
1557
|
+
let rest =
|
|
1558
|
+
fullAllDataRowMap.get(lineData);
|
|
1559
|
+
rest.treeLoaded = true;
|
|
1560
|
+
}
|
|
1561
|
+
});
|
|
1562
|
+
|
|
1563
|
+
$grid.treeConfig.lazy = isLazy;
|
|
1564
|
+
}, 0);
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
let row = rows.find((item) => !item[parentField]);
|
|
1569
|
+
if (
|
|
1570
|
+
row &&
|
|
1571
|
+
(!expandAll || !expandIds.includes(row.id))
|
|
1572
|
+
) {
|
|
1573
|
+
let hasChild = $grid.treeConfig.hasChild;
|
|
1574
|
+
if (row[hasChild]) {
|
|
1575
|
+
that.$nextTick(() => {
|
|
1576
|
+
setTimeout(function () {
|
|
1577
|
+
$grid.setTreeExpand(row, true);
|
|
1578
|
+
}, 0);
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
that.$nextTick(() => {
|
|
1585
|
+
setTimeout(function () {
|
|
1586
|
+
dataTableConfig.callback &&
|
|
1587
|
+
dataTableConfig.callback(rows);
|
|
1588
|
+
tableOption.callback && tableOption.callback(rows);
|
|
1589
|
+
that.handleCustomEvent(
|
|
1590
|
+
that.widget.options.formScriptCallback,
|
|
1591
|
+
["rows"],
|
|
1592
|
+
[rows]
|
|
1593
|
+
);
|
|
1594
|
+
}, 0);
|
|
1595
|
+
});
|
|
1596
|
+
}
|
|
1597
|
+
};
|
|
1598
|
+
this.loadDefaultQueryList(reqData, done, customParam);
|
|
1599
|
+
};
|
|
1600
|
+
let loopHandle = () => {
|
|
1601
|
+
if (index < 500 && $grid.tableFormStop === true) {
|
|
1602
|
+
//阻塞列表查询,或者次数达到500时,自动释放
|
|
1603
|
+
index++;
|
|
1604
|
+
setTimeout(() => {
|
|
1605
|
+
loopHandle();
|
|
1606
|
+
}, 10);
|
|
1607
|
+
} else {
|
|
1608
|
+
if ($grid.tableFormStop) $grid.tableFormStop = false;
|
|
1609
|
+
toDo();
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
loopHandle();
|
|
1613
|
+
} else {
|
|
1614
|
+
resolve();
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
},
|
|
1618
|
+
},
|
|
1619
|
+
};
|
|
1620
|
+
tableOption.callback = (rows) => {
|
|
1621
|
+
// this.fieldModel = rows;
|
|
1622
|
+
this.formModel[this.fieldKeyName] = rows;
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
if (isTreeTable) {
|
|
1627
|
+
tableOption.filterType = false;
|
|
1628
|
+
}
|
|
1629
|
+
tableOption = extendDeeply(tableOption, tableConfig);
|
|
1630
|
+
/* if (this.widget.options.tableConfig) {
|
|
1631
|
+
let tableConfig =
|
|
1632
|
+
this.handleCustomEvent(this.widget.options.tableConfig) || {};
|
|
1633
|
+
tableOption = extendDeeply(tableOption, tableConfig);
|
|
1634
|
+
this.tableConfig = tableConfig;
|
|
1635
|
+
} */
|
|
1636
|
+
|
|
1637
|
+
if (tableOption.config.showFooter && !tableOption.config.footerMethod) {
|
|
1638
|
+
let footerColumnIds = [];
|
|
1639
|
+
this.loodHandleColumns(columns, (item) => {
|
|
1640
|
+
if (!item.children?.length && !!item.params?.footerDataType) {
|
|
1641
|
+
footerColumnIds.push(item.params.columnId);
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
|
|
1645
|
+
/* let footerColumnIds = columns
|
|
1646
|
+
.filter((item) => !!item.params?.footerDataType)
|
|
1647
|
+
.map((item) => item.params.columnId); */
|
|
1648
|
+
if (footerColumnIds.length) {
|
|
1649
|
+
tableOption.config.footerMethod = (param) => {
|
|
1650
|
+
let { columns: column1s, data } = param;
|
|
1651
|
+
return [
|
|
1652
|
+
column1s.map((column, columnIndex) => {
|
|
1653
|
+
let columnId = column.params?.columnId;
|
|
1654
|
+
if (columnId && footerColumnIds.includes(columnId)) {
|
|
1655
|
+
let footerDataType = column.params.footerDataType;
|
|
1656
|
+
if (footerDataType === "1") {
|
|
1657
|
+
//求和
|
|
1658
|
+
return this.sumNum(data, column.field);
|
|
1659
|
+
} else if (footerDataType === "2") {
|
|
1660
|
+
//求平均值
|
|
1661
|
+
return this.meanNum(data, column.field);
|
|
1662
|
+
} else if (footerDataType === "3") {
|
|
1663
|
+
if (column.params.footerMethodConfg) {
|
|
1664
|
+
let n = new Function(
|
|
1665
|
+
"dataId",
|
|
1666
|
+
"formCode",
|
|
1667
|
+
"param",
|
|
1668
|
+
column.params.footerMethodConfg
|
|
1669
|
+
);
|
|
1670
|
+
return n.call(this, dataId, formCode, param) ?? null;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
return null;
|
|
1675
|
+
}),
|
|
1676
|
+
];
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
tableOption.vue = this;
|
|
1681
|
+
|
|
1682
|
+
//合并单元格
|
|
1683
|
+
let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
|
|
1684
|
+
let unikey = this.widget.options.mergeRowKey;
|
|
1685
|
+
if (mergeRowEnabled && unikey) {
|
|
1686
|
+
tableOption.config.spanMethod = this.mergeRowMethod;
|
|
1687
|
+
}
|
|
1688
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
1689
|
+
this.vxeOption = opts;
|
|
1690
|
+
if (!isQueryTable) {
|
|
1691
|
+
setTimeout(() => {
|
|
1692
|
+
this.loadAccessData(1);
|
|
1693
|
+
}, 20);
|
|
1694
|
+
}
|
|
1695
|
+
});
|
|
1696
|
+
},
|
|
1697
|
+
loodHandleColumns(columns, callback) {
|
|
1698
|
+
let columnLoopDo = (t, e) => {
|
|
1699
|
+
callback && callback(t);
|
|
1700
|
+
if (t.children && t.children.length) {
|
|
1701
|
+
this.loodHandleColumns(t.children, callback);
|
|
1702
|
+
/* for (let item of t.children) {
|
|
1703
|
+
columnLoopDo(item);
|
|
1704
|
+
} */
|
|
1705
|
+
}
|
|
1706
|
+
};
|
|
1707
|
+
for (let item of columns) {
|
|
1708
|
+
columnLoopDo(item);
|
|
1709
|
+
}
|
|
1710
|
+
},
|
|
1711
|
+
|
|
1712
|
+
meanNum(list, field) {
|
|
1713
|
+
let count = this.sumNum(list, field);
|
|
1714
|
+
return this.$baseDiv(count, list.length);
|
|
1715
|
+
},
|
|
1716
|
+
sumNum(list, field) {
|
|
1717
|
+
let count = 0;
|
|
1718
|
+
list.forEach((item) => {
|
|
1719
|
+
count = this.$baseAdd(count, item[field]);
|
|
1720
|
+
});
|
|
1721
|
+
return count;
|
|
1722
|
+
},
|
|
1723
|
+
getSearchFormData() {
|
|
1724
|
+
let map = { condition: [] };
|
|
1725
|
+
let formData = this.globalModel.formModel;
|
|
1726
|
+
let widgetList = this.widget.widgetList;
|
|
1727
|
+
if (!!widgetList && widgetList.length > 0) {
|
|
1728
|
+
let loop = (wItem) => {
|
|
1729
|
+
if (wItem.category === "container") {
|
|
1730
|
+
loop(wItem);
|
|
1731
|
+
} else {
|
|
1732
|
+
let formField = this.getFieldKeyName(wItem);
|
|
1733
|
+
let vaule = formData[formField];
|
|
1734
|
+
if (vaule !== null && vaule !== undefined && vaule !== "") {
|
|
1735
|
+
if (!Array.isArray(vaule) || vaule.length > 0) {
|
|
1736
|
+
let item = {
|
|
1737
|
+
value: vaule,
|
|
1738
|
+
field: formField,
|
|
1739
|
+
filter: null,
|
|
1740
|
+
};
|
|
1741
|
+
let wType = wItem.type;
|
|
1742
|
+
if (["date-range", "time-range"].includes(wType)) {
|
|
1743
|
+
item.filter = "between";
|
|
1744
|
+
} else if (
|
|
1745
|
+
["input-batch", "checkbox"].includes(wType) ||
|
|
1746
|
+
(wType === "select" && wItem.options.multiple)
|
|
1747
|
+
) {
|
|
1748
|
+
item.filter = "in";
|
|
1749
|
+
} else if (
|
|
1750
|
+
["radio", "time", "date"].includes(wType) ||
|
|
1751
|
+
(wType === "select" && !wItem.options.multiple)
|
|
1752
|
+
) {
|
|
1753
|
+
item.filter = "eq";
|
|
1754
|
+
} else {
|
|
1755
|
+
item.filter = "like";
|
|
1756
|
+
}
|
|
1757
|
+
map.condition.push(item);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
};
|
|
1762
|
+
widgetList.forEach((wItem) => {
|
|
1763
|
+
loop(wItem);
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
return map;
|
|
1767
|
+
},
|
|
1768
|
+
getUrl() {
|
|
1769
|
+
let accessUrl = this.widget.options.accessUrl;
|
|
1770
|
+
return accessUrl || USER_PREFIX + `/form_ins/getFormInsData`;
|
|
1771
|
+
},
|
|
1772
|
+
getAttachmentType() {
|
|
1773
|
+
/* let vailColumns = this.widget.options.tableColumns.filter(
|
|
1774
|
+
(item) => item.prop && item.label
|
|
1775
|
+
);
|
|
1776
|
+
let result = vailColumns
|
|
1777
|
+
.filter((item) => {
|
|
1778
|
+
return item.formatS === "editAttachment";
|
|
1779
|
+
})
|
|
1780
|
+
.map((item) => item.prop); */
|
|
1781
|
+
|
|
1782
|
+
let result = [];
|
|
1783
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1784
|
+
if (!item.children?.length && item.prop && item.label) {
|
|
1785
|
+
if (item.formatS === "editAttachment") {
|
|
1786
|
+
result.push(item.prop);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
});
|
|
1790
|
+
return result;
|
|
1791
|
+
},
|
|
1792
|
+
getThirdtabm() {
|
|
1793
|
+
/* let vailColumns = this.widget.options.tableColumns.filter(
|
|
1794
|
+
(item) => item.prop && item.label
|
|
1795
|
+
);
|
|
1796
|
+
let result = vailColumns
|
|
1797
|
+
.filter((item) => {
|
|
1798
|
+
return (
|
|
1799
|
+
item.formatS === "editSearch" && item.columnOption.multipleChoices
|
|
1800
|
+
);
|
|
1801
|
+
})
|
|
1802
|
+
.map((item) => item.prop); */
|
|
1803
|
+
let result = [];
|
|
1804
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
1805
|
+
if (!item.children?.length && item.prop && item.label) {
|
|
1806
|
+
if (
|
|
1807
|
+
item.formatS === "editSearch" &&
|
|
1808
|
+
item.widget?.options?.multipleChoices
|
|
1809
|
+
) {
|
|
1810
|
+
result.push(item.prop);
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
});
|
|
1814
|
+
return result;
|
|
1815
|
+
},
|
|
1816
|
+
|
|
1817
|
+
loadDefaultViewList(option) {
|
|
1818
|
+
let dataId = this.formDataId;
|
|
1819
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
|
1820
|
+
let formCode = reportTemplate.formCode;
|
|
1821
|
+
let accessParam = this.getAccessParam() || {};
|
|
1822
|
+
let otherParam = {};
|
|
1823
|
+
let attachmentType = this.getAttachmentType();
|
|
1824
|
+
if (attachmentType.length) {
|
|
1825
|
+
otherParam.attachmentType = attachmentType;
|
|
1826
|
+
}
|
|
1827
|
+
let thirdtabm = this.getThirdtabm();
|
|
1828
|
+
if (thirdtabm.length) {
|
|
1829
|
+
otherParam.thirdtabm = thirdtabm;
|
|
1830
|
+
}
|
|
1831
|
+
let scriptCode = this.getScriptCode();
|
|
1832
|
+
return this.formHttp({
|
|
1833
|
+
/*url: "/" + reportTemplate.serviceName + "/form_ins/getList",*/
|
|
1834
|
+
scriptCode: scriptCode,
|
|
1835
|
+
data: {
|
|
1836
|
+
formCode: formCode,
|
|
1837
|
+
formVersion: reportTemplate.formVersion,
|
|
1838
|
+
taBm: this.fieldKeyName,
|
|
1839
|
+
data: {
|
|
1840
|
+
id: dataId,
|
|
1841
|
+
...otherParam,
|
|
1842
|
+
...accessParam,
|
|
1843
|
+
},
|
|
1844
|
+
},
|
|
1845
|
+
callback: (res) => {
|
|
1846
|
+
let $grid = this.getGridTable();
|
|
1847
|
+
// let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
1848
|
+
|
|
1849
|
+
let items = this.handleTreeData(res.objx?.records || res.objx || []);
|
|
1850
|
+
if (res.objx?.records !== undefined) {
|
|
1851
|
+
res.objx.records = items;
|
|
1852
|
+
} else {
|
|
1853
|
+
res.objx = items;
|
|
1854
|
+
}
|
|
1855
|
+
let rows = res.objx ? res.objx.records || res.objx || [] : [];
|
|
1856
|
+
|
|
1857
|
+
// that.handleNullValue(rows);
|
|
1858
|
+
let defaultRow = this.createNewTableData();
|
|
1859
|
+
rows = rows.map((row) => {
|
|
1860
|
+
return {
|
|
1861
|
+
...defaultRow,
|
|
1862
|
+
...row,
|
|
1863
|
+
};
|
|
1864
|
+
});
|
|
1865
|
+
this.initValue(rows);
|
|
1866
|
+
this.$nextTick(() => {
|
|
1867
|
+
/*if (this.widget.options.isTreeTable) {
|
|
1868
|
+
let $grid = this.getGridTable();
|
|
1869
|
+
$grid.treeConfig.lazy = false;
|
|
1870
|
+
$grid.setAllTreeExpand(true);
|
|
1871
|
+
}*/
|
|
1872
|
+
this.tableConfig.callback && this.tableConfig.callback(rows);
|
|
1873
|
+
this.handleCustomEvent(
|
|
1874
|
+
this.widget.options.formScriptCallback,
|
|
1875
|
+
["rows"],
|
|
1876
|
+
[rows]
|
|
1877
|
+
);
|
|
1878
|
+
this.$forceUpdate();
|
|
1879
|
+
});
|
|
1880
|
+
},
|
|
1881
|
+
});
|
|
1882
|
+
},
|
|
1883
|
+
getAccessParam() {
|
|
1884
|
+
if (!this.widget.options.formScriptParam) return;
|
|
1885
|
+
return this.handleCustomEvent(this.widget.options.formScriptParam);
|
|
1886
|
+
},
|
|
1887
|
+
getScriptCode() {
|
|
1888
|
+
let accessReturnType = this.widget.options.accessReturnType;
|
|
1889
|
+
let defaultScriptCode = "getList";
|
|
1890
|
+
if (accessReturnType === "1") {
|
|
1891
|
+
defaultScriptCode = "getList";
|
|
1892
|
+
} else if (accessReturnType === "2") {
|
|
1893
|
+
defaultScriptCode = "getPage";
|
|
1894
|
+
}
|
|
1895
|
+
let scriptCode = this.widget.options.formScriptCode || defaultScriptCode;
|
|
1896
|
+
return scriptCode;
|
|
1897
|
+
},
|
|
1898
|
+
loadDefaultQueryList(reqData, done, customParam) {
|
|
1899
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
|
1900
|
+
let prefix = "/" + reportTemplate.serviceName;
|
|
1901
|
+
let formCode = reportTemplate.formCode;
|
|
1902
|
+
let formConfig = this.formConfig;
|
|
1903
|
+
let accessReturnType = this.widget.options.accessReturnType;
|
|
1904
|
+
let scriptCode = this.getScriptCode();
|
|
1905
|
+
let accessParam = {};
|
|
1906
|
+
let otherParam = {};
|
|
1907
|
+
if (customParam?.exportParam?.type === "exportItem") {
|
|
1908
|
+
let $grid = this.getGridTable();
|
|
1909
|
+
let originOption = $grid.params.originOption;
|
|
1910
|
+
let exportItemConfig = originOption.exportItemConfig || {};
|
|
1911
|
+
if (exportItemConfig.scriptCode) {
|
|
1912
|
+
scriptCode = exportItemConfig.scriptCode;
|
|
1913
|
+
}
|
|
1914
|
+
if (exportItemConfig.columns?.length) {
|
|
1915
|
+
let result = [];
|
|
1916
|
+
this.loodHandleColumns(exportItemConfig.columns, (item) => {
|
|
1917
|
+
if (!item.children?.length && item.field && item.title) {
|
|
1918
|
+
if (item.field.startsWith("attachments_")) {
|
|
1919
|
+
result.push(item.field);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
if (result.length) {
|
|
1924
|
+
otherParam.attachmentType = result;
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
let ids = $grid.getCheckboxRecords(true).map((item) => {
|
|
1928
|
+
return item.id;
|
|
1929
|
+
});
|
|
1930
|
+
|
|
1931
|
+
if (originOption.exportItemConfig.param) {
|
|
1932
|
+
accessParam = originOption.exportItemConfig.param() || {};
|
|
1933
|
+
}
|
|
1934
|
+
accessParam.ids = ids;
|
|
1935
|
+
} else {
|
|
1936
|
+
accessParam = this.getAccessParam() || {};
|
|
1937
|
+
let attachmentType = this.getAttachmentType();
|
|
1938
|
+
if (attachmentType.length) {
|
|
1939
|
+
otherParam.attachmentType = attachmentType;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
let defaultOption = this.getHttpConfigForUser();
|
|
1944
|
+
|
|
1945
|
+
let ajaxConfig = customParam?.config || {};
|
|
1946
|
+
|
|
1947
|
+
let requestData = {
|
|
1948
|
+
...reqData,
|
|
1949
|
+
...otherParam,
|
|
1950
|
+
};
|
|
1951
|
+
requestData = extendDeeply(requestData, accessParam);
|
|
1952
|
+
|
|
1953
|
+
return this.formHttp({
|
|
1954
|
+
// url: prefix + "/form_ins/getPage",
|
|
1955
|
+
scriptCode: scriptCode,
|
|
1956
|
+
data: {
|
|
1957
|
+
formCode: formCode,
|
|
1958
|
+
formVersion: reportTemplate.formVersion,
|
|
1959
|
+
taBm: this.fieldKeyName,
|
|
1960
|
+
data: requestData,
|
|
1961
|
+
},
|
|
1962
|
+
isLoading: false,
|
|
1963
|
+
...defaultOption,
|
|
1964
|
+
...ajaxConfig,
|
|
1965
|
+
callback: (res) => {
|
|
1966
|
+
done(res);
|
|
1967
|
+
},
|
|
1968
|
+
});
|
|
1969
|
+
},
|
|
1970
|
+
loadAccessData(flag) {
|
|
1971
|
+
if (
|
|
1972
|
+
this.formModel[this.fieldKeyName] &&
|
|
1973
|
+
this.formModel[this.fieldKeyName].length
|
|
1974
|
+
) {
|
|
1975
|
+
this.initValue(this.formModel[this.fieldKeyName]);
|
|
1976
|
+
}
|
|
1977
|
+
if (flag === 1) {
|
|
1978
|
+
let tableConfig = this.tableConfig;
|
|
1979
|
+
let accessEnabled = tableConfig.accessEnabled ?? true;
|
|
1980
|
+
if (accessEnabled === false) {
|
|
1981
|
+
return;
|
|
1982
|
+
}
|
|
1983
|
+
if (this.formConfig.isLoadEntity && !this.formDataId) {
|
|
1984
|
+
return;
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
let scriptCode = this.getScriptCode();
|
|
1989
|
+
if (scriptCode) {
|
|
1990
|
+
this.loadDefaultViewList();
|
|
1991
|
+
}
|
|
1992
|
+
},
|
|
1993
|
+
getReqParam(item, dataId, billData) {
|
|
1994
|
+
let param = {};
|
|
1995
|
+
if (item.accessParam) {
|
|
1996
|
+
if (typeof item.accessParam === "string") {
|
|
1997
|
+
let n = new Function("billData", item.accessParam);
|
|
1998
|
+
param = n.call(this, billData);
|
|
1999
|
+
} else {
|
|
2000
|
+
param = item.accessParam;
|
|
2001
|
+
}
|
|
2002
|
+
} else {
|
|
2003
|
+
param = { id: dataId };
|
|
2004
|
+
}
|
|
2005
|
+
return param;
|
|
2006
|
+
},
|
|
2007
|
+
getTableRef() {
|
|
2008
|
+
let tableRef = this.widget.id;
|
|
2009
|
+
return tableRef;
|
|
2010
|
+
},
|
|
2011
|
+
exportData(option) {
|
|
2012
|
+
let tableRef = this.getTableRef();
|
|
2013
|
+
let serviceName = this.getFormRef().reportTemplate.serviceName;
|
|
2014
|
+
option.prefix = option.prefix || "/" + serviceName;
|
|
2015
|
+
let exportTableTarget = this.$refs.exportTable;
|
|
2016
|
+
let getExportTableRef = () => {
|
|
2017
|
+
return exportTableTarget;
|
|
2018
|
+
};
|
|
2019
|
+
this.$excelExport({ targetRef: tableRef, ...option });
|
|
2020
|
+
},
|
|
2021
|
+
async deleteRow(row, rowIndex) {
|
|
2022
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
|
2023
|
+
if (isTreeTable) {
|
|
2024
|
+
this.removeTreeRow({ row });
|
|
2025
|
+
return;
|
|
2026
|
+
}
|
|
2027
|
+
delete this.fieldSchemaMap[row._X_ROW_KEY];
|
|
2028
|
+
let $grid = this.getGridTable();
|
|
2029
|
+
$grid.remove(row);
|
|
2030
|
+
let tableData = $grid.getTableData();
|
|
2031
|
+
let isEditTable = this.widget.options.isEditTable;
|
|
2032
|
+
let fullData = !isEditTable ? tableData.fullData : tableData.tableData;
|
|
2033
|
+
this.formModel[this.fieldKeyName] = fullData;
|
|
2034
|
+
this.fieldModel = fullData;
|
|
2035
|
+
this.$nextTick(() => {
|
|
2036
|
+
this.handleWbs();
|
|
2037
|
+
});
|
|
2038
|
+
// this.deleteRowWidgets(row);
|
|
2039
|
+
},
|
|
2040
|
+
isSingerlSearch(widget) {
|
|
2041
|
+
let widgetType = widget?.type;
|
|
2042
|
+
let result =
|
|
2043
|
+
widgetType === "singerSearch" ||
|
|
2044
|
+
(widgetType === "vabsearch" && !widget.options.multipleChoices);
|
|
2045
|
+
return result;
|
|
2046
|
+
},
|
|
2047
|
+
getColumnNullValue(widget, defaultValueEnabled) {
|
|
2048
|
+
if (!widget) return null;
|
|
2049
|
+
let nullValue = null;
|
|
2050
|
+
let widgetType = widget.type;
|
|
2051
|
+
let multiWidgetTypes = [
|
|
2052
|
+
"checkbox",
|
|
2053
|
+
"time-range",
|
|
2054
|
+
"baseAttachment",
|
|
2055
|
+
"vabUpload",
|
|
2056
|
+
"project-tag",
|
|
2057
|
+
];
|
|
2058
|
+
|
|
2059
|
+
let defaultValue = widget.options.defaultValue;
|
|
2060
|
+
if (
|
|
2061
|
+
defaultValue !== undefined &&
|
|
2062
|
+
defaultValue !== null &&
|
|
2063
|
+
defaultValue !== "" &&
|
|
2064
|
+
defaultValueEnabled !== false
|
|
2065
|
+
) {
|
|
2066
|
+
nullValue = defaultValue;
|
|
2067
|
+
} else if (widgetType === "select" && widget.options.multiple) {
|
|
2068
|
+
nullValue = [];
|
|
2069
|
+
} else if (widgetType === "date" && widget.options.type === "dates") {
|
|
2070
|
+
nullValue = [];
|
|
2071
|
+
} else if (widgetType === "vabsearch" && widget.options.multipleChoices) {
|
|
2072
|
+
nullValue = [];
|
|
2073
|
+
} else if (multiWidgetTypes.includes(widgetType)) {
|
|
2074
|
+
nullValue = [];
|
|
2075
|
+
}
|
|
2076
|
+
return nullValue;
|
|
2077
|
+
},
|
|
2078
|
+
getIsFormWidget(widget) {
|
|
2079
|
+
let widgetTypes = ["baseAttachment"];
|
|
2080
|
+
let result = false;
|
|
2081
|
+
if (widget.formItemFlag) {
|
|
2082
|
+
result = true;
|
|
2083
|
+
}
|
|
2084
|
+
return result;
|
|
2085
|
+
},
|
|
2086
|
+
handleWidgetNullValue(widget, newData) {
|
|
2087
|
+
if (!widget || !newData) return;
|
|
2088
|
+
if (this.getIsFormWidget(widget)) {
|
|
2089
|
+
let field = this.getFieldKeyName(widget);
|
|
2090
|
+
let nullValue = newData.hasOwnProperty(field)
|
|
2091
|
+
? null
|
|
2092
|
+
: this.getColumnNullValue(widget);
|
|
2093
|
+
newData[field] = nullValue;
|
|
2094
|
+
if (this.isSingerlSearch(widget)) {
|
|
2095
|
+
let vabSearchName = widget.options.vabSearchName;
|
|
2096
|
+
if (vabSearchName) newData[vabSearchName] = null;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
},
|
|
2100
|
+
createNewTableData(isEdit, defaultValueEnabled = true) {
|
|
2101
|
+
let newData = {};
|
|
2102
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
|
|
2103
|
+
if (!item.children?.length && item.prop && item.label) {
|
|
2104
|
+
let formatS = !isEdit ? item.formatS : item.editFormatS;
|
|
2105
|
+
let widget = null;
|
|
2106
|
+
if (isEdit) {
|
|
2107
|
+
widget = item.editWidget || item.widget;
|
|
2108
|
+
} else {
|
|
2109
|
+
widget = item.widget;
|
|
2110
|
+
}
|
|
2111
|
+
if (formatS === "widgetRender") {
|
|
2112
|
+
if (item.widgetList) {
|
|
2113
|
+
loopHandleWidget(item.widgetList, (w, p) => {
|
|
2114
|
+
this.handleWidgetNullValue(w, newData, defaultValueEnabled);
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
} else {
|
|
2118
|
+
if (widget) {
|
|
2119
|
+
this.handleWidgetNullValue(widget, newData, defaultValueEnabled);
|
|
2120
|
+
} else {
|
|
2121
|
+
newData[item.prop] = null;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
});
|
|
2126
|
+
return newData;
|
|
2127
|
+
},
|
|
2128
|
+
addTableData(rows, field) {
|
|
2129
|
+
let $grid = this.getGridTable();
|
|
2130
|
+
let formDataModel = this.formModel;
|
|
2131
|
+
let tableRows = formDataModel[this.fieldKeyName] || [];
|
|
2132
|
+
let fullData = $grid.getTableData().fullData;
|
|
2133
|
+
let items;
|
|
2134
|
+
if (field) {
|
|
2135
|
+
let keys = fullData.map((item) => {
|
|
2136
|
+
return item[field] + "";
|
|
2137
|
+
});
|
|
2138
|
+
items = rows.filter((item) => {
|
|
2139
|
+
let value = item[field] + "";
|
|
2140
|
+
return !keys.includes(value);
|
|
2141
|
+
});
|
|
2142
|
+
} else {
|
|
2143
|
+
items = rows;
|
|
2144
|
+
}
|
|
2145
|
+
if (items) {
|
|
2146
|
+
if (items.length) {
|
|
2147
|
+
items.forEach((row) => {
|
|
2148
|
+
let newData = this.createNewTableData();
|
|
2149
|
+
Object.assign(newData, row);
|
|
2150
|
+
|
|
2151
|
+
tableRows.push(newData);
|
|
2152
|
+
});
|
|
2153
|
+
}
|
|
2154
|
+
} else {
|
|
2155
|
+
let newData = this.createNewTableData();
|
|
2156
|
+
tableRows.push(newData);
|
|
2157
|
+
}
|
|
2158
|
+
// this.formModel[this.fieldKeyName] = this.$baseLodash(this.fieldModel)
|
|
2159
|
+
// this.fieldModel = tableRows
|
|
2160
|
+
this.setValue(tableRows);
|
|
2161
|
+
this.$nextTick(() => {
|
|
2162
|
+
this.handleWbs();
|
|
2163
|
+
});
|
|
2164
|
+
// $grid.loadData(tableRows);
|
|
2165
|
+
},
|
|
2166
|
+
getColumnWidgetConfig(row, isEdit) {
|
|
2167
|
+
let formatS = isEdit ? row.editFormatS : row.formatS;
|
|
2168
|
+
let formRef = this.getFormRef();
|
|
2169
|
+
let columnSelectedWidget = null;
|
|
2170
|
+
let columnEditFields = null;
|
|
2171
|
+
|
|
2172
|
+
let type = columnFormatMap[formatS];
|
|
2173
|
+
|
|
2174
|
+
if (type) {
|
|
2175
|
+
columnSelectedWidget = this.$baseLodash.cloneDeep(
|
|
2176
|
+
formRef.getFieldWidgetByType(type)
|
|
2177
|
+
);
|
|
2178
|
+
let tmpId = generateId();
|
|
2179
|
+
let idVal = row.prop ? row.prop : type + tmpId;
|
|
2180
|
+
/*
|
|
2181
|
+
columnSelectedWidget.id = idVal;*/
|
|
2182
|
+
/*if(isEdit){
|
|
2183
|
+
columnSelectedWidget.id = "edit_"+row.columnId;
|
|
2184
|
+
}else{
|
|
2185
|
+
columnSelectedWidget.id = row.columnId;
|
|
2186
|
+
}*/
|
|
2187
|
+
// columnSelectedWidget.id = row.columnId;
|
|
2188
|
+
|
|
2189
|
+
columnSelectedWidget.options.name = idVal;
|
|
2190
|
+
|
|
2191
|
+
let columnOption;
|
|
2192
|
+
if (!isEdit) {
|
|
2193
|
+
columnOption = row.columnOption;
|
|
2194
|
+
} else {
|
|
2195
|
+
columnOption = row.editColumnOption;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
if (columnOption && Object.keys(columnOption).length) {
|
|
2199
|
+
columnOption.required = row.required || false;
|
|
2200
|
+
columnSelectedWidget.options = columnOption;
|
|
2201
|
+
if ("editDelete" === formatS) {
|
|
2202
|
+
columnSelectedWidget.options.hiddenByWf =
|
|
2203
|
+
columnSelectedWidget.options.hiddenByWf ?? true;
|
|
2204
|
+
columnSelectedWidget.options.prefixIcon =
|
|
2205
|
+
columnSelectedWidget.options.prefixIcon || "el-icon-delete";
|
|
2206
|
+
} else if ("editButton" === formatS) {
|
|
2207
|
+
columnSelectedWidget.options.prefixIcon =
|
|
2208
|
+
columnSelectedWidget.options.prefixIcon || "el-icon-edit";
|
|
2209
|
+
}
|
|
2210
|
+
} else {
|
|
2211
|
+
columnSelectedWidget.options.required = row.required || false;
|
|
2212
|
+
if ("editDelete" === formatS) {
|
|
2213
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-delete";
|
|
2214
|
+
columnSelectedWidget.options.label = "删除";
|
|
2215
|
+
columnSelectedWidget.options.labelHidden = true;
|
|
2216
|
+
columnSelectedWidget.options.hiddenByWf = true;
|
|
2217
|
+
columnSelectedWidget.options.onClick =
|
|
2218
|
+
"let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.deleteRow(tableParam.row,tableParam.rowIndex);";
|
|
2219
|
+
} else if ("editButton" === formatS) {
|
|
2220
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-edit";
|
|
2221
|
+
columnSelectedWidget.options.label = "查看";
|
|
2222
|
+
columnSelectedWidget.options.labelHidden = true;
|
|
2223
|
+
columnSelectedWidget.options.onClick =
|
|
2224
|
+
"let tableParam = this.tableParam;\nlet tableRef = this.getWidgetRef(this.parentWidget.options.name);\ntableRef.openEditDialog(tableParam.row)";
|
|
2225
|
+
} else if ("addSiblingEditRow" === formatS) {
|
|
2226
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2227
|
+
columnSelectedWidget.options.label = "新增兄弟节点";
|
|
2228
|
+
columnSelectedWidget.options.labelHidden = false;
|
|
2229
|
+
columnSelectedWidget.options.onClick =
|
|
2230
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().addSiblingTreeRow(null,tableParam);";
|
|
2231
|
+
} else if ("addChildTreeRow" === formatS) {
|
|
2232
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2233
|
+
columnSelectedWidget.options.label = "新增子节点";
|
|
2234
|
+
columnSelectedWidget.options.labelHidden = false;
|
|
2235
|
+
columnSelectedWidget.options.onClick =
|
|
2236
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().addChildTreeRow(null,tableParam);";
|
|
2237
|
+
} else if ("moveUpRow" === formatS) {
|
|
2238
|
+
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2239
|
+
columnSelectedWidget.options.label = "↑上移";
|
|
2240
|
+
columnSelectedWidget.options.labelHidden = false;
|
|
2241
|
+
columnSelectedWidget.options.onClick =
|
|
2242
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().moveUpRow(tableParam);";
|
|
2243
|
+
} else if ("moveDownRow" === formatS) {
|
|
2244
|
+
// columnSelectedWidget.options.prefixIcon = "el-icon-plus";
|
|
2245
|
+
columnSelectedWidget.options.label = "↓下移";
|
|
2246
|
+
columnSelectedWidget.options.labelHidden = false;
|
|
2247
|
+
columnSelectedWidget.options.onClick =
|
|
2248
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().moveDownRow(tableParam);";
|
|
2249
|
+
} else if ("removeTreeRow" === formatS) {
|
|
2250
|
+
columnSelectedWidget.options.prefixIcon = "el-icon-delete";
|
|
2251
|
+
columnSelectedWidget.options.label = "删除";
|
|
2252
|
+
columnSelectedWidget.options.labelHidden = true;
|
|
2253
|
+
columnSelectedWidget.options.onClick =
|
|
2254
|
+
"let tableParam = this.tableParam;\nthis.getParentTarget().removeTreeRow(tableParam);";
|
|
2255
|
+
}
|
|
2256
|
+
columnOption = columnSelectedWidget.options;
|
|
2257
|
+
}
|
|
2258
|
+
if (columnSelectedWidget.options.hasOwnProperty("keyName")) {
|
|
2259
|
+
columnSelectedWidget.options.keyName = row.prop;
|
|
2260
|
+
columnSelectedWidget.options.keyNameEnabled = true;
|
|
2261
|
+
} else {
|
|
2262
|
+
columnSelectedWidget.options.name = row.prop;
|
|
2263
|
+
}
|
|
2264
|
+
if (type !== "button" && type !== "a-link") {
|
|
2265
|
+
columnSelectedWidget.options.label = row.label;
|
|
2266
|
+
columnSelectedWidget.options.labelHidden = true;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
return { columnSelectedWidget, columnEditFields };
|
|
2270
|
+
},
|
|
2271
|
+
getColumnProp2(fieldWidget, obj) {
|
|
2272
|
+
let isQueryTable = this.widget.options.isQueryTable || false;
|
|
2273
|
+
let rowWidget = this.getRowWidget(obj, fieldWidget);
|
|
2274
|
+
let required = rowWidget.options.required || false;
|
|
2275
|
+
|
|
2276
|
+
let fieldKeyName = this.getFieldKeyName(this.widget);
|
|
2277
|
+
let property = this.getFieldKeyName(rowWidget);
|
|
2278
|
+
if (this.isVabsearchFlagWidget(rowWidget)) {
|
|
2279
|
+
property = rowWidget.options.vabSearchName || property;
|
|
2280
|
+
}
|
|
2281
|
+
let rowIndex = Math.max(obj.rowIndex, 0);
|
|
2282
|
+
|
|
2283
|
+
let propName = fieldKeyName + "." + rowIndex + "." + property;
|
|
2284
|
+
if (isQueryTable && !required) {
|
|
2285
|
+
propName = "false";
|
|
2286
|
+
}
|
|
2287
|
+
return propName;
|
|
2288
|
+
},
|
|
2289
|
+
validateCheckRow() {
|
|
2290
|
+
let $grid = this.getGridTable();
|
|
2291
|
+
let checkRows = $grid.getCheckboxRecords(true);
|
|
2292
|
+
if (checkRows.length === 0) {
|
|
2293
|
+
this.$message({
|
|
2294
|
+
message: "请选择要操作的行",
|
|
2295
|
+
type: "warning",
|
|
2296
|
+
});
|
|
2297
|
+
return false;
|
|
2298
|
+
}
|
|
2299
|
+
const fieldsToValidate = [];
|
|
2300
|
+
let tableColumns = this.widget.options.tableColumns;
|
|
2301
|
+
checkRows.forEach((row) => {
|
|
2302
|
+
let fieldSchema = this.fieldSchemaMap[row._X_ROW_KEY];
|
|
2303
|
+
tableColumns.forEach((column) => {
|
|
2304
|
+
if (column.widget) {
|
|
2305
|
+
let widget = fieldSchema[column.widget.id];
|
|
2306
|
+
let required = widget.options.required || false;
|
|
2307
|
+
if (required) {
|
|
2308
|
+
let propName = this.getColumnWidgetProp(widget, row);
|
|
2309
|
+
fieldsToValidate.push(propName);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
if (column.widgetList) {
|
|
2313
|
+
column.widgetList.forEach((itemWidget) => {
|
|
2314
|
+
let widget = fieldSchema[itemWidget.id];
|
|
2315
|
+
let required = widget.options.required || false;
|
|
2316
|
+
if (required) {
|
|
2317
|
+
let propName = this.getColumnWidgetProp(widget, row);
|
|
2318
|
+
fieldsToValidate.push(propName);
|
|
2319
|
+
}
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
2322
|
+
});
|
|
2323
|
+
});
|
|
2324
|
+
let formRef = this.getFormRef();
|
|
2325
|
+
let renderForm = formRef.$refs.renderForm;
|
|
2326
|
+
let hasError = false;
|
|
2327
|
+
renderForm.validateField(fieldsToValidate, (errors) => {
|
|
2328
|
+
if (!hasError && errors) {
|
|
2329
|
+
this.$message.error(errors);
|
|
2330
|
+
hasError = true;
|
|
2331
|
+
}
|
|
2332
|
+
});
|
|
2333
|
+
return !hasError;
|
|
2334
|
+
},
|
|
2335
|
+
getColumnWidgetProp(widget, row) {
|
|
2336
|
+
if (!widget) return;
|
|
2337
|
+
let $grid = this.getGridTable();
|
|
2338
|
+
let rowIndex = $grid.getRowIndex(row);
|
|
2339
|
+
let fieldKeyName = this.getFieldKeyName(this.widget);
|
|
2340
|
+
let property = this.getFieldKeyName(widget);
|
|
2341
|
+
if (this.isVabsearchFlagWidget(widget)) {
|
|
2342
|
+
property = widget.options.vabSearchName || property;
|
|
2343
|
+
}
|
|
2344
|
+
let propName = fieldKeyName + "." + rowIndex + "." + property;
|
|
2345
|
+
return propName;
|
|
2346
|
+
},
|
|
2347
|
+
getColumnProp(obj, isEdit) {
|
|
2348
|
+
let sourceWidgetId = isEdit
|
|
2349
|
+
? obj.column?.params?.editWidget?.id
|
|
2350
|
+
: obj.column?.params?.widget?.id;
|
|
2351
|
+
if (!sourceWidgetId || !this.fieldSchemaMap[obj.row._X_ROW_KEY])
|
|
2352
|
+
return "false";
|
|
2353
|
+
let fieldWidget = this.fieldSchemaMap[obj.row._X_ROW_KEY][sourceWidgetId];
|
|
2354
|
+
if (!fieldWidget) {
|
|
2355
|
+
return "false";
|
|
2356
|
+
}
|
|
2357
|
+
let isQueryTable = this.widget.options.isQueryTable || false;
|
|
2358
|
+
|
|
2359
|
+
let required = fieldWidget.options.required || false;
|
|
2360
|
+
if (isEdit || !isQueryTable || required) {
|
|
2361
|
+
let fieldKeyName = this.getFieldKeyName(this.widget);
|
|
2362
|
+
let rowIndex = Math.max(obj.rowIndex, 0);
|
|
2363
|
+
|
|
2364
|
+
let isTreeTable = this.widget.options.isTreeTable || false;
|
|
2365
|
+
if (isTreeTable) {
|
|
2366
|
+
rowIndex = this.getValue().findIndex(
|
|
2367
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2368
|
+
);
|
|
2369
|
+
if (rowIndex < 0) {
|
|
2370
|
+
return "false";
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
let property = this.getFieldKeyName(fieldWidget);
|
|
2375
|
+
if (obj.row[property] && Array.isArray(obj.row[property])) {
|
|
2376
|
+
return "false";
|
|
2377
|
+
}
|
|
2378
|
+
// let property = obj.column.property
|
|
2379
|
+
if (this.isVabsearchFlagWidget(fieldWidget)) {
|
|
2380
|
+
property = fieldWidget.options.vabSearchName || property;
|
|
2381
|
+
}
|
|
2382
|
+
let propName = fieldKeyName + "." + rowIndex + "." + property;
|
|
2383
|
+
return propName;
|
|
2384
|
+
} else {
|
|
2385
|
+
return "false";
|
|
2386
|
+
}
|
|
2387
|
+
},
|
|
2388
|
+
isVabsearchFlagWidget(widget) {
|
|
2389
|
+
let type = widget?.type;
|
|
2390
|
+
return (
|
|
2391
|
+
type === "vabsearch" ||
|
|
2392
|
+
type === "singerSearch" ||
|
|
2393
|
+
type === "multiSearch"
|
|
2394
|
+
);
|
|
2395
|
+
},
|
|
2396
|
+
getColumnWidgetName(e) {
|
|
2397
|
+
if (e && e.type) {
|
|
2398
|
+
if (e.category === "container") {
|
|
2399
|
+
return this.getContainerWidgetName(e);
|
|
2400
|
+
} else {
|
|
2401
|
+
return e.type + "-widget";
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
},
|
|
2405
|
+
getGridTable() {
|
|
2406
|
+
let $grid = this.$refs[this.getTableRef()];
|
|
2407
|
+
return $grid;
|
|
2408
|
+
},
|
|
2409
|
+
getContainerWidgetName: function (e) {
|
|
2410
|
+
return "grid" === e.type ? "grid-item" : e.type + "-item";
|
|
2411
|
+
},
|
|
2412
|
+
getWidgetName: function (e) {
|
|
2413
|
+
return (e.targetType || e.type) + "-widget";
|
|
2414
|
+
},
|
|
2415
|
+
handleCheckboxChange(param) {
|
|
2416
|
+
let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
|
|
2417
|
+
let mergeRowKey = this.widget.options.mergeRowKey;
|
|
2418
|
+
if (mergeRowEnabled && mergeRowKey) {
|
|
2419
|
+
let grid = this.getGridTable();
|
|
2420
|
+
let fullData = grid.getTableData().fullData;
|
|
2421
|
+
let row = param.row;
|
|
2422
|
+
let val = row[mergeRowKey];
|
|
2423
|
+
let items = fullData.filter((item) => item[mergeRowKey] === val);
|
|
2424
|
+
if (items.length) {
|
|
2425
|
+
grid.setCheckboxRow(items, param.checked);
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
if (this.widget.options.onCheckboxChange) {
|
|
2429
|
+
let t = new Function("param", this.widget.options.onCheckboxChange);
|
|
2430
|
+
t.call(this, param);
|
|
2431
|
+
}
|
|
2432
|
+
let formRef = this.getFormRef();
|
|
2433
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
|
2434
|
+
dataTableConfig.onCheckboxChange &&
|
|
2435
|
+
dataTableConfig.onCheckboxChange(param);
|
|
2436
|
+
},
|
|
2437
|
+
handleCheckboxAll(param) {
|
|
2438
|
+
if (this.widget.options.onCheckboxAll) {
|
|
2439
|
+
let t = new Function("param", this.widget.options.onCheckboxAll);
|
|
2440
|
+
t.call(this, param);
|
|
2441
|
+
}
|
|
2442
|
+
let formRef = this.getFormRef();
|
|
2443
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
|
2444
|
+
dataTableConfig.onCheckboxAll && dataTableConfig.onCheckboxAll(param);
|
|
2445
|
+
},
|
|
2446
|
+
handleCellDblclick(param) {
|
|
2447
|
+
if (this.widget.options.onCellDblclick) {
|
|
2448
|
+
let t = new Function("param", this.widget.options.onCellDblclick);
|
|
2449
|
+
t.call(this, param);
|
|
2450
|
+
}
|
|
2451
|
+
let formRef = this.getFormRef();
|
|
2452
|
+
let dataTableConfig = formRef.$attrs.dataTableOption || {};
|
|
2453
|
+
dataTableConfig.onCellDblclick && dataTableConfig.onCellDblclick(param);
|
|
2454
|
+
},
|
|
2455
|
+
advancedClear() {
|
|
2456
|
+
let formModel = this.formModel;
|
|
2457
|
+
let searchColumns = this.getGridTable().params.searchColumns;
|
|
2458
|
+
searchColumns.forEach((form1Field) => {
|
|
2459
|
+
if (!form1Field.common) {
|
|
2460
|
+
let field = form1Field.field;
|
|
2461
|
+
let options = form1Field.widget.options;
|
|
2462
|
+
let value = formModel[field] ?? null;
|
|
2463
|
+
let widgetRef = this.getWidgetRef(options.name);
|
|
2464
|
+
widgetRef && widgetRef.setValue(value);
|
|
2465
|
+
}
|
|
2466
|
+
});
|
|
2467
|
+
// this.getGridTable().$forceUpdate();
|
|
2468
|
+
},
|
|
2469
|
+
tableFormSettingConfirm() {
|
|
2470
|
+
let formModel = this.formModel;
|
|
2471
|
+
this.getFormRef().setFormData(formModel);
|
|
2472
|
+
},
|
|
2473
|
+
|
|
2474
|
+
//editTable begin
|
|
2475
|
+
async saveEditRow(obj) {
|
|
2476
|
+
let formRef = this.getFormRef();
|
|
2477
|
+
let formConfig = this.formConfig;
|
|
2478
|
+
let entity = formConfig.entity;
|
|
2479
|
+
if (!entity) return;
|
|
2480
|
+
let dataId = formRef?.dataId;
|
|
2481
|
+
let reportTemplate = formRef?.reportTemplate;
|
|
2482
|
+
let formCode = reportTemplate?.formCode;
|
|
2483
|
+
let scriptCode = formConfig.saveScriptCode || "saveUpdate";
|
|
2484
|
+
|
|
2485
|
+
let that = this;
|
|
2486
|
+
let $grid = obj.$table.$xegrid;
|
|
2487
|
+
let originOption = $grid.params.originOption;
|
|
2488
|
+
|
|
2489
|
+
let formModel = this.formModel;
|
|
2490
|
+
let dataMap = this.getGridTable().getTableData();
|
|
2491
|
+
|
|
2492
|
+
/* const errMap = await $grid.validate(obj.row).catch(errMap => errMap)
|
|
2493
|
+
if (errMap) {
|
|
2494
|
+
let title = errMap[Object.keys(errMap)[0]][0].column.title
|
|
2495
|
+
this.$message.error(`[${title}]不能为空`)
|
|
2496
|
+
return
|
|
2497
|
+
} */
|
|
2498
|
+
|
|
2499
|
+
formRef.validate((valid) => {
|
|
2500
|
+
if (valid) {
|
|
2501
|
+
$grid.clearActived().then(() => {
|
|
2502
|
+
$grid.setActiveRow(obj.row);
|
|
2503
|
+
let mainData = commonDataUtil.handleForm(obj.row);
|
|
2504
|
+
|
|
2505
|
+
delete mainData._createNickName;
|
|
2506
|
+
delete mainData._createMobile;
|
|
2507
|
+
delete mainData._modifyNickName;
|
|
2508
|
+
delete mainData._modifyMobile;
|
|
2509
|
+
delete mainData._createBy;
|
|
2510
|
+
delete mainData._modifyBy;
|
|
2511
|
+
|
|
2512
|
+
let formData = {
|
|
2513
|
+
[entity]: mainData,
|
|
2514
|
+
};
|
|
2515
|
+
|
|
2516
|
+
Object.keys(mainData).forEach((key) => {
|
|
2517
|
+
if (key.startsWith("attachments_")) {
|
|
2518
|
+
formData[key] = mainData[key];
|
|
2519
|
+
}
|
|
2520
|
+
});
|
|
2521
|
+
|
|
2522
|
+
let reqData = {
|
|
2523
|
+
formCode: formCode,
|
|
2524
|
+
formVersion: reportTemplate.formVersion,
|
|
2525
|
+
taBm: entity,
|
|
2526
|
+
data: formData,
|
|
2527
|
+
};
|
|
2528
|
+
|
|
2529
|
+
this.formHttp({
|
|
2530
|
+
scriptCode: scriptCode,
|
|
2531
|
+
data: reqData,
|
|
2532
|
+
successMsg: true,
|
|
2533
|
+
isConfirm: true,
|
|
2534
|
+
confirmText: "您确定要保存吗?",
|
|
2535
|
+
success: (res0) => {
|
|
2536
|
+
this.getRowData(res0.objx, (res) => {
|
|
2537
|
+
if (obj.row.id === res.objx.id) {
|
|
2538
|
+
$grid.clearActived().then(() => {
|
|
2539
|
+
Object.assign(obj.row, res.objx);
|
|
2540
|
+
});
|
|
2541
|
+
} else {
|
|
2542
|
+
// $grid.remove(obj.row);
|
|
2543
|
+
// $grid.insertAt(res.objx);
|
|
2544
|
+
let items = that.getValue();
|
|
2545
|
+
let index = items.findIndex(
|
|
2546
|
+
(item) => item.id === obj.row.id
|
|
2547
|
+
);
|
|
2548
|
+
items.splice(index, 1, res.objx);
|
|
2549
|
+
that.setValue(items);
|
|
2550
|
+
}
|
|
2551
|
+
delete obj.$table.editCloneRow;
|
|
2552
|
+
});
|
|
2553
|
+
},
|
|
2554
|
+
});
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
});
|
|
2558
|
+
},
|
|
2559
|
+
getRowData(dataId, callback) {
|
|
2560
|
+
let reportTemplate = this.getFormRef()?.reportTemplate;
|
|
2561
|
+
let formCode = reportTemplate.formCode;
|
|
2562
|
+
let formConfig = this.formConfig;
|
|
2563
|
+
// let isLoadEntity = formConfig.isLoadEntity;
|
|
2564
|
+
let entity = formConfig.entity;
|
|
2565
|
+
let scriptCode = formConfig.formScriptCode || "getOne";
|
|
2566
|
+
let defaultOption = this.getHttpConfigForUser();
|
|
2567
|
+
this.formHttp({
|
|
2568
|
+
scriptCode: scriptCode,
|
|
2569
|
+
data: {
|
|
2570
|
+
formCode: formCode,
|
|
2571
|
+
formVersion: reportTemplate.formVersion,
|
|
2572
|
+
taBm: entity,
|
|
2573
|
+
data: {
|
|
2574
|
+
id: dataId,
|
|
2575
|
+
},
|
|
2576
|
+
},
|
|
2577
|
+
...defaultOption,
|
|
2578
|
+
success: (res) => {
|
|
2579
|
+
callback && callback(res);
|
|
2580
|
+
},
|
|
2581
|
+
});
|
|
2582
|
+
},
|
|
2583
|
+
addChildTreeRow(rowData, obj, toTop) {
|
|
2584
|
+
let toEnd = !toTop;
|
|
2585
|
+
this.addTreeRow(rowData, obj, toEnd, null);
|
|
2586
|
+
},
|
|
2587
|
+
addTopTreeRow(rowData, toTop) {
|
|
2588
|
+
let toEnd = !toTop;
|
|
2589
|
+
this.addTreeRow(rowData, null, toEnd, null);
|
|
2590
|
+
},
|
|
2591
|
+
addSiblingTreeRow(rowData, obj) {
|
|
2592
|
+
this.addTreeRow(rowData, obj, null, true);
|
|
2593
|
+
},
|
|
2594
|
+
addTreeRow(rowData, obj, toEnd, toSibling) {
|
|
2595
|
+
let isEditTable = this.widget.options.isEditTable || false;
|
|
2596
|
+
let parent = obj?.row;
|
|
2597
|
+
let $grid = this.getGridTable();
|
|
2598
|
+
if (isEditTable && this.hasEditingRow($grid, 1)) {
|
|
2599
|
+
return false;
|
|
2600
|
+
}
|
|
2601
|
+
let parentField = $grid.treeConfig.parentField;
|
|
2602
|
+
let newRow = {};
|
|
2603
|
+
let originOption = $grid.params.originOption;
|
|
2604
|
+
let editDefaultRow;
|
|
2605
|
+
if (originOption.editDefaultRow) {
|
|
2606
|
+
if (typeof originOption.editDefaultRow === "function") {
|
|
2607
|
+
editDefaultRow = originOption.editDefaultRow() || {};
|
|
2608
|
+
} else {
|
|
2609
|
+
editDefaultRow = originOption.editDefaultRow || {};
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
|
|
2613
|
+
// Object.assign(newRow, editDefaultRow, rowData);
|
|
2614
|
+
newRow.id =
|
|
2615
|
+
"row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
|
2616
|
+
if (!toSibling) {
|
|
2617
|
+
newRow[parentField] = parent?.id || 0;
|
|
2618
|
+
} else {
|
|
2619
|
+
newRow[parentField] = obj?.row[parentField] || 0;
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
let newData = this.createNewTableData(isEditTable);
|
|
2623
|
+
newRow = Object.assign({}, newData, newRow, editDefaultRow, rowData);
|
|
2624
|
+
|
|
2625
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
|
2626
|
+
if (!parent) {
|
|
2627
|
+
if (toEnd === true) {
|
|
2628
|
+
tableRows.push(newRow);
|
|
2629
|
+
} else if (toSibling === true) {
|
|
2630
|
+
let addIndex =
|
|
2631
|
+
tableRows.findIndex(
|
|
2632
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2633
|
+
) + 1;
|
|
2634
|
+
tableRows.splice(addIndex, 0, newRow);
|
|
2635
|
+
} else {
|
|
2636
|
+
tableRows.splice(0, 0, newRow);
|
|
2637
|
+
}
|
|
2638
|
+
this.setValue(tableRows);
|
|
2639
|
+
this.$nextTick(() => {
|
|
2640
|
+
this.handleWbs();
|
|
2641
|
+
if (isEditTable) {
|
|
2642
|
+
$grid.setActiveRow(newRow);
|
|
2643
|
+
}
|
|
2644
|
+
});
|
|
2645
|
+
|
|
2646
|
+
// $grid.insert(newRow).then(({row}) => $grid.setActiveRow(row));
|
|
2647
|
+
} else {
|
|
2648
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
|
2649
|
+
if (toEnd === true) {
|
|
2650
|
+
tableRows.push(newRow);
|
|
2651
|
+
} else if (toSibling === true) {
|
|
2652
|
+
let addIndex =
|
|
2653
|
+
tableRows.findIndex(
|
|
2654
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2655
|
+
) + 1;
|
|
2656
|
+
tableRows.splice(addIndex, 0, newRow);
|
|
2657
|
+
} else {
|
|
2658
|
+
tableRows.splice(0, 0, newRow);
|
|
2659
|
+
}
|
|
2660
|
+
this.setValue(tableRows);
|
|
2661
|
+
this.$nextTick(() => {
|
|
2662
|
+
this.handleWbs();
|
|
2663
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
|
2664
|
+
if (isEditTable) {
|
|
2665
|
+
$grid.setActiveRow(newRow);
|
|
2666
|
+
}
|
|
2667
|
+
});
|
|
2668
|
+
});
|
|
2669
|
+
});
|
|
2670
|
+
}
|
|
2671
|
+
},
|
|
2672
|
+
removeTreeRow(obj) {
|
|
2673
|
+
let row = obj.row;
|
|
2674
|
+
let $grid = this.getGridTable();
|
|
2675
|
+
let childrenField = $grid.treeConfig?.children;
|
|
2676
|
+
// let tableRows = this.formModel[this.fieldKeyName];
|
|
2677
|
+
// let index = tableRows.findIndex(item => item.id === row.id)
|
|
2678
|
+
let delIds = [];
|
|
2679
|
+
let loopDo = (item) => {
|
|
2680
|
+
if (item._X_ROW_KEY) delIds.push(item._X_ROW_KEY);
|
|
2681
|
+
if (childrenField && item[childrenField]) {
|
|
2682
|
+
item[childrenField].forEach((subItem) => {
|
|
2683
|
+
loopDo(subItem);
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2686
|
+
};
|
|
2687
|
+
loopDo(row);
|
|
2688
|
+
/* delIds.forEach((id) => {
|
|
2689
|
+
let index = tableRows.findIndex((item) => item.id === id);
|
|
2690
|
+
let delRow = tableRows[index];
|
|
2691
|
+
tableRows.splice(index, 1);
|
|
2692
|
+
this.deleteRowWidgets(delRow);
|
|
2693
|
+
}); */
|
|
2694
|
+
let tableRows = this.getValue();
|
|
2695
|
+
let delIndex = [];
|
|
2696
|
+
tableRows.map((item, index) => {
|
|
2697
|
+
if (delIds.includes(item._X_ROW_KEY)) {
|
|
2698
|
+
delIndex.push(index);
|
|
2699
|
+
}
|
|
2700
|
+
});
|
|
2701
|
+
delIndex.reverse().forEach((index) => {
|
|
2702
|
+
tableRows.splice(index, 1);
|
|
2703
|
+
});
|
|
2704
|
+
|
|
2705
|
+
// $grid.remove(obj.row);
|
|
2706
|
+
|
|
2707
|
+
// let newRows = tableRows.filter((item) => !delIds.includes(item.id));
|
|
2708
|
+
// this.setValue(newRows);
|
|
2709
|
+
this.$nextTick(() => {
|
|
2710
|
+
this.handleWbs();
|
|
2711
|
+
});
|
|
2712
|
+
},
|
|
2713
|
+
addSiblingEditRow(rowData, obj) {
|
|
2714
|
+
this.addEditRow(rowData, obj, null, true);
|
|
2715
|
+
},
|
|
2716
|
+
addEditRow(rowData, obj, toEnd, toSibling) {
|
|
2717
|
+
let isEditTable = this.widget.options.isEditTable || false;
|
|
2718
|
+
let isTreeTable = this.widget.options.isTreeTable || false;
|
|
2719
|
+
let parent = obj?.row;
|
|
2720
|
+
let $grid = this.getGridTable();
|
|
2721
|
+
if (isEditTable && this.hasEditingRow($grid, 1)) {
|
|
2722
|
+
return false;
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
let newRow = {};
|
|
2726
|
+
let originOption = $grid.params.originOption;
|
|
2727
|
+
let editDefaultRow;
|
|
2728
|
+
if (originOption.editDefaultRow) {
|
|
2729
|
+
if (typeof originOption.editDefaultRow === "function") {
|
|
2730
|
+
editDefaultRow = originOption.editDefaultRow() || {};
|
|
2731
|
+
} else {
|
|
2732
|
+
editDefaultRow = originOption.editDefaultRow || {};
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
newRow.id =
|
|
2737
|
+
"row_" + new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
|
2738
|
+
if (isTreeTable) {
|
|
2739
|
+
let parentField = $grid.treeConfig.parentField;
|
|
2740
|
+
if (!toSibling) {
|
|
2741
|
+
newRow[parentField] = parent?.id || 0;
|
|
2742
|
+
} else {
|
|
2743
|
+
newRow[parentField] = obj?.row[parentField] || 0;
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
|
|
2747
|
+
let newData = this.createNewTableData(isEditTable);
|
|
2748
|
+
newRow = Object.assign({}, newData, newRow, editDefaultRow, rowData);
|
|
2749
|
+
|
|
2750
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
|
2751
|
+
if (!parent) {
|
|
2752
|
+
if (toEnd === true) {
|
|
2753
|
+
tableRows.push(newRow);
|
|
2754
|
+
} else if (toSibling === true) {
|
|
2755
|
+
let addIndex =
|
|
2756
|
+
tableRows.findIndex(
|
|
2757
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2758
|
+
) + 1;
|
|
2759
|
+
tableRows.splice(addIndex, 0, newRow);
|
|
2760
|
+
} else {
|
|
2761
|
+
tableRows.splice(0, 0, newRow);
|
|
2762
|
+
}
|
|
2763
|
+
this.setValue(tableRows);
|
|
2764
|
+
this.$nextTick(() => {
|
|
2765
|
+
this.handleWbs();
|
|
2766
|
+
if (isEditTable) {
|
|
2767
|
+
$grid.setActiveRow(newRow);
|
|
2768
|
+
}
|
|
2769
|
+
});
|
|
2770
|
+
|
|
2771
|
+
// $grid.insert(newRow).then(({row}) => $grid.setActiveRow(row));
|
|
2772
|
+
} else {
|
|
2773
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
|
2774
|
+
if (toEnd === true) {
|
|
2775
|
+
tableRows.push(newRow);
|
|
2776
|
+
} else if (toSibling === true) {
|
|
2777
|
+
let addIndex =
|
|
2778
|
+
tableRows.findIndex(
|
|
2779
|
+
(item) => item._X_ROW_KEY === obj.row._X_ROW_KEY
|
|
2780
|
+
) + 1;
|
|
2781
|
+
tableRows.splice(addIndex, 0, newRow);
|
|
2782
|
+
} else {
|
|
2783
|
+
tableRows.splice(0, 0, newRow);
|
|
2784
|
+
}
|
|
2785
|
+
this.setValue(tableRows);
|
|
2786
|
+
this.$nextTick(() => {
|
|
2787
|
+
this.handleWbs();
|
|
2788
|
+
$grid.setTreeExpand(obj.row, true).then(() => {
|
|
2789
|
+
if (isEditTable) {
|
|
2790
|
+
$grid.setActiveRow(newRow);
|
|
2791
|
+
}
|
|
2792
|
+
});
|
|
2793
|
+
});
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
},
|
|
2797
|
+
async removeEditRow(obj) {
|
|
2798
|
+
this.removeTreeRow(obj);
|
|
2799
|
+
},
|
|
2800
|
+
//editTable end
|
|
2801
|
+
getHttpConfigForUser() {
|
|
2802
|
+
let defaultOption = {
|
|
2803
|
+
addCreateInfo: true,
|
|
2804
|
+
queryCreateInfo: window.$vueRoot.$store.getters.queryCreateInfo || "0",
|
|
2805
|
+
};
|
|
2806
|
+
return defaultOption;
|
|
2807
|
+
},
|
|
2808
|
+
handleWbs() {
|
|
2809
|
+
if (this.widget.options.wbsEnabled) {
|
|
2810
|
+
this.updateWbs();
|
|
2811
|
+
}
|
|
2812
|
+
},
|
|
2813
|
+
updateWbs() {
|
|
2814
|
+
let that = this;
|
|
2815
|
+
let $grid = that.getGridTable();
|
|
2816
|
+
let childrenField = $grid.treeConfig.children;
|
|
2817
|
+
let fullData = $grid.getTableData().fullData;
|
|
2818
|
+
let tableRows = this.formModel[that.fieldKeyName] || [];
|
|
2819
|
+
let map = {};
|
|
2820
|
+
let loopDo = (item, wbs) => {
|
|
2821
|
+
item.f_wbs = wbs;
|
|
2822
|
+
map[item._X_ROW_KEY] = wbs;
|
|
2823
|
+
item[childrenField] &&
|
|
2824
|
+
item[childrenField].forEach((subitem, subindex) => {
|
|
2825
|
+
let sub_wbs = wbs + "." + (subindex + 1) + "";
|
|
2826
|
+
loopDo(subitem, sub_wbs);
|
|
2827
|
+
});
|
|
2828
|
+
};
|
|
2829
|
+
fullData.forEach((item, index) => {
|
|
2830
|
+
let wbs = index + 1 + "";
|
|
2831
|
+
loopDo(item, wbs);
|
|
2832
|
+
});
|
|
2833
|
+
$grid.updateData();
|
|
2834
|
+
},
|
|
2835
|
+
moveUpRow(obj) {
|
|
2836
|
+
let row = obj.row;
|
|
2837
|
+
let $grid = this.getGridTable();
|
|
2838
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
|
2839
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
|
2840
|
+
if (isTreeTable) {
|
|
2841
|
+
let parentField = $grid.treeConfig.parentField;
|
|
2842
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
|
2843
|
+
let paretValue = row[parentField];
|
|
2844
|
+
let siblingRows = tableRows.filter(
|
|
2845
|
+
(item) => item[parentField] === paretValue
|
|
2846
|
+
);
|
|
2847
|
+
if (siblingRows.length > 1) {
|
|
2848
|
+
let currentIndex = tableRows.findIndex(
|
|
2849
|
+
(item) => item[rowField] === row[rowField]
|
|
2850
|
+
);
|
|
2851
|
+
let index1 = siblingRows.findIndex(
|
|
2852
|
+
(item) => item[rowField] === row[rowField]
|
|
2853
|
+
);
|
|
2854
|
+
if (index1 > 0) {
|
|
2855
|
+
let prevRow = siblingRows[index1 - 1];
|
|
2856
|
+
let prevIndex = tableRows.findIndex(
|
|
2857
|
+
(item) => item[rowField] === prevRow[rowField]
|
|
2858
|
+
);
|
|
2859
|
+
tableRows.splice(currentIndex, 1);
|
|
2860
|
+
tableRows.splice(prevIndex, 0, row);
|
|
2861
|
+
this.setValue(tableRows);
|
|
2862
|
+
this.$nextTick(() => {
|
|
2863
|
+
this.handleWbs();
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
} else {
|
|
2868
|
+
let rowIndex = $grid.getRowIndex(row);
|
|
2869
|
+
if (rowIndex >= 0) {
|
|
2870
|
+
tableRows.splice(rowIndex, 1);
|
|
2871
|
+
tableRows.splice(rowIndex - 1, 0, row);
|
|
2872
|
+
this.setValue(tableRows);
|
|
2873
|
+
this.$nextTick(() => {
|
|
2874
|
+
this.handleWbs();
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
},
|
|
2879
|
+
moveDownRow(obj) {
|
|
2880
|
+
let row = obj.row;
|
|
2881
|
+
let $grid = this.getGridTable();
|
|
2882
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
|
2883
|
+
let isTreeTable = this.widget.options.isTreeTable;
|
|
2884
|
+
if (isTreeTable) {
|
|
2885
|
+
let parentField = $grid.treeConfig.parentField;
|
|
2886
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
|
2887
|
+
let paretValue = row[parentField];
|
|
2888
|
+
let siblingRows = tableRows.filter(
|
|
2889
|
+
(item) => item[parentField] === paretValue
|
|
2890
|
+
);
|
|
2891
|
+
if (siblingRows.length > 1) {
|
|
2892
|
+
let currentIndex = tableRows.findIndex(
|
|
2893
|
+
(item) => item[rowField] === row[rowField]
|
|
2894
|
+
);
|
|
2895
|
+
let index1 = siblingRows.findIndex(
|
|
2896
|
+
(item) => item[rowField] === row[rowField]
|
|
2897
|
+
);
|
|
2898
|
+
if (index1 < siblingRows.length - 1) {
|
|
2899
|
+
let nextRow = siblingRows[index1 + 1];
|
|
2900
|
+
let nextIndex = tableRows.findIndex(
|
|
2901
|
+
(item) => item[rowField] === nextRow[rowField]
|
|
2902
|
+
);
|
|
2903
|
+
tableRows.splice(currentIndex, 1);
|
|
2904
|
+
tableRows.splice(nextIndex, 0, row);
|
|
2905
|
+
this.setValue(tableRows);
|
|
2906
|
+
this.$nextTick(() => {
|
|
2907
|
+
this.handleWbs();
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
} else {
|
|
2912
|
+
let rowIndex = $grid.getRowIndex(row);
|
|
2913
|
+
if (rowIndex < tableRows.length - 1) {
|
|
2914
|
+
tableRows.splice(rowIndex, 1);
|
|
2915
|
+
tableRows.splice(rowIndex + 1, 0, row);
|
|
2916
|
+
this.setValue(tableRows);
|
|
2917
|
+
this.$nextTick(() => {
|
|
2918
|
+
this.handleWbs();
|
|
2919
|
+
});
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
},
|
|
2923
|
+
|
|
2924
|
+
openSortRowDialog(obj) {
|
|
2925
|
+
let $grid = this.getGridTable();
|
|
2926
|
+
let parentField = $grid.treeConfig.parentField;
|
|
2927
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
|
2928
|
+
let row = obj.row;
|
|
2929
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
|
2930
|
+
|
|
2931
|
+
let sortParentRow = tableRows.find(
|
|
2932
|
+
(item) => item[rowField] === row[parentField]
|
|
2933
|
+
);
|
|
2934
|
+
let sortRows = tableRows.filter(
|
|
2935
|
+
(item) => item[parentField] === row[parentField]
|
|
2936
|
+
);
|
|
2937
|
+
this.sortRows = sortRows;
|
|
2938
|
+
this.sortParentRow = sortParentRow;
|
|
2939
|
+
this.showTreeMoveDialog = true;
|
|
2940
|
+
},
|
|
2941
|
+
confirmTreeMoveDialog(rows) {
|
|
2942
|
+
if (this.widget.options.isEditTable) {
|
|
2943
|
+
let reportTemplate = this.getFormRef().reportTemplate;
|
|
2944
|
+
let formConfig = this.formConfig;
|
|
2945
|
+
let entity = formConfig.entity;
|
|
2946
|
+
let reqData = {
|
|
2947
|
+
formCode: reportTemplate.formCode,
|
|
2948
|
+
formVersion: reportTemplate.formVersion,
|
|
2949
|
+
taBm: entity,
|
|
2950
|
+
data: rows,
|
|
2951
|
+
};
|
|
2952
|
+
let scriptCode = this.widget.options.sortScriptCode;
|
|
2953
|
+
this.formHttp({
|
|
2954
|
+
scriptCode: scriptCode,
|
|
2955
|
+
data: reqData,
|
|
2956
|
+
successMsg: true,
|
|
2957
|
+
isConfirm: true,
|
|
2958
|
+
confirmText: "您确定要保存排序吗?",
|
|
2959
|
+
success: (res) => {
|
|
2960
|
+
this.getGridTable().reloadTreeExpand(this.sortParentRow);
|
|
2961
|
+
},
|
|
2962
|
+
});
|
|
2963
|
+
} else {
|
|
2964
|
+
let $grid = this.getGridTable();
|
|
2965
|
+
let rowField = $grid.treeConfig.rowField || "id";
|
|
2966
|
+
let tableRows = this.formModel[this.fieldKeyName] || [];
|
|
2967
|
+
|
|
2968
|
+
let ids = rows.map((item) => item[rowField]);
|
|
2969
|
+
let index = tableRows.findIndex((item) => ids.includes(item[rowField]));
|
|
2970
|
+
let items = tableRows.filter((item) => !ids.includes(item[rowField]));
|
|
2971
|
+
rows.forEach((row, index1) => {
|
|
2972
|
+
items.splice(index + index1, 0, row);
|
|
2973
|
+
});
|
|
2974
|
+
this.setValue(items);
|
|
2975
|
+
this.$nextTick(() => {
|
|
2976
|
+
this.handleWbs();
|
|
2977
|
+
});
|
|
2978
|
+
}
|
|
2979
|
+
},
|
|
2980
|
+
// 通用行合并函数(将相同多列数据合并为一行)
|
|
2981
|
+
mergeRowMethod(tableParam) {
|
|
2982
|
+
let { row, _rowIndex, column, visibleData } = tableParam;
|
|
2983
|
+
let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
|
|
2984
|
+
let unikey = this.widget.options.mergeRowKey;
|
|
2985
|
+
const cellValue = row[unikey];
|
|
2986
|
+
let isItemLine = column.params?.isItemLine || false;
|
|
2987
|
+
if (mergeRowEnabled && unikey && !isItemLine) {
|
|
2988
|
+
const prevRow = visibleData[_rowIndex - 1];
|
|
2989
|
+
let nextRow = visibleData[_rowIndex + 1];
|
|
2990
|
+
if (prevRow && prevRow[unikey] === cellValue) {
|
|
2991
|
+
return { rowspan: 0, colspan: 0 };
|
|
2992
|
+
} else {
|
|
2993
|
+
let countRowspan = 1;
|
|
2994
|
+
while (nextRow && nextRow[unikey] === cellValue) {
|
|
2995
|
+
nextRow = visibleData[++countRowspan + _rowIndex];
|
|
2996
|
+
}
|
|
2997
|
+
if (countRowspan > 1) {
|
|
2998
|
+
return { rowspan: countRowspan, colspan: 1 };
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
} else {
|
|
3002
|
+
// return { rowspan: 1, colspan: 1 }
|
|
3003
|
+
}
|
|
3004
|
+
},
|
|
3005
|
+
mergeRowMethod2({ row, _rowIndex, column, visibleData }) {
|
|
3006
|
+
const fields = ["key"];
|
|
3007
|
+
const cellValue = row[column.field];
|
|
3008
|
+
if (cellValue && fields.includes(column.field)) {
|
|
3009
|
+
const prevRow = visibleData[_rowIndex - 1];
|
|
3010
|
+
let nextRow = visibleData[_rowIndex + 1];
|
|
3011
|
+
if (prevRow && prevRow[column.field] === cellValue) {
|
|
3012
|
+
return { rowspan: 0, colspan: 0 };
|
|
3013
|
+
} else {
|
|
3014
|
+
let countRowspan = 1;
|
|
3015
|
+
while (nextRow && nextRow[column.field] === cellValue) {
|
|
3016
|
+
nextRow = visibleData[++countRowspan + _rowIndex];
|
|
3017
|
+
}
|
|
3018
|
+
if (countRowspan > 1) {
|
|
3019
|
+
return { rowspan: countRowspan, colspan: 1 };
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
},
|
|
3024
|
+
|
|
3025
|
+
/**begin*/
|
|
3026
|
+
/*initFieldSchemaData() { //初始化fieldSchemaData!!!
|
|
3027
|
+
|
|
3028
|
+
let rowWidgetList = this.rowWidgetList
|
|
3029
|
+
let rows = this.getValue();
|
|
3030
|
+
let rowLength = rows.length
|
|
3031
|
+
this.widgetMap = {} //清除数组必须用splice,length=0不会响应式更新!!
|
|
3032
|
+
if (rowLength > 0) {
|
|
3033
|
+
for (let i = 0; i < rowLength; i++) {
|
|
3034
|
+
let row = rows[i];
|
|
3035
|
+
let fieldSchemas = []
|
|
3036
|
+
rowWidgetList.forEach(swItem => {
|
|
3037
|
+
fieldSchemas.push( this.cloneFieldSchema(swItem) )
|
|
3038
|
+
})
|
|
3039
|
+
let keyVal = row._X_ROW_KEY;
|
|
3040
|
+
this.widgetMap[keyVal] = fieldSchemas;
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
},
|
|
3044
|
+
|
|
3045
|
+
addToFieldSchemaData(row) {
|
|
3046
|
+
let fieldSchemas = []
|
|
3047
|
+
this.rowWidgetList.forEach(swItem => {
|
|
3048
|
+
fieldSchemas.push( this.cloneFieldSchema(swItem) )
|
|
3049
|
+
})
|
|
3050
|
+
|
|
3051
|
+
let keyVal = row._X_ROW_KEY;
|
|
3052
|
+
this.widgetMap[keyVal] = fieldSchemas;
|
|
3053
|
+
},
|
|
3054
|
+
|
|
3055
|
+
deleteFromFieldSchemaData(row) {
|
|
3056
|
+
let keyVal = row._X_ROW_KEY;
|
|
3057
|
+
delete this.widgetMap[keyVal] ;
|
|
3058
|
+
},
|
|
3059
|
+
|
|
3060
|
+
cloneFieldSchema(fieldWidget) {
|
|
3061
|
+
let newFieldSchema = this.$baseLodash.cloneDeep(fieldWidget)
|
|
3062
|
+
newFieldSchema.id = fieldWidget.type + generateId()
|
|
3063
|
+
return newFieldSchema
|
|
3064
|
+
},*/
|
|
3065
|
+
clearRowWidgets() {
|
|
3066
|
+
// this.widgetMap = {};
|
|
3067
|
+
},
|
|
3068
|
+
deleteRowWidgets(row) {
|
|
3069
|
+
this.rowWidgetList.forEach((widget) => {
|
|
3070
|
+
let key = this.getRowRefKey(row, widget.options.name);
|
|
3071
|
+
delete this.widgetMap[key];
|
|
3072
|
+
});
|
|
3073
|
+
},
|
|
3074
|
+
/**end*/
|
|
3075
|
+
|
|
3076
|
+
//begin1
|
|
3077
|
+
initAllFieldSchema() {
|
|
3078
|
+
this.initRowIdData(true);
|
|
3079
|
+
this.initFieldSchemaData();
|
|
3080
|
+
},
|
|
3081
|
+
initRowIdData(initFlag) {
|
|
3082
|
+
this.rowIdData.splice(0, this.rowIdData.length); //清除数组必须用splice,length=0不会响应式更新!!
|
|
3083
|
+
let subFormModel = this.formModel[this.fieldKeyName];
|
|
3084
|
+
if (!!subFormModel && subFormModel.length > 0) {
|
|
3085
|
+
subFormModel.forEach((row) => {
|
|
3086
|
+
if (!row._X_ROW_KEY) row._X_ROW_KEY = "row_" + generateId();
|
|
3087
|
+
this.rowIdData.push(row._X_ROW_KEY);
|
|
3088
|
+
});
|
|
3089
|
+
|
|
3090
|
+
/*if (!!initFlag) {
|
|
3091
|
+
//注意:事件触发需延期执行,SumFormDataChange事件处理代码中可能存在尚未创建完成的组件!!
|
|
3092
|
+
setTimeout(() => {
|
|
3093
|
+
this.handleSubFormRowChange(subFormModel)
|
|
3094
|
+
}, 800)
|
|
3095
|
+
}*/
|
|
3096
|
+
}
|
|
3097
|
+
},
|
|
3098
|
+
initFieldSchemaData(initFlag) {
|
|
3099
|
+
//初始化fieldSchemaData!!!
|
|
3100
|
+
/*if (this.widget.type !== 'sub-form') {
|
|
3101
|
+
return
|
|
3102
|
+
}*/
|
|
3103
|
+
|
|
3104
|
+
let rows = this.formModel[this.fieldKeyName];
|
|
3105
|
+
let rowIdData = this.rowIdData;
|
|
3106
|
+
let rowLength = this.rowIdData.length;
|
|
3107
|
+
// this.fieldSchemaData.splice(0, this.fieldSchemaData.length) //清除数组必须用splice,length=0不会响应式更新!!
|
|
3108
|
+
// if(initFlag)this.fieldSchemaMap = {};
|
|
3109
|
+
if (rowLength > 0) {
|
|
3110
|
+
let target = this.getGridTable();
|
|
3111
|
+
if (!target) return;
|
|
3112
|
+
let { fullColumn } = target.getTableColumn();
|
|
3113
|
+
let allWidgets = [];
|
|
3114
|
+
let fieldSchemaMap = {};
|
|
3115
|
+
let fieldSchemaMap0 = this.fieldSchemaMap;
|
|
3116
|
+
for (let i = 0; i < rowLength; i++) {
|
|
3117
|
+
let rowId = rowIdData[i];
|
|
3118
|
+
let fieldSchemas = [];
|
|
3119
|
+
let fieldSchemaMap2 = null;
|
|
3120
|
+
if (initFlag) {
|
|
3121
|
+
fieldSchemaMap2 = this.createRowFieldSchemaMap();
|
|
3122
|
+
} else {
|
|
3123
|
+
let fieldSchemaMap01 = fieldSchemaMap0[rowId];
|
|
3124
|
+
fieldSchemaMap2 = fieldSchemaMap01
|
|
3125
|
+
? this.$baseLodash.cloneDeep(fieldSchemaMap01)
|
|
3126
|
+
: this.createRowFieldSchemaMap();
|
|
3127
|
+
}
|
|
3128
|
+
fieldSchemaMap[rowId] = fieldSchemaMap2;
|
|
3129
|
+
}
|
|
3130
|
+
this.fieldSchemaMap = fieldSchemaMap;
|
|
3131
|
+
}
|
|
3132
|
+
},
|
|
3133
|
+
createRowFieldSchemaMap() {
|
|
3134
|
+
let target = this.getGridTable();
|
|
3135
|
+
let { fullColumn } = target.getTableColumn();
|
|
3136
|
+
|
|
3137
|
+
let fieldSchemaMap2 = {};
|
|
3138
|
+
fullColumn.forEach((column) => {
|
|
3139
|
+
let params = column.params;
|
|
3140
|
+
if (params) {
|
|
3141
|
+
if (params.widget) {
|
|
3142
|
+
let item1 = this.cloneFieldSchema(params.widget);
|
|
3143
|
+
fieldSchemaMap2[params.widget.id] = item1;
|
|
3144
|
+
}
|
|
3145
|
+
if (params.editWidget) {
|
|
3146
|
+
let item1 = this.cloneFieldSchema(params.editWidget);
|
|
3147
|
+
fieldSchemaMap2[params.editWidget.id] = item1;
|
|
3148
|
+
}
|
|
3149
|
+
if (params.widgetList) {
|
|
3150
|
+
let widgetList = this.$baseLodash.cloneDeep(params.widgetList);
|
|
3151
|
+
loopHandleWidget(widgetList, (w, p) => {
|
|
3152
|
+
// let item1 = this.cloneFieldSchema(w)
|
|
3153
|
+
let id = w.id;
|
|
3154
|
+
w.id = w.type + generateId();
|
|
3155
|
+
fieldSchemaMap2[id] = w;
|
|
3156
|
+
});
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
});
|
|
3160
|
+
return fieldSchemaMap2;
|
|
3161
|
+
},
|
|
3162
|
+
addToFieldSchemaData(rowIndex) {
|
|
3163
|
+
let fieldSchemas = [];
|
|
3164
|
+
this.widget.widgetList.forEach((swItem) => {
|
|
3165
|
+
fieldSchemas.push(this.cloneFieldSchema(swItem));
|
|
3166
|
+
});
|
|
3167
|
+
|
|
3168
|
+
if (rowIndex === undefined) {
|
|
3169
|
+
this.fieldSchemaData.push(fieldSchemas);
|
|
3170
|
+
} else {
|
|
3171
|
+
this.fieldSchemaData.splice(rowIndex, 0, fieldSchemas);
|
|
3172
|
+
}
|
|
3173
|
+
},
|
|
3174
|
+
|
|
3175
|
+
deleteFromFieldSchemaData(rowIndex) {
|
|
3176
|
+
this.fieldSchemaData.splice(rowIndex, 1);
|
|
3177
|
+
},
|
|
3178
|
+
|
|
3179
|
+
cloneFieldSchema(fieldWidget) {
|
|
3180
|
+
let newFieldSchema = deepClone(fieldWidget);
|
|
3181
|
+
newFieldSchema.id = fieldWidget.type + generateId();
|
|
3182
|
+
return newFieldSchema;
|
|
3183
|
+
},
|
|
3184
|
+
//end1
|
|
3185
|
+
initExportFieldSchemaData(rows) {
|
|
3186
|
+
if (!rows) return;
|
|
3187
|
+
//初始化fieldSchemaData!!!
|
|
3188
|
+
let fieldSchemaMap = this.fieldSchemaMap;
|
|
3189
|
+
for (let row of rows) {
|
|
3190
|
+
if (!row._X_ROW_KEY) row._X_ROW_KEY = "row_" + generateId();
|
|
3191
|
+
this.rowIdData.push(row._X_ROW_KEY);
|
|
3192
|
+
let fieldSchemaMap2 = this.createRowFieldSchemaMap();
|
|
3193
|
+
fieldSchemaMap[row._X_ROW_KEY] = fieldSchemaMap2;
|
|
3194
|
+
}
|
|
3195
|
+
},
|
|
3196
|
+
initEventHandler() {
|
|
3197
|
+
if (this.designState) return;
|
|
3198
|
+
this.$on("setFormData", (o) => {
|
|
3199
|
+
let rows = this.formModel[this.fieldKeyName] || [];
|
|
3200
|
+
this.setValue(rows);
|
|
3201
|
+
});
|
|
3202
|
+
},
|
|
3203
|
+
isDisHandleWidget(widget, ignoreFields) {
|
|
3204
|
+
let flag1 = widget.options.hasOwnProperty("disabled");
|
|
3205
|
+
let flag2 = !ignoreFields || !ignoreFields.includes(widget.options.name);
|
|
3206
|
+
return flag1 && flag2;
|
|
3207
|
+
},
|
|
3208
|
+
setGridDisabled(disabled, ignoreFields) {
|
|
3209
|
+
if (!!this.widget.widgetList) {
|
|
3210
|
+
traverseAllWidgetsNew(this.widget.widgetList, (widget) => {
|
|
3211
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3212
|
+
widget.options.disabled = disabled;
|
|
3213
|
+
}
|
|
3214
|
+
});
|
|
3215
|
+
}
|
|
3216
|
+
if (!!this.widget.buttons) {
|
|
3217
|
+
traverseAllWidgetsNew(this.widget.buttons, (widget) => {
|
|
3218
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3219
|
+
widget.options.disabled = disabled;
|
|
3220
|
+
}
|
|
3221
|
+
});
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
this.loodHandleColumns(this.widget.options.tableColumns, (column) => {
|
|
3225
|
+
if (column.widget) {
|
|
3226
|
+
let widget = column.widget;
|
|
3227
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3228
|
+
widget.options.disabled = disabled;
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3231
|
+
let widgetList = column.widgetList;
|
|
3232
|
+
if (widgetList && widgetList.length) {
|
|
3233
|
+
traverseAllWidgetsNew(widgetList, (widget) => {
|
|
3234
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3235
|
+
widget.options.disabled = disabled;
|
|
3236
|
+
}
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
});
|
|
3240
|
+
|
|
3241
|
+
let target = this.getGridTable();
|
|
3242
|
+
let { fullColumn } = target.getTableColumn();
|
|
3243
|
+
this.loodHandleColumns(fullColumn, (column) => {
|
|
3244
|
+
if (column.params?.widget) {
|
|
3245
|
+
let widget = column.params.widget;
|
|
3246
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3247
|
+
widget.options.disabled = disabled;
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
let widgetList = column.params?.widgetList;
|
|
3251
|
+
if (widgetList && widgetList.length) {
|
|
3252
|
+
traverseAllWidgetsNew(widgetList, (widget) => {
|
|
3253
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3254
|
+
widget.options.disabled = disabled;
|
|
3255
|
+
}
|
|
3256
|
+
});
|
|
3257
|
+
}
|
|
3258
|
+
});
|
|
3259
|
+
let rows = this.getValue();
|
|
3260
|
+
if (rows.length > 0) {
|
|
3261
|
+
rows.forEach((dataRow, rowIndex) => {
|
|
3262
|
+
this.setRowDisabled(disabled, rowIndex, ignoreFields);
|
|
3263
|
+
});
|
|
3264
|
+
}
|
|
3265
|
+
},
|
|
3266
|
+
setRowDisabled(disabled, rowIndex, ignoreFields) {
|
|
3267
|
+
let gsfFWList = [];
|
|
3268
|
+
let fieldListFn = (fw) => {
|
|
3269
|
+
gsfFWList.push(fw);
|
|
3270
|
+
};
|
|
3271
|
+
|
|
3272
|
+
let target = this.getGridTable();
|
|
3273
|
+
let { fullColumn } = target.getTableColumn();
|
|
3274
|
+
this.loodHandleColumns(fullColumn, (column) => {
|
|
3275
|
+
if (column.params?.widget) {
|
|
3276
|
+
let widget = column.params.widget;
|
|
3277
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3278
|
+
gsfFWList.push(widget);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
let widgetList = column.params?.widgetList;
|
|
3282
|
+
if (widgetList && widgetList.length) {
|
|
3283
|
+
traverseAllWidgetsNew(widgetList, (widget) => {
|
|
3284
|
+
if (this.isDisHandleWidget(widget, ignoreFields)) {
|
|
3285
|
+
gsfFWList.push(widget);
|
|
3286
|
+
}
|
|
3287
|
+
});
|
|
3288
|
+
}
|
|
3289
|
+
});
|
|
3290
|
+
|
|
3291
|
+
let rows = this.getValue();
|
|
3292
|
+
let row = rows[rowIndex];
|
|
3293
|
+
gsfFWList.forEach((fw) => {
|
|
3294
|
+
let swRefName = this.getRowRefKey(row, fw.options.name);
|
|
3295
|
+
// let swRefName = fw.options.name + '@row' + this.rowIdData[rowIndex]
|
|
3296
|
+
let foundSW = this.getWidgetRef(swRefName);
|
|
3297
|
+
if (!!foundSW && !!foundSW.setDisabled) {
|
|
3298
|
+
foundSW.setDisabled(disabled);
|
|
3299
|
+
}
|
|
3300
|
+
});
|
|
3301
|
+
},
|
|
3302
|
+
//xk begin
|
|
3303
|
+
disableGridForm() {
|
|
3304
|
+
this.setGridDisabled(true);
|
|
3305
|
+
},
|
|
3306
|
+
enableGridForm() {
|
|
3307
|
+
this.setGridDisabled(false);
|
|
3308
|
+
},
|
|
3309
|
+
//xk end
|
|
3310
|
+
handleNullValue(rows) {
|
|
3311
|
+
let newData = this.createNewTableData(true, false);
|
|
3312
|
+
let keys = Object.keys(newData);
|
|
3313
|
+
if (keys.length) {
|
|
3314
|
+
rows.forEach((row) => {
|
|
3315
|
+
keys.forEach((key) => {
|
|
3316
|
+
if (row[key] === undefined) {
|
|
3317
|
+
row[key] = newData[key];
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
});
|
|
3321
|
+
}
|
|
3322
|
+
},
|
|
3323
|
+
},
|
|
3324
|
+
};
|
|
3325
|
+
|
|
3326
|
+
export default modules;
|