|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- import Header from '@/components/headerNew/index.vue';
- import Footer from '@/components/footer/index.vue';
- import Left from '@/components/left/index.vue';
- import Right from '@/components/right/index.vue';
- import Tabs from '@/components/tabs/index.vue';
-
- import Left11 from './comps/left/top/1/index.vue';
- import Left21 from './comps/left/middle/1/index.vue';
- import Left31 from './comps/left/bottom/1/index.vue';
- import Right11 from './comps/right/top/1/index.vue';
- import Right21 from './comps/right/middle/1/index.vue';
- import Right31 from './comps/right/bottom/1/index.vue';
- import Bottom1 from './comps/buttom/1/index.vue';
- import Bottom2 from './comps/buttom/2/index.vue';
-
- import Popover from './popover/index.vue';
- import MainGis from './main-gis/index.vue';
-
- import { comps } from './data.js'
-
- import { getStatistic } from "@/api/index";
- import { getInfo } from "@/api/login";
- import {mapGetters} from "vuex";
-
- export default {
- components: {
- MainGis,
- Header,
- Footer,
- Left,
- Right,
- Tabs,
- Left11,
- Left21,
- Left31,
- Right11,
- Right21,
- Right31,
- Popover,
- Bottom2,
- Bottom1
- },
- data () {
- return {
- comps,
- tab: '1',
- allData: {},
- deptIdPage:100
- };
- },
- watch: {
- // year: {
- // handler () {
- // this.getData(this.deptIdPage);
- // },
- // immediate: true, // 立即执行
- // },
- // deptId: {
- // handler () {
- // this.getData(this.deptIdPage);
- // },
- // immediate: true, // 立即执行
- // }
- },
- computed: {
- ...mapGetters(['year', 'deptId']),
- currentComp: function () {
- return this.comps[this.tab]
- }
- },
- created () {
- getInfo().then(res => {
- this.deptIdPage = res.user.deptId;
- this.getData(res.user.deptId);
- })
- },
- mounted () {
-
- },
- methods: {
- getData(deptId){
- this.currentComp.right[0].data = [];
- this.currentComp.right[1].data = [];
- this.currentComp.right[2].data = [];
-
- this.currentComp.left[0].data = [];
- this.currentComp.left[1].data = [];
- this.currentComp.left[2].data = [];
- getStatistic({deptId: deptId}).then((response) => {
- response.data.jtzyzcDeptList.map(rr => {
- this.currentComp.right[0].data.push({
- name: rr.deptName,
- value: rr.ydmj
- })
- })
- response.data.nysssbDeptList.map(rr => {
- this.currentComp.right[1].data.push({
- name: rr.deptName,
- value: rr.ydmj
- })
- })
- response.data.nhzcDeptList.map(rr => {
- this.currentComp.right[2].data.push({
- name: rr.deptName,
- value: rr.ydmj
- })
- })
-
- response.data.jtzyzcTypeList.map(rr => {
- this.currentComp.left[0].data.push({
- name: rr.threeDetailType,
- value: rr.ydmj
- })
- })
- response.data.nysssbTypeList.map(rr => {
- this.currentComp.left[1].data.push({
- name: rr.threeDetailType,
- value: rr.ydmj
- })
- })
- response.data.nhzcTypeList.map(rr => {
- this.currentComp.left[2].data.push({
- name: rr.threeDetailType,
- value: rr.ydmj,
- unit: '万元'
- })
- })
-
- this.currentComp.buttom[0].data = {
- jtzyzc: response.data.jtzyzc,//集体资源资产
- nysssb: response.data.nysssb,//农业设施设备
- nhzc: response.data.nhzc,
- }
-
- this.currentComp.buttom[1].data = {
- xy23: response.data.xy23,
- xy24: response.data.xy24
- }
-
- console.log(this.currentComp)
- this.allData = response.data;
- });
- },
- tabChange (info) {
- this.tab = info.id;
- }
- }
- };
|