From 5f00696dfb25bc90034448ceb634ed1ef256681a Mon Sep 17 00:00:00 2001 From: qiyunfeng-create <1940665526@qq.com> Date: 星期四, 21 八月 2025 21:13:35 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/xiehe_website --- src/views/classManage/studentJob.vue | 357 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 357 insertions(+), 0 deletions(-) diff --git a/src/views/classManage/studentJob.vue b/src/views/classManage/studentJob.vue new file mode 100644 index 0000000..0cd5e1f --- /dev/null +++ b/src/views/classManage/studentJob.vue @@ -0,0 +1,357 @@ +<template> + <div class="classManagePage-box"> + <div class="classManagePage-nav"> + <el-breadcrumb :separator-icon="ArrowRight"> + <el-breadcrumb-item>鎴戠殑鐝骇</el-breadcrumb-item> + <el-breadcrumb-item>{{ classInfo?.name }}</el-breadcrumb-item> + <el-breadcrumb-item>浣滀笟绠$悊</el-breadcrumb-item> + </el-breadcrumb> + </div> + <div class="classManagePage-content"> + <div class="cartClass"> + <!-- <el-tabs v-model="jobState" @tab-click="tabCart"> + <el-tab-pane label="鍏ㄩ儴" name="all"></el-tab-pane> + <el-tab-pane label="杩涜涓�" name="payment"></el-tab-pane> + <el-tab-pane label="宸茶繃鏈�" name="complete"></el-tab-pane> + </el-tabs> --> + <div class="titleOptions"> + <span>浣滀笟绠$悊</span> + </div> + </div> + <div class="headerBox"> + <div class="searchBox"> + <el-input + v-model="searchKey" + clearable + @clear="searchTask" + @keydown.enter="searchTask" + placeholder="璇疯緭鍏ュ叧閿瓧" + > + <template #append> + <el-button type="primary" @click="searchTask" class="searchBtn" :icon="Search" /> + </template> + </el-input> + </div> + </div> + <div class="listBox"> + <el-table + :data="tableData" + :header-cell-style="{ background: '#eee' }" + max-height="600px" + style="width: 100%" + v-loading="pages.loading" + > + <el-table-column label="搴忓彿" prop="id" width="70"> </el-table-column> + <el-table-column label="鍚嶇О" prop="name"> </el-table-column> + <el-table-column label="浣滀笟瀹屾垚鎯呭喌" #default="scope"> + <span v-if="scope.row.submitState == 'WaitCheck'" style="color: #ff6d00">寰呮壒鏀�</span> + <span v-if="scope.row.submitState == 'Normal'" style="color: #67c23a">宸叉壒鏀�</span> + <span v-if="!scope.row.submitState" style="color: red">鏈彁浜�</span> + </el-table-column> + <!-- <el-table-column label="鐘舵��" prop="state" #default="scope"> + <span v-if="scope.row.state == 'Waiting'" style="color: red">鏈紑濮�</span> + <span v-if="scope.row.state == 'Normal'" style="color: #67c23a">杩涜涓�</span> + <span v-if="scope.row.state == 'Ended'" style="color: #999">宸茬粨鏉�</span> + </el-table-column> --> + <el-table-column label="浣滀笟寮�濮嬫棩鏈�" prop="beginDate"> </el-table-column> + <el-table-column label="浣滀笟缁撴潫鏃ユ湡" prop="endDate"> </el-table-column> + <el-table-column label="涓昏棰樺緱鍒�" prop="judgeScore"> </el-table-column> + <el-table-column label="瀹㈣棰樺緱鍒�" prop="otherScore"> </el-table-column> + <el-table-column label="鎬诲垎" prop="totalScore"> </el-table-column> + <el-table-column label="鎿嶄綔" width="200" #default="scope"> + <el-button link style="color: #409eff" @click="preview(scope.row)">棰勮</el-button> + <el-button link v-if="!scope.row.submitState" type="primary" @click="answer(scope.row)"> + 绛旈 + </el-button> + </el-table-column> + </el-table> + <div class="pageBox"> + <el-pagination + v-model:current-page="pages.currentPage" + :page-size="pages.pageSize" + :size="'small'" + :disabled="pages.count <= 1" + layout="total, prev, pager, next" + :total="pages.count" + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + /> + </div> + </div> + </div> + </div> +</template> + +<script setup lang="ts"> +import { reactive, ref, onMounted, inject, watch } from 'vue' +import { Search, ArrowRight } from '@element-plus/icons-vue' +import { useRoute, useRouter } from 'vue-router' +import { ElMessage, ElMessageBox } from 'element-plus' +import moment from 'moment' + +const route: any = useRoute() +const router = useRouter() +const MG: any = inject('MG') +const config: any = inject('config') +const tool: any = inject('toolClass') +const classInfo = JSON.parse(route.query.classInfo) +const jobState = ref('all') +const searchKey = ref('') +const dataList = ref([]) +const userInfo = ref() + +// 鑾峰彇task鍙傛暟 +const filterData = ref([ + { + value: config.taskType.homeWork, + field: 'Type', + subFilters: [] + } +]) +// task +const taskData = reactive({ + id: '', + description: '', + rootCmsItemId: '', + name: '', + type: '', + state: '', + groupId: '', + beginDate: '', + endDate: '' +}) + +const visiblePub = ref(false) +const questionData: any = ref([]) + +const scoreData: any = ref([]) +// question Key +const questionKey = [ + 'Name', + 'Embedded_QuestionBank_AnalysisCon', + 'Embedded_QuestionBank_Answer', + 'Embedded_QuestionBank_Difficulty', + 'Embedded_QuestionBank_KnowledgePoint', + 'Embedded_QuestionBank_Option', + 'Embedded_QuestionBank_OptionStyle', + 'Embedded_QuestionBank_QuestionType', + 'Embedded_QuestionBank_Score', + 'Embedded_QuestionBank_Stem', + 'Embedded_QuestionBank_StemStyle' +] + +let pages = reactive({ + currentPage: 1, + page: 1, + pageSize: 15, + count: 0, + loading: false +}) +// 浣滀笟鍒楄〃 +const tableData: any = ref([]) + +onMounted(() => { + const userCache: any = localStorage.getItem(config.userInfoKey) + if (userCache) { + userInfo.value = JSON.parse(userCache) + } + getTaskList() +}) + +// 鍒嗛〉 +const handleSizeChange = (val: number) => { + pages.pageSize = val + getTaskList() +} + +const handleCurrentChange = (val: number) => { + pages.page = val + pages.currentPage = val + getTaskList() +} + +// 鑾峰彇浠诲姟鍒楄〃 +const getTaskList = (filter?: any[], search?: any[]) => { + const filterList = filter ?? filterData.value + const searchList = search ?? [] + pages.loading = true + const data = { + start: (pages.page - 1) * pages.pageSize, + size: pages.pageSize, + sort: { + type: 'Desc', + field: 'CreateDate' + }, + filterList, + searchList, + groupId: classInfo?.id + } + MG.edu + .getTaskList(data) + .then((res: any) => { + pages.count = res.totalSize + if (res.datas.length > 0) { + tableData.value = res.datas?.map((item: any) => { + item.judgeScore = 0 + item.otherScore = 0 + if (item.submit?.id) { + item.submit?.submitAndCmsItemLinks?.forEach((citem: any) => { + if (citem.comments == 'judge') { + item.judgeScore += citem.score + } + if (citem.comments != 'judge') { + item.otherScore += citem.score + } + }) + } + return { + ...item, + totalScore: item.judgeScore + item.otherScore, + beginDate: moment(item.beginDate).format('YYYY-MM-DD'), + endDate: moment(item.endDate).format('YYYY-MM-DD') + } + }) + } else { + tableData.value = [] + } + pages.loading = false + }) + .catch((e: any) => { + pages.loading = false + console.log(e) + }) +} + +// 鎼滅储浠诲姟 +const searchTask = () => { + const data = [ + { + compareType: 'Contains', + keywords: searchKey.value, + field: 'Name' + } + ] + pages.page = 1 + pages.currentPage = 1 + getTaskList(undefined, data) +} + +// 琛ㄦ牸tab浜嬩欢{Waiting:鏈紑濮�,Normal:杩涜涓�,Ended:宸茬粨鏉焳 +const tabCart = (event: Event | any) => { + let queryFilter: any = [] + jobState.value = event.props.name + pages.page = 1 + dataList.value = [] + if (jobState.value == 'all') { + queryFilter = [...filterData.value] + } + if (jobState.value == 'payment') { + queryFilter = [...filterData.value, { field: 'State', value: 'Normal', subFilters: [] }] + } + if (jobState.value == 'complete') { + queryFilter = [...filterData.value, { field: 'State', value: 'Ended', subFilters: [] }] + } + getTaskList(queryFilter) +} + +// 绛旈 +const answer = (item: any) => { + router.push({ + path: '/bookService/details/answer', + query: { + answerTitle: item.name, + taskId: item.id, + groupId: classInfo?.id, + answerType: 'task' + } + }) +} + +// 棰勮 +const preview = (item: any) => { + router.push({ + path: '/bookService/details/answer', + query: { + answerTitle: item.name, + taskId: item.id, + groupId: classInfo?.id, + answerType: 'task', + isPreview: 'true' + } + }) +} +</script> + +<style lang="less" scoped> +.classManagePage-box { + padding: 20px; + .classManagePage-nav { + padding-bottom: 20px; + border-bottom: 1px solid #e6e8ed; + } + .classManagePage-content { + .cartClass { + .titleOptions { + width: 160px; + display: flex; + justify-content: space-between; + align-items: center; + span { + height: 30px; + font-weight: bold; + font-size: 16px; + color: #333; + line-height: 30px; + text-align: left; + border-left: 6px solid #ff6c00; + padding-left: 10px; + } + } + margin-top: 20px; + ::v-deep .el-tabs__nav-wrap::after { + background-color: #ff6d00; + height: 1px; + } + + ::v-deep .el-tabs__item { + width: 100px; + padding: 0; + color: #545c63; + } + + ::v-deep .is-active { + background-color: #ff6d00; + color: #fff; + border-radius: 3px 3px 0 0; + } + } + .headerBox { + padding: 20px 0; + overflow: hidden; + .searchBox { + width: 300px; + float: left; + .searchBtn { + background-color: var(--el-color-primary); + color: #fff; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + } + } + ::v-deep(.customDialog) { + border-radius: 5px; + margin: 10px auto; + padding-bottom: 20px; + .pubContent { + height: 800px; + } + } + .pageBox { + padding: 10px 0; + display: flex; + justify-content: flex-end; + } + } +} +</style> -- Gitblit v1.9.1