cloud-web-corejs 1.0.276 → 1.0.278
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 +30 -24
- package/src/App.vue +73 -71
- package/src/api/user.js +21 -0
- package/src/components/baseArea/index.vue +82 -27
- package/src/components/baseTabs/mixins.js +5 -1
- package/src/components/formDialog/README.md +371 -0
- package/src/components/formDialog/actionButtons.js +90 -0
- package/src/components/formDialog/index.js +48 -0
- package/src/components/formDialog/index.vue +802 -0
- package/src/components/formDrawer/drawer.vue +722 -0
- package/src/components/formDrawer/index.js +50 -0
- package/src/components/luckysheet/dialog.vue +1 -1
- package/src/components/micro-view-host/contract.js +66 -0
- package/src/components/micro-view-host/index.vue +148 -0
- package/src/components/table/tableForm.vue +16 -5
- package/src/components/table/tableFormMixin.js +35 -7
- package/src/components/vb-tabs/x-tabs.vue +167 -143
- package/src/components/wf/content.vue +14 -0
- package/src/components/wf/content2.vue +4 -2
- package/src/components/wf/wf.js +74 -23
- package/src/components/wf/wfActionDropdown.vue +85 -0
- package/src/components/wf/wfActionItems.js +136 -0
- package/src/components/wf/wfAutoConfirm.js +55 -0
- package/src/components/wf/wfButtonName.js +60 -0
- package/src/components/wf/wfUserRange.js +53 -0
- package/src/components/wf/wfUtil.js +373 -295
- package/src/components/xform/XFormTabContainer//346/226/260/345/242/236/351/241/265/347/255/276/346/250/241/345/274/217-/346/234/200/347/273/210/345/256/236/347/216/260.md +195 -0
- package/src/components/xform/docs/2026-07 table/344/270/216excelExport/344/277/256/345/244/215/345/217/212/345/257/274/345/207/272/344/274/230/345/214/226.md" +57 -0
- package/src/components/xform/docs/2026-07 /346/216/222/346/237/245/344/277/256/345/244/215/350/256/260/345/275/225.md" +73 -0
- package/src/components/xform/docs/autocomplete /350/207/252/345/212/250/345/256/214/346/210/220/347/273/204/344/273/266/350/257/264/346/230/216.md" +126 -0
- package/src/components/xform/docs//345/257/271/346/257/224/345/212/237/350/203/275/350/220/275/345/234/260/346/226/271/346/241/210.md +986 -0
- package/src/components/xform/docs//346/225/260/346/215/256/350/241/250/346/240/274/345/212/250/346/200/201/345/210/227 JSON /350/257/264/346/230/216.md" +657 -0
- package/src/components/xform/docs//346/240/221/350/241/250rowField/346/224/266/346/225/233-/350/220/275/345/234/260/346/226/207/346/241/243.md +1427 -0
- package/src/components/xform/form-designer/designer.js +2085 -2025
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +9 -11
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +76 -75
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +10 -4
- package/src/components/xform/form-designer/form-widget/container-widget/detail-plain-widget.vue +76 -0
- package/src/components/xform/form-designer/form-widget/container-widget/detail-widget.vue +59 -5
- package/src/components/xform/form-designer/form-widget/dialog/fileReferenceDialog.vue +38 -17
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +138 -13
- package/src/components/xform/form-designer/form-widget/dialog/formFieldDialog.vue +1 -1
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +1774 -1772
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +2 -3
- package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +66 -53
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +287 -214
- package/src/components/xform/form-designer/form-widget/field-widget/button-widget.vue +76 -66
- package/src/components/xform/form-designer/form-widget/field-widget/cascader-widget.vue +208 -124
- package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +11 -2
- package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +7 -6
- package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +43 -19
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +680 -372
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +879 -763
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +17 -2
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-bar-mixin.js +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-category-mixin.js +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/echart-pie-mixin.js +3 -9
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/relative-default-mixin.js +107 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/relativeDateUtil.js +321 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/time-limit-mixin.js +77 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/vabsearch-mixin.js +13 -0
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +13 -8
- package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +4 -9
- package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +3 -0
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +120 -120
- package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +4 -0
- package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +11 -0
- package/src/components/xform/form-designer/form-widget/field-widget/switch-widget.vue +9 -1
- package/src/components/xform/form-designer/form-widget/field-widget/tempStorage-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/text-widget.vue +7 -3
- package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +4 -2
- package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +36 -5
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +338 -374
- package/src/components/xform/form-designer/form-widget/index.vue +6 -1
- package/src/components/xform/form-designer/form-widget/indexMixin.js +29 -25
- package/src/components/xform/form-designer/index.vue +194 -191
- package/src/components/xform/form-designer/indexMixin.js +860 -847
- package/src/components/xform/form-designer/setting-panel/dataSource-setting.vue +397 -397
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +602 -601
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +1790 -1483
- package/src/components/xform/form-designer/setting-panel/index.vue +2 -7
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +370 -335
- package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +585 -544
- package/src/components/xform/form-designer/setting-panel/property-editor/a-link-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/a-text-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/alignType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/buttonIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/censusClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/colorClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/commonAttributeEnabled-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +124 -125
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1151 -957
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +96 -74
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail-plain/detail-plain-editor.vue +75 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/colHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue +14 -13
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-offset-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-pull-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-push-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-grid-col/grid-col-span-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/container-h5-card/h5-card-editor.vue +124 -124
- package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +26 -31
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/height-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-panel/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-customClass-editor.vue +119 -119
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tabClass-editor.vue +45 -45
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +340 -342
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table-cell/cellWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree/tree-customClass-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tree-pane/tree-pane-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/cancelButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/okButtonLabel-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/title-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-vf-dialog/width-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/containerClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/customClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/descriptionsItems-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/downloadButtonFlag-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +6 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/dsName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/echartHeight-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/endPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-accessUrl/accessUrl-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -50
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +7 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/addTableData-event-editor.vue +84 -85
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/button-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindActions.js +262 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/clickBindEvent-editor.vue +97 -88
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/form-host-event-editor.vue +188 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/icon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/search-dialog-event-editor.vue +27 -10
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/checkStrictly-editor.vue +11 -13
- package/src/components/xform/form-designer/setting-panel/property-editor/field-common/keyName-editor.vue +74 -67
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +27 -5
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-defaultValue-editor.vue +35 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultTime-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-defaultValue-editor.vue +35 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date-range/date-range-valueFormat-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-divider/contentPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-dropdown-menu/dropdown-menu-editor.vue +59 -59
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-bar-editor.vue +11 -11
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-category-editor.vue +10 -10
- package/src/components/xform/form-designer/setting-panel/property-editor/field-echart/echart-pie-editor.vue +12 -12
- package/src/components/xform/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue +29 -29
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-number/controlsPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue +44 -44
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-print-button/print-detail-button-editor.vue +115 -115
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/highThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/lowThreshold-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-defaultValue-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-rate/rate-max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script/script-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-script-input/script-input-editor.vue +4 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/fontSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-static-text/textContent-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/activeText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/inactiveText-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-switch/switchWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-button-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +74 -74
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-defaultValue-editor.vue +34 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time/time-timeLimit-editor.vue +53 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-defaultValue-editor.vue +35 -18
- package/src/components/xform/form-designer/setting-panel/property-editor/field-time-range/time-range-format-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchField-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabSearch/vabSearchName-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/field-vabUpload-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload2/field-vabUpload2-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vue-page/vue-page-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/fileMaxSize-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -176
- package/src/components/xform/form-designer/setting-panel/property-editor/fixedQuery-editor.vue +39 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +41 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/formatType-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/formula-editor.vue +972 -972
- package/src/components/xform/form-designer/setting-panel/property-editor/iconClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/label-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelAlign-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelColor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/labelWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/limit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/max-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/maxLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/min-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/minLength-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/multipleLimit-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/name-editor.vue +15 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/placeholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/precision-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/prefixIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +6 -6
- package/src/components/xform/form-designer/setting-panel/property-editor/relative-default-block.vue +369 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/requiredHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/rows-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/space-editor-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/startPlaceholder-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/step-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTableClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/styleTitClass-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/suffixIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/tempStorage-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +2 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/type-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadTip-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/uploadURL-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/urlValueEnabled-editor.vue +91 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/validation-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/validationHint-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/widgetWidth-editor.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +374 -351
- package/src/components/xform/form-designer/toolbar-panel/index.vue +266 -103
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +655 -589
- package/src/components/xform/form-designer/widget-panel/index.vue +391 -341
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +351 -308
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +4642 -4028
- package/src/components/xform/form-render/container-item/containerItemMixin.js +76 -61
- package/src/components/xform/form-render/container-item/data-table-item.vue +24 -13
- package/src/components/xform/form-render/container-item/data-table-mixin.js +5927 -3400
- package/src/components/xform/form-render/container-item/detail-h5-item.vue +173 -173
- package/src/components/xform/form-render/container-item/detail-item.vue +446 -224
- package/src/components/xform/form-render/container-item/detail-plain-item.vue +92 -0
- package/src/components/xform/form-render/container-item/list-h5-item.vue +1186 -411
- package/src/components/xform/form-render/container-item/tab-item.vue +129 -125
- package/src/components/xform/form-render/container-item/table-item.vue +0 -3
- package/src/components/xform/form-render/container-item/table2-item.vue +18 -10
- package/src/components/xform/form-render/dynamicDialogRender.js +140 -99
- package/src/components/xform/form-render/index.vue +8 -8
- package/src/components/xform/form-render/indexMixin.js +5299 -3766
- package/src/components/xform/form-render/refMixin.js +14 -11
- package/src/components/xform/lang/en-US.js +473 -438
- package/src/components/xform/lang/en-US_extension.js +4 -0
- package/src/components/xform/lang/zh-CN.js +646 -620
- package/src/components/xform/mixins/defaultHandle.js +363 -26
- package/src/components/xform/mixins/scriptHttp.js +54 -51
- package/src/components/xform/utils/attachmentValueUtil.js +239 -0
- package/src/components/xform/utils/fixedQueryUtil.js +93 -0
- package/src/components/xform/utils/format.js +195 -169
- package/src/components/xform/utils/queryParamUtil.js +84 -0
- package/src/components/xform/utils/tableColumnHelper.js +7 -8
- package/src/components/xform/utils/util.js +1663 -1551
- package/src/components/xform/utils/validators.js +100 -48
- package/src/index.js +403 -89
- package/src/layout/components/AppMain.vue +147 -119
- package/src/layout/components/Sidebar/default.vue +109 -59
- package/src/layout/components/TagsView/index.vue +1 -1
- package/src/layout/components/extractedCode/queryDialog.vue +33 -26
- package/src/layout/components/extractedCode/viewDialog.vue +207 -193
- package/src/layout/components/langTool.vue +128 -123
- package/src/layout/defaultLayout.vue +170 -158
- package/src/mixins/wf/index.js +40 -38
- package/src/public-path.js +38 -0
- package/src/router/modules/system.js +4 -0
- package/src/store/config/index.js +945 -669
- package/src/utils/pdfUtil.js +428 -70
- package/src/views/bd/setting/bd_company_env/dialog.vue +1 -1
- package/src/views/bd/setting/formVersion/button.vue +5 -0
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +21 -10
- package/src/views/bd/setting/formVersion/link.vue +5 -0
- package/src/views/bd/setting/form_script/edit.vue +1 -0
- package/src/views/bd/setting/form_script/edit1.vue +1 -0
- package/src/views/bd/setting/form_script/form_list.vue +1 -0
- package/src/views/bd/setting/form_script/list.vue +1 -0
- package/src/views/bd/setting/form_script/list1.vue +2 -0
- package/src/views/bd/setting/form_template/edit.vue +1 -0
- package/src/views/bd/setting/form_template/list.vue +2 -0
- package/src/views/bd/setting/form_template/mixins/edit.js +77 -74
- package/src/views/bd/setting/table_model/edit.vue +16 -29
- package/src/views/bd/setting/table_model/list.vue +1 -0
- package/src/views/bd/setting/table_model/mixins/edit.js +295 -149
- package/src/views/bd/setting/table_model/mixins/zdDialog.js +32 -0
- package/src/views/support/export_template/list.vue +1 -1
- package/src/views/user/company_info/edit.vue +149 -88
- package/src/views/user/form/form_template/dialog.vue +1 -1
- package/src/views/user/form/form_template/itemList.vue +1 -1
- package/src/views/user/form/form_template/list.vue +1 -1
- package/src/views/user/form/form_template_field/dialog.vue +1 -1
- package/src/views/user/form/form_type/dialog.vue +1 -1
- package/src/views/user/form/form_type/list.vue +1 -1
- package/src/views/user/form/report_requestaccess/dialog.vue +1 -1
- package/src/views/user/form/report_requestaccess/list.vue +1 -1
- package/src/views/user/form/vform/designer.vue +51 -22
- package/src/views/user/form/vform/render.vue +21 -23
- package/src/views/user/form/view/list.vue +134 -37
- package/src/views/user/wf/wfReport/index.vue +24 -1
- package/src/views/user/wf/wf_manage/list.vue +8 -4
- package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +0 -209
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin - /345/211/257/346/234/254.js" +0 -1639
- package/src/views/bd/setting/table_model/mixins/edit copy.js +0 -903
- package/src/views/user/menu/voc_list.vue +0 -686
package/src/index.js
CHANGED
|
@@ -1,102 +1,169 @@
|
|
|
1
1
|
/**version-1.0*/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import "./public-path"; // qiankun publicPath 修正,必须保持第一行
|
|
3
|
+
import Vue from "vue";
|
|
4
|
+
import Cookies from "js-cookie";
|
|
5
|
+
import "normalize.css/normalize.css"; // a modern alternative to CSS resets
|
|
6
|
+
import Element from "element-ui";
|
|
7
|
+
import "@/styles/element-variables.scss";
|
|
8
|
+
import "@/styles/index.scss"; // global css
|
|
9
|
+
|
|
10
|
+
import App from "@base/App";
|
|
11
|
+
import store from "@base/store";
|
|
12
|
+
import router, { resetRouter } from "@base/router";
|
|
13
|
+
import settings from "@/settings";
|
|
14
|
+
import { setToken as setAuthToken } from "@base/utils/auth";
|
|
15
|
+
import { loadViewComponent } from "@base/utils/resolveViewComponent";
|
|
16
|
+
|
|
17
|
+
import "@/icons"; // icon
|
|
18
|
+
import "@base/permission"; // permission control
|
|
19
|
+
|
|
20
|
+
import * as filters from "@base/filters"; // global filters
|
|
8
21
|
|
|
9
|
-
|
|
10
|
-
import store from '@base/store';
|
|
11
|
-
import router from '@base/router';
|
|
12
|
-
|
|
13
|
-
import '@/icons'; // icon
|
|
14
|
-
import '@base/permission'; // permission control
|
|
22
|
+
// main.js 文件添加以下代码
|
|
15
23
|
|
|
16
|
-
import
|
|
24
|
+
import BaseKeepAlive from "@base/utils/keepAlive.js";
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
Vue.component("BaseKeepAlive", BaseKeepAlive);
|
|
19
27
|
|
|
20
|
-
import
|
|
28
|
+
import VXETable from "vxe-table";
|
|
29
|
+
import "vxe-table/lib/style.css";
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
// 引入扩展插件
|
|
32
|
+
// import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.es6.min.js";
|
|
33
|
+
// import "@base/components/table/plugins/extend-cell-area/vxe-table-extend-cell-area.min.css";
|
|
23
34
|
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
/* // 设置授权信息
|
|
36
|
+
VXETable.setup({
|
|
37
|
+
// showAuthLog: true, // 是否在控制台显示授权信息,专业版支持关闭
|
|
38
|
+
// authId: 'gbeumewkoyt2rhf9', // 获取授权后在官网登录后进入“用户中心”查看
|
|
39
|
+
authId: 'gbeumewkoyt2rhft', // 获取授权后在官网登录后进入“用户中心”查看
|
|
40
|
+
// onAuth (e) {
|
|
41
|
+
// // 打印授权状态
|
|
42
|
+
// console.log(e)
|
|
43
|
+
// }
|
|
44
|
+
}) */
|
|
26
45
|
|
|
27
|
-
import Vab from
|
|
46
|
+
import Vab from "@base/utils/vab";
|
|
47
|
+
import createCodeEditorAsyncComponent from "@base/components/code-editor/async";
|
|
28
48
|
|
|
29
49
|
Vue.use(Vab);
|
|
30
50
|
|
|
51
|
+
// appCode 兜底派生:子应用(拥有自己的子命名空间,即 WEB_PREFIX !== MAIN_WEB_PREFIX)
|
|
52
|
+
// 若未在自身 settings.js 里维护 appCode,则从 WEB_PREFIX 去前导斜杠派生(/mkweb → mkweb),
|
|
53
|
+
// 免得每个子应用再手填一处、也不会写错。主应用/独立主站两前缀相同 → 保持空。
|
|
54
|
+
// 优先级:mount 里的 props.appCode > settings 显式值 > 此派生。window.WEB_PREFIX /
|
|
55
|
+
// MAIN_WEB_PREFIX 已由上面 vab 的 Object.assign(window, prefixConfig) 设好。
|
|
56
|
+
if (!settings.appCode) {
|
|
57
|
+
const webPrefix = window.WEB_PREFIX || "";
|
|
58
|
+
const mainWebPrefix = window.MAIN_WEB_PREFIX || "";
|
|
59
|
+
if (webPrefix && webPrefix !== mainWebPrefix) {
|
|
60
|
+
settings.appCode = webPrefix.replace(/^\/+/, "");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
31
64
|
Vue.use(VXETable);
|
|
32
65
|
|
|
33
|
-
import
|
|
66
|
+
/* import tablePluns from "@/mixins/table/index.js"
|
|
67
|
+
VXETable.use(tablePluns) */
|
|
68
|
+
|
|
69
|
+
import "@base/components/table/index.js";
|
|
34
70
|
|
|
35
|
-
import drag from
|
|
71
|
+
import drag from "@base/directive/el-drag-dialog/index.js";
|
|
36
72
|
|
|
37
73
|
Vue.use(drag.install);
|
|
38
74
|
|
|
39
|
-
import elDialogCenter from
|
|
75
|
+
import elDialogCenter from "@base/directive/el-dialog-center/index.js";
|
|
40
76
|
|
|
41
77
|
Vue.use(elDialogCenter.install);
|
|
42
78
|
|
|
43
|
-
import ErroreBox from
|
|
79
|
+
import ErroreBox from "@base/components/errorMsg/index.js";
|
|
44
80
|
|
|
45
81
|
Vue.use(ErroreBox);
|
|
46
82
|
|
|
47
|
-
import ExcelExport from
|
|
83
|
+
import ExcelExport from "@base/components/excelExport/index.js";
|
|
48
84
|
|
|
49
85
|
Vue.use(ExcelExport);
|
|
50
86
|
|
|
51
|
-
|
|
87
|
+
// 首屏优化:excelImport 链上有 xlsx(~430KB min),改为首次调用时才加载(utils/lazyPlugin)
|
|
88
|
+
import { lazyPrototypePlugin } from "@base/utils/lazyPlugin";
|
|
52
89
|
|
|
53
|
-
Vue.use(
|
|
90
|
+
Vue.use(
|
|
91
|
+
lazyPrototypePlugin(
|
|
92
|
+
() =>
|
|
93
|
+
import(
|
|
94
|
+
/* webpackChunkName: "excel-import" */ "@base/components/excelImport/index.js"
|
|
95
|
+
),
|
|
96
|
+
[{ name: "$excelImport" }, { name: "$downloadImportTemplate" }]
|
|
97
|
+
)
|
|
98
|
+
);
|
|
54
99
|
|
|
55
|
-
import ConfirmDialog from
|
|
100
|
+
import ConfirmDialog from "@base/components/confirmDialog/index.js";
|
|
56
101
|
|
|
57
102
|
Vue.use(ConfirmDialog);
|
|
58
103
|
|
|
59
|
-
import baseAlert from
|
|
104
|
+
import baseAlert from "@base/components/baseAlert/index.js";
|
|
60
105
|
|
|
61
106
|
Vue.use(baseAlert);
|
|
62
107
|
|
|
63
|
-
import
|
|
108
|
+
import FormDialog from "@base/components/formDialog/index.js";
|
|
64
109
|
|
|
65
|
-
Vue.use(
|
|
110
|
+
Vue.use(FormDialog);
|
|
66
111
|
|
|
67
|
-
import
|
|
112
|
+
import FormDrawer from "@base/components/formDrawer/index.js";
|
|
68
113
|
|
|
69
|
-
Vue.use(
|
|
114
|
+
Vue.use(FormDrawer);
|
|
70
115
|
|
|
71
|
-
|
|
116
|
+
import permission from "@base/directive/permission";
|
|
72
117
|
|
|
73
|
-
|
|
118
|
+
Vue.use(permission);
|
|
119
|
+
|
|
120
|
+
// 首屏优化:VabUpload 链上有 esdk-obs-browserjs(OBS SDK),改为首次调用时才加载
|
|
121
|
+
Vue.use(
|
|
122
|
+
lazyPrototypePlugin(
|
|
123
|
+
() =>
|
|
124
|
+
import(
|
|
125
|
+
/* webpackChunkName: "vab-upload" */ "@base/components/VabUpload/index.js"
|
|
126
|
+
),
|
|
127
|
+
[
|
|
128
|
+
{ name: "$baseUpload", methods: ["open", "upload"] },
|
|
129
|
+
{ name: "$openFileLibraryDialog" },
|
|
130
|
+
]
|
|
131
|
+
)
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
Vue.component("baseUpload", () =>
|
|
135
|
+
import("@base/components/VabUpload/view.vue")
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
import baseAttachment from "@base/components/baseAttachment/install";
|
|
74
139
|
|
|
75
140
|
Vue.use(baseAttachment);
|
|
76
|
-
Vue.component(
|
|
141
|
+
Vue.component("attachmentShowList", () =>
|
|
142
|
+
import("@base/components/baseAttachment/showList")
|
|
143
|
+
);
|
|
77
144
|
|
|
78
|
-
import
|
|
145
|
+
import "@base/resources/js/base/common.js";
|
|
79
146
|
|
|
80
|
-
import vxeFilter from
|
|
147
|
+
import vxeFilter from "@base/components/table/vxeFilter/index.js";
|
|
81
148
|
|
|
82
149
|
Vue.use(vxeFilter);
|
|
83
150
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
151
|
+
// 首屏优化:低频/非首屏组件转懒注册(名字与组件内 name 一致,写死字符串)
|
|
152
|
+
Vue.component("base-table-export", () =>
|
|
153
|
+
import("@base/components/excelExport/button.vue")
|
|
154
|
+
);
|
|
88
155
|
|
|
89
156
|
/* Vue.component('extendedProperties', () => import('@base/components/extendedProperties/view.vue')); */
|
|
90
157
|
|
|
91
|
-
import LimitNumber from
|
|
158
|
+
import LimitNumber from "@base/directive/LimitNumber/index.js";
|
|
92
159
|
|
|
93
160
|
Vue.use(LimitNumber);
|
|
94
161
|
|
|
95
|
-
import baseInputNumber from
|
|
162
|
+
import baseInputNumber from "@base/components/baseInputNumber/index.vue";
|
|
96
163
|
|
|
97
164
|
Vue.component(baseInputNumber.name, baseInputNumber);
|
|
98
165
|
|
|
99
|
-
import elReadonly from
|
|
166
|
+
import elReadonly from "@base/directive/el-readonly/index.js";
|
|
100
167
|
|
|
101
168
|
Vue.use(elReadonly);
|
|
102
169
|
|
|
@@ -104,25 +171,33 @@ Vue.use(elReadonly);
|
|
|
104
171
|
|
|
105
172
|
Vue.use(cnPrint);*/
|
|
106
173
|
|
|
107
|
-
|
|
108
|
-
import
|
|
109
|
-
|
|
110
|
-
Vue.component(oplogTable.name, oplogTable);
|
|
174
|
+
Vue.component("oplogTable", () =>
|
|
175
|
+
import("@base/components/oplogTable/index.vue")
|
|
176
|
+
);
|
|
111
177
|
|
|
112
|
-
|
|
178
|
+
Vue.component("baseInputBatch", () =>
|
|
179
|
+
import("@base/components/baseInputBatch/index.vue")
|
|
180
|
+
);
|
|
113
181
|
|
|
114
|
-
Vue.component(
|
|
182
|
+
Vue.component("baseArea", () => import("@base/components/baseArea/index.vue"));
|
|
115
183
|
|
|
116
|
-
Vue.component(
|
|
184
|
+
Vue.component("baseInputExport", () =>
|
|
185
|
+
import("@base/components/baseInputExport/index.vue")
|
|
186
|
+
);
|
|
117
187
|
|
|
118
|
-
Vue.component(
|
|
188
|
+
Vue.component("advancedSearchDialog", () =>
|
|
189
|
+
import("@base/components/advancedSearchDialog/index.vue")
|
|
190
|
+
);
|
|
119
191
|
|
|
120
|
-
|
|
192
|
+
// baseTabs/baseTabPane 必须同步注册,不可懒注册:
|
|
193
|
+
// xform 详情容器(detail-item)把所有 detail-pane 及其内部字段组件放在 <baseTabs> 的默认插槽里。
|
|
194
|
+
// 异步组件未解析时 Vue 只渲染占位注释节点,插槽内的组件不会被实例化,
|
|
195
|
+
// 于是 detail-item 的 mounted 早于内部字段组件的 created(registerToRefList)执行,
|
|
196
|
+
// 模板脚本 onMounted 里的 getWidgetRef('xxx') 首次进入必然拿到 undefined(二次进入因异步工厂已缓存而正常)。
|
|
197
|
+
import baseTabs from "@base/components/baseTabs/index.vue";
|
|
198
|
+
import baseTabPane from "@base/components/baseTabs/baseTabPane.vue";
|
|
121
199
|
|
|
122
200
|
Vue.component(baseTabs.name, baseTabs);
|
|
123
|
-
|
|
124
|
-
import baseTabPane from '@base/components/baseTabs/baseTabPane.vue'
|
|
125
|
-
|
|
126
201
|
Vue.component(baseTabPane.name, baseTabPane);
|
|
127
202
|
|
|
128
203
|
import vb_tabs from "@base/components/vb-tabs/index.vue";
|
|
@@ -133,31 +208,49 @@ Vue.component(vb_tabs.name, vb_tabs);
|
|
|
133
208
|
Vue.component(vb_tab_pane.name, vb_tab_pane);
|
|
134
209
|
Vue.component(xTabs.name, xTabs);
|
|
135
210
|
|
|
136
|
-
Vue.component(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Vue.component(
|
|
141
|
-
|
|
142
|
-
Vue.component(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
Vue.component(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Vue.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
211
|
+
Vue.component("status-tag", () =>
|
|
212
|
+
import("@base/components/statusTag/index.vue")
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
Vue.component("CodeEditor", createCodeEditorAsyncComponent);
|
|
216
|
+
|
|
217
|
+
Vue.component("scriptDescriptionButton", () =>
|
|
218
|
+
import("@base/components/scriptDescription/button")
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
Vue.component("scriptTestButton", () =>
|
|
222
|
+
import("@base/components/scriptTest/button")
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
Vue.component("BaseTextarea", () =>
|
|
226
|
+
import("@base/components/base-textarea/index.vue")
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
// 首屏优化:jsonImport/langImport 链上同样有 xlsx,改为首次调用时才加载
|
|
230
|
+
Vue.use(
|
|
231
|
+
lazyPrototypePlugin(
|
|
232
|
+
() =>
|
|
233
|
+
import(
|
|
234
|
+
/* webpackChunkName: "json-import" */ "@base/components/jsonImport/index.js"
|
|
235
|
+
),
|
|
236
|
+
[{ name: "$jsonImport" }, { name: "$jsonExport" }]
|
|
237
|
+
)
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
Vue.use(
|
|
241
|
+
lazyPrototypePlugin(
|
|
242
|
+
() =>
|
|
243
|
+
import(
|
|
244
|
+
/* webpackChunkName: "lang-import" */ "@base/components/langImport/index.js"
|
|
245
|
+
),
|
|
246
|
+
[{ name: "$langImport" }]
|
|
247
|
+
)
|
|
248
|
+
);
|
|
155
249
|
|
|
156
250
|
//vform
|
|
157
|
-
import '@base/components/xform/utils/directive'
|
|
158
|
-
|
|
251
|
+
// import '@base/components/xform/utils/directive'
|
|
159
252
|
|
|
160
|
-
import i18n from
|
|
253
|
+
import i18n from "@base/lang/index.js";
|
|
161
254
|
|
|
162
255
|
/**
|
|
163
256
|
* If you don't want to use mock-server
|
|
@@ -167,28 +260,249 @@ import i18n from '@base/lang/index.js'
|
|
|
167
260
|
* Currently MockJs will be used in the production environment,
|
|
168
261
|
* please remove it before going online ! ! !
|
|
169
262
|
*/
|
|
170
|
-
if (process.env.NODE_ENV ===
|
|
263
|
+
if (process.env.NODE_ENV === "production") {
|
|
171
264
|
/* const { mockXHR } = require('../mock')
|
|
172
265
|
mockXHR() */
|
|
173
266
|
}
|
|
174
267
|
|
|
175
268
|
Vue.use(Element, {
|
|
176
|
-
size: Cookies.get(
|
|
269
|
+
size: Cookies.get("size") || "medium", // set element-ui default size
|
|
177
270
|
// locale: enLang // 如果使用中文,无需设置,请删除
|
|
178
271
|
});
|
|
179
272
|
|
|
180
273
|
// register global utility filters
|
|
181
|
-
Object.keys(filters).forEach(key => {
|
|
274
|
+
Object.keys(filters).forEach((key) => {
|
|
182
275
|
Vue.filter(key, filters[key]);
|
|
183
276
|
});
|
|
184
277
|
|
|
278
|
+
// 详情承载宿主:弹框 remote 分支用它 loadMicroApp 装载归属子应用渲染私有详情页
|
|
279
|
+
Vue.component("micro-view-host", () =>
|
|
280
|
+
import("@base/components/micro-view-host/index.vue")
|
|
281
|
+
);
|
|
282
|
+
|
|
185
283
|
Vue.config.productionTip = false;
|
|
186
284
|
|
|
187
|
-
let
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
285
|
+
let instance = null;
|
|
286
|
+
|
|
287
|
+
function render(props = {}) {
|
|
288
|
+
const { container } = props;
|
|
289
|
+
instance = new Vue({
|
|
290
|
+
router,
|
|
291
|
+
store,
|
|
292
|
+
i18n,
|
|
293
|
+
render: (h) => h(App),
|
|
294
|
+
}).$mount(container ? container.querySelector("#app") : "#app");
|
|
295
|
+
window.$vueRoot = instance;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* 详情承载入口(qiankun 详情承载协议 §5.5)。
|
|
300
|
+
* 主应用/渲染方的 micro-view-host 用 loadMicroApp 装载本应用并置 props.microDetailHost=true,
|
|
301
|
+
* 要求只渲染 targetPath 指向的详情页、把详情页的刷新/关闭/回调桥接回主应用,不出整站壳。
|
|
302
|
+
* 契约字段见 docs/qiankun详情承载子应用对接清单.md。
|
|
303
|
+
*
|
|
304
|
+
* ⚠ parentVue shim 的委托语义需真机联调打磨:详情页 getTarget(this) 命中 shim 后会用到
|
|
305
|
+
* $http/$message/$baseConfirm/$attrs 等——这些经原型委托到宿主根实例(全局插件已装齐),
|
|
306
|
+
* 仅 $baseReload / _handleCallback 覆盖为回主应用的动作。个别详情页若有更深的 $parent 依赖,
|
|
307
|
+
* 按对接清单 §5.6 做最小改造。
|
|
308
|
+
*/
|
|
309
|
+
function mountDetailHost(props = {}) {
|
|
310
|
+
if (props.appCode) settings.appCode = props.appCode;
|
|
311
|
+
if (props.token) {
|
|
312
|
+
setAuthToken(props.token);
|
|
313
|
+
store.commit("user/SET_TOKEN", props.token);
|
|
314
|
+
}
|
|
315
|
+
if (props.lang) i18n.locale = props.lang;
|
|
316
|
+
|
|
317
|
+
const appCode = props.appCode || settings.appCode;
|
|
318
|
+
const resolved = loadViewComponent(props.targetPath, { appCode });
|
|
319
|
+
const target = resolved.component;
|
|
320
|
+
const bizParams = props.bizParams || {};
|
|
321
|
+
const viewMeta = props.viewMeta || {};
|
|
322
|
+
|
|
323
|
+
// shim 需先于 render 存在(作为 parentVue prop 传入),其 Vue 能力在挂载后经原型委托到根实例
|
|
324
|
+
const shim = {
|
|
325
|
+
$baseReload: () => props.onReload && props.onReload(),
|
|
326
|
+
_handleCallback: (flag) => props.onHandleCallback && props.onHandleCallback(flag),
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
const { container } = props;
|
|
330
|
+
const mountEl = container ? container.querySelector("#app") : "#app";
|
|
331
|
+
instance = new Vue({
|
|
332
|
+
store,
|
|
333
|
+
i18n,
|
|
334
|
+
render(h) {
|
|
335
|
+
if (!target) {
|
|
336
|
+
return h(
|
|
337
|
+
"div",
|
|
338
|
+
{ staticClass: "micro-detail-host-missing" },
|
|
339
|
+
"详情页组件未找到:" + (props.targetPath || "")
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
return h(target, {
|
|
343
|
+
props: Object.assign({}, bizParams, viewMeta, {
|
|
344
|
+
parentVue: shim,
|
|
345
|
+
_handleCallback: (flag) =>
|
|
346
|
+
props.onHandleCallback && props.onHandleCallback(flag),
|
|
347
|
+
outParam: props.initialOutParam,
|
|
348
|
+
}),
|
|
349
|
+
on: {
|
|
350
|
+
reload: () => props.onReload && props.onReload(),
|
|
351
|
+
close: () => props.onClose && props.onClose(),
|
|
352
|
+
"update:outParam": (v) =>
|
|
353
|
+
props.onUpdateOutParam && props.onUpdateOutParam(v),
|
|
354
|
+
},
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
}).$mount(mountEl);
|
|
358
|
+
// #4 listeners 透传:详情页里父级 v-on="listeners" 那批是详情页直接 this.$emit 的,
|
|
359
|
+
// 拦截根子组件的 $emit,任意事件都转发给主应用的 onEmit(按名字派回原 option.on)。
|
|
360
|
+
const child = instance.$children && instance.$children[0];
|
|
361
|
+
if (child && typeof child.$emit === "function") {
|
|
362
|
+
const rawEmit = child.$emit.bind(child);
|
|
363
|
+
child.$emit = (name, ...args) => {
|
|
364
|
+
if (typeof props.onEmit === "function") props.onEmit(name, ...args);
|
|
365
|
+
return rawEmit(name, ...args);
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
// 挂载后把 shim 的原型指向根实例:$http/$message/$baseConfirm 等委托过去,
|
|
369
|
+
// 而 shim 自有的 $baseReload/_handleCallback 覆盖生效(详情页动作时才会调用)
|
|
370
|
+
Object.setPrototypeOf(shim, instance);
|
|
371
|
+
window.$vueRoot = instance;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (!window.__POWERED_BY_QIANKUN__) {
|
|
375
|
+
// 独立运行 / 主应用形态:行为与拆分前一致
|
|
376
|
+
render();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* qiankun 子应用生命周期。
|
|
381
|
+
* 引包子应用入口 re-export 即可:export * from "cloud-web-corejs/src/index";
|
|
382
|
+
* 主子通信协议见 docs/qiankun微前端改造-实现方案.md 3.3。
|
|
383
|
+
*/
|
|
384
|
+
export async function bootstrap() {}
|
|
385
|
+
|
|
386
|
+
export async function mount(props = {}) {
|
|
387
|
+
if (props.microDetailHost) {
|
|
388
|
+
// 详情承载模式(micro-view-host 装载):不走整站壳/路由/菜单,
|
|
389
|
+
// 只在容器里渲染 props.targetPath 指向的本应用组件。见对接清单文档。
|
|
390
|
+
return mountDetailHost(props);
|
|
391
|
+
}
|
|
392
|
+
if (props.appCode) {
|
|
393
|
+
// 主应用可经 props 覆盖,子应用也可在自身 settings.js 里声明
|
|
394
|
+
settings.appCode = props.appCode;
|
|
395
|
+
}
|
|
396
|
+
if (props.token) {
|
|
397
|
+
// token 存 sessionStorage,按 origin 隔离——跨域/跨端口主应用的登录态子应用天然拿不到,
|
|
398
|
+
// 主应用显式下发 token 即可免登(写入自身登录态后守卫按已登录走 getInfo2)
|
|
399
|
+
setAuthToken(props.token);
|
|
400
|
+
store.commit("user/SET_TOKEN", props.token);
|
|
401
|
+
}
|
|
402
|
+
store.commit("micro/SET_MICRO_CONTEXT", {
|
|
403
|
+
appCode: props.appCode || settings.appCode,
|
|
404
|
+
// 非数组(null/未传)= 自治嵌入模式:子应用自拉菜单、保留自身壳(micro store 据此置 selfManaged)
|
|
405
|
+
menus: Array.isArray(props.menus) ? props.menus : null,
|
|
406
|
+
mainAdapter: props.mainAdapter || null,
|
|
407
|
+
// 主应用经本地调试覆盖装载:允许 URL 直达未配菜单的页面
|
|
408
|
+
debug: !!props.microDebug,
|
|
409
|
+
});
|
|
410
|
+
// 再次挂载时 unmount 已重置路由,而 roles 仍在会使守卫跳过路由生成,这里主动补一次
|
|
411
|
+
if (store.getters.roles && store.getters.roles.length > 0) {
|
|
412
|
+
if (store.state.micro.selfManaged) {
|
|
413
|
+
await store.dispatch("permission/generateRoutes2", {
|
|
414
|
+
flag: store.state.user.userFlag,
|
|
415
|
+
});
|
|
416
|
+
} else {
|
|
417
|
+
await store.dispatch(
|
|
418
|
+
"permission/generateRoutesFromProps",
|
|
419
|
+
props.menus || []
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
render(props);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* 保活协议(主应用 loadMicroApp 模式):
|
|
428
|
+
* update({ microActive: false }) —— 容器被隐藏:暂停路由监听(守卫 next(false) +
|
|
429
|
+
* ensureURL 置空,防止对主应用的 URL 变化做出反应、回写 URL 互相打架);
|
|
430
|
+
* update({ microActive: true }) —— 容器重新显示:恢复监听并把当前 hash 同步进路由
|
|
431
|
+
* (含主应用在隐藏期间切到本应用另一菜单的深导航场景)。
|
|
432
|
+
*/
|
|
433
|
+
let pausedEnsureURL = null;
|
|
434
|
+
|
|
435
|
+
function pauseSubRouter() {
|
|
436
|
+
if (store.state.micro.routerPaused) return;
|
|
437
|
+
store.commit("micro/SET_ROUTER_PAUSED", true);
|
|
438
|
+
const history = router.history;
|
|
439
|
+
if (history && typeof history.ensureURL === "function") {
|
|
440
|
+
pausedEnsureURL = history.ensureURL;
|
|
441
|
+
history.ensureURL = function () {};
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function resumeSubRouter() {
|
|
446
|
+
if (store.state.micro.routerPaused) {
|
|
447
|
+
store.commit("micro/SET_ROUTER_PAUSED", false);
|
|
448
|
+
if (pausedEnsureURL) {
|
|
449
|
+
router.history.ensureURL = pausedEnsureURL;
|
|
450
|
+
pausedEnsureURL = null;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
syncSubRouter();
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function syncSubRouter() {
|
|
457
|
+
const current = window.location.hash.replace(/^#/, "") || "/";
|
|
458
|
+
if (router.currentRoute.fullPath !== current) {
|
|
459
|
+
// vue-router 3.0.2 的 push 不返回 Promise(3.1.0 才加),直接 .catch 会读到
|
|
460
|
+
// undefined 抛错,且此调用发生在 qiankun update 生命周期内——异常会让 parcel 直接
|
|
461
|
+
// died、后续所有 update(含页签刷新转发)失效。仅当 push 返回 Promise 时才吞异常。
|
|
462
|
+
const nav = router.push(current);
|
|
463
|
+
if (nav && typeof nav.catch === "function") {
|
|
464
|
+
nav.catch(() => {});
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* 主应用页签"刷新"转发过来时在子应用内部重建当前页组件。
|
|
471
|
+
* 不能套用主应用那招(delCachedView + 跳 /redirect):子应用与主应用共用同一个
|
|
472
|
+
* 浏览器 hash,跳 /redirect 会被主应用 afterEach 判成"离开子应用路由",
|
|
473
|
+
* 容器随即隐藏并暂停子应用路由,重建被掐断——表现就是点刷新没反应。
|
|
474
|
+
* 改为自增序号通知 AppMain 原地销毁重建,全程不碰 URL。
|
|
475
|
+
*/
|
|
476
|
+
function refreshCurrentView() {
|
|
477
|
+
store.commit("micro/BUMP_RELOAD_SEQ");
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export async function update(props = {}) {
|
|
481
|
+
if (props.microActive === false) {
|
|
482
|
+
pauseSubRouter();
|
|
483
|
+
} else if (props.microActive === true) {
|
|
484
|
+
resumeSubRouter();
|
|
485
|
+
}
|
|
486
|
+
if (props.microRefresh) {
|
|
487
|
+
refreshCurrentView();
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
export async function unmount() {
|
|
492
|
+
if (store.state.micro.routerPaused && pausedEnsureURL) {
|
|
493
|
+
router.history.ensureURL = pausedEnsureURL;
|
|
494
|
+
pausedEnsureURL = null;
|
|
495
|
+
}
|
|
496
|
+
if (instance) {
|
|
497
|
+
instance.$destroy();
|
|
498
|
+
if (instance.$el) {
|
|
499
|
+
instance.$el.innerHTML = "";
|
|
500
|
+
}
|
|
501
|
+
instance = null;
|
|
502
|
+
}
|
|
503
|
+
if (window.$vueRoot) {
|
|
504
|
+
window.$vueRoot = null;
|
|
505
|
+
}
|
|
506
|
+
store.commit("micro/CLEAR_MICRO_CONTEXT");
|
|
507
|
+
resetRouter();
|
|
508
|
+
}
|