@@ -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]+)>)/ig, '');
+ const tmpJson = '['+clueres.rows[i].childlist+']';
+ if (isJson(tmpJson)){
+ clueres.rows[i].childArray = JSON.parse(tmpJson);
+ for (var j=0; j]+)>)/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();
})
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue
index 9755859..a7ff24a 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue
@@ -36,16 +36,24 @@ const props = defineProps({
})
const value = ref('')
+const updateLabel = (val) => {
+ value.value = val;
+}
-
+const onSelectOption = (option) => {
+ classTaskStore.updateEduInfo = `${classTaskStore.edustage}-${classTaskStore.edusubject}`;
+ console.log('updateEduInfo->', classTaskStore.updateEduInfo);
+ console.log(option,'选择的实验课-------')
+ emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
+}
onMounted(() => {
})
-const onSelectOption = (option) => {
- console.log(option,'选择的实验课-------')
- emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
-}
+defineExpose({
+ updateLabel
+})
+