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.

158 lines
3.4 KiB

3 years ago
<template>
<div class="m-zyqd">
3 years ago
<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">
<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 './fwBarOption04.js';
3 years ago
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,
pieData: [],
info: {}
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() {
let url = 'user_demand_count';
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: 69450870,
3 years ago
}
);
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() {
let data = [...this.info.child];
let pieData0 = [];
let pieData1 = [];
let pieData2 = [];
let pieData3 = [];
data.forEach((item, index) => {
pieData0.push(item.category);
pieData1.push(item.user_service_num);
pieData2.push(item.service_complete_num);
pieData3.push(item.service_complete_ratio);
});
3 years ago
this.pieData = [pieData0, pieData1, pieData2, pieData3];
3 years ago
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];
3 years ago
this.$refs.pieChart.setOption(this.pieOption);
}
}
};
</script>
<style lang="scss" src="@/assets/scss/dataBoard/renfang/index.scss" scoped></style>
<style scoped>
.pieMain2{margin-left:0px!important}
</style>