|
@@ -45,6 +45,7 @@
|
|
import { mapState, mapMutations } from 'vuex'
|
|
import { mapState, mapMutations } from 'vuex'
|
|
import { PROGRESS_BG_COLOR } from './constant'
|
|
import { PROGRESS_BG_COLOR } from './constant'
|
|
import FileController from '@/controller/fileController'
|
|
import FileController from '@/controller/fileController'
|
|
|
|
+import { logicConfig } from "@/logicConfig";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
|
|
|
|
@@ -58,15 +59,15 @@ export default {
|
|
PROGRESS_BG_COLOR,
|
|
PROGRESS_BG_COLOR,
|
|
synced: 0,
|
|
synced: 0,
|
|
isHasError: false, //上传是否出现错误
|
|
isHasError: false, //上传是否出现错误
|
|
- uploadSuccessList: [],
|
|
|
|
|
|
+ // uploadSuccessList: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
async uploadVisible(nv, ov) {
|
|
async uploadVisible(nv, ov) {
|
|
const that = this;
|
|
const that = this;
|
|
this.synced = 0
|
|
this.synced = 0
|
|
|
|
+ const successList = [];
|
|
if (nv) {
|
|
if (nv) {
|
|
-
|
|
|
|
this.uploading = true
|
|
this.uploading = true
|
|
const res = await FileController.uploadFiles({
|
|
const res = await FileController.uploadFiles({
|
|
uploadProgressCall(_obj) {
|
|
uploadProgressCall(_obj) {
|
|
@@ -75,23 +76,22 @@ export default {
|
|
oneUploadedCall(_obj) {
|
|
oneUploadedCall(_obj) {
|
|
that.synced += 1
|
|
that.synced += 1
|
|
that.percentage = (that.synced / that.fileList?.length) * 100;
|
|
that.percentage = (that.synced / that.fileList?.length) * 100;
|
|
- if(that.percentage === 100) {
|
|
|
|
- that.uploading = false
|
|
|
|
- }
|
|
|
|
- that.uploadSuccessList.push(_obj)
|
|
|
|
|
|
+ successList.push(_obj)
|
|
|
|
+
|
|
},
|
|
},
|
|
files: that.fileList
|
|
files: that.fileList
|
|
});
|
|
});
|
|
- }
|
|
|
|
- },
|
|
|
|
- uploading(nv, ov) {
|
|
|
|
- if(!nv){
|
|
|
|
- this.updata({successList: this.uploadSuccessList})
|
|
|
|
|
|
+ if(res.result === logicConfig.resultObj.success) {
|
|
|
|
+ this.updata({successList})
|
|
|
|
+ }
|
|
|
|
+ this.uploading = false;
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapState('uploadFile', ['uploadVisible', 'fileList'])
|
|
|
|
|
|
+ ...mapState('uploadFile', ['uploadVisible', 'fileList', "successList"])
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|