|
@@ -91,8 +91,10 @@
|
|
|
:fit="true"
|
|
|
v-loading="isLoading"
|
|
|
style="width: 100%"
|
|
|
+ @sort-change="ownScoreSort"
|
|
|
:header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
|
:row-class-name="tableRowClassName"
|
|
|
+ :default-sort = "{prop: 'ownScore', order: 'descending'}"
|
|
|
>
|
|
|
<el-table-column label="序号" min-width="5" align="center">
|
|
|
<template slot-scope="scope">
|
|
@@ -105,7 +107,7 @@
|
|
|
label="创建人"
|
|
|
min-width="5"
|
|
|
align="center"
|
|
|
- v-if="tType == 0"
|
|
|
+ v-if="false"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<div class="userImg">
|
|
@@ -122,16 +124,38 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="我的评分"
|
|
|
- min-width="10"
|
|
|
+ <el-table-column
|
|
|
+ label="案例分类"
|
|
|
+ min-width="20"
|
|
|
align="center"
|
|
|
v-if="tType == 2"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <div>{{ scope.row.ownScore ? scope.row.ownScore : "-" }}</div>
|
|
|
+ <div>{{ scope.row.typename ? scope.row.typename : "-" }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ label="我的评分"
|
|
|
+ min-width="10"
|
|
|
+ align="center"
|
|
|
+ prop="ownScore"
|
|
|
+ sortable="custom"
|
|
|
+ v-if="tType == 2"
|
|
|
+ >
|
|
|
+ <template slot="header">
|
|
|
+ <div style="display: flex;float: left;align-items: center;position: relative;">
|
|
|
+ <el-tooltip effect="light" :content="`一等90分以上 占比${ratingData.one[1]}%,二等75-89 占比${ratingData.two[1]}%,三等60-74 占比${ratingData.three[1]}%`" placement="top">
|
|
|
+ <div style="position:relative;left:15px;top:5px;">我的评分</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.ownScore ? scope.row.ownScore : "-" }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
<el-table-column
|
|
|
label="所属单位"
|
|
|
min-width="10"
|
|
@@ -181,22 +205,21 @@
|
|
|
label="平均得分"
|
|
|
min-width="10"
|
|
|
align="center"
|
|
|
+ sortable="custom"
|
|
|
v-if="tType == 0"
|
|
|
>
|
|
|
+ <template slot="header">
|
|
|
+ <div style="display: flex;float: left;align-items: center;position: relative;">
|
|
|
+ <el-tooltip effect="light" :content="`一等90分以上 占比${ratingDataAdmin.one[1]}%,二等75-89 占比${ratingDataAdmin.two[1]}%,三等60-74 占比${ratingDataAdmin.three[1]}%`" placement="top">
|
|
|
+ <div style="position:relative;left:40px;top:5px;">平均得分</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope">
|
|
|
<div>{{ scope.row.sum ? scope.row.sum : "-" }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="案例分类"
|
|
|
- min-width="20"
|
|
|
- align="center"
|
|
|
- v-if="tType == 2"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>{{ scope.row.typename ? scope.row.typename : "-" }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+
|
|
|
<!-- <el-table-column
|
|
|
label="所获奖项"
|
|
|
min-width="10"
|
|
@@ -251,7 +274,7 @@
|
|
|
)
|
|
|
"
|
|
|
>
|
|
|
- 案例详情
|
|
|
+ 查看
|
|
|
</div>
|
|
|
<!-- <div @click="openScore(scope.row, 1)">立即评分</div> -->
|
|
|
<div
|
|
@@ -290,6 +313,18 @@
|
|
|
@current-change="handleCurrentChange"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
+ <div class="rating_information" v-if="tType=='2'">
|
|
|
+ <div class="ri-card" style="background-color: #E2F0D9;">90分以上:{{ratingData.one[0]}}个 {{ratingData.one[1]}}%</div>
|
|
|
+ <div class="ri-card" style="background-color: #E2F0D9;">89-75分:{{ratingData.two[0]}}个 {{ratingData.two[1]}}%</div>
|
|
|
+ <div class="ri-card" style="background-color: #FCE4D6 ;">74-60分以上:{{ratingData.three[0]}}个 {{ratingData.three[1]}}%</div>
|
|
|
+ <div class="ri-card" style="background-color: #E7E6E6;">未评分:{{ratingData.four[0]}}个 {{ratingData.four[1]}}%</div>
|
|
|
+ </div>
|
|
|
+ <div class="rating_information" v-if="tType=='0'">
|
|
|
+ <div class="ri-card" style="background-color: #E2F0D9;">90分以上:{{ratingDataAdmin.one[0]}}个 {{ratingDataAdmin.one[1]}}%</div>
|
|
|
+ <div class="ri-card" style="background-color: #E2F0D9;">89-75分:{{ratingDataAdmin.two[0]}}个 {{ratingDataAdmin.two[1]}}%</div>
|
|
|
+ <div class="ri-card" style="background-color: #FCE4D6 ;">74-60分以上:{{ratingDataAdmin.three[0]}}个 {{ratingDataAdmin.three[1]}}%</div>
|
|
|
+ <div class="ri-card" style="background-color: #E7E6E6;">未评分:{{ratingDataAdmin.four[0]}}个 {{ratingDataAdmin.four[1]}}%</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-dialog
|
|
@@ -438,7 +473,7 @@ export default {
|
|
|
page: 1,
|
|
|
total: 0,
|
|
|
// anliType: "",
|
|
|
- tableHeight: "500px",
|
|
|
+ tableHeight: "100%",
|
|
|
isLoading: false,
|
|
|
CourseType: [],
|
|
|
CourseTypeJson: {},
|
|
@@ -447,6 +482,9 @@ export default {
|
|
|
anliName: "",
|
|
|
anliBox: "",
|
|
|
tableData: [],
|
|
|
+ scoreListData:[],
|
|
|
+ allScoreList:[],
|
|
|
+ scoreFn:2,// 0 默认 1 升序 2 降序
|
|
|
reviewer: "",
|
|
|
reviewerBox: [],
|
|
|
checkboxList: [],
|
|
@@ -476,6 +514,66 @@ export default {
|
|
|
reCid: "",
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ratingData(){
|
|
|
+ const myScore = this.allScoreList.filter(i=>i.scorer===this.userid)
|
|
|
+
|
|
|
+ let one = [0,0];
|
|
|
+ let two = [0,0];
|
|
|
+ let three = [0,0];
|
|
|
+ let four = [0,0];
|
|
|
+
|
|
|
+ myScore.forEach(i=>{
|
|
|
+ let score = JSON.parse(i.score);
|
|
|
+ let total = (score.first + score.second + score.third)/3;
|
|
|
+ if(total>=90){
|
|
|
+ one[0]++;
|
|
|
+ }else if(total>=75 && total<=89){
|
|
|
+ two[0]++;
|
|
|
+ }else if(total>=60 && total<=74){
|
|
|
+ three[0]++;
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ four[0] = this.total-myScore.length;
|
|
|
+
|
|
|
+ one[1] = (one[0]/this.total).toFixed(4)*100
|
|
|
+ two[1] = (two[0]/this.total).toFixed(4)*100
|
|
|
+ three[1] = (three[0]/this.total).toFixed(4)*100
|
|
|
+ four[1] = (four[0]/this.total).toFixed(4)*100
|
|
|
+
|
|
|
+ return {one:one,two:two,three:three,four:four}
|
|
|
+ },
|
|
|
+ ratingDataAdmin(){
|
|
|
+ const score = this.scoreListData;
|
|
|
+
|
|
|
+ let one = [0,0];
|
|
|
+ let two = [0,0];
|
|
|
+ let three = [0,0];
|
|
|
+ let four = [0,0];
|
|
|
+
|
|
|
+ score.forEach(i=>{
|
|
|
+ let sum = i.sum;
|
|
|
+ if(sum===0){
|
|
|
+ four[0]++
|
|
|
+ }
|
|
|
+ if(parseFloat(sum)>=90){
|
|
|
+ one[0]++
|
|
|
+ }else if(parseFloat(sum)>=75 && parseFloat(sum)<=89){
|
|
|
+ two[0]++;
|
|
|
+ }else if(parseFloat(sum)>=60 && parseFloat(sum)<=74){
|
|
|
+ three[0]++;
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ one[1] = (one[0]/this.total).toFixed(4)*100
|
|
|
+ two[1] = (two[0]/this.total).toFixed(4)*100
|
|
|
+ three[1] = (three[0]/this.total).toFixed(4)*100
|
|
|
+ four[1] = (four[0]/this.total).toFixed(4)*100
|
|
|
+
|
|
|
+ return {one:one,two:two,three:three,four:four}
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.$nextTick(function () {
|
|
|
this.tableHeight =
|
|
@@ -615,8 +713,10 @@ export default {
|
|
|
.get(this.$store.state.api + "selectPointAll", params)
|
|
|
.then((res) => {
|
|
|
|
|
|
+
|
|
|
this.total = res.data[0].length > 0 ? res.data[0].length : 0;
|
|
|
var scoreList = res.data[0];
|
|
|
+ this.scoreListData = scoreList;
|
|
|
for (var i = 0; i < scoreList.length; i++) {
|
|
|
scoreList[i].info = JSON.parse(scoreList[i].info);
|
|
|
if (scoreList[i].score != null) {
|
|
@@ -628,13 +728,17 @@ export default {
|
|
|
scoreList[i].sum = sumScore;
|
|
|
}
|
|
|
}
|
|
|
- scoreList.sort((item1, item2) => item2.sum - item1.sum);
|
|
|
+
|
|
|
+ // 降序
|
|
|
+ // scoreList.sort((item1, item2) => item2.sum - item1.sum);
|
|
|
+ // 升序
|
|
|
+ // scoreList.sort((item1, item2) => item1.sum - item2.sum);
|
|
|
|
|
|
- sessionStorage.setItem("allScoreList",JSON.stringify(scoreList.map(i=>i.id)))
|
|
|
- const start = (this.page - 1) * 10;
|
|
|
- const end = start + 10;
|
|
|
- let pageData = scoreList.slice(start, end);
|
|
|
- this.selectPwScore(pageData);
|
|
|
+
|
|
|
+ // const start = (this.page - 1) * 10;
|
|
|
+ // const end = start + 10;
|
|
|
+ // let pageData = scoreList.slice(start, end);
|
|
|
+ this.selectPwScore(scoreList);
|
|
|
this.isLoading = false;
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -646,6 +750,7 @@ export default {
|
|
|
.get(this.$store.state.api + "selectAllScore")
|
|
|
.then((res) => {
|
|
|
var scoreList = res.data[0];
|
|
|
+ this.allScoreList = scoreList;
|
|
|
for (var j = 0; j < p.length; j++) {
|
|
|
let sum = 0;
|
|
|
let isScore = 0;
|
|
@@ -680,8 +785,29 @@ export default {
|
|
|
}
|
|
|
p[j].sum = isScore == 0 ? 0 : (sum / isScore).toFixed(2);
|
|
|
}
|
|
|
- this.tableData = p;
|
|
|
- console.log(this.tableData);
|
|
|
+
|
|
|
+ if(this.scoreFn===1){//升序
|
|
|
+ // 升序
|
|
|
+ p.sort((a, b) => {
|
|
|
+ let aScore = a.hasOwnProperty(this.tType==2?'ownScore':'sum') ? this.tType=='2'?a.ownScore:a.sum===0?Number.MAX_VALUE: parseFloat(a.sum) : Number.MAX_VALUE;
|
|
|
+ let bScore = b.hasOwnProperty(this.tType==2?'ownScore':'sum') ? this.tType=='2'?b.ownScore:b.sum===0?Number.MAX_VALUE: parseFloat(b.sum) : Number.MAX_VALUE;
|
|
|
+ return aScore - bScore;
|
|
|
+ })
|
|
|
+ }else if(this.scoreFn===2){//降序
|
|
|
+ //降序
|
|
|
+ p.sort((a, b) => {
|
|
|
+ let aScore = a.hasOwnProperty(this.tType==2?'ownScore':'sum') ? this.tType=='2'?a.ownScore:a.sum===0?-1: parseFloat(a.sum) : -1;
|
|
|
+ let bScore = b.hasOwnProperty(this.tType==2?'ownScore':'sum') ? this.tType=='2'?b.ownScore:b.sum===0?-1: parseFloat(b.sum) : -1;
|
|
|
+ return bScore - aScore;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ sessionStorage.setItem("allScoreList",JSON.stringify(p.map(i=>i.id)))
|
|
|
+
|
|
|
+ const start = (this.page - 1) * 10;
|
|
|
+ const end = start + 10;
|
|
|
+ let result = p.slice(start, end);
|
|
|
+ this.tableData = result;
|
|
|
this.$forceUpdate();
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -1029,6 +1155,17 @@ export default {
|
|
|
type: "success",
|
|
|
});
|
|
|
},
|
|
|
+ // 我的评分排序
|
|
|
+ ownScoreSort(row,column){
|
|
|
+ if(row.order==="descending"){
|
|
|
+ this.scoreFn=2
|
|
|
+ }else if(row.order==="ascending"){
|
|
|
+ this.scoreFn=1
|
|
|
+ }else{
|
|
|
+ this.scoreFn=2
|
|
|
+ }
|
|
|
+ this.search()
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
// this.getAnliList();
|
|
@@ -1134,8 +1271,31 @@ export default {
|
|
|
}
|
|
|
|
|
|
.student_page {
|
|
|
- width: 95%;
|
|
|
+ width: 100%;
|
|
|
margin: 20px auto 0;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+
|
|
|
+.rating_information{
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ margin-left: 20px;
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.ri-card{
|
|
|
+ width: auto;
|
|
|
+ font-size: 14px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding: 5px 10px;
|
|
|
+ white-space: nowrap;
|
|
|
+ margin-right: 20px;
|
|
|
+ border-radius: 5px;
|
|
|
}
|
|
|
|
|
|
.anliBox {
|