diff --git a/src/views/resources/api/index.js b/src/views/resources/api/index.js index fc8d6d5..1893420 100644 --- a/src/views/resources/api/index.js +++ b/src/views/resources/api/index.js @@ -64,3 +64,16 @@ export function longTermContractNonExecutionWarning (deptId, year) { params: query }) } + +// 资源一张图-左上-资源概况分析 +export function resourceOverviewAnalysis (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/resource/zygkfx', + method: 'get', + params: query + }) +} diff --git a/src/views/resources/comps/left/bottom/1/index.html b/src/views/resources/comps/left/bottom/1/index.html index 8b38f3e..17cbcf2 100644 --- a/src/views/resources/comps/left/bottom/1/index.html +++ b/src/views/resources/comps/left/bottom/1/index.html @@ -1,4 +1,4 @@ - +
diff --git a/src/views/resources/comps/left/top/1/index.html b/src/views/resources/comps/left/top/1/index.html index f1b24d5..4d662b0 100644 --- a/src/views/resources/comps/left/top/1/index.html +++ b/src/views/resources/comps/left/top/1/index.html @@ -1,4 +1,9 @@ - +
@@ -10,7 +15,7 @@
- +
\ No newline at end of file diff --git a/src/views/resources/comps/left/top/1/index.js b/src/views/resources/comps/left/top/1/index.js index b8917af..40718dc 100644 --- a/src/views/resources/comps/left/top/1/index.js +++ b/src/views/resources/comps/left/top/1/index.js @@ -1,13 +1,32 @@ import Pannel from '@/components/pannel/index.vue'; import HorizontalBar from '@/components/charts/horizontal-bar/index.vue'; - +import { resourceOverviewAnalysis } from '../../../../api/index.js' +import { mapGetters } from 'vuex'; export default { components: { HorizontalBar, Pannel }, + computed: { + ...mapGetters(['year', 'deptId']) + }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, data () { return { + isLoad: false, data: [ { name: '农用地', @@ -24,9 +43,34 @@ export default { value: '500', unit: '亩' } - ] + ], + barData: [] }; }, methods: { + getData () { + 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 + + let barData = [ + { + name: '闲置', + value: res.data.xz + }, + { + name: '出租/出借', + value: res.data.czcj + } + ] + this.barData = barData; + this.isLoad = true; + }) + } + } } };