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

考试分析页对接api

上级 cf9b7f36
<template>
<div class="examination-analysis">
<div class="box-list">
<div v-for="(item , index) in cardData" :key="index" class="box">
<el-card class="box-card">
<div slot="header" class="title">
<span class="weight">{{ item.title }}</span>
<!-- <el-tooltip class="item-tool" placement="bottom-end" effect="light">
<div slot="content">
<p v-for="text in item.content">{{ text }}</p>
</div>
<div class="box-content">
<span class="weight">{{ item.num }}</span>
{{ item.unit }}
<i class="el-icon-question notice"></i>
</el-tooltip>-->
<div class="left-content">
<p class="value">{{ item.value }}</p>
<p class="title">{{ item.title }}</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>-->
</el-card>
<div v-if="index+1 !== cardData.length" class="line"></div>
</div>
</div>
<!-- <div class="chart-title">完成项目考试次数情况</div>
<div class="chart" id="durationChart" ref="durationChart"></div>
<div class="chart-title">完成项目考试分数情况</div>
<div class="chart" id="durationChart" ref="durationChart"></div> -->
<div class="table">
<el-table :data="tableData" style="width: 100%" border>
<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
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 label="操作" fixed="right" align="center" min-width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="goPage(scope.row)">查看名单</el-button>
......@@ -28,7 +65,7 @@
</el-table-column>
<div slot="empty">
<div class="table-empty">
<img src="../../assets/image/no-content1.png">
<img src="../../assets/image/no-content1.png" />
<p>没有相关数据,请重新选择查询范围</p>
</div>
</div>
......@@ -51,11 +88,11 @@
</template>
<script>
import { log } from 'util';
import { log } from "util";
import * as operationData from "../../utils/operation";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
let vm
let vm;
export default {
props: {
formInline: {
......@@ -73,14 +110,14 @@ export default {
},
data() {
return {
projectId: '',
projectId: "",
tableData: [],
cardData: [],
totalRows: 0, //数据总数
pageNo: 1, //当前是第几页
pageSize: 20, //页面总数
labelTd: [],
showTd: [false,false,false,false],
showTd: [false, false, false, false]
};
},
created() {
......@@ -89,7 +126,7 @@ export default {
},
// 挂载到Dom完成时
mounted: function() {
this.$on('search',()=>{
this.$on("search", () => {
// console.log(this.formInline);
this.pageNo = 1;
this.search();
......@@ -101,7 +138,7 @@ export default {
}
});
});
this.$on("reset",() =>{
this.$on("reset", () => {
this.pageNo = 1;
this.pageSize = 20;
this.tableData = [];
......@@ -109,33 +146,20 @@ export default {
});
},
methods: {
setCardData(data) {
vm.totalRows = data.projectExamCount;
vm.cardData = [
{
title: "项目所有考试数",
num: data.projectExamCount,
unit: "门考试"
},
{
title: "项目所有考题数",
num: data.projectExamQuestionCount,
unit: "道题"
}
];
// vm.cardData[0].num = data.projectExamCount;
// vm.cardData[1].num = data.projectExamQuestionCount;
},
// 搜索列表
search() {
if (vm.formInline.region.length == 0) {
const h = this.$createElement;
vm.$message({
message: h('p', { style: 'color: #FF3399' }, '请先选择地区后再进行查询 ')
message: h(
"p",
{ style: "color: #FF3399" },
"请先选择地区后再进行查询 "
)
});
return;
}
let checkAll = operationData.hasAll(vm.formInline.organization)
let checkAll = operationData.hasAll(vm.formInline.organization);
let req = {
projectId: vm.projectId,
beginDate: operationData.setDuringTime(vm.formInline.during, "begin"),
......@@ -147,72 +171,103 @@ export default {
};
// console.log("4 req", req);
openLoading(vm);
vm.reportGET("report/portalProjectExam/getTotal", req).then(res => {
vm.POST("stats/report/exam", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
if(res.data.projectExamCount == 0 ) {
vm.$message("没有相关数据,请重新选择查询范围");
}
// if(res.data.projectExamCount == 0 ) {
// vm.$message("没有相关数据,请重新选择查询范围");
// }
vm.setCardData(res.data);
vm.labelTd = res.data.gradeNameList;
// vm.labelTd = res.data.gradeNameList;
} else {
vm.$message(res.message);
}
});
let reqList = req;
reqList.pageNo = vm.pageNo;
reqList.pageSize = vm.pageSize;
vm.reportGET("report/portalProjectExam/getExamList", 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];
}
}
});
// let reqList = req;
// reqList.pageNo = vm.pageNo;
// reqList.pageSize = vm.pageSize;
// vm.reportGET("report/portalProjectExam/getExamList", 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];
// }
// }
// });
//
},
setCardData(data) {
vm.totalRows = data.projectExamCount;
vm.cardData = [
{
title: "项目正式考试数",
value: "0门"
},
{
title: "项目摸底考试数",
value: "0门"
},
{
title: "项目所有考题数",
value: "0道"
}
];
vm.cardData[0].value = data.afterExamCount + "门";
vm.cardData[1].value = data.beforeExamCount + "门";
vm.cardData[2].value = data.examTitleCount + "道";
},
// 跳转查看名单页面
goPage(data) {
let checkAll = operationData.hasAll(vm.formInline.organization)
let checkAll = operationData.hasAll(vm.formInline.organization);
let routerData = {};
routerData = this.dialogData;
routerData.projectId = vm.projectId;
routerData.projectName = vm.getUrlSearch(window.location.href, "projectName");
routerData.projectName = vm.getUrlSearch(
window.location.href,
"projectName"
);
routerData.tableType = 2;
routerData.examId = data.examId;
routerData.ids = operationData.getIds(vm.formInline,vm.organizationList,checkAll);
routerData.type = operationData.getSearchType(vm.formInline,checkAll),
routerData.originalFlag = vm.formInline.checked == false ? 0 : 1
routerData.ids = operationData.getIds(
vm.formInline,
vm.organizationList,
checkAll
);
(routerData.type = operationData.getSearchType(vm.formInline, checkAll)),
(routerData.originalFlag = vm.formInline.checked == false ? 0 : 1);
// this.$router.push({ path: '/name-list', query: routerData});
let routeData = this.$router.resolve({ path: '/name-list', query: routerData});
window.open(routeData.href, '_blank');
let routeData = this.$router.resolve({
path: "/name-list",
query: routerData
});
window.open(routeData.href, "_blank");
},
// 更改数据显示数量
handleSizeChange(val) {
console.log(`每页 ${val} 条`)
vm.pageSize = val
vm.search()
console.log(`每页 ${val} 条`);
vm.pageSize = val;
vm.search();
},
// 换页
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
vm.pageNo = val
vm.search()
console.log(`当前页: ${val}`);
vm.pageNo = val;
vm.search();
}
}
};
......@@ -239,25 +294,85 @@ export default {
float: left;
margin-top: 20px;
}
.box {
}
.table {
margin-top: 30px;
}
.box-list {
position: relative;
// width: 100%;
height: 110px;
.box-card {
width: 48%;
margin-right: 1%;
position: relative;
background-color: #e3efed;
color: #449284;
width: 31%;
margin-right: 2%;
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: 100%;
height: 110px;
text-align: left;
padding: 23px 0 0 20px;
.title {
text-align: center;
font-size: 14px;
height: 14px;
line-height: 14px;
}
.box-content {
text-align: center;
height: 40px;
font-size: 15px;
.value {
margin-top: 20px;
margin-bottom: 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;
}
.right-content {
position: relative;
float: left;
width: 64%;
height: 110px;
text-align: left;
font-size: 14px;
padding: 23px 0 0 29px;
p {
height: 14px;
line-height: 14px;
}
.should {
margin-top: 28px;
}
}
}
.box-card2 {
width: 48%;
margin-right: 1%;
}
}
}
......
......@@ -243,7 +243,7 @@ export default {
// organizationData: "",
},
tags: [],
activeName: "fifth",
activeName: "fourth",
organizationNum: 0,
dialogVisible: false,
dialogUpdate: false,
......@@ -482,6 +482,7 @@ export default {
this.$refs.childDataAll.$emit("search");
this.$refs.childCrowd.$emit("search");
this.$refs.childCourse.$emit("search");
this.$refs.childExam.$emit("search");
this.$refs.childEffect.$emit("search");
// if (this.activeName == "first") {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册