n20-common-lib 1.3.46 → 1.3.49
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 +2 -2
- package/g6.js +2 -2
- package/nstc-g6/assets/svg/addFile.svg +31 -31
- package/nstc-g6/assets/svg/deleteFile.svg +27 -27
- package/nstc-g6/assets/svg/filter.svg +15 -15
- package/nstc-g6/assets/svg/filterActive.svg +16 -16
- package/nstc-g6/assets/svg/hourglass.svg +18 -18
- package/nstc-g6/assets/svg/newsearch.svg +18 -18
- package/nstc-g6/assets/svg/searchActive.svg +18 -18
- package/nstc-g6/components/Calendar/index.js +8 -8
- package/nstc-g6/components/Calendar/src/basic/month-table.vue +129 -129
- package/nstc-g6/components/Calendar/src/basic/year-table.vue +126 -126
- package/nstc-g6/components/Calendar/src/main.vue +442 -442
- package/nstc-g6/components/DialogForm/index.js +8 -8
- package/nstc-g6/components/DialogForm/src/demo/index.vue +56 -56
- package/nstc-g6/components/DialogForm/src/main.vue +189 -189
- package/nstc-g6/components/Form/A_DEMO/component/originalForm.vue +280 -280
- package/nstc-g6/components/Form/A_DEMO/config/config_3.js +1222 -1222
- package/nstc-g6/components/Form/A_DEMO/index.vue +803 -803
- package/nstc-g6/components/Form/AutocompleteCustom/index.vue +72 -72
- package/nstc-g6/components/Form/BusinessSpecific/InputMultiple.vue +191 -191
- package/nstc-g6/components/Form/BusinessSpecific/InputWithUnit.vue +128 -128
- package/nstc-g6/components/Form/BusinessSpecific/SelectTreeDialog.vue +233 -233
- package/nstc-g6/components/Form/BusinessSpecific/readme.md +7 -7
- package/nstc-g6/components/Form/CascaderCustom/index.vue +101 -101
- package/nstc-g6/components/Form/CheckboxCustom/index.vue +84 -84
- package/nstc-g6/components/Form/Component.vue +661 -661
- package/nstc-g6/components/Form/ComponentSecond.vue +650 -650
- package/nstc-g6/components/Form/DatepickerCustom/index.vue +130 -130
- package/nstc-g6/components/Form/InputAndDialog/index.js +15 -15
- package/nstc-g6/components/Form/InputAndDialog/src/main.vue +394 -394
- package/nstc-g6/components/Form/InputCustom/demo/index.vue +65 -65
- package/nstc-g6/components/Form/InputCustom/index.vue +307 -307
- package/nstc-g6/components/Form/IntervalinputCustom/demo/index.vue +31 -31
- package/nstc-g6/components/Form/IntervalinputCustom/index.vue +118 -118
- package/nstc-g6/components/Form/Item.vue +330 -330
- package/nstc-g6/components/Form/ItemSecond.vue +269 -269
- package/nstc-g6/components/Form/List.vue +146 -146
- package/nstc-g6/components/Form/ListSecond.vue +130 -130
- package/nstc-g6/components/Form/RadioCustom/index.vue +73 -73
- package/nstc-g6/components/Form/SelectAccount/index.js +15 -15
- package/nstc-g6/components/Form/SelectAccount/src/demo/index.vue +57 -57
- package/nstc-g6/components/Form/SelectAccount/src/main.vue +282 -282
- package/nstc-g6/components/Form/SelectAndDialog/index.js +15 -15
- package/nstc-g6/components/Form/SelectAndDialog/src/main.vue +383 -383
- package/nstc-g6/components/Form/SelectCashFlow/index.js +15 -15
- package/nstc-g6/components/Form/SelectCashFlow/src/demo/index.vue +41 -41
- package/nstc-g6/components/Form/SelectCashFlow/src/main.vue +125 -125
- package/nstc-g6/components/Form/SelectCustom/demo/index.vue +82 -82
- package/nstc-g6/components/Form/SelectCustom/index.vue +488 -488
- package/nstc-g6/components/Form/SelectSubject/index.js +15 -15
- package/nstc-g6/components/Form/SelectSubject/src/demo/index.vue +84 -84
- package/nstc-g6/components/Form/SelectSubject/src/main.vue +181 -181
- package/nstc-g6/components/Form/SelectindialogCustom/demo/index.vue +188 -188
- package/nstc-g6/components/Form/SelectindialogCustom/index.vue +650 -650
- package/nstc-g6/components/Form/SelectindialogCustom/install.js +6 -6
- package/nstc-g6/components/Form/TableRadioCustom/demo/index.vue +53 -53
- package/nstc-g6/components/Form/TableRadioCustom/index.vue +183 -183
- package/nstc-g6/components/Form/TextCustom/index.vue +38 -38
- package/nstc-g6/components/Form/UploadCustom/demo/index.vue +31 -31
- package/nstc-g6/components/Form/UploadCustom/index.vue +506 -506
- package/nstc-g6/components/Form/configs.js +191 -191
- package/nstc-g6/components/Form/configsSecond.js +161 -161
- package/nstc-g6/components/Form/index.js +8 -8
- package/nstc-g6/components/Form/index.scss +29 -29
- package/nstc-g6/components/Form/payeePersonSelect/index.js +15 -15
- package/nstc-g6/components/Form/payeePersonSelect/src/demo/index.vue +163 -163
- package/nstc-g6/components/Form/payeePersonSelect/src/main.vue +184 -184
- package/nstc-g6/components/Form/readme.txt +4 -4
- package/nstc-g6/components/FormGroup/index.js +8 -8
- package/nstc-g6/components/FormGroup/src/demo/config.js +23 -23
- package/nstc-g6/components/FormGroup/src/demo/index.vue +85 -85
- package/nstc-g6/components/FormGroup/src/main.vue +639 -639
- package/nstc-g6/components/FormGroup/src/validate.js +22 -22
- package/nstc-g6/components/InputTag/InputTag.vue +269 -269
- package/nstc-g6/components/NstcApprovel/NstcApprovel.vue +24 -24
- package/nstc-g6/components/NstcBackToTop/NstcBackToTop.vue +150 -150
- package/nstc-g6/components/NstcBranchLazyLoad/NstcBranchLazyLoad.vue +123 -123
- package/nstc-g6/components/NstcCharts/NstcCharts.vue +162 -162
- package/nstc-g6/components/NstcCharts/define.js +74 -74
- package/nstc-g6/components/NstcCharts/mixins/resize.js +56 -56
- package/nstc-g6/components/NstcConfirm/NstcConfirm.vue +152 -152
- package/nstc-g6/components/NstcConfirm/index.js +24 -24
- package/nstc-g6/components/NstcDialog/NstcDialog.vue +184 -184
- package/nstc-g6/components/NstcDialogForm/NstcDialogForm.vue +175 -175
- package/nstc-g6/components/NstcDialogTable/NstcDialogTable.vue +280 -280
- package/nstc-g6/components/NstcDropdown/NstcDropdown.vue +52 -52
- package/nstc-g6/components/NstcDropdownTree/NstcDropdownTree.vue +396 -396
- package/nstc-g6/components/NstcElectronicFile/NstcElectronicFile.vue +711 -711
- package/nstc-g6/components/NstcExcelCustomImport/NstcExcelCustomImport.vue +475 -475
- package/nstc-g6/components/NstcExcelExport/NstcExcelExport.vue +145 -145
- package/nstc-g6/components/NstcExcelImport/NstcExcelImport.vue +1074 -1074
- package/nstc-g6/components/NstcExcelImportN/NstcExcelImportN.vue +1166 -1166
- package/nstc-g6/components/NstcExpandCollapse/NstcExpandCollapse.vue +130 -130
- package/nstc-g6/components/NstcExpandCollapse/index.scss +77 -77
- package/nstc-g6/components/NstcFileUpload/NstcFileUpload.vue +989 -989
- package/nstc-g6/components/NstcFileUpload/img/addFile.svg +31 -31
- package/nstc-g6/components/NstcFileUpload/img/delete.svg +23 -23
- package/nstc-g6/components/NstcFileUpload/img/deleteFile.svg +27 -27
- package/nstc-g6/components/NstcFileUpload/img/download.svg +23 -23
- package/nstc-g6/components/NstcFileUpload/img/inputUpload.svg +29 -29
- package/nstc-g6/components/NstcFileUpload/img/look-diabled.svg +23 -23
- package/nstc-g6/components/NstcFileUpload/img/look.svg +23 -23
- package/nstc-g6/components/NstcForm/A_DEMO/component/originalForm.vue +280 -280
- package/nstc-g6/components/NstcForm/A_DEMO/config/config_3.js +1222 -1222
- package/nstc-g6/components/NstcForm/A_DEMO/index.vue +796 -796
- package/nstc-g6/components/NstcForm/AutocompleteCustom/index.vue +68 -68
- package/nstc-g6/components/NstcForm/BusinessSpecific/InputMultiple.vue +189 -189
- package/nstc-g6/components/NstcForm/BusinessSpecific/InputWithUnit.vue +128 -128
- package/nstc-g6/components/NstcForm/BusinessSpecific/SelectTreeDialog.vue +233 -233
- package/nstc-g6/components/NstcForm/BusinessSpecific/readme.md +7 -7
- package/nstc-g6/components/NstcForm/CascaderCustom/index.vue +101 -101
- package/nstc-g6/components/NstcForm/CheckboxCustom/index.vue +84 -84
- package/nstc-g6/components/NstcForm/Component.vue +684 -684
- package/nstc-g6/components/NstcForm/ComponentSecond.vue +650 -650
- package/nstc-g6/components/NstcForm/DatepickerCustom/index.vue +130 -130
- package/nstc-g6/components/NstcForm/InputAndDialog/NstcInputAndDialog.vue +389 -389
- package/nstc-g6/components/NstcForm/InputCustom/index.vue +313 -313
- package/nstc-g6/components/NstcForm/IntervalInputCustom/index.vue +111 -111
- package/nstc-g6/components/NstcForm/Item.vue +327 -327
- package/nstc-g6/components/NstcForm/ItemSecond.vue +269 -269
- package/nstc-g6/components/NstcForm/List.vue +146 -146
- package/nstc-g6/components/NstcForm/ListSecond.vue +130 -130
- package/nstc-g6/components/NstcForm/RadioCustom/index.vue +73 -73
- package/nstc-g6/components/NstcForm/SelectAccount/NstcSelectAccount.vue +334 -334
- package/nstc-g6/components/NstcForm/SelectAndDialog/NstcSelectAndDialog.vue +377 -377
- package/nstc-g6/components/NstcForm/SelectCashFlow/NstcSelectCashFlow.vue +122 -122
- package/nstc-g6/components/NstcForm/SelectCustom/index.vue +460 -460
- package/nstc-g6/components/NstcForm/SelectSubject/NstcSelectSubject.vue +184 -184
- package/nstc-g6/components/NstcForm/SelectindialogCustom/index.vue +648 -648
- package/nstc-g6/components/NstcForm/TableRadioCustom/index.vue +183 -183
- package/nstc-g6/components/NstcForm/TextCustom/index.vue +38 -38
- package/nstc-g6/components/NstcForm/UploadCustom/index.vue +500 -500
- package/nstc-g6/components/NstcForm/configs.js +191 -191
- package/nstc-g6/components/NstcForm/configsSecond.js +161 -161
- package/nstc-g6/components/NstcForm/index.js +8 -8
- package/nstc-g6/components/NstcForm/index.scss +29 -29
- package/nstc-g6/components/NstcForm/payeePersonSelect/NstcPayeePerson.vue +187 -187
- package/nstc-g6/components/NstcForm/readme.txt +4 -4
- package/nstc-g6/components/NstcPagination/NstcPagination.vue +428 -428
- package/nstc-g6/components/NstcScreenFull/NstcScreenFull.vue +70 -70
- package/nstc-g6/components/NstcSelectTree/NstcSelectTree.vue +730 -730
- package/nstc-g6/components/NstcSelectTreeList/NstcSelectTreeList.vue +677 -677
- package/nstc-g6/components/NstcSticky/NstcSticky.vue +97 -97
- package/nstc-g6/components/NstcSvgIcon/NstcSvgIcon.vue +72 -72
- package/nstc-g6/components/NstcTab/NstcTab.vue +80 -80
- package/nstc-g6/components/NstcTabWithBadge/NstcTabWithBadge.vue +45 -45
- package/nstc-g6/components/NstcTabWithBadge/index.scss +31 -31
- package/nstc-g6/components/NstcTable/ElTableColumnCustom/index.vue +292 -292
- package/nstc-g6/components/NstcTable/NstcTable.vue +460 -460
- package/nstc-g6/components/NstcTableSet/NstcTableSet.vue +802 -802
- package/nstc-g6/components/NstcThemePicker/NstcThemePicker.vue +186 -186
- package/nstc-g6/components/NstcUploadCustomExcel/NstcUploadCustomExcel.vue +328 -328
- package/nstc-g6/components/NstcUploadExcel/NstcUploadExcel.vue +145 -145
- package/nstc-g6/components/NstcWorkBench/NstcWorkBench.vue +180 -180
- package/nstc-g6/components/Search/NstcSearch.vue +583 -583
- package/nstc-g6/components/Search/src/demo/index copy.vue +101 -101
- package/nstc-g6/components/Search/src/demo/index.vue +103 -103
- package/nstc-g6/components/Search/src/main copy.vue +607 -607
- package/nstc-g6/components/approvelTwo/main.vue +220 -220
- package/nstc-g6/components/approvelTwo/progress.vue +154 -154
- package/nstc-g6/directives/VCopy/index.js +59 -59
- package/nstc-g6/directives/VNstcNumber/index.js +14 -14
- package/nstc-g6/directives/VNstcNumber/temp.js +446 -446
- package/nstc-g6/index.js +193 -193
- package/nstc-g6/utils/auth.js +2 -2
- package/nstc-g6/utils/axios.js +2 -2
- package/nstc-g6/utils/dateAndValidator.js +649 -649
- package/nstc-g6/utils/debounce.js +40 -40
- package/nstc-g6/utils/mapper_aims.js +809 -809
- package/nstc-g6/utils/parseTime.js +48 -48
- package/nstc-g6/utils/validate/index.js +6 -6
- package/nstc-g6/utils/vendor/Export2Excel.js +229 -229
- package/nstc-g6/utils/vendor/Export2Zip.js +24 -24
- package/nstc-g6/utils/vue-bus.js +4 -4
- package/package.json +103 -103
- package/src/_qiankun/index.js +113 -113
- package/src/_qiankun/postMessage.js +24 -24
- package/src/assets/css/_coreLib.scss +43 -43
- package/src/assets/css/alert.scss +28 -28
- package/src/assets/css/cl-anchor.scss +70 -70
- package/src/assets/css/cl-approve-card.scss +68 -68
- package/src/assets/css/cl-dialog.scss +113 -113
- package/src/assets/css/cl-drag-list.scss +24 -24
- package/src/assets/css/cl-empty.scss +10 -10
- package/src/assets/css/cl-expandable-pane.scss +37 -37
- package/src/assets/css/cl-expandable.scss +27 -27
- package/src/assets/css/cl-file-upload-table.scss +31 -31
- package/src/assets/css/cl-filter.scss +4 -4
- package/src/assets/css/cl-flow-step.scss +185 -185
- package/src/assets/css/cl-footer-box.scss +10 -10
- package/src/assets/css/cl-form-item.scss +729 -729
- package/src/assets/css/cl-general-card.scss +11 -11
- package/src/assets/css/cl-layout-aside.scss +92 -92
- package/src/assets/css/cl-layout-content.scss +16 -16
- package/src/assets/css/cl-layout-header.scss +89 -89
- package/src/assets/css/cl-layout-tabs.scss +87 -87
- package/src/assets/css/cl-layout.scss +97 -97
- package/src/assets/css/cl-login-temporary.scss +37 -37
- package/src/assets/css/cl-message.scss +159 -159
- package/src/assets/css/cl-more-tab.scss +98 -98
- package/src/assets/css/cl-nav-menu.scss +5 -5
- package/src/assets/css/cl-pagination.scss +130 -130
- package/src/assets/css/cl-secondary-tab.scss +53 -53
- package/src/assets/css/cl-showcolumn.scss +40 -40
- package/src/assets/css/cl-sifting.scss +51 -51
- package/src/assets/css/cl-statis.scss +54 -54
- package/src/assets/css/cl-step.scss +73 -73
- package/src/assets/css/cl-suspend.scss +19 -19
- package/src/assets/css/cl-tertiary-tab.scss +56 -56
- package/src/assets/css/cl-upload.scss +52 -52
- package/src/assets/css/cl-worn-pagination.scss +50 -50
- package/src/assets/css/el-button.scss +186 -186
- package/src/assets/css/el-table.scss +88 -88
- package/src/assets/css/element-variables.scss +1061 -1061
- package/src/assets/css/element.dev.scss +22 -22
- package/src/assets/css/font-icon.scss +26 -26
- package/src/assets/css/index.dev.scss +4 -4
- package/src/assets/css/index.scss +11 -11
- package/src/assets/css/normalize.scss +845 -845
- package/src/assets/css/plain-text.scss +36 -36
- package/src/assets/css/rootvar.scss +143 -143
- package/src/assets/css/select.scss +25 -25
- package/src/assets/css/title-pop.scss +23 -23
- package/src/assets/getJsonc.js +53 -53
- package/src/assets/iconFont/demo.css +539 -539
- package/src/assets/iconFont/demo_index.html +1614 -1614
- package/src/assets/iconFont/iconfont.css +263 -263
- package/src/assets/iconFont/iconfont.json +443 -443
- package/src/assets/realUrl.js +13 -13
- package/src/components/Anchor/AnchorItem.vue +30 -30
- package/src/components/Anchor/index.vue +208 -208
- package/src/components/ApprovalButtons/index.vue +240 -240
- package/src/components/ApprovalCard/index.vue +132 -132
- package/src/components/ApprovalRecord/approvalImg.vue +39 -39
- package/src/components/ApprovalRecord/approvalImgPro.vue +424 -424
- package/src/components/ApprovalRecord/flowDialog.vue +47 -47
- package/src/components/ApprovalRecord/index.vue +63 -63
- package/src/components/Button/button-group.vue +148 -148
- package/src/components/Button/icon-group-button.vue +63 -63
- package/src/components/Button/index.vue +56 -56
- package/src/components/CascaderArea/index.vue +103 -103
- package/src/components/ChildRange/index.vue +169 -169
- package/src/components/ChildRange/style.scss +34 -34
- package/src/components/ContentLoading/index.vue +41 -41
- package/src/components/ContentNull/index.vue +19 -19
- package/src/components/DatePicker/index.vue +33 -33
- package/src/components/DatePicker/por.vue +171 -171
- package/src/components/Descriptions/index.vue +42 -42
- package/src/components/Dialog/index.vue +26 -26
- package/src/components/Dialog/indexO.vue +116 -116
- package/src/components/DragList/index.vue +79 -79
- package/src/components/ECharts/define.js +74 -74
- package/src/components/ECharts/index.vue +170 -170
- package/src/components/ECharts/mixins/resize.js +23 -23
- package/src/components/Empty/img/400.svg +101 -101
- package/src/components/Empty/img/401.svg +101 -101
- package/src/components/Empty/img/403.svg +101 -101
- package/src/components/Empty/img/405.svg +101 -101
- package/src/components/Empty/img/901.svg +95 -95
- package/src/components/Empty/img/902.svg +95 -95
- package/src/components/Empty/img/903.svg +95 -95
- package/src/components/Empty/img/904.svg +95 -95
- package/src/components/Empty/img/905.svg +95 -95
- package/src/components/Empty/img/906.svg +95 -95
- package/src/components/Empty/img/907.svg +95 -95
- package/src/components/Empty/img/abnormal.svg +108 -108
- package/src/components/Empty/img/dispose.svg +71 -71
- package/src/components/Empty/img/empty.svg +57 -57
- package/src/components/Empty/img/general.svg +58 -58
- package/src/components/Empty/img/lock.svg +57 -57
- package/src/components/Empty/img/network.svg +59 -59
- package/src/components/Empty/img/relevant.svg +68 -68
- package/src/components/Empty/img/search.svg +72 -72
- package/src/components/Empty/index.vue +147 -147
- package/src/components/EventBubble/demo/a.vue +29 -29
- package/src/components/EventBubble/demo/b.vue +12 -12
- package/src/components/EventBubble/demo/c.vue +18 -18
- package/src/components/EventBubble/index.vue +57 -57
- package/src/components/Expandable/index.vue +49 -49
- package/src/components/Expandable/main.vue +64 -64
- package/src/components/FileExportAsync/index.vue +191 -191
- package/src/components/FileImport/index.vue +108 -108
- package/src/components/FileUploadTable/index.vue +583 -583
- package/src/components/Filters/form-item-input.vue +185 -185
- package/src/components/Filters/index.vue +216 -216
- package/src/components/Filters/indexO.vue +106 -106
- package/src/components/FlowStep/index.vue +92 -92
- package/src/components/FooterBox/index.vue +21 -21
- package/src/components/GeneralCard/index.vue +15 -15
- package/src/components/InputNumber/index.vue +184 -184
- package/src/components/InputNumber/numberRange.vue +62 -62
- package/src/components/InputSearch/index.vue +79 -75
- package/src/components/Layout/AsideNav/index.vue +120 -120
- package/src/components/Layout/AsideNav/menuItem.vue +34 -34
- package/src/components/Layout/AsideNav/submenuTitle.vue +26 -26
- package/src/components/Layout/HeaderWrap/changePwd.vue +215 -215
- package/src/components/Layout/HeaderWrap/index.vue +412 -412
- package/src/components/Layout/HeaderWrap/noticePop.vue +316 -316
- package/src/components/Layout/SubContent/index.vue +127 -127
- package/src/components/Layout/TabsNav/index.vue +169 -169
- package/src/components/Layout/index.vue +518 -518
- package/src/components/Layout/utils.js +12 -12
- package/src/components/LoginTemporary/form.vue +581 -581
- package/src/components/LoginTemporary/index.vue +198 -198
- package/src/components/LoginTemporary/qrcode.vue +92 -92
- package/src/components/LoginTemporary/retrievePw.vue +375 -375
- package/src/components/LoginTemporary/utils.js +73 -73
- package/src/components/MicroApp/index.js +67 -67
- package/src/components/MicroFrame/index.vue +95 -95
- package/src/components/MoreTab/index.vue +229 -229
- package/src/components/NavMenu/index.vue +60 -60
- package/src/components/PageHeader/index.vue +39 -39
- package/src/components/PageHeader/style.scss +44 -44
- package/src/components/PageLayout/page.vue +15 -15
- package/src/components/Pagination/index.vue +165 -165
- package/src/components/SecondaryTab/index.vue +57 -57
- package/src/components/SelectLazy/index.vue +75 -75
- package/src/components/SelectTree/SelectTreeLazy.vue +241 -241
- package/src/components/SelectTree/index.vue +206 -206
- package/src/components/ShowColumn/index.vue +252 -252
- package/src/components/Sifting/index.vue +98 -98
- package/src/components/Stamp/index.vue +75 -75
- package/src/components/Statis/index.vue +113 -113
- package/src/components/Statis/statisItem.vue +65 -65
- package/src/components/Statis/statisPopover.vue +63 -63
- package/src/components/Step/index.vue +37 -37
- package/src/components/Suspend/index.vue +72 -72
- package/src/components/Table/filters.js +60 -60
- package/src/components/Table/index.vue +89 -89
- package/src/components/Table/indexO.vue +149 -149
- package/src/components/TableOperateColumn/OperateBtns.vue +86 -86
- package/src/components/TableOperateColumn/index.vue +26 -26
- package/src/components/Task/index.vue +26 -26
- package/src/components/TertiaryTab/index.vue +62 -62
- package/src/components/TimePicker/index.vue +28 -28
- package/src/components/Upload/index.vue +280 -280
- package/src/components/Upload/uploadMsg.vue +114 -114
- package/src/components/WornPagination/index.vue +73 -73
- package/src/directives/VClickOutside/index.js +27 -27
- package/src/directives/VHas/index.js +58 -58
- package/src/directives/VMove/index.js +42 -42
- package/src/directives/VRuleKey/index.js +201 -201
- package/src/directives/VTitle/index.js +109 -109
- package/src/index.js +265 -265
- package/src/plugins/CompatibleOld/index.js +11 -11
- package/src/plugins/Print/index.js +4 -4
- package/src/plugins/Print/print-js/.babelrc +12 -12
- package/src/plugins/Print/print-js/LICENSE +21 -21
- package/src/plugins/Print/print-js/README.md +98 -98
- package/src/plugins/Print/print-js/dist/print.css +96 -96
- package/src/plugins/Print/print-js/dist/print.js +990 -990
- package/src/plugins/Print/print-js/package.json +60 -60
- package/src/plugins/Print/print-js/src/index.d.ts +45 -45
- package/src/plugins/Print/print-js/src/index.js +10 -10
- package/src/plugins/Print/print-js/src/js/browser.js +33 -33
- package/src/plugins/Print/print-js/src/js/functions.js +103 -103
- package/src/plugins/Print/print-js/src/js/html.js +70 -70
- package/src/plugins/Print/print-js/src/js/image.js +48 -48
- package/src/plugins/Print/print-js/src/js/init.js +168 -168
- package/src/plugins/Print/print-js/src/js/json.js +109 -109
- package/src/plugins/Print/print-js/src/js/modal.js +62 -62
- package/src/plugins/Print/print-js/src/js/pdf.js +62 -62
- package/src/plugins/Print/print-js/src/js/print.js +102 -102
- package/src/plugins/Print/print-js/src/js/raw-html.js +15 -15
- package/src/plugins/Print/print-js/src/sass/index.scss +13 -13
- package/src/plugins/Print/print-js/src/sass/modules/_colors.scss +9 -9
- package/src/plugins/Print/print-js/src/sass/partials/_modal.scss +40 -40
- package/src/plugins/Print/print-js/src/sass/partials/_spinner.scss +45 -45
- package/src/plugins/Print/print.js +2 -2
- package/src/plugins/Print/print.scss +1 -1
- package/src/plugins/SetMenuTree/index.vue +41 -41
- package/src/plugins/SetMenuTree/logoIcon.vue +37 -37
- package/src/plugins/SetMenuTree/setmenutree.vue +427 -427
- package/src/plugins/SetMenuTree/utils.js +74 -74
- package/src/plugins/Sign/InfosecNetSignCNGAgent.min.js +2000 -2000
- package/src/plugins/Sign/bjca/XTXSAB.js +2395 -2395
- package/src/plugins/Sign/bjca/index.js +129 -129
- package/src/plugins/Sign/index.js +28 -28
- package/src/plugins/Sign/sign.js +108 -64
- package/src/plugins/setTabsForSub.js +2 -2
- package/src/utils/auth.js +56 -56
- package/src/utils/axios.js +205 -205
- package/src/utils/downloadBlob.js +19 -19
- package/src/utils/forEachs.js +16 -16
- package/src/utils/getScrollContainer.js +43 -43
- package/src/utils/handleTab.js +109 -109
- package/src/utils/i18n/cn2hk.json +1270 -1270
- package/src/utils/i18n/index.js +50 -50
- package/src/utils/importGlobal.js +16 -16
- package/src/utils/list2tree.js +36 -36
- package/src/utils/msgboxPor.js +26 -26
- package/src/utils/print.js +161 -161
- package/src/utils/relaNo.js +72 -72
- package/src/utils/repairElementUI.js +169 -169
- package/src/utils/tableheaderFilterpanel.vue +248 -248
- package/src/utils/theme.config.js +22 -22
- package/src/utils/theme.js +31 -31
- package/src/utils/toExcel.js +103 -103
- package/src/utils/urlToGo.js +82 -82
- package/src/utils/xls2json.js +44 -44
- package/src/utils/xlsx2json.js +28 -28
|
@@ -1,989 +1,989 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
功能: 新版UI文件上传
|
|
3
|
-
作者: lihao
|
|
4
|
-
创建时间: 2021-02-19
|
|
5
|
-
-->
|
|
6
|
-
<template>
|
|
7
|
-
<div class="nstc-file-upload">
|
|
8
|
-
<div v-if="pattern !== 'text'" class="nstc-file-upload-head">
|
|
9
|
-
<el-button
|
|
10
|
-
v-if="!views"
|
|
11
|
-
type="primary"
|
|
12
|
-
class="nstc-g6-common-btn-1 nstc-g6-common-btn-size-s"
|
|
13
|
-
:disabled="isDisabled"
|
|
14
|
-
@click="add"
|
|
15
|
-
>
|
|
16
|
-
新增
|
|
17
|
-
</el-button>
|
|
18
|
-
<el-button
|
|
19
|
-
v-if="tableData.length !== 0 && !views"
|
|
20
|
-
class="nstc-g6-common-btn-1 nstc-g6-common-btn-size-s"
|
|
21
|
-
@click="batchDownload"
|
|
22
|
-
>下载
|
|
23
|
-
</el-button>
|
|
24
|
-
<el-button
|
|
25
|
-
v-if="tableData.length !== 0 && !views"
|
|
26
|
-
class="nstc-g6-common-btn-4 nstc-g6-common-btn-size-s"
|
|
27
|
-
:disabled="isDisabled"
|
|
28
|
-
@click="batchDelete"
|
|
29
|
-
>
|
|
30
|
-
删除
|
|
31
|
-
</el-button>
|
|
32
|
-
</div>
|
|
33
|
-
<div v-else class="nstc-file-upload-head">
|
|
34
|
-
<el-button
|
|
35
|
-
v-if="tableData.length !== 0 && !views"
|
|
36
|
-
class="nstc-g6-common-btn-1 nstc-g6-common-btn-size-s"
|
|
37
|
-
@click="batchDownload"
|
|
38
|
-
>下载
|
|
39
|
-
</el-button>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="nstc-file-upload-table">
|
|
42
|
-
<el-form ref="form" :rules="model.rules" :model="model">
|
|
43
|
-
<el-table :data="tableData" @selection-change="handleSelectionChange">
|
|
44
|
-
<el-table-column type="selection" width="50" align="center" />
|
|
45
|
-
<el-table-column label="附件类型" align="left" min-width="180">
|
|
46
|
-
<template slot-scope="scope">
|
|
47
|
-
<!-- !textFlag(scope.row.uuid,scope.row.filePath) -->
|
|
48
|
-
<el-select
|
|
49
|
-
v-if="!textFlag(scope.row.uuid, scope.row.filePath) && !views"
|
|
50
|
-
v-model="scope.row.fileType"
|
|
51
|
-
>
|
|
52
|
-
<el-option
|
|
53
|
-
v-for="(item, index) in fileTypeList"
|
|
54
|
-
:key="index"
|
|
55
|
-
:label="item.label"
|
|
56
|
-
:value="item.value"
|
|
57
|
-
/>
|
|
58
|
-
</el-select>
|
|
59
|
-
<span v-else>{{
|
|
60
|
-
getFileTypeLabel(scope.row.fileType) || '--'
|
|
61
|
-
}}</span>
|
|
62
|
-
</template>
|
|
63
|
-
</el-table-column>
|
|
64
|
-
<el-table-column label="附件名称" align="left" min-width="180">
|
|
65
|
-
<template slot-scope="scope">
|
|
66
|
-
<el-form-item
|
|
67
|
-
v-if="!textFlag(scope.row.uuid, scope.row.filePath) && !views"
|
|
68
|
-
:prop="'tableData.' + scope.$index + '.attachmentName'"
|
|
69
|
-
:rules="model.rules.attachmentName"
|
|
70
|
-
>
|
|
71
|
-
<el-input
|
|
72
|
-
v-model.trim="scope.row.attachmentName"
|
|
73
|
-
placeholder="请输入附件名称"
|
|
74
|
-
clearable
|
|
75
|
-
:maxlength="attachmentMaxlength"
|
|
76
|
-
/>
|
|
77
|
-
</el-form-item>
|
|
78
|
-
|
|
79
|
-
<span v-else>{{ scope.row.attachmentName || '--' }}</span>
|
|
80
|
-
</template>
|
|
81
|
-
</el-table-column>
|
|
82
|
-
<el-table-column label="附件上传" align="left" min-width="180">
|
|
83
|
-
<template slot-scope="scope">
|
|
84
|
-
<el-upload
|
|
85
|
-
v-if="pattern !== 'text' && !views"
|
|
86
|
-
:ref="`nstc_g6_common_upload_index_${scope.$index}`"
|
|
87
|
-
action=""
|
|
88
|
-
v-bind="$attrs"
|
|
89
|
-
:auto-upload="false"
|
|
90
|
-
:before-upload="
|
|
91
|
-
function (file) {
|
|
92
|
-
return beforeUpload(file, scope.row)
|
|
93
|
-
}
|
|
94
|
-
"
|
|
95
|
-
:on-exceed="handleExceed"
|
|
96
|
-
:on-change="
|
|
97
|
-
(file, fileLists) => {
|
|
98
|
-
handleChange(file, fileLists, scope.$index, scope.row)
|
|
99
|
-
}
|
|
100
|
-
"
|
|
101
|
-
:file-list="fileList"
|
|
102
|
-
:show-file-list="false"
|
|
103
|
-
:http-request="httpRequest"
|
|
104
|
-
v-on="$listeners"
|
|
105
|
-
>
|
|
106
|
-
<el-input
|
|
107
|
-
v-model="scope.row.fileName"
|
|
108
|
-
placeholder="请选择附件"
|
|
109
|
-
readonly
|
|
110
|
-
@click="getUploadIndex(scope.$index)"
|
|
111
|
-
>
|
|
112
|
-
<div slot="suffix" class="input-upload">
|
|
113
|
-
<img :src="inputUploadSvg" alt="" />
|
|
114
|
-
</div>
|
|
115
|
-
</el-input>
|
|
116
|
-
</el-upload>
|
|
117
|
-
<span v-else>{{ scope.row.fileName || '--' }}</span>
|
|
118
|
-
</template>
|
|
119
|
-
<el-input />
|
|
120
|
-
</el-table-column>
|
|
121
|
-
<el-table-column
|
|
122
|
-
label="上传时间"
|
|
123
|
-
prop="time"
|
|
124
|
-
align="left"
|
|
125
|
-
width="220px"
|
|
126
|
-
>
|
|
127
|
-
<template slot-scope="scope">
|
|
128
|
-
<span>{{
|
|
129
|
-
(scope.row.time || scope.row.createTime) | parseTimeFormat
|
|
130
|
-
}}</span>
|
|
131
|
-
</template>
|
|
132
|
-
</el-table-column>
|
|
133
|
-
<el-table-column label="上传人" prop="user" align="left">
|
|
134
|
-
<template slot-scope="scope">
|
|
135
|
-
<span>{{ scope.row.user || scope.row.creator }}</span>
|
|
136
|
-
</template>
|
|
137
|
-
</el-table-column>
|
|
138
|
-
<el-table-column
|
|
139
|
-
v-if="pattern !== 'text'"
|
|
140
|
-
label="上传进度"
|
|
141
|
-
align="left"
|
|
142
|
-
width="300px"
|
|
143
|
-
>
|
|
144
|
-
<template slot-scope="scope">
|
|
145
|
-
<div class="nstc-el-progress-box">
|
|
146
|
-
<el-progress
|
|
147
|
-
v-show="showProgress"
|
|
148
|
-
:percentage="
|
|
149
|
-
(scope.row.uuid || scope.row.filePath) &&
|
|
150
|
-
scope.row.status !== 'exception'
|
|
151
|
-
? 100
|
|
152
|
-
: scope.row.percentage
|
|
153
|
-
"
|
|
154
|
-
:status="
|
|
155
|
-
scope.row.uuid || scope.row.filePath
|
|
156
|
-
? 'success'
|
|
157
|
-
: scope.row.status
|
|
158
|
-
"
|
|
159
|
-
:width="100"
|
|
160
|
-
/>
|
|
161
|
-
</div>
|
|
162
|
-
<span
|
|
163
|
-
v-if="scope.row.status === 'exception'"
|
|
164
|
-
class="nstc-file-reload"
|
|
165
|
-
@click="reUploadAction(scope.$index)"
|
|
166
|
-
>重新上传</span
|
|
167
|
-
>
|
|
168
|
-
</template>
|
|
169
|
-
</el-table-column>
|
|
170
|
-
<el-table-column label="操作" align="left" width="100px">
|
|
171
|
-
<template slot-scope="scope">
|
|
172
|
-
<div class="nstc-file-upload-opt">
|
|
173
|
-
<!-- v-if="false" -->
|
|
174
|
-
<!-- -->
|
|
175
|
-
<img
|
|
176
|
-
v-if="showViews"
|
|
177
|
-
:src="lookDiabled"
|
|
178
|
-
alt=""
|
|
179
|
-
@click="lookFile(scope.$index)"
|
|
180
|
-
/>
|
|
181
|
-
<img
|
|
182
|
-
v-if="
|
|
183
|
-
(scope.row.uuid || scope.row.filePath) && pattern === 'text'
|
|
184
|
-
"
|
|
185
|
-
:src="downloadSvg"
|
|
186
|
-
alt=""
|
|
187
|
-
@click="downLoadFile(scope.row)"
|
|
188
|
-
/>
|
|
189
|
-
<!-- <img
|
|
190
|
-
v-if="pattern !== 'text'"
|
|
191
|
-
:src="deleteSvg"
|
|
192
|
-
alt=""
|
|
193
|
-
@click="deleteFile(scope.$index)"
|
|
194
|
-
/> -->
|
|
195
|
-
</div>
|
|
196
|
-
</template>
|
|
197
|
-
</el-table-column>
|
|
198
|
-
</el-table>
|
|
199
|
-
</el-form>
|
|
200
|
-
</div>
|
|
201
|
-
<DialogCustom
|
|
202
|
-
v-model="dialogShowFlag"
|
|
203
|
-
:show-footer="false"
|
|
204
|
-
:title="dialogTitle"
|
|
205
|
-
@confirm="handleConfirm"
|
|
206
|
-
>
|
|
207
|
-
<span>查看文件</span>
|
|
208
|
-
</DialogCustom>
|
|
209
|
-
</div>
|
|
210
|
-
</template>
|
|
211
|
-
|
|
212
|
-
<script>
|
|
213
|
-
import lookSvg from './img/look.svg'
|
|
214
|
-
import lookDiabled from './img/look-diabled.svg'
|
|
215
|
-
import downloadSvg from './img/download.svg'
|
|
216
|
-
import deleteSvg from './img/delete.svg'
|
|
217
|
-
import inputUploadSvg from './img/inputUpload.svg'
|
|
218
|
-
import addFile from './img/addFile.svg'
|
|
219
|
-
import deleteFileSvg from './img/deleteFile.svg'
|
|
220
|
-
import DialogCustom from '../NstcDialog/NstcDialog'
|
|
221
|
-
// fileDownloadGdt
|
|
222
|
-
|
|
223
|
-
import { parseTime } from '../../utils/parseTime'
|
|
224
|
-
import auth from '../../utils/auth'
|
|
225
|
-
import axios from 'axios'
|
|
226
|
-
|
|
227
|
-
export default {
|
|
228
|
-
name: 'NstcFileUpload',
|
|
229
|
-
components: {
|
|
230
|
-
DialogCustom
|
|
231
|
-
},
|
|
232
|
-
filters: {
|
|
233
|
-
parseTimeFormat: function (val) {
|
|
234
|
-
if (val !== '' && val) {
|
|
235
|
-
return parseTime(new Date(val), '{y}-{m}-{d}')
|
|
236
|
-
} else {
|
|
237
|
-
return ''
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
props: {
|
|
242
|
-
attachmentMaxlength: {
|
|
243
|
-
type: String,
|
|
244
|
-
default: '64'
|
|
245
|
-
},
|
|
246
|
-
views: {
|
|
247
|
-
//是否浏览模式
|
|
248
|
-
type: Boolean,
|
|
249
|
-
default: false
|
|
250
|
-
},
|
|
251
|
-
value: {
|
|
252
|
-
type: Array,
|
|
253
|
-
default: () => {
|
|
254
|
-
return []
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
pattern: {
|
|
258
|
-
type: String,
|
|
259
|
-
default: () => {
|
|
260
|
-
return 'normal'
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
url: {
|
|
264
|
-
type: String,
|
|
265
|
-
default: null
|
|
266
|
-
},
|
|
267
|
-
batchDownloadUrl: {
|
|
268
|
-
type: String,
|
|
269
|
-
default: null
|
|
270
|
-
},
|
|
271
|
-
httpMethod: {
|
|
272
|
-
type: String,
|
|
273
|
-
default: 'post'
|
|
274
|
-
},
|
|
275
|
-
showLength: {
|
|
276
|
-
type: Boolean,
|
|
277
|
-
default: true
|
|
278
|
-
},
|
|
279
|
-
isDisabled: {
|
|
280
|
-
type: Boolean,
|
|
281
|
-
default: false
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
data() {
|
|
285
|
-
return {
|
|
286
|
-
lookSvg,
|
|
287
|
-
lookDiabled,
|
|
288
|
-
downloadSvg,
|
|
289
|
-
deleteSvg,
|
|
290
|
-
inputUploadSvg,
|
|
291
|
-
addFile,
|
|
292
|
-
deleteFileSvg,
|
|
293
|
-
showViews: false,
|
|
294
|
-
model: {
|
|
295
|
-
rules: {
|
|
296
|
-
attachmentName: {
|
|
297
|
-
type: 'string',
|
|
298
|
-
required: true,
|
|
299
|
-
message: '必填字段',
|
|
300
|
-
trigger: 'change'
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
tableData: []
|
|
304
|
-
},
|
|
305
|
-
fileList: [],
|
|
306
|
-
tableSelectionData: [],
|
|
307
|
-
tableSelectionData2: [],
|
|
308
|
-
fileTypeList: [{ label: '附件', value: 1 }],
|
|
309
|
-
tempFile: {
|
|
310
|
-
id: '',
|
|
311
|
-
attachmentName: '',
|
|
312
|
-
fileName: '',
|
|
313
|
-
remark: null,
|
|
314
|
-
fileType: 1,
|
|
315
|
-
type: '',
|
|
316
|
-
time: '',
|
|
317
|
-
user: '',
|
|
318
|
-
progress: 0,
|
|
319
|
-
uuid: '',
|
|
320
|
-
status: null,
|
|
321
|
-
fileObj: '',
|
|
322
|
-
percentage: 0
|
|
323
|
-
},
|
|
324
|
-
dialogTitle: '查看',
|
|
325
|
-
dialogShowFlag: false,
|
|
326
|
-
currentUploadIndex: null,
|
|
327
|
-
showProgress: true,
|
|
328
|
-
dialogShowDelete: false,
|
|
329
|
-
dialogDeleteTitle: '提示'
|
|
330
|
-
}
|
|
331
|
-
},
|
|
332
|
-
computed: {
|
|
333
|
-
tableData: {
|
|
334
|
-
get() {
|
|
335
|
-
this.value.map((item) => {
|
|
336
|
-
item.fileType = item.fileType == '' ? '' : Number(item.fileType)
|
|
337
|
-
item.status == null ? (item.status = 0) : ''
|
|
338
|
-
return item
|
|
339
|
-
})
|
|
340
|
-
this.model.tableData = this.value
|
|
341
|
-
console.log('this.model=====', this.model.tableData)
|
|
342
|
-
return this.value
|
|
343
|
-
},
|
|
344
|
-
set(val) {
|
|
345
|
-
this.$emit('input', val)
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
uploadFlag() {
|
|
349
|
-
return this.tableData.filter((i) => i.uuid).length !== 0
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
beforeUpdate() {
|
|
353
|
-
this.showProgress = false
|
|
354
|
-
},
|
|
355
|
-
updated() {
|
|
356
|
-
setTimeout(() => {
|
|
357
|
-
this.showProgress = true
|
|
358
|
-
}, 1)
|
|
359
|
-
},
|
|
360
|
-
methods: {
|
|
361
|
-
beforeUpload(file, row) {
|
|
362
|
-
console.log(file, row)
|
|
363
|
-
// if(!row.attachmentName) {
|
|
364
|
-
// this.$message({
|
|
365
|
-
// type: "warning",
|
|
366
|
-
// message: "请先输入附件名称再上传",
|
|
367
|
-
// });
|
|
368
|
-
// return false
|
|
369
|
-
// }
|
|
370
|
-
},
|
|
371
|
-
checkValidate() {
|
|
372
|
-
this.$refs['form'].validate((res) => {
|
|
373
|
-
return res
|
|
374
|
-
})
|
|
375
|
-
},
|
|
376
|
-
cancel(i) {
|
|
377
|
-
this.tableData[i].percentage = 0
|
|
378
|
-
console.log('111')
|
|
379
|
-
},
|
|
380
|
-
/**
|
|
381
|
-
* 判断当前是不是文档模式
|
|
382
|
-
* 1, pattern 等于 text
|
|
383
|
-
* 2 上传成功
|
|
384
|
-
*/
|
|
385
|
-
textFlag(uuid, filePath) {
|
|
386
|
-
console.log(uuid, filePath)
|
|
387
|
-
if (this.pattern === 'text') {
|
|
388
|
-
return true
|
|
389
|
-
} else {
|
|
390
|
-
return !!uuid || !!filePath
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* 新增文件
|
|
396
|
-
*/
|
|
397
|
-
add() {
|
|
398
|
-
this.tableData.unshift(
|
|
399
|
-
JSON.parse(
|
|
400
|
-
JSON.stringify({
|
|
401
|
-
id: new Date().getTime(),
|
|
402
|
-
attachmentName: '',
|
|
403
|
-
fileName: '',
|
|
404
|
-
remark: null,
|
|
405
|
-
fileType: 1,
|
|
406
|
-
type: '',
|
|
407
|
-
time: '',
|
|
408
|
-
user: '',
|
|
409
|
-
progress: 0,
|
|
410
|
-
uuid: '',
|
|
411
|
-
status: null,
|
|
412
|
-
fileObj: '',
|
|
413
|
-
percentage: 0
|
|
414
|
-
})
|
|
415
|
-
)
|
|
416
|
-
)
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* 表格选择变化
|
|
421
|
-
*/
|
|
422
|
-
handleSelectionChange(data) {
|
|
423
|
-
this.tableSelectionData = data
|
|
424
|
-
},
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* 查看文件
|
|
428
|
-
*/
|
|
429
|
-
lookFile() {
|
|
430
|
-
// this.dialogShowFlag = true;
|
|
431
|
-
},
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* 下载文件
|
|
435
|
-
*/
|
|
436
|
-
downLoadFile(data) {
|
|
437
|
-
console.log(data)
|
|
438
|
-
// const aEl = document.createElement('a')
|
|
439
|
-
let uuid = data.uuid || data.filePath
|
|
440
|
-
const p = encodeURIComponent(uuid)
|
|
441
|
-
const n = encodeURIComponent(data.fileName)
|
|
442
|
-
|
|
443
|
-
axios({
|
|
444
|
-
method: this.httpMethod,
|
|
445
|
-
url: `${this.url}/download/${p}/${n}`,
|
|
446
|
-
// 这里可以在header中加一些东西,比如token
|
|
447
|
-
headers: {
|
|
448
|
-
'Content-Type': 'application/json',
|
|
449
|
-
Authorization: `Bearer ${auth.getCookieToken()}`,
|
|
450
|
-
timestamp: Date.now(),
|
|
451
|
-
OperationDesc: 'yYarJp',
|
|
452
|
-
requestKey: Math.round(Math.random() * 1000000000)
|
|
453
|
-
},
|
|
454
|
-
responseType: 'blob'
|
|
455
|
-
})
|
|
456
|
-
.then((res) => {
|
|
457
|
-
console.log('response: ', res)
|
|
458
|
-
let blob = new Blob([res.data], {
|
|
459
|
-
type: 'application/octet-stream;charset=UTF-8'
|
|
460
|
-
})
|
|
461
|
-
let fileName = decodeURI(
|
|
462
|
-
res.headers['content-disposition'].split(';')[1].split('=')[1]
|
|
463
|
-
)
|
|
464
|
-
if (window.navigator.msSaveBlob) {
|
|
465
|
-
// ie
|
|
466
|
-
window.navigator.msSaveOrOpenBlob(blob, fileName)
|
|
467
|
-
return
|
|
468
|
-
}
|
|
469
|
-
let elink = document.createElement('a')
|
|
470
|
-
elink.style.display = 'none'
|
|
471
|
-
elink.href = window.URL.createObjectURL(blob)
|
|
472
|
-
elink.download = data.fileName
|
|
473
|
-
document.body.appendChild(elink)
|
|
474
|
-
elink.click()
|
|
475
|
-
URL.revokeObjectURL(elink.href)
|
|
476
|
-
document.body.removeChild(elink)
|
|
477
|
-
})
|
|
478
|
-
.catch((error) => {
|
|
479
|
-
console.log('response: ', error)
|
|
480
|
-
})
|
|
481
|
-
},
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* 删除文件
|
|
485
|
-
*/
|
|
486
|
-
deleteFile(index) {
|
|
487
|
-
this.$confirmTip({
|
|
488
|
-
type: 'info',
|
|
489
|
-
title: '确认删除该文件?',
|
|
490
|
-
info: '',
|
|
491
|
-
button: {
|
|
492
|
-
ok: '提交',
|
|
493
|
-
cancel: '取消'
|
|
494
|
-
}
|
|
495
|
-
}).then(() => {
|
|
496
|
-
this.tableData.splice(index, 1)
|
|
497
|
-
this.$message({
|
|
498
|
-
type: 'success',
|
|
499
|
-
message: '删除成功!'
|
|
500
|
-
})
|
|
501
|
-
})
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* 弹框确认事件
|
|
506
|
-
*/
|
|
507
|
-
handleConfirm() {},
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* 批量下载
|
|
511
|
-
*/
|
|
512
|
-
batchDownload() {
|
|
513
|
-
if (this.tableSelectionData.length === 1) {
|
|
514
|
-
// 单条下载
|
|
515
|
-
this.downLoadFile(this.tableSelectionData[0])
|
|
516
|
-
} else if (this.tableSelectionData.length > 1) {
|
|
517
|
-
const files = []
|
|
518
|
-
// 判断是否有文件未上传
|
|
519
|
-
console.log('this.tableSelectionData====', this.tableSelectionData)
|
|
520
|
-
let isNoUpload = this.tableSelectionData.some((item) => {
|
|
521
|
-
!item.uuid == true
|
|
522
|
-
})
|
|
523
|
-
console.log('文件判断=======', isNoUpload)
|
|
524
|
-
if (isNoUpload) {
|
|
525
|
-
// 阻断下载
|
|
526
|
-
this.$message({
|
|
527
|
-
type: 'warning',
|
|
528
|
-
message: '勾选文件中有文件未上传'
|
|
529
|
-
})
|
|
530
|
-
return
|
|
531
|
-
}
|
|
532
|
-
this.tableSelectionData.map((item) => {
|
|
533
|
-
files.push({
|
|
534
|
-
uuid: item.uuid || item.filePath,
|
|
535
|
-
fileName: item.fileName
|
|
536
|
-
})
|
|
537
|
-
})
|
|
538
|
-
|
|
539
|
-
axios({
|
|
540
|
-
url: this.batchDownloadUrl,
|
|
541
|
-
method: 'POST',
|
|
542
|
-
data: JSON.stringify(files),
|
|
543
|
-
headers: {
|
|
544
|
-
'Content-Type': 'application/json',
|
|
545
|
-
Authorization: `Bearer ${auth.getCookieToken()}`,
|
|
546
|
-
timestamp: Date.now(),
|
|
547
|
-
OperationDesc: 'yYarJp',
|
|
548
|
-
requestKey: Math.round(Math.random() * 1000000000)
|
|
549
|
-
},
|
|
550
|
-
responseType: 'blob'
|
|
551
|
-
})
|
|
552
|
-
.then((res) => {
|
|
553
|
-
let blob = new Blob([res.data], {
|
|
554
|
-
type: 'application/octet-stream;charset=UTF-8'
|
|
555
|
-
})
|
|
556
|
-
let fileName = decodeURI(
|
|
557
|
-
res.headers['content-disposition'].split(';')[1].split('=')[1]
|
|
558
|
-
)
|
|
559
|
-
if (window.navigator.msSaveBlob) {
|
|
560
|
-
// ie
|
|
561
|
-
window.navigator.msSaveOrOpenBlob(blob, fileName)
|
|
562
|
-
return
|
|
563
|
-
}
|
|
564
|
-
let elink = document.createElement('a')
|
|
565
|
-
elink.style.display = 'none'
|
|
566
|
-
elink.href = window.URL.createObjectURL(blob)
|
|
567
|
-
elink.download = '批量下载.zip'
|
|
568
|
-
document.body.appendChild(elink)
|
|
569
|
-
elink.click()
|
|
570
|
-
URL.revokeObjectURL(elink.href)
|
|
571
|
-
document.body.removeChild(elink)
|
|
572
|
-
})
|
|
573
|
-
.catch((error) => {
|
|
574
|
-
console.log('response: ', error)
|
|
575
|
-
})
|
|
576
|
-
} else {
|
|
577
|
-
this.$message({
|
|
578
|
-
type: 'warning',
|
|
579
|
-
message: '请选择要下载的附件'
|
|
580
|
-
})
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* 批量删除
|
|
586
|
-
*/
|
|
587
|
-
batchDelete() {
|
|
588
|
-
if (this.tableSelectionData.length !== 0) {
|
|
589
|
-
this.dialogShowDelete = true
|
|
590
|
-
this.$confirmTip({
|
|
591
|
-
type: 'error',
|
|
592
|
-
title: '确认要删除所选附件吗?',
|
|
593
|
-
info: '删除后数据不可恢复',
|
|
594
|
-
button: {
|
|
595
|
-
ok: '提交',
|
|
596
|
-
cancel: '取消'
|
|
597
|
-
}
|
|
598
|
-
}).then(() => {
|
|
599
|
-
this.tableData = this.tableData.filter((i) => {
|
|
600
|
-
return !this.tableSelectionData.includes(i)
|
|
601
|
-
})
|
|
602
|
-
setTimeout(() => {
|
|
603
|
-
this.tableSelectionData = []
|
|
604
|
-
}, 30)
|
|
605
|
-
this.$message({
|
|
606
|
-
type: 'success',
|
|
607
|
-
message: '删除成功!'
|
|
608
|
-
})
|
|
609
|
-
})
|
|
610
|
-
} else {
|
|
611
|
-
this.$message({
|
|
612
|
-
type: 'warning',
|
|
613
|
-
message: '请选择要删除的附件'
|
|
614
|
-
})
|
|
615
|
-
}
|
|
616
|
-
},
|
|
617
|
-
handleConfirmDelete() {
|
|
618
|
-
this.tableData = this.tableData.filter((i) => {
|
|
619
|
-
return !this.tableSelectionData.includes(i)
|
|
620
|
-
})
|
|
621
|
-
setTimeout(() => {
|
|
622
|
-
this.tableSelectionData = []
|
|
623
|
-
}, 30)
|
|
624
|
-
this.dialogShowDelete = false
|
|
625
|
-
this.$message({
|
|
626
|
-
type: 'success',
|
|
627
|
-
message: '删除成功!'
|
|
628
|
-
})
|
|
629
|
-
},
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* 获取文件类型
|
|
633
|
-
*/
|
|
634
|
-
getFileTypeLabel(type) {
|
|
635
|
-
const t = this.fileTypeList.filter((i) => {
|
|
636
|
-
return Number(type) === Number(i.value)
|
|
637
|
-
})
|
|
638
|
-
if (t.length === 1) {
|
|
639
|
-
return t[0].label
|
|
640
|
-
} else {
|
|
641
|
-
return type
|
|
642
|
-
}
|
|
643
|
-
},
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* 附件上传
|
|
647
|
-
*/
|
|
648
|
-
httpRequest(fileObj) {
|
|
649
|
-
const isLt2M = fileObj.file.size / 1024 / 1024 < 20
|
|
650
|
-
if (!isLt2M) {
|
|
651
|
-
this.$message({
|
|
652
|
-
message: '上传文件大小不能超过 20MB!',
|
|
653
|
-
type: 'warning'
|
|
654
|
-
})
|
|
655
|
-
this.tableData[this.currentUploadIndex].percentage = 75
|
|
656
|
-
this.tableData[this.currentUploadIndex].status = 'exception'
|
|
657
|
-
this.$emit('upload_over', {})
|
|
658
|
-
return
|
|
659
|
-
}
|
|
660
|
-
const that = this
|
|
661
|
-
const formData = new FormData()
|
|
662
|
-
this.tableData[this.currentUploadIndex].fileSize = fileObj.file.size
|
|
663
|
-
// this.tableData[this.currentUploadIndex].fileName = fileObj.file.name
|
|
664
|
-
this.tableData[this.currentUploadIndex].type = fileObj.file.type
|
|
665
|
-
|
|
666
|
-
formData.append('file', fileObj.file)
|
|
667
|
-
axios(`${this.url}/upload`, formData, {
|
|
668
|
-
onUploadProgress: (progressEvent) => {
|
|
669
|
-
let percent = ((progressEvent.loaded / progressEvent.total) * 100) | 0
|
|
670
|
-
// 调用onProgress方法来显示进度条,需要传递个对象 percent为进度值
|
|
671
|
-
that.tableData[this.currentUploadIndex].percentage = percent
|
|
672
|
-
}
|
|
673
|
-
})
|
|
674
|
-
.then((res) => {
|
|
675
|
-
// 上传成功
|
|
676
|
-
// that.tableData[this.currentUploadIndex].percentage = 100
|
|
677
|
-
console.log('上传文件1111', res)
|
|
678
|
-
this.tableData[this.currentUploadIndex].time = parseTime(
|
|
679
|
-
res[0][`time`],
|
|
680
|
-
'{y}-{m}-{d} {h}:{i}:{s}'
|
|
681
|
-
)
|
|
682
|
-
this.tableData[this.currentUploadIndex].uuid = res[0][`uuid`]
|
|
683
|
-
this.tableData[this.currentUploadIndex].status = 'success'
|
|
684
|
-
this.tableData[this.currentUploadIndex].user = res[0][`user`]
|
|
685
|
-
this.tableData[this.currentUploadIndex].creator = res[0][`creator`]
|
|
686
|
-
res[0][`createTime`] = parseTime(
|
|
687
|
-
res[0][`createTime`],
|
|
688
|
-
'{y}-{m}-{d} {h}:{i}:{s}'
|
|
689
|
-
)
|
|
690
|
-
this.tableData[this.currentUploadIndex].createTime =
|
|
691
|
-
res[0][`createTime`]
|
|
692
|
-
this.$emit('upload_over', {})
|
|
693
|
-
})
|
|
694
|
-
.catch(() => {
|
|
695
|
-
// 上传失败
|
|
696
|
-
// this.resetUpload(this.currentUploadIndex)
|
|
697
|
-
that.tableData[this.currentUploadIndex].percentage = 75
|
|
698
|
-
this.tableData[this.currentUploadIndex].status = 'exception'
|
|
699
|
-
this.$emit('upload_over', {})
|
|
700
|
-
})
|
|
701
|
-
// setTimeout(function () {
|
|
702
|
-
// //去调用了这个cancel()方法,没有完成请求的接口便会停止请求
|
|
703
|
-
// self.cancel()
|
|
704
|
-
// }, 1)
|
|
705
|
-
},
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* 文件超出个数限制
|
|
709
|
-
*/
|
|
710
|
-
handleExceed() {
|
|
711
|
-
this.$message({
|
|
712
|
-
type: 'error',
|
|
713
|
-
message: '最多只能选择一个文件'
|
|
714
|
-
})
|
|
715
|
-
},
|
|
716
|
-
|
|
717
|
-
/**
|
|
718
|
-
* 文件变化
|
|
719
|
-
* file, fileList
|
|
720
|
-
*/
|
|
721
|
-
handleChange(file, fileLists, index, row) {
|
|
722
|
-
// if(!row.attachmentName) {
|
|
723
|
-
// this.$message({
|
|
724
|
-
// type: "warning",
|
|
725
|
-
// message: "请先输入附件名称再上传",
|
|
726
|
-
// });
|
|
727
|
-
// return false
|
|
728
|
-
// }
|
|
729
|
-
this.tableData[index].fileObj = file
|
|
730
|
-
this.tableData[index].fileName = file.name
|
|
731
|
-
this.tableData[index].user = ''
|
|
732
|
-
this.tableData[index].percentage = 0
|
|
733
|
-
this.tableData[index].uuid = ''
|
|
734
|
-
if (fileLists.length > 1) {
|
|
735
|
-
fileLists.splice(0, 1)
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
this.tableSelectionData2 = []
|
|
739
|
-
this.tableSelectionData2.push(this.tableData[index])
|
|
740
|
-
this.validFile(index)
|
|
741
|
-
},
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* 获取当前上传的文件的index
|
|
745
|
-
*/
|
|
746
|
-
getUploadIndex(index) {
|
|
747
|
-
this.currentUploadIndex = index
|
|
748
|
-
},
|
|
749
|
-
|
|
750
|
-
strLen(str) {
|
|
751
|
-
let len = 0
|
|
752
|
-
for (let i = 0; i < str.length; i++) {
|
|
753
|
-
let c = str.charCodeAt(i)
|
|
754
|
-
//单字节加1
|
|
755
|
-
if ((c >= 0x0001 && c <= 0x007e) || (c >= 0xff60 && c <= 0xff9f)) {
|
|
756
|
-
len++
|
|
757
|
-
} else {
|
|
758
|
-
len += 3
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
return len
|
|
762
|
-
},
|
|
763
|
-
|
|
764
|
-
/**
|
|
765
|
-
* 校验文件上传
|
|
766
|
-
*/
|
|
767
|
-
validFile(index) {
|
|
768
|
-
// if(this.tableSelectionData.length == 0) {
|
|
769
|
-
// return this.$message.warning('请选择数据')
|
|
770
|
-
// }
|
|
771
|
-
let t = this.tableSelectionData2.filter((item) => {
|
|
772
|
-
// return this.strLen(item.fileName) > 60;
|
|
773
|
-
return item.fileName.length > 60
|
|
774
|
-
})
|
|
775
|
-
if (t.length) {
|
|
776
|
-
this.$message({
|
|
777
|
-
type: 'error',
|
|
778
|
-
message: '文件名不能超过64个字,请重新上传!'
|
|
779
|
-
})
|
|
780
|
-
// this.tableData[index].status = 'exception';
|
|
781
|
-
return null
|
|
782
|
-
}
|
|
783
|
-
let temp = this.tableSelectionData2.filter((item) => {
|
|
784
|
-
const names = item.fileName ? item.fileName.split('.') : []
|
|
785
|
-
let nameType = names.length ? names[names.length - 1] : ''
|
|
786
|
-
return ['exe', 'bin'].includes(nameType)
|
|
787
|
-
})
|
|
788
|
-
if (temp.length) {
|
|
789
|
-
this.$message({
|
|
790
|
-
type: 'error',
|
|
791
|
-
message: '暂不支持 .exe, .bin等格式文件格式上传!'
|
|
792
|
-
})
|
|
793
|
-
this.tableData[index].fileName = ''
|
|
794
|
-
return null
|
|
795
|
-
}
|
|
796
|
-
this.tableData[index].percentage = 50
|
|
797
|
-
this.submitFile()
|
|
798
|
-
},
|
|
799
|
-
|
|
800
|
-
/**
|
|
801
|
-
* 上传文件
|
|
802
|
-
*/
|
|
803
|
-
submitFile() {
|
|
804
|
-
// 获得将要上传的文件
|
|
805
|
-
const uploadFileArr = []
|
|
806
|
-
this.tableSelectionData2.map((item) => {
|
|
807
|
-
// 没有上传文件 并且选择了文件
|
|
808
|
-
if (!item.uuid && item.fileObj) {
|
|
809
|
-
uploadFileArr.push({
|
|
810
|
-
ref_index: this.tableData.findIndex(
|
|
811
|
-
(objitem) => objitem.id === item.id
|
|
812
|
-
),
|
|
813
|
-
data: item
|
|
814
|
-
})
|
|
815
|
-
}
|
|
816
|
-
})
|
|
817
|
-
// 执行
|
|
818
|
-
uploadFileArr.length &&
|
|
819
|
-
this.uploadAction(uploadFileArr).then(() => {
|
|
820
|
-
console.log('上传文件完成')
|
|
821
|
-
})
|
|
822
|
-
},
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* 文件上传动作
|
|
826
|
-
*/
|
|
827
|
-
uploadAction(fileArr) {
|
|
828
|
-
let uploadedLength = 0
|
|
829
|
-
return new Promise((resolve) => {
|
|
830
|
-
// 启动上传
|
|
831
|
-
uploadedLength++
|
|
832
|
-
this.currentUploadIndex = fileArr[0].ref_index
|
|
833
|
-
this.$refs[
|
|
834
|
-
`nstc_g6_common_upload_index_${this.currentUploadIndex}`
|
|
835
|
-
].submit()
|
|
836
|
-
|
|
837
|
-
// 监听上传完毕
|
|
838
|
-
this.$on('upload_over', () => {
|
|
839
|
-
if (uploadedLength === fileArr.length) {
|
|
840
|
-
resolve()
|
|
841
|
-
} else {
|
|
842
|
-
uploadedLength++
|
|
843
|
-
this.currentUploadIndex = fileArr[uploadedLength - 1].ref_index
|
|
844
|
-
this.$refs[
|
|
845
|
-
`nstc_g6_common_upload_index_${this.currentUploadIndex}`
|
|
846
|
-
].submit()
|
|
847
|
-
}
|
|
848
|
-
})
|
|
849
|
-
})
|
|
850
|
-
},
|
|
851
|
-
|
|
852
|
-
/**
|
|
853
|
-
* 重置
|
|
854
|
-
*/
|
|
855
|
-
resetUpload(index) {
|
|
856
|
-
this.$refs[`nstc_upload_index_${index}`].clearFiles()
|
|
857
|
-
this.tableData[index].fileName = ''
|
|
858
|
-
this.tableData[index].fileSize = ''
|
|
859
|
-
this.tableData[index].percentage = 0
|
|
860
|
-
this.tableData[index].fileType = 1
|
|
861
|
-
this.tableData[index].fileFormat = ''
|
|
862
|
-
this.tableData[index].remark = ''
|
|
863
|
-
this.tableData[index].state = '1'
|
|
864
|
-
this.tableData[index].createTime = ''
|
|
865
|
-
this.tableData[index].uuid = ''
|
|
866
|
-
},
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* 发生错误重新上传
|
|
870
|
-
*/
|
|
871
|
-
reUploadAction(index) {
|
|
872
|
-
console.log('附件上传', index)
|
|
873
|
-
// this.tableData[index].percentage = 0;
|
|
874
|
-
// this.tableData[index].percentage = 50;
|
|
875
|
-
this.$refs[`nstc_g6_common_upload_index_${index}`].submit()
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
</script>
|
|
880
|
-
|
|
881
|
-
<style lang="scss">
|
|
882
|
-
.nstc-file-upload {
|
|
883
|
-
.input-upload {
|
|
884
|
-
height: 100%;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
.cell {
|
|
888
|
-
padding: 0 8px !important;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
&-head {
|
|
892
|
-
text-align: right;
|
|
893
|
-
display: flex;
|
|
894
|
-
justify-content: flex-end;
|
|
895
|
-
|
|
896
|
-
.nstc-g6-common-btn-4 {
|
|
897
|
-
// border-color: $--color-danger !important;
|
|
898
|
-
color: #fb5555 !important;
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
&-table {
|
|
903
|
-
margin-top: 12px;
|
|
904
|
-
|
|
905
|
-
.is-success {
|
|
906
|
-
.el-icon-circle-check {
|
|
907
|
-
&:before {
|
|
908
|
-
content: '\e79c';
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
.is-exception {
|
|
914
|
-
.el-icon-circle-close {
|
|
915
|
-
&:before {
|
|
916
|
-
content: '\e79d';
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
th {
|
|
922
|
-
> .cell {
|
|
923
|
-
box-sizing: border-box;
|
|
924
|
-
padding-left: 5px !important;
|
|
925
|
-
text-align: left !important;
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
.el-table-column--selection {
|
|
930
|
-
> .cell {
|
|
931
|
-
text-align: center !important;
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
.input-upload {
|
|
936
|
-
display: flex;
|
|
937
|
-
align-items: center;
|
|
938
|
-
margin-right: 5px;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
&-opt {
|
|
943
|
-
display: flex;
|
|
944
|
-
justify-content: flex-start;
|
|
945
|
-
align-items: center;
|
|
946
|
-
|
|
947
|
-
img {
|
|
948
|
-
margin-right: 10px;
|
|
949
|
-
// &:hover {
|
|
950
|
-
// cursor: pointer;
|
|
951
|
-
// color: $baseColor;
|
|
952
|
-
// }
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
.nstc-el-progress-box {
|
|
957
|
-
width: 200px;
|
|
958
|
-
display: inline-block;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
.nstc-file-reload {
|
|
962
|
-
color: #fb5555;
|
|
963
|
-
cursor: pointer;
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
.nstc-file-cancal {
|
|
967
|
-
color: #007aff;
|
|
968
|
-
cursor: pointer;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
&-input-width {
|
|
972
|
-
max-width: 180px !important;
|
|
973
|
-
|
|
974
|
-
.el-input,
|
|
975
|
-
.el-select {
|
|
976
|
-
max-width: 180px !important;
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
</style>
|
|
981
|
-
<style scoped>
|
|
982
|
-
.nstc-file-upload /deep/ .cell {
|
|
983
|
-
padding: 0 8px 0 16px !important;
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
.nstc-file-upload .el-form-item {
|
|
987
|
-
margin-bottom: 0 !important;
|
|
988
|
-
}
|
|
989
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
功能: 新版UI文件上传
|
|
3
|
+
作者: lihao
|
|
4
|
+
创建时间: 2021-02-19
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<div class="nstc-file-upload">
|
|
8
|
+
<div v-if="pattern !== 'text'" class="nstc-file-upload-head">
|
|
9
|
+
<el-button
|
|
10
|
+
v-if="!views"
|
|
11
|
+
type="primary"
|
|
12
|
+
class="nstc-g6-common-btn-1 nstc-g6-common-btn-size-s"
|
|
13
|
+
:disabled="isDisabled"
|
|
14
|
+
@click="add"
|
|
15
|
+
>
|
|
16
|
+
新增
|
|
17
|
+
</el-button>
|
|
18
|
+
<el-button
|
|
19
|
+
v-if="tableData.length !== 0 && !views"
|
|
20
|
+
class="nstc-g6-common-btn-1 nstc-g6-common-btn-size-s"
|
|
21
|
+
@click="batchDownload"
|
|
22
|
+
>下载
|
|
23
|
+
</el-button>
|
|
24
|
+
<el-button
|
|
25
|
+
v-if="tableData.length !== 0 && !views"
|
|
26
|
+
class="nstc-g6-common-btn-4 nstc-g6-common-btn-size-s"
|
|
27
|
+
:disabled="isDisabled"
|
|
28
|
+
@click="batchDelete"
|
|
29
|
+
>
|
|
30
|
+
删除
|
|
31
|
+
</el-button>
|
|
32
|
+
</div>
|
|
33
|
+
<div v-else class="nstc-file-upload-head">
|
|
34
|
+
<el-button
|
|
35
|
+
v-if="tableData.length !== 0 && !views"
|
|
36
|
+
class="nstc-g6-common-btn-1 nstc-g6-common-btn-size-s"
|
|
37
|
+
@click="batchDownload"
|
|
38
|
+
>下载
|
|
39
|
+
</el-button>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="nstc-file-upload-table">
|
|
42
|
+
<el-form ref="form" :rules="model.rules" :model="model">
|
|
43
|
+
<el-table :data="tableData" @selection-change="handleSelectionChange">
|
|
44
|
+
<el-table-column type="selection" width="50" align="center" />
|
|
45
|
+
<el-table-column label="附件类型" align="left" min-width="180">
|
|
46
|
+
<template slot-scope="scope">
|
|
47
|
+
<!-- !textFlag(scope.row.uuid,scope.row.filePath) -->
|
|
48
|
+
<el-select
|
|
49
|
+
v-if="!textFlag(scope.row.uuid, scope.row.filePath) && !views"
|
|
50
|
+
v-model="scope.row.fileType"
|
|
51
|
+
>
|
|
52
|
+
<el-option
|
|
53
|
+
v-for="(item, index) in fileTypeList"
|
|
54
|
+
:key="index"
|
|
55
|
+
:label="item.label"
|
|
56
|
+
:value="item.value"
|
|
57
|
+
/>
|
|
58
|
+
</el-select>
|
|
59
|
+
<span v-else>{{
|
|
60
|
+
getFileTypeLabel(scope.row.fileType) || '--'
|
|
61
|
+
}}</span>
|
|
62
|
+
</template>
|
|
63
|
+
</el-table-column>
|
|
64
|
+
<el-table-column label="附件名称" align="left" min-width="180">
|
|
65
|
+
<template slot-scope="scope">
|
|
66
|
+
<el-form-item
|
|
67
|
+
v-if="!textFlag(scope.row.uuid, scope.row.filePath) && !views"
|
|
68
|
+
:prop="'tableData.' + scope.$index + '.attachmentName'"
|
|
69
|
+
:rules="model.rules.attachmentName"
|
|
70
|
+
>
|
|
71
|
+
<el-input
|
|
72
|
+
v-model.trim="scope.row.attachmentName"
|
|
73
|
+
placeholder="请输入附件名称"
|
|
74
|
+
clearable
|
|
75
|
+
:maxlength="attachmentMaxlength"
|
|
76
|
+
/>
|
|
77
|
+
</el-form-item>
|
|
78
|
+
|
|
79
|
+
<span v-else>{{ scope.row.attachmentName || '--' }}</span>
|
|
80
|
+
</template>
|
|
81
|
+
</el-table-column>
|
|
82
|
+
<el-table-column label="附件上传" align="left" min-width="180">
|
|
83
|
+
<template slot-scope="scope">
|
|
84
|
+
<el-upload
|
|
85
|
+
v-if="pattern !== 'text' && !views"
|
|
86
|
+
:ref="`nstc_g6_common_upload_index_${scope.$index}`"
|
|
87
|
+
action=""
|
|
88
|
+
v-bind="$attrs"
|
|
89
|
+
:auto-upload="false"
|
|
90
|
+
:before-upload="
|
|
91
|
+
function (file) {
|
|
92
|
+
return beforeUpload(file, scope.row)
|
|
93
|
+
}
|
|
94
|
+
"
|
|
95
|
+
:on-exceed="handleExceed"
|
|
96
|
+
:on-change="
|
|
97
|
+
(file, fileLists) => {
|
|
98
|
+
handleChange(file, fileLists, scope.$index, scope.row)
|
|
99
|
+
}
|
|
100
|
+
"
|
|
101
|
+
:file-list="fileList"
|
|
102
|
+
:show-file-list="false"
|
|
103
|
+
:http-request="httpRequest"
|
|
104
|
+
v-on="$listeners"
|
|
105
|
+
>
|
|
106
|
+
<el-input
|
|
107
|
+
v-model="scope.row.fileName"
|
|
108
|
+
placeholder="请选择附件"
|
|
109
|
+
readonly
|
|
110
|
+
@click="getUploadIndex(scope.$index)"
|
|
111
|
+
>
|
|
112
|
+
<div slot="suffix" class="input-upload">
|
|
113
|
+
<img :src="inputUploadSvg" alt="" />
|
|
114
|
+
</div>
|
|
115
|
+
</el-input>
|
|
116
|
+
</el-upload>
|
|
117
|
+
<span v-else>{{ scope.row.fileName || '--' }}</span>
|
|
118
|
+
</template>
|
|
119
|
+
<el-input />
|
|
120
|
+
</el-table-column>
|
|
121
|
+
<el-table-column
|
|
122
|
+
label="上传时间"
|
|
123
|
+
prop="time"
|
|
124
|
+
align="left"
|
|
125
|
+
width="220px"
|
|
126
|
+
>
|
|
127
|
+
<template slot-scope="scope">
|
|
128
|
+
<span>{{
|
|
129
|
+
(scope.row.time || scope.row.createTime) | parseTimeFormat
|
|
130
|
+
}}</span>
|
|
131
|
+
</template>
|
|
132
|
+
</el-table-column>
|
|
133
|
+
<el-table-column label="上传人" prop="user" align="left">
|
|
134
|
+
<template slot-scope="scope">
|
|
135
|
+
<span>{{ scope.row.user || scope.row.creator }}</span>
|
|
136
|
+
</template>
|
|
137
|
+
</el-table-column>
|
|
138
|
+
<el-table-column
|
|
139
|
+
v-if="pattern !== 'text'"
|
|
140
|
+
label="上传进度"
|
|
141
|
+
align="left"
|
|
142
|
+
width="300px"
|
|
143
|
+
>
|
|
144
|
+
<template slot-scope="scope">
|
|
145
|
+
<div class="nstc-el-progress-box">
|
|
146
|
+
<el-progress
|
|
147
|
+
v-show="showProgress"
|
|
148
|
+
:percentage="
|
|
149
|
+
(scope.row.uuid || scope.row.filePath) &&
|
|
150
|
+
scope.row.status !== 'exception'
|
|
151
|
+
? 100
|
|
152
|
+
: scope.row.percentage
|
|
153
|
+
"
|
|
154
|
+
:status="
|
|
155
|
+
scope.row.uuid || scope.row.filePath
|
|
156
|
+
? 'success'
|
|
157
|
+
: scope.row.status
|
|
158
|
+
"
|
|
159
|
+
:width="100"
|
|
160
|
+
/>
|
|
161
|
+
</div>
|
|
162
|
+
<span
|
|
163
|
+
v-if="scope.row.status === 'exception'"
|
|
164
|
+
class="nstc-file-reload"
|
|
165
|
+
@click="reUploadAction(scope.$index)"
|
|
166
|
+
>重新上传</span
|
|
167
|
+
>
|
|
168
|
+
</template>
|
|
169
|
+
</el-table-column>
|
|
170
|
+
<el-table-column label="操作" align="left" width="100px">
|
|
171
|
+
<template slot-scope="scope">
|
|
172
|
+
<div class="nstc-file-upload-opt">
|
|
173
|
+
<!-- v-if="false" -->
|
|
174
|
+
<!-- -->
|
|
175
|
+
<img
|
|
176
|
+
v-if="showViews"
|
|
177
|
+
:src="lookDiabled"
|
|
178
|
+
alt=""
|
|
179
|
+
@click="lookFile(scope.$index)"
|
|
180
|
+
/>
|
|
181
|
+
<img
|
|
182
|
+
v-if="
|
|
183
|
+
(scope.row.uuid || scope.row.filePath) && pattern === 'text'
|
|
184
|
+
"
|
|
185
|
+
:src="downloadSvg"
|
|
186
|
+
alt=""
|
|
187
|
+
@click="downLoadFile(scope.row)"
|
|
188
|
+
/>
|
|
189
|
+
<!-- <img
|
|
190
|
+
v-if="pattern !== 'text'"
|
|
191
|
+
:src="deleteSvg"
|
|
192
|
+
alt=""
|
|
193
|
+
@click="deleteFile(scope.$index)"
|
|
194
|
+
/> -->
|
|
195
|
+
</div>
|
|
196
|
+
</template>
|
|
197
|
+
</el-table-column>
|
|
198
|
+
</el-table>
|
|
199
|
+
</el-form>
|
|
200
|
+
</div>
|
|
201
|
+
<DialogCustom
|
|
202
|
+
v-model="dialogShowFlag"
|
|
203
|
+
:show-footer="false"
|
|
204
|
+
:title="dialogTitle"
|
|
205
|
+
@confirm="handleConfirm"
|
|
206
|
+
>
|
|
207
|
+
<span>查看文件</span>
|
|
208
|
+
</DialogCustom>
|
|
209
|
+
</div>
|
|
210
|
+
</template>
|
|
211
|
+
|
|
212
|
+
<script>
|
|
213
|
+
import lookSvg from './img/look.svg'
|
|
214
|
+
import lookDiabled from './img/look-diabled.svg'
|
|
215
|
+
import downloadSvg from './img/download.svg'
|
|
216
|
+
import deleteSvg from './img/delete.svg'
|
|
217
|
+
import inputUploadSvg from './img/inputUpload.svg'
|
|
218
|
+
import addFile from './img/addFile.svg'
|
|
219
|
+
import deleteFileSvg from './img/deleteFile.svg'
|
|
220
|
+
import DialogCustom from '../NstcDialog/NstcDialog'
|
|
221
|
+
// fileDownloadGdt
|
|
222
|
+
|
|
223
|
+
import { parseTime } from '../../utils/parseTime'
|
|
224
|
+
import auth from '../../utils/auth'
|
|
225
|
+
import axios from 'axios'
|
|
226
|
+
|
|
227
|
+
export default {
|
|
228
|
+
name: 'NstcFileUpload',
|
|
229
|
+
components: {
|
|
230
|
+
DialogCustom
|
|
231
|
+
},
|
|
232
|
+
filters: {
|
|
233
|
+
parseTimeFormat: function (val) {
|
|
234
|
+
if (val !== '' && val) {
|
|
235
|
+
return parseTime(new Date(val), '{y}-{m}-{d}')
|
|
236
|
+
} else {
|
|
237
|
+
return ''
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
props: {
|
|
242
|
+
attachmentMaxlength: {
|
|
243
|
+
type: String,
|
|
244
|
+
default: '64'
|
|
245
|
+
},
|
|
246
|
+
views: {
|
|
247
|
+
//是否浏览模式
|
|
248
|
+
type: Boolean,
|
|
249
|
+
default: false
|
|
250
|
+
},
|
|
251
|
+
value: {
|
|
252
|
+
type: Array,
|
|
253
|
+
default: () => {
|
|
254
|
+
return []
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
pattern: {
|
|
258
|
+
type: String,
|
|
259
|
+
default: () => {
|
|
260
|
+
return 'normal'
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
url: {
|
|
264
|
+
type: String,
|
|
265
|
+
default: null
|
|
266
|
+
},
|
|
267
|
+
batchDownloadUrl: {
|
|
268
|
+
type: String,
|
|
269
|
+
default: null
|
|
270
|
+
},
|
|
271
|
+
httpMethod: {
|
|
272
|
+
type: String,
|
|
273
|
+
default: 'post'
|
|
274
|
+
},
|
|
275
|
+
showLength: {
|
|
276
|
+
type: Boolean,
|
|
277
|
+
default: true
|
|
278
|
+
},
|
|
279
|
+
isDisabled: {
|
|
280
|
+
type: Boolean,
|
|
281
|
+
default: false
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
data() {
|
|
285
|
+
return {
|
|
286
|
+
lookSvg,
|
|
287
|
+
lookDiabled,
|
|
288
|
+
downloadSvg,
|
|
289
|
+
deleteSvg,
|
|
290
|
+
inputUploadSvg,
|
|
291
|
+
addFile,
|
|
292
|
+
deleteFileSvg,
|
|
293
|
+
showViews: false,
|
|
294
|
+
model: {
|
|
295
|
+
rules: {
|
|
296
|
+
attachmentName: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
required: true,
|
|
299
|
+
message: '必填字段',
|
|
300
|
+
trigger: 'change'
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
tableData: []
|
|
304
|
+
},
|
|
305
|
+
fileList: [],
|
|
306
|
+
tableSelectionData: [],
|
|
307
|
+
tableSelectionData2: [],
|
|
308
|
+
fileTypeList: [{ label: '附件', value: 1 }],
|
|
309
|
+
tempFile: {
|
|
310
|
+
id: '',
|
|
311
|
+
attachmentName: '',
|
|
312
|
+
fileName: '',
|
|
313
|
+
remark: null,
|
|
314
|
+
fileType: 1,
|
|
315
|
+
type: '',
|
|
316
|
+
time: '',
|
|
317
|
+
user: '',
|
|
318
|
+
progress: 0,
|
|
319
|
+
uuid: '',
|
|
320
|
+
status: null,
|
|
321
|
+
fileObj: '',
|
|
322
|
+
percentage: 0
|
|
323
|
+
},
|
|
324
|
+
dialogTitle: '查看',
|
|
325
|
+
dialogShowFlag: false,
|
|
326
|
+
currentUploadIndex: null,
|
|
327
|
+
showProgress: true,
|
|
328
|
+
dialogShowDelete: false,
|
|
329
|
+
dialogDeleteTitle: '提示'
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
computed: {
|
|
333
|
+
tableData: {
|
|
334
|
+
get() {
|
|
335
|
+
this.value.map((item) => {
|
|
336
|
+
item.fileType = item.fileType == '' ? '' : Number(item.fileType)
|
|
337
|
+
item.status == null ? (item.status = 0) : ''
|
|
338
|
+
return item
|
|
339
|
+
})
|
|
340
|
+
this.model.tableData = this.value
|
|
341
|
+
console.log('this.model=====', this.model.tableData)
|
|
342
|
+
return this.value
|
|
343
|
+
},
|
|
344
|
+
set(val) {
|
|
345
|
+
this.$emit('input', val)
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
uploadFlag() {
|
|
349
|
+
return this.tableData.filter((i) => i.uuid).length !== 0
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
beforeUpdate() {
|
|
353
|
+
this.showProgress = false
|
|
354
|
+
},
|
|
355
|
+
updated() {
|
|
356
|
+
setTimeout(() => {
|
|
357
|
+
this.showProgress = true
|
|
358
|
+
}, 1)
|
|
359
|
+
},
|
|
360
|
+
methods: {
|
|
361
|
+
beforeUpload(file, row) {
|
|
362
|
+
console.log(file, row)
|
|
363
|
+
// if(!row.attachmentName) {
|
|
364
|
+
// this.$message({
|
|
365
|
+
// type: "warning",
|
|
366
|
+
// message: "请先输入附件名称再上传",
|
|
367
|
+
// });
|
|
368
|
+
// return false
|
|
369
|
+
// }
|
|
370
|
+
},
|
|
371
|
+
checkValidate() {
|
|
372
|
+
this.$refs['form'].validate((res) => {
|
|
373
|
+
return res
|
|
374
|
+
})
|
|
375
|
+
},
|
|
376
|
+
cancel(i) {
|
|
377
|
+
this.tableData[i].percentage = 0
|
|
378
|
+
console.log('111')
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* 判断当前是不是文档模式
|
|
382
|
+
* 1, pattern 等于 text
|
|
383
|
+
* 2 上传成功
|
|
384
|
+
*/
|
|
385
|
+
textFlag(uuid, filePath) {
|
|
386
|
+
console.log(uuid, filePath)
|
|
387
|
+
if (this.pattern === 'text') {
|
|
388
|
+
return true
|
|
389
|
+
} else {
|
|
390
|
+
return !!uuid || !!filePath
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* 新增文件
|
|
396
|
+
*/
|
|
397
|
+
add() {
|
|
398
|
+
this.tableData.unshift(
|
|
399
|
+
JSON.parse(
|
|
400
|
+
JSON.stringify({
|
|
401
|
+
id: new Date().getTime(),
|
|
402
|
+
attachmentName: '',
|
|
403
|
+
fileName: '',
|
|
404
|
+
remark: null,
|
|
405
|
+
fileType: 1,
|
|
406
|
+
type: '',
|
|
407
|
+
time: '',
|
|
408
|
+
user: '',
|
|
409
|
+
progress: 0,
|
|
410
|
+
uuid: '',
|
|
411
|
+
status: null,
|
|
412
|
+
fileObj: '',
|
|
413
|
+
percentage: 0
|
|
414
|
+
})
|
|
415
|
+
)
|
|
416
|
+
)
|
|
417
|
+
},
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* 表格选择变化
|
|
421
|
+
*/
|
|
422
|
+
handleSelectionChange(data) {
|
|
423
|
+
this.tableSelectionData = data
|
|
424
|
+
},
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* 查看文件
|
|
428
|
+
*/
|
|
429
|
+
lookFile() {
|
|
430
|
+
// this.dialogShowFlag = true;
|
|
431
|
+
},
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* 下载文件
|
|
435
|
+
*/
|
|
436
|
+
downLoadFile(data) {
|
|
437
|
+
console.log(data)
|
|
438
|
+
// const aEl = document.createElement('a')
|
|
439
|
+
let uuid = data.uuid || data.filePath
|
|
440
|
+
const p = encodeURIComponent(uuid)
|
|
441
|
+
const n = encodeURIComponent(data.fileName)
|
|
442
|
+
|
|
443
|
+
axios({
|
|
444
|
+
method: this.httpMethod,
|
|
445
|
+
url: `${this.url}/download/${p}/${n}`,
|
|
446
|
+
// 这里可以在header中加一些东西,比如token
|
|
447
|
+
headers: {
|
|
448
|
+
'Content-Type': 'application/json',
|
|
449
|
+
Authorization: `Bearer ${auth.getCookieToken()}`,
|
|
450
|
+
timestamp: Date.now(),
|
|
451
|
+
OperationDesc: 'yYarJp',
|
|
452
|
+
requestKey: Math.round(Math.random() * 1000000000)
|
|
453
|
+
},
|
|
454
|
+
responseType: 'blob'
|
|
455
|
+
})
|
|
456
|
+
.then((res) => {
|
|
457
|
+
console.log('response: ', res)
|
|
458
|
+
let blob = new Blob([res.data], {
|
|
459
|
+
type: 'application/octet-stream;charset=UTF-8'
|
|
460
|
+
})
|
|
461
|
+
let fileName = decodeURI(
|
|
462
|
+
res.headers['content-disposition'].split(';')[1].split('=')[1]
|
|
463
|
+
)
|
|
464
|
+
if (window.navigator.msSaveBlob) {
|
|
465
|
+
// ie
|
|
466
|
+
window.navigator.msSaveOrOpenBlob(blob, fileName)
|
|
467
|
+
return
|
|
468
|
+
}
|
|
469
|
+
let elink = document.createElement('a')
|
|
470
|
+
elink.style.display = 'none'
|
|
471
|
+
elink.href = window.URL.createObjectURL(blob)
|
|
472
|
+
elink.download = data.fileName
|
|
473
|
+
document.body.appendChild(elink)
|
|
474
|
+
elink.click()
|
|
475
|
+
URL.revokeObjectURL(elink.href)
|
|
476
|
+
document.body.removeChild(elink)
|
|
477
|
+
})
|
|
478
|
+
.catch((error) => {
|
|
479
|
+
console.log('response: ', error)
|
|
480
|
+
})
|
|
481
|
+
},
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* 删除文件
|
|
485
|
+
*/
|
|
486
|
+
deleteFile(index) {
|
|
487
|
+
this.$confirmTip({
|
|
488
|
+
type: 'info',
|
|
489
|
+
title: '确认删除该文件?',
|
|
490
|
+
info: '',
|
|
491
|
+
button: {
|
|
492
|
+
ok: '提交',
|
|
493
|
+
cancel: '取消'
|
|
494
|
+
}
|
|
495
|
+
}).then(() => {
|
|
496
|
+
this.tableData.splice(index, 1)
|
|
497
|
+
this.$message({
|
|
498
|
+
type: 'success',
|
|
499
|
+
message: '删除成功!'
|
|
500
|
+
})
|
|
501
|
+
})
|
|
502
|
+
},
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* 弹框确认事件
|
|
506
|
+
*/
|
|
507
|
+
handleConfirm() {},
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* 批量下载
|
|
511
|
+
*/
|
|
512
|
+
batchDownload() {
|
|
513
|
+
if (this.tableSelectionData.length === 1) {
|
|
514
|
+
// 单条下载
|
|
515
|
+
this.downLoadFile(this.tableSelectionData[0])
|
|
516
|
+
} else if (this.tableSelectionData.length > 1) {
|
|
517
|
+
const files = []
|
|
518
|
+
// 判断是否有文件未上传
|
|
519
|
+
console.log('this.tableSelectionData====', this.tableSelectionData)
|
|
520
|
+
let isNoUpload = this.tableSelectionData.some((item) => {
|
|
521
|
+
!item.uuid == true
|
|
522
|
+
})
|
|
523
|
+
console.log('文件判断=======', isNoUpload)
|
|
524
|
+
if (isNoUpload) {
|
|
525
|
+
// 阻断下载
|
|
526
|
+
this.$message({
|
|
527
|
+
type: 'warning',
|
|
528
|
+
message: '勾选文件中有文件未上传'
|
|
529
|
+
})
|
|
530
|
+
return
|
|
531
|
+
}
|
|
532
|
+
this.tableSelectionData.map((item) => {
|
|
533
|
+
files.push({
|
|
534
|
+
uuid: item.uuid || item.filePath,
|
|
535
|
+
fileName: item.fileName
|
|
536
|
+
})
|
|
537
|
+
})
|
|
538
|
+
|
|
539
|
+
axios({
|
|
540
|
+
url: this.batchDownloadUrl,
|
|
541
|
+
method: 'POST',
|
|
542
|
+
data: JSON.stringify(files),
|
|
543
|
+
headers: {
|
|
544
|
+
'Content-Type': 'application/json',
|
|
545
|
+
Authorization: `Bearer ${auth.getCookieToken()}`,
|
|
546
|
+
timestamp: Date.now(),
|
|
547
|
+
OperationDesc: 'yYarJp',
|
|
548
|
+
requestKey: Math.round(Math.random() * 1000000000)
|
|
549
|
+
},
|
|
550
|
+
responseType: 'blob'
|
|
551
|
+
})
|
|
552
|
+
.then((res) => {
|
|
553
|
+
let blob = new Blob([res.data], {
|
|
554
|
+
type: 'application/octet-stream;charset=UTF-8'
|
|
555
|
+
})
|
|
556
|
+
let fileName = decodeURI(
|
|
557
|
+
res.headers['content-disposition'].split(';')[1].split('=')[1]
|
|
558
|
+
)
|
|
559
|
+
if (window.navigator.msSaveBlob) {
|
|
560
|
+
// ie
|
|
561
|
+
window.navigator.msSaveOrOpenBlob(blob, fileName)
|
|
562
|
+
return
|
|
563
|
+
}
|
|
564
|
+
let elink = document.createElement('a')
|
|
565
|
+
elink.style.display = 'none'
|
|
566
|
+
elink.href = window.URL.createObjectURL(blob)
|
|
567
|
+
elink.download = '批量下载.zip'
|
|
568
|
+
document.body.appendChild(elink)
|
|
569
|
+
elink.click()
|
|
570
|
+
URL.revokeObjectURL(elink.href)
|
|
571
|
+
document.body.removeChild(elink)
|
|
572
|
+
})
|
|
573
|
+
.catch((error) => {
|
|
574
|
+
console.log('response: ', error)
|
|
575
|
+
})
|
|
576
|
+
} else {
|
|
577
|
+
this.$message({
|
|
578
|
+
type: 'warning',
|
|
579
|
+
message: '请选择要下载的附件'
|
|
580
|
+
})
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* 批量删除
|
|
586
|
+
*/
|
|
587
|
+
batchDelete() {
|
|
588
|
+
if (this.tableSelectionData.length !== 0) {
|
|
589
|
+
this.dialogShowDelete = true
|
|
590
|
+
this.$confirmTip({
|
|
591
|
+
type: 'error',
|
|
592
|
+
title: '确认要删除所选附件吗?',
|
|
593
|
+
info: '删除后数据不可恢复',
|
|
594
|
+
button: {
|
|
595
|
+
ok: '提交',
|
|
596
|
+
cancel: '取消'
|
|
597
|
+
}
|
|
598
|
+
}).then(() => {
|
|
599
|
+
this.tableData = this.tableData.filter((i) => {
|
|
600
|
+
return !this.tableSelectionData.includes(i)
|
|
601
|
+
})
|
|
602
|
+
setTimeout(() => {
|
|
603
|
+
this.tableSelectionData = []
|
|
604
|
+
}, 30)
|
|
605
|
+
this.$message({
|
|
606
|
+
type: 'success',
|
|
607
|
+
message: '删除成功!'
|
|
608
|
+
})
|
|
609
|
+
})
|
|
610
|
+
} else {
|
|
611
|
+
this.$message({
|
|
612
|
+
type: 'warning',
|
|
613
|
+
message: '请选择要删除的附件'
|
|
614
|
+
})
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
handleConfirmDelete() {
|
|
618
|
+
this.tableData = this.tableData.filter((i) => {
|
|
619
|
+
return !this.tableSelectionData.includes(i)
|
|
620
|
+
})
|
|
621
|
+
setTimeout(() => {
|
|
622
|
+
this.tableSelectionData = []
|
|
623
|
+
}, 30)
|
|
624
|
+
this.dialogShowDelete = false
|
|
625
|
+
this.$message({
|
|
626
|
+
type: 'success',
|
|
627
|
+
message: '删除成功!'
|
|
628
|
+
})
|
|
629
|
+
},
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* 获取文件类型
|
|
633
|
+
*/
|
|
634
|
+
getFileTypeLabel(type) {
|
|
635
|
+
const t = this.fileTypeList.filter((i) => {
|
|
636
|
+
return Number(type) === Number(i.value)
|
|
637
|
+
})
|
|
638
|
+
if (t.length === 1) {
|
|
639
|
+
return t[0].label
|
|
640
|
+
} else {
|
|
641
|
+
return type
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* 附件上传
|
|
647
|
+
*/
|
|
648
|
+
httpRequest(fileObj) {
|
|
649
|
+
const isLt2M = fileObj.file.size / 1024 / 1024 < 20
|
|
650
|
+
if (!isLt2M) {
|
|
651
|
+
this.$message({
|
|
652
|
+
message: '上传文件大小不能超过 20MB!',
|
|
653
|
+
type: 'warning'
|
|
654
|
+
})
|
|
655
|
+
this.tableData[this.currentUploadIndex].percentage = 75
|
|
656
|
+
this.tableData[this.currentUploadIndex].status = 'exception'
|
|
657
|
+
this.$emit('upload_over', {})
|
|
658
|
+
return
|
|
659
|
+
}
|
|
660
|
+
const that = this
|
|
661
|
+
const formData = new FormData()
|
|
662
|
+
this.tableData[this.currentUploadIndex].fileSize = fileObj.file.size
|
|
663
|
+
// this.tableData[this.currentUploadIndex].fileName = fileObj.file.name
|
|
664
|
+
this.tableData[this.currentUploadIndex].type = fileObj.file.type
|
|
665
|
+
|
|
666
|
+
formData.append('file', fileObj.file)
|
|
667
|
+
axios(`${this.url}/upload`, formData, {
|
|
668
|
+
onUploadProgress: (progressEvent) => {
|
|
669
|
+
let percent = ((progressEvent.loaded / progressEvent.total) * 100) | 0
|
|
670
|
+
// 调用onProgress方法来显示进度条,需要传递个对象 percent为进度值
|
|
671
|
+
that.tableData[this.currentUploadIndex].percentage = percent
|
|
672
|
+
}
|
|
673
|
+
})
|
|
674
|
+
.then((res) => {
|
|
675
|
+
// 上传成功
|
|
676
|
+
// that.tableData[this.currentUploadIndex].percentage = 100
|
|
677
|
+
console.log('上传文件1111', res)
|
|
678
|
+
this.tableData[this.currentUploadIndex].time = parseTime(
|
|
679
|
+
res[0][`time`],
|
|
680
|
+
'{y}-{m}-{d} {h}:{i}:{s}'
|
|
681
|
+
)
|
|
682
|
+
this.tableData[this.currentUploadIndex].uuid = res[0][`uuid`]
|
|
683
|
+
this.tableData[this.currentUploadIndex].status = 'success'
|
|
684
|
+
this.tableData[this.currentUploadIndex].user = res[0][`user`]
|
|
685
|
+
this.tableData[this.currentUploadIndex].creator = res[0][`creator`]
|
|
686
|
+
res[0][`createTime`] = parseTime(
|
|
687
|
+
res[0][`createTime`],
|
|
688
|
+
'{y}-{m}-{d} {h}:{i}:{s}'
|
|
689
|
+
)
|
|
690
|
+
this.tableData[this.currentUploadIndex].createTime =
|
|
691
|
+
res[0][`createTime`]
|
|
692
|
+
this.$emit('upload_over', {})
|
|
693
|
+
})
|
|
694
|
+
.catch(() => {
|
|
695
|
+
// 上传失败
|
|
696
|
+
// this.resetUpload(this.currentUploadIndex)
|
|
697
|
+
that.tableData[this.currentUploadIndex].percentage = 75
|
|
698
|
+
this.tableData[this.currentUploadIndex].status = 'exception'
|
|
699
|
+
this.$emit('upload_over', {})
|
|
700
|
+
})
|
|
701
|
+
// setTimeout(function () {
|
|
702
|
+
// //去调用了这个cancel()方法,没有完成请求的接口便会停止请求
|
|
703
|
+
// self.cancel()
|
|
704
|
+
// }, 1)
|
|
705
|
+
},
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* 文件超出个数限制
|
|
709
|
+
*/
|
|
710
|
+
handleExceed() {
|
|
711
|
+
this.$message({
|
|
712
|
+
type: 'error',
|
|
713
|
+
message: '最多只能选择一个文件'
|
|
714
|
+
})
|
|
715
|
+
},
|
|
716
|
+
|
|
717
|
+
/**
|
|
718
|
+
* 文件变化
|
|
719
|
+
* file, fileList
|
|
720
|
+
*/
|
|
721
|
+
handleChange(file, fileLists, index, row) {
|
|
722
|
+
// if(!row.attachmentName) {
|
|
723
|
+
// this.$message({
|
|
724
|
+
// type: "warning",
|
|
725
|
+
// message: "请先输入附件名称再上传",
|
|
726
|
+
// });
|
|
727
|
+
// return false
|
|
728
|
+
// }
|
|
729
|
+
this.tableData[index].fileObj = file
|
|
730
|
+
this.tableData[index].fileName = file.name
|
|
731
|
+
this.tableData[index].user = ''
|
|
732
|
+
this.tableData[index].percentage = 0
|
|
733
|
+
this.tableData[index].uuid = ''
|
|
734
|
+
if (fileLists.length > 1) {
|
|
735
|
+
fileLists.splice(0, 1)
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
this.tableSelectionData2 = []
|
|
739
|
+
this.tableSelectionData2.push(this.tableData[index])
|
|
740
|
+
this.validFile(index)
|
|
741
|
+
},
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* 获取当前上传的文件的index
|
|
745
|
+
*/
|
|
746
|
+
getUploadIndex(index) {
|
|
747
|
+
this.currentUploadIndex = index
|
|
748
|
+
},
|
|
749
|
+
|
|
750
|
+
strLen(str) {
|
|
751
|
+
let len = 0
|
|
752
|
+
for (let i = 0; i < str.length; i++) {
|
|
753
|
+
let c = str.charCodeAt(i)
|
|
754
|
+
//单字节加1
|
|
755
|
+
if ((c >= 0x0001 && c <= 0x007e) || (c >= 0xff60 && c <= 0xff9f)) {
|
|
756
|
+
len++
|
|
757
|
+
} else {
|
|
758
|
+
len += 3
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return len
|
|
762
|
+
},
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* 校验文件上传
|
|
766
|
+
*/
|
|
767
|
+
validFile(index) {
|
|
768
|
+
// if(this.tableSelectionData.length == 0) {
|
|
769
|
+
// return this.$message.warning('请选择数据')
|
|
770
|
+
// }
|
|
771
|
+
let t = this.tableSelectionData2.filter((item) => {
|
|
772
|
+
// return this.strLen(item.fileName) > 60;
|
|
773
|
+
return item.fileName.length > 60
|
|
774
|
+
})
|
|
775
|
+
if (t.length) {
|
|
776
|
+
this.$message({
|
|
777
|
+
type: 'error',
|
|
778
|
+
message: '文件名不能超过64个字,请重新上传!'
|
|
779
|
+
})
|
|
780
|
+
// this.tableData[index].status = 'exception';
|
|
781
|
+
return null
|
|
782
|
+
}
|
|
783
|
+
let temp = this.tableSelectionData2.filter((item) => {
|
|
784
|
+
const names = item.fileName ? item.fileName.split('.') : []
|
|
785
|
+
let nameType = names.length ? names[names.length - 1] : ''
|
|
786
|
+
return ['exe', 'bin'].includes(nameType)
|
|
787
|
+
})
|
|
788
|
+
if (temp.length) {
|
|
789
|
+
this.$message({
|
|
790
|
+
type: 'error',
|
|
791
|
+
message: '暂不支持 .exe, .bin等格式文件格式上传!'
|
|
792
|
+
})
|
|
793
|
+
this.tableData[index].fileName = ''
|
|
794
|
+
return null
|
|
795
|
+
}
|
|
796
|
+
this.tableData[index].percentage = 50
|
|
797
|
+
this.submitFile()
|
|
798
|
+
},
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* 上传文件
|
|
802
|
+
*/
|
|
803
|
+
submitFile() {
|
|
804
|
+
// 获得将要上传的文件
|
|
805
|
+
const uploadFileArr = []
|
|
806
|
+
this.tableSelectionData2.map((item) => {
|
|
807
|
+
// 没有上传文件 并且选择了文件
|
|
808
|
+
if (!item.uuid && item.fileObj) {
|
|
809
|
+
uploadFileArr.push({
|
|
810
|
+
ref_index: this.tableData.findIndex(
|
|
811
|
+
(objitem) => objitem.id === item.id
|
|
812
|
+
),
|
|
813
|
+
data: item
|
|
814
|
+
})
|
|
815
|
+
}
|
|
816
|
+
})
|
|
817
|
+
// 执行
|
|
818
|
+
uploadFileArr.length &&
|
|
819
|
+
this.uploadAction(uploadFileArr).then(() => {
|
|
820
|
+
console.log('上传文件完成')
|
|
821
|
+
})
|
|
822
|
+
},
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* 文件上传动作
|
|
826
|
+
*/
|
|
827
|
+
uploadAction(fileArr) {
|
|
828
|
+
let uploadedLength = 0
|
|
829
|
+
return new Promise((resolve) => {
|
|
830
|
+
// 启动上传
|
|
831
|
+
uploadedLength++
|
|
832
|
+
this.currentUploadIndex = fileArr[0].ref_index
|
|
833
|
+
this.$refs[
|
|
834
|
+
`nstc_g6_common_upload_index_${this.currentUploadIndex}`
|
|
835
|
+
].submit()
|
|
836
|
+
|
|
837
|
+
// 监听上传完毕
|
|
838
|
+
this.$on('upload_over', () => {
|
|
839
|
+
if (uploadedLength === fileArr.length) {
|
|
840
|
+
resolve()
|
|
841
|
+
} else {
|
|
842
|
+
uploadedLength++
|
|
843
|
+
this.currentUploadIndex = fileArr[uploadedLength - 1].ref_index
|
|
844
|
+
this.$refs[
|
|
845
|
+
`nstc_g6_common_upload_index_${this.currentUploadIndex}`
|
|
846
|
+
].submit()
|
|
847
|
+
}
|
|
848
|
+
})
|
|
849
|
+
})
|
|
850
|
+
},
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* 重置
|
|
854
|
+
*/
|
|
855
|
+
resetUpload(index) {
|
|
856
|
+
this.$refs[`nstc_upload_index_${index}`].clearFiles()
|
|
857
|
+
this.tableData[index].fileName = ''
|
|
858
|
+
this.tableData[index].fileSize = ''
|
|
859
|
+
this.tableData[index].percentage = 0
|
|
860
|
+
this.tableData[index].fileType = 1
|
|
861
|
+
this.tableData[index].fileFormat = ''
|
|
862
|
+
this.tableData[index].remark = ''
|
|
863
|
+
this.tableData[index].state = '1'
|
|
864
|
+
this.tableData[index].createTime = ''
|
|
865
|
+
this.tableData[index].uuid = ''
|
|
866
|
+
},
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* 发生错误重新上传
|
|
870
|
+
*/
|
|
871
|
+
reUploadAction(index) {
|
|
872
|
+
console.log('附件上传', index)
|
|
873
|
+
// this.tableData[index].percentage = 0;
|
|
874
|
+
// this.tableData[index].percentage = 50;
|
|
875
|
+
this.$refs[`nstc_g6_common_upload_index_${index}`].submit()
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
</script>
|
|
880
|
+
|
|
881
|
+
<style lang="scss">
|
|
882
|
+
.nstc-file-upload {
|
|
883
|
+
.input-upload {
|
|
884
|
+
height: 100%;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.cell {
|
|
888
|
+
padding: 0 8px !important;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
&-head {
|
|
892
|
+
text-align: right;
|
|
893
|
+
display: flex;
|
|
894
|
+
justify-content: flex-end;
|
|
895
|
+
|
|
896
|
+
.nstc-g6-common-btn-4 {
|
|
897
|
+
// border-color: $--color-danger !important;
|
|
898
|
+
color: #fb5555 !important;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
&-table {
|
|
903
|
+
margin-top: 12px;
|
|
904
|
+
|
|
905
|
+
.is-success {
|
|
906
|
+
.el-icon-circle-check {
|
|
907
|
+
&:before {
|
|
908
|
+
content: '\e79c';
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
.is-exception {
|
|
914
|
+
.el-icon-circle-close {
|
|
915
|
+
&:before {
|
|
916
|
+
content: '\e79d';
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
th {
|
|
922
|
+
> .cell {
|
|
923
|
+
box-sizing: border-box;
|
|
924
|
+
padding-left: 5px !important;
|
|
925
|
+
text-align: left !important;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.el-table-column--selection {
|
|
930
|
+
> .cell {
|
|
931
|
+
text-align: center !important;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.input-upload {
|
|
936
|
+
display: flex;
|
|
937
|
+
align-items: center;
|
|
938
|
+
margin-right: 5px;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
&-opt {
|
|
943
|
+
display: flex;
|
|
944
|
+
justify-content: flex-start;
|
|
945
|
+
align-items: center;
|
|
946
|
+
|
|
947
|
+
img {
|
|
948
|
+
margin-right: 10px;
|
|
949
|
+
// &:hover {
|
|
950
|
+
// cursor: pointer;
|
|
951
|
+
// color: $baseColor;
|
|
952
|
+
// }
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
.nstc-el-progress-box {
|
|
957
|
+
width: 200px;
|
|
958
|
+
display: inline-block;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.nstc-file-reload {
|
|
962
|
+
color: #fb5555;
|
|
963
|
+
cursor: pointer;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.nstc-file-cancal {
|
|
967
|
+
color: #007aff;
|
|
968
|
+
cursor: pointer;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
&-input-width {
|
|
972
|
+
max-width: 180px !important;
|
|
973
|
+
|
|
974
|
+
.el-input,
|
|
975
|
+
.el-select {
|
|
976
|
+
max-width: 180px !important;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
</style>
|
|
981
|
+
<style scoped>
|
|
982
|
+
.nstc-file-upload /deep/ .cell {
|
|
983
|
+
padding: 0 8px 0 16px !important;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
.nstc-file-upload .el-form-item {
|
|
987
|
+
margin-bottom: 0 !important;
|
|
988
|
+
}
|
|
989
|
+
</style>
|