From b9f4637ab6907e43f49b787e36438b7eeddd13d3 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Thu, 15 Aug 2024 16:44:16 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E9=A2=98=E9=80=89=E9=A1=B9=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/static/ueditorPlus/ueditor.config.js | 4 +-
src/pages/ques/detail/index.vue | 42 ++++++++++++++++++++-
src/pages/testPaper/detail/template.vue | 1 +
3 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/public/static/ueditorPlus/ueditor.config.js b/public/static/ueditorPlus/ueditor.config.js
index 7c9cfd1..f555c0e 100644
--- a/public/static/ueditorPlus/ueditor.config.js
+++ b/public/static/ueditorPlus/ueditor.config.js
@@ -59,7 +59,7 @@
".gif",
".bmp"
],
-
+ fontfamily: [],
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的重新定义
toolbars: [
["fullscreen", "source", "|", "bold", "italic", "underline", "forecolor", "fontfamily", "fontsize", "|", "justifyleft", "justifycenter", "justifyright", "justifyjustify", "|", "insertimage", "inserttable", 'formula', "gapfilling", 'combox']
@@ -101,7 +101,7 @@
// 禁止本地上传
disableUpload: false,
}
- , zIndex: 2000
+ , zIndex: 2500
, fullscreen: false
, rgb2Hex: true,
diff --git a/src/pages/ques/detail/index.vue b/src/pages/ques/detail/index.vue
index 26d6490..2d4ab6d 100644
--- a/src/pages/ques/detail/index.vue
+++ b/src/pages/ques/detail/index.vue
@@ -57,7 +57,12 @@
选项{{
numToLetter(i)
}}
-
+
+ optReady(editor, item)" />
@@ -66,7 +71,6 @@
-
@@ -228,6 +232,7 @@ export default {
answerIsCorrect: '',
optionNumber: '',
optionText: '',
+ focus: 0,
},
answerAnalysis: '',
originFillBlank: {},
@@ -331,6 +336,7 @@ export default {
// this.questionBankCategory = r.questionBankCategory
}
+ opts.map(e => e.focus = 0)
this.form = {
questionId: r.questionId,
questionType: r.questionType,
@@ -477,6 +483,20 @@ export default {
delOpt (i) {
this.form.questionAnswerVersions.length > 2 && this.form.questionAnswerVersions.splice(i, 1)
},
+ // 移除选项
+ optFocus (e) {
+ const opts = this.form.questionAnswerVersions
+ opts.map(n => n.focus = 0)
+ e.focus = 1
+ },
+ // 选项富文本加载完毕回调
+ optReady (editor, opt) {
+ editor.setContent(opt.optionText)
+ editor.addListener('blur', () => {
+ opt.optionText = editor.getContent()
+ })
+ editor.focus()
+ },
editorReady (instance) {
console.log("🚀 ~ editorReady ~ instance:", instance)
@@ -721,6 +741,24 @@ export default {
margin-right: 15px;
}
+ .opt-input {
+ width: 100%;
+ min-height: 32px;
+ padding: 0 15px;
+ font-size: 13px;
+ border: 1px solid #DCDEE0;
+ border-radius: 2px;
+ cursor: text;
+ }
+
+ .default {
+ color: #8f8f8f;
+ }
+
+ .opt-editor {
+ width: calc(100% - 132px);
+ }
+
.icon {
margin-left: 10px;
font-size: 18px;
diff --git a/src/pages/testPaper/detail/template.vue b/src/pages/testPaper/detail/template.vue
index bc559d2..ba627ef 100644
--- a/src/pages/testPaper/detail/template.vue
+++ b/src/pages/testPaper/detail/template.vue
@@ -240,6 +240,7 @@ export default {
// 使用模板
async useTemplate (row) {
const data = await this.getDetail(row.templateId)
+ data.paperOutline.map(e => e.examQuestions = [])
this.$parent.form.paperOutline = data.paperOutline
this.listVisible = false
},