This commit is contained in:
parent
24b2d08617
commit
92170da77d
|
@ -51,7 +51,8 @@ onMounted(() => {
|
|||
})
|
||||
|
||||
defineExpose({
|
||||
updateLabel
|
||||
updateLabel,
|
||||
onSelectOption
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue