This commit is contained in:
“zouyf” 2025-01-20 17:28:01 +08:00
parent 24b2d08617
commit 92170da77d
3 changed files with 17 additions and 12 deletions

View File

@ -51,7 +51,8 @@ onMounted(() => {
}) })
defineExpose({ defineExpose({
updateLabel updateLabel,
onSelectOption
}) })

View File

@ -49,7 +49,7 @@ import useClassTaskStore from '@/store/modules/classTask'
const userStore = useUserStore().user const userStore = useUserStore().user
// emit // emit
// let emit = defineEmits(['experlist']) let emit = defineEmits(['experlist'])
// const expObj = ref({ // const expObj = ref({
// edustage: useClassTaskStore().experimentObj.edustage, // edustage: useClassTaskStore().experimentObj.edustage,
// edusubject: useClassTaskStore().experimentObj.edusubject, // edusubject: useClassTaskStore().experimentObj.edusubject,
@ -268,7 +268,7 @@ const handleUserEduStage = (item) => {
} }
} }
// //
const handleUserEduSubject = (item) => { const handleUserEduSubject = (item, isEmit=true) => {
// userStore.edusubject = item; // userStore.edusubject = item;
useClassTaskStore().experimentObj.edusubject = item; useClassTaskStore().experimentObj.edusubject = item;
console.log(item,'选择的学科-------') console.log(item,'选择的学科-------')
@ -292,7 +292,9 @@ const handleUserEduSubject = (item) => {
} }
console.log(checkList.value,'checkList') console.log(checkList.value,'checkList')
useClassTaskStore().experimentObj.experimentList = checkList.value; useClassTaskStore().experimentObj.experimentList = checkList.value;
// emit('experlist',checkList.value) if (isEmit) {
emit('experlist',checkList.value)
}
} }
const updateCheckList = async () => { const updateCheckList = async () => {
@ -313,7 +315,7 @@ const updateCheckList = async () => {
expList.value = chooseGrade.value expList.value = chooseGrade.value
const edusubject = useClassTaskStore().experimentObj.edusubject; const edusubject = useClassTaskStore().experimentObj.edusubject;
bindSubject.value = [edustage, edusubject]; bindSubject.value = [edustage, edusubject];
handleUserEduSubject(edusubject); handleUserEduSubject(edusubject, false);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} }

View File

@ -3,7 +3,7 @@
<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 ref="selectClassRef"/> <selectClass ref="selectClassRef" @experlist="initExperimentFirst"/>
</div> </div>
<div> <div>
<selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" /> <selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" />
@ -69,11 +69,13 @@ onMounted(() => {
// // mainDiv ref="mainDiv" // // mainDiv ref="mainDiv"
// } // }
// //
// const getExperimentList = (val) => { const initExperimentFirst = (val) => {
// console.log(val,'list') //
// // experimentList.value = val; if (val[0].label && val[0].label !='') {
// } selectExperimentRef.value.onSelectOption(val[0].label);
}
}
// //
const getExperimentListItem = (val) => { const getExperimentListItem = (val) => {
console.log(val,'选择的实验课程信息') console.log(val,'选择的实验课程信息')
@ -82,7 +84,7 @@ 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;
// //