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.

163 lines
3.6 KiB

3 years ago
<template>
<div class="m-zyqd">
<el-row :gutter="16">
<el-col :span="6">
3 years ago
<div class="kuangkuang">
<h3>个性服务数量</h3>
<h2>{{info.user_service_total}}</h2>
3 years ago
</div>
</el-col>
<el-col :span="6">
3 years ago
<div class="kuangkuang">
<h3>完成服务数量</h3>
<h2>{{info.service_complete_total}}</h2>
</div>
</el-col>
<el-col :span="6">
<div class="kuangkuang">
<h3>服务完成率</h3>
<h2>{{info.service_complete_ratio_total}}</h2>
</div>
</el-col>
<el-col :span="6">
<div class="kuangkuang">
<h3>服务满意度</h3>
<h2>{{info.service_score_tatal}}</h2>
3 years ago
</div>
</el-col>
</el-row>
3 years ago
<div class="pieMain pieMain2">
2 years ago
<div class="pie"><screen-echarts-frame @myChartMethod="pieInitOk" ref="pieChart"></screen-echarts-frame>
</div>
</div>
3 years ago
</div>
</template>
<script>
2 years ago
import screenEchartsFrame from '@/views/dataBoard/cpts/screen-echarts-frame/index';
import {
pieOption
} from './fwBarOption04.js';
import {
requestPostBi
} from '@/js/dai/request-bipass';
export default {
props: {
orgId: {
type: String,
default: ''
},
searchDate: Array
3 years ago
},
2 years ago
data() {
return {
showNoData: false,
timer: null,
pieChart: '',
pieOption: {},
pieInitState: false,
pieData: [],
info: {}
};
3 years ago
},
2 years ago
components: {
screenEchartsFrame
},
mounted() {
this.init();
},
methods: {
async init() {
await this.getInfo();
this.getPie();
},
// 公共服务数据统计
async getInfo() {
let url = 'user_demand_count';
this.$refs.pieChart.showLoading();
const {
data,
code,
msg
} = await requestPostBi(url, {
3 years ago
queryParam: {
3 years ago
org_id: this.orgId,
start_date: this.searchDate[0],
end_date: this.searchDate[1]
3 years ago
}
2 years ago
}, {
3 years ago
// mockId: 69450870,
2 years ago
});
this.$refs.pieChart.hideLoading();
if (code === 0) {
let data1 = data.slice(0, 10)
if (data1 && Array.isArray(data1) && data1.length > 0) {
let info = data1[0];
this.info = {
...this.info,
...info
};
}
} else {
this.$message.error(msg);
3 years ago
}
2 years ago
},
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();
3 years ago
} else {
2 years ago
setTimeout(() => {
this.getPie();
}, 500);
3 years ago
}
2 years ago
},
setPieData() {
let data = [...this.info.child];
let pieData0 = [];
let pieData1 = [];
let pieData2 = [];
let pieData3 = [];
console.log("data22",data)
data.forEach((item, index) => {
if(index<10)
{
pieData0.push(item.category);
pieData1.push(item.service_complete_ratio);
pieData2.push(item.user_service_num);
pieData3.push(item.service_complete_num);}
});
this.pieData = [pieData0, pieData1, pieData2, pieData3];
this.iniPieChart();
},
// 获取饼状图
async iniPieChart() {
this.$refs.pieChart.clear();
// 获取pieChart配置
this.pieOption = pieOption();
this.pieOption.xAxis[0].data = this.pieData[0];
this.pieOption.series[0].data = this.pieData[1];
this.pieOption.series[1].data = this.pieData[2];
this.pieOption.series[2].data = this.pieData[3];
this.$refs.pieChart.setOption(this.pieOption);
3 years ago
}
}
2 years ago
};
3 years ago
</script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>
<style scoped>
2 years ago
.pieMain2 {
margin-left: 0px !important
}
</style>