|
|
@@ -1,14 +1,15 @@
|
|
|
<template>
|
|
|
- <a-card>
|
|
|
- <div class="paper-list">
|
|
|
- <!-- 任务中心开始 -->
|
|
|
- <div class="task-center" style="margin-bottom: 24px">
|
|
|
- <h3 style="border-left: solid 4px #3651d4; padding-left: 8px; margin-bottom: 12px; font-size: 18px">
|
|
|
- <div>{{ examName }}</div>
|
|
|
- </h3>
|
|
|
+ <div>
|
|
|
+ <a-card style="width: 100%;" class="titleCard">
|
|
|
+ <div style="font-size: 18px">
|
|
|
+ <div>我的{{ examName }}</div>
|
|
|
+ </div>
|
|
|
+ </a-card>
|
|
|
+ <a-card style="width: 100%" class="mt-3">
|
|
|
+ <div class="flc mb-4">
|
|
|
+ <div class="fcc mr-1">分类:</div>
|
|
|
<a-select
|
|
|
v-if="examType == 1"
|
|
|
- class="mb-3"
|
|
|
v-model:value="examTypeSelect"
|
|
|
placeholder="所有分类"
|
|
|
style="width: 110px"
|
|
|
@@ -16,65 +17,65 @@
|
|
|
@change="handleChangeVal"
|
|
|
allowClear
|
|
|
></a-select>
|
|
|
- <a-spin :spinning="taskLoading">
|
|
|
- <a-table
|
|
|
- ref="paperTableRef"
|
|
|
- :columns="taskColumns"
|
|
|
- :data-source="taskList"
|
|
|
- :expand-row-by-click="true"
|
|
|
- :pagination="pagination"
|
|
|
- >
|
|
|
- <template #headerCell="{ column }">
|
|
|
- <template v-if="column.dataIndex === 'examName'">
|
|
|
- {{ examName + column.title }}
|
|
|
- </template>
|
|
|
- <template v-if="column.dataIndex === 'examType'">
|
|
|
- {{ examName + column.title }}
|
|
|
- </template>
|
|
|
+ </div>
|
|
|
+ <a-spin :spinning="taskLoading">
|
|
|
+ <a-table
|
|
|
+ ref="paperTableRef"
|
|
|
+ :columns="taskColumns"
|
|
|
+ :data-source="taskList"
|
|
|
+ :expand-row-by-click="true"
|
|
|
+ :pagination="pagination"
|
|
|
+ >
|
|
|
+ <template #headerCell="{ column }">
|
|
|
+ <template v-if="column.dataIndex === 'examName'">
|
|
|
+ {{ examName + column.title }}
|
|
|
+ </template>
|
|
|
+ <template v-if="column.dataIndex === 'examType'">
|
|
|
+ {{ examName + column.title }}
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
+ <template v-if="record.examType && column.key === 'examType'">
|
|
|
+ {{ examTypeName(record.examType) || '--' }}
|
|
|
+ </template>
|
|
|
+ <template v-if="record.startTime && column.key === 'startTime'">
|
|
|
+ {{ formatDateTime(record.startTime) || '--' }}
|
|
|
+ </template>
|
|
|
+ <template v-if="record.endTime && column.key === 'endTime'">
|
|
|
+ {{ formatDateTime(record.endTime) || '--' }}
|
|
|
</template>
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
- <template v-if="record.examType && column.key === 'examType'">
|
|
|
- {{ examTypeName(record.examType) || '--' }}
|
|
|
- </template>
|
|
|
- <template v-if="record.startTime && column.key === 'startTime'">
|
|
|
- {{ formatDateTime(record.startTime) || '--' }}
|
|
|
- </template>
|
|
|
- <template v-if="record.endTime && column.key === 'endTime'">
|
|
|
- {{ formatDateTime(record.endTime) || '--' }}
|
|
|
- </template>
|
|
|
|
|
|
- <template v-if="record.paperType && column.key === 'paperType'">
|
|
|
- <span v-if="!examPaperType">{{ examTypeName(record.paperType) }}</span>
|
|
|
- <span v-if="examPaperType">{{ paperTypeEnum(record.paperType) }}</span>
|
|
|
- </template>
|
|
|
+ <template v-if="record.paperType && column.key === 'paperType'">
|
|
|
+ <span v-if="!examPaperType">{{ examTypeName(record.paperType) }}</span>
|
|
|
+ <span v-if="examPaperType">{{ paperTypeEnum(record.paperType) }}</span>
|
|
|
+ </template>
|
|
|
|
|
|
- <template v-if="column.key === 'status'">
|
|
|
- <a-tag :color="statusTagFormatter(record.status)" size="small">
|
|
|
- {{ statusTextFormatter(record.status) }}
|
|
|
- </a-tag>
|
|
|
- </template>
|
|
|
- <template v-if="column.key === 'action'">
|
|
|
- <router-link
|
|
|
- v-if="record.status == 0"
|
|
|
- :to="{ path: '/student/do', query: { id: record.paperId ? record.paperId : record.id } }"
|
|
|
- target="_blank"
|
|
|
- >
|
|
|
- <a-button type="link" size="small">{{ examType == 4 ? `开始答题` : `填写${examName}` }}</a-button>
|
|
|
- </router-link>
|
|
|
- <router-link
|
|
|
- v-if="record.status == 2"
|
|
|
- :to="{ path: '/student/read', query: { id: record.answerId } }"
|
|
|
- target="_blank"
|
|
|
- >
|
|
|
- <a-button type="link" size="small">查看结果</a-button>
|
|
|
- </router-link>
|
|
|
- </template>
|
|
|
+ <template v-if="column.key === 'status'">
|
|
|
+ <a-tag :color="statusTagFormatter(record.status)" size="small">
|
|
|
+ {{ statusTextFormatter(record.status) }}
|
|
|
+ </a-tag>
|
|
|
</template>
|
|
|
- </a-table>
|
|
|
- </a-spin>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </a-card>
|
|
|
+ <template v-if="column.key === 'action'">
|
|
|
+ <router-link
|
|
|
+ v-if="record.status == 0"
|
|
|
+ :to="{ path: '/student/do', query: { id: record.paperId ? record.paperId : record.id } }"
|
|
|
+ target="_blank"
|
|
|
+ >
|
|
|
+ <a-button type="link" size="small">{{ examType == 4 ? `开始答题` : `填写${examName}` }}</a-button>
|
|
|
+ </router-link>
|
|
|
+ <router-link
|
|
|
+ v-if="record.status == 2"
|
|
|
+ :to="{ path: '/student/read', query: { id: record.answerId } }"
|
|
|
+ target="_blank"
|
|
|
+ >
|
|
|
+ <a-button type="link" size="small">查看结果</a-button>
|
|
|
+ </router-link>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </a-spin>
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -105,26 +106,26 @@
|
|
|
const typeOptionsVal = ref([
|
|
|
{
|
|
|
label: '考试',
|
|
|
- title:'任务',
|
|
|
+ title: '任务',
|
|
|
value: '1',
|
|
|
paperType: '6'
|
|
|
},
|
|
|
{
|
|
|
label: '章节测验',
|
|
|
- title:'章节测验',
|
|
|
+ title: '章节测验',
|
|
|
value: '2',
|
|
|
paperType: '3',
|
|
|
funcType: '5'
|
|
|
},
|
|
|
{
|
|
|
label: '调查问卷',
|
|
|
- title:'调查问卷',
|
|
|
+ title: '调查问卷',
|
|
|
value: '3',
|
|
|
paperType: '5'
|
|
|
},
|
|
|
{
|
|
|
label: '作业',
|
|
|
- title:'作业',
|
|
|
+ title: '作业',
|
|
|
value: '4',
|
|
|
paperType: '2',
|
|
|
funcType: '4'
|
|
|
@@ -171,7 +172,7 @@
|
|
|
{ title: '结束时间', dataIndex: 'endTime', key: 'endTime', width: 180, columnsType: [1, 3] },
|
|
|
|
|
|
{ title: '状态', dataIndex: 'status', key: 'status', width: 90, columnsType: [1, 2, 3, 4] },
|
|
|
- { title: '操作', key: 'action', align: 'right', width: 120, columnsType: [1, 2, 3, 4] }
|
|
|
+ { title: '操作', key: 'action', align: 'left', width: 120, columnsType: [1, 2, 3, 4] }
|
|
|
])
|
|
|
const statusTextFormatter = (status) => {
|
|
|
if (status === 0) return '未答题'
|
|
|
@@ -182,14 +183,14 @@
|
|
|
const statusTagFormatter = (status) => {
|
|
|
if (status === 2) return 'blue'
|
|
|
if (status === 1) return 'green'
|
|
|
- if (status === 0) return 'gray'
|
|
|
+ if (status === 0) return 'red'
|
|
|
return 'default'
|
|
|
}
|
|
|
- const examPaperType = computed(()=>{
|
|
|
+ const examPaperType = computed(() => {
|
|
|
if (examType.value == 2 || examType.value == 4) {
|
|
|
//章节/作业(固定试卷)
|
|
|
return true
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//任务试卷
|
|
|
return false
|
|
|
}
|
|
|
@@ -257,10 +258,17 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
- .paper-list {
|
|
|
- margin-top: 10px;
|
|
|
- .task-center {
|
|
|
- margin-bottom: 24px;
|
|
|
- }
|
|
|
- }
|
|
|
+.flc {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.fcc {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+:deep(.titleCard .ant-card-body){
|
|
|
+ padding:16px 24px;
|
|
|
+}
|
|
|
</style>
|