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'
import 'echarts/map/js/world'
import 'zrender/lib/svg/svg'
import { listAllShop } from '@/api/sysUnit'
import { statistics } from '@/api/dashboard'
export default {
name: 'dashboard',
......@@ -222,9 +223,11 @@ export default {
'deptId'
])
},
created() {
async created() {
this.fetchData()
this.getDeptList()
await this.getDeptList()
this.roleFunction()
this.getTableData()
},
mounted() {
// 绑定echart图表跟随窗口大小自动缩放
......@@ -238,13 +241,15 @@ export default {
},
methods: {
getDeptList() {
listAllShop().then(res => {
if (res.code === 200) {
this.deptList = res.data
this.company = this.deptList[0].businessId
this.companyName = this.deptList[0].unitName
this.roleFunction()
}
return new Promise(resolve => {
listAllShop().then(res => {
if (res.code === 200) {
this.deptList = res.data
this.company = this.deptList[0].businessId
this.companyName = this.deptList[0].unitName
resolve()
}
})
})
},
fetchData() {
......@@ -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