epmet pc工作端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
3.2 KiB

3 years ago
<template>
<div class="m-zyqd">
<el-row :gutter="16">
<el-col :span="8">
3 years ago
<div class="kuangkuang">
<h3>发布政策数</h3>
3 years ago
<h2>256</h2>
</div>
</el-col>
<el-col :span="8">
3 years ago
<div class="kuangkuang">
<h3>指派服务数</h3>
<h2>2545</h2>
</div>
</el-col>
<el-col :span="8">
<div class="kuangkuang">
<h3>政策找人数</h3>
3 years ago
<h2>2545</h2>
</div>
</el-col>
</el-row>
3 years ago
<div class="pieMain pieMain2">
<div class="pie" ><screen-echarts-frame @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame></div>
</div>
3 years ago
</div>
</template>
<script>
import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index';
import { pieOption } from './fwBarOption.js';
import { requestPostBi } from '@/js/dai/request-bipass';
export default {
props: {
orgId: {
type: String,
default: ''
3 years ago
},
searchDate: Array
3 years ago
},
data() {
return {
showNoData: false,
timer: null,
pieChart: '',
pieOption: {},
pieInitState: false,
3 years ago
pieData: []
3 years ago
};
},
components: {
screenEchartsFrame
},
mounted() {
this.init();
},
3 years ago
3 years ago
methods: {
async init() {
await this.getInfo();
this.getPie();
},
3 years ago
3 years ago
// 获取房屋总数等
async getInfo() {
3 years ago
let url = 'common_service_view';
3 years ago
this.$refs.pieChart.showLoading();
const { data, code, msg } = await requestPostBi(
url,
{
queryParam: {
3 years ago
org_id: this.orgId,
start_date: this.searchDate[0],
end_date: this.searchDate[1]
3 years ago
}
},
{
// mockId: 60041615,
}
);
this.$refs.pieChart.hideLoading();
if (code === 0) {
if (data && Array.isArray(data) && data.length > 0) {
let info = data[0];
this.info = {
...this.info,
...info
};
}
} else {
this.$message.error(msg);
}
},
selItem(selItem, selIndex) {
this.tabList.forEach((element, index) => {
if (index === selIndex) {
element.sel = true;
} else {
element.sel = false;
}
});
},
pieInitOk() {
this.pieInitState = true;
},
getPie() {
if (this.pieInitState) {
this.setPieData();
} else {
setTimeout(() => {
this.getPie();
}, 500);
}
},
setPieData() {
3 years ago
let { data } = this;
data = [
{
org_id: '',
name: '健康医疗',
count: 10
},
{
org_id: '',
name: '社区安全',
count: 20
},
{
org_id: '',
name: '社区治安',
count: 30
},
{
3 years ago
org_id: '',
name: '社区卫生',
count: 40
},
{
3 years ago
org_id: '',
name: '社区环境',
count: 50
},
{
3 years ago
org_id: '',
name: '社区救助',
count: 60
},
{
3 years ago
org_id: '',
name: '社区养老',
count: 70
}
];
3 years ago
data = JSON.parse(JSON.stringify(data).replace(/count/g, 'value'));
console.log('data', data);
this.pieData = data;
this.iniPieChart();
},
// 获取饼状图
async iniPieChart() {
this.$refs.pieChart.clear();
// 获取pieChart配置
this.pieOption = pieOption();
this.pieOption.series[0].name = this.currentTab;
this.pieOption.series[0].data = this.pieData;
this.$refs.pieChart.setOption(this.pieOption);
}
}
};
</script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>