农经大屏
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.

51 lines
1.1 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 { analysisOfContractTypes } 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. methods: {
  35. getData () {
  36. this.isLoad = false // 是否加载完成
  37. if (this.year, this.deptId) {
  38. analysisOfContractTypes(this.deptId, this.year).then(res => {
  39. this.data[0][0].value = res.data.numHt
  40. this.data[0][1].value = res.data.zhte
  41. this.data[1][0].value = res.data.yjk
  42. this.data[1][1].value = res.data.djk
  43. this.isLoad = true // 是否加载完成
  44. })
  45. }
  46. }
  47. }
  48. };