|
|
@@ -6,6 +6,14 @@
|
|
|
<h3 style="border-left: solid 4px #3651d4; padding-left: 8px; margin-bottom: 12px; font-size: 18px">
|
|
|
<div>{{ examName }}</div>
|
|
|
</h3>
|
|
|
+ <a-select
|
|
|
+ v-model:value="examTypeSelect"
|
|
|
+ placeholder="所有分类"
|
|
|
+ style="width: 110px"
|
|
|
+ :options="typeOptionsVal"
|
|
|
+ @change="handleChangeVal"
|
|
|
+ allowClear
|
|
|
+ ></a-select>
|
|
|
<a-spin :spinning="taskLoading">
|
|
|
<a-table
|
|
|
ref="paperTableRef"
|
|
|
@@ -14,12 +22,12 @@
|
|
|
:expand-row-by-click="true"
|
|
|
:pagination="pagination"
|
|
|
>
|
|
|
- <template #headerCell="{ column}">
|
|
|
+ <template #headerCell="{ column }">
|
|
|
<template v-if="column.dataIndex === 'examName'">
|
|
|
- {{ examName + column.title}}
|
|
|
+ {{ examName + column.title }}
|
|
|
</template>
|
|
|
<template v-if="column.dataIndex === 'examType'">
|
|
|
- {{ examName + column.title}}
|
|
|
+ {{ examName + column.title }}
|
|
|
</template>
|
|
|
</template>
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
@@ -108,6 +116,27 @@
|
|
|
break
|
|
|
}
|
|
|
})
|
|
|
+ const typeOptionsVal = ref([
|
|
|
+ {
|
|
|
+ label: '考试',
|
|
|
+ value: '1'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '章节测验',
|
|
|
+ value: '2'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '调查问卷',
|
|
|
+ value: '3'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '作业',
|
|
|
+ value: '4'
|
|
|
+ }
|
|
|
+ ])
|
|
|
+ const handleChangeVal = (value) => {
|
|
|
+ getTaskList()
|
|
|
+ }
|
|
|
// 任务中心相关
|
|
|
const taskList = ref([])
|
|
|
const taskLoading = ref(false)
|
|
|
@@ -125,14 +154,23 @@
|
|
|
ellipsis: true
|
|
|
}
|
|
|
]
|
|
|
- const taskColumns = ref([
|
|
|
- { title: '名称', dataIndex: 'examName', key: 'examName' },
|
|
|
- { title: '类型', dataIndex: 'examType', key: 'examType', width: 120 },
|
|
|
- { title: '开始时间', dataIndex: 'startTime', key: 'startTime', width: 180 },
|
|
|
- { title: '结束时间', dataIndex: 'endTime', key: 'endTime', width: 180 },
|
|
|
+ const taskColumns = computed(() =>
|
|
|
+ taskAllColumns.value.filter((r) => r.columnsType.includes(parseFloat(examType.value)))
|
|
|
+ )
|
|
|
+ const taskAllColumns = ref([
|
|
|
+ { title: '课程名称', dataIndex: 'courseName', key: 'courseName', columnsType: [2, 4] },
|
|
|
+ { title: '章节名称', dataIndex: 'chapterName', key: 'chapterName', columnsType: [2, 4] },
|
|
|
+ { title: '课时名称', dataIndex: 'hourName', key: 'hourName', columnsType: [2, 4] },
|
|
|
+ { title: '作业名称', dataIndex: 'name', key: 'name', columnsType: [2, 4] },
|
|
|
+ { title: '试卷类型', dataIndex: 'paperType', key: 'paperType', width: 120, columnsType: [2, 4] },
|
|
|
+
|
|
|
+ { title: '名称', dataIndex: 'examName', key: 'examName', columnsType: [1, 3] },
|
|
|
+ { title: '类型', dataIndex: 'examType', key: 'examType', width: 120, columnsType: [1, 3] },
|
|
|
+ { title: '开始时间', dataIndex: 'startTime', key: 'startTime', width: 180, columnsType: [1, 3] },
|
|
|
+ { title: '结束时间', dataIndex: 'endTime', key: 'endTime', width: 180, columnsType: [1, 3] },
|
|
|
|
|
|
- { title: '状态', dataIndex: 'status', key: 'status', width: 90 },
|
|
|
- { title: '操作', key: 'action', align: 'right', width: 120 }
|
|
|
+ { title: '状态', dataIndex: 'status', key: 'status', width: 90, columnsType: [1, 2, 3, 4] },
|
|
|
+ { title: '操作', key: 'action', align: 'right', width: 120, columnsType: [1, 2, 3, 4] }
|
|
|
])
|
|
|
const statusTextFormatter = (status) => {
|
|
|
if (status === 0) return '未答题'
|
|
|
@@ -156,9 +194,13 @@
|
|
|
subjectId: pagination.value.subjectId,
|
|
|
courseId: route.query.id,
|
|
|
paperType: paperType.value,
|
|
|
- examType: examType.value
|
|
|
+ examType: examTypeSelect.value
|
|
|
+ }
|
|
|
+ if (examType.value == 4 || examType.value == 2) {
|
|
|
+ res = await examPaperApi.newPageList(params)
|
|
|
+ } else {
|
|
|
+ res = await examPaperApi.pageExamList(params)
|
|
|
}
|
|
|
- res = await examPaperApi.pageExamList(params)
|
|
|
|
|
|
taskList.value = res?.records || []
|
|
|
pagination.value.total = res.total
|
|
|
@@ -182,6 +224,7 @@
|
|
|
}
|
|
|
// lifecycle
|
|
|
const examType = ref()
|
|
|
+ const examTypeSelect = ref()
|
|
|
const paperType = ref(2)
|
|
|
|
|
|
// 监听消息
|