| @@ -88,4 +88,18 @@ export function rankingOfFundIncome (deptId, year) { | |||||
| method: 'get', | method: 'get', | ||||
| params: query | params: query | ||||
| }) | }) | ||||
| } | |||||
| } | |||||
| // 资金一张图-右下-资金支出排名 | |||||
| export function rankingOfCapitalExpenditure (deptId, year) { | |||||
| let query = { | |||||
| deptId, | |||||
| year | |||||
| } | |||||
| return request({ | |||||
| url: 'api/home/xixia/finance/zjzhcpm', | |||||
| method: 'get', | |||||
| params: query | |||||
| }) | |||||
| } | |||||
| @@ -1,3 +1,3 @@ | |||||
| <Pannel title="资金支出排名" height="340"> | <Pannel title="资金支出排名" height="340"> | ||||
| <ScrollTable></ScrollTable> | |||||
| <ScrollTable v-if="isLoad" :data="data" :headers="['部门名称', '收入金额', '排名']"></ScrollTable> | |||||
| </Pannel> | </Pannel> | ||||
| @@ -1,19 +1,51 @@ | |||||
| import Pannel from '@/components/pannel/index.vue'; | import Pannel from '@/components/pannel/index.vue'; | ||||
| import ScrollTable from '@/components/scroll-table/index.vue'; | import ScrollTable from '@/components/scroll-table/index.vue'; | ||||
| import { rankingOfCapitalExpenditure } from '../../../../api/index.js'; | |||||
| import { mapGetters } from 'vuex'; | |||||
| export default { | export default { | ||||
| components: { | components: { | ||||
| ScrollTable, | ScrollTable, | ||||
| Pannel | Pannel | ||||
| }, | }, | ||||
| computed: { | |||||
| ...mapGetters(['year', 'deptId']) | |||||
| }, | |||||
| watch: { | |||||
| year: { | |||||
| handler () { | |||||
| this.getData(); | |||||
| }, | |||||
| immediate: true, // 立即执行 | |||||
| }, | |||||
| deptId: { | |||||
| handler () { | |||||
| this.getData(); | |||||
| }, | |||||
| immediate: true, // 立即执行 | |||||
| } | |||||
| }, | |||||
| data () { | data () { | ||||
| return { | return { | ||||
| isLoad: false | |||||
| }; | }; | ||||
| }, | }, | ||||
| created () { | created () { | ||||
| }, | }, | ||||
| mounted () { | mounted () { | ||||
| }, | }, | ||||
| methods: { | 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; | |||||
| }) | |||||
| } | |||||
| } | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -39,11 +39,9 @@ export default { | |||||
| if (this.year, this.deptId) { | if (this.year, this.deptId) { | ||||
| this.isLoad = false; | this.isLoad = false; | ||||
| rankingOfFundIncome(this.deptId, this.year).then(res => { | rankingOfFundIncome(this.deptId, this.year).then(res => { | ||||
| console.log(res.data, 992); | |||||
| let data = res.data.map(item => { | let data = res.data.map(item => { | ||||
| return [item.name, item.value, item.index] | return [item.name, item.value, item.index] | ||||
| }) | }) | ||||
| console.log(data, 999); | |||||
| this.data = data; | this.data = data; | ||||
| this.isLoad = true; | this.isLoad = true; | ||||
| }) | }) | ||||