|
@@ -23,6 +23,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref, computed, onMounted } from 'vue';
|
|
import { ref, computed, onMounted } from 'vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
+import { useStore } from 'vuex'
|
|
|
|
|
|
|
|
import AppQuestionnaireQuestionList from '@/components/AppQuestionnaireQuestionList.vue';
|
|
import AppQuestionnaireQuestionList from '@/components/AppQuestionnaireQuestionList.vue';
|
|
|
|
|
|
|
@@ -31,6 +32,8 @@ import {getEvaluationProcessMsgApi} from '@/api/selfQuestionnaireProcess'
|
|
|
import { getEvaluationQuestionDataApi, saveEvaluationQuestionDataApi } from '@/api/questionnaireCommit'
|
|
import { getEvaluationQuestionDataApi, saveEvaluationQuestionDataApi } from '@/api/questionnaireCommit'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+const store = useStore()
|
|
|
|
|
+
|
|
|
interface TeacherItm {
|
|
interface TeacherItm {
|
|
|
id: string|number
|
|
id: string|number
|
|
|
evaluationClassName: string //班级
|
|
evaluationClassName: string //班级
|
|
@@ -101,6 +104,7 @@ const HandleFinishReview = async ()=>{
|
|
|
}
|
|
}
|
|
|
// 跳转到下一个教师的问卷
|
|
// 跳转到下一个教师的问卷
|
|
|
currentActiveTeacherId.value = teacherList.value?.[currentIndex + 1]?.id || ''
|
|
currentActiveTeacherId.value = teacherList.value?.[currentIndex + 1]?.id || ''
|
|
|
|
|
+ store.commit('updateSubjectQuestionnaireTitle',teacherList.value?.[currentIndex + 1]?.evaluationSubjectName + '-' + teacherList.value?.[currentIndex + 1]?.teacherName + '问卷')
|
|
|
}else{
|
|
}else{
|
|
|
// 重新查询教师状态和问卷状态
|
|
// 重新查询教师状态和问卷状态
|
|
|
await ReloadPageData()
|
|
await ReloadPageData()
|
|
@@ -206,7 +210,25 @@ const GetFullQuestionnaireData = async ()=>{
|
|
|
if(currentActiveTeacherId.value){
|
|
if(currentActiveTeacherId.value){
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- currentActiveTeacherId.value = teacherList.value?.[0]?.id || ''
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 获取第一个 进行中
|
|
|
|
|
+ const firstActiveIndex = teacherList.value.findIndex(item => item.evaluationStatus === 1);
|
|
|
|
|
+ const hasActive = firstActiveIndex !== -1;
|
|
|
|
|
+
|
|
|
|
|
+ // 获取第一个待评价
|
|
|
|
|
+ const firstPendingIndex = hasActive
|
|
|
|
|
+ ? -1
|
|
|
|
|
+ : teacherList.value.findIndex(item => item.evaluationStatus === 0);
|
|
|
|
|
+ const hasPending = firstPendingIndex != -1
|
|
|
|
|
+
|
|
|
|
|
+ let finalIndex = hasActive ? firstActiveIndex :
|
|
|
|
|
+ (hasPending ? firstPendingIndex : 0)
|
|
|
|
|
+
|
|
|
|
|
+ // 这个要默认打开最新的 第一个进行中 或第一个待评价
|
|
|
|
|
+ currentActiveTeacherId.value = teacherList.value?.[finalIndex]?.id || ''
|
|
|
|
|
+ store.commit('updateSubjectQuestionnaireTitle',teacherList.value?.[finalIndex]?.evaluationSubjectName + '-' + teacherList.value?.[finalIndex]?.teacherName + '问卷')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 重新加载页面数据
|
|
// 重新加载页面数据
|
|
@@ -216,6 +238,13 @@ const ReloadPageData = async ()=>{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(()=>{
|
|
onMounted(()=>{
|
|
|
|
|
+ let currentEditTeacherQuestionnaire = sessionStorage.getItem('currentEditTeacherQuestionnaire')
|
|
|
|
|
+ if(currentEditTeacherQuestionnaire){
|
|
|
|
|
+ let localQuestionnaire = JSON.parse(currentEditTeacherQuestionnaire || '{}')
|
|
|
|
|
+ currentActiveTeacherId.value = localQuestionnaire?.id
|
|
|
|
|
+ store.commit('updateSubjectQuestionnaireTitle',localQuestionnaire?.subjectName + '-' + localQuestionnaire?.teacherName+ '问卷')
|
|
|
|
|
+ sessionStorage.removeItem('currentEditTeacherQuestionnaire')
|
|
|
|
|
+ }
|
|
|
ReloadPageData()
|
|
ReloadPageData()
|
|
|
})
|
|
})
|
|
|
|
|
|