This commit is contained in:
“zouyf” 2024-12-25 10:06:03 +08:00
parent 63b8a0d5c6
commit ff0dd3600c
6 changed files with 55 additions and 8 deletions

View File

@ -1,5 +1,7 @@
import { listEntpcoursework,getEvaluationclue } from '@/api/classTask'; import { listEntpcoursework,getEvaluationclue } from '@/api/classTask';
import { processList } from '@/hooks/useProcessList'; import { processList } from '@/hooks/useProcessList';
import useClassTaskStore from '@/store/modules/classTask'
const useClassTaskStores = useClassTaskStore();
const isJson = (str) => { const isJson = (str) => {
if (typeof str == 'string') { if (typeof str == 'string') {
@ -114,6 +116,13 @@ export const editListItem = (row, courseObj) => {
} }
else if (row.worktype == '科学实验') { else if (row.worktype == '科学实验') {
if(isJson(row.workcodes)){ if(isJson(row.workcodes)){
// 同步更新实验内部的科目信息
if (row.worktag && row.worktag.indexOf('-') > -1){
const eduInfo = row.worktag.split('-');
useClassTaskStores.experimentObj.edustage = eduInfo[0];
useClassTaskStores.experimentObj.edusubject = eduInfo[1];
}
// 更新科学实验内容
classtaskObj.fileHomeworkList = JSON.parse(row.workcodes); classtaskObj.fileHomeworkList = JSON.parse(row.workcodes);
// //
// console.log('科学实验', classtaskObj); // console.log('科学实验', classtaskObj);

View File

@ -9,6 +9,7 @@ const useClassTaskStore = defineStore('classTask',{
edustage: '小学', // 教育阶段 edustage: '小学', // 教育阶段
edusubject: '', // 学科 edusubject: '', // 学科
experimentList: [], // 实验科目列表 experimentList: [], // 实验科目列表
updateEduInfo: '小学-数学', //实际需上传的学段+学科信息(用于上传及回显实验内的学段学科)
}, },
isOpenQuestUploadView: false, // 是否打开习题上传的页面 isOpenQuestUploadView: false, // 是否打开习题上传的页面
classListIds: [], classListIds: [],

View File

@ -36,16 +36,24 @@ const props = defineProps({
}) })
const value = ref('') const value = ref('')
const updateLabel = (val) => {
value.value = val;
}
const onSelectOption = (option) => {
classTaskStore.updateEduInfo = `${classTaskStore.edustage}-${classTaskStore.edusubject}`;
console.log('updateEduInfo->', classTaskStore.experimentList.updateEduInfo);
console.log(option,'选择的实验课-------')
emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
}
onMounted(() => { onMounted(() => {
}) })
const onSelectOption = (option) => { defineExpose({
console.log(option,'选择的实验课-------') updateLabel
emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0]) })
}
</script> </script>
<style scoped> <style scoped>

View File

@ -177,10 +177,29 @@ const handleUserEduSubject = (item) => {
// emit('experlist',checkList.value) // emit('experlist',checkList.value)
} }
const updateCheckList = () => {
const edustage = useClassTaskStore().experimentObj.edustage;
if(edustage === '小学'){
chooseGrade.value = jsonData.data.primary
}else if(edustage === '初中'){
chooseGrade.value = jsonData.data.junior
}else if(edustage === '高中'){
chooseGrade.value = jsonData.data.senior
}
expList.value = chooseGrade.value
const edusubject = useClassTaskStore().experimentObj.edusubject;
handleUserEduSubject(edusubject);
}
onMounted(() => { onMounted(() => {
getSubject() getSubject()
}) })
defineExpose({
updateCheckList
})
</script> </script>
<style scoped> <style scoped>
.custom-button { .custom-button {

View File

@ -3,10 +3,10 @@
<div class="activeExp-header"> <div class="activeExp-header">
<div class="infomation" v-if="isStadium() !== true" > <div class="infomation" v-if="isStadium() !== true" >
<!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> --> <!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> -->
<selectClass v-if="!isSubject" /> <selectClass ref="selectClassRef"/>
</div> </div>
<div> <div>
<selectExperiment @selectItem="getExperimentListItem" /> <selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" />
</div> </div>
</div> </div>
<div ref="mainDiv" class="activeExp-main" style="overflow: auto"> <div ref="mainDiv" class="activeExp-main" style="overflow: auto">
@ -44,6 +44,8 @@ const props = defineProps({
// //
// const experimentList = ref([]); // const experimentList = ref([]);
const activeExp = ref({}); const activeExp = ref({});
const selectExperimentRef = ref();
const selectClassRef = ref();
const isStadium = () => { const isStadium = () => {
let roles = userStore.roles let roles = userStore.roles
@ -82,6 +84,13 @@ const getExperimentListItem = (val) => {
watch(() => props.expObj.fileurl, (newVal, oldVal) => { watch(() => props.expObj.fileurl, (newVal, oldVal) => {
console.log(props.expObj,'科学实验科目') console.log(props.expObj,'科学实验科目')
activeExp.value = props.expObj; activeExp.value = props.expObj;
//
nextTick(() => {
selectClassRef.value.updateCheckList();
selectExperimentRef.value.updateLabel(props.expObj.label);
})
}) })
</script> </script>

View File

@ -807,6 +807,7 @@ const editWork = async (cform) =>{
else if (classWorkForm.worktype=='科学实验') { //TODO fileHomeworkList else if (classWorkForm.worktype=='科学实验') { //TODO fileHomeworkList
// 1. (, ) // 1. (, )
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
} }
// 3. // 3.