提交 b32549dc 编写于 作者: zhentian.jia's avatar zhentian.jia

人群分析问题

上级 79d81961
......@@ -280,6 +280,11 @@ const vueFilter = {
} else if(value == 4) {
return '已下架';
}
}
},
examRate: (value) => {
let num = (value*100).toFixed(2);
let rate = num + '%';
return rate;
},
}
export default vueFilter
\ No newline at end of file
......@@ -638,7 +638,7 @@ export function knowledgeEffect(xAxisData, seriesBefore ,seriesAfter) {
return option;
}
export function examTimes() {
export function examTimes(xAxisData, seriesData) {
let option = {
title: {
text: "",
......@@ -660,19 +660,18 @@ export function examTimes() {
dataZoom: {
show: true,
start: 0,
end: 66
end: 100
},
xAxis: [
{
// splitLine: {
// show: false
// },
axisLabel: {
interval: 0,
rotate: 35
},
type: "category",
data: [
"1次",
"2次"
],
data: xAxisData,
axisTick: {
alignWithLabel: true
}
......@@ -680,23 +679,92 @@ export function examTimes() {
],
yAxis: [
{
splitLine: {
show: true
},
type: "value",
name: "完成时长 (天)"
name: "人数 (名)"
}
],
series: [
{
name: "时长",
name: "",
type: "bar",
barWidth: 17,
data: [
],
data: seriesData,
label: {
show: true,
position: "top",
formatter: "{c}",
rotate: -90,
offset: [-5, -15]
offset: [-5, -15],
}
}
]
};
return option;
}
export function examScore(xAxisData, seriesData) {
let option = {
title: {
text: "",
x: "left"
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow" // 默认为直线,可选为:'line' | 'shadow'
}
},
color: ['#CAA861'],
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
dataZoom: {
show: true,
start: 0,
end: 100
},
xAxis: [
{
// splitLine: {
// show: false
// },
axisLabel: {
interval: 0,
},
type: "category",
data: xAxisData,
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
splitLine: {
show: true
},
type: "value",
name: "人数 (名)"
}
],
series: [
{
name: "",
type: "bar",
barWidth: 17,
data: seriesData,
label: {
show: true,
position: "top",
formatter: "{c}",
rotate: -90,
offset: [-5, -15],
}
}
]
......
......@@ -606,13 +606,23 @@ export function initRank(data) {
}
return list;
}
export function getAvgTime(data) {
let list = [0, 0];
if (data != null && data != '') {
list[0] = Math.floor(data / 60);
list[1] = data % 60;
}
return list;
export function getAvgTime(value) {
let list = [0,0];
let avgTime = '';
if(value != null && value !='') {
list[0] = Math.floor(value / 60);
list[1] = value % 60;
}
if(list[0] == 0 && list[1] == 0) {
avgTime = list[1] + '秒';
} else if(list[0] == 0 && list[1] != 0) {
avgTime = list[1] + '秒';
} else if(list[0] != 0 && list[1] == 0) {
avgTime = list[0] + '分钟';
} else if(list[0] != 0 && list[1] != 0) {
avgTime = list[0] + '分钟' + list[1] + '秒';
}
return avgTime;
}
export function getComponent(data) {
let list = [];
......
<template>
<div class="crowd-analysis-wrap">
<el-radio-group class="crowd-radio" v-model="radio" size="small" @change="updateRadio">
<el-radio-button label="1">全部用户</el-radio-button>
<el-radio-button label="2">参与项目</el-radio-button>
<el-radio-button label="3">通过项目</el-radio-button>
<el-radio-button label="0">全部用户</el-radio-button>
<el-radio-button label="1">参与项目</el-radio-button>
<el-radio-button label="2">通过项目</el-radio-button>
</el-radio-group>
<div v-show="!showData" class="empty">
<p>"没有相关数据,请重新选择查询范围"</p>
......@@ -55,11 +55,11 @@ export default {
},
data() {
return {
radio: 1,
radio: 0,
sexData: [],
projectId: "",
crowdData: {},
showData: false,
showData: true,
echartsData: {
chart1: {},
chart2: {},
......@@ -75,7 +75,7 @@ export default {
// commonUtil.resizeHeight();
//父组件传值
this.$on("search", () => {
vm.radio = 1;
vm.radio = 0;
this.search();
});
this.$on("init", () => {
......@@ -104,33 +104,31 @@ export default {
let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
cityOrHospitalId: operationData.getIds(vm.formInline,vm.organizationList,checkAll),
kind: operationData.getSearchType(vm.formInline,checkAll),
type: vm.radio,
originalFlag: vm.formInline.checked == false ? 0 : 1
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 0 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag
};
// console.log("2 req", req);
openLoading(vm);
vm.reportGET("report/portal/getPeoplesDetails", req).then(res => {
vm.POST("stats/report/userAnalysis_pc/"+vm.radio, req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.educationList.length == 0 && res.data.jobTitle.length == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
this.showData = false;
} else {
this.showData = true;
}
// if(res.data.educationList.length == 0 && res.data.jobTitle.length == 0 ) {
// vm.$message("没有相关数据,请重新选择查询范围");
// this.showData = false;
// } else {
// this.showData = true;
// }
this.crowdData = res.data;
setTimeout(function() {
vm.educationDivision();
vm.jobDivision();
vm.getSexData();
vm.ageDivision();
// vm.jobDivision();
// vm.getSexData();
// vm.ageDivision();
},20);
// this.educationDivision();
// this.jobDivision();
// this.getSexData();
// this.ageDivision();
} else {
vm.$message(res.message);
}
......@@ -185,17 +183,16 @@ export default {
},
educationDivision(data) {
let myChart = echarts.init(this.$refs.education);
let educationList = operationData.removeZero(this.crowdData.educationList);
let educationList = this.crowdData.eduList;
let legendData = [];
let seriesData = [];
let colorData = ["#FF9F7F", "#008000", "#E062AE", "#37A2DA", "#0050DC", "#67E0E3", "#8A2BE2"];
// for (let i = 0; i < educationList.length; i++) {
// legendData[i] = educationList[i].name;
// }
if(educationList.length > 0) {
legendData = ['博士后','博士','硕士','本科','大专','中专及以下','其他'];
let colorData = ["#7453FF", "#3BA0FF", "#5D7092", "#39AF9A", "#FFBC3D", "#FF9A4B", "#8A2BE2"];
// legendData = ['博士后','博士','硕士','本科','大专','中专及以下','其他'];
for (let i = 0; i < educationList.length; i++) {
legendData[i] = educationList[i].name;
seriesData[i] = educationList[i].value;
}
seriesData = educationList;
let option = operationData.getPicOption(
"用户学历分布",
legendData,
......
......@@ -3,8 +3,8 @@
<div v-if="dataType == 0" class="data-chart">
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card">
<el-tooltip class="item-tool" placement="bottom-end" effect="light">
<el-card class="box-card" v-bind:class="{ 'box-last': index == 2 }">
<el-tooltip v-if="index == 2" class="item-tool" placement="bottom-end" effect="light">
<div slot="content">
<p v-for="text in item.content">{{ text }}</p>
</div>
......@@ -55,6 +55,7 @@
></el-pagination>
</div> -->
</div>
<div class="spacing"></div>
<div class="chart-title">证历分布情况</div>
<div class="chart-distributeChart">
<div class="distributeChart" id="distributeChart" ref="distributeChart"></div>
......@@ -243,7 +244,7 @@ export default {
req.regionId = "310";
}
// console.log("0 req", req);
vm.POST("stats/report/general", req).then(res => {
vm.POST("stats/report/general_pc", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.initCard(res.data.percentData);
......@@ -459,16 +460,15 @@ export default {
.data-all-wrap {
background: #fff;
overflow: hidden;
padding: 10px;
// padding: 10px;
.box-list {
position: relative;
// width: 100%;
height: 110px;
.box-card {
position: relative;
background-color: #e3efed;
color: #449284;
width: 31%;
width: 32%;
margin-right: 2%;
height: 110px;
float: left;
......@@ -536,6 +536,15 @@ export default {
width: 48%;
margin-right: 1%;
}
.box-last {
margin-right: 0;
}
}
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.date-table {
position: relative;
......@@ -559,12 +568,10 @@ export default {
font-weight:600;
line-height: 60px;
color: #000000;
border-bottom: 1px solid #E4E7ED;
}
.chart {
position: relative;
margin: 20px auto 0 auto;
// width: 100%;
width: 860px;
height: 350px;
}
......
......@@ -13,41 +13,24 @@
<div class="spacing"></div>
<div class="chart-title">完成项目考试次数情况</div>
<div class="chart" id="examTimes" ref="examTimes"></div>
<!-- <div class="chart-title">完成项目考试分数情况</div>
<div class="chart" id="examScore" ref="examScore"></div>-->
<div class="chart-remarks">注:本报表数据来源包括用户参加正式考试,不包含摸底考试。</div>
<div class="spacing"></div>
<div class="chart-title">完成项目考试分数情况</div>
<div class="chart" id="examScore" ref="examScore"></div>
<div class="spacing"></div>
<div class="table">
<el-table :data="tableData" style="width: 100%" border>
<el-table-column prop="examType" label="类型" align="center"></el-table-column>
<el-table-column prop="examName" label="考试名" min-width="150" align="center"></el-table-column>
<el-table-column prop="examUserCount" label="参与考试人数" min-width="100" align="center"></el-table-column>
<el-table-column prop="userCountForPassExam" label="通过考试人数" min-width="80" align="center"></el-table-column>
<el-table-column
v-if="showTd[0]"
prop="userCountList[0]"
:label="labelTd[0]"
min-width="80"
align="center"
></el-table-column>
<el-table-column
v-if="showTd[1]"
prop="userCountList[1]"
:label="labelTd[1]"
min-width="80"
align="center"
></el-table-column>
<el-table-column
v-if="showTd[2]"
prop="userCountList[2]"
:label="labelTd[2]"
min-width="80"
align="center"
></el-table-column>
<el-table-column
v-if="showTd[3]"
prop="userCountList[3]"
:label="labelTd[3]"
min-width="80"
align="center"
></el-table-column>
<el-table-column prop="doctorCount" label="应参与考试人数" align="center"></el-table-column>
<el-table-column prop="passCount" label="通过考试人数" align="center"></el-table-column>
<el-table-column prop="passRate" label="整体通过率" align="center">
<template slot-scope="scope">{{ scope.row.passRate | examRate }}</template>
</el-table-column>
<el-table-column prop="joinCount" label="参与考试人数" align="center"></el-table-column>
<el-table-column prop="joinRate" label="参与通过率" align="center">
<template slot-scope="scope">{{ scope.row.joinRate | examRate }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="goPage(scope.row)">查看名单</el-button>
......@@ -127,11 +110,13 @@ export default {
// console.log(this.formInline);
this.pageNo = 1;
this.search();
this.searchTable();
});
this.$on("init", () => {
this.$nextTick(function() {
if (vm.formInline.region.length != 0) {
this.search();
this.searchTable();
}
});
});
......@@ -145,17 +130,6 @@ export default {
methods: {
// 搜索列表
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h(
"p",
{ style: "color: #FF3399" },
"请先选择地区后再进行查询 "
)
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
......@@ -174,6 +148,7 @@ export default {
vm.scoreData = res.data;
vm.setCardData(res.data);
vm.setExamTimes(res.data.examTimesList);
vm.setExamScore(res.data.examScoreList);
} else {
vm.$message(res.message);
}
......@@ -182,32 +157,40 @@ export default {
// let reqList = req;
// reqList.pageNo = vm.pageNo;
// reqList.pageSize = vm.pageSize;
// vm.reportGET("report/portalProjectExam/getExamList", req).then(res => {
// openLoading(vm);
// vm.POST("stats/report/exam/list", req).then(res => {
// closeLoading(vm);
// if (res.code == "000000") {
// vm.tableData = res.data.list;
// if(res.data.list.length == 0) {
// return;
// }
// if(res.data.list[0].userCountList == null || res.data.list[0].userCountList.length == 0) {
// vm.showTd = [false,false,false,false];
// } else if (res.data.list[0].userCountList.length == 1){
// vm.showTd = [true,false,false,false];
// } else if (res.data.list[0].userCountList.length == 2){
// vm.showTd = [true,true,false,false];
// } else if (res.data.list[0].userCountList.length == 3){
// vm.showTd = [true,true,true,false];
// } else if (res.data.list[0].userCountList.length == 4){
// vm.showTd = [true,true,true,true];
// }
// vm.tableData = res.data.examInfoList;
// vm.totalRows = res.data.totalRows;
// }
// });
//
},
searchTable() {
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
endDate: operationData.setDuringTime(vm.formInline.during, "end"),
hospitalIdList: vm.formInline.organization,
originalFlag: vm.formInline.checked == false ? 0 : 1,
regionId: vm.formInline.region[vm.formInline.region.length - 1],
timeFlag: vm.formInline.timeFlag
};
let reqList = req;
reqList.pageNo = vm.pageNo;
reqList.pageSize = vm.pageSize;
openLoading(vm);
vm.POST("stats/report/exam/list", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.tableData = res.data.examInfoList;
vm.totalRows = res.data.totalRows;
}
});
},
setCardData(data) {
vm.totalRows = data.projectExamCount;
vm.cardData = [
let cardData = [
{
title: "项目正式考试数",
value: "0门"
......@@ -221,9 +204,10 @@ export default {
value: "0道"
}
];
vm.cardData[0].value = data.afterExamCount + "门";
vm.cardData[1].value = data.beforeExamCount + "门";
vm.cardData[2].value = data.examTitleCount + "道";
cardData[0].value = data.afterExamCount + "门";
cardData[1].value = data.beforeExamCount + "门";
cardData[2].value = data.examTitleCount + "道";
vm.cardData = cardData;
},
updateResize() {
setTimeout(function() {
......@@ -231,16 +215,34 @@ export default {
vm.echartsData.chart0.resize();
vm.echartsData.chart1.resize();
};
}, 100);
}, 30);
},
setExamTimes(data) {
let myChart = echarts.init(this.$refs.examTimes);
let option = chartData.examTimes();
let xAxisData = [];
let seriesData = [];
for (let i = 0; i < data.length; i++) {
xAxisData.push(data[i].times + "次");
seriesData.push(data[i].count);
}
let option = chartData.examTimes(xAxisData, seriesData);
myChart.setOption(option);
vm.echartsData.chart0 = myChart;
vm.updateResize();
},
setExamScore(data) {},
setExamScore(data) {
let myChart = echarts.init(this.$refs.examScore);
let xAxisData = [];
let seriesData = [];
for (let i = 0; i < data.length; i++) {
xAxisData.push(data[i].timesStr);
seriesData.push(data[i].count);
}
let option = chartData.examScore(xAxisData, seriesData);
myChart.setOption(option);
vm.echartsData.chart1 = myChart;
vm.updateResize();
},
// 跳转查看名单页面
goPage(data) {
let checkAll = operationData.hasAll(vm.formInline.organization);
......@@ -272,13 +274,13 @@ export default {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
vm.pageSize = val;
vm.search();
vm.searchTable();
},
// 换页
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
vm.pageNo = val;
vm.search();
vm.searchTable();
}
}
};
......@@ -355,13 +357,13 @@ export default {
.chart-title {
position: relative;
margin-top: 17px;
margin-left: 30px;
width: 100%;
height: 60px;
font-size: 18px;
font-weight: 600;
line-height: 60px;
color: #000000;
border-bottom: 1px solid #e4e7ed;
}
.chart {
position: relative;
......@@ -369,5 +371,8 @@ export default {
width: 860px;
height: 350px;
}
.chart-remarks {
position: relative;
}
}
</style>
......@@ -2,26 +2,19 @@
<div class="learning-effect">
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card">
<!-- <el-tooltip class="item-tool" placement="bottom-end" effect="light">
<div slot="content">
<p v-for="text in item.content">{{ text }}</p>
</div>
<i class="el-icon-question notice"></i>
</el-tooltip> -->
<div class="left-content">
<el-card class="box-card" v-bind:class="{ 'box-last': index == 1 }">
<!-- <div class="left-content"> -->
<p class="value">{{ item.value }}</p>
<p class="title">{{ item.title }}</p>
<p class="value">{{ item.value }}</p>
</div>
<!-- <div class="vertical"></div>
<div class="right-content">
<p class="has">{{ item.hasKey }}:{{ item.hasNum }}</p>
<p class="should">{{ item.shouldKey }}:{{ item.shouldNum }}</p>
</div>-->
<!-- </div> -->
</el-card>
</div>
</div>
<div class="spacing"></div>
<div class="chart-title">不同学历完成项目前后正确率对比</div>
<div class="chart" ref="education"></div>
<div class="spacing"></div>
<div class="chart-title">培训前后知识点掌握情况</div>
<div class="chart" ref="learning"></div>
</div>
</template>
......@@ -149,63 +142,62 @@ export default {
.learning-effect {
background: #fff;
overflow: hidden;
padding: 10px;
// padding: 10px;
.spacing {
position: relative;
width: 100%;
height: 20px;
background: #f0f2f5;
}
.box-list {
position: relative;
// width: 100%;
height: 110px;
background: #f0f2f5;
.box-card {
position: relative;
background-color: #e3efed;
color: #449284;
width: 48%;
margin-right: 1%;
height: 110px;
background-color: #ffffff;
width: 49%;
margin-right: 2%;
height: 120px;
float: left;
.notice {
position: absolute;
z-index: 999;
top: 21px;
right: 14px;
width: 16px;
height: 16px;
}
.el-card__header {
border-bottom-width: 0;
}
.el-card__body {
padding: 0px;
}
.left-content {
position: relative;
float: left;
width: 33%;
height: 110px;
text-align: left;
padding: 23px 0 0 20px;
.title {
font-size: 14px;
height: 14px;
line-height: 14px;
}
.value {
margin-top: 20px;
height: 22px;
font-size: 30px;
line-height: 22px;
font-weight: 500;
}
.value {
color: #373839;
text-align: center;
margin-top: 24px;
margin-bottom: 8px;
height: 45px;
line-height: 45px;
font-size: 32px;
font-weight: 500;
}
.vertical {
position: absolute;
left: 34%;
float: left;
margin-top: 23px;
width:1px;
height:57px;
background-color: #C1D8D4;
.title {
color: #666666;
text-align: center;
font-size: 14px;
height: 20px;
line-height: 20px;
}
}
.box-last {
margin-right: 0%;
}
}
.chart-title {
position: relative;
margin-top: 17px;
margin-left: 30px;
width: 100%;
height: 60px;
font-size: 18px;
font-weight: 600;
line-height: 60px;
color: #000000;
}
.chart {
position: relative;
......
......@@ -75,7 +75,7 @@
</el-date-picker>
</el-col>
</el-form-item>
<el-form-item label v-if="showOriginal == 1">
<el-form-item label v-if="showOriginal !== 1">
<el-checkbox size="small" v-model="formInline.checked">查看原始数据</el-checkbox>
</el-form-item>
<div class="form-button">
......@@ -244,7 +244,7 @@ export default {
// organizationData: "",
},
tags: [],
activeName: "fourth",
activeName: "second",
organizationNum: 0,
dialogVisible: false,
dialogUpdate: false,
......@@ -286,34 +286,34 @@ export default {
},
methods: {
getDisplay(type) {
let req = {
// let req = {
// projectId: vm.projectId,
// projectName: vm.projectName,
// };
// openLoading(vm);
// vm.reportGET("report/portal/display", req).then(res => {
// closeLoading(vm);
// if (res.code == "000000") {
// vm.showOriginal = res.data.status;
// vm.roleType = res.data.roleType;
// vm.displayExam = res.data.existExam;
// vm.flag = res.data.flag;
// }
// });
let reqInfo = {
projectId: vm.projectId,
projectName: vm.projectName,
};
openLoading(vm);
vm.reportGET("report/portal/display", req).then(res => {
vm.GET("stats/region/info", reqInfo).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.showOriginal = res.data.status;
vm.roleType = res.data.roleType;
// vm.showOriginal = res.data.status;
// vm.roleType = res.data.roleType;
// vm.displayExam = res.data.existExam;
vm.flag = res.data.flag;
// vm.flag = res.data.flag;
}
});
let reqInfo = {
projectId: vm.projectId,
};
// openLoading(vm);
// vm.GET("stats/region/info", reqInfo).then(res => {
// closeLoading(vm);
// if (res.code == "000000") {
// // vm.showOriginal = res.data.status;
// // vm.roleType = res.data.roleType;
// // vm.displayExam = res.data.existExam;
// // vm.flag = res.data.flag;
// }
// });
},
beforeLeave(activeName, oldActiveName) {
// console.log('action',activeName,'oldActive',oldActiveName)
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册