Compare commits
7 Commits
b5f824ceea
...
1f96b9b09e
Author | SHA1 | Date |
---|---|---|
zouyf | 1f96b9b09e | |
“zouyf” | 35c088c25a | |
“zouyf” | 028eb0f752 | |
zhengdegang | 9a68661fb0 | |
zdg | b28abdff50 | |
zdg | b428260703 | |
“zouyf” | 7b59d78ce3 |
|
@ -4,7 +4,7 @@
|
|||
* @date 2024-11-26
|
||||
*/
|
||||
import { toRaw } from 'vue'
|
||||
import { Result } from '@/types' // 接口类型
|
||||
import type { Result } from './types' // 接口类型
|
||||
import msgUtils from '@/plugins/modal' // 消息工具
|
||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||
import * as API_smarttalk from '@/api/file' // 相关api
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @description api 无store循环引用
|
||||
* @author zdg
|
||||
*/
|
||||
import { Result } from '@/types' // 接口类型
|
||||
import type { Result } from './types' // 接口类型
|
||||
import msgUtils from '@/plugins/modal' // 消息工具
|
||||
import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api
|
||||
|
||||
|
|
|
@ -36,13 +36,13 @@ export const processList = (row, aloneOption=false) => {
|
|||
row[i].method = jjj.method
|
||||
row[i].discuss = jjj.discuss
|
||||
//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)
|
||||
}
|
||||
|
||||
// 具体题型数据结构处理
|
||||
if (row[i].worktype == '复合题') {
|
||||
// 旧类型
|
||||
// 复合题 - 旧格式
|
||||
if (row[i].title.indexOf('!@#$%') !== -1) {
|
||||
// 1.选项解析替换
|
||||
const options = JSON.parse(row[i].workdesc)
|
||||
|
@ -129,7 +129,9 @@ export const processList = (row, aloneOption=false) => {
|
|||
|
||||
row[i].workanswerFormat = answer
|
||||
} else {
|
||||
// 处理[题干显示] - 不再需要处理
|
||||
// 复合题 - 现格式
|
||||
|
||||
// 处理[题干显示] - 不再需要处理(头部已处理)
|
||||
// row[i].titleFormat = row[i].title; // 仅占位提示
|
||||
|
||||
/**
|
||||
|
@ -222,6 +224,7 @@ export const processList = (row, aloneOption=false) => {
|
|||
row[i].workanswerFormat = workAnswerHtml
|
||||
}
|
||||
} else if (
|
||||
/** 主观题/非基础题(其中主要为第三方的各类解答题) */
|
||||
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)
|
||||
}
|
||||
} else {
|
||||
// 单选题|多选题|填空题|判断题|主观题?(待确认是否归在这里)
|
||||
// 基础题: 单选题|多选题|填空题|判断题|主观题?(待确认是否归在这里)
|
||||
// 通用选项结构 ['ABC123','ABC123'] | ['ABC123','ABC123'] | [](填空题无选项) | [](判断题无选项)
|
||||
let workDescArr = []
|
||||
if (
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="年份" label-width="70">
|
||||
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择" >
|
||||
<el-select v-model="entpCourseWorkQueryParams.yearStr" placeholder="请选择">
|
||||
<el-option v-for="(item, index) in entpCourseWorkYearList" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
|
@ -16,6 +16,16 @@
|
|||
<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>
|
||||
<!-- 分页-->
|
||||
<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>
|
||||
|
@ -54,11 +64,13 @@ const { proxy } = getCurrentInstance()
|
|||
|
||||
const props = defineProps({
|
||||
listExamQuestion: {type: Array},
|
||||
loading: {type: Boolean}
|
||||
loading: {type: Boolean},
|
||||
paginationParams: {type: Object},
|
||||
})
|
||||
|
||||
const activeExamInfoDrawer = ref(false);
|
||||
const activeExam = ref({});
|
||||
const emit = defineEmits(['updatePageNum'])
|
||||
|
||||
const showExamAnalyseDrawer = (row) => {
|
||||
nextTick(() => {
|
||||
|
@ -69,13 +81,17 @@ const showExamAnalyseDrawer = (row) => {
|
|||
})
|
||||
}
|
||||
|
||||
const changePageNum = (pageNum) => {
|
||||
emit('updatePageNum', pageNum);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.table-main {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: calc(100% - 48px);
|
||||
text-align: left;
|
||||
|
||||
.main-title {
|
||||
|
|
|
@ -47,10 +47,13 @@
|
|||
</el-select>
|
||||
</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
|
||||
:loading="loading"
|
||||
:listExamQuestion="listExamQuestion"
|
||||
:paginationParams="paginationParams"
|
||||
@updatePageNum="updatePageNum"
|
||||
v-if="curTask.viewkey=='真题回顾' "
|
||||
/>
|
||||
|
||||
|
@ -77,12 +80,15 @@ import ChooseTextbook from '@/components/choose-textbook/index.vue'
|
|||
import {listEntpcoursework, listEntpcourseworkNew} from '@/api/education/entpCourseWork'
|
||||
import { processList } from '@/hooks/useProcessList'
|
||||
import { JYApiListCT} from "@/utils/examQuestion/jyeoo"
|
||||
import useClassTaskStore from '@/store/modules/classTask'
|
||||
|
||||
import examReview from './container/examReview.vue'
|
||||
import pointAnalysis from './container/pointAnalysis.vue'
|
||||
import examMocks from './container/examMocks.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const classTaskStore = useClassTaskStore();
|
||||
|
||||
const {proxy} = getCurrentInstance();
|
||||
const sourceStore = useResoureStore();
|
||||
const viewportHeight = ref(0);
|
||||
|
@ -91,6 +97,11 @@ const viewportWidth = ref(0);
|
|||
const curNode = ref({});
|
||||
// 试题集合
|
||||
const listExamQuestion = ref([]);
|
||||
const paginationParams = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
});
|
||||
const loading = ref(false);
|
||||
const curTask = reactive({
|
||||
viewkey: '真题回顾',
|
||||
|
@ -107,6 +118,22 @@ const listWorkType = ref([{
|
|||
value: 0,
|
||||
}]);
|
||||
|
||||
|
||||
/**
|
||||
* @desc: 翻页
|
||||
* @return: {*}
|
||||
* @param {*} pageNum
|
||||
*/
|
||||
const updatePageNum = (pageNum) => {
|
||||
paginationParams.pageNum = pageNum;
|
||||
queryExamQuestionByParams();
|
||||
}
|
||||
|
||||
/**
|
||||
* @desc: 具体获取试题及格式化
|
||||
* @return: {*}
|
||||
* @param {*} params
|
||||
*/
|
||||
const getCourseWorkList = async (params) => {
|
||||
const res = await listEntpcourseworkNew(params);
|
||||
if(res.data == null) {
|
||||
|
@ -115,7 +142,14 @@ const getCourseWorkList = async (params) => {
|
|||
return;
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
@ -132,7 +166,8 @@ const getData = async (data) => {
|
|||
loading.value = true;
|
||||
|
||||
// 1.获取题型
|
||||
getWorkType(data.node);
|
||||
//getWorkType(data.node);
|
||||
listWorkType.value = classTaskStore.entpCourseWorkTypeList;
|
||||
|
||||
// 2.获取试题集合
|
||||
curNode.value = data.node;
|
||||
|
@ -166,6 +201,8 @@ const getData = async (data) => {
|
|||
edusubject: curNode.value.edusubject,
|
||||
edustage: curNode.value.edustage,
|
||||
sectionName: curNode.value.itemtitle,
|
||||
currentPage: paginationParams.pageNum,
|
||||
pageSize: paginationParams.pageSize,
|
||||
}
|
||||
await getCourseWorkList(params);
|
||||
loading.value = false;
|
||||
|
@ -181,6 +218,7 @@ const changeTaskView = (item, key) => {
|
|||
curTask.viewkey = item;
|
||||
}
|
||||
|
||||
// 目前暂不使用, 题型已通过classTaskStore获取
|
||||
const getWorkType = async (data) => {
|
||||
const selName = `${data.edustage}${data.edusubject}`
|
||||
const curName = `${curNode.value.edustage}${curNode.value.edusubject}`
|
||||
|
@ -231,6 +269,8 @@ const queryExamQuestionByParams = async () => {
|
|||
edusubject: curNode.value.edusubject,
|
||||
edustage: curNode.value.edustage,
|
||||
sectionName: curNode.value.itemtitle,
|
||||
currentPage: paginationParams.pageNum,
|
||||
pageSize: paginationParams.pageSize,
|
||||
}
|
||||
await getCourseWorkList(params);
|
||||
loading.value = false;
|
||||
|
|
Loading…
Reference in New Issue