diff --git a/src/config/router.config.js b/src/config/router.config.js index b88eaab..c460919 100644 --- a/src/config/router.config.js +++ b/src/config/router.config.js @@ -31,7 +31,7 @@ export const asyncRouterMap = [{ component: () => import('@/views/home/Index'), meta: { title: '数据看板', - keepAlive: true, + keepAlive: false, icon: 'user', permission: ['home'] } diff --git a/src/views/home/Index.vue b/src/views/home/Index.vue index 2b372c7..ff67183 100644 --- a/src/views/home/Index.vue +++ b/src/views/home/Index.vue @@ -3,16 +3,15 @@ - --> - - - 首页展示。。 - + diff --git a/src/views/home/components/Analysis.vue b/src/views/home/components/Analysis.vue index 3c9974e..4932929 100644 --- a/src/views/home/components/Analysis.vue +++ b/src/views/home/components/Analysis.vue @@ -2,7 +2,7 @@
- +
@@ -14,19 +14,25 @@ 当周 + + 当月 + + + 当年 +
- 当周 - 当日 + 当日 + 当周 当月 - + 当年
-

副标题

+
@@ -111,12 +117,10 @@ for (let i = 0; i < 50; i += 1) { const DataSet = require('@antv/data-set') const sourceData = [ - { item: '家用电器', count: 32.2 }, - { item: '食用酒水', count: 21 }, - { item: '个护健康', count: 17 }, - { item: '服饰箱包', count: 13 }, - { item: '母婴产品', count: 9 }, - { item: '其他', count: 7.8 } + { item: '代理进货金额', count: 32.2 }, + { item: '创客进货金额', count: 21 }, + { item: '线上销售金额', count: 17 }, + { item: '线下销售金额', count: 13 } ] const pieScale = [{ diff --git a/src/views/home/components/Count.vue b/src/views/home/components/Count.vue index b039d23..475f10b 100644 --- a/src/views/home/components/Count.vue +++ b/src/views/home/components/Count.vue @@ -1,54 +1,48 @@ @@ -197,14 +217,34 @@ export default { }, name: 'Count', data: () => ({ - loading: false + visible: false, + loading: false, + type: 'today', + typeIndex: 0, + searchs: [ + { key: 'today', title: '本日' }, + { key: 'week', title: '本周' }, + { key: 'month', title: '本月' }, + { key: 'year', title: '本年' } + ] }), - beforeCreate () {}, - methods: {} + beforeCreate () { + console.log('beforeCreate.......') + }, + methods: { + handleMenuClick (e) { + this.typeIndex = this.searchs.findIndex(item => item.key === e.key) + console.log(e.key) + this.visible = false + this.type = e.key + } + } } diff --git a/src/views/permissions/Index.vue b/src/views/permissions/Index.vue index c341ebc..c98114b 100644 --- a/src/views/permissions/Index.vue +++ b/src/views/permissions/Index.vue @@ -199,10 +199,11 @@ export default { methods: { // 获取当前用户的组织 staffDeparts () { + this.loading = true staffDeparts().then(res => { console.log(res) - this.loading = true this.promissions = res + this.loading = true if (res.length > 0) { this.departs = [{ key: '', title: '全部角色' }, ...res[0].departs] }