diff --git a/src/views/capital/api/index.js b/src/views/capital/api/index.js index b6f19ce..4a6f030 100644 --- a/src/views/capital/api/index.js +++ b/src/views/capital/api/index.js @@ -88,4 +88,18 @@ export function rankingOfFundIncome (deptId, year) { method: 'get', params: query }) -} \ No newline at end of file +} + +// 资金一张图-右下-资金支出排名 +export function rankingOfCapitalExpenditure (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/finance/zjzhcpm', + method: 'get', + params: query + }) +} + diff --git a/src/views/capital/comps/right/bottom/1/index.html b/src/views/capital/comps/right/bottom/1/index.html index 95bb6de..39228ad 100644 --- a/src/views/capital/comps/right/bottom/1/index.html +++ b/src/views/capital/comps/right/bottom/1/index.html @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/src/views/capital/comps/right/bottom/1/index.js b/src/views/capital/comps/right/bottom/1/index.js index bcaba7d..a87661c 100644 --- a/src/views/capital/comps/right/bottom/1/index.js +++ b/src/views/capital/comps/right/bottom/1/index.js @@ -1,19 +1,51 @@ import Pannel from '@/components/pannel/index.vue'; import ScrollTable from '@/components/scroll-table/index.vue'; - +import { rankingOfCapitalExpenditure } from '../../../../api/index.js'; +import { mapGetters } from 'vuex'; export default { components: { ScrollTable, Pannel }, + computed: { + ...mapGetters(['year', 'deptId']) + }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, data () { return { + isLoad: false }; }, created () { }, mounted () { + }, methods: { + getData () { + if (this.year, this.deptId) { + this.isLoad = false; + rankingOfCapitalExpenditure(this.deptId, this.year).then(res => { + let data = res.data.map(item => { + return [item.name, item.value, item.index] + }) + this.data = data; + this.isLoad = true; + }) + } + } } }; diff --git a/src/views/capital/comps/right/middle/1/index.js b/src/views/capital/comps/right/middle/1/index.js index a30f7c9..6c662e6 100644 --- a/src/views/capital/comps/right/middle/1/index.js +++ b/src/views/capital/comps/right/middle/1/index.js @@ -39,11 +39,9 @@ export default { if (this.year, this.deptId) { this.isLoad = false; rankingOfFundIncome(this.deptId, this.year).then(res => { - console.log(res.data, 992); let data = res.data.map(item => { return [item.name, item.value, item.index] }) - console.log(data, 999); this.data = data; this.isLoad = true; })