|
@@ -47,9 +47,11 @@
|
|
|
|
|
|
|
|
<ul class="teacher_list">
|
|
<ul class="teacher_list">
|
|
|
<li v-for="(teacher,index) in teacherList" :key="teacher.id"
|
|
<li v-for="(teacher,index) in teacherList" :key="teacher.id"
|
|
|
- :class="['teacher_card',{active:currentActiveTeacherId === teacher.teacherId,},
|
|
|
|
|
- {disabled:IsSubjectQuestionnaireUnFinish(teacher.evaluationStatus)}]"
|
|
|
|
|
- @click="IsSubjectQuestionnaireUnFinish(teacher.evaluationStatus) ? '' : HandleSubjectTeacherChange(index,teacher)">
|
|
|
|
|
|
|
+ :class="['teacher_card',{active:currentActiveTeacherId === teacher.id,},
|
|
|
|
|
+ {disabled:defaultQuestionnaireMode == 'split' || !isTeacherEdit(teacher,index)}]"
|
|
|
|
|
+ @click="(defaultQuestionnaireMode == 'split' || !isTeacherEdit(teacher,index)) ? '' : HandleSubjectTeacherChange(index,teacher)">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
<div class="teacher_tag" :style="{backgroundColor:subjectToColor(teacher.evaluationSubjectName)?.color}">
|
|
<div class="teacher_tag" :style="{backgroundColor:subjectToColor(teacher.evaluationSubjectName)?.color}">
|
|
|
{{ teacher.evaluationSubjectName }}
|
|
{{ teacher.evaluationSubjectName }}
|
|
|
</div>
|
|
</div>
|
|
@@ -91,7 +93,7 @@
|
|
|
<!-- 单选 0 评分单选 3-->
|
|
<!-- 单选 0 评分单选 3-->
|
|
|
<SingleSelectQuestionBatchFill
|
|
<SingleSelectQuestionBatchFill
|
|
|
v-if="currentEditQuestion?.questionType === 0 || currentEditQuestion?.questionType === 3"
|
|
v-if="currentEditQuestion?.questionType === 0 || currentEditQuestion?.questionType === 3"
|
|
|
- v-model:isFinishEdit="isQuestionEdit"
|
|
|
|
|
|
|
+ v-model:isFinishEdit="isFinishEdit"
|
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
|
:titleMsg="currentEditQuestion"
|
|
:titleMsg="currentEditQuestion"
|
|
|
@questionAnswerChange="HandleQuestionAnswerChange"
|
|
@questionAnswerChange="HandleQuestionAnswerChange"
|
|
@@ -102,7 +104,7 @@
|
|
|
<!-- 多选 1 -->
|
|
<!-- 多选 1 -->
|
|
|
<BatchSelectQuestionBatchFill
|
|
<BatchSelectQuestionBatchFill
|
|
|
v-if="currentEditQuestion?.questionType === 1"
|
|
v-if="currentEditQuestion?.questionType === 1"
|
|
|
- v-model:isFinishEdit="isQuestionEdit"
|
|
|
|
|
|
|
+ v-model:isFinishEdit="isFinishEdit"
|
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
|
:titleMsg="currentEditQuestion"
|
|
:titleMsg="currentEditQuestion"
|
|
|
@questionAnswerChange="HandleQuestionAnswerChange"
|
|
@questionAnswerChange="HandleQuestionAnswerChange"
|
|
@@ -116,7 +118,7 @@
|
|
|
<!-- 数字评分 -->
|
|
<!-- 数字评分 -->
|
|
|
<ScoreQuestionBatchFill
|
|
<ScoreQuestionBatchFill
|
|
|
v-if="currentEditQuestion?.questionAnswerClass === 0"
|
|
v-if="currentEditQuestion?.questionAnswerClass === 0"
|
|
|
- v-model:isFinishEdit="isQuestionEdit"
|
|
|
|
|
|
|
+ v-model:isFinishEdit="isFinishEdit"
|
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
|
:titleMsg="currentEditQuestion"
|
|
:titleMsg="currentEditQuestion"
|
|
|
@questionAnswerChange="HandleQuestionAnswerChange"
|
|
@questionAnswerChange="HandleQuestionAnswerChange"
|
|
@@ -127,7 +129,7 @@
|
|
|
<!-- 星星评分 -->
|
|
<!-- 星星评分 -->
|
|
|
<StarRationQuestionBatchFill
|
|
<StarRationQuestionBatchFill
|
|
|
v-if="currentEditQuestion?.questionAnswerClass === 1"
|
|
v-if="currentEditQuestion?.questionAnswerClass === 1"
|
|
|
- v-model:isFinishEdit="isQuestionEdit"
|
|
|
|
|
|
|
+ v-model:isFinishEdit="isFinishEdit"
|
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
|
:titleMsg="currentEditQuestion"
|
|
:titleMsg="currentEditQuestion"
|
|
|
:allowEdit="!isCurrentQuestionnaireTaskFinish"
|
|
:allowEdit="!isCurrentQuestionnaireTaskFinish"
|
|
@@ -139,7 +141,7 @@
|
|
|
<!-- 问答题 2-->
|
|
<!-- 问答题 2-->
|
|
|
<QuestionAndAnswerBatchFill
|
|
<QuestionAndAnswerBatchFill
|
|
|
v-if="currentEditQuestion?.questionType === 2"
|
|
v-if="currentEditQuestion?.questionType === 2"
|
|
|
- v-model:isFinishEdit="isQuestionEdit"
|
|
|
|
|
|
|
+ v-model:isFinishEdit="isFinishEdit"
|
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
:titleIndex="currentSelectedQuestionIndex"
|
|
|
:titleMsg="currentEditQuestion"
|
|
:titleMsg="currentEditQuestion"
|
|
|
:allowEdit="!isCurrentQuestionnaireTaskFinish"
|
|
:allowEdit="!isCurrentQuestionnaireTaskFinish"
|
|
@@ -147,8 +149,8 @@
|
|
|
:defaultTableData="questionTableData"
|
|
:defaultTableData="questionTableData"
|
|
|
/>
|
|
/>
|
|
|
<div class="operation">
|
|
<div class="operation">
|
|
|
- <el-button :class="[isQuestionEdit ? 'button_background' : 'is-disabled']"
|
|
|
|
|
- @click="isQuestionEdit ? HandleFinishCurrentQuestion() : ''">
|
|
|
|
|
|
|
+ <el-button :class="[!isCurrentQuestionnaireTaskFinish && isFinishEdit ? 'button_background' : 'is-disabled']"
|
|
|
|
|
+ @click="!isCurrentQuestionnaireTaskFinish && isFinishEdit ? HandleFinishCurrentQuestion() : ''">
|
|
|
{{(currentSelectedQuestionIndex + 1) < questionnaireSplitData?.length ? '下一题' : '提交'}}
|
|
{{(currentSelectedQuestionIndex + 1) < questionnaireSplitData?.length ? '下一题' : '提交'}}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -168,11 +170,11 @@
|
|
|
<li v-for="(question,index) in questionaireMsg.questionData" :key="question.id">
|
|
<li v-for="(question,index) in questionaireMsg.questionData" :key="question.id">
|
|
|
<span @click="defaultQuestionnaireMode=='full' ?
|
|
<span @click="defaultQuestionnaireMode=='full' ?
|
|
|
ScrollToItem(question.id) :
|
|
ScrollToItem(question.id) :
|
|
|
- (IsSplitQuestionnaireUnFinish(question.studentAnswerStatus) ? '' : HandleChangeQuestion(index,question)) "
|
|
|
|
|
|
|
+ (!isQuestionTitleEdit(question,index) ? '' : HandleChangeQuestion(index,question)) "
|
|
|
:title="question.questionTitleName"
|
|
:title="question.questionTitleName"
|
|
|
class="one_line_ellipsis"
|
|
class="one_line_ellipsis"
|
|
|
:class="[{active:defaultQuestionnaireMode=='split' && currentSelectedQuestionIndex == index,
|
|
:class="[{active:defaultQuestionnaireMode=='split' && currentSelectedQuestionIndex == index,
|
|
|
- disabled:defaultQuestionnaireMode=='split' && IsSplitQuestionnaireUnFinish(question.studentAnswerStatus)}]">
|
|
|
|
|
|
|
+ disabled:defaultQuestionnaireMode=='split' && !isQuestionTitleEdit(question,index)}]">
|
|
|
{{ index + 1 }}.{{ question.questionTitleName }}
|
|
{{ index + 1 }}.{{ question.questionTitleName }}
|
|
|
</span>
|
|
</span>
|
|
|
<img v-if="IsSplitQuestionnaireFinish(question.studentAnswerStatus)" :src="finishIcon" alt="">
|
|
<img v-if="IsSplitQuestionnaireFinish(question.studentAnswerStatus)" :src="finishIcon" alt="">
|
|
@@ -200,7 +202,7 @@ import QuestionAndAnswerBatchFill from '@/components/questionAndAnswerBatchFill/
|
|
|
import BatchSelectQuestionBatchFill from '@/components/batchSelectQuestionBatchFill/BatchSelectQuestionBatchFill.vue';
|
|
import BatchSelectQuestionBatchFill from '@/components/batchSelectQuestionBatchFill/BatchSelectQuestionBatchFill.vue';
|
|
|
|
|
|
|
|
import { subjectToColor,fillOutStatusToColor,
|
|
import { subjectToColor,fillOutStatusToColor,
|
|
|
- IsSubjectQuestionnaireUnFinish,IsSplitQuestionnaireFinish,IsSplitQuestionnaireUnFinish
|
|
|
|
|
|
|
+ IsSplitQuestionnaireFinish
|
|
|
} from '@/components/commonDictConvert';
|
|
} from '@/components/commonDictConvert';
|
|
|
import { useTimeCountDown } from '@/utils/dateTransform';
|
|
import { useTimeCountDown } from '@/utils/dateTransform';
|
|
|
import {getExcelColumn} from '@/utils/numberConvertExcelColumn'
|
|
import {getExcelColumn} from '@/utils/numberConvertExcelColumn'
|
|
@@ -221,8 +223,6 @@ interface TeacherItm {
|
|
|
subjectType: number // 科目类型 0-班主任 1 科目(单科)
|
|
subjectType: number // 科目类型 0-班主任 1 科目(单科)
|
|
|
teacherName: string //教师名称
|
|
teacherName: string //教师名称
|
|
|
evaluationSubjectName:string //科目名称
|
|
evaluationSubjectName:string //科目名称
|
|
|
- teacherId:string | string //教师id
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -248,13 +248,72 @@ const {
|
|
|
// 待评价教师列表
|
|
// 待评价教师列表
|
|
|
const teacherList = ref<TeacherItm[]>([])
|
|
const teacherList = ref<TeacherItm[]>([])
|
|
|
|
|
|
|
|
|
|
+// evaluationStatus 0-待评价 1-进行中 2-已评价
|
|
|
|
|
+// 问卷教师是否可以切换
|
|
|
|
|
+const isTeacherEdit = computed(() => {
|
|
|
|
|
+ // 除了已评价(2)状态可编辑外,
|
|
|
|
|
+ // 如果有进行中状态,第一个进行中(1)状态可编辑
|
|
|
|
|
+ // 没有进行中状态,第一个待评价(0)状态可编辑;
|
|
|
|
|
+ const list = teacherList.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 获取第一个 进行中
|
|
|
|
|
+ const firstActiveIndex = list.findIndex(item => item.evaluationStatus === 1);
|
|
|
|
|
+ const hasActive = firstActiveIndex !== -1;
|
|
|
|
|
+
|
|
|
|
|
+ // 如果没有进行中的,才去寻找第一个待评价的
|
|
|
|
|
+ const firstPendingIndex = hasActive
|
|
|
|
|
+ ? -1
|
|
|
|
|
+ : list.findIndex(item => item.evaluationStatus === 0);
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 返回一个函数,供 v-for 循环调用
|
|
|
|
|
+ return (teacher, index) => {
|
|
|
|
|
+ // 已评价(2) 始终可编辑
|
|
|
|
|
+ if (teacher.evaluationStatus === 2) return true;
|
|
|
|
|
+
|
|
|
|
|
+ // 进行中(1):判断当前索引是否等于缓存的第一个进行中索引
|
|
|
|
|
+ if (teacher.evaluationStatus === 1) {
|
|
|
|
|
+ return index === firstActiveIndex;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 待评价(0):判断当前索引是否等于缓存的第一个待评价索引
|
|
|
|
|
+ if (teacher.evaluationStatus === 0) {
|
|
|
|
|
+ return index === firstPendingIndex;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 兜底:其他未知状态不可编辑
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+// 问卷标题是否可以切换
|
|
|
|
|
+const isQuestionTitleEdit = computed(()=>{
|
|
|
|
|
+ const list = questionaireMsg.value?.questionData || []
|
|
|
|
|
+ // 获取第一个 未答完的题
|
|
|
|
|
+ const firstUnfinishIndex = list.findIndex(item => item.studentAnswerStatus === 0);
|
|
|
|
|
|
|
|
|
|
+ return (question, index) => {
|
|
|
|
|
+ // 已答题(1) 始终可编辑
|
|
|
|
|
+ if (question.studentAnswerStatus === 1) return true;
|
|
|
|
|
+
|
|
|
|
|
+ // 未答题(0):判断当前索引是否等于缓存的第一个未答题索引
|
|
|
|
|
+ if (question.studentAnswerStatus === 0) {
|
|
|
|
|
+ return index === firstUnfinishIndex;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 兜底:其他未知状态不可编辑
|
|
|
|
|
+ return false;
|
|
|
|
|
+ };
|
|
|
|
|
+})
|
|
|
/**
|
|
/**
|
|
|
* 2. 问卷整体数据
|
|
* 2. 问卷整体数据
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
// 当前问卷任务是否全部完成 ———— 以及问卷是否结束
|
|
// 当前问卷任务是否全部完成 ———— 以及问卷是否结束
|
|
|
-const isCurrentQuestionnaireTaskFinish = ref(false) //true false
|
|
|
|
|
|
|
+const isCurrentQuestionnaireTaskFinish = computed(()=>{
|
|
|
|
|
+ // 判断教师列表是否全部完成
|
|
|
|
|
+ return !(teacherList.value.find(teacher=>{
|
|
|
|
|
+ return (teacher.evaluationStatus === 0 || teacher.evaluationStatus === 1)
|
|
|
|
|
+ }))
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
// 问卷填写截止时间
|
|
// 问卷填写截止时间
|
|
|
const deadlineTime = ref('')
|
|
const deadlineTime = ref('')
|
|
@@ -302,7 +361,7 @@ const currentSelectedQuestionnaireData = computed(()=>{
|
|
|
// 整卷填写
|
|
// 整卷填写
|
|
|
if(defaultQuestionnaireMode.value == 'full'){
|
|
if(defaultQuestionnaireMode.value == 'full'){
|
|
|
return teacherQuestionnaireData.value.find((item:any)=>{
|
|
return teacherQuestionnaireData.value.find((item:any)=>{
|
|
|
- return item.teacherId == currentActiveTeacherId.value
|
|
|
|
|
|
|
+ return item.evaluationCodeRelationId == currentActiveTeacherId.value
|
|
|
})
|
|
})
|
|
|
// 按题填写
|
|
// 按题填写
|
|
|
}else if(defaultQuestionnaireMode.value == 'split'){
|
|
}else if(defaultQuestionnaireMode.value == 'split'){
|
|
@@ -432,7 +491,7 @@ const GetFullQuestionnaireData = async ()=>{
|
|
|
if(currentActiveTeacherId.value){
|
|
if(currentActiveTeacherId.value){
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- currentActiveTeacherId.value = teacherList.value?.[0]?.teacherId || ''
|
|
|
|
|
|
|
+ currentActiveTeacherId.value = teacherList.value?.[0]?.id || ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取按题填写问卷数据
|
|
// 获取按题填写问卷数据
|
|
@@ -453,14 +512,14 @@ const GetSplitQuestionnaireData = async ()=>{
|
|
|
// 问卷试题 dom
|
|
// 问卷试题 dom
|
|
|
const questionListRef = ref()
|
|
const questionListRef = ref()
|
|
|
// 当前选中的待评价科目教师
|
|
// 当前选中的待评价科目教师
|
|
|
-const currentActiveTeacherId = ref('')
|
|
|
|
|
|
|
+const currentActiveTeacherId = ref<number|string>('')
|
|
|
|
|
|
|
|
// 整卷填写 教师问卷的答案
|
|
// 整卷填写 教师问卷的答案
|
|
|
const fullQuestionnaireAnswer = ref({})
|
|
const fullQuestionnaireAnswer = ref({})
|
|
|
|
|
|
|
|
// 切换 评价的科目教师
|
|
// 切换 评价的科目教师
|
|
|
const HandleSubjectTeacherChange = (index,teacher)=>{
|
|
const HandleSubjectTeacherChange = (index,teacher)=>{
|
|
|
- currentActiveTeacherId.value = teacher.teacherId
|
|
|
|
|
|
|
+ currentActiveTeacherId.value = teacher.id
|
|
|
|
|
|
|
|
currentSelectedQuestionIndex.value = 0
|
|
currentSelectedQuestionIndex.value = 0
|
|
|
}
|
|
}
|
|
@@ -499,10 +558,14 @@ const HandleFinishReview = async ()=>{
|
|
|
// 重查和索引切换顺序不能颠倒
|
|
// 重查和索引切换顺序不能颠倒
|
|
|
// 找到当前选中的教师
|
|
// 找到当前选中的教师
|
|
|
let currentIndex = teacherList.value.findIndex(item=>{
|
|
let currentIndex = teacherList.value.findIndex(item=>{
|
|
|
- return item.teacherId == currentActiveTeacherId.value
|
|
|
|
|
|
|
+ return item.id == currentActiveTeacherId.value
|
|
|
})
|
|
})
|
|
|
|
|
+ // 如果不是最后一卷,跳转到下一卷
|
|
|
|
|
+ if((currentIndex + 1) >= teacherList.value.length ){
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
// 跳转到下一个教师的问卷
|
|
// 跳转到下一个教师的问卷
|
|
|
- currentActiveTeacherId.value = teacherList.value?.[currentIndex + 1]?.teacherId || ''
|
|
|
|
|
|
|
+ currentActiveTeacherId.value = teacherList.value?.[currentIndex + 1]?.id || ''
|
|
|
}else{
|
|
}else{
|
|
|
// 重新查询教师状态和问卷状态
|
|
// 重新查询教师状态和问卷状态
|
|
|
await ReloadPageData()
|
|
await ReloadPageData()
|
|
@@ -514,7 +577,7 @@ const HandleFinishReview = async ()=>{
|
|
|
/**
|
|
/**
|
|
|
* 4. 按题填写相关变量 和操作
|
|
* 4. 按题填写相关变量 和操作
|
|
|
*/
|
|
*/
|
|
|
-const isQuestionEdit = ref(false) // 当前试题是否已经编辑完成
|
|
|
|
|
|
|
+const isFinishEdit = ref(false) // 当前试题是否已经编辑完成
|
|
|
const currentSelectedQuestionIndex = ref(0) // 当前选中的题目索引
|
|
const currentSelectedQuestionIndex = ref(0) // 当前选中的题目索引
|
|
|
|
|
|
|
|
// 当前问卷题目的 教师评价答案列表
|
|
// 当前问卷题目的 教师评价答案列表
|
|
@@ -670,7 +733,7 @@ watch(()=>currentEditQuestion.value?.questionType,(newVal)=>{
|
|
|
// 切换当前选中的试题索引
|
|
// 切换当前选中的试题索引
|
|
|
const HandleChangeQuestion = (index,question)=>{
|
|
const HandleChangeQuestion = (index,question)=>{
|
|
|
console.log('当前索引--',index)
|
|
console.log('当前索引--',index)
|
|
|
- isQuestionEdit.value = false
|
|
|
|
|
|
|
+ isFinishEdit.value = false
|
|
|
currentSelectedQuestionIndex.value = index
|
|
currentSelectedQuestionIndex.value = index
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -760,14 +823,18 @@ const HandleFinishCurrentQuestion = async ()=>{
|
|
|
let res = await saveEvaluationQuestionDataSplitApi(params)
|
|
let res = await saveEvaluationQuestionDataSplitApi(params)
|
|
|
if(res?.code == 200){
|
|
if(res?.code == 200){
|
|
|
ElMessage.success('问卷评价提交成功')
|
|
ElMessage.success('问卷评价提交成功')
|
|
|
- singleQuestionAnswer.value = []
|
|
|
|
|
- isQuestionEdit.value = false
|
|
|
|
|
- questionTableData.value = []
|
|
|
|
|
- questionTableColumns.value = []
|
|
|
|
|
- // 重新查询 问卷内容和页面内容
|
|
|
|
|
- await ReloadPageData()
|
|
|
|
|
|
|
+ // 不是最后一卷 ,要跳转到下一卷
|
|
|
if((currentSelectedQuestionIndex.value + 1) < questionaireMsg.value.questionData?.length){
|
|
if((currentSelectedQuestionIndex.value + 1) < questionaireMsg.value.questionData?.length){
|
|
|
|
|
+ singleQuestionAnswer.value = []
|
|
|
|
|
+ isFinishEdit.value = false
|
|
|
|
|
+ questionTableData.value = []
|
|
|
|
|
+ questionTableColumns.value = []
|
|
|
|
|
+ // 重新查询 问卷内容和页面内容
|
|
|
|
|
+ await ReloadPageData()
|
|
|
currentSelectedQuestionIndex.value += 1
|
|
currentSelectedQuestionIndex.value += 1
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // 重新查询 问卷内容和页面内容
|
|
|
|
|
+ await ReloadPageData()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|