|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import Pannel from '@/components/pannel/index.vue';
- import Bar from '@/components/charts/bar/index.vue';
- import { mapGetters } from 'vuex';
- import { analysisOfLargeFundExpenditureWarning } from '../../../../api/index.js';
- export default {
- components: {
- Bar,
- Pannel
- },
- computed: {
- ...mapGetters(['year', 'deptId'])
- },
- watch: {
- year: {
- handler () {
- this.getData();
- },
- immediate: true, // 立即执行
- },
- deptId: {
- handler () {
- this.getData();
- },
- immediate: true, // 立即执行
- }
- },
- data () {
- return {
- isLoad: false,
- data: []
- };
- },
- created () {
- },
- mounted () {
- },
- methods: {
- getData () {
- if (this.year, this.deptId) {
- this.isLoad = false;
- analysisOfLargeFundExpenditureWarning(this.deptId, this.year).then(res => {
- let arr = res.data.map(item => {
- return {
- name: item.name,
- value: item.value
- }
- })
- this.data = arr;
- this.isLoad = true;
- })
- }
- }
- }
- };
|