上传文件管理增加统计

This commit is contained in:
gooking 2018-05-19 07:27:36 +08:00
parent c3203e89d7
commit 38e8adb4e3
5 changed files with 39 additions and 6 deletions

View File

@ -1,5 +1,6 @@
const getters = {
sidebar: state => state.app.sidebar,
device: state => state.app.device
device: state => state.app.device,
centerUserBase: state => state.other.centerUserBase
}
export default getters

View File

@ -1,13 +1,15 @@
import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import other from './modules/other'
import getters from './getters'
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
app
app,
other
},
getters
})

View File

@ -0,0 +1,15 @@
const user = {
state: {
centerUserBase: { }
},
mutations: {
SET_CENTER_USER_BASE: (state, centerUserBase) => {
state.centerUserBase = centerUserBase
}
}
}
export default user

View File

@ -15,6 +15,13 @@
<el-date-picker type="date" placeholder="上传时间止" v-model="searchData.dateAddEnd" style="width: 200px;" class="filter-item"></el-date-picker>
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="fetchData">搜索</el-button>
</div>
<div class="filter-container">
<el-alert
:title="'您当前是:' + (centerUserBase.vipLevel ? 'vip会员' : '免费会员') + ', ' + '可使用 ' + (centerUserBase.vipLevel ? '500' : '100') + 'MB 免费存储空间, 当前文件总数: '+ statisticsData.count +' 占用总容量: ' + statisticsData.capacityStr"
type="warning">
</el-alert>
</div>
<el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row empty-text="暂无数据" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55" row-key="id"></el-table-column>
@ -49,8 +56,14 @@
<script>
import { fetchDataList, statistics, delData } from '@/api/apiExtDfs'
import { Message, MessageBox } from 'element-ui'
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'centerUserBase'
])
},
data() {
return {
page:1,

View File

@ -4,7 +4,7 @@
<breadcrumb></breadcrumb>
<el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper">
<span style="display:block;">当前登录: {{centeruserinfo.realName}} ( {{centeruserinfo.mobile}} )</span>
<span style="display:block;">{{centerUserBase.realName}} ( {{centerUserBase.mobile}} )</span>
<i class="el-icon-caret-bottom"></i>
</div>
<el-dropdown-menu class="user-dropdown" slot="dropdown">
@ -38,17 +38,19 @@ export default {
computed: {
...mapGetters([
'sidebar',
'avatar'
'avatar',
'centerUserBase'
])
},
data() {
return {
centeruserinfo:{}
}
},
mounted() {
this.centerUserBase.aaa = 'ssddfssfg0000'
info().then(res => {
this.centeruserinfo = res.data;
this.$store.commit('SET_CENTER_USER_BASE',res.data)
});
},
methods: {