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