|
@@ -101,6 +101,7 @@
|
|
|
v-for="(exception, index) in richJsonItem.exceptions"
|
|
|
:key="index"
|
|
|
@click="highLightErrorText(exception)"
|
|
|
+ :class="{ hide: inHasIgnore(exception.indexs) }"
|
|
|
>
|
|
|
{{ exception.message }}
|
|
|
</p>
|
|
@@ -210,8 +211,35 @@ export default {
|
|
|
mixins: [scrollMixins, timeMixin],
|
|
|
computed: {
|
|
|
hasErrorTips() {
|
|
|
- return (this.paperRichJsonGroup || []).some((item) => {
|
|
|
- return item?.exceptions?.length;
|
|
|
+ // return (this.paperRichJsonGroup || []).some((item) => {
|
|
|
+ // return item?.exceptions?.length;
|
|
|
+ // });
|
|
|
+ let detailInfo = this.paperData;
|
|
|
+ if (!Array.isArray(detailInfo)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return detailInfo.some((detail) => {
|
|
|
+ return detail?.questions?.some((item) => {
|
|
|
+ let questionExceptions = item.questionExceptions;
|
|
|
+ let arr = item.ignoreOptionRepeat
|
|
|
+ ? questionExceptions.filter(
|
|
|
+ (v) => !v.cause.includes("选项内容相同")
|
|
|
+ )
|
|
|
+ : questionExceptions;
|
|
|
+ if (!item.subQuestions?.length) {
|
|
|
+ return !!arr.length;
|
|
|
+ } else {
|
|
|
+ return item.subQuestions.some((sub) => {
|
|
|
+ let { questionExceptions = [] } = sub;
|
|
|
+ let ar = sub.ignoreOptionRepeat
|
|
|
+ ? questionExceptions.filter(
|
|
|
+ (v) => !v.cause.includes("选项内容相同")
|
|
|
+ )
|
|
|
+ : questionExceptions;
|
|
|
+ return !!ar.length;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
},
|
|
@@ -236,6 +264,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ ignoreRepeatExceptionIndexArr: [],
|
|
|
modalIsShow: false,
|
|
|
loading: false,
|
|
|
questionKey: "",
|
|
@@ -259,8 +288,42 @@ export default {
|
|
|
showIframeDialog: false,
|
|
|
};
|
|
|
},
|
|
|
-
|
|
|
+ created() {
|
|
|
+ this.$bus.on("markIgnoreRepeatQuestion", this.markIgnoreRepeat);
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ inHasIgnore(indexes) {
|
|
|
+ return this.ignoreRepeatExceptionIndexArr.includes(indexes.toString());
|
|
|
+ },
|
|
|
+ markIgnoreRepeat(exceptionIndex, bool) {
|
|
|
+ this.paperData.forEach((detail) => {
|
|
|
+ detail.questions.forEach((question) => {
|
|
|
+ if (
|
|
|
+ question.questionExceptions?.length &&
|
|
|
+ question.questionExceptions.find(
|
|
|
+ (v) => v.exceptionIndex.toString() == exceptionIndex
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ question.ignoreOptionRepeat = bool;
|
|
|
+ }
|
|
|
+ if (question.subQuestions?.length) {
|
|
|
+ question.subQuestions.forEach((sub) => {
|
|
|
+ if (
|
|
|
+ sub.questionExceptions?.length &&
|
|
|
+ sub.questionExceptions.find(
|
|
|
+ (v) => v.exceptionIndex.toString() == exceptionIndex
|
|
|
+ )
|
|
|
+ ) {
|
|
|
+ sub.ignoreOptionRepeat = bool;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.paperData = JSON.parse(JSON.stringify(this.paperData));
|
|
|
+ this.paperRichJsonGroup = this.getRichTextGroup();
|
|
|
+ this.ignoreRepeatExceptionIndexArr.push(exceptionIndex);
|
|
|
+ },
|
|
|
urlToBlob(url, callback) {
|
|
|
let xhr = new XMLHttpRequest();
|
|
|
xhr.open("GET", url, true);
|
|
@@ -282,6 +345,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
async visibleChange() {
|
|
|
+ this.ignoreRepeatExceptionIndexArr = [];
|
|
|
await this.getCourseProperty();
|
|
|
|
|
|
// this.resetData({
|
|
@@ -965,7 +1029,7 @@ export default {
|
|
|
|
|
|
if (this.loading) return;
|
|
|
this.loading = true;
|
|
|
-
|
|
|
+ console.log("detailInfo", detailInfo);
|
|
|
const res = await questionImportPaperSave({
|
|
|
...this.data.importData,
|
|
|
detailInfo,
|
|
@@ -1036,7 +1100,6 @@ export default {
|
|
|
},
|
|
|
// rich test editor
|
|
|
richTextFocus(richTextGroup) {
|
|
|
- console.log("ggg", richTextGroup);
|
|
|
this.$refs.QuestionImportPaperEdit.scrollToContentByIndex(
|
|
|
richTextGroup.indexs
|
|
|
);
|