|
@@ -24,19 +24,20 @@
|
|
|
<span class="active">个人总览</span>
|
|
|
</div>
|
|
|
<div class="bbox">
|
|
|
- <div class="test_data_box">
|
|
|
+ <div class="test_data_box" v-loading="isLoadingData">
|
|
|
<div class="data_box">
|
|
|
<div class="left">
|
|
|
<div class="title">表单状态总览</div>
|
|
|
<div class="box">
|
|
|
- <span class="color1">{{ 10 }}个进行中</span>
|
|
|
- <span class="color2">{{ 8 }}个未发布</span>
|
|
|
- <span class="color3">{{ 6 }}个已完成</span>
|
|
|
- <span class="color4">{{ 7 }}个逾期</span>
|
|
|
+ <span class="color1">{{ dataJ.doing }}个进行中</span>
|
|
|
+ <span class="color5">{{ dataJ.nodo }}个未进行</span>
|
|
|
+ <span class="color2">{{ dataJ.noLook }}个未发布</span>
|
|
|
+ <span class="color3">{{ dataJ.is }}个已完成</span>
|
|
|
+ <span class="color4">{{ dataJ.no }}个逾期</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
- <pie-1></pie-1>
|
|
|
+ <pie-1 :dataJ="dataJ"></pie-1>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="data_box">
|
|
@@ -53,33 +54,33 @@
|
|
|
<pie-2></pie-2>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="data_box">
|
|
|
+ <div class="data_box" v-if="typeArray.length">
|
|
|
<div class="left">
|
|
|
<div class="title">综合平均分</div>
|
|
|
<div class="box2">
|
|
|
- <span>{{ 85 }}</span>
|
|
|
+ <span>{{ zscore.toFixed(0) }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
- <randar-1></randar-1>
|
|
|
+ <randar-1 :typeJArray="typeJArray"></randar-1>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="data_box">
|
|
|
- <div class="left">
|
|
|
- <div class="title">逾期情况</div>
|
|
|
- <div class="box2">
|
|
|
+ <div class="data_box" v-if="typeArray.length" style="flex-direction: column;">
|
|
|
+ <div class="left" style="height: fit-content;text-align: left;width: 100%;">
|
|
|
+ <div class="title" style="margin: 0;">逾期情况</div>
|
|
|
+ <!-- <div class="box2">
|
|
|
<span>{{ 12 }}%</span>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
- <div class="right">
|
|
|
- <randar-2></randar-2>
|
|
|
+ <div class="right" style="height: calc(100% - 20px);">
|
|
|
+ <randar-2 :typeJArray="typeJArray"></randar-2>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="search_nav">
|
|
|
<div class="right">
|
|
|
<span :class="{ active: stype == 1 }" @click="checkDataType(1)">按问卷查看</span>
|
|
|
- <span :class="{active: stype == 2}" @click="checkDataType(2)">按人员查看</span>
|
|
|
+ <span :class="{ active: stype == 2 }" @click="checkDataType(2)">按人员查看</span>
|
|
|
</div>
|
|
|
<div class="left">
|
|
|
<span class="list" :class="{ active: stype2 == 1 }" @click="checkStype2(1)"></span>
|
|
@@ -150,11 +151,12 @@
|
|
|
<span><span>截止日期</span></span><span>{{ item.overtime ? item.overtime : '未设置' }}</span>
|
|
|
</div>
|
|
|
<div class="test_time">
|
|
|
- <span><span>填写范围</span></span><el-tooltip :content="item.juriP ? item.juriP : '所有人'" placement="top" effect="dark">
|
|
|
+ <span><span>填写范围</span></span><el-tooltip :content="item.juriP ? item.juriP : '所有人'"
|
|
|
+ placement="top" effect="dark">
|
|
|
<!-- content to trigger tooltip here -->
|
|
|
<span>{{ item.juriP ? item.juriP : '所有人' }}</span>
|
|
|
</el-tooltip>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
<div class="test_time tset_type" v-if="typeArray.length">
|
|
|
<span><span>类型</span></span>
|
|
@@ -229,18 +231,16 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="350px">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="goToCourse2(scope.row.courseId)" type="text" size="small"
|
|
|
- v-if="((scope.row.userid == userid) ||
|
|
|
- (scope.row.course_teacher &&
|
|
|
+ <el-button @click="goToCourse2(scope.row.courseId)" type="text" size="small" v-if="((scope.row.userid == userid) ||
|
|
|
+ (scope.row.course_teacher &&
|
|
|
scope.row.course_teacher.indexOf(userid) !== -1) || role == '1')">编辑</el-button>
|
|
|
<el-button @click="checkToTest(scope.row.courseId)" type="text" size="small">查看</el-button>
|
|
|
<el-button @click="copyTest(scope.row.courseId)" type="text" size="small">复制</el-button>
|
|
|
<el-button @click="shareTest(scope.row)" type="text" size="small">提醒</el-button>
|
|
|
<el-button @click="deleteCourse(scope.row.courseId)" type="text" size="small"
|
|
|
- style="color: #EE3E3E;"
|
|
|
- v-if="((scope.row.userid == userid) ||
|
|
|
+ style="color: #EE3E3E;" v-if="((scope.row.userid == userid) ||
|
|
|
(scope.row.course_teacher &&
|
|
|
- scope.row.course_teacher.indexOf(userid) !== -1) || role == '1')">删除</el-button>
|
|
|
+ scope.row.course_teacher.indexOf(userid) !== -1) || role == '1')">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -259,7 +259,8 @@
|
|
|
<span><span>已完成表单</span></span><span>{{ item.testCount }}</span>
|
|
|
</div>
|
|
|
<div class="test_time">
|
|
|
- <span><span>教研室</span></span><el-tooltip :content="item.className ? item.className : '无'" placement="top" effect="dark">
|
|
|
+ <span><span>教研室</span></span><el-tooltip :content="item.className ? item.className : '无'"
|
|
|
+ placement="top" effect="dark">
|
|
|
<!-- content to trigger tooltip here -->
|
|
|
<span>{{ item.className ? item.className : '无' }}</span>
|
|
|
</el-tooltip>
|
|
@@ -383,7 +384,7 @@ import randar2 from "./data/randar2.vue";
|
|
|
import shareBox from './shareBox/index.vue'
|
|
|
export default {
|
|
|
name: 'test',
|
|
|
- components: { EditorBar, CourseProblem, pie1, pie2, randar1, randar2,shareBox },
|
|
|
+ components: { EditorBar, CourseProblem, pie1, pie2, randar1, randar2, shareBox },
|
|
|
data() {
|
|
|
return {
|
|
|
itemCount: 1,
|
|
@@ -391,6 +392,7 @@ export default {
|
|
|
courseText: "",
|
|
|
courseTime: "",
|
|
|
isLoading: false,
|
|
|
+ isLoadingData: false,
|
|
|
fileList: [],
|
|
|
fileList1: [],
|
|
|
homeworkList: [{ name: "" }],
|
|
@@ -432,17 +434,19 @@ export default {
|
|
|
typeCheck: "",
|
|
|
stype: 1,
|
|
|
stype2: 1,
|
|
|
- scid:{},
|
|
|
- dialogVisibleShare:false,
|
|
|
+ scid: {},
|
|
|
+ dialogVisibleShare: false,
|
|
|
page2: 1,
|
|
|
total2: 0,
|
|
|
pageSize2: 20,
|
|
|
course2: [],
|
|
|
-
|
|
|
+ dataJ: {},
|
|
|
+ typeJArray:[],
|
|
|
+ zscore: 0
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- random(){
|
|
|
+ random() {
|
|
|
return Math.random().toString(36).substr(2);
|
|
|
},
|
|
|
tableRowClassName2({ row, rowIndex }) {
|
|
@@ -539,7 +543,7 @@ export default {
|
|
|
this.role
|
|
|
);
|
|
|
},
|
|
|
- checkToTest2(uid){
|
|
|
+ checkToTest2(uid) {
|
|
|
this.$router.push(
|
|
|
"/checkToTest2?uid=" +
|
|
|
uid +
|
|
@@ -609,7 +613,7 @@ export default {
|
|
|
this.page = val;
|
|
|
this.getCourse();
|
|
|
},
|
|
|
- handleCurrentChange2(val){
|
|
|
+ handleCurrentChange2(val) {
|
|
|
this.page2 = val
|
|
|
this.getCourse2();
|
|
|
},
|
|
@@ -653,12 +657,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
searchCourse() {
|
|
|
- if(this.stype == 1){
|
|
|
+ if (this.stype == 1) {
|
|
|
this.page = 1
|
|
|
- this.getCourse();
|
|
|
- }else if(this.stype == 2){
|
|
|
+ this.getCourse();
|
|
|
+ } else if (this.stype == 2) {
|
|
|
this.page2 = 1
|
|
|
- this.getCourse2();
|
|
|
+ this.getCourse2();
|
|
|
}
|
|
|
},
|
|
|
clear() {
|
|
@@ -668,12 +672,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.typeCheck = ''
|
|
|
- if(this.stype == 1){
|
|
|
+ if (this.stype == 1) {
|
|
|
this.page = 1
|
|
|
- this.getCourse();
|
|
|
- }else if(this.stype == 2){
|
|
|
+ this.getCourse();
|
|
|
+ } else if (this.stype == 2) {
|
|
|
this.page2 = 1
|
|
|
- this.getCourse2();
|
|
|
+ this.getCourse2();
|
|
|
}
|
|
|
},
|
|
|
getCourse() {
|
|
@@ -730,12 +734,14 @@ export default {
|
|
|
this.isLoading = false;
|
|
|
this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
this.course = res.data[0];
|
|
|
+
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
+ this.isLoading = false;
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
- getCourse2(){
|
|
|
+ getCourse2() {
|
|
|
this.isLoading = true;
|
|
|
let params = {
|
|
|
oid: this.oid,
|
|
@@ -753,9 +759,130 @@ export default {
|
|
|
this.course2 = res.data[0];
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
+ this.isLoading = false;
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ let params = {
|
|
|
+ oid: this.oid,
|
|
|
+ org: this.org,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "testDataBoard", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.isLoadingData = false;
|
|
|
+ let test = res.data[0]
|
|
|
+ let work = res.data[1]
|
|
|
+ let dataJ = {
|
|
|
+ doing: 0,
|
|
|
+ nodo: 0,
|
|
|
+ noLook: 0,
|
|
|
+ is: 0,
|
|
|
+ no: 0
|
|
|
+ }
|
|
|
+ for (var i = 0; i < test.length; i++) {
|
|
|
+ if (test[i].look == '1') {
|
|
|
+ dataJ.noLook++
|
|
|
+ }
|
|
|
+
|
|
|
+ let now = new Date().getTime()
|
|
|
+ let isTime = test[i].over_at && new Date(test[i].over_at).getTime()
|
|
|
+ if (test[i].over_at && test[i].look == '2' && now > isTime) {
|
|
|
+ dataJ.no++
|
|
|
+ }
|
|
|
+
|
|
|
+ if (((test[i].over_at && test[i].look == '2' && isTime > now) || (!test[i].over_at && test[i].look == '2')) && test[i].isWorkCount > 0) {
|
|
|
+ dataJ.doing++
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (((test[i].over_at && test[i].look == '2' && isTime > now) || (!test[i].over_at && test[i].look == '2')) && test[i].isWorkCount == 0) {
|
|
|
+ dataJ.nodo++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.dataJ = dataJ
|
|
|
+
|
|
|
+ if (this.typeArray.length) {
|
|
|
+ let typeJ = {}
|
|
|
+ for (var i = 0; i < this.typeArray.length; i++) {
|
|
|
+ typeJ[this.typeArray[i].id] = {
|
|
|
+ name: this.typeArray[i].name,
|
|
|
+ count: 0,
|
|
|
+ scroe: 0,
|
|
|
+ zcount: 0,
|
|
|
+ kcount: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ typeJ['qita'] = {
|
|
|
+ name: '其他',
|
|
|
+ count: 0,
|
|
|
+ scroe: 0,
|
|
|
+ zcount: 0,
|
|
|
+ kcount: 0
|
|
|
+ }
|
|
|
+ for(var i = 0; i < work.length; i++) {
|
|
|
+ if(work[i].typeid){
|
|
|
+ let score = this.getScore(work[i].courseJson)
|
|
|
+ typeJ[work[i].typeid].count++
|
|
|
+ typeJ[work[i].typeid].scroe+=score
|
|
|
+ }else{
|
|
|
+ let score = this.getScore(work[i].courseJson)
|
|
|
+ typeJ['qita'].count++
|
|
|
+ typeJ['qita'].scroe+=score
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let typeJArray = Object.values(typeJ)
|
|
|
+ let zscore = 0
|
|
|
+ for(var i = 0; i < typeJArray.length; i++){
|
|
|
+ typeJArray[i].zcount = typeJArray[i].scroe ? Math.round(typeJArray[i].scroe/typeJArray[i].count) : 0
|
|
|
+ zscore += typeJArray[i].zcount
|
|
|
+ }
|
|
|
+ this.zscore = zscore ? zscore / typeJArray.length : 0
|
|
|
+ for(var i = 0; i < test.length; i++){
|
|
|
+ let now = new Date().getTime()
|
|
|
+ let isTime = test[i].over_at && new Date(test[i].over_at).getTime()
|
|
|
+ if (test[i].over_at && test[i].look == '2' && now > isTime && test[i].typeid) {
|
|
|
+ typeJ[test[i].typeid].kcount++
|
|
|
+ }else if (test[i].over_at && test[i].look == '1' && now > isTime) {
|
|
|
+ typeJ['qita'].kcount++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.typeJArray = typeJArray
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.isLoadingData = false;
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ getScore(courseJson) {
|
|
|
+ // let _array = JSON.parse(array)
|
|
|
+ let _score = 0;
|
|
|
+ let _array = JSON.parse(courseJson);
|
|
|
+ for (var j = 0; j < _array.length; j++) {
|
|
|
+ let el = _array[j];
|
|
|
+ if ((el.ttype == 3 || el.ttype == 2) && el.array.length > 0) {
|
|
|
+ for (var k = 0; k < el.array.length; k++) {
|
|
|
+ let item = el.array[k];
|
|
|
+ if (item.ttype == 2 && item.array.length > 0) {
|
|
|
+ for (var z = 0; z < item.array.length; z++) {
|
|
|
+ let item2 = item.array[z];
|
|
|
+ if (item2.ttype == 1 && item2.json && item2.json.score2) {
|
|
|
+ _score += parseInt(item2.json.score2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (item.ttype == 1 && item.json && item.json.score2) {
|
|
|
+ _score += parseInt(item.json.score2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (el.ttype == 1 && el.json && el.json.score2) {
|
|
|
+ _score += parseInt(el.json.score2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return _score ? _score : 0;
|
|
|
+ },
|
|
|
getTypeName() {
|
|
|
this.$forceUpdate();
|
|
|
this.page = 1;
|
|
@@ -781,7 +908,7 @@ export default {
|
|
|
// console.error(err);
|
|
|
// });
|
|
|
// },
|
|
|
- shareTest(cid){
|
|
|
+ shareTest(cid) {
|
|
|
this.scid = cid
|
|
|
this.dialogVisibleShare = true
|
|
|
},
|
|
@@ -876,6 +1003,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
selectTestType() {
|
|
|
+ this.isLoadingData = true
|
|
|
let params = {
|
|
|
oid: this.oid,
|
|
|
};
|
|
@@ -883,6 +1011,7 @@ export default {
|
|
|
.get(this.$store.state.api + "selectTestType", params)
|
|
|
.then((res) => {
|
|
|
this.typeArray = res.data[0];
|
|
|
+ this.getData()
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
console.error(err);
|
|
@@ -990,22 +1119,22 @@ export default {
|
|
|
checkDataType(type) {
|
|
|
if (this.stype != type) {
|
|
|
this.stype = type
|
|
|
- if(type == 1){
|
|
|
+ if (type == 1) {
|
|
|
this.page = 1
|
|
|
this.getCourse()
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.page2 = 1
|
|
|
this.getCourse2()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
search() {
|
|
|
- if(this.stype == 1){
|
|
|
+ if (this.stype == 1) {
|
|
|
this.page = 1
|
|
|
- this.getCourse();
|
|
|
- }else if(this.stype == 2){
|
|
|
+ this.getCourse();
|
|
|
+ } else if (this.stype == 2) {
|
|
|
this.page2 = 1
|
|
|
- this.getCourse2();
|
|
|
+ this.getCourse2();
|
|
|
}
|
|
|
},
|
|
|
checkProblem(res) {
|
|
@@ -1037,10 +1166,10 @@ export default {
|
|
|
activated() {
|
|
|
console.log(1);
|
|
|
this.selectAllType();
|
|
|
- if(this.stype == 1){
|
|
|
- this.getCourse();
|
|
|
- }else if(this.stype == 2){
|
|
|
- this.getCourse2();
|
|
|
+ if (this.stype == 1) {
|
|
|
+ this.getCourse();
|
|
|
+ } else if (this.stype == 2) {
|
|
|
+ this.getCourse2();
|
|
|
}
|
|
|
this.selectTestType();
|
|
|
},
|
|
@@ -1051,10 +1180,10 @@ export default {
|
|
|
}
|
|
|
this.page = 1;
|
|
|
this.selectAllType();
|
|
|
- if(this.stype == 1){
|
|
|
- this.getCourse();
|
|
|
- }else if(this.stype == 2){
|
|
|
- this.getCourse2();
|
|
|
+ if (this.stype == 1) {
|
|
|
+ this.getCourse();
|
|
|
+ } else if (this.stype == 2) {
|
|
|
+ this.getCourse2();
|
|
|
}
|
|
|
this.selectTestType();
|
|
|
},
|
|
@@ -1757,6 +1886,7 @@ export default {
|
|
|
background-image: url('../../../assets/icon/test/share_test_icon.png');
|
|
|
margin-right: 20px;
|
|
|
}
|
|
|
+
|
|
|
.test_box>.test_btn>.test_o_btn>.delete {
|
|
|
background-image: url('../../../assets/icon/test/delete_test_icon.png');
|
|
|
}
|
|
@@ -1794,6 +1924,7 @@ export default {
|
|
|
color: rgb(235, 154, 96);
|
|
|
background-color: rgba(235, 154, 96, .1);
|
|
|
}
|
|
|
+
|
|
|
.sub_head {
|
|
|
position: relative;
|
|
|
font-size: 20px;
|
|
@@ -2050,6 +2181,10 @@ export default {
|
|
|
background: #f5b763;
|
|
|
}
|
|
|
|
|
|
+.test_data_box>.data_box>.left>.box>.color5::before {
|
|
|
+ background: #b362ff;
|
|
|
+}
|
|
|
+
|
|
|
.test_data_box>.data_box>.right {
|
|
|
/* width: calc(100% - 110px); */
|
|
|
width: calc(100%);
|
|
@@ -2063,5 +2198,6 @@ export default {
|
|
|
.tableClass {
|
|
|
width: calc(100% - 20px);
|
|
|
margin: 0 auto;
|
|
|
-}</style>
|
|
|
+}
|
|
|
+</style>
|
|
|
|