农经大屏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 1.1 KiB

1 maand geleden
1 maand geleden
1 maand geleden
1 maand geleden
1 maand geleden
1 maand geleden
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import Pannel from '@/components/pannel/index.vue';
  2. import Bar from '@/components/charts/bar/index.vue';
  3. import { mapGetters } from 'vuex';
  4. import { analysisOfLargeFundExpenditureWarning } from '../../../../api/index.js';
  5. export default {
  6. components: {
  7. Bar,
  8. Pannel
  9. },
  10. computed: {
  11. ...mapGetters(['year', 'deptId'])
  12. },
  13. watch: {
  14. year: {
  15. handler () {
  16. this.getData();
  17. },
  18. immediate: true, // 立即执行
  19. },
  20. deptId: {
  21. handler () {
  22. this.getData();
  23. },
  24. immediate: true, // 立即执行
  25. }
  26. },
  27. data () {
  28. return {
  29. isLoad: false,
  30. data: []
  31. };
  32. },
  33. created () {
  34. },
  35. mounted () {
  36. },
  37. methods: {
  38. getData () {
  39. if (this.year, this.deptId) {
  40. this.isLoad = false;
  41. analysisOfLargeFundExpenditureWarning(this.deptId, this.year).then(res => {
  42. let arr = res.data.map(item => {
  43. return {
  44. name: item.name,
  45. value: item.value
  46. }
  47. })
  48. this.data = arr;
  49. this.isLoad = true;
  50. })
  51. }
  52. }
  53. }
  54. };