|
@@ -23,7 +23,7 @@
|
|
|
</p> -->
|
|
|
<span v-if="item.isFinish" class="info-end">已结束</span>
|
|
|
<span v-else :class="['info-end', item.completeCount === item.taskCount ? 'info-review' : 'info-progress']">{{ item.completeCount === item.taskCount ? '已评审' : '评审中' }}</span>
|
|
|
- <span v-show="!item.isFinish" class="info-end">需评审 {{ item.taskCount - item.completeCount }} 个</span>
|
|
|
+ <span v-show="!item.isFinish && item.completeCount != item.taskCount" class="info-end">需评审 {{ item.taskCount - item.completeCount }} 个</span>
|
|
|
</div>
|
|
|
<p class="info-time">
|
|
|
<el-icon><Clock /></el-icon>
|
|
@@ -39,7 +39,7 @@
|
|
|
<div class="info-box">
|
|
|
<el-tabs v-model="actTab" class="demo-tabs">
|
|
|
<el-tab-pane label="作品评审" name="user">
|
|
|
- <el-scrollbar height="750px">
|
|
|
+ <el-scrollbar>
|
|
|
<div>
|
|
|
<p @click="skModule = !skModule" class="module-box">
|
|
|
<el-icon v-show="skModule"><CaretBottom /></el-icon>
|
|
@@ -65,12 +65,14 @@
|
|
|
</div>
|
|
|
<div class="review-header-works">
|
|
|
<div class="works-list">
|
|
|
- <div v-for="(item, index) in workInfo.files" :key="index" @click="changeFile(item, index)" :class="['files-list', {'active-file': fileIndex === index}]">
|
|
|
- <p>{{ item.name }}</p>
|
|
|
- </div>
|
|
|
+ <el-scrollbar>
|
|
|
+ <div v-for="(item, index) in workInfo.files" :key="index" @click="changeFile(item, index)" :class="['files-list', {'active-file': fileIndex === index}]">
|
|
|
+ <p>{{ item.name }}</p>
|
|
|
+ </div>
|
|
|
+ </el-scrollbar>
|
|
|
</div>
|
|
|
<div class="works-info">
|
|
|
- <video v-if="fileInfo.type === 'video'" :id="'video'" :src="fileInfo.urlShow" controls="controls" style="border-radius: 5px;max-height: 700px;max-width: 100%;" />
|
|
|
+ <video v-if="fileInfo.type === 'video'" :id="'video'" :src="fileInfo.urlShow" controls="controls" style="border-radius: 5px;max-height: 280px;max-width: 100%;" />
|
|
|
<img v-else-if="fileInfo.type === 'image'" :src="fileInfo.urlShow" style="border-radius: 5px;max-height: 700px !important;max-width: 100% !important;" />
|
|
|
<audio v-else-if="fileInfo.type === 'audio'" controls>
|
|
|
<source :src="fileInfo.urlShow" />
|
|
@@ -87,7 +89,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="text-align: right; margin: 10px 0;" v-show="workList.length && workList.length != 1">
|
|
|
+ <div style="text-align: right; margin: 10px 20px;" v-show="workList.length && workList.length != 1">
|
|
|
<el-button type="info" @click="changeWork()" v-show="workIndex">上一位</el-button>
|
|
|
<el-button type="info" @click="changeWork(true)" v-show="workIndex != (workList.length - 1)">下一位</el-button>
|
|
|
<el-button type="info" @click="scoring = true" :icon="Notebook" circle />
|
|
@@ -150,14 +152,19 @@
|
|
|
</div>
|
|
|
<el-empty v-else description="暂无活动" :image-size="300" />
|
|
|
<el-dialog v-model="scoring" title="请选择打分作品" width="40%">
|
|
|
- <div v-for="item in workList" :key="item.id">
|
|
|
+ <!-- <div v-for="item in workList" :key="item.id">
|
|
|
姓名:{{ item.name }} 学段:{{ item.period }} 学科:{{ item.subject }}
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div>
|
|
|
<el-table :data="workList" row-key="id" highlight-current-row default-expand-all @current-change="handleCurrentChange">
|
|
|
<el-table-column prop="name" label="姓名" align="center" width="170" />
|
|
|
<el-table-column prop="period" label="学段" align="center" width="100" />
|
|
|
<el-table-column prop="subject" label="学科" align="center" width="100" />
|
|
|
+ <el-table-column label="成绩" align="center" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <p>{{ scope.row.score === -1 ? '-' : scope.row.score }}</p>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<!-- <el-table-column label="作品" align="center">
|
|
|
<template #default="scope">
|
|
|
<p>
|
|
@@ -197,7 +204,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { Search, Delete, Clock, CaretBottom, CaretRight, Avatar, Management, Notebook, Picture, Film, Paperclip, FolderRemove } from '@element-plus/icons-vue'
|
|
|
+import { Search, Delete, Clock, CaretBottom, CaretRight, Avatar, Management, Notebook, Picture, Film, Paperclip, FolderRemove, CloseBold } from '@element-plus/icons-vue'
|
|
|
import { ElMessageBox, ElMessage, FormRules } from 'element-plus'
|
|
|
import { getCurrentInstance, onMounted, reactive, ref, watch, watchEffect } from 'vue'
|
|
|
|
|
@@ -217,6 +224,8 @@ let workList = ref([])
|
|
|
let workIndex = ref(0)
|
|
|
// 展示作品信息
|
|
|
let workInfo = ref({})
|
|
|
+// 作品信息
|
|
|
+let workInfoShow = ref({})
|
|
|
let fileIndex = ref(0)
|
|
|
let fileInfo = ref({})
|
|
|
let previewFile = ref({})
|
|
@@ -231,8 +240,6 @@ let skModule = ref(true)
|
|
|
// 作品列表弹出框
|
|
|
let scoring = ref(false)
|
|
|
|
|
|
-// 作品信息
|
|
|
-let workInfoShow = reactive({})
|
|
|
// workInfo = workList[0]
|
|
|
|
|
|
getTaskList()
|
|
@@ -284,6 +291,17 @@ function getRuleScore(arr, workInfo, isRestore) {
|
|
|
return arr
|
|
|
}
|
|
|
|
|
|
+function checkNotScore(arr) {
|
|
|
+ let notScore = arr.find(item => {
|
|
|
+ let needBreak = undefined
|
|
|
+ if(item.children.length) {
|
|
|
+ needBreak = checkNotScore(item.children)
|
|
|
+ }
|
|
|
+ return needBreak || item.score === null
|
|
|
+ })
|
|
|
+ return notScore
|
|
|
+}
|
|
|
+
|
|
|
function getUploadInfo(info) {
|
|
|
if(!info?.files) {
|
|
|
let params = {
|
|
@@ -293,9 +311,14 @@ function getUploadInfo(info) {
|
|
|
}
|
|
|
proxy.$api.getTaskList(params).then(res => {
|
|
|
if(res?.upload) {
|
|
|
- info.files = res.upload.files.map(item => {
|
|
|
+ info.files = []
|
|
|
+ res.upload.files.map(item => {
|
|
|
item.urlShow = actInfo.value.url + item.url + '?' + actInfo.value.sas
|
|
|
- return item
|
|
|
+ if(item.type === 'video') {
|
|
|
+ info.files.unshift(item)
|
|
|
+ } else {
|
|
|
+ info.files.push(item)
|
|
|
+ }
|
|
|
})
|
|
|
workInfo.value = info
|
|
|
// changeFile(workInfo.value.files[0], 0)
|
|
@@ -312,19 +335,29 @@ function getUploadInfo(info) {
|
|
|
|
|
|
function changeWork(type) {
|
|
|
ElMessageBox.confirm(`当前分数不会保存,是否切换?`).then(() => {
|
|
|
+ workIndex.value = type ? workIndex.value + 1 : workIndex.value - 1
|
|
|
if(ruleInfo.value.scoreDetail) {
|
|
|
ruleInfo.value.trees = getRuleScore(ruleInfo.value.trees, workList.value[workIndex.value].detailScore, true)
|
|
|
} else {
|
|
|
reviewScore.value = null
|
|
|
}
|
|
|
- workIndex.value = type ? workIndex.value + 1 : workIndex.value - 1
|
|
|
getUploadInfo(workList.value[workIndex.value])
|
|
|
})
|
|
|
}
|
|
|
|
|
|
function saveScore() {
|
|
|
- let totalScore = 0
|
|
|
-
|
|
|
+ let notScore = undefined
|
|
|
+ if(ruleInfo.value.scoreDetail) {
|
|
|
+ // 排查细项打分时,是否有遗漏(可以打0分)
|
|
|
+ notScore = checkNotScore(ruleInfo.value.trees)
|
|
|
+ }
|
|
|
+ if(notScore || reviewScore.value === null) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: ruleInfo.value.scoreDetail ? '有细项未打分' : '未打分'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
let params = {
|
|
|
grant_type: 'decide-score',
|
|
|
activityId: taskList.value[taskIndex.value].activityId,
|
|
@@ -342,10 +375,30 @@ function saveScore() {
|
|
|
} else {
|
|
|
params.scoreData.score += reviewScore.value
|
|
|
}
|
|
|
+ // 可以打0分
|
|
|
+ /* if(!params.scoreData.score) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '分数不能为0'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ } */
|
|
|
console.log(params);
|
|
|
proxy.$api.getTaskList(params).then(res => {
|
|
|
if(res.code === 200) {
|
|
|
-
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '保存成功'
|
|
|
+ })
|
|
|
+ if(!workList.value[workIndex.value].detailScore.length) {
|
|
|
+ taskList.value[taskIndex.value].completeCount = res.completeCount
|
|
|
+ }
|
|
|
+ workList.value = res.contestTasks
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '保存失败'
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -385,15 +438,21 @@ function changeFile(info, index) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 选择将要打分作品
|
|
|
-let handleCurrentChange = (key, keyIndex) => {
|
|
|
- workInfoShow = key
|
|
|
+function handleCurrentChange(key, keyIndex) {
|
|
|
+ workInfoShow.value = key
|
|
|
}
|
|
|
+
|
|
|
// 确认开始打分
|
|
|
-let startWork = () => {
|
|
|
- // workInfo = workInfoShow
|
|
|
- Object.assign(workInfo.value, workInfoShow)
|
|
|
+function startWork() {
|
|
|
+ workIndex.value = workList.value.findIndex(item => item.uploadId === workInfoShow.value.uploadId)
|
|
|
+ if(ruleInfo.value.scoreDetail) {
|
|
|
+ ruleInfo.value.trees = getRuleScore(ruleInfo.value.trees, workList.value[workIndex.value].detailScore, true)
|
|
|
+ } else {
|
|
|
+ reviewScore.value = null
|
|
|
+ }
|
|
|
+ workInfo.value = workInfoShow.value
|
|
|
+ getUploadInfo(workInfo.value)
|
|
|
scoring.value = false
|
|
|
}
|
|
|
</script>
|
|
@@ -406,5 +465,9 @@ let startWork = () => {
|
|
|
.el-upload-list__item-info {
|
|
|
height: 20px;
|
|
|
}
|
|
|
+ .el-tabs__content,
|
|
|
+ .el-tab-pane {
|
|
|
+ height: 97%;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|