Parcourir la source

资源类型分析

dev
yuzongping il y a 10 heures
Parent
révision
f7d0f0fec2
4 fichiers modifiés avec 59 ajouts et 8 suppressions
  1. +13
    -0
      src/views/resources/api/index.js
  2. +7
    -2
      src/views/resources/comps/left/middle/1/index.html
  3. +39
    -5
      src/views/resources/comps/left/middle/1/index.js
  4. +0
    -1
      src/views/resources/comps/left/top/1/index.js

+ 13
- 0
src/views/resources/api/index.js Voir le fichier

@@ -77,3 +77,16 @@ export function resourceOverviewAnalysis (deptId, year) {
params: query
})
}

// 资源一张图-左中-资源类型分析
export function resourceTypeAnalysis (deptId, year) {
let query = {
deptId,
year
}
return request({
url: 'api/home/xixia/resource/zylxfx',
method: 'get',
params: query
})
}

+ 7
- 2
src/views/resources/comps/left/middle/1/index.html Voir le fichier

@@ -1,10 +1,15 @@
<Pannel title="资源类型分析" height="340">
<Pannel title="资源类型分析" height="340"
v-loading="!isLoad"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.1)"
>
<div class="full">
<div class="top">
<PannelTabs @change="tabChange" :data="pannelTabData"></PannelTabs>
</div>
<div class="buttom">
<Bar :color="['rgba(134, 91, 252, 1)', 'rgba(49, 129, 246, 1)']"></Bar>
<Bar v-if="isLoad" :data="data" :color="['rgba(134, 91, 252, 1)', 'rgba(49, 129, 246, 1)']"></Bar>
</div>
</div>
</Pannel>

+ 39
- 5
src/views/resources/comps/left/middle/1/index.js Voir le fichier

@@ -1,15 +1,34 @@
import Pannel from '@/components/pannel/index.vue';
import PannelTabs from '@/components/pannel-tabs/index.vue';
import Bar from '@/components/charts/bar/index.vue';

import { resourceTypeAnalysis } from '../../../../api/index.js'
import { mapGetters } from 'vuex';
export default {
components: {
Bar,
PannelTabs,
Pannel
},
computed: {
...mapGetters(['year', 'deptId'])
},
watch: {
year: {
handler () {
this.getData();
},
immediate: true, // 立即执行
},
deptId: {
handler () {
this.getData();
},
immediate: true, // 立即执行
}
},
data () {
return {
isLoad: false,
pannelTabData: [
{
id: '1',
@@ -24,16 +43,31 @@ export default {
name: '未利用地'
}
],
data: [],
tabIndex: '1'
};
},
created () {
},
mounted () {
},
methods: {
getData () {
if (this.year, this.deptId) {
this.isLoad = false;
resourceTypeAnalysis(this.deptId, this.year).then(res => {
if (this.tabIndex == 1) {
this.data = res.data.nyd

} else if (this.tabIndex == 2) {
this.data = res.data.jsyd

} else if (this.tabIndex == 3) {
this.data = res.data.wlydjlm
}
this.isLoad = true;
})
}
},
tabChange (info) {
this.tabIndex = info.id
this.getData();
}
}
};

+ 0
- 1
src/views/resources/comps/left/top/1/index.js Voir le fichier

@@ -52,7 +52,6 @@ export default {
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


Chargement…
Annuler
Enregistrer