This commit is contained in:
parent
63b8a0d5c6
commit
ff0dd3600c
|
@ -1,5 +1,7 @@
|
|||
import { listEntpcoursework,getEvaluationclue } from '@/api/classTask';
|
||||
import { processList } from '@/hooks/useProcessList';
|
||||
import useClassTaskStore from '@/store/modules/classTask'
|
||||
const useClassTaskStores = useClassTaskStore();
|
||||
|
||||
const isJson = (str) => {
|
||||
if (typeof str == 'string') {
|
||||
|
@ -114,6 +116,13 @@ export const editListItem = (row, courseObj) => {
|
|||
}
|
||||
else if (row.worktype == '科学实验') {
|
||||
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);
|
||||
//
|
||||
// console.log('科学实验', classtaskObj);
|
||||
|
|
|
@ -9,6 +9,7 @@ const useClassTaskStore = defineStore('classTask',{
|
|||
edustage: '小学', // 教育阶段
|
||||
edusubject: '', // 学科
|
||||
experimentList: [], // 实验科目列表
|
||||
updateEduInfo: '小学-数学', //实际需上传的学段+学科信息(用于上传及回显实验内的学段学科)
|
||||
},
|
||||
isOpenQuestUploadView: false, // 是否打开习题上传的页面
|
||||
classListIds: [],
|
||||
|
|
|
@ -36,16 +36,24 @@ const props = defineProps({
|
|||
})
|
||||
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(() => {
|
||||
})
|
||||
|
||||
const onSelectOption = (option) => {
|
||||
console.log(option,'选择的实验课-------')
|
||||
emit('selectItem', classTaskStore.experimentList.filter(item => item.label === option)[0])
|
||||
}
|
||||
defineExpose({
|
||||
updateLabel
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
|
|
|
@ -177,10 +177,29 @@ const handleUserEduSubject = (item) => {
|
|||
// 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(() => {
|
||||
getSubject()
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
updateCheckList
|
||||
})
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.custom-button {
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
<div class="activeExp-header">
|
||||
<div class="infomation" v-if="isStadium() !== true" >
|
||||
<!-- <selectClass v-if="!isSubject" @experlist="getExperimentList" /> -->
|
||||
<selectClass v-if="!isSubject" />
|
||||
<selectClass ref="selectClassRef"/>
|
||||
</div>
|
||||
<div>
|
||||
<selectExperiment @selectItem="getExperimentListItem" />
|
||||
<selectExperiment ref="selectExperimentRef" @selectItem="getExperimentListItem" />
|
||||
</div>
|
||||
</div>
|
||||
<div ref="mainDiv" class="activeExp-main" style="overflow: auto">
|
||||
|
@ -19,7 +19,7 @@
|
|||
<script setup>
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
//import html2canvas from 'html2canvas';
|
||||
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
|
||||
import { onMounted, ref, watch, reactive, getCurrentInstance, nextTick } from 'vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useClassTaskStore from '@/store/modules/classTask'
|
||||
import selectClass from './components/selectClass.vue' //选择学校和班级
|
||||
|
@ -44,6 +44,8 @@ const props = defineProps({
|
|||
// 学科的 实验列
|
||||
// const experimentList = ref([]);
|
||||
const activeExp = ref({});
|
||||
const selectExperimentRef = ref();
|
||||
const selectClassRef = ref();
|
||||
|
||||
const isStadium = () => {
|
||||
let roles = userStore.roles
|
||||
|
@ -82,6 +84,13 @@ const getExperimentListItem = (val) => {
|
|||
watch(() => props.expObj.fileurl, (newVal, oldVal) => {
|
||||
console.log(props.expObj,'科学实验科目')
|
||||
activeExp.value = props.expObj;
|
||||
|
||||
//
|
||||
nextTick(() => {
|
||||
selectClassRef.value.updateCheckList();
|
||||
selectExperimentRef.value.updateLabel(props.expObj.label);
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
|
@ -807,6 +807,7 @@ const editWork = async (cform) =>{
|
|||
else if (classWorkForm.worktype=='科学实验') { //TODO 注意,fileHomeworkList字段与常规作业共用
|
||||
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
|
||||
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
|
||||
cform.worktag = useClassTaskStores.experimentObj.updateEduInfo;
|
||||
}
|
||||
|
||||
// 3.更新作业任务本身
|
||||
|
|
Loading…
Reference in New Issue