Commit fe00ad4f authored by 刘怀志's avatar 刘怀志

banner暂存

parent 0ea16ebb
import request from '@/utils/request'
import Qs from 'qs'
export function statistics(query) {
return request({
url: '/sysunit/statistics',
method: 'get',
params: query
})
}
...@@ -17,6 +17,7 @@ import 'echarts/lib/component/dataset' ...@@ -17,6 +17,7 @@ import 'echarts/lib/component/dataset'
import 'echarts/map/js/world' import 'echarts/map/js/world'
import 'zrender/lib/svg/svg' import 'zrender/lib/svg/svg'
import { listAllShop } from '@/api/sysUnit' import { listAllShop } from '@/api/sysUnit'
import { statistics } from '@/api/dashboard'
export default { export default {
name: 'dashboard', name: 'dashboard',
...@@ -222,9 +223,11 @@ export default { ...@@ -222,9 +223,11 @@ export default {
'deptId' 'deptId'
]) ])
}, },
created() { async created() {
this.fetchData() this.fetchData()
this.getDeptList() await this.getDeptList()
this.roleFunction()
this.getTableData()
}, },
mounted() { mounted() {
// 绑定echart图表跟随窗口大小自动缩放 // 绑定echart图表跟随窗口大小自动缩放
...@@ -238,14 +241,16 @@ export default { ...@@ -238,14 +241,16 @@ export default {
}, },
methods: { methods: {
getDeptList() { getDeptList() {
return new Promise(resolve => {
listAllShop().then(res => { listAllShop().then(res => {
if (res.code === 200) { if (res.code === 200) {
this.deptList = res.data this.deptList = res.data
this.company = this.deptList[0].businessId this.company = this.deptList[0].businessId
this.companyName = this.deptList[0].unitName this.companyName = this.deptList[0].unitName
this.roleFunction() resolve()
} }
}) })
})
}, },
fetchData() { fetchData() {
}, },
...@@ -260,6 +265,11 @@ export default { ...@@ -260,6 +265,11 @@ export default {
} }
}) })
} }
},
getTableData() {
statistics({ businessId: this.company }).then(res => {
console.log('getTableData', res)
})
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment