农经大屏
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

index.js 3.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import Header from '@/components/headerNew/index.vue';
  2. import Footer from '@/components/footer/index.vue';
  3. import Left from '@/components/left/index.vue';
  4. import Right from '@/components/right/index.vue';
  5. import Tabs from '@/components/tabs/index.vue';
  6. import Left11 from './comps/left/top/1/index.vue';
  7. import Left21 from './comps/left/middle/1/index.vue';
  8. import Left31 from './comps/left/bottom/1/index.vue';
  9. import Right11 from './comps/right/top/1/index.vue';
  10. import Right21 from './comps/right/middle/1/index.vue';
  11. import Right31 from './comps/right/bottom/1/index.vue';
  12. import Bottom1 from './comps/buttom/1/index.vue';
  13. import Bottom2 from './comps/buttom/2/index.vue';
  14. import Popover from './popover/index.vue';
  15. import MainGis from './main-gis/index.vue';
  16. import { comps } from './data.js'
  17. import { getStatistic } from "@/api/index";
  18. import { getInfo } from "@/api/login";
  19. import {mapGetters} from "vuex";
  20. export default {
  21. components: {
  22. MainGis,
  23. Header,
  24. Footer,
  25. Left,
  26. Right,
  27. Tabs,
  28. Left11,
  29. Left21,
  30. Left31,
  31. Right11,
  32. Right21,
  33. Right31,
  34. Popover,
  35. Bottom2,
  36. Bottom1
  37. },
  38. data () {
  39. return {
  40. comps,
  41. tab: '1',
  42. allData: {},
  43. deptIdPage:100
  44. };
  45. },
  46. watch: {
  47. // year: {
  48. // handler () {
  49. // this.getData(this.deptIdPage);
  50. // },
  51. // immediate: true, // 立即执行
  52. // },
  53. // deptId: {
  54. // handler () {
  55. // this.getData(this.deptIdPage);
  56. // },
  57. // immediate: true, // 立即执行
  58. // }
  59. },
  60. computed: {
  61. ...mapGetters(['year', 'deptId']),
  62. currentComp: function () {
  63. return this.comps[this.tab]
  64. }
  65. },
  66. created () {
  67. getInfo().then(res => {
  68. this.deptIdPage = res.user.deptId;
  69. this.getData(res.user.deptId);
  70. })
  71. },
  72. mounted () {
  73. },
  74. methods: {
  75. getData(deptId){
  76. this.currentComp.right[0].data = [];
  77. this.currentComp.right[1].data = [];
  78. this.currentComp.right[2].data = [];
  79. this.currentComp.left[0].data = [];
  80. this.currentComp.left[1].data = [];
  81. this.currentComp.left[2].data = [];
  82. getStatistic({deptId: deptId}).then((response) => {
  83. response.data.jtzyzcDeptList.map(rr => {
  84. this.currentComp.right[0].data.push({
  85. name: rr.deptName,
  86. value: rr.ydmj
  87. })
  88. })
  89. response.data.nysssbDeptList.map(rr => {
  90. this.currentComp.right[1].data.push({
  91. name: rr.deptName,
  92. value: rr.ydmj
  93. })
  94. })
  95. response.data.nhzcDeptList.map(rr => {
  96. this.currentComp.right[2].data.push({
  97. name: rr.deptName,
  98. value: rr.ydmj
  99. })
  100. })
  101. response.data.jtzyzcTypeList.map(rr => {
  102. this.currentComp.left[0].data.push({
  103. name: rr.threeDetailType,
  104. value: rr.ydmj
  105. })
  106. })
  107. response.data.nysssbTypeList.map(rr => {
  108. this.currentComp.left[1].data.push({
  109. name: rr.threeDetailType,
  110. value: rr.ydmj
  111. })
  112. })
  113. response.data.nhzcTypeList.map(rr => {
  114. this.currentComp.left[2].data.push({
  115. name: rr.threeDetailType,
  116. value: rr.ydmj,
  117. unit: '万元'
  118. })
  119. })
  120. this.currentComp.buttom[0].data = {
  121. jtzyzc: response.data.jtzyzc,//集体资源资产
  122. nysssb: response.data.nysssb,//农业设施设备
  123. nhzc: response.data.nhzc,
  124. }
  125. this.currentComp.buttom[1].data = {
  126. xy23: response.data.xy23,
  127. xy24: response.data.xy24
  128. }
  129. console.log(this.currentComp)
  130. this.allData = response.data;
  131. });
  132. },
  133. tabChange (info) {
  134. this.tab = info.id;
  135. }
  136. }
  137. };