refactor: uploading counters vuex state
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
import * as i18n from '@/i18n'
|
||||
import moment from 'moment'
|
||||
|
||||
@@ -83,8 +84,27 @@ const mutations = {
|
||||
state.clipboard.key = ''
|
||||
state.clipboard.items = []
|
||||
},
|
||||
setProgress: (state, value) => {
|
||||
state.progress = value
|
||||
|
||||
uploadingIncrementId: (state) => {
|
||||
state.uploading.id = state.uploading.id + 1
|
||||
},
|
||||
uploadingIncrementSize: (state, value) => {
|
||||
state.uploading.size = state.uploading.size + value
|
||||
},
|
||||
uploadingIncrementCount: (state) => {
|
||||
state.uploading.count = state.uploading.count + 1
|
||||
},
|
||||
uploadingDecreaseCount: (state) => {
|
||||
state.uploading.count = state.uploading.count - 1
|
||||
},
|
||||
uploadigSetProgress(state, { id, loaded }) {
|
||||
Vue.set(state.uploading.progress, id, loaded)
|
||||
},
|
||||
uploadingReset: (state) => {
|
||||
state.uploading.id = 0
|
||||
state.uploading.size = 0
|
||||
state.uploading.count = 0
|
||||
state.uploading.progress = []
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user