diff --git a/src/views/resources/api/index.js b/src/views/resources/api/index.js index 7ec49ae..81b822b 100644 --- a/src/views/resources/api/index.js +++ b/src/views/resources/api/index.js @@ -141,4 +141,17 @@ export function Rankinganalysisofstandardcontractmanagement (deptId, year) { method: 'get', params: query }) +} + +// 资源一张图-中下-资源分析 +export function Resources (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/resource/zyfx', + method: 'get', + params: query + }) } \ No newline at end of file diff --git a/src/views/resources/comps/buttom/1/index.js b/src/views/resources/comps/buttom/1/index.js index 7b2a5a9..f19aa9b 100644 --- a/src/views/resources/comps/buttom/1/index.js +++ b/src/views/resources/comps/buttom/1/index.js @@ -1,9 +1,28 @@ import BlockValue from '@/components/value/index.vue'; import data from './data.js'; +import { Resources } from '../../../api/index.js' +import { mapGetters } from 'vuex' export default { components: { BlockValue }, + computed: { + ...mapGetters(['year', 'deptId']) + }, + watch: { + year: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + }, + deptId: { + handler () { + this.getData(); + }, + immediate: true, // 立即执行 + } + }, data () { return { data @@ -14,5 +33,21 @@ export default { mounted () { }, methods: { + getData () { + if (this.year, this.deptId) { + this.isLoad = false; + Resources(this.deptId, this.year).then(res => { + this.data[0][0].value = res.data.nyd + this.data[0][1].value = res.data.jsyd + this.data[0][2].value = res.data.wlydjlm + this.data[0][3].value = res.data.numWlydjlm + this.data[0][4].value = res.data.nyd + this.data[0][5].value = res.data.wlydjlm + + this.data = data + this.isLoad = true; + }) + } + }, } }; diff --git a/src/views/resources/comps/right/bottom/1/index.js b/src/views/resources/comps/right/bottom/1/index.js index 75b2b02..96d2598 100644 --- a/src/views/resources/comps/right/bottom/1/index.js +++ b/src/views/resources/comps/right/bottom/1/index.js @@ -31,10 +31,6 @@ export default { headers: ['部门名称', '合同数量', '排名'] }; }, - created () { - }, - mounted () { - }, methods: { getData () { if (this.year, this.deptId) {