cloud-web-corejs 1.1.0-dev.6 → 1.1.0-dev.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/bin/core-resources.js +16 -0
- package/bin/create-child-app.js +34 -0
- package/docs/child-app/README.md +95 -0
- package/docs/child-app/activiti-resources.md +63 -0
- package/docs/child-app/generate-prompt.md +55 -0
- package/docs/child-app/luckysheet-resources.md +80 -0
- package/docs/child-app/public-resources-plan.md +288 -0
- package/docs/child-app/resources-implementation.md +101 -0
- package/docs/child-app/tinymce-resources.md +88 -0
- package/docs/child-app/validation.md +34 -0
- package/docs/qiankun/346/216/245/345/205/245/345/215/217/350/256/256.md +298 -0
- package/docs/qiankun/350/257/246/346/203/205/346/211/277/350/275/275/345/255/220/345/272/224/347/224/250/345/257/271/346/216/245/346/270/205/345/215/225.md +111 -0
- package/package.json +29 -4
- package/resource-tools/index.js +126 -0
- package/src/app-bootstrap.js +531 -0
- package/src/app-bootstrap.sync.js +502 -0
- package/src/boot-assets.legacy.js +13 -0
- package/src/boot-assets.next.js +7 -0
- package/src/components/Qrcode/fileParse.vue +11 -0
- package/src/components/Tinymce/dynamicLoadScript.js +51 -59
- package/src/components/Tinymce/index.vue +382 -336
- package/src/components/Tinymce/mce-chrome.scss +150 -0
- package/src/components/VabUpload/image-viewer.vue +18 -10
- package/src/components/VabUpload/index.js +11 -4
- package/src/components/VabUpload/index.vue +1 -1
- package/src/components/VabUpload/mixins/fileLibraryDialog.js +2 -0
- package/src/components/VabUpload/mixins.js +72 -40
- package/src/components/VabUpload/partUploadConfig.js +95 -0
- package/src/components/VabUpload/privateProfileDialogMixins.js +2 -0
- package/src/components/VabUpload/style.scss +282 -0
- package/src/components/VabUpload/view.vue +19 -18
- package/src/components/baseArea/index.vue +2 -2
- package/src/components/baseInputExport/mixins.js +1 -6
- package/src/components/bizTab/BizTabListPage.vue +66 -33
- package/src/components/bizTab/README.md +3 -1
- package/src/components/bizTab/bizBillDetailMixin.js +2 -0
- package/src/components/code-editor/ace-chrome.scss +17 -0
- package/src/components/code-editor/index.vue +361 -340
- package/src/components/errorMsg/index.vue +142 -13
- package/src/components/errorMsg/mixins.js +53 -0
- package/src/components/excelExport/conditionExportConfig.js +112 -0
- package/src/components/excelExport/exportColumnMemory.js +118 -0
- package/src/components/excelExport/exportFieldDialog.vue +50 -38
- package/src/components/excelExport/exportType.js +8 -0
- package/src/components/excelExport/index.js +30 -13
- package/src/components/excelExport/index.vue +7 -1
- package/src/components/excelExport/mixins.js +782 -293
- package/src/components/excelImport/index.vue +156 -156
- package/src/components/excelImport/mixins.js +888 -834
- package/src/components/fileLibrary/mixins/indexMixins.js +2 -0
- package/src/components/fileLibrary/style.scss +579 -0
- package/src/components/formDialog/index.vue +11 -8
- package/src/components/hiprint/style.scss +188 -0
- package/src/components/hiprint/view/json-view.vue +4 -4
- package/src/components/jdPrint/mixins.js +2 -0
- package/src/components/jsonImport/index.vue +1 -1
- package/src/components/jsonImport/mixins.js +6 -10
- package/src/components/langImport/index.vue +1 -1
- package/src/components/langImport/mixins.js +6 -10
- package/src/components/luckysheet/loadResources.js +64 -0
- package/src/components/luckysheet/view.vue +239 -210
- package/src/components/mobile/buttonGroup/index.vue +1 -1
- package/src/components/mobile/wf/addTaskUserdialog.vue +100 -80
- package/src/components/mobile/wf/content.vue +1734 -1662
- package/src/components/mobile/wf/deleteTaskUserDialog.vue +73 -54
- package/src/components/mobile/wf/selectUserDialog.vue +118 -0
- package/src/components/mobile/wf/setCandidateDialog.vue +69 -48
- package/src/components/mobile/wf/urgingDialog.vue +75 -52
- package/src/components/mobile/wf/wfModifyDialog.vue +4 -0
- package/src/components/obsUpload/index.js +4 -1
- package/src/components/obsUpload/index.vue +1 -1
- package/src/components/obsUpload/mixins.js +45 -15
- package/src/components/onlineTalk/index.vue +4 -4
- package/src/components/onlineTalk/mixins.js +21 -7
- package/src/components/table/index.js +96 -81
- package/src/components/table/plugins/cell-area/index.js +10 -3
- package/src/components/table/style.scss +1399 -0
- package/src/components/table/vxeFilter/mixin.js +28 -18
- package/src/components/wf/content.vue +3 -2
- package/src/components/wf/content2.vue +1 -1
- package/src/components/wf/style.scss +265 -0
- package/src/components/wf/wf.js +7 -0
- package/src/components/wf/wfActionItems.js +3 -0
- package/src/components/wf/wfStartDialog.vue +1 -0
- package/src/components/wf/wfTransferEnabled.js +54 -0
- package/src/components/wf/wfUtil.js +47 -29
- package/src/components/wf/wfVisibility.js +6 -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" +64 -57
- package/src/components/xform/docs/2026-08 xform H5 P0 /345/256/236/347/216/260/350/247/204/346/240/274.md" +1 -1
- package/src/components/xform/docs/2026-08 xform /347/247/273/345/212/250/347/253/257/345/270/203/345/261/200/345/257/271/351/275/220 bill_setting /346/226/271/346/241/210.md" +1 -1
- package/src/components/xform/docs/2026-09 /345/212/250/346/200/201/345/255/227/346/256/265/350/247/204/345/210/231/344/270/216/346/265/201/347/250/213/346/216/247/345/210/266/346/211/247/350/241/214/351/241/272/345/272/217/350/220/275/345/234/260/346/226/271/346/241/210.md" +409 -0
- package/src/components/xform/docs/2026-09 /346/235/241/344/273/266/345/257/274/345/207/272/345/244/247/346/225/260/346/215/256/351/207/217/345/264/251/346/272/203/346/216/222/346/237/245.md" +389 -0
- package/src/components/xform/docs/2026-09 /346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206P0/344/273/243/347/240/201/350/257/204/345/256/241.md" +255 -0
- package/src/components/xform/docs/2026-09 /346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206P0/346/265/213/350/257/225/351/252/214/350/257/201/345/256/236/346/226/275/346/226/207/346/241/243.md" +595 -0
- package/src/components/xform/docs/2026-09 /347/274/226/350/276/221/350/241/250/350/241/214/345/206/205/344/277/235/345/255/230/346/240/241/351/252/214/350/214/203/345/233/264/344/270/216/345/210/227/345/277/205/345/241/253/350/247/243/346/236/220/344/277/256/345/244/215.md" +233 -0
- package/src/components/xform/docs/2026-09 /350/241/250/345/215/225/345/257/274/345/205/245/351/200/232/351/201/223/346/242/263/347/220/206/344/270/216/350/220/275/345/234/260/346/226/271/346/241/210.md" +745 -0
- package/src/components/xform/docs//346/265/217/350/247/210/345/231/250/345/264/251/346/272/203/346/262/273/347/220/206/344/270/216/344/277/256/345/244/215/350/220/275/345/234/260/346/226/271/346/241/210.md +324 -0
- package/src/components/xform/form-designer/designer.js +2133 -2100
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +7 -0
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-widget.vue +4 -2
- package/src/components/xform/form-designer/form-widget/container-widget/detail-h5-widget.vue +243 -227
- package/src/components/xform/form-designer/form-widget/container-widget/h5-card-pane-widget.vue +228 -207
- package/src/components/xform/form-designer/form-widget/container-widget/h5-card-widget.vue +165 -136
- package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +30 -4
- package/src/components/xform/form-designer/form-widget/dialog/importDialog.vue +190 -185
- package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +2657 -1774
- package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +27 -4
- package/src/components/xform/form-designer/form-widget/field-widget/a-link-widget.vue +1 -1
- 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/area-select-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/baseAttachment-widget.vue +1 -1
- 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 +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/census-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/checkbox-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/color-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/copy_button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/date-range-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/descriptions-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/divider-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/download-button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-item-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/dropdown-widget.vue +35 -4
- package/src/components/xform/form-designer/form-widget/field-widget/echart-bar-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/echart-category-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/echart-pie-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +64 -10
- package/src/components/xform/form-designer/form-widget/field-widget/file-upload-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +14 -4
- package/src/components/xform/form-designer/form-widget/field-widget/html-text-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +19 -6
- package/src/components/xform/form-designer/form-widget/field-widget/import2-button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/index.js +10 -1
- package/src/components/xform/form-designer/form-widget/field-widget/input-batch-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/input-widget.vue +29 -3
- package/src/components/xform/form-designer/form-widget/field-widget/multiSearch-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/news-list-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/number-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/picture-upload-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/print-button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/print-detail-button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/project-tag-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/radio-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/rate-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/rich-editor-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/row-col-select-widget.vue +64 -0
- package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/search_button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-button-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/select-export-item-button-widget.vue +6 -2
- package/src/components/xform/form-designer/form-widget/field-widget/select-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/singerSearch-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/singleUpload-widget.vue +145 -145
- package/src/components/xform/form-designer/form-widget/field-widget/slider-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/static-content-wrapper.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/static-text-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/switch-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/table-export-button-widget.vue +3 -2
- 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 +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/textarea-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/time-range-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/time-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/title-head-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/vabSearch-widget.vue +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload-widget.vue +3 -3
- package/src/components/xform/form-designer/form-widget/field-widget/vabUpload2-widget.vue +25 -1
- package/src/components/xform/form-designer/form-widget/field-widget/vue-page-widget.vue +1 -1
- package/src/components/xform/form-designer/indexMixin.js +27 -0
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +687 -602
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +269 -36
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +335 -12
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +23 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-temp-edito.vue +13 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +846 -860
- package/src/components/xform/form-designer/setting-panel/property-editor/container-tab/tab-lazyRender-editor.vue +27 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabChange-editor.vue +28 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/onTabClick-editor.vue +28 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +62 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import2-button-editor.vue +142 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/empty-number-input.vue +51 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/select-export-item-button-editor.vue +27 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-table-export-button/table-export-button-editor.vue +33 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/project-tag-editor.vue +2 -4
- package/src/components/xform/form-designer/setting-panel/property-editor/suffixIconClickable-editor.vue +23 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +18 -4
- package/src/components/xform/form-designer/toolbar-panel/index.vue +884 -874
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +13 -0
- package/src/components/xform/form-designer/widget-panel/index.vue +11 -7
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +15 -2
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +152 -9
- package/src/components/xform/form-render/container-item/containerItemMixin.js +93 -8
- package/src/components/xform/form-render/container-item/data-table-item.vue +352 -347
- package/src/components/xform/form-render/container-item/data-table-mixin.js +7261 -5985
- package/src/components/xform/form-render/container-item/detail-h5-item.vue +48 -19
- package/src/components/xform/form-render/container-item/detail-item.vue +350 -446
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +55 -1
- package/src/components/xform/form-render/container-item/list-h5-item.vue +261 -178
- package/src/components/xform/form-render/container-item/panel-item.vue +1 -1
- package/src/components/xform/form-render/container-item/tab-item.vue +177 -129
- package/src/components/xform/form-render/fieldControlEngine.js +218 -0
- package/src/components/xform/form-render/fieldControlMixin.js +536 -0
- package/src/components/xform/form-render/index.vue +164 -153
- package/src/components/xform/form-render/indexMixin.js +5443 -5311
- package/src/components/xform/form-render/pageDialogScope.js +54 -0
- package/src/components/xform/icon-picker/index.vue +1 -1
- package/src/components/xform/lang/en-US.js +8 -0
- package/src/components/xform/lang/zh-CN.js +9 -0
- package/src/components/xform/mixins/businessLock.js +59 -0
- package/src/components/xform/mixins/defaultHandle.js +713 -707
- package/src/components/xform/mixins/scriptHttp.js +42 -21
- package/src/components/xform/mixins/wfStart.js +105 -0
- package/src/components/xform/mixins/wfVisibility.js +33 -0
- package/src/components/xform/styles/census.scss +288 -0
- package/src/components/xform/styles/containers.scss +215 -0
- package/src/components/xform/styles/designer.scss +904 -0
- package/src/components/xform/styles/detail-temp.scss +71 -0
- package/src/components/xform/styles/h5-designer.scss +191 -0
- package/src/components/xform/styles/h5-runtime.scss +520 -0
- package/src/components/xform/styles/h5.scss +836 -516
- package/src/components/xform/styles/skins.scss +398 -0
- package/src/components/xform/styles/table-layout.scss +91 -0
- package/src/components/xform/styles/titles.scss +255 -0
- package/src/components/xform/utils/dynamicSchemaUtil.js +385 -361
- package/src/components/xform/utils/fixedQueryUtil.js +29 -4
- package/src/components/xform/utils/serviceNameCache.js +69 -0
- package/src/components/xform/utils/tableColumnHelper.js +46 -4
- package/src/components/xform/utils/util.js +1776 -1708
- package/src/core-resources/css/h5.scss +548 -0
- package/src/core-resources/css/iconfont.css +1447 -0
- package/src/core-resources/font/iconfont.ttf +0 -0
- package/src/core-resources/font/iconfont.woff +0 -0
- package/src/core-resources/font/iconfont.woff2 +0 -0
- package/src/core-resources/images/default-header.png +0 -0
- package/src/core-resources/images/ico-default_wenjian.svg +1 -0
- package/src/core-resources/images/ico-excel.svg +1 -0
- package/src/core-resources/images/ico-ftl.svg +7 -0
- package/src/core-resources/images/ico-html.svg +1 -0
- package/src/core-resources/images/ico-java.svg +1 -0
- package/src/core-resources/images/ico-music.svg +1 -0
- package/src/core-resources/images/ico-pdf.svg +1 -0
- package/src/core-resources/images/ico-photo.svg +1 -0
- package/src/core-resources/images/ico-ppt.svg +1 -0
- package/src/core-resources/images/ico-psd.svg +1 -0
- package/src/core-resources/images/ico-service.png +0 -0
- package/src/core-resources/images/ico-txt.svg +1 -0
- package/src/core-resources/images/ico-video.svg +1 -0
- package/src/core-resources/images/ico-vue.svg +8 -0
- package/src/core-resources/images/ico-wenjianjia.svg +1 -0
- package/src/core-resources/images/ico-wrod.svg +1 -0
- package/src/core-resources/images/ico-xml.svg +1 -0
- package/src/core-resources/images/ico-yasuobao.svg +1 -0
- package/src/core-resources/images/icon-error.png +0 -0
- package/src/core-resources/images/icon-tips.png +0 -0
- package/src/core-resources/images/nodata.png +0 -0
- package/src/core-resources/images/nodata2.png +0 -0
- package/src/directive/append-to-body/index.js +48 -0
- package/src/directive/el-dialog-center/index.js +3 -2
- package/src/directive/el-drag-dialog/drag.js +33 -4
- package/src/icons/index.js +9 -0
- package/src/icons/svg/404.svg +1 -0
- package/src/icons/svg/alert.svg +1 -0
- package/src/icons/svg/bug.svg +1 -0
- package/src/icons/svg/button.svg +1 -0
- package/src/icons/svg/card.svg +1 -0
- package/src/icons/svg/cascader-field.svg +1 -0
- package/src/icons/svg/census.svg +1 -0
- package/src/icons/svg/chart.svg +1 -0
- package/src/icons/svg/checkbox-field.svg +1 -0
- package/src/icons/svg/clipboard.svg +1 -0
- package/src/icons/svg/color-field.svg +1 -0
- package/src/icons/svg/component.svg +1 -0
- package/src/icons/svg/custom-component.svg +1 -0
- package/src/icons/svg/dashboard.svg +1 -0
- package/src/icons/svg/data-table.svg +1 -0
- package/src/icons/svg/date-field.svg +1 -0
- package/src/icons/svg/date-range-field.svg +1 -0
- package/src/icons/svg/descriptions.svg +1 -0
- package/src/icons/svg/divider.svg +1 -0
- package/src/icons/svg/document.svg +1 -0
- package/src/icons/svg/documentation.svg +1 -0
- package/src/icons/svg/drag.svg +1 -0
- package/src/icons/svg/echart-category.svg +1 -0
- package/src/icons/svg/echart-pie.svg +1 -0
- package/src/icons/svg/echart.svg +1 -0
- package/src/icons/svg/edit.svg +1 -0
- package/src/icons/svg/education.svg +1 -0
- package/src/icons/svg/email.svg +1 -0
- package/src/icons/svg/example.svg +1 -0
- package/src/icons/svg/excel.svg +1 -0
- package/src/icons/svg/exit-fullscreen.svg +1 -0
- package/src/icons/svg/eye-open.svg +1 -0
- package/src/icons/svg/eye.svg +1 -0
- package/src/icons/svg/file-upload-field.svg +1 -0
- package/src/icons/svg/form.svg +1 -0
- package/src/icons/svg/fullscreen.svg +1 -0
- package/src/icons/svg/github.svg +1 -0
- package/src/icons/svg/grid.svg +1 -0
- package/src/icons/svg/guide.svg +1 -0
- package/src/icons/svg/html-text.svg +1 -0
- package/src/icons/svg/ico-more.svg +1 -0
- package/src/icons/svg/ico-wenjianjia.svg +1 -0
- package/src/icons/svg/icon.svg +1 -0
- package/src/icons/svg/input-batch.svg +1 -0
- package/src/icons/svg/international.svg +1 -0
- package/src/icons/svg/language.svg +1 -0
- package/src/icons/svg/link.svg +1 -0
- package/src/icons/svg/list-export.svg +1 -0
- package/src/icons/svg/list.svg +1 -0
- package/src/icons/svg/lock.svg +1 -0
- package/src/icons/svg/message.svg +1 -0
- package/src/icons/svg/money.svg +1 -0
- package/src/icons/svg/nested.svg +1 -0
- package/src/icons/svg/news-list.svg +1 -0
- package/src/icons/svg/node-tree.svg +1 -0
- package/src/icons/svg/number-field.svg +1 -0
- package/src/icons/svg/password.svg +1 -0
- package/src/icons/svg/pdf.svg +1 -0
- package/src/icons/svg/people.svg +1 -0
- package/src/icons/svg/peoples.svg +1 -0
- package/src/icons/svg/picture-upload-field.svg +1 -0
- package/src/icons/svg/qq.svg +1 -0
- package/src/icons/svg/query.svg +1 -0
- package/src/icons/svg/radio-field.svg +1 -0
- package/src/icons/svg/rate-field.svg +1 -0
- package/src/icons/svg/redo.svg +1 -0
- package/src/icons/svg/rich-editor-field.svg +1 -0
- package/src/icons/svg/search.svg +1 -0
- package/src/icons/svg/searchbox.svg +1 -0
- package/src/icons/svg/section.svg +1 -0
- package/src/icons/svg/select-field.svg +1 -0
- package/src/icons/svg/shopping.svg +1 -0
- package/src/icons/svg/size.svg +1 -0
- package/src/icons/svg/skill.svg +1 -0
- package/src/icons/svg/slider-field.svg +1 -0
- package/src/icons/svg/slot-component.svg +1 -0
- package/src/icons/svg/slot-field.svg +1 -0
- package/src/icons/svg/star.svg +1 -0
- package/src/icons/svg/static-text.svg +1 -0
- package/src/icons/svg/status.svg +1 -0
- package/src/icons/svg/sub-form.svg +1 -0
- package/src/icons/svg/switch-field.svg +1 -0
- package/src/icons/svg/tab.svg +1 -0
- package/src/icons/svg/table.svg +1 -0
- package/src/icons/svg/text-field.svg +1 -0
- package/src/icons/svg/text.svg +1 -0
- package/src/icons/svg/textarea-field.svg +1 -0
- package/src/icons/svg/theme.svg +1 -0
- package/src/icons/svg/time-field.svg +1 -0
- package/src/icons/svg/time-range-field.svg +1 -0
- package/src/icons/svg/tips-text.svg +1 -0
- package/src/icons/svg/title-head.svg +1 -0
- package/src/icons/svg/tree-pane.svg +1 -0
- package/src/icons/svg/tree-table.svg +1 -0
- package/src/icons/svg/tree.svg +1 -0
- package/src/icons/svg/undo.svg +1 -0
- package/src/icons/svg/uploadbox.svg +1 -0
- package/src/icons/svg/user.svg +1 -0
- package/src/icons/svg/vf-box.svg +1 -0
- package/src/icons/svg/vf-dialog.svg +1 -0
- package/src/icons/svg/vf-drawer.svg +1 -0
- package/src/icons/svg/vue-sfc.svg +1 -0
- package/src/icons/svg/wechat.svg +1 -0
- package/src/icons/svg/zip.svg +1 -0
- package/src/index.js +2 -510
- package/src/index.next.js +5 -0
- package/src/index.sync.js +5 -0
- package/src/layout/components/Sidebar/default.vue +1656 -1655
- package/src/layout/components/TagsView/index.vue +330 -323
- package/src/layout/components/TagsView/style.scss +92 -0
- package/src/layout/defaultLayout.vue +2 -2
- package/src/router/index.js +43 -48
- package/src/router/modules/customer.js +12 -0
- package/src/store/modules/settings.js +1 -1
- package/src/store/modules/tagsView.js +241 -217
- package/src/store/modules/user.js +16 -12
- package/src/styles/btn.scss +315 -0
- package/src/styles/dialog.scss +1710 -0
- package/src/styles/element-ui.scss +1076 -0
- package/src/styles/element-variables.scss +31 -0
- package/src/styles/global.scss +115 -0
- package/src/styles/index.scss +245 -0
- package/src/styles/layout-skins.scss +840 -0
- package/src/styles/legacy-base.scss +19 -0
- package/src/styles/menu-icons.scss +75 -0
- package/src/styles/mixin.scss +80 -0
- package/src/styles/nprogress.scss +14 -0
- package/src/styles/page-shell.scss +723 -0
- package/src/styles/sidebar.scss +296 -0
- package/src/styles/split-handle.scss +52 -0
- package/src/styles/theme-variables.scss +7 -0
- package/src/styles/transition.scss +48 -0
- package/src/styles/utilities.scss +253 -0
- package/src/styles/variables.scss +72 -0
- package/src/utils/baseDictsCache.js +197 -0
- package/src/utils/chunkLoadError.js +24 -0
- package/src/utils/featureResources.js +57 -0
- package/src/utils/importLimit.js +72 -0
- package/src/utils/pdfUtil.js +6 -1
- package/src/utils/request.js +142 -7
- package/src/utils/resolveViewComponent.js +45 -90
- package/src/utils/runtimeRecovery.js +105 -0
- package/src/utils/swiperLoader.js +20 -0
- package/src/utils/vab.js +1334 -1283
- package/src/utils/xlsxLoader.js +29 -0
- package/src/views/bd/setting/formVersion/compareContMixin.scss +1 -1
- package/src/views/bd/setting/form_template/edit.vue +378 -356
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +6 -0
- package/src/views/bd/setting/form_template/formTemplateType.js +43 -0
- package/src/views/bd/setting/form_template/list.vue +304 -303
- package/src/views/bd/setting/form_template/mixins/edit.js +344 -280
- package/src/views/bd/setting/form_template/mixins/list.js +749 -721
- package/src/views/bd/setting/form_template/mixins/list2.js +412 -411
- package/src/views/bd/setting/form_template/mixins/wf_list.js +431 -430
- package/src/views/mobile/user/area/dialog.vue +1 -1
- package/src/views/mobile/user/user/dialog.vue +1 -1
- package/src/views/user/bill_setting/mixins/wf.js +8 -0
- package/src/views/user/bill_setting/render.vue +1 -1
- package/src/views/user/commMenu/index.vue +3 -1
- package/src/views/user/commMenu/style.scss +123 -0
- package/src/views/user/common_attribute/edit.vue +2 -0
- package/src/views/user/common_attribute/itemEdit.vue +2 -0
- package/src/views/user/file_view_ins/list.vue +970 -970
- package/src/views/user/form/form_template/list.vue +527 -506
- package/src/views/user/form/vform/designer.vue +823 -821
- package/src/views/user/form/view/list.vue +24 -1
- package/src/views/user/home/default.vue +1124 -1117
- package/src/views/user/home/default2.vue +12 -8
- package/src/views/user/home/index.vue +102 -102
- package/src/views/user/home/wjl/content.vue +1581 -1569
- package/src/views/user/intf_permission/edit.vue +230 -0
- package/src/views/user/intf_permission/list.vue +196 -0
- package/src/views/user/menuFallback/index.vue +23 -0
- package/src/views/user/notify_message/dialog.vue +139 -139
- package/src/views/user/outLink/form_view.vue +202 -202
- package/src/views/user/outLink/index.vue +110 -110
- package/src/views/user/role/edit.vue +4 -0
- package/src/views/user/role/role-box.scss +83 -0
- package/src/views/user/role/voc_edit.vue +4 -0
- package/src/views/user/user/list.vue +28 -6
- package/src/views/user/wf/iframe/index.vue +51 -51
- package/src/views/user/wf/iframe/index2.vue +64 -64
- package/src/views/user/wf/wf_diy_attribute/edit.vue +1 -1
- package/src/views/user/wf/wf_manage/list2.vue +871 -871
- package/src/views/user/wf/wf_manage/wfContentDialog.vue +177 -126
- package/src/views/user/wf/wf_obj_config/activiti_wf.vue +134 -133
- package/src/views/user/wf/wf_obj_config/importItemDialog.vue +1 -1
- package/src/views/user/wf/wf_obj_config/list.vue +747 -746
- package/src/views/user/wf/wf_obj_config/list_form.vue +374 -373
- package/templates/child-app/.env +3 -0
- package/templates/child-app/README.md +49 -0
- package/templates/child-app/app.config.js +6 -0
- package/templates/child-app/babel.config.js +1 -0
- package/templates/child-app/core-resources.config.js +15 -0
- package/templates/child-app/gitignore +7 -0
- package/templates/child-app/package.json +34 -0
- package/templates/child-app/public/index.html +12 -0
- package/templates/child-app/src/assets/401_images/401.gif +0 -0
- package/templates/child-app/src/assets/404_images/404.png +0 -0
- package/templates/child-app/src/assets/404_images/404_cloud.png +0 -0
- package/templates/child-app/src/assets/logo.png +0 -0
- package/templates/child-app/src/corejsConfig.js +2 -0
- package/templates/child-app/src/icons/index.js +2 -0
- package/templates/child-app/src/icons/svg/child-demo.svg +1 -0
- package/templates/child-app/src/layout/index.vue +4 -0
- package/templates/child-app/src/main.js +5 -0
- package/templates/child-app/src/prefixConfig.js +13 -0
- package/templates/child-app/src/resources/css/login.scss +29 -0
- package/templates/child-app/src/resources/images/bg-login5.jpg +0 -0
- package/templates/child-app/src/resources/images/home-img.png +0 -0
- package/templates/child-app/src/router/modules/customer.js +3 -0
- package/templates/child-app/src/settings.js +24 -0
- package/templates/child-app/src/styles/app.scss +2 -0
- package/templates/child-app/src/views/demo/detail.vue +19 -0
- package/templates/child-app/src/views/demo/list.vue +38 -0
- package/templates/child-app/src/views/user/login/index.vue +18 -0
- package/templates/child-app/vue.config.js +107 -0
- package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +0 -285
- package/src/components/xform/form-render/formDynamicFieldMixin.js +0 -131
- package/src/views/demo/bizTab/bill/billConfig.js +0 -41
- package/src/views/demo/bizTab/bill/detail.vue +0 -436
- package/src/views/demo/bizTab/bill/list.vue +0 -288
- package/src/views/demo/bizTab/bill/productDialog.vue +0 -176
- package/src/views/demo/bizTab/simple/billApi.js +0 -123
- package/src/views/demo/bizTab/simple/detail.vue +0 -407
- package/src/views/demo/bizTab/simple/list.vue +0 -217
- package/src/views/demo/bizTab/standalone/index.vue +0 -121
- package/src/views/demo/bizTab/wf/billConfig.js +0 -44
- package/src/views/demo/bizTab/wf/detail.vue +0 -661
- package/src/views/demo/bizTab/wf/list.vue +0 -242
- package/src/views/user/outLink/cc_form_view.vue +0 -188
- /package/src/{resources → core-resources}/js/base/common.js +0 -0
|
@@ -1,850 +1,904 @@
|
|
|
1
1
|
/**version-1.0*/
|
|
2
|
-
import {
|
|
2
|
+
import { loadXlsx } from "@base/utils/xlsxLoader";
|
|
3
3
|
|
|
4
4
|
let tmixins = {};
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
5
|
+
import { getToken } from "../../utils/auth";
|
|
6
|
+
import XEUtils from "xe-utils";
|
|
7
|
+
import { getErrorMsg } from "@base/utils/index.js";
|
|
8
|
+
import {
|
|
9
|
+
getImportCellText,
|
|
10
|
+
getImportFileSizeLimit,
|
|
11
|
+
getImportRowLimit,
|
|
12
|
+
isImportFileOversize,
|
|
13
|
+
isImportRowsOverLimit,
|
|
14
|
+
toFileSizeMb,
|
|
15
|
+
} from "../../utils/importLimit";
|
|
16
|
+
|
|
10
17
|
let configUtil = {
|
|
11
18
|
baseUrl: process.env.VUE_APP_BASE_API,
|
|
12
|
-
XLSX,
|
|
13
19
|
getToken,
|
|
14
20
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
tmixins = {
|
|
18
|
-
name: "excelImport",
|
|
19
|
-
props: ["param"],
|
|
20
|
-
data() {
|
|
21
|
-
return {
|
|
22
|
-
excTime: 0,
|
|
23
|
-
showImportDialog: false,
|
|
24
|
-
showImportDialog2: false,
|
|
25
|
-
falseValue: false,
|
|
26
|
-
fileRaw: false,
|
|
27
|
-
isEnd: false,
|
|
28
|
-
currentIndex: 0,
|
|
29
|
-
excelTemplate: "",
|
|
30
|
-
prefix: "/user",
|
|
31
|
-
dataSize: 0,
|
|
32
|
-
totalSuccessNum: 0,
|
|
33
|
-
totalErrorNum: 0,
|
|
34
|
-
percentageNum: 0,
|
|
35
|
-
successRows: [],
|
|
36
|
-
failRows: [],
|
|
37
|
-
oriCols: [],
|
|
38
|
-
showImportResult: false,
|
|
39
|
-
resultType: "",
|
|
40
|
-
option: {},
|
|
41
|
-
showContent: false,
|
|
42
|
-
resOption: {},
|
|
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
|
-
this.
|
|
113
|
-
this.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
this.fileRaw =
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
21
|
+
// 计时器与遮罩句柄必须挂实例:模块级单例在 tagsView 同时开两个导入页时会被后开的
|
|
22
|
+
// 那个覆盖,先开的 100ms interval 永远停不掉,还会把整个组件钉住不被回收。
|
|
23
|
+
tmixins = {
|
|
24
|
+
name: "excelImport",
|
|
25
|
+
props: ["param"],
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
excTime: 0,
|
|
29
|
+
showImportDialog: false,
|
|
30
|
+
showImportDialog2: false,
|
|
31
|
+
falseValue: false,
|
|
32
|
+
fileRaw: false,
|
|
33
|
+
isEnd: false,
|
|
34
|
+
currentIndex: 0,
|
|
35
|
+
excelTemplate: "",
|
|
36
|
+
prefix: "/user",
|
|
37
|
+
dataSize: 0,
|
|
38
|
+
totalSuccessNum: 0,
|
|
39
|
+
totalErrorNum: 0,
|
|
40
|
+
percentageNum: 0,
|
|
41
|
+
successRows: [],
|
|
42
|
+
failRows: [],
|
|
43
|
+
oriCols: [],
|
|
44
|
+
showImportResult: false,
|
|
45
|
+
resultType: "",
|
|
46
|
+
option: {},
|
|
47
|
+
showContent: false,
|
|
48
|
+
resOption: {},
|
|
49
|
+
importTimer: null,
|
|
50
|
+
loadingObj: null,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
created() {},
|
|
54
|
+
beforeDestroy() {
|
|
55
|
+
this.clearImportTimer();
|
|
56
|
+
},
|
|
57
|
+
methods: {
|
|
58
|
+
initResGird() {
|
|
59
|
+
var that = this;
|
|
60
|
+
let tableRef = "resGrid";
|
|
61
|
+
let columns = [
|
|
62
|
+
{
|
|
63
|
+
type: "checkbox",
|
|
64
|
+
fixed: "left",
|
|
65
|
+
width: 48,
|
|
66
|
+
resizable: false,
|
|
67
|
+
headerClassName: "vxe-hcs",
|
|
68
|
+
className: "vxe-hcs",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
field: "impNumber",
|
|
72
|
+
title: this.$t2("行号", "components.excelImport.impNumber"),
|
|
73
|
+
width: 100,
|
|
74
|
+
fixed: "left",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
field: "_resultContent",
|
|
78
|
+
title: this.$t2("结果", "components.excelImport.resultContent"),
|
|
79
|
+
width: 250,
|
|
80
|
+
fixed: "left",
|
|
81
|
+
slots: {
|
|
82
|
+
default: ({ row, $rowIndex, $table }) => {
|
|
83
|
+
return that.handleRes(row._resultContent);
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
let cCols = this.oriCols.map((oriCol, index) => {
|
|
89
|
+
let col = {
|
|
90
|
+
field: oriCol.field,
|
|
91
|
+
title: oriCol.title,
|
|
92
|
+
width: 150,
|
|
93
|
+
};
|
|
94
|
+
if (index === 0) {
|
|
95
|
+
col.fixed = "left";
|
|
96
|
+
}
|
|
97
|
+
return col;
|
|
98
|
+
});
|
|
99
|
+
columns = columns.concat(cCols);
|
|
100
|
+
|
|
101
|
+
let tableOption = {
|
|
102
|
+
vue: this,
|
|
103
|
+
tableRef: tableRef,
|
|
104
|
+
tableNameRequired: false,
|
|
105
|
+
columns: columns,
|
|
106
|
+
config: {
|
|
107
|
+
toolbarConfig: {
|
|
108
|
+
custom: false,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
114
|
+
this.resOption = opts;
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
exc() {
|
|
118
|
+
this.option = this.param;
|
|
119
|
+
this.showContent = true;
|
|
120
|
+
this.showImportDialog = true;
|
|
121
|
+
this.showImportDialog2 = false;
|
|
122
|
+
},
|
|
123
|
+
showSuccessResult() {
|
|
124
|
+
this.showImportResult = true;
|
|
125
|
+
this.resultType = 1;
|
|
126
|
+
this.$nextTick(() => {
|
|
127
|
+
this.initResGird();
|
|
128
|
+
this.$nextTick(() => {
|
|
129
|
+
let tDatas = this.successRows.map((item, index) => {
|
|
130
|
+
item.id = index;
|
|
131
|
+
return item;
|
|
132
|
+
});
|
|
133
|
+
this.$refs.resGrid.loadData(tDatas);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
showErrorResult() {
|
|
138
|
+
this.showImportResult = true;
|
|
139
|
+
this.resultType = 0;
|
|
140
|
+
this.$nextTick(() => {
|
|
141
|
+
this.initResGird();
|
|
142
|
+
this.$nextTick(() => {
|
|
143
|
+
let tDatas = this.failRows.map((item, index) => {
|
|
144
|
+
item.id = index;
|
|
145
|
+
return item;
|
|
146
|
+
});
|
|
147
|
+
this.$refs.resGrid.loadData(tDatas);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
fileChange(file) {
|
|
152
|
+
if (file) {
|
|
153
|
+
this.fileRaw = file.raw;
|
|
154
|
+
} else {
|
|
155
|
+
this.fileRaw = false;
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
dialogClose1() {
|
|
159
|
+
this.$emit("update:visiable", false);
|
|
160
|
+
this.showContent = false;
|
|
161
|
+
},
|
|
162
|
+
async dialogPrimary1() {
|
|
163
|
+
let that = this;
|
|
164
|
+
let option = this.option;
|
|
165
|
+
let saveUrl = option.saveUrl;
|
|
166
|
+
if (!saveUrl) {
|
|
167
|
+
this.dialogPrimary3();
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (!this.fileRaw) {
|
|
172
|
+
this.$baseAlert(
|
|
173
|
+
this.$t2("请上传附件", "components.excelImport.warmMsg1")
|
|
174
|
+
);
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
this.createImportTimer();
|
|
178
|
+
this.showImportDialog = false;
|
|
179
|
+
if (!option.onConfirm) {
|
|
180
|
+
this.showImportDialog2 = true;
|
|
181
|
+
}
|
|
182
|
+
this.$nextTick(() => {
|
|
183
|
+
try {
|
|
184
|
+
this.readExcel(this.fileRaw, function (resultData) {
|
|
185
|
+
if (option.onConfirm) {
|
|
186
|
+
option.onConfirm(resultData.data, that.fileRaw);
|
|
187
|
+
} else {
|
|
188
|
+
that.syncDataForImport({
|
|
189
|
+
multi: false,
|
|
190
|
+
data: resultData,
|
|
191
|
+
saveUrl: saveUrl,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
} catch (et) {
|
|
196
|
+
that.clearImportTimer();
|
|
197
|
+
console.error(et);
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
handleBeforeClose(hide) {
|
|
202
|
+
this.option.onCancel
|
|
203
|
+
&& this.option.onCancel(this.getCallbackData(), this.fileRaw);
|
|
204
|
+
hide();
|
|
205
|
+
},
|
|
206
|
+
dialogClose2() {
|
|
207
|
+
this.showImportDialog2 = false;
|
|
208
|
+
this.option.onBeforeCancel
|
|
209
|
+
&& this.option.onBeforeCancel(this.getCallbackData(), this.fileRaw);
|
|
210
|
+
},
|
|
211
|
+
handleClose2() {
|
|
212
|
+
this.clearImportTimer();
|
|
213
|
+
this.showImportDialog2 = false;
|
|
214
|
+
this.showContent = false;
|
|
215
|
+
this.option.onClose
|
|
216
|
+
&& this.option.onClose(this.getCallbackData(), this.fileRaw);
|
|
217
|
+
this.option.callback
|
|
218
|
+
&& this.option.callback(this.getCallbackData(), this.fileRaw);
|
|
219
|
+
},
|
|
220
|
+
dialogPrimary2() {
|
|
221
|
+
this.showImportDialog2 = false;
|
|
222
|
+
this.option.onBeforeConfirm
|
|
223
|
+
&& this.option.onBeforeConfirm(this.getCallbackData(), this.fileRaw);
|
|
224
|
+
},
|
|
225
|
+
getCallbackData() {
|
|
226
|
+
return {
|
|
227
|
+
...this.resultData,
|
|
228
|
+
successRows: this.successRows,
|
|
229
|
+
failRows: this.failRows,
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
async readExcel(file, callback) {
|
|
155
233
|
let that = this;
|
|
156
234
|
let option = this.option;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
235
|
+
|
|
236
|
+
// 整文件读进内存前先卡一刀:下面的 readAsBinaryString + XLSX.read 是同步的,
|
|
237
|
+
// 占用约为文件体积的 5~20 倍,超限时崩在库内部,连提示都给不出来。
|
|
238
|
+
if (isImportFileOversize(file, option)) {
|
|
239
|
+
this.showImportDialog2 = false;
|
|
240
|
+
this.showContent = false;
|
|
241
|
+
this.clearImportTimer();
|
|
242
|
+
this.$baseAlert(
|
|
243
|
+
this.$t1(
|
|
244
|
+
"导入文件过大({size}MB),当前最多支持 {limit}MB,请拆分后分批导入",
|
|
245
|
+
{
|
|
246
|
+
size: toFileSizeMb(file.size),
|
|
247
|
+
limit: toFileSizeMb(getImportFileSizeLimit(option)),
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
);
|
|
160
251
|
return false;
|
|
161
252
|
}
|
|
162
253
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
254
|
+
let XLSX;
|
|
255
|
+
try {
|
|
256
|
+
XLSX = await loadXlsx();
|
|
257
|
+
} catch (error) {
|
|
258
|
+
this.$baseAlert(this.$t1("Excel解析组件加载失败,请刷新页面后重试"));
|
|
167
259
|
return false;
|
|
168
260
|
}
|
|
169
|
-
this.createImportTimer();
|
|
170
|
-
this.showImportDialog = false;
|
|
171
|
-
if (!option.onConfirm) {
|
|
172
|
-
this.showImportDialog2 = true;
|
|
173
|
-
}
|
|
174
|
-
this.$nextTick(() => {
|
|
175
|
-
try {
|
|
176
|
-
this.readExcel(this.fileRaw, function (resultData) {
|
|
177
|
-
if (option.onConfirm) {
|
|
178
|
-
option.onConfirm(resultData.data, that.fileRaw);
|
|
179
|
-
} else {
|
|
180
|
-
that.syncDataForImport({
|
|
181
|
-
multi: false,
|
|
182
|
-
data: resultData,
|
|
183
|
-
saveUrl: saveUrl,
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
} catch (et) {
|
|
188
|
-
that.clearImportTimer();
|
|
189
|
-
console.error(et);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
},
|
|
193
|
-
handleBeforeClose(hide) {
|
|
194
|
-
this.option.onCancel
|
|
195
|
-
&& this.option.onCancel(this.getCallbackData(), this.fileRaw);
|
|
196
|
-
hide();
|
|
197
|
-
},
|
|
198
|
-
dialogClose2() {
|
|
199
|
-
this.showImportDialog2 = false;
|
|
200
|
-
this.option.onBeforeCancel
|
|
201
|
-
&& this.option.onBeforeCancel(this.getCallbackData(), this.fileRaw);
|
|
202
|
-
},
|
|
203
|
-
handleClose2() {
|
|
204
|
-
this.clearImportTimer();
|
|
205
|
-
this.showImportDialog2 = false;
|
|
206
|
-
this.showContent = false;
|
|
207
|
-
this.option.onClose
|
|
208
|
-
&& this.option.onClose(this.getCallbackData(), this.fileRaw);
|
|
209
|
-
this.option.callback
|
|
210
|
-
&& this.option.callback(this.getCallbackData(), this.fileRaw);
|
|
211
|
-
},
|
|
212
|
-
dialogPrimary2() {
|
|
213
|
-
this.showImportDialog2 = false;
|
|
214
|
-
this.option.onBeforeConfirm
|
|
215
|
-
&& this.option.onBeforeConfirm(this.getCallbackData(), this.fileRaw);
|
|
216
|
-
},
|
|
217
|
-
getCallbackData() {
|
|
218
|
-
return {
|
|
219
|
-
...this.resultData,
|
|
220
|
-
successRows: this.successRows,
|
|
221
|
-
failRows: this.failRows,
|
|
222
|
-
};
|
|
223
|
-
},
|
|
224
|
-
async readExcel(file, callback) {
|
|
225
|
-
let that = this;
|
|
226
|
-
let option = this.option;
|
|
227
261
|
|
|
228
262
|
const fileReader = new FileReader();
|
|
229
|
-
fileReader.onload = async (ev) => {
|
|
230
|
-
var resultData;
|
|
231
|
-
try {
|
|
232
|
-
const data = ev.target.result;
|
|
233
|
-
const workbook =
|
|
234
|
-
type: "binary",
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
var sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
238
|
-
if (sheet["!ref"] === undefined) {
|
|
239
|
-
that.showImportDialog2 = false;
|
|
240
|
-
that.showContent = false;
|
|
241
|
-
that.clearImportTimer();
|
|
242
|
-
that.$baseAlert(
|
|
243
|
-
this.$t2(
|
|
244
|
-
"请使用正确的导入模版!",
|
|
245
|
-
"components.excelImport.warmMsg2"
|
|
246
|
-
)
|
|
247
|
-
);
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
var range =
|
|
251
|
-
var dataSize = range.e.r + 1; //行数
|
|
252
|
-
that.dataSize = dataSize - 3 >= 0 ? dataSize - 3 : 0;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
-
let
|
|
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
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
var
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
var
|
|
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
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
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
|
-
} else {
|
|
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
|
-
that.
|
|
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
|
-
|
|
263
|
+
fileReader.onload = async (ev) => {
|
|
264
|
+
var resultData;
|
|
265
|
+
try {
|
|
266
|
+
const data = ev.target.result;
|
|
267
|
+
const workbook = XLSX.read(data, {
|
|
268
|
+
type: "binary",
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
var sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
272
|
+
if (sheet["!ref"] === undefined) {
|
|
273
|
+
that.showImportDialog2 = false;
|
|
274
|
+
that.showContent = false;
|
|
275
|
+
that.clearImportTimer();
|
|
276
|
+
that.$baseAlert(
|
|
277
|
+
this.$t2(
|
|
278
|
+
"请使用正确的导入模版!",
|
|
279
|
+
"components.excelImport.warmMsg2"
|
|
280
|
+
)
|
|
281
|
+
);
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
var range = XLSX.utils.decode_range(sheet["!ref"]);
|
|
285
|
+
var dataSize = range.e.r + 1; //行数
|
|
286
|
+
that.dataSize = dataSize - 3 >= 0 ? dataSize - 3 : 0;
|
|
287
|
+
// 行数闸门:下面逐格取值、建行对象、再整批发包全是同步的,行数失控时
|
|
288
|
+
// 主线程会被占死甚至 OOM。文件本身不大但行极多(窄表)时只有这一道能拦。
|
|
289
|
+
if (isImportRowsOverLimit(that.dataSize, option)) {
|
|
290
|
+
that.showImportDialog2 = false;
|
|
291
|
+
that.showContent = false;
|
|
292
|
+
that.clearImportTimer();
|
|
293
|
+
that.$baseAlert(
|
|
294
|
+
that.$t1(
|
|
295
|
+
"导入数据 {size} 行,超过单次上限 {limit} 行,请拆分后分批导入",
|
|
296
|
+
{
|
|
297
|
+
size: that.dataSize,
|
|
298
|
+
limit: getImportRowLimit(option),
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
);
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
var titles = [];
|
|
305
|
+
var fields = [];
|
|
306
|
+
|
|
307
|
+
const ws = workbook.Sheets[sheet];
|
|
308
|
+
|
|
309
|
+
let prefix = option.prefix;
|
|
310
|
+
let excelUrl = option.excel;
|
|
311
|
+
|
|
312
|
+
var excelRows = [];
|
|
313
|
+
var row;
|
|
314
|
+
var rowNum;
|
|
315
|
+
var colNum;
|
|
316
|
+
for (rowNum = range.s.r; rowNum <= range.e.r; rowNum++) {
|
|
317
|
+
row = [];
|
|
318
|
+
for (colNum = range.s.c; colNum <= range.e.c; colNum++) {
|
|
319
|
+
var nextCell
|
|
320
|
+
= sheet[
|
|
321
|
+
XLSX.utils.encode_cell({
|
|
322
|
+
r: rowNum,
|
|
323
|
+
c: colNum,
|
|
324
|
+
})
|
|
325
|
+
];
|
|
326
|
+
if (typeof nextCell === "undefined") {
|
|
327
|
+
row.push(void 0);
|
|
328
|
+
} else {
|
|
329
|
+
row.push(getImportCellText(nextCell));
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (rowNum === 1) {
|
|
333
|
+
titles = row;
|
|
334
|
+
}
|
|
335
|
+
if (rowNum === 2) {
|
|
336
|
+
fields = row;
|
|
337
|
+
let checkResult = true;
|
|
338
|
+
if (!option.importAttachCode) {
|
|
339
|
+
await that
|
|
340
|
+
.checkExcelForImport(titles, fields, excelUrl, prefix)
|
|
341
|
+
.then((res) => {
|
|
342
|
+
if (res.type != "success") {
|
|
343
|
+
checkResult = false;
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
if (!checkResult) {
|
|
347
|
+
that.showContent = false;
|
|
348
|
+
that.clearImportTimer();
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (rowNum > 2) {
|
|
354
|
+
let item = {};
|
|
355
|
+
for (let i = 0; i < fields.length; i++) {
|
|
356
|
+
let field = fields[i];
|
|
357
|
+
item[field] = row[i];
|
|
358
|
+
}
|
|
359
|
+
excelRows.push(item);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (
|
|
363
|
+
!titles.length
|
|
364
|
+
|| !fields.length
|
|
365
|
+
|| titles.length != fields.length
|
|
366
|
+
) {
|
|
367
|
+
that.showContent = false;
|
|
368
|
+
that.clearImportTimer();
|
|
369
|
+
that.$baseAlert(
|
|
370
|
+
this.$t2(
|
|
371
|
+
"请使用正确的导入模版!",
|
|
372
|
+
"components.excelImport.warmMsg2"
|
|
373
|
+
)
|
|
374
|
+
);
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
var columns = [];
|
|
379
|
+
var cols = [];
|
|
380
|
+
let uniqueFields = [];
|
|
381
|
+
for (let i = 0; i < titles.length; i++) {
|
|
382
|
+
let title = titles[i];
|
|
383
|
+
if (title) {
|
|
384
|
+
let field = fields[i];
|
|
385
|
+
if (field === null) {
|
|
386
|
+
that.showContent = false;
|
|
387
|
+
that.clearImportTimer();
|
|
388
|
+
that.$baseAlert(
|
|
389
|
+
this.$t2(
|
|
390
|
+
"请使用正确的导入模版!",
|
|
391
|
+
"components.excelImport.warmMsg2"
|
|
392
|
+
)
|
|
393
|
+
);
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
let t = title.substr(-1);
|
|
397
|
+
let u = title.length >= 2 ? title.substr(-2) : title;
|
|
398
|
+
let isNeed = false;
|
|
399
|
+
if (t === "*") {
|
|
400
|
+
isNeed = true;
|
|
401
|
+
}
|
|
402
|
+
let isUnique = false;
|
|
403
|
+
if (u === "**") {
|
|
404
|
+
uniqueFields.push(field);
|
|
405
|
+
isUnique = true;
|
|
406
|
+
}
|
|
407
|
+
let col = {
|
|
408
|
+
field: field,
|
|
409
|
+
title: title,
|
|
410
|
+
width: 100,
|
|
411
|
+
isNeed: isNeed,
|
|
412
|
+
isUnique: isUnique,
|
|
413
|
+
};
|
|
414
|
+
cols.push(col);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
var oriCols = JSON.parse(JSON.stringify(cols)); //列信息
|
|
419
|
+
if (uniqueFields.length) {
|
|
420
|
+
//分组唯一字段为空时,全部不发包。
|
|
421
|
+
for (let i = 0; i < oriCols.length; i++) {
|
|
422
|
+
let oriCol = oriCols[i];
|
|
423
|
+
if (oriCol.isNeed) {
|
|
424
|
+
for (let j = 0; j < excelRows.length; j++) {
|
|
425
|
+
let data = excelRows[j];
|
|
426
|
+
let value = data[oriCol.field];
|
|
427
|
+
if (value === null || value === "") {
|
|
428
|
+
that.clearImportTimer();
|
|
429
|
+
that.$baseAlert(
|
|
430
|
+
this.$t2(
|
|
431
|
+
"第" + (j + 4) + "行[" + oriCol.title + "]不能为空;",
|
|
432
|
+
"components.excelImport.warmMsg3",
|
|
433
|
+
{
|
|
434
|
+
lineNo: j + 4,
|
|
435
|
+
title: oriCol.title,
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
);
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
this.oriCols = oriCols;
|
|
447
|
+
|
|
448
|
+
resultData = {
|
|
449
|
+
data: excelRows,
|
|
450
|
+
titles: titles,
|
|
451
|
+
fields: fields,
|
|
452
|
+
uniqueFields: uniqueFields,
|
|
453
|
+
oriCols: oriCols,
|
|
454
|
+
};
|
|
455
|
+
this.resultData = resultData;
|
|
456
|
+
callback(resultData);
|
|
457
|
+
} catch (et) {
|
|
458
|
+
that.showContent = false;
|
|
459
|
+
that.clearImportTimer();
|
|
460
|
+
console.error(et);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
fileReader.readAsBinaryString(file);
|
|
464
|
+
},
|
|
465
|
+
async checkExcelForImport(titles, fields, turl, prefix) {
|
|
466
|
+
let that = this;
|
|
467
|
+
var data = {
|
|
468
|
+
filed_name: fields,
|
|
469
|
+
field_note: titles,
|
|
470
|
+
url: turl,
|
|
471
|
+
};
|
|
472
|
+
var param = JSON.stringify(data);
|
|
473
|
+
return this.$http({
|
|
474
|
+
url: prefix + "/sf_common/compareExcelFields",
|
|
475
|
+
method: "post",
|
|
476
|
+
headers: {
|
|
477
|
+
"Content-Type": "application/json;charset=utf-8",
|
|
478
|
+
},
|
|
479
|
+
// data: param,
|
|
480
|
+
data: data,
|
|
481
|
+
});
|
|
482
|
+
},
|
|
483
|
+
syncDataForImport(opts) {
|
|
484
|
+
let that = this;
|
|
485
|
+
var multi = this.option.multi;
|
|
486
|
+
var resultData = opts.data;
|
|
487
|
+
var datas = resultData.data;
|
|
488
|
+
var titles = resultData.titles;
|
|
489
|
+
var fields = resultData.fields;
|
|
490
|
+
let uniqueFields = resultData.uniqueFields;
|
|
491
|
+
var saveUrl = opts.saveUrl;
|
|
492
|
+
var size = datas.length;
|
|
493
|
+
var index = 0;
|
|
494
|
+
var successNum = 0;
|
|
495
|
+
var failNum = 0;
|
|
496
|
+
var dialogObj = this.$refs.importDialog.$el;
|
|
497
|
+
var successNumObj = dialogObj.querySelector(".successNum");
|
|
498
|
+
var failNumObj = dialogObj.querySelector(".failNum");
|
|
499
|
+
var percentageObj = dialogObj.querySelector(".percentage");
|
|
500
|
+
var doneNumObj = dialogObj.querySelector(".doneNum");
|
|
501
|
+
dialogObj.querySelector(".dataSize").innerText = size;
|
|
502
|
+
|
|
503
|
+
that.successRows = [];
|
|
504
|
+
that.failRows = [];
|
|
505
|
+
|
|
506
|
+
var multiSize = opts.multiSize || 2;
|
|
507
|
+
|
|
508
|
+
let groupIndex = 0;
|
|
509
|
+
let groupDatas = [];
|
|
510
|
+
if (uniqueFields.length) {
|
|
511
|
+
let d = XEUtils.groupBy(datas, function (item, itemIndex, items) {
|
|
512
|
+
let keyArr = [];
|
|
513
|
+
uniqueFields.forEach((field) => {
|
|
514
|
+
keyArr.push(item[field]);
|
|
515
|
+
});
|
|
516
|
+
return keyArr.join("&_&");
|
|
517
|
+
});
|
|
518
|
+
for (let key in d) {
|
|
519
|
+
groupDatas.push(d[key]);
|
|
520
|
+
}
|
|
521
|
+
datas.forEach((item, itemIndex) => {
|
|
522
|
+
item.impSeq = itemIndex;
|
|
523
|
+
item.impNumber = itemIndex + 4;
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
var compareV = function (property) {
|
|
528
|
+
return function (a, b) {
|
|
529
|
+
var value1 = a[property];
|
|
530
|
+
var value2 = b[property];
|
|
531
|
+
return value1 - value2;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
var prevHandleData = function (percentageStr, excNum) {
|
|
536
|
+
successNumObj.innerText = successNum;
|
|
537
|
+
failNumObj.innerText = failNum;
|
|
538
|
+
doneNumObj.innerText = successNum + failNum;
|
|
539
|
+
that.percentageNum = percentageStr;
|
|
540
|
+
let isEnd = false;
|
|
541
|
+
if (uniqueFields.length) {
|
|
542
|
+
isEnd = groupIndex + 1 >= groupDatas.length;
|
|
543
|
+
} else {
|
|
544
|
+
isEnd = index + excNum >= size;
|
|
545
|
+
}
|
|
546
|
+
if (!isEnd) {
|
|
547
|
+
index = index + excNum;
|
|
548
|
+
groupIndex = groupIndex + 1;
|
|
549
|
+
setTimeout(function () {
|
|
550
|
+
handleData();
|
|
551
|
+
}, 1);
|
|
552
|
+
} else {
|
|
553
|
+
setTimeout(function () {
|
|
554
|
+
that.clearImportTimer();
|
|
555
|
+
}, 300);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
let getDefaultValue = (row) => {
|
|
560
|
+
let value = null;
|
|
561
|
+
let defaultValue = this.option.defaultValue;
|
|
562
|
+
if (defaultValue) {
|
|
563
|
+
if (typeof defaultValue === "function") {
|
|
564
|
+
value = defaultValue(row) || {};
|
|
565
|
+
} else {
|
|
566
|
+
value = defaultValue || {};
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
return value;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
let handleData = () => {
|
|
573
|
+
if (!that.isEnd && index < size) {
|
|
574
|
+
var param;
|
|
575
|
+
var excNum;
|
|
576
|
+
if (multi) {
|
|
577
|
+
if (!uniqueFields.length) {
|
|
578
|
+
if (index + multiSize < size) {
|
|
579
|
+
excNum = multiSize;
|
|
580
|
+
} else {
|
|
581
|
+
excNum = size - index;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
let dataList = [];
|
|
585
|
+
for (let i = 0; i < excNum; i++) {
|
|
586
|
+
var mIndex = index + i;
|
|
587
|
+
let mData = datas[mIndex];
|
|
588
|
+
mData.impSeq = mIndex;
|
|
589
|
+
mData.impNumber = mIndex + 4;
|
|
590
|
+
|
|
591
|
+
let errorInfo = that.vailData(mData, opts);
|
|
592
|
+
if (errorInfo.length > 0) {
|
|
593
|
+
mData._resultType = "error";
|
|
594
|
+
mData._resultContent = errorInfo;
|
|
595
|
+
failNum++;
|
|
596
|
+
that.failRows.push(mData);
|
|
597
|
+
} else {
|
|
598
|
+
let defaultValue = getDefaultValue(mData);
|
|
599
|
+
if (defaultValue) {
|
|
600
|
+
Object.assign(mData, defaultValue);
|
|
601
|
+
}
|
|
602
|
+
dataList.push(mData);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
datas[mIndex] = mData;
|
|
606
|
+
}
|
|
607
|
+
if (dataList.length > 0) {
|
|
608
|
+
param = dataList;
|
|
609
|
+
}
|
|
610
|
+
} else {
|
|
611
|
+
excNum = groupDatas[groupIndex].length;
|
|
612
|
+
param = groupDatas[groupIndex];
|
|
613
|
+
}
|
|
614
|
+
} else {
|
|
615
|
+
var data = datas[index];
|
|
616
|
+
data.impSeq = index;
|
|
617
|
+
data.impNumber = index + 4;
|
|
618
|
+
excNum = 1;
|
|
619
|
+
datas[index] = data;
|
|
620
|
+
|
|
621
|
+
let errorInfo = that.vailData(data, opts);
|
|
622
|
+
if (errorInfo.length > 0) {
|
|
623
|
+
data._resultType = "error";
|
|
624
|
+
data._resultContent = errorInfo;
|
|
625
|
+
failNum++;
|
|
626
|
+
that.failRows.push(data);
|
|
627
|
+
} else {
|
|
628
|
+
param = data;
|
|
629
|
+
let defaultValue = getDefaultValue(data);
|
|
630
|
+
if (defaultValue) {
|
|
631
|
+
Object.assign(param, defaultValue);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
var percentageStr = parseInt(((index + excNum) * 100) / size);
|
|
637
|
+
if (param === null || param.length === 0) {
|
|
638
|
+
if (that.showContent) {
|
|
639
|
+
prevHandleData(percentageStr, excNum);
|
|
640
|
+
}
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
that
|
|
645
|
+
.$http({
|
|
646
|
+
url: saveUrl,
|
|
647
|
+
method: "post",
|
|
648
|
+
data: param,
|
|
649
|
+
resultType: "special",
|
|
650
|
+
modal: false,
|
|
651
|
+
callback: (resultMsg) => {
|
|
652
|
+
if (multi) {
|
|
653
|
+
if (resultMsg.type === "success") {
|
|
654
|
+
var multiRows = resultMsg.objx;
|
|
655
|
+
for (let i = 0; i < multiRows.length; i++) {
|
|
656
|
+
var multiRow = multiRows[i];
|
|
657
|
+
var data = { ...datas[multiRow.impSeq] };
|
|
658
|
+
data._rqeData = { ...datas[multiRow.impSeq] };
|
|
659
|
+
data._resultData = multiRow;
|
|
660
|
+
data._resultType = multiRow.impReturnType;
|
|
661
|
+
data._resultContent
|
|
662
|
+
= multiRow.impReturnType === "success"
|
|
663
|
+
? this.$t2(
|
|
664
|
+
"导入成功",
|
|
665
|
+
"components.excelImport.importSucess"
|
|
666
|
+
)
|
|
667
|
+
: multiRow.impReturnMsg;
|
|
668
|
+
if (multiRow.impReturnType === "success") {
|
|
669
|
+
successNum++;
|
|
670
|
+
that.successRows.push(data);
|
|
671
|
+
} else {
|
|
672
|
+
failNum++;
|
|
673
|
+
that.failRows.push(data);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
that.failRows = that.failRows.sort(compareV("impSeq"));
|
|
678
|
+
} else {
|
|
679
|
+
// error_win(resultMsg);
|
|
680
|
+
// layer.close(opts.dialogObjIndex);
|
|
681
|
+
that.$errorMsg(resultMsg);
|
|
682
|
+
that.showContent = false;
|
|
683
|
+
that.clearImportTimer();
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
} else {
|
|
687
|
+
var data = { ...datas[index] };
|
|
688
|
+
data._resultType = resultMsg.type;
|
|
689
|
+
data._resultContent
|
|
690
|
+
= resultMsg.type === "success"
|
|
691
|
+
? this.$t2(
|
|
692
|
+
"导入成功",
|
|
693
|
+
"components.excelImport.importSucess"
|
|
694
|
+
)
|
|
695
|
+
: this.handleRes(resultMsg.content);
|
|
696
|
+
data._rqeData = { ...datas[index] };
|
|
697
|
+
data._resultData = resultMsg.objx;
|
|
698
|
+
if (resultMsg.type === "success") {
|
|
699
|
+
successNum++;
|
|
700
|
+
that.successRows.push(data);
|
|
701
|
+
} else {
|
|
702
|
+
failNum++;
|
|
703
|
+
that.failRows.push(data);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (that.showContent) {
|
|
707
|
+
prevHandleData(percentageStr, excNum);
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
})
|
|
711
|
+
.catch(function (et) {
|
|
712
|
+
that.isEnd = true;
|
|
713
|
+
that.clearImportTimer();
|
|
714
|
+
console.error(et);
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
handleData();
|
|
719
|
+
},
|
|
720
|
+
commonLocalDownload() {
|
|
721
|
+
if (this.option.importAttachCode) {
|
|
722
|
+
this.commonLocalDownload2();
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
let path = this.option.excel;
|
|
726
|
+
let prefix = this.option.prefix;
|
|
727
|
+
prefix = prefix || "";
|
|
728
|
+
var url = configUtil.baseUrl + prefix + "/sf_common/download";
|
|
729
|
+
if (path) {
|
|
730
|
+
var params = {
|
|
731
|
+
url: path,
|
|
732
|
+
};
|
|
733
|
+
params["access_token"] = configUtil.getToken();
|
|
734
|
+
|
|
735
|
+
var form = document.createElement("form");
|
|
736
|
+
|
|
737
|
+
let randomNum
|
|
738
|
+
= new Date().valueOf() + Math.floor(Math.random() * 1000000);
|
|
739
|
+
let formId = "formId-" + randomNum;
|
|
740
|
+
let formName = "formName-" + randomNum;
|
|
741
|
+
|
|
742
|
+
form.id = formId;
|
|
743
|
+
form.name = formName;
|
|
744
|
+
form.target = "_blank";
|
|
745
|
+
document.body.appendChild(form);
|
|
746
|
+
for (let obj in params) {
|
|
747
|
+
if (params.hasOwnProperty(obj)) {
|
|
748
|
+
let input = document.createElement("input");
|
|
749
|
+
input.tpye = "hidden";
|
|
750
|
+
input.name = obj;
|
|
751
|
+
input.value = params[obj];
|
|
752
|
+
form.appendChild(input);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
form.method = "post"; //请求方式
|
|
756
|
+
form.action = url;
|
|
757
|
+
form.submit();
|
|
758
|
+
document.body.removeChild(form);
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
commonLocalDownload2() {
|
|
762
|
+
let importAttachCode = this.option.importAttachCode;
|
|
763
|
+
if (!importAttachCode) return;
|
|
764
|
+
this.$http({
|
|
765
|
+
url: USER_PREFIX + "/bd_attach_setting/getByCode",
|
|
766
|
+
method: "post",
|
|
767
|
+
data: {
|
|
768
|
+
stringOne: importAttachCode,
|
|
769
|
+
},
|
|
770
|
+
success: (res) => {
|
|
771
|
+
let fileObj = res.objx;
|
|
772
|
+
let url = fileObj?.url;
|
|
773
|
+
if (fileObj && url) {
|
|
774
|
+
this.$commonFileUtil.downloadFile(url, fileObj.name);
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
});
|
|
778
|
+
},
|
|
779
|
+
vailData(data, opts) {
|
|
780
|
+
var oriCols = opts.data.oriCols;
|
|
781
|
+
var errorInfo = [];
|
|
782
|
+
for (let i = 0; i < oriCols.length; i++) {
|
|
783
|
+
let oriCol = oriCols[i];
|
|
784
|
+
if (oriCol.isNeed) {
|
|
785
|
+
let value = data[oriCol.field];
|
|
786
|
+
if (value === null || value === "") {
|
|
787
|
+
errorInfo.push(
|
|
788
|
+
this.$t2(
|
|
789
|
+
"[" + oriCol.title + "]不能为空;",
|
|
790
|
+
"components.excelImport.warmMsg4",
|
|
791
|
+
{ title: oriCol.title }
|
|
792
|
+
)
|
|
793
|
+
);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
return errorInfo.join("");
|
|
798
|
+
},
|
|
799
|
+
handleRes(val) {
|
|
800
|
+
/* var content = val;
|
|
801
|
+
var text = content;
|
|
802
|
+
if (content && content.indexOf("Exception") >= 0) {
|
|
803
|
+
var index0 = content.lastIndexOf("*]");
|
|
804
|
+
if (index0 >= 0) {
|
|
805
|
+
text = content.substr(index0);
|
|
806
|
+
if (text) {
|
|
807
|
+
var index1 = text.indexOf("Exception:");
|
|
808
|
+
if (index1 >= 0) {
|
|
809
|
+
text = text.substr(index1 + 10);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
} */
|
|
814
|
+
let text = getErrorMsg(val);
|
|
815
|
+
return text;
|
|
816
|
+
},
|
|
817
|
+
exportToExcel() {
|
|
818
|
+
let str
|
|
819
|
+
= this.resultType === 1
|
|
820
|
+
? this.$t2("成功", "components.excelImport.success")
|
|
821
|
+
: this.$t2("失败", "components.excelImport.fail");
|
|
822
|
+
let fileName
|
|
823
|
+
= this.$t2("导入结果导出", "components.excelImport.exportFileName")
|
|
824
|
+
+ "("
|
|
825
|
+
+ str
|
|
826
|
+
+ ")";
|
|
827
|
+
let $grid = this.$refs.resGrid;
|
|
828
|
+
let columns = $grid.getColumns();
|
|
829
|
+
if (columns && columns.length) {
|
|
830
|
+
let fields = columns
|
|
831
|
+
.filter((item, index) => {
|
|
832
|
+
return index > 0 && item.property;
|
|
833
|
+
})
|
|
834
|
+
.map((item, index) => {
|
|
835
|
+
return item.property;
|
|
836
|
+
});
|
|
837
|
+
this.$refs.resGrid.exportData({
|
|
838
|
+
filename: fileName,
|
|
839
|
+
mode: "all",
|
|
840
|
+
type: "csv",
|
|
841
|
+
columns: fields,
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
createImportTimer() {
|
|
846
|
+
this.excTime = 0;
|
|
847
|
+
let beginTime = new Date().getTime();
|
|
848
|
+
this.importTimer = setInterval(() => {
|
|
849
|
+
let nowTime = new Date().getTime();
|
|
850
|
+
let diffTime = (nowTime - beginTime) / 1000;
|
|
851
|
+
this.$set(this, "excTime", this.$baseLodash.round(diffTime, 2));
|
|
852
|
+
}, 100);
|
|
853
|
+
},
|
|
854
|
+
clearImportTimer() {
|
|
855
|
+
if (this.importTimer) clearInterval(this.importTimer);
|
|
856
|
+
this.importTimer = null;
|
|
857
|
+
this.loadingObj && this.loadingObj.close();
|
|
858
|
+
this.loadingObj = null;
|
|
859
|
+
},
|
|
860
|
+
async dialogPrimary3() {
|
|
861
|
+
if (!this.fileRaw) {
|
|
862
|
+
this.$baseAlert(
|
|
863
|
+
this.$t2("请上传附件", "components.excelImport.warmMsg1")
|
|
864
|
+
);
|
|
865
|
+
return false;
|
|
866
|
+
}
|
|
867
|
+
let that = this;
|
|
868
|
+
let option = this.option;
|
|
869
|
+
let done = () => {
|
|
870
|
+
that.showImportDialog = false;
|
|
871
|
+
};
|
|
872
|
+
if (!option.excel) {
|
|
873
|
+
if (
|
|
874
|
+
option.callback
|
|
875
|
+
&& option.callback(null, this.fileRaw, done) !== false
|
|
876
|
+
) {
|
|
877
|
+
that.showImportDialog = false;
|
|
878
|
+
}
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
this.loadingObj = this.$baseLoading({
|
|
882
|
+
target: document.body,
|
|
883
|
+
background: "unset",
|
|
884
|
+
});
|
|
885
|
+
this.readExcel(this.fileRaw, function (resultData) {
|
|
886
|
+
try {
|
|
887
|
+
if (
|
|
888
|
+
option.callback
|
|
889
|
+
&& option.callback(resultData, that.fileRaw, done) !== false
|
|
890
|
+
) {
|
|
891
|
+
that.showImportDialog = false;
|
|
892
|
+
}
|
|
893
|
+
} catch (et) {
|
|
894
|
+
console.error(et);
|
|
895
|
+
}
|
|
896
|
+
setTimeout(function () {
|
|
897
|
+
that.loadingObj && that.loadingObj.close();
|
|
898
|
+
that.loadingObj = null;
|
|
899
|
+
}, 200);
|
|
900
|
+
});
|
|
901
|
+
},
|
|
902
|
+
},
|
|
903
|
+
};
|
|
904
|
+
export const mixins = tmixins;
|