[查询试题] - 单元查询优化
This commit is contained in:
parent
cccf109499
commit
78ecf6ea55
|
@ -55,6 +55,7 @@
|
|||
<el-col :span="11">
|
||||
<el-form-item label="知识点" label-width="70">
|
||||
<el-cascader
|
||||
disabled
|
||||
v-model="entpCourseWorkQueryParams.point"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
|
@ -172,7 +173,7 @@
|
|||
<!-- 非习题训练:常规作业、 -->
|
||||
<div v-if="classWorkForm.worktype!='习题训练'">
|
||||
<div :style="{ 'overflow': 'auto'}">
|
||||
<template v-if="classWorkForm.worktype!='常规作业'">
|
||||
<!-- <template v-if="classWorkForm.worktype!='常规作业'">
|
||||
<template v-for="(item, index) in workResource.teachResourceList" :key="item">
|
||||
<div v-if="item.worktype==classWorkForm.worktype" style="border-bottom: 1px dotted;display: flex;justify-content: space-between;">
|
||||
<div style="margin-bottom: 5px; padding-left: 15px;display: flex;flex-direction: row;align-items: center;">
|
||||
|
@ -193,7 +194,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</template> -->
|
||||
<template v-if="classWorkForm.worktype =='常规作业'">
|
||||
<div v-loading="fileLoading" class="upload-homework">
|
||||
<FileUpload v-model="classWorkForm.fileHomeworkList" :fileSize="800" :fileType="['mp3','mp4','doc','docx','xlsx','xls','pdf','ppt','pptx','jpg','jpeg','gif','png','txt']"/>
|
||||
|
@ -285,6 +286,7 @@ import { updateClasswork, listEvaluationclue, listClassworkeval,delClassworkeval
|
|||
import { listEvaluation } from '@/api/subject'
|
||||
import { listEntpcoursefile } from '@/api/education/entpcoursefile'
|
||||
import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
|
||||
import { isJson } from "@/utils/comm";
|
||||
|
||||
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
|
@ -459,12 +461,13 @@ const client = new Apis('/paht');
|
|||
*/
|
||||
const t = function(name, time) {
|
||||
return new Promise(resolve => {
|
||||
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
|
||||
const queryForm = {
|
||||
// 分页参数
|
||||
currentPage: paginationParams.pageNum,
|
||||
pageSize: paginationParams.pageSize,
|
||||
// 课程相关参数
|
||||
eid: props.bookobj.levelSecondId,
|
||||
eid: evalId, // 当前单元或章节id
|
||||
sectionName: props.bookobj.coursetitle,
|
||||
edusubject: userStore.edusubject,
|
||||
edustage: userStore.edustage,
|
||||
|
@ -557,9 +560,12 @@ const getQueryFromEvaluationclue = () => {
|
|||
}
|
||||
|
||||
if (clueres.rows[i].childlist != '') {
|
||||
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
|
||||
const tmpJson = '['+clueres.rows[i].childlist+']';
|
||||
if (isJson(tmpJson)){
|
||||
clueres.rows[i].childArray = JSON.parse(tmpJson);
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clueres.rows[i].childArray = {};
|
||||
|
@ -990,6 +996,8 @@ const initPageParams = () => {
|
|||
|
||||
|
||||
onMounted(async() => {
|
||||
// 知识点
|
||||
getEntpCourseWorkPointList();
|
||||
})
|
||||
|
||||
// const refreshData = () => {
|
||||
|
@ -1016,9 +1024,9 @@ const debounceQueryData = debounce(() => {
|
|||
// 习题资源
|
||||
handleQueryFromEntpCourseWork(0);
|
||||
// 框架梳理
|
||||
getQueryFromEvaluationclue();
|
||||
//getQueryFromEvaluationclue();
|
||||
// 知识点
|
||||
getEntpCourseWorkPointList();
|
||||
//getEntpCourseWorkPointList();
|
||||
}, 1000);
|
||||
|
||||
watch(() => props.propsformobj.uniquekey, (newVal) => {
|
||||
|
@ -1027,8 +1035,20 @@ watch(() => props.propsformobj.uniquekey, (newVal) => {
|
|||
classWorkForm.uniquekey = props.propsformobj.uniquekey?cloneDeep(props.propsformobj.uniquekey):''; // 作业唯一标识 作业名称
|
||||
}
|
||||
})
|
||||
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
|
||||
|
||||
|
||||
//watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
|
||||
|
||||
watch([
|
||||
() => props.bookobj.levelFirstId,
|
||||
() => props.bookobj.levelSecondId
|
||||
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
|
||||
console.log(props.bookobj,'课程选择')
|
||||
// 默认选择一级单元时, 不自动获取试题, 需手动按钮获取试题
|
||||
if (props.bookobj.levelSecondId == '') {
|
||||
workResource.entpCourseWorkList = [];
|
||||
return;
|
||||
}
|
||||
debounceQueryData();
|
||||
})
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
|
|||
import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue";
|
||||
import { useHandleData } from "@/hooks/useHandleData";
|
||||
import { processList } from '@/hooks/useProcessList';
|
||||
import { isJson } from "@/utils/comm";
|
||||
|
||||
|
||||
import { debounce } from '@/utils/comm'
|
||||
|
@ -254,6 +255,7 @@ function Apis(key) {
|
|||
const client = new Apis('/paht');
|
||||
const t = function(name, time) {
|
||||
return new Promise(resolve => {
|
||||
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
|
||||
const queryForm = {
|
||||
// 题类
|
||||
worktype: entpCourseWorkQueryParams.worktype.label,
|
||||
|
@ -266,7 +268,7 @@ const t = function(name, time) {
|
|||
// 课程相关参数
|
||||
edustage: userStore.edustage, // this.userStore.edustage,
|
||||
edusubject: userStore.edusubject, // this.userStore.edusubject,
|
||||
eid: props.bookobj.levelSecondId, // this.activeParams.lession.id,
|
||||
eid: evalId, // 当前单元或章节id
|
||||
status: "1",
|
||||
editUserId: userStore.userId,
|
||||
//orderby: 'concat(worktype,timestamp) DESC',
|
||||
|
@ -326,9 +328,12 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
|
|||
}
|
||||
//console.log("clueres.rows[i].childlist",clueres.rows[i].childlist);
|
||||
if (clueres.rows[i].childlist != '') {
|
||||
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
|
||||
const tmpJson = '['+clueres.rows[i].childlist+']';
|
||||
if (isJson(tmpJson)){
|
||||
clueres.rows[i].childArray = JSON.parse(tmpJson);
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clueres.rows[i].childArray = {};
|
||||
|
@ -482,8 +487,16 @@ const debounceQueryData = debounce(() => {
|
|||
}, 1000);
|
||||
|
||||
|
||||
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
|
||||
watch([
|
||||
() => props.bookobj.levelFirstId,
|
||||
() => props.bookobj.levelSecondId
|
||||
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
|
||||
console.log(props.bookobj,'课程选择')
|
||||
// 默认选择一级单元时, 不自动获取试题, 需手动按钮获取试题
|
||||
if (props.bookobj.levelSecondId == '') {
|
||||
workResource.entpCourseWorkList = [];
|
||||
return;
|
||||
}
|
||||
debounceQueryData();
|
||||
})
|
||||
|
||||
|
|
|
@ -1703,13 +1703,13 @@ const myMessageShow=(title, msg, status)=>{
|
|||
* @return: {*}
|
||||
* @param {*} list
|
||||
*/
|
||||
const updateKnowledgePoint = (list) => {
|
||||
const formatKnowledgePoint = (list) => {
|
||||
list.forEach(item => {
|
||||
if (item.title && item.title != '') {
|
||||
item.knowTitle = item.title;
|
||||
}
|
||||
if (item.children && Array.isArray(item.children)) {
|
||||
updateKnowledgePoint(item.children);
|
||||
formatKnowledgePoint(item.children);
|
||||
}
|
||||
});
|
||||
return list;
|
||||
|
@ -1733,7 +1733,7 @@ watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
|
|||
if (id) {
|
||||
listKnowlegepointFormat({evalId: id, pageNum: 1, pageSize: 5000,}).then(res => {
|
||||
//console.log('listKnowlegepointFormat->', res.rows);
|
||||
curKnowledgePointList.value = updateKnowledgePoint(res.rows);
|
||||
curKnowledgePointList.value = formatKnowledgePoint(res.rows);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
|
|
|
@ -117,6 +117,8 @@ import { listKnowledgePoint } from "@/api/knowledge/knowledgePoint";
|
|||
import { getBindlist } from '@/api/education/knowledgePoint'
|
||||
import examDetailsDrawer from '@/components/exam-question/examDetailsDrawer.vue'
|
||||
import { processList } from '@/hooks/useProcessList'
|
||||
import { isJson } from "@/utils/comm";
|
||||
|
||||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import {throttle,debounce } from '@/utils/comm'
|
||||
|
@ -190,6 +192,8 @@ const workResource = reactive({
|
|||
|
||||
onMounted(() => {
|
||||
console.log('entpCourseWorkTypeList', entpCourseWorkTypeList);
|
||||
// 知识点 (仅用更新一次)
|
||||
getEntpCourseWorkPointList();
|
||||
debounceQueryData(); // 查询习题列表
|
||||
})
|
||||
|
||||
|
@ -235,32 +239,33 @@ function Apis(key) {
|
|||
const client = new Apis('/paht');
|
||||
const t = function(name, time) {
|
||||
return new Promise(resolve => {
|
||||
const queryForm = {
|
||||
// 分页参数
|
||||
currentPage: paginationParams.pageNum,
|
||||
pageSize: paginationParams.pageSize,
|
||||
// 课程相关参数
|
||||
eid: props.bookobj.levelSecondId,
|
||||
sectionName: props.bookobj.coursetitle,
|
||||
edusubject: userStore.edusubject,
|
||||
edustage: userStore.edustage,
|
||||
//
|
||||
// 题类
|
||||
worktype: entpCourseWorkQueryParams.worktype.label,
|
||||
workTypeId: entpCourseWorkQueryParams.worktype.value,
|
||||
// 题源
|
||||
workgroup: entpCourseWorkQueryParams.workgroup,
|
||||
// 年份
|
||||
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'',
|
||||
// 知识点
|
||||
thirdId: entpCourseWorkQueryParams.point&&entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'',
|
||||
// 关键字
|
||||
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
|
||||
const evalId = props.bookobj.levelSecondId=='' ? props.bookobj.levelFirstId : props.bookobj.levelSecondId;
|
||||
const queryForm = {
|
||||
// 分页参数
|
||||
currentPage: paginationParams.pageNum,
|
||||
pageSize: paginationParams.pageSize,
|
||||
// 课程相关参数
|
||||
eid: evalId, // 当前单元或章节id
|
||||
sectionName: props.bookobj.coursetitle,
|
||||
edusubject: userStore.edusubject,
|
||||
edustage: userStore.edustage,
|
||||
//
|
||||
// 题类
|
||||
worktype: entpCourseWorkQueryParams.worktype.label,
|
||||
workTypeId: entpCourseWorkQueryParams.worktype.value,
|
||||
// 题源
|
||||
workgroup: entpCourseWorkQueryParams.workgroup,
|
||||
// 年份
|
||||
yearStr: entpCourseWorkQueryParams.yearStr !== '-1' ? entpCourseWorkQueryParams.yearStr:'',
|
||||
// 知识点
|
||||
thirdId: entpCourseWorkQueryParams.point&&entpCourseWorkQueryParams.point.length > 0 ? entpCourseWorkQueryParams.point[0]:'',
|
||||
// 关键字
|
||||
keyword: entpCourseWorkQueryParams.keyWord && entpCourseWorkQueryParams.keyWord !== '' ? entpCourseWorkQueryParams.keyWord:'',
|
||||
|
||||
}
|
||||
const entpcourseworkres = listEntpcourseworkNew(queryForm);
|
||||
}
|
||||
const entpcourseworkres = listEntpcourseworkNew(queryForm);
|
||||
|
||||
resolve(entpcourseworkres);
|
||||
resolve(entpcourseworkres);
|
||||
})
|
||||
}
|
||||
const handleQueryFromEntpCourseWork= async (queryType) => {
|
||||
|
@ -329,9 +334,12 @@ const handleQueryFromEntpCourseWork= async (queryType) => {
|
|||
}
|
||||
//console.log("clueres.rows[i].childlist",clueres.rows[i].childlist);
|
||||
if (clueres.rows[i].childlist != '') {
|
||||
clueres.rows[i].childArray = JSON.parse('['+clueres.rows[i].childlist+']');
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
|
||||
const tmpJson = '['+clueres.rows[i].childlist+']';
|
||||
if (isJson(tmpJson)){
|
||||
clueres.rows[i].childArray = JSON.parse(tmpJson);
|
||||
for (var j=0; j<clueres.rows[i].childArray.length; j++) {
|
||||
clueres.rows[i].childArray[j].title = clueres.rows[i].childArray[j].title.replace(/(<([^>]+)>)/ig, '');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
clueres.rows[i].childArray = {};
|
||||
|
@ -460,19 +468,29 @@ const captureScreenshot = (id) => {
|
|||
// 防抖
|
||||
const debounceQueryData = debounce(() => {
|
||||
console.log("防抖 加载数据中...")
|
||||
console.log(props.bookobj,'课程选择')
|
||||
// 初始化滚动加载参数
|
||||
initPageParams();
|
||||
// 习题资源
|
||||
handleQueryFromEntpCourseWork(0);
|
||||
// 框架梳理
|
||||
getQueryFromEvaluationclue();
|
||||
//getQueryFromEvaluationclue();
|
||||
// 知识点
|
||||
getEntpCourseWorkPointList();
|
||||
//getEntpCourseWorkPointList();
|
||||
}, 1000);
|
||||
|
||||
//watch(() => props.bookobj.levelSecondId, async (newVal, oldVal) => {
|
||||
|
||||
watch(() => props.bookobj.levelSecondId, (newVal, oldVal) => {
|
||||
watch([
|
||||
() => props.bookobj.levelFirstId,
|
||||
() => props.bookobj.levelSecondId
|
||||
], ([newLevelSecondId, newLevelFirstId], [oldLevelSecondId, oldLevelFirstId]) => {
|
||||
console.log(props.bookobj,'课程选择')
|
||||
// 默认选择一级单元时, 不自动获取试题, 需手动按钮获取试题
|
||||
if (props.bookobj.levelSecondId == '') {
|
||||
workResource.entpCourseWorkList = [];
|
||||
return;
|
||||
}
|
||||
debounceQueryData();
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue