[考试分析] - 优化非绑定菁优网章节不显示试题
This commit is contained in:
parent
f6f804a09e
commit
cd5abd864d
|
@ -49,7 +49,7 @@ import { useGetSubject } from '@/hooks/useGetSubject'
|
||||||
|
|
||||||
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
const BaseUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH
|
||||||
// 定义要发送的emit事件
|
// 定义要发送的emit事件
|
||||||
const emit = defineEmits(['nodeClick'])
|
const emit = defineEmits(['nodeClick', 'changeBook'])
|
||||||
let useSubject = null
|
let useSubject = null
|
||||||
const subjectList = ref([])
|
const subjectList = ref([])
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
|
@ -164,7 +164,6 @@ const handleNodeClick = (data) => {
|
||||||
sessionStore.set('subject.defaultExpandedKeys', defaultExpandedKeys)
|
sessionStore.set('subject.defaultExpandedKeys', defaultExpandedKeys)
|
||||||
sessionStore.set('subject.curNode', nodeData)
|
sessionStore.set('subject.curNode', nodeData)
|
||||||
emit('nodeClick', curData)
|
emit('nodeClick', curData)
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted( async () => {
|
onMounted( async () => {
|
||||||
treeLoading.value = true
|
treeLoading.value = true
|
||||||
|
|
|
@ -58,8 +58,8 @@
|
||||||
v-else-if="curTask.viewkey=='考点分析' "
|
v-else-if="curTask.viewkey=='考点分析' "
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<examMocks v-else
|
<examMocks
|
||||||
|
v-else
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,6 +81,7 @@ import { JYApiListCT} from "@/utils/examQuestion/jyeoo"
|
||||||
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'
|
||||||
|
|
||||||
const {proxy} = getCurrentInstance();
|
const {proxy} = getCurrentInstance();
|
||||||
const sourceStore = useResoureStore();
|
const sourceStore = useResoureStore();
|
||||||
|
@ -106,6 +107,19 @@ const listWorkType = ref([{
|
||||||
value: 0,
|
value: 0,
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
const getCourseWorkList = async (params) => {
|
||||||
|
const res = await listEntpcourseworkNew(params);
|
||||||
|
if(res.data == null) {
|
||||||
|
listExamQuestion.value = [];
|
||||||
|
// queryParams.total = 0
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
listExamQuestion.value = res.data;
|
||||||
|
// queryParams.total = res.total;
|
||||||
|
// 格式化试题
|
||||||
|
processList(listExamQuestion.value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @desc: 选中单元章节后的回调, 获取单元章节信息
|
* @desc: 选中单元章节后的回调, 获取单元章节信息
|
||||||
* @return: {*}
|
* @return: {*}
|
||||||
|
@ -134,6 +148,15 @@ const getData = async (data) => {
|
||||||
// const res = await listEntpcoursework(params);
|
// const res = await listEntpcoursework(params);
|
||||||
// listExamQuestion.value = res.rows;
|
// listExamQuestion.value = res.rows;
|
||||||
|
|
||||||
|
// 当前不存在对应绑定的菁优网章节id时, 不进行处理
|
||||||
|
// 注意: 菁优网章节id绑定需在网页端[/evaluation/bind]中进行绑定
|
||||||
|
if (curNode.value.bookId == null || curNode.value.bookId == '' || curNode.value.bookId == '0') {
|
||||||
|
listExamQuestion.value = [];
|
||||||
|
loading.value = false;
|
||||||
|
ElMessage.error("当前单元/章节下无试题");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 查询本地+菁优网(后端处理)
|
// 查询本地+菁优网(后端处理)
|
||||||
const params = {
|
const params = {
|
||||||
eid: curNode.value.id,
|
eid: curNode.value.id,
|
||||||
|
@ -144,17 +167,7 @@ const getData = async (data) => {
|
||||||
edustage: curNode.value.edustage,
|
edustage: curNode.value.edustage,
|
||||||
sectionName: curNode.value.itemtitle,
|
sectionName: curNode.value.itemtitle,
|
||||||
}
|
}
|
||||||
const res = await listEntpcourseworkNew(params);
|
await getCourseWorkList(params);
|
||||||
if(res.data == null) {
|
|
||||||
listExamQuestion.value = [];
|
|
||||||
// queryParams.total = 0
|
|
||||||
loading.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
listExamQuestion.value = res.data;
|
|
||||||
// queryParams.total = res.total;
|
|
||||||
// 格式化试题
|
|
||||||
processList(listExamQuestion.value);
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,6 +215,13 @@ const queryExamQuestionByParams = async () => {
|
||||||
// const res = await listEntpcoursework(params);
|
// const res = await listEntpcoursework(params);
|
||||||
// listExamQuestion.value = res.rows;
|
// listExamQuestion.value = res.rows;
|
||||||
|
|
||||||
|
if (curNode.value.bookId == null || curNode.value.bookId == '' || curNode.value.bookId == '0') {
|
||||||
|
listExamQuestion.value = [];
|
||||||
|
loading.value = false;
|
||||||
|
ElMessage.error("当前单元/章节下无试题");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 查询本地+菁优网(后端处理)
|
// 查询本地+菁优网(后端处理)
|
||||||
const params = {
|
const params = {
|
||||||
eid: curNode.value.id,
|
eid: curNode.value.id,
|
||||||
|
@ -212,17 +232,7 @@ const queryExamQuestionByParams = async () => {
|
||||||
edustage: curNode.value.edustage,
|
edustage: curNode.value.edustage,
|
||||||
sectionName: curNode.value.itemtitle,
|
sectionName: curNode.value.itemtitle,
|
||||||
}
|
}
|
||||||
const res = await listEntpcourseworkNew(params);
|
await getCourseWorkList(params);
|
||||||
if(res.data == null) {
|
|
||||||
listExamQuestion.value = [];
|
|
||||||
// queryParams.total = 0
|
|
||||||
loading.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
listExamQuestion.value = res.data;
|
|
||||||
// queryParams.total = res.total;
|
|
||||||
// 格式化试题
|
|
||||||
processList(listExamQuestion.value);
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue