Compare commits

...

4 Commits

4 changed files with 69 additions and 10 deletions

View File

@ -36,13 +36,13 @@ export const processList = (row, aloneOption=false) => {
row[i].method = jjj.method row[i].method = jjj.method
row[i].discuss = jjj.discuss row[i].discuss = jjj.discuss
//row[i].discusscollapse = false; //row[i].discusscollapse = false;
if (row[i].examdate !== null && row[i].examdate !== undefined) { if (row[i].examdate && row[i].examdate != "") {
row[i].examdate = row[i].examdate.substring(0, 10) row[i].examdate = row[i].examdate.substring(0, 10)
} }
// 具体题型数据结构处理 // 具体题型数据结构处理
if (row[i].worktype == '复合题') { if (row[i].worktype == '复合题') {
// 旧类型 // 复合题 - 旧格式
if (row[i].title.indexOf('!@#$%') !== -1) { if (row[i].title.indexOf('!@#$%') !== -1) {
// 1.选项解析替换 // 1.选项解析替换
const options = JSON.parse(row[i].workdesc) const options = JSON.parse(row[i].workdesc)
@ -129,7 +129,9 @@ export const processList = (row, aloneOption=false) => {
row[i].workanswerFormat = answer row[i].workanswerFormat = answer
} else { } else {
// 处理[题干显示] - 不再需要处理 // 复合题 - 现格式
// 处理[题干显示] - 不再需要处理(头部已处理)
// row[i].titleFormat = row[i].title; // 仅占位提示 // row[i].titleFormat = row[i].title; // 仅占位提示
/** /**
@ -222,6 +224,7 @@ export const processList = (row, aloneOption=false) => {
row[i].workanswerFormat = workAnswerHtml row[i].workanswerFormat = workAnswerHtml
} }
} else if ( } else if (
/** 主观题/非基础题(其中主要为第三方的各类解答题) */
row[i].worktype == '主观题' || row[i].worktype == '主观题' ||
(row[i].worktype !== '单选题' && (row[i].worktype !== '单选题' &&
row[i].worktype !== '多选题' && row[i].worktype !== '多选题' &&
@ -236,7 +239,7 @@ export const processList = (row, aloneOption=false) => {
row[i].workanswerFormat = JSON.parse(row[i].workanswer) row[i].workanswerFormat = JSON.parse(row[i].workanswer)
} }
} else { } else {
// 单选题|多选题|填空题|判断题|主观题?(待确认是否归在这里) // 基础题: 单选题|多选题|填空题|判断题|主观题?(待确认是否归在这里)
// 通用选项结构 ['ABC123','ABC123'] | ['ABC123','ABC123'] | [](填空题无选项) | [](判断题无选项) // 通用选项结构 ['ABC123','ABC123'] | ['ABC123','ABC123'] | [](填空题无选项) | [](判断题无选项)
let workDescArr = [] let workDescArr = []
if ( if (

View File

@ -16,6 +16,16 @@
<el-table-column align="center" prop="worktype" width="100"></el-table-column> <el-table-column align="center" prop="worktype" width="100"></el-table-column>
<el-table-column align="center" prop="worktag" width="120"></el-table-column> <el-table-column align="center" prop="worktag" width="120"></el-table-column>
</el-table> </el-table>
<!-- 分页-->
<div style="height: 48px;">
<el-pagination
v-show="paginationParams.total > 0"
v-model:page="paginationParams.pageNum"
v-model:limit="paginationParams.pageSize"
:total="paginationParams.total"
:style="{ position: 'relative', 'padding': '8px 20px 0 0' }"
@change="changePageNum" />
</div>
<!-- 试题详细信息 --> <!-- 试题详细信息 -->
<examDetailsDrawer ref="examDetailsDrawerRef"></examDetailsDrawer> <examDetailsDrawer ref="examDetailsDrawerRef"></examDetailsDrawer>
@ -54,11 +64,13 @@ const { proxy } = getCurrentInstance()
const props = defineProps({ const props = defineProps({
listExamQuestion: {type: Array}, listExamQuestion: {type: Array},
loading: {type: Boolean} loading: {type: Boolean},
paginationParams: {type: Object},
}) })
const activeExamInfoDrawer = ref(false); const activeExamInfoDrawer = ref(false);
const activeExam = ref({}); const activeExam = ref({});
const emit = defineEmits(['updatePageNum'])
const showExamAnalyseDrawer = (row) => { const showExamAnalyseDrawer = (row) => {
nextTick(() => { nextTick(() => {
@ -69,13 +81,17 @@ const showExamAnalyseDrawer = (row) => {
}) })
} }
const changePageNum = (pageNum) => {
emit('updatePageNum', pageNum);
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.table-main { .table-main {
width: 100%; width: 100%;
height: 100%; height: calc(100% - 48px);
text-align: left; text-align: left;
.main-title { .main-title {

View File

@ -47,10 +47,13 @@
</el-select> </el-select>
</div> </div>
<div :style="{'width': (viewportWidth - 400) + 'px','height': (viewportHeight-38) + 'px','overflow-y': 'auto'}"> <!-- <div :style="{'width': (viewportWidth - 400) + 'px','height': (viewportHeight-38) + 'px','overflow-y': 'auto'}"> -->
<div style="width: 100%; height: 100%; overflow-y: auto; border-radius: 10px;">
<examReview <examReview
:loading="loading" :loading="loading"
:listExamQuestion="listExamQuestion" :listExamQuestion="listExamQuestion"
:paginationParams="paginationParams"
@updatePageNum="updatePageNum"
v-if="curTask.viewkey=='真题回顾' " v-if="curTask.viewkey=='真题回顾' "
/> />
@ -77,12 +80,15 @@ import ChooseTextbook from '@/components/choose-textbook/index.vue'
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork' import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork'
import { processList } from '@/hooks/useProcessList' import { processList } from '@/hooks/useProcessList'
import { JYApiListCT} from "@/utils/examQuestion/jyeoo" import { JYApiListCT} from "@/utils/examQuestion/jyeoo"
import useClassTaskStore from '@/store/modules/classTask'
import examReview from './container/examReview.vue' import examReview from './container/examReview.vue'
import pointAnalysis from './container/pointAnalysis.vue' import pointAnalysis from './container/pointAnalysis.vue'
import examMocks from './container/examMocks.vue' import examMocks from './container/examMocks.vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
const classTaskStore = useClassTaskStore();
const {proxy} = getCurrentInstance(); const {proxy} = getCurrentInstance();
const sourceStore = useResoureStore(); const sourceStore = useResoureStore();
const viewportHeight = ref(0); const viewportHeight = ref(0);
@ -91,6 +97,11 @@ const viewportWidth = ref(0);
const curNode = ref({}); const curNode = ref({});
// //
const listExamQuestion = ref([]); const listExamQuestion = ref([]);
const paginationParams = reactive({
pageNum: 1,
pageSize: 10,
total: 0,
});
const loading = ref(false); const loading = ref(false);
const curTask = reactive({ const curTask = reactive({
viewkey: '真题回顾', viewkey: '真题回顾',
@ -107,6 +118,22 @@ const listWorkType = ref([{
value: 0, value: 0,
}]); }]);
/**
* @desc: 翻页
* @return: {*}
* @param {*} pageNum
*/
const updatePageNum = (pageNum) => {
paginationParams.pageNum = pageNum;
queryExamQuestionByParams();
}
/**
* @desc: 具体获取试题及格式化
* @return: {*}
* @param {*} params
*/
const getCourseWorkList = async (params) => { const getCourseWorkList = async (params) => {
const res = await listEntpcourseworkNew(params); const res = await listEntpcourseworkNew(params);
if(res.data == null) { if(res.data == null) {
@ -115,7 +142,14 @@ const getCourseWorkList = async (params) => {
return; return;
} }
listExamQuestion.value = res.data; listExamQuestion.value = res.data;
// queryParams.total = res.total; //
const total = parseInt(res.msg)
if (!isNaN(total)) {
paginationParams.total = total;
} else {
console.error('无法将 res.msg 转换为数字');
paginationParams.total = 0; //
}
// //
processList(listExamQuestion.value); processList(listExamQuestion.value);
} }
@ -132,7 +166,8 @@ const getData = async (data) => {
loading.value = true; loading.value = true;
// 1. // 1.
getWorkType(data.node); //getWorkType(data.node);
listWorkType.value = classTaskStore.entpCourseWorkTypeList;
// 2. // 2.
curNode.value = data.node; curNode.value = data.node;
@ -166,6 +201,8 @@ const getData = async (data) => {
edusubject: curNode.value.edusubject, edusubject: curNode.value.edusubject,
edustage: curNode.value.edustage, edustage: curNode.value.edustage,
sectionName: curNode.value.itemtitle, sectionName: curNode.value.itemtitle,
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
} }
await getCourseWorkList(params); await getCourseWorkList(params);
loading.value = false; loading.value = false;
@ -181,6 +218,7 @@ const changeTaskView = (item, key) => {
curTask.viewkey = item; curTask.viewkey = item;
} }
// 使, classTaskStore
const getWorkType = async (data) => { const getWorkType = async (data) => {
const selName = `${data.edustage}${data.edusubject}` const selName = `${data.edustage}${data.edusubject}`
const curName = `${curNode.value.edustage}${curNode.value.edusubject}` const curName = `${curNode.value.edustage}${curNode.value.edusubject}`
@ -231,6 +269,8 @@ const queryExamQuestionByParams = async () => {
edusubject: curNode.value.edusubject, edusubject: curNode.value.edusubject,
edustage: curNode.value.edustage, edustage: curNode.value.edustage,
sectionName: curNode.value.itemtitle, sectionName: curNode.value.itemtitle,
currentPage: paginationParams.pageNum,
pageSize: paginationParams.pageSize,
} }
await getCourseWorkList(params); await getCourseWorkList(params);
loading.value = false; loading.value = false;