This commit is contained in:
yanran200730
2022-10-10 11:07:23 +08:00
parent 90fed1bae2
commit 8f73ddb063
3 changed files with 18 additions and 20 deletions

View File

@@ -93,7 +93,6 @@
</template>
<script>
import { mapState } from 'vuex'
import * as echarts from 'echarts'
export default {
name: 'Statistics',
@@ -126,10 +125,6 @@
}
},
computed: {
...mapState(['user'])
},
watch: {
unitName (val) {
this.$refs.tree.filter(val)
@@ -137,20 +132,20 @@
},
mounted () {
this.areaId = this.user.info.areaId
this.areaName = this.user.info.areaName
this.endTime = this.$moment().format('YYYY-MM-DD')
this.beginTime = this.$moment(new Date().getTime() - 7 * 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
this.getTree()
this.loading = true
this.$nextTick(() => {
this.chart1 = echarts.init(document.querySelector('.chart1'))
this.chart2 = echarts.init(document.querySelector('.chart2'))
window.addEventListener('resize', this.onResize)
this.dict.load('sex').then(() => {
this.getInfo()
})
this.getInfo()
})
this.instance.post(`/app/appdvcpconfig/getCorpArea`).then(res => {
if (res.code == 0) {
this.areaId = res.data
this.getTree(res.data)
}
})
},
@@ -165,7 +160,6 @@
onTreeChange (e) {
this.areaId = e.id
this.areaName = e.name
this.$nextTick(() => {
this.getInfo()
@@ -177,8 +171,8 @@
return data.name.indexOf(value) !== -1
},
getTree () {
this.instance.post(`/admin/area/queryAllArea?id=${this.user.info.areaId}`).then(res => {
getTree (areaId) {
this.instance.post(`/admin/area/queryAllArea?id=${areaId}`).then(res => {
if (res.code === 0) {
let parent = res.data.map(v => {
v.label = v.name