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

考试分析

上级 22ccbca0
...@@ -54,7 +54,7 @@ export function recordOption() { ...@@ -54,7 +54,7 @@ export function recordOption() {
}, },
}, },
backgroundColor: 'rgba(0,0,0,0.7)', backgroundColor: 'rgba(0,0,0,0.7)',
formatter: function(params) { formatter: function (params) {
let relVal = params[0].name + "人数:"; let relVal = params[0].name + "人数:";
let value = 0; let value = 0;
for (let i = 0, l = params.length; i < l; i++) { for (let i = 0, l = params.length; i < l; i++) {
...@@ -65,9 +65,9 @@ export function recordOption() { ...@@ -65,9 +65,9 @@ export function recordOption() {
divList[0] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>"; divList[0] = "<div style='background: #FFB01B;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[1] = "<div style='background: #39AF9A;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>"; divList[1] = "<div style='background: #39AF9A;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
divList[2] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>"; divList[2] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
for (let j = params.length - 1 ; j >= 0; j--) { for (let j = params.length - 1; j >= 0; j--) {
relVal += relVal +=
"<br/>" + divList[j%3] + "<br/>" + divList[j % 3] +
params[j].seriesName + params[j].seriesName +
"占比: " + "占比: " +
( (
...@@ -79,7 +79,7 @@ export function recordOption() { ...@@ -79,7 +79,7 @@ export function recordOption() {
return relVal; return relVal;
} }
}, },
color: ['#FFB01B','#39AF9A', '#5D7092'], color: ['#FFB01B', '#39AF9A', '#5D7092'],
legend: { legend: {
data: ["未获证人数", "获优秀人数", "获及格人数"] data: ["未获证人数", "获优秀人数", "获及格人数"]
}, },
...@@ -156,7 +156,7 @@ export function certificateOption() { ...@@ -156,7 +156,7 @@ export function certificateOption() {
} }
}, },
backgroundColor: 'rgba(0,0,0,0.7)', backgroundColor: 'rgba(0,0,0,0.7)',
formatter: function(params) { formatter: function (params) {
let relVal = ""; let relVal = "";
let divList = []; let divList = [];
divList[0] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>"; divList[0] = "<div style='background: #5D7092;height: 12px;width: 20px;margin: 5px 5px 0 2px;float: left;border-radius:2px;'></div>";
...@@ -173,7 +173,7 @@ export function certificateOption() { ...@@ -173,7 +173,7 @@ export function certificateOption() {
return relVal; return relVal;
} }
}, },
color: ['#5D7092','#FFB01B', '#559A99'], color: ['#5D7092', '#FFB01B', '#559A99'],
dataZoom: { dataZoom: {
show: true, show: true,
start: 0, start: 0,
...@@ -472,4 +472,110 @@ export function durationOption() { ...@@ -472,4 +472,110 @@ export function durationOption() {
] ]
}; };
return option; return option;
}
export function educationEffect(xAxisData, seriesBefore ,seriesAfter) {
let option = {
title: {
text: ""
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
}
},
color: ["#5D7092", "#FFB01B"],
legend: {
data: ["项目前总正确率", "项目后总正确率"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
data: xAxisData
},
yAxis: {
min: 0,
max: 100,
type: "value",
axisLabel: {
formatter: "{value} %"
}
},
series: [
{
name: "项目前总正确率",
type: "bar",
barWidth: 10,
data: seriesBefore,
},
{
name: "项目后总正确率",
type: "bar",
barWidth: 10,
data: seriesAfter,
}
]
};
return option;
}
export function knowledgeEffect(xAxisData, seriesBefore ,seriesAfter) {
let option = {
title: {
text: ""
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow"
}
},
color: ["#5D7092", "#FFB01B"],
legend: {
data: ["培训前正确率", "培训后正确率"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
axisLabel: {
interval: 0,
rotate: 45
},
type: "category",
data: xAxisData,
},
yAxis: {
min: 0,
max: 100,
type: "value",
axisLabel: {
formatter: "{value} %"
}
},
series: [
{
name: "培训前正确率",
type: "bar",
barWidth: 10,
data: seriesBefore,
},
{
name: "培训后正确率",
type: "bar",
barWidth: 10,
data: seriesAfter
}
]
};
return option;
} }
\ No newline at end of file
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<div class="box-list"> <div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box"> <div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card"> <el-card class="box-card">
<el-tooltip class="item-tool" placement="bottom-end" effect="light"> <!-- <el-tooltip class="item-tool" placement="bottom-end" effect="light">
<div slot="content"> <div slot="content">
<p v-for="text in item.content">{{ text }}</p> <p v-for="text in item.content">{{ text }}</p>
</div> </div>
<i class="el-icon-question notice"></i> <i class="el-icon-question notice"></i>
</el-tooltip> </el-tooltip> -->
<div class="left-content"> <div class="left-content">
<p class="title">{{ item.title }}</p> <p class="title">{{ item.title }}</p>
<p class="value">{{ item.value }}</p> <p class="value">{{ item.value }}</p>
...@@ -53,6 +53,7 @@ export default { ...@@ -53,6 +53,7 @@ export default {
}, },
created() { created() {
vm = this; vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "id");
}, },
mounted() { mounted() {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
...@@ -89,8 +90,8 @@ export default { ...@@ -89,8 +90,8 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
vm.initCard(res.data); vm.initCard(res.data);
setTimeout(function() { setTimeout(function() {
vm.setEducation(); vm.setEducation(res.data.educationEffectList);
vm.setLearning(); vm.setLearning(res.data.knowledgeEffectList);
}, 20); }, 20);
} }
}); });
...@@ -106,115 +107,36 @@ export default { ...@@ -106,115 +107,36 @@ export default {
title: "培训前后正确率" title: "培训前后正确率"
} }
]; ];
cardData[0] = data.befortRate + "%"; cardData[0].value = data.beforeRate*100 + "%";
cardData[1] = data.afterRate + "%"; cardData[1].value = data.afterRate*100 + "%";
vm.cardData = cardData;
}, },
setEducation() { setEducation(data) {
let myChart = echarts.init(this.$refs.education); let myChart = echarts.init(this.$refs.education);
let option = { let xAxisData = [];
title: { let seriesBefore = [];
text: "" let seriesAfter = [];
}, for(let i = 0; i < data.length ; i++) {
tooltip: { xAxisData.push(data[i].classifyName);
trigger: "axis", seriesBefore.push(data[i].beforeRate*100);
axisPointer: { seriesAfter.push(data[i].afterRate*100);
type: "shadow" }
} let option = chartData.educationEffect(xAxisData, seriesBefore ,seriesAfter);
},
color: ["#5D7092", "#FFB01B"],
legend: {
data: ["项目前总正确率", "项目后总正确率"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
data: ["本科", "大专", "中专及以下", "硕士", "博士", "其他"]
},
yAxis: {
min: 0,
max: 100,
type: "value",
axisLabel: {
formatter: "{value} %"
}
},
series: [
{
name: "项目前总正确率",
type: "bar",
barWidth: 10,
data: [45, 45, 34, 34, 4, 8]
},
{
name: "项目后总正确率",
type: "bar",
barWidth: 10,
data: [70, 66, 67, 67, 24, 24]
}
]
};
myChart.setOption(option); myChart.setOption(option);
vm.echartsData.chart1 = myChart; vm.echartsData.chart1 = myChart;
vm.updateResize(); vm.updateResize();
}, },
setLearning() { setLearning(data) {
let myChart = echarts.init(this.$refs.learning); let myChart = echarts.init(this.$refs.learning);
let option = { let xAxisData = [];
title: { let seriesBefore = [];
text: "" let seriesAfter = [];
}, for(let i = 0; i < data.length ; i++) {
tooltip: { xAxisData.push(data[i].classifyName);
trigger: "axis", seriesBefore.push(data[i].beforeRate*100);
axisPointer: { seriesAfter.push(data[i].afterRate*100);
type: "shadow" }
} let option = chartData.knowledgeEffect(xAxisData, seriesBefore ,seriesAfter);
},
color: ["#5D7092", "#FFB01B"],
legend: {
data: ["培训前正确率", "培训后正确率"]
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
axisLabel: {
interval: 0,
rotate: 45
},
type: "category",
data: ["推荐联合用药方案"]
},
yAxis: {
min: 0,
max: 100,
type: "value",
axisLabel: {
formatter: "{value} %"
}
},
series: [
{
name: "培训前正确率",
type: "bar",
barWidth: 10,
data: [45]
},
{
name: "培训后正确率",
type: "bar",
barWidth: 10,
data: [81]
}
]
};
myChart.setOption(option); myChart.setOption(option);
vm.echartsData.chart2 = myChart; vm.echartsData.chart2 = myChart;
vm.updateResize(); vm.updateResize();
...@@ -228,6 +150,63 @@ export default { ...@@ -228,6 +150,63 @@ export default {
background: #fff; background: #fff;
overflow: hidden; overflow: hidden;
padding: 10px; padding: 10px;
.box-list {
position: relative;
// width: 100%;
height: 110px;
.box-card {
position: relative;
background-color: #e3efed;
color: #449284;
width: 48%;
margin-right: 1%;
height: 110px;
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;
}
}
.vertical {
position: absolute;
left: 34%;
float: left;
margin-top: 23px;
width:1px;
height:57px;
background-color: #C1D8D4;
}
}
}
.chart { .chart {
position: relative; position: relative;
margin: 20px auto 0 auto; margin: 20px auto 0 auto;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册