|
@@ -63,6 +63,7 @@
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
icon="icon icon-save-white"
|
|
icon="icon icon-save-white"
|
|
|
|
+ :loading="loading"
|
|
@click="confirm"
|
|
@click="confirm"
|
|
>识别无误,加入题库</el-button
|
|
>识别无误,加入题库</el-button
|
|
>
|
|
>
|
|
@@ -174,7 +175,7 @@ export default {
|
|
// this.paperRichJson = deepCopy(paperRichTextJson);
|
|
// this.paperRichJson = deepCopy(paperRichTextJson);
|
|
this.paperRichJson = deepCopy(this.data.richText);
|
|
this.paperRichJson = deepCopy(this.data.richText);
|
|
this.paperData = deepCopy(this.data.detailInfo);
|
|
this.paperData = deepCopy(this.data.detailInfo);
|
|
- this.transformRichImg();
|
|
|
|
|
|
+ this.transformDataInfo();
|
|
this.questionKey = randomCode();
|
|
this.questionKey = randomCode();
|
|
},
|
|
},
|
|
async getCourseProperty() {
|
|
async getCourseProperty() {
|
|
@@ -185,9 +186,34 @@ export default {
|
|
JSON.stringify({ optionList, courseId: this.data.importData.courseId })
|
|
JSON.stringify({ optionList, courseId: this.data.importData.courseId })
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- transformRichImg() {
|
|
|
|
- const rate = 96 / 200;
|
|
|
|
- this.paperRichJson.sections.forEach((section) => {
|
|
|
|
|
|
+ transformDataInfo() {
|
|
|
|
+ this.transformRichImg(this.paperRichJson);
|
|
|
|
+ this.paperData.forEach((detail) => {
|
|
|
|
+ detail.questions.forEach((question) => {
|
|
|
|
+ this.transformQuestion(question);
|
|
|
|
+ if (question.subQuestions && question.subQuestions.length) {
|
|
|
|
+ question.subQuestions.forEach((subq) => {
|
|
|
|
+ this.transformQuestion(subq);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ transformQuestion(question) {
|
|
|
|
+ this.transformRichImg(question.body);
|
|
|
|
+ this.transformRichImg(question.answerRichTexts);
|
|
|
|
+ if (question.options && question.options.length) {
|
|
|
|
+ question.options.forEach((item) => {
|
|
|
|
+ this.transformRichImg(item.body);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ // this.transformRichImg(question.quesAnswer);
|
|
|
|
+ },
|
|
|
|
+ transformRichImg(richText) {
|
|
|
|
+ if (isAnEmptyRichText(richText)) return;
|
|
|
|
+
|
|
|
|
+ const rate = 96 / 300;
|
|
|
|
+ richText.sections.forEach((section) => {
|
|
section.blocks.forEach((block) => {
|
|
section.blocks.forEach((block) => {
|
|
if (block.type !== "image" || !block.param) return;
|
|
if (block.type !== "image" || !block.param) return;
|
|
block.param.width = block.param.width * rate;
|
|
block.param.width = block.param.width * rate;
|