From babfe30a925dd38161d9d592785ecf2a75503d60 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Thu, 29 Aug 2024 11:33:05 +0800
Subject: [PATCH] fix
---
public/static/ueditorPlus/themes/iframe.css | 64 ---------
src/pages/ques/detail/index.vue | 32 +++--
src/pages/ques/list/index.vue | 8 +-
src/pages/testPaper/detail/auto.vue | 19 +--
src/pages/testPaper/detail/index.vue | 142 ++++++++++++--------
src/pages/testPaper/detail/repeatQues.vue | 66 +++++----
src/pages/testPaper/list/index.vue | 4 +-
src/pages/testPaper/preview/index.vue | 53 +++++++-
8 files changed, 207 insertions(+), 181 deletions(-)
diff --git a/public/static/ueditorPlus/themes/iframe.css b/public/static/ueditorPlus/themes/iframe.css
index 7c037d9..75019b7 100644
--- a/public/static/ueditorPlus/themes/iframe.css
+++ b/public/static/ueditorPlus/themes/iframe.css
@@ -1,67 +1,3 @@
-body {
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
- font-size: 14px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-a {
- color: #09f;
- text-decoration: none;
-}
-
-a:hover,
-a:focus {
- color: #09f;
- text-decoration: none;
-}
-
-blockquote {
- padding: 0 0 0 15px;
- margin: 0 0 18px;
- border-left: 5px solid #EEE;
-}
-
-img + br {
- display: block;
- padding: 4px 0;
- content: ' ';
-}
-
-body p {
- margin-bottom: 1em;
-}
-
-iframe {
- border: none;
-}
-
-img {
- max-width: 100%;
-}
-
-img[data-word-image] {
- cursor: pointer;
-}
-
-pre {
- margin: .5em 0;
- padding: .4em .6em;
- border-radius: 8px;
- background: #f8f8f8;
- line-height: 1.5;
-}
-
-/*交互操作*/
-img {
- cursor: pointer;
-}
-
-.edui-quick-operate-active {
- background: #E6ECFF;
-}
-
.edui-for-gapfilling {
content: '点击插入填空题';
font-size: 14px;
diff --git a/src/pages/ques/detail/index.vue b/src/pages/ques/detail/index.vue
index 46aaec1..975024a 100644
--- a/src/pages/ques/detail/index.vue
+++ b/src/pages/ques/detail/index.vue
@@ -36,10 +36,11 @@
-
- 设置
+ 设置
@@ -175,7 +176,7 @@
保存
+ @click="submit(0)">保存
保存
{{ questionId ? '保存并同步更新相似题'
@@ -188,9 +189,16 @@
-
- 系统已经识别出题库中有与本题相似的其他题目。如果您选择同步更新这些相似题目,那么所有关联的试卷将会自动更新。
-
+
+
+ 系统已经识别出题库中有与本题相似的其他题目。如果您选择同步更新这些相似题目,那么所有关联的试卷将会自动更新。
+
+
+
+
+
{{ questionTypes.find(e => e.id === scope.row.questionType) ?
@@ -303,6 +311,7 @@ export default {
keep: 0,
repeatVisible: false,
+ multipleSelection: [],
repeats: [],
kpVisible: false,
@@ -440,7 +449,7 @@ export default {
// 试卷里点击编辑试题进来的
if (this.paperType > 1) {
this.questionBankName = r.questionBankName
- // this.questionBankCategory = r.questionBankCategory
+ this.questionBankCategory = r.questionBankCategory
this.$nextTick(() => {
this.getKnowledge()
})
@@ -648,6 +657,9 @@ export default {
uploadSuccess (file) {
this.form.stemAttachment = file.url
},
+ handleSelectionChange (val) {
+ this.multipleSelection = val
+ },
// 题目提交
submit (keep) {
if (this.submiting) return false
@@ -754,9 +766,9 @@ export default {
const form = this.tempForm
const type = this.detailType
const paperEdit = this.curQues // 试卷里编辑试题进来的
- // type: 1复制(调新增接口),2查看,3编辑,4是试卷里点编辑试题进来的(调createNewVersion创建新的版本)
- const res = await this.$post(this.api[paperEdit ? 'createNewVersion' : type === 1 || !form.questionId ? 'addQuestion' : 'updateQuestion'], form)
- paperEdit && this.$emit('updateQues', form, res.questionVersionId)
+ // type: 1复制(调新增接口),2查看,3编辑,4是试卷里点编辑试题进来的
+ await this.$post(this.api[type === 1 || !form.questionId ? 'addQuestion' : 'updateQuestion'], form)
+ paperEdit && this.$emit('updateQues', form)
Util.successMsg('保存成功')
!form.questionId && this.keep ? this.init(form) : this.back()
diff --git a/src/pages/ques/list/index.vue b/src/pages/ques/list/index.vue
index 18b9e5b..14b7398 100644
--- a/src/pages/ques/list/index.vue
+++ b/src/pages/ques/list/index.vue
@@ -148,7 +148,7 @@
@@ -401,7 +401,7 @@ export default {
this.page = val
this.getList()
},
- handleSelectionChange (val) { // 多选
+ handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
@@ -502,6 +502,10 @@ export default {
this.delVisible = false
this.getList()
},
+ // 删除提示里的跳转试卷
+ toPaper (row) {
+ this.$router.push(`/testPaper/detail?paperId=${row.paperId}&libraryId=${row.libraryId}&classificationId=${row.classificationId}`)
+ },
// 批量移除
async batchRemove () {
const list = this.multipleSelection
diff --git a/src/pages/testPaper/detail/auto.vue b/src/pages/testPaper/detail/auto.vue
index 7cdab0b..26ec91e 100644
--- a/src/pages/testPaper/detail/auto.vue
+++ b/src/pages/testPaper/detail/auto.vue
@@ -392,8 +392,7 @@ export default {
},
// 处理大纲列表
handleQuesList () {
- const list = _.cloneDeep(this.$parent.form.paperOutline)
- this.list = list
+ this.list = _.cloneDeep(this.$parent.form.paperOutline)
},
// 清空已选
async clearChecked () {
@@ -435,18 +434,6 @@ export default {
item.knowledges.length || this.checked.splice(i, 1) // 知识点清空了则把该题库删除
this.knowledgeCheck = false
},
- // 获取模板列表
- async getList () {
- try {
- const res = await this.$post(this.api.examPaperTemplateList, {
- pageNum: this.page,
- pageSize: this.pageSize,
- ...this.filter
- })
- this.list = res.pageList.records
- this.total = res.pageList.total
- } catch (e) { }
- },
// 试卷难度选择回调
@@ -526,6 +513,8 @@ export default {
invalid = 1
break
}
+ total = Decimal(total).add(e.randomDifficulty || 0).toNumber()
+ e.count = total
totalCount = Decimal(totalCount).add(total).toNumber()
}
if (invalid) return false
@@ -557,7 +546,7 @@ export default {
let invalid = 0
let hasQues = 0
list.map((e, i) => {
- if (+e.questionNum !== res.list[i].questions.length) invalid = 1
+ if (+e.count !== res.list[i].questions.length) invalid = 1
if (e.examQuestions.length) hasQues = 1
e.score = 0
})
diff --git a/src/pages/testPaper/detail/index.vue b/src/pages/testPaper/detail/index.vue
index c06aca5..9e54075 100644
--- a/src/pages/testPaper/detail/index.vue
+++ b/src/pages/testPaper/detail/index.vue
@@ -160,14 +160,18 @@
每空分值
分 填空项{{ k + 1 }}
+ @change="fillScoreChange(ques)" />
+ 分 填空项{{ k + 1 }}
+ 建议分值占比:{{
+ ques.answerData[k].scoreProportion }}%
查看每空分值
- 编辑试题
+ 编辑试题
更换试题
添加试题
移除试题
@@ -178,20 +182,20 @@
-
+
{{ numToLetter(j) }}.
-
+
【{{ item.questionType === 'essay' ? '参考答案' : '正确答案' }}】:
-
+
@@ -200,6 +204,10 @@
effect="plain">{{
kp.name }}
+
+
来自:
+
{{ ques.questionBankName }}
+
@@ -215,30 +223,33 @@
-
-
-
-
- 大题
- 已添加题数/目标题数
- 已分配分值/目标分值
-
-
-
-
- 第{{ arabicToChinese(i + 1) }}大题
- {{ item.examQuestions.length }}/{{ item.questionNum }}
- {{ item.examQuestions.reduce((e, j) => (e += +j.score), 0) }}/{{ item.targetScore }}
-
-
- 总计
- {{ overview.alreadyQuesCount }}/{{ overview.questionCount }}
- {{ overview.alreadyScore }}/{{ overview.totalScore }}
-
-
-
-
-
+
+
+
+
+
+
+ 大题
+ 已添加题数/目标题数
+ 已分配分值/目标分值
+
+
+
+
+ 第{{ arabicToChinese(i + 1) }}大题
+ {{ item.examQuestions.length }}/{{ item.questionNum }}
+ {{ item.examQuestions.reduce((e, j) => (e += +j.score), 0) || 0 }}/{{ item.targetScore }}
+
+
+ 总计
+ {{ overview.alreadyQuesCount }}/{{ overview.questionCount }}
+ {{ overview.alreadyScore }}/{{ overview.totalScore }}
+
+
+
+
+
+
@@ -247,13 +258,14 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/pages/testPaper/list/index.vue b/src/pages/testPaper/list/index.vue
index 4f5d575..0272d50 100644
--- a/src/pages/testPaper/list/index.vue
+++ b/src/pages/testPaper/list/index.vue
@@ -65,7 +65,8 @@
题目类型
-
+
@@ -121,7 +122,6 @@
show-overflow-tooltip>
-
diff --git a/src/pages/testPaper/preview/index.vue b/src/pages/testPaper/preview/index.vue
index 8d59624..9ae8442 100644
--- a/src/pages/testPaper/preview/index.vue
+++ b/src/pages/testPaper/preview/index.vue
@@ -57,7 +57,9 @@
@click="item.shrink = !item.shrink">
-
+
{{ j + 1 }} / {{ item.questionNum }}
{{ item.questionTypeName }}
@@ -551,12 +553,53 @@ export default {
}
}
- .item:not(:last-child) {
- padding-bottom: 15px;
- margin-bottom: 15px;
- border-bottom: 1px dashed #e1e1e1;
+ .item {
+ position: relative;
+ overflow: hidden;
+
+ &:not(:last-child) {
+ padding-bottom: 15px;
+ margin-bottom: 15px;
+ border-bottom: 1px dashed #e1e1e1;
+ }
+
+
+ &.disabled,
+ &.del,
+ &.repeat {
+ border-color: #f00;
+
+ &:after {
+ content: '已 禁 用';
+ position: absolute;
+ top: 17px;
+ right: -33px;
+ padding: 5px 36px;
+ font-size: 14px;
+ color: #fff;
+ background-color: #f00;
+ transform: rotate(45deg);
+ opacity: .6;
+ }
+ }
+
+ &.del {
+ &:after {
+ content: '已 删 除';
+ }
+ }
+
+ &.repeat {
+ border-color: #ff962a;
+
+ &:after {
+ content: '存在重复题';
+ background-color: #ff962a;
+ }
+ }
}
+
.stem-wrap {
display: flex;
align-items: baseline;