From 8d8d91a0c32830985701e35ad05e7db8e96fcec2 Mon Sep 17 00:00:00 2001 From: yuzongping <835949940@qq.com> Date: Fri, 11 Jul 2025 10:41:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E9=87=91=E6=94=AF=E5=87=BA=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/capital/api/index.js | 26 ++++++++ .../capital/comps/left/bottom/1/index.html | 11 +++- .../capital/comps/left/bottom/1/index.js | 60 ++++++++++++++++++- 3 files changed, 93 insertions(+), 4 deletions(-) diff --git a/src/views/capital/api/index.js b/src/views/capital/api/index.js index 4cdee67..c150576 100644 --- a/src/views/capital/api/index.js +++ b/src/views/capital/api/index.js @@ -36,4 +36,30 @@ export function leftbottomcapitalgainstrend (deptId, year) { method: 'get', params: query }) +} + +// 资金一张图-左下-资金支出分析(类型) +export function analysisOfCapitalExpenditureType (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/finance/zjzhclxfx', + method: 'get', + params: query + }) +} + +// 资金一张图-左中-资金支出分析(趋势) +export function analysisOfCapitalExpenditureRend (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/finance/zjzhcqsfx', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/src/views/capital/comps/left/bottom/1/index.html b/src/views/capital/comps/left/bottom/1/index.html index 86b7673..409b1f5 100644 --- a/src/views/capital/comps/left/bottom/1/index.html +++ b/src/views/capital/comps/left/bottom/1/index.html @@ -1,11 +1,16 @@ - +
- - + +
\ No newline at end of file diff --git a/src/views/capital/comps/left/bottom/1/index.js b/src/views/capital/comps/left/bottom/1/index.js index 6bd2c3d..601445c 100644 --- a/src/views/capital/comps/left/bottom/1/index.js +++ b/src/views/capital/comps/left/bottom/1/index.js @@ -2,6 +2,8 @@ import Pannel from '@/components/pannel/index.vue'; import PannelTabs from '@/components/pannel-tabs/index.vue'; import LineCharts from '@/components/charts/line/index.vue'; import PieCharts from '@/components/charts/pie/index.vue'; +import { mapGetters } from 'vuex'; +import { analysisOfCapitalExpenditureType, analysisOfCapitalExpenditureRend } from '../../../../api/index.js'; export default { components: { @@ -12,17 +14,73 @@ export default { }, data () { return { + data: [], // 数据 + isLoad: false, // 是否加载完成 tabIndex: '1' }; }, + computed: { + ...mapGetters(['year', 'deptId']) + }, created () { }, mounted () { }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, methods: { tabChange (info) { //console.log(info); this.tabIndex = info.id - } + this.getData() + }, + // 获取数据 + getData () { + if (this.year || this.deptId) { + + this.isLoad = false; + // 如果是趋势 + if (this.tabIndex == 1) { + analysisOfCapitalExpenditureRend(this.year, this.deptId).then(res => { + let data = res.data.map(item => { + return { + name: item.name + '月', + value: item.value + } + }) + this.data = data; + this.isLoad = true; + }) + } else if (this.tabIndex == 2) { + // 获取类型 + analysisOfCapitalExpenditureType(this.year, this.deptId).then(res => { + + let data = res.data.list.map(item => { + + return { + name: item.name, + value: item.value, + unit: '万元' + } + }) + this.data = data + this.isLoad = true; + }) + } + + } + }, } };