From ff0dd3600cf665ff4e8c372af55804dd38d0a6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Wed, 25 Dec 2024 10:06:03 +0800 Subject: [PATCH] 1 --- src/renderer/src/hooks/useClassTask.js | 9 +++++++++ src/renderer/src/store/modules/classTask.js | 1 + .../components/experimentList.vue | 18 +++++++++++++----- .../components/selectClass.vue | 19 +++++++++++++++++++ .../experimentQuestion/index.vue | 15 ++++++++++++--- .../classTask/newClassTaskAssign/index.vue | 1 + 6 files changed, 55 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/hooks/useClassTask.js b/src/renderer/src/hooks/useClassTask.js index 934caf6..3668ef6 100644 --- a/src/renderer/src/hooks/useClassTask.js +++ b/src/renderer/src/hooks/useClassTask.js @@ -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); diff --git a/src/renderer/src/store/modules/classTask.js b/src/renderer/src/store/modules/classTask.js index e93be20..17b008d 100644 --- a/src/renderer/src/store/modules/classTask.js +++ b/src/renderer/src/store/modules/classTask.js @@ -9,6 +9,7 @@ const useClassTaskStore = defineStore('classTask',{ edustage: '小学', // 教育阶段 edusubject: '', // 学科 experimentList: [], // 实验科目列表 + updateEduInfo: '小学-数学', //实际需上传的学段+学科信息(用于上传及回显实验内的学段学科) }, isOpenQuestUploadView: false, // 是否打开习题上传的页面 classListIds: [], diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue index 9755859..c19db84 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/experimentQuestion/components/experimentList.vue @@ -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 +}) +