|
@@ -344,6 +344,7 @@ const point = ref('');
|
|
|
const complete = ref(false);
|
|
const complete = ref(false);
|
|
|
const subtitleSatisfactionOptions = ['非常满意', '比较满意', '一般', '不太满意', '很不满意'];
|
|
const subtitleSatisfactionOptions = ['非常满意', '比较满意', '一般', '不太满意', '很不满意'];
|
|
|
const subtitleSatisfaction = reactive({} as Record<string, number | null>);
|
|
const subtitleSatisfaction = reactive({} as Record<string, number | null>);
|
|
|
|
|
+const subtitleHiddenQuestionTypes = ['Radio', 'Scale', 'Checkbox'];
|
|
|
const anonymousType = ref(0);
|
|
const anonymousType = ref(0);
|
|
|
const showModal_Anonymous = ref(false); // 是否实名填写弹窗显示
|
|
const showModal_Anonymous = ref(false); // 是否实名填写弹窗显示
|
|
|
const showModal_User = ref(false); // 实名用户选择弹窗显示
|
|
const showModal_User = ref(false); // 实名用户选择弹窗显示
|
|
@@ -632,7 +633,7 @@ const bySort = (list: any[]) => {
|
|
|
item.SubTitleIndex = currentSubTitleIndex;
|
|
item.SubTitleIndex = currentSubTitleIndex;
|
|
|
item.Sort = sort + 1;
|
|
item.Sort = sort + 1;
|
|
|
sort++;
|
|
sort++;
|
|
|
- if (item.QuestType == 'Scale' && currentSubTitleItem) {
|
|
|
|
|
|
|
+ if (isSubtitleHiddenQuestion(item) && currentSubTitleItem) {
|
|
|
currentSubTitleItem.HasScaleInSubtitle = true;
|
|
currentSubTitleItem.HasScaleInSubtitle = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -681,8 +682,12 @@ const isSubtitleSatisfactionActive = (subtitleIndex, childIndex) => {
|
|
|
return Number(subtitleSatisfaction[subtitleIndex]) === Number(childIndex);
|
|
return Number(subtitleSatisfaction[subtitleIndex]) === Number(childIndex);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const isSubtitleHiddenQuestion = (item) => {
|
|
|
|
|
+ return subtitleHiddenQuestionTypes.includes(item?.QuestType);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const isQuestionHidden = (item) => {
|
|
const isQuestionHidden = (item) => {
|
|
|
- return item?.QuestType == 'Scale' && item.SubTitleIndex > -1 && !isSubtitleScaleExpanded(item.SubTitleIndex);
|
|
|
|
|
|
|
+ return isSubtitleHiddenQuestion(item) && item.SubTitleIndex > -1 && !isSubtitleScaleExpanded(item.SubTitleIndex);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const getAnswerIndex = (answerList, questId) => {
|
|
const getAnswerIndex = (answerList, questId) => {
|
|
@@ -699,9 +704,16 @@ const setSingleQuestionAnswer = (question, answerList, childIndex) => {
|
|
|
if (!question?.QuestionItemList?.[childIndex]) return;
|
|
if (!question?.QuestionItemList?.[childIndex]) return;
|
|
|
const answerIndex = getAnswerIndex(answerList, question.QuestId);
|
|
const answerIndex = getAnswerIndex(answerList, question.QuestId);
|
|
|
const answer = question.QuestionItemList[childIndex].ItemId;
|
|
const answer = question.QuestionItemList[childIndex].ItemId;
|
|
|
|
|
+ if (question.QuestType == 'Checkbox' && !question.MustQuest) {
|
|
|
|
|
+ question.AnswerList = [];
|
|
|
|
|
+ if (answerIndex > -1) {
|
|
|
|
|
+ answerList[answerIndex].Answer = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
question.AnswerList = [answer];
|
|
question.AnswerList = [answer];
|
|
|
if (answerIndex > -1) {
|
|
if (answerIndex > -1) {
|
|
|
- answerList[answerIndex].Answer = answer;
|
|
|
|
|
|
|
+ answerList[answerIndex].Answer = question.QuestType == 'Checkbox' ? [answer] : answer;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -714,7 +726,7 @@ const choiceSubtitleSatisfaction = (e) => {
|
|
|
|
|
|
|
|
if (childIndex == 0) {
|
|
if (childIndex == 0) {
|
|
|
questionList.forEach((item) => {
|
|
questionList.forEach((item) => {
|
|
|
- if (item.SubTitleIndex == subtitleIndex && item.QuestType == 'Scale') {
|
|
|
|
|
|
|
+ if (item.SubTitleIndex == subtitleIndex && isSubtitleHiddenQuestion(item)) {
|
|
|
setSingleQuestionAnswer(item, answerList, 0);
|
|
setSingleQuestionAnswer(item, answerList, 0);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|