import Pannel from '@/components/pannel/index.vue';
import BarSpecial from '@/components/charts/bar-special/index.vue';
import { mapGetters } from 'vuex';
import { distributionOfLiabilities } from '../../../../api/index.js';
export default {
  components: {
    BarSpecial,
    Pannel
  },
  data () {
    return {
    };
  },
  computed: {
    ...mapGetters(['year', 'deptId'])
  },
  watch: {
    year: {
      handler () {
        this.getData();
      },
      immediate: true, // 立即执行
    },
    deptId: {
      handler () {
        this.getData();
      },
      immediate: true, // 立即执行
    }
  },
  methods: {
    getData () {
      if (this.year, this.deptId) {
        this.isLoad = false;
        distributionOfLiabilities(this.deptId, this.year).then(res => {
          this.isLoad = true;
        })
      }
    },
  }
};
