农经大屏
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.2 KiB

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