From f7d0f0fec2c1b73efab15279480ee80774ec2ae2 Mon Sep 17 00:00:00 2001 From: yuzongping <835949940@qq.com> Date: Wed, 16 Jul 2025 09:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=B1=BB=E5=9E=8B=E5=88=86?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/resources/api/index.js | 13 ++++++ .../resources/comps/left/middle/1/index.html | 9 +++- .../resources/comps/left/middle/1/index.js | 44 ++++++++++++++++--- src/views/resources/comps/left/top/1/index.js | 1 - 4 files changed, 59 insertions(+), 8 deletions(-) diff --git a/src/views/resources/api/index.js b/src/views/resources/api/index.js index 1893420..20d70be 100644 --- a/src/views/resources/api/index.js +++ b/src/views/resources/api/index.js @@ -77,3 +77,16 @@ export function resourceOverviewAnalysis (deptId, year) { params: query }) } + +// 资源一张图-左中-资源类型分析 +export function resourceTypeAnalysis (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/resource/zylxfx', + method: 'get', + params: query + }) +} diff --git a/src/views/resources/comps/left/middle/1/index.html b/src/views/resources/comps/left/middle/1/index.html index d50f843..29b5ebd 100644 --- a/src/views/resources/comps/left/middle/1/index.html +++ b/src/views/resources/comps/left/middle/1/index.html @@ -1,10 +1,15 @@ - +
- +
\ No newline at end of file diff --git a/src/views/resources/comps/left/middle/1/index.js b/src/views/resources/comps/left/middle/1/index.js index 583a715..4cf8ff5 100644 --- a/src/views/resources/comps/left/middle/1/index.js +++ b/src/views/resources/comps/left/middle/1/index.js @@ -1,15 +1,34 @@ import Pannel from '@/components/pannel/index.vue'; import PannelTabs from '@/components/pannel-tabs/index.vue'; import Bar from '@/components/charts/bar/index.vue'; - +import { resourceTypeAnalysis } from '../../../../api/index.js' +import { mapGetters } from 'vuex'; export default { components: { Bar, PannelTabs, Pannel }, + computed: { + ...mapGetters(['year', 'deptId']) + }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, data () { return { + isLoad: false, pannelTabData: [ { id: '1', @@ -24,16 +43,31 @@ export default { name: '未利用地' } ], + data: [], tabIndex: '1' }; }, - created () { - }, - mounted () { - }, methods: { + getData () { + if (this.year, this.deptId) { + this.isLoad = false; + resourceTypeAnalysis(this.deptId, this.year).then(res => { + if (this.tabIndex == 1) { + this.data = res.data.nyd + + } else if (this.tabIndex == 2) { + this.data = res.data.jsyd + + } else if (this.tabIndex == 3) { + this.data = res.data.wlydjlm + } + this.isLoad = true; + }) + } + }, tabChange (info) { this.tabIndex = info.id + this.getData(); } } }; diff --git a/src/views/resources/comps/left/top/1/index.js b/src/views/resources/comps/left/top/1/index.js index 40718dc..9b98377 100644 --- a/src/views/resources/comps/left/top/1/index.js +++ b/src/views/resources/comps/left/top/1/index.js @@ -52,7 +52,6 @@ export default { if (this.year, this.deptId) { this.isLoad = false; resourceOverviewAnalysis(this.deptId, this.year).then(res => { - console.log(222, res); this.data[0].value = res.data.nyd this.data[1].value = res.data.jsyd this.data[2].value = res.data.wlydjlm