|
|
@@ -144,9 +144,6 @@
|
|
|
@questionAnswerChange="HandleQuestionAnswerChange"
|
|
|
:defaultTableData="questionTableData"
|
|
|
/>
|
|
|
-
|
|
|
-
|
|
|
- <!-- 下一题 能否点击 —— 只针对必填项 需要变量判断 ———— 待完善--- -->
|
|
|
<div class="operation">
|
|
|
<el-button :class="[isQuestionEdit ? 'button_background' : 'is-disabled']"
|
|
|
@click="isQuestionEdit ? HandleFinishCurrentQuestion() : ''">
|
|
|
@@ -487,8 +484,7 @@ const HandleFinishReview = async ()=>{
|
|
|
fullQuestionnaireAnswer.value = {}
|
|
|
}
|
|
|
// 重新查询教师状态和问卷状态
|
|
|
- await GetEvaluationProcessMsg()
|
|
|
- await GetFullQuestionnaireData()
|
|
|
+ await ReloadPageData()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -504,7 +500,15 @@ const singleQuestionAnswer = ref([])
|
|
|
|
|
|
// 当前编辑的试题
|
|
|
const currentEditQuestion = computed(()=>{
|
|
|
- return questionnaireSplitData.value?.[currentSelectedQuestionIndex.value]
|
|
|
+ let currentQuestion = questionnaireSplitData.value?.[currentSelectedQuestionIndex.value]
|
|
|
+ let extraConfig = []
|
|
|
+ if(Number(currentQuestion?.questionAnswerType) === 1){
|
|
|
+ extraConfig.push('required')
|
|
|
+ }
|
|
|
+ if(Number(currentQuestion?.questionSortRole) === 1){
|
|
|
+ extraConfig.push('isHorizontal')
|
|
|
+ }
|
|
|
+ return {...currentQuestion,extraConfig}
|
|
|
})
|
|
|
|
|
|
|
|
|
@@ -513,7 +517,7 @@ const questionTableColumns = ref<any[]>([]) //按题填写的表列数据
|
|
|
const questionTableData = ref<any[]>([]) //按题填写的表行数据
|
|
|
|
|
|
|
|
|
-// 监听按题填写时候的 表格数据渲染 studentQuestionScore 可能有问题
|
|
|
+// 监听【按题填写】时候的 表格数据渲染
|
|
|
watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
console.log('teacherList',teacherList.value)
|
|
|
console.log('questionaireMsg',questionaireMsg.value)
|
|
|
@@ -550,7 +554,11 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
// 评分单选时候,每个选项对应的分值 obj
|
|
|
"answerScoreObj": singleScoreObj
|
|
|
}
|
|
|
- let answers = stuAnswer.answerCode?.split('|') || []
|
|
|
+
|
|
|
+ let answers = []
|
|
|
+ if(stuAnswer.answerCode){
|
|
|
+ answers = stuAnswer.answerCode?.split('|') || []
|
|
|
+ }
|
|
|
// 回显已经填写完的信息
|
|
|
answers.map((ans)=>{
|
|
|
rowKeys['sort_'+ans] = true
|
|
|
@@ -589,7 +597,10 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
"answerScore": ''
|
|
|
}
|
|
|
|
|
|
- let answers = stuAnswer.answerCode?.split('|') || []
|
|
|
+ let answers = []
|
|
|
+ if(stuAnswer.answerCode){
|
|
|
+ answers = stuAnswer.answerCode?.split('|') || []
|
|
|
+ }
|
|
|
// 回显已经填写完的信息
|
|
|
answers.map((ans)=>{
|
|
|
rowKeys['sort_'+ans] = true
|
|
|
@@ -648,10 +659,6 @@ const HandleQuestionAnswerChange = (val)=>{
|
|
|
// 当前题目 有关所有教师的评价数据提交
|
|
|
const HandleFinishCurrentQuestion = async ()=>{
|
|
|
console.log('当前题目的教师评价数据--',singleQuestionAnswer.value )
|
|
|
-
|
|
|
- // 区分 单选 多选 问答 评价 评分
|
|
|
-
|
|
|
-
|
|
|
let finalAnswerData:any[] = []
|
|
|
|
|
|
switch(currentEditQuestion.value?.questionType){
|
|
|
@@ -728,17 +735,18 @@ const HandleFinishCurrentQuestion = async ()=>{
|
|
|
answerData:finalAnswerData
|
|
|
}
|
|
|
|
|
|
-
|
|
|
let res = await saveEvaluationQuestionDataSplitApi(params)
|
|
|
if(res?.code == 200){
|
|
|
ElMessage.success('问卷评价提交成功')
|
|
|
- }
|
|
|
|
|
|
- // if((currentSelectedQuestionIndex.value + 1) < questionaireMsg.value.questionData?.length){
|
|
|
- // currentSelectedQuestionIndex.value += 1
|
|
|
- // }
|
|
|
- // singleQuestionAnswer.value = []
|
|
|
- // isQuestionEdit.value = false
|
|
|
+ if((currentSelectedQuestionIndex.value + 1) < questionaireMsg.value.questionData?.length){
|
|
|
+ currentSelectedQuestionIndex.value += 1
|
|
|
+ }
|
|
|
+ singleQuestionAnswer.value = []
|
|
|
+ isQuestionEdit.value = false
|
|
|
+ // 重新查询 问卷内容和页面内容
|
|
|
+ await ReloadPageData()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//
|
|
|
@@ -757,9 +765,14 @@ const GetEvaluationProcessMsg = async ()=>{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-onMounted( async ()=>{
|
|
|
+// 重新加载页面数据
|
|
|
+const ReloadPageData = async ()=>{
|
|
|
await GetEvaluationProcessMsg()
|
|
|
await GetFullQuestionnaireData()
|
|
|
+}
|
|
|
+
|
|
|
+onMounted( async ()=>{
|
|
|
+ await ReloadPageData()
|
|
|
})
|
|
|
|
|
|
</script>
|