yujialong 3 months ago
parent b9f4637ab6
commit 9945e373c3
  1. 2
      public/static/ueditorPlus/ueditor.config.js
  2. 8
      src/components/ueditorPlus/index.vue
  3. 17
      src/pages/ques/detail/index.vue
  4. 28
      src/pages/testPaper/detail/index.vue
  5. 19
      src/pages/testPaper/detail/manual.vue

@ -101,7 +101,7 @@
// 禁止本地上传
disableUpload: false,
}
, zIndex: 2500
, zIndex: 2000
, fullscreen: false
, rgb2Hex: true,

@ -13,6 +13,11 @@ export default {
default: function () {
return ''
}
},
config: {
default () {
return {}
}
}
},
data () {
@ -48,7 +53,8 @@ export default {
this.instance = UE.getEditor(this.randomId, {
UEDITOR_HOME_URL: Setting.isDev ? '/static/ueditorPlus/' : '/examination/static/ueditorPlus/',
serverUrl: "http://121.37.12.51/exam/exam/upload/configAndUpload",
plugins: 'gapfilling'
plugins: 'gapfilling',
...this.config
})
this.instance.addListener('ready', () => {

@ -34,7 +34,7 @@
</el-radio-group>
</el-form-item>
<el-form-item class="is-required" prop="stem" label="题干">
<UeditorPlus ref="stem" @ready="stemReady" v-model="form.stem" />
<UeditorPlus ref="stem" :config="editorConfig" @ready="stemReady" v-model="form.stem" />
<Upload v-if="form.questionType === 'essay'" class="m-t-10"
accept=".csv,.xlsx,.xls,.docx,.doc,.pdf,.jpg,.png,.zip,.rar,.7z" :max-size="50" :file-list="uploadList"
@ -61,8 +61,8 @@
<div v-if="item.optionText" v-html="item.optionText"></div>
<p v-else class="default">请输入</p>
</div>
<UeditorPlus v-else class="opt-editor" :ref="'opt' + item.optionNumber" v-model="item.optionText"
@ready="editor => optReady(editor, item)" />
<UeditorPlus v-else class="opt-editor" :ref="'opt' + item.optionNumber" :config="editorConfig"
v-model="item.optionText" @ready="editor => optReady(editor, item)" />
<template v-if="form.questionType !== 'judgement'">
<i class="icon el-icon-circle-plus-outline" @click="addOpt(i)"></i>
<i class="icon el-icon-remove-outline" @click="delOpt(i)"></i>
@ -124,7 +124,8 @@
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.allowAttachment" prop="uploadInstructions" label="上传要求说明">
<UeditorPlus ref="uploadInstructions" @ready="uploadInstructionsReady" v-model="form.uploadInstructions" />
<UeditorPlus ref="uploadInstructions" :config="editorConfig" @ready="uploadInstructionsReady"
v-model="form.uploadInstructions" />
</el-form-item>
<el-form-item label="判分标准" class="is-required">
<el-select :value="form.questionAnswerVersions[0].gradingStandard" placeholder="请选择判分标准" disabled>
@ -132,13 +133,14 @@
</el-select>
</el-form-item>
<el-form-item prop="referenceAnswer" label="参考答案">
<UeditorPlus ref="referenceAnswer" @ready="referenceAnswerReady"
<UeditorPlus ref="referenceAnswer" :config="editorConfig" @ready="referenceAnswerReady"
v-model="form.questionAnswerVersions[0].referenceAnswer" />
</el-form-item>
</template>
<el-form-item prop="answerAnalysis" label="解析">
<UeditorPlus ref="answerAnalysis" @ready="answerAnalysisReady" v-model="answerAnalysis" />
<UeditorPlus ref="answerAnalysis" :config="editorConfig" @ready="answerAnalysisReady"
v-model="answerAnalysis" />
</el-form-item>
</el-form>
<span v-if="detailType !== 2" slot="footer" class="dialog-footer">
@ -221,6 +223,9 @@ export default {
questionTypes: Const.questionTypes,
knowledges: [],
editorConfig: {
zIndex: 2500,
},
richEditor: {
object: null,
parameterName: '',

@ -134,9 +134,11 @@
<el-checkbox v-model="ques.check"></el-checkbox>
<div :class="['ques-info', { disabled: !ques.status, del: ques.isDel, repeat: ques.isRepeat }]">
<div class="top-line">
<span class="label">{{ j + 1 }} / {{ item.examQuestions.length }}</span>
<span class="label">{{ questionTypes.find(e => e.id === item.questionType).name }}</span>
<div :id="'stem' + ques.questionVersionId" v-html="getQuesStem(ques)"></div>
<div class="labels">
<span class="label">{{ j + 1 }} / {{ item.examQuestions.length }}</span>
<span class="label">{{ questionTypes.find(e => e.id === item.questionType).name }}</span>
</div>
<div class="stem" :id="'stem' + ques.questionVersionId" v-html="getQuesStem(ques)"></div>
<p v-if="item.questionType !== 'fill_blank'"><el-input class="score" placeholder="请输入"
v-model="ques.score" /></p>
</div>
@ -753,6 +755,7 @@ export default {
let invalid = 0
for (const i in paper) {
const e = paper[i]
const chineseNum = this.arabicToChinese(+i + 1)
if (!e.questionType) {
Util.warningMsg('请选择题型')
invalid = 1
@ -763,13 +766,17 @@ export default {
invalid = 1
break
}
if (!e.outlineName) {
Util.warningMsg(`${chineseNum}大题请输入大题名称`)
invalid = 1
break
}
if (!e.targetScore) {
Util.warningMsg('请输入目标分值')
invalid = 1
break
}
const chineseNum = this.arabicToChinese(+i + 1)
//
if (+e.questionNum !== e.examQuestions.length) {
Util.warningMsg(`${chineseNum}大题的小题总数跟目标题数不一致,请重新修改`)
@ -974,8 +981,14 @@ export default {
.top-line {
display: flex;
align-items: center;
align-items: baseline;
margin-bottom: 10px;
line-height: 28px;
}
.labels {
display: inline-flex;
align-items: center;
}
.label {
@ -984,10 +997,15 @@ export default {
font-size: 12px;
line-height: 1;
color: $main-color;
white-space: nowrap;
border: 1px solid;
border-radius: 2px;
}
.stem {
max-width: calc(100% - 236px);
}
/deep/.score {
width: 70px;
margin: 0 10px;

@ -39,7 +39,9 @@
<el-checkbox v-model="item.check" :disabled="item.disabled"
@change="val => quesChange(val, item)"></el-checkbox>
<span class="serial">{{ i + 1 }}</span>
<span>{{ item.stemText }}</span>
<el-tooltip effect="dark" :content="item.stemText" placement="top-start">
<p class="stem" :title="item.stemText">{{ item.stemText }}</p>
</el-tooltip>
</div>
</div>
</div>
@ -66,7 +68,9 @@
<div class="check-left">
<el-checkbox v-model="item.check"></el-checkbox>
<span class="serial">{{ i + 1 }}</span>
<div v-html="item.stemText"></div>
<el-tooltip effect="dark" :content="item.stemText" placement="top-start">
<p class="checked-stem" :title="item.stemText">{{ item.stemText }}</p>
</el-tooltip>
</div>
<i class="el-icon-delete action-icon" @click="delChecked(item)"></i>
</div>
@ -402,6 +406,17 @@ export default {
width: 32px;
margin: 0 12px;
text-align: center;
white-space: nowrap;
}
.stem {
max-width: calc(100% - 71px);
@include ellipsis;
}
.checked-stem {
max-width: 165px;
@include ellipsis;
}
.check-left {

Loading…
Cancel
Save