瀏覽代碼

展示成绩获奖情况

XW 1 年之前
父節點
當前提交
1b9c3947d6

+ 39 - 0
Contest/contest.client/src/view/activitylist/ActivityInfo.less

@@ -118,6 +118,45 @@
                             font-weight: bold;
                             font-weight: bold;
                         }
                         }
                     }
                     }
+
+                    .score-box {
+                        // padding-top: 20px;
+                        margin-top: 20px;
+                        border-top: 1px dashed #ccc;
+                        display: flex;
+                        justify-content: space-around;
+
+                        &>div {
+                            text-align: center;
+                            max-width: 25%;
+                            border-right: 1px dashed #ccc;
+                            padding-top: 20px;
+
+                            &:last-of-type {
+                                border: none;
+                            }
+                        }
+
+                        .score-lable {
+                            margin-bottom: 10px;
+
+                            &>p {
+                                margin-bottom: 10px;
+                            }
+                        }
+
+                        .score-info {
+                            display: flex;
+                            flex-wrap: wrap;
+                            justify-content: center;
+
+                            &>div {
+                                text-align: center;
+                                margin: 5px 10px;
+                                min-width: 85px;
+                            }
+                        }
+                    }
                 }
                 }
             }
             }
         }
         }

+ 25 - 6
Contest/contest.client/src/view/activitylist/ActivityInfo.vue

@@ -70,6 +70,22 @@
                                             </template>
                                             </template>
                                         </el-step>
                                         </el-step>
                                     </el-steps>
                                     </el-steps>
+                                    <div v-if="contestScores.length && contest.score.scoreStatus" class="score-box">
+                                        <div v-for="(item, index) in contestScores" :key="index">
+                                            <div class="score-lable" v-show="contest.score.showType">
+                                                <p>{{ item.lable }}</p>
+                                                <el-icon color="#ffd111" size="18" v-for="scores in item.scores" :key="scores.tmdid"><Trophy /></el-icon>
+                                            </div>
+                                            <div class="score-info">
+                                                <div v-for="scores in item.scores" :key="scores.tmdid">
+                                                    <el-avatar :size="35" :src="scores.picture" />
+                                                    <p style="font-size: 14px; margin-top: 5px;">
+                                                        {{ scores.type ? scores.teamName : scores.name }}({{ scores.score }}分)
+                                                    </p>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
                                 </div>
                                 </div>
                             </div>
                             </div>
                         </template>
                         </template>
@@ -201,7 +217,7 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ArrowLeft, WarningFilled, Search, CircleCheck, CircleClose, CaretBottom, CaretRight, Message, Edit, Finished, Folder, CloseBold } from '@element-plus/icons-vue'
+import { ArrowLeft, WarningFilled, Search, CircleCheck, CircleClose, CaretBottom, CaretRight, Message, Edit, Finished, Folder, CloseBold, Trophy } from '@element-plus/icons-vue'
 import { ElMessageBox, ElMessage, ElLoading } from 'element-plus'
 import { ElMessageBox, ElMessage, ElLoading } from 'element-plus'
 import { useStore } from "@/pinia/common"
 import { useStore } from "@/pinia/common"
 import { reactive, ref, onMounted, watch, toRaw, getCurrentInstance } from 'vue'
 import { reactive, ref, onMounted, watch, toRaw, getCurrentInstance } from 'vue'
@@ -217,6 +233,7 @@ let yxModule = ref(true)
 let jyModule = ref(true)
 let jyModule = ref(true)
 let codeSearch = ref(true) //搜索标识码
 let codeSearch = ref(true) //搜索标识码
 let previewStatus = ref(false)
 let previewStatus = ref(false)
+let enrollForm = ref(null)
 let registered = ref(0) //是否可以报名 0:可以 1:已经报名 2:所在学校未被邀请 3:不在报名时间
 let registered = ref(0) //是否可以报名 0:可以 1:已经报名 2:所在学校未被邀请 3:不在报名时间
 let contestStep = ref(0)
 let contestStep = ref(0)
 let schoolIndex = ref('')
 let schoolIndex = ref('')
@@ -225,10 +242,10 @@ let research = ref({})
 let training = ref({})
 let training = ref({})
 const infoId = ref(route.params.info)
 const infoId = ref(route.params.info)
 const actInfo = ref({attachment: []})
 const actInfo = ref({attachment: []})
-let teamMembers = ref([])
 let rules = ref({})
 let rules = ref({})
 let previewFile = ref({})
 let previewFile = ref({})
-let enrollForm = ref(null)
+let teamMembers = ref([])
+let contestScores = ref([])
 
 
 let loading = reactive({
 let loading = reactive({
     lock: true,
     lock: true,
@@ -303,10 +320,11 @@ function getListInfo() {
             let nowTime = Date.parse(new Date())
             let nowTime = Date.parse(new Date())
             res.contest.modules.forEach((item, index) => {
             res.contest.modules.forEach((item, index) => {
                 res.contest[item].actState = nowTime < res.contest[item].stime ? 'notStart' : (nowTime > res.contest[item].etime ? 'finish' : 'going')
                 res.contest[item].actState = nowTime < res.contest[item].stime ? 'notStart' : (nowTime > res.contest[item].etime ? 'finish' : 'going')
-                if(res.contest[item].actState === 'going') {
-                    contestStep = index === 1 ? (res.contest.sign.actState === 'going' ? 0 : 1) : index
-                }
             })
             })
+            let index = res.contest.modules.findIndex(item => {
+                return res.contest[item].actState === 'going'
+            })
+            contestStep.value = index === -1 ? 4 : index
             contest.value = res.contest
             contest.value = res.contest
             enrollData.type = res.contest.sign.type
             enrollData.type = res.contest.sign.type
             registered.value = nowTime > res.contest.sign.stime && nowTime < res.contest.sign.etime ? 0 : 3
             registered.value = nowTime > res.contest.sign.stime && nowTime < res.contest.sign.etime ? 0 : 3
@@ -316,6 +334,7 @@ function getListInfo() {
                     val: item.field === 'sex' ? 'secrecy' : ''
                     val: item.field === 'sex' ? 'secrecy' : ''
                 }
                 }
             })
             })
+            contestScores.value = res.contestScores || []
             research.value = res.research
             research.value = res.research
             training.value = res.training
             training.value = res.training
             getEnroll()
             getEnroll()

+ 43 - 0
Contest/contest.client/src/view/myactivity/MyActivity.less

@@ -113,6 +113,48 @@
 
 
             .demo-tabs {
             .demo-tabs {
                 height: 100%;
                 height: 100%;
+
+                .module-box {
+                    cursor: pointer;
+                }
+            }
+
+            .score-box {
+                // padding-top: 20px;
+                // margin: 20px 0;
+                // border-top: 1px dashed #ccc;
+                display: flex;
+                justify-content: center;
+
+                &>div {
+                    text-align: center;
+                    padding: 0 20px;
+                    margin-top: 10px;
+
+                    &:last-of-type {
+                        border: none;
+                    }
+                }
+
+                .score-lable {
+                    margin-bottom: 10px;
+
+                    &>p {
+                        margin-bottom: 10px;
+                    }
+                }
+
+                .score-info {
+                    display: flex;
+                    flex-wrap: wrap;
+                    justify-content: center;
+
+                    &>div {
+                        text-align: center;
+                        margin: 5px 10px;
+                        min-width: 85px;
+                    }
+                }
             }
             }
 
 
             .upload-demo {
             .upload-demo {
@@ -280,6 +322,7 @@
 
 
 .el-popper {
 .el-popper {
     .filter-box {
     .filter-box {
+
         // margin: 10px;
         // margin: 10px;
         &>p:first-child {
         &>p:first-child {
             border-bottom: 1px solid #ccc;
             border-bottom: 1px solid #ccc;

+ 78 - 9
Contest/contest.client/src/view/myactivity/MyActivity.vue

@@ -85,8 +85,8 @@
                                     <el-icon v-show="!skModule"><CaretRight /></el-icon>
                                     <el-icon v-show="!skModule"><CaretRight /></el-icon>
                                     赛课模块
                                     赛课模块
                                 </p>
                                 </p>
-                                <el-alert title="上传作品时间已过" v-show="contest.upload.actState === 'finish'" type="warning" :closable="false" show-icon style="margin-top: 20px;" />
                                 <div v-show="skModule">
                                 <div v-show="skModule">
+                                    <el-alert title="上传作品时间已过" v-show="contest.upload.actState === 'finish'" type="warning" :closable="false" show-icon style="margin-top: 20px;" />
                                     <div class="cipher-box" v-show="contest.sign.type">
                                     <div class="cipher-box" v-show="contest.sign.type">
                                         <p>队伍名称:{{ cipher.teamName }}</p>
                                         <p>队伍名称:{{ cipher.teamName }}</p>
                                         <p>队伍编号:{{ cipher.cipher }}</p>
                                         <p>队伍编号:{{ cipher.cipher }}</p>
@@ -113,6 +113,11 @@
                                                 </el-tag>
                                                 </el-tag>
                                             </template>
                                             </template>
                                         </el-table-column>
                                         </el-table-column>
+                                        <el-table-column label="分数" align="center" v-if="scoreData.levelStatus != -1">
+                                            <template #default="scope">
+                                                {{ scope.row.myself ? scoreData.score : '无权限' }}
+                                            </template>
+                                        </el-table-column>
                                         <el-table-column label="操作" align="center">
                                         <el-table-column label="操作" align="center">
                                             <template #default="scope">
                                             <template #default="scope">
                                                 <el-button size="small" type="primary" @click="changeLeader(scope.$index, scope.row)" v-if="isLeader && !scope.row.myself">
                                                 <el-button size="small" type="primary" @click="changeLeader(scope.$index, scope.row)" v-if="isLeader && !scope.row.myself">
@@ -121,6 +126,9 @@
                                                 <el-button size="small" type="danger" @click="deleteMem(scope.$index, scope.row)" v-if="isLeader && !scope.row.myself && !scope.row.identity">
                                                 <el-button size="small" type="danger" @click="deleteMem(scope.$index, scope.row)" v-if="isLeader && !scope.row.myself && !scope.row.identity">
                                                     删除
                                                     删除
                                                 </el-button>
                                                 </el-button>
+                                                <el-button size="small" type="primary" v-if="scope.row.myself && scoreData.detailScore.length">
+                                                    查看得分
+                                                </el-button>
                                                 <el-button size="small" @click="exitAct(scope.$index, scope.row)" v-if="scope.row.myself">
                                                 <el-button size="small" @click="exitAct(scope.$index, scope.row)" v-if="scope.row.myself">
                                                     退出
                                                     退出
                                                 </el-button>
                                                 </el-button>
@@ -181,6 +189,32 @@
                             </el-scrollbar>
                             </el-scrollbar>
                         </template>
                         </template>
                     </el-tab-pane>
                     </el-tab-pane>
+                    <el-tab-pane label="成绩展示" name="score">
+                        <el-scrollbar>
+                            <el-table :data="contestScores" style="width: 100%">
+                                <el-table-column prop="lable" label="奖项名称" align="center" width="200">
+                                    <template #default="scope">
+                                        <p>{{ scope.row.lable }}</p>
+                                        <p>
+                                            <el-icon color="#ffd111" size="18" v-for="scores in scope.row.scores" :key="scores.tmdid"><Trophy /></el-icon>
+                                        </p>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column label="获奖人员" align="center">
+                                    <template #default="scope">
+                                        <div class="score-box">
+                                            <div v-for="scores in scope.row.scores" :key="scores.tmdid">
+                                                <el-avatar :size="35" :src="scores.picture" />
+                                                <p style="font-size: 14px; margin-top: 5px;">
+                                                    {{ scores.type ? scores.teamName : scores.name }}({{ scores.score }}分)
+                                                </p>
+                                            </div>
+                                        </div>
+                                    </template>
+                                </el-table-column>
+                            </el-table>
+                        </el-scrollbar>
+                    </el-tab-pane>
                     <el-tab-pane label="活动信息" name="info">
                     <el-tab-pane label="活动信息" name="info">
                         <el-scrollbar>
                         <el-scrollbar>
                             <div style="margin-bottom: 20px;" class="sk-info">
                             <div style="margin-bottom: 20px;" class="sk-info">
@@ -236,11 +270,21 @@
 			</div>
 			</div>
             <el-image-viewer v-else hide-on-click-modal @close="previewStatus = false" :url-list="[previewFile.urlShow]" />
             <el-image-viewer v-else hide-on-click-modal @close="previewStatus = false" :url-list="[previewFile.urlShow]" />
 		</div>
 		</div>
+        <el-dialog v-model="uploadDia" title="上传作品" width="30%">
+            <p style="margin-bottom: 10px;">请为作品集取一个名称</p>
+            <el-input v-model="uploadName" placeholder="请输入" />
+            <template #footer>
+                <span class="dialog-footer">
+                    <el-button @click="uploadDia = false">取消</el-button>
+                    <el-button type="primary" @click="startUpload()">开始上传</el-button>
+                </span>
+                </template>
+        </el-dialog>
     </div>
     </div>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { Search, Delete, UserFilled, Clock, UploadFilled, CaretBottom, CaretRight, WarnTriangleFilled, DArrowRight, CloseBold, Warning, Filter } from '@element-plus/icons-vue'
+import { Search, Delete, UserFilled, Clock, UploadFilled, CaretBottom, CaretRight, WarnTriangleFilled, DArrowRight, CloseBold, Warning, Filter, Trophy } from '@element-plus/icons-vue'
 import { ElMessageBox, ElMessage, FormRules, ElLoading } from 'element-plus'
 import { ElMessageBox, ElMessage, FormRules, ElLoading } from 'element-plus'
 import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRaw, watch } from 'vue'
 import { getCurrentInstance, nextTick, onMounted, reactive, ref, toRaw, watch } from 'vue'
 import { useStore } from "@/pinia/common"
 import { useStore } from "@/pinia/common"
@@ -259,21 +303,25 @@ let accept = ref('')
 let nowYear = ref('')
 let nowYear = ref('')
 let scopeVal = ref('')
 let scopeVal = ref('')
 let publishVal = ref('')
 let publishVal = ref('')
+let uploadName = ref('')
 let searShow = ref(false)
 let searShow = ref(false)
 let skModule = ref(true)
 let skModule = ref(true)
 let isLeader = ref(false)
 let isLeader = ref(false)
 let previewStatus = ref(false)
 let previewStatus = ref(false)
+let uploadDia = ref(false)
 let actList = ref([])
 let actList = ref([])
 let actListShow = ref([])
 let actListShow = ref([])
 let memberData = ref([])
 let memberData = ref([])
 let fileList = ref([])
 let fileList = ref([])
 let uploadList = ref([])
 let uploadList = ref([])
 let modalList = ref([])
 let modalList = ref([])
+let contestScores = ref([])
 let actInfo = ref({attachment: []})
 let actInfo = ref({attachment: []})
 let contest = ref({})
 let contest = ref({})
 let research = ref({}) //教研
 let research = ref({}) //教研
 let training = ref({}) //研修
 let training = ref({}) //研修
 let previewFile = ref({})
 let previewFile = ref({})
+let scoreData = ref({detailScore: []})
 
 
 const refUpload = ref(HTMLElement)
 const refUpload = ref(HTMLElement)
 const cipher = ref({})
 const cipher = ref({})
@@ -318,6 +366,10 @@ function getActList() {
 function getListInfo(info, index) {
 function getListInfo(info, index) {
     actIndex.value = index
     actIndex.value = index
     actInfo.value = {attachment: []}
     actInfo.value = {attachment: []}
+    uploadList.value = []
+    accept.value = ''
+    uploadName.value = ''
+    scoreData.value = {}
     if(!info.isJoin) return
     if(!info.isJoin) return
     /* loading = ElLoading.service({
     /* loading = ElLoading.service({
         lock: true,
         lock: true,
@@ -338,6 +390,7 @@ function getListInfo(info, index) {
                 res.contest[item].actState = nowDate < res.contest[item].stime ? 'notStart' : (nowDate > res.contest[item].etime ? 'finish' : 'going')
                 res.contest[item].actState = nowDate < res.contest[item].stime ? 'notStart' : (nowDate > res.contest[item].etime ? 'finish' : 'going')
             })
             })
             contest.value = res.contest
             contest.value = res.contest
+            contestScores.value = res.contestScores || []
             research.value = res.research
             research.value = res.research
             training.value = res.training
             training.value = res.training
 
 
@@ -389,6 +442,9 @@ function getEnroll() {
                     // loading.close()
                     // loading.close()
                 }
                 }
             }
             }
+            if(res.scoreData) {
+                scoreData.value = res.scoreData
+            }
         }
         }
     }).catch(() => {
     }).catch(() => {
         // loading.close()
         // loading.close()
@@ -606,14 +662,19 @@ async function uploadFile() {
         })
         })
         return
         return
     }
     }
-    /* loading = ElLoading.service({
-        lock: true,
-        text: '加载中',
-        background: 'rgba(0, 0, 0, 0.7)'
-    }) */
+    uploadDia.value = true
+}
+
+async function startUpload() {
+    if(!uploadName.value) {
+        ElMessage({
+            type: 'warning',
+            message: '请输入作品集名称'
+        })
+        return
+    }
     let blobList = await uploadBlob()
     let blobList = await uploadBlob()
     if(!blobList) {
     if(!blobList) {
-        // loading.close()
         ElMessage({
         ElMessage({
             type: 'warning',
             type: 'warning',
             message: '上传失败'
             message: '上传失败'
@@ -625,6 +686,7 @@ async function uploadFile() {
         activityId: actInfo.value.id,
         activityId: actInfo.value.id,
         uploadData: {
         uploadData: {
             type: contest.value.upload.type,
             type: contest.value.upload.type,
+            name: uploadName.value,
         },
         },
     }
     }
     // 暂不考虑这种情况,因为创建活动时必须填写报名模块
     // 暂不考虑这种情况,因为创建活动时必须填写报名模块
@@ -641,7 +703,7 @@ async function uploadFile() {
     } else {
     } else {
         params.uploadData.sokrates = []
         params.uploadData.sokrates = []
     }
     }
-    proxy.$api.teaContest(params).then(res => {
+    proxy.$api.teaContest(params).then(async res => {
         if(res.code === 200) {
         if(res.code === 200) {
             ElMessage({
             ElMessage({
                 type: 'success',
                 type: 'success',
@@ -654,9 +716,12 @@ async function uploadFile() {
                 type: 'warning',
                 type: 'warning',
                 message: res.code === 35 ? '上传时间已过,不能上传' : '上传失败'
                 message: res.code === 35 ? '上传时间已过,不能上传' : '上传失败'
             })
             })
+            let path = `activity/${actInfo.value.id}/upload/${store.userInfo.sub}`
+            await deleteBlobPrefix(actInfo.value.owner, path)
         }
         }
     }).finally(() => {
     }).finally(() => {
         // loading.close()
         // loading.close()
+        uploadDia.value = false
     })
     })
 }
 }
 
 
@@ -696,6 +761,7 @@ function scopeChange(value) {
         actListShow.value = actList.value.filter(item => {
         actListShow.value = actList.value.filter(item => {
             return item.scope === value && (publishVal.value ? (publishVal.value === 'notRegister' ? !item.isJoin : (item.isJoin && (publishVal.value === 'going' ? item.publish === 1 : item.publish === 2))) : true)
             return item.scope === value && (publishVal.value ? (publishVal.value === 'notRegister' ? !item.isJoin : (item.isJoin && (publishVal.value === 'going' ? item.publish === 1 : item.publish === 2))) : true)
         })
         })
+        getListInfo(actListShow.value[0], 0)
     } else {
     } else {
         onFilterClear()
         onFilterClear()
     }
     }
@@ -706,6 +772,7 @@ function publishChange(value) {
         actListShow.value = actList.value.filter(item => {
         actListShow.value = actList.value.filter(item => {
             return (value === 'notRegister' ? !item.isJoin : (item.isJoin && (value === 'going' ? item.publish === 1 : item.publish === 2))) && (scopeVal.value ? item.scope === scopeVal.value : true) && (modalList.value.length ? item.modules.every(modules => modalList.value.includes(modules)) : true)
             return (value === 'notRegister' ? !item.isJoin : (item.isJoin && (value === 'going' ? item.publish === 1 : item.publish === 2))) && (scopeVal.value ? item.scope === scopeVal.value : true) && (modalList.value.length ? item.modules.every(modules => modalList.value.includes(modules)) : true)
         })
         })
+        getListInfo(actListShow.value[0], 0)
     } else {
     } else {
         onFilterClear()
         onFilterClear()
     }
     }
@@ -716,6 +783,7 @@ function modalChange(value) {
         actListShow.value = actList.value.filter(item => {
         actListShow.value = actList.value.filter(item => {
             return item.modules.every(modules => value.includes(modules)) && (publishVal.value ? (publishVal.value === 'notRegister' ? !item.isJoin : (item.isJoin && (publishVal.value === 'going' ? item.publish === 1 : item.publish === 2))) : true) && (scopeVal.value ? item.scope === scopeVal.value : true)
             return item.modules.every(modules => value.includes(modules)) && (publishVal.value ? (publishVal.value === 'notRegister' ? !item.isJoin : (item.isJoin && (publishVal.value === 'going' ? item.publish === 1 : item.publish === 2))) : true) && (scopeVal.value ? item.scope === scopeVal.value : true)
         })
         })
+        getListInfo(actListShow.value[0], 0)
     } else {
     } else {
         onFilterClear()
         onFilterClear()
     }
     }
@@ -735,6 +803,7 @@ function onFilterClear() {
         return
         return
     }
     }
     actListShow.value = actList.value
     actListShow.value = actList.value
+    getListInfo(actListShow.value[0], 0)
 }
 }
 
 
 watch(nowYear, (newValue, oldValue) => {
 watch(nowYear, (newValue, oldValue) => {