|
@@ -1,8 +1,30 @@
|
|
|
import axios from "@/utils/axios";
|
|
|
+import {showModal} from '@/utils/model/progress/index'
|
|
|
// 新系统文件新接口
|
|
|
export default {
|
|
|
- uploadFile(data){
|
|
|
- return axios.post('/fileManager/uploadNormalFile', data)
|
|
|
+ uploadFile(data,uploadProgress){
|
|
|
+ let ProgressModalControl = null
|
|
|
+ return axios.post('/fileManager/uploadNormalFile', data,{
|
|
|
+ onUploadProgress: progressEvent => {
|
|
|
+ if (progressEvent.total) {
|
|
|
+ const percent = Math.round((progressEvent.loaded * 100) / progressEvent.total);
|
|
|
+ if (typeof uploadProgress === 'function') {
|
|
|
+ uploadProgress(percent);
|
|
|
+ }else{
|
|
|
+ if(percent == 0){
|
|
|
+ ProgressModalControl = showModal()
|
|
|
+ }
|
|
|
+ if(ProgressModalControl){
|
|
|
+ ProgressModalControl.update(percent)
|
|
|
+ if(percent == 100){
|
|
|
+ ProgressModalControl.hide()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
downLoadFile(params, prop = {}) {
|
|
|
return axios.get('/fileManager/downloadFile', {params},prop)
|