|
@@ -115,8 +115,8 @@
|
|
|
</div>
|
|
|
<!-- <el-button type="primary" @click="searchCourse">查询</el-button> -->
|
|
|
<el-button type="primary" class="bgColor" @click="openTestDataBoard()"
|
|
|
- v-if="oid == '4c686762-1d0a-11ed-8c78-005056b86db5'">评测看板</el-button>
|
|
|
- <el-button type="primary" class="bgColor" @click="goToCourse()">新建评测</el-button>
|
|
|
+ v-if="oid == '4c686762-1d0a-11ed-8c78-005056b86db5'">表单看板</el-button>
|
|
|
+ <el-button type="primary" class="bgColor" @click="goToCourse()">新建表单</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -194,8 +194,10 @@
|
|
|
item.course_teacher.indexOf(userid) !== -1) || role == '1')"></span>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <div class="test_type" :class="{ no: item.look == '1', is: item.look == '2' }">
|
|
|
- <span>{{ item.look == '1' ? '未发布' : '已发布' }}</span>
|
|
|
+ <!-- <div class="test_type" :class="{ no: item.look == '1', is: item.look == '2' }"> -->
|
|
|
+ <div class="test_type" :class="getLookType(item)">
|
|
|
+ <!-- <span>{{ item.look == '1' ? '未发布' : '已发布' }}</span> -->
|
|
|
+ <span>{{ getLook(item) }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -223,9 +225,11 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="表单状态" min-width="80" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
+ <!-- <div class="test_type2" style="width: fit-content;margin: 0 auto;" :class="{ no: scope.row.look == '1', is: scope.row.look == '2' }"> -->
|
|
|
<div class="test_type2" style="width: fit-content;margin: 0 auto;"
|
|
|
- :class="{ no: scope.row.look == '1', is: scope.row.look == '2' }">
|
|
|
- <span>{{ scope.row.look == '1' ? '未发布' : '已发布' }}</span>
|
|
|
+ :class="getLookType(scope.row)">
|
|
|
+ <!-- <span>{{ scope.row.look == '1' ? '未发布' : '已发布' }}</span> -->
|
|
|
+ <span>{{ getLook(scope.row) }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -238,7 +242,8 @@
|
|
|
<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>
|
|
|
</template>
|
|
@@ -441,10 +446,71 @@ export default {
|
|
|
pageSize2: 20,
|
|
|
course2: [],
|
|
|
dataJ: {},
|
|
|
- typeJArray:[],
|
|
|
+ typeJArray: [],
|
|
|
zscore: 0
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ getLook() {
|
|
|
+ return function (item) {
|
|
|
+ let content = "";
|
|
|
+ if (item.look == '1') {
|
|
|
+ content = '未发布'
|
|
|
+ }
|
|
|
+ let now = new Date().getTime()
|
|
|
+ let isTime = item.over_at && new Date(item.over_at).getTime()
|
|
|
+ if (item.over_at && item.look == '2' && now > isTime && ((item.isUserCount > 0 && item.isUserCount > item.worksPerson) || item.isUserCount == 0)) {
|
|
|
+ content = '逾期'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && ((item.isUserCount == 0 && item.worksPerson > 0) || (item.isUserCount > 0 && 0 < item.worksPerson && item.worksPerson < item.isUserCount))) {
|
|
|
+ content = '进行中'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && item.worksPerson == 0) {
|
|
|
+ content = '未进行'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.look == '2' && (item.isUserCount > 0 && item.isUserCount <= item.worksPerson)) {
|
|
|
+ content = '已完成'
|
|
|
+ }
|
|
|
+ return content;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getLookType() {
|
|
|
+ return function (item) {
|
|
|
+ let content = "";
|
|
|
+ if (item.look == '1') {
|
|
|
+ // content = '未发布'
|
|
|
+ content = 'no'
|
|
|
+ }
|
|
|
+ let now = new Date().getTime()
|
|
|
+ let isTime = item.over_at && new Date(item.over_at).getTime()
|
|
|
+ if (item.over_at && item.look == '2' && now > isTime && ((item.isUserCount > 0 && item.isUserCount > item.worksPerson) || item.isUserCount == 0)) {
|
|
|
+ // content = '逾期'
|
|
|
+ content = 'noTime'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && ((item.isUserCount == 0 && item.worksPerson > 0) || (item.isUserCount > 0 && 0 < item.worksPerson && item.worksPerson < item.isUserCount))) {
|
|
|
+ // content = '进行中'
|
|
|
+ content = 'doing'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && item.worksPerson == 0) {
|
|
|
+ // content = '未进行'
|
|
|
+ content = 'nodo'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.look == '2' && (item.isUserCount > 0 && item.isUserCount <= item.worksPerson)) {
|
|
|
+ // content = '已完成'
|
|
|
+ content = 'is'
|
|
|
+ }
|
|
|
+ return content;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
random() {
|
|
|
return Math.random().toString(36).substr(2);
|
|
@@ -514,7 +580,7 @@ export default {
|
|
|
// this.$router.push(path);
|
|
|
},
|
|
|
goToCourse2(item) {
|
|
|
- if(item.worksCount > 0){
|
|
|
+ if (item.worksCount > 0) {
|
|
|
this.$confirm("该表单已存在数据,如果修改题目可能会导致数据错乱,是否进入编辑编辑?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
@@ -538,7 +604,7 @@ export default {
|
|
|
.catch(() => {
|
|
|
return;
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.$router.push(
|
|
|
"/addTest?cid=" +
|
|
|
item.courseId +
|
|
@@ -810,29 +876,29 @@ export default {
|
|
|
for (var i = 0; i < test.length; i++) {
|
|
|
if (test[i].look == '1') {
|
|
|
dataJ.noLook++
|
|
|
- console.log('index-----------',i)
|
|
|
+ console.log('index-----------', 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].isUserCount > 0 && test[i].isUserCount > test[i].isWorkCount) || test[i].isUserCount == 0)) {
|
|
|
dataJ.no++
|
|
|
- console.log('index-----------',i)
|
|
|
+ console.log('index-----------', i)
|
|
|
}
|
|
|
|
|
|
- if (((test[i].over_at && test[i].look == '2' && isTime > now) || (!test[i].over_at && test[i].look == '2')) && ((test[i].isUserCount == 0 && test[i].isWorkCount > 0) || (test[i].isUserCount > 0 && 0 < test[i].isWorkCount && test[i].isWorkCount < test[i].isUserCount))) {
|
|
|
+ if (((test[i].over_at && test[i].look == '2' && isTime > now) || (!test[i].over_at && test[i].look == '2')) && ((test[i].isUserCount == 0 && test[i].isWorkCount > 0) || (test[i].isUserCount > 0 && 0 < test[i].isWorkCount && test[i].isWorkCount < test[i].isUserCount))) {
|
|
|
dataJ.doing++
|
|
|
- console.log('index-----------',i)
|
|
|
+ console.log('index-----------', i)
|
|
|
}
|
|
|
|
|
|
|
|
|
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++
|
|
|
- console.log('index-----------',i)
|
|
|
+ console.log('index-----------', i)
|
|
|
}
|
|
|
|
|
|
- if(test[i].look == '2' && (test[i].isUserCount > 0 && test[i].isUserCount <= test[i].isWorkCount)){
|
|
|
+ if (test[i].look == '2' && (test[i].isUserCount > 0 && test[i].isUserCount <= test[i].isWorkCount)) {
|
|
|
dataJ.is++
|
|
|
- console.log('index-----------',i)
|
|
|
+ console.log('index-----------', i)
|
|
|
}
|
|
|
}
|
|
|
this.dataJ = dataJ
|
|
@@ -849,36 +915,36 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
typeJ['qita'] = {
|
|
|
- name: '其他',
|
|
|
- count: 0,
|
|
|
- scroe: 0,
|
|
|
- zcount: 0,
|
|
|
- kcount: 0
|
|
|
- }
|
|
|
- for(var i = 0; i < work.length; i++) {
|
|
|
- if(work[i].typeid){
|
|
|
+ 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{
|
|
|
+ typeJ[work[i].typeid].scroe += score
|
|
|
+ } else {
|
|
|
let score = this.getScore(work[i].courseJson)
|
|
|
typeJ['qita'].count++
|
|
|
- typeJ['qita'].scroe+=score
|
|
|
+ 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
|
|
|
+ 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++){
|
|
|
+ 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 && ((test[i].isUserCount > 0 && test[i].isUserCount > test[i].isWorkCount) || test[i].isUserCount == 0)) {
|
|
|
typeJ[test[i].typeid].kcount++
|
|
|
- }else if (test[i].over_at && test[i].look == '1' && now > isTime && ((test[i].isUserCount > 0 && test[i].isUserCount > test[i].isWorkCount) || test[i].isUserCount == 0)) {
|
|
|
+ } else if (test[i].over_at && test[i].look == '1' && now > isTime && ((test[i].isUserCount > 0 && test[i].isUserCount > test[i].isWorkCount) || test[i].isUserCount == 0)) {
|
|
|
typeJ['qita'].kcount++
|
|
|
}
|
|
|
}
|
|
@@ -948,7 +1014,7 @@ export default {
|
|
|
},
|
|
|
deleteCourse(cid) {
|
|
|
// if (this.time()) {
|
|
|
- this.$confirm("确定删除此评测吗?", "提示", {
|
|
|
+ this.$confirm("确定删除此表单吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
@@ -1942,6 +2008,21 @@ export default {
|
|
|
background-color: rgba(235, 154, 96, .1);
|
|
|
}
|
|
|
|
|
|
+.noTime {
|
|
|
+ color: rgb(77, 77, 77);
|
|
|
+ background-color: rgba(77, 77, 77, .1);
|
|
|
+}
|
|
|
+
|
|
|
+.doing {
|
|
|
+ color: rgb(54, 116, 231);
|
|
|
+ background-color: rgba(54, 116, 231, .1);
|
|
|
+}
|
|
|
+
|
|
|
+.nodo {
|
|
|
+ color: rgb(97, 184, 255);
|
|
|
+ background-color: rgba(97, 184, 255, .1);
|
|
|
+}
|
|
|
+
|
|
|
.test_type2 {
|
|
|
font-size: 14px;
|
|
|
border-radius: 5px;
|
|
@@ -1949,16 +2030,6 @@ export default {
|
|
|
padding: 3px 8px;
|
|
|
}
|
|
|
|
|
|
-.is {
|
|
|
- color: rgb(57, 204, 127);
|
|
|
- background-color: rgba(57, 204, 127, .1);
|
|
|
-}
|
|
|
-
|
|
|
-.no {
|
|
|
- color: rgb(235, 154, 96);
|
|
|
- background-color: rgba(235, 154, 96, .1);
|
|
|
-}
|
|
|
-
|
|
|
.sub_head {
|
|
|
position: relative;
|
|
|
font-size: 20px;
|