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({
updateLabel
updateLabel,
onSelectOption
})

View File

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

View File

@ -3,7 +3,7 @@
<div class="activeExp-header">
<div class="infomation" v-if="isStadium() !== true" >
<!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> -->
<selectClass ref="selectClassRef"/>
<selectClass ref="selectClassRef" @experlist="initExperimentFirst"/>
</div>
<div>
<selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" />
@ -69,11 +69,13 @@ onMounted(() => {
// // mainDiv ref="mainDiv"
// }
//
// const getExperimentList = (val) => {
// console.log(val,'list')
// // experimentList.value = val;
// }
//
const initExperimentFirst = (val) => {
//
if (val[0].label && val[0].label !='') {
selectExperimentRef.value.onSelectOption(val[0].label);
}
}
//
const getExperimentListItem = (val) => {
console.log(val,'选择的实验课程信息')
@ -82,7 +84,7 @@ const getExperimentListItem = (val) => {
}
//
watch(() => props.expObj.fileurl, (newVal, oldVal) => {
console.log(props.expObj,'科学实验科目')
console.log(props.expObj,'监听-科学实验科目')
activeExp.value = props.expObj;
//