|
|
@@ -1,15 +1,34 @@ |
|
|
|
import Pannel from '@/components/pannel/index.vue'; |
|
|
|
import PannelTabs from '@/components/pannel-tabs/index.vue'; |
|
|
|
import Bar from '@/components/charts/bar/index.vue'; |
|
|
|
|
|
|
|
import { resourceTypeAnalysis } from '../../../../api/index.js' |
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
Bar, |
|
|
|
PannelTabs, |
|
|
|
Pannel |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters(['year', 'deptId']) |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
year: { |
|
|
|
handler () { |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
immediate: true, // 立即执行 |
|
|
|
}, |
|
|
|
deptId: { |
|
|
|
handler () { |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
immediate: true, // 立即执行 |
|
|
|
} |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
|
isLoad: false, |
|
|
|
pannelTabData: [ |
|
|
|
{ |
|
|
|
id: '1', |
|
|
@@ -24,16 +43,31 @@ export default { |
|
|
|
name: '未利用地' |
|
|
|
} |
|
|
|
], |
|
|
|
data: [], |
|
|
|
tabIndex: '1' |
|
|
|
}; |
|
|
|
}, |
|
|
|
created () { |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getData () { |
|
|
|
if (this.year, this.deptId) { |
|
|
|
this.isLoad = false; |
|
|
|
resourceTypeAnalysis(this.deptId, this.year).then(res => { |
|
|
|
if (this.tabIndex == 1) { |
|
|
|
this.data = res.data.nyd |
|
|
|
|
|
|
|
} else if (this.tabIndex == 2) { |
|
|
|
this.data = res.data.jsyd |
|
|
|
|
|
|
|
} else if (this.tabIndex == 3) { |
|
|
|
this.data = res.data.wlydjlm |
|
|
|
} |
|
|
|
this.isLoad = true; |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
tabChange (info) { |
|
|
|
this.tabIndex = info.id |
|
|
|
this.getData(); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |