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, disableUpload: false,
} }
, zIndex: 2500 , zIndex: 2000
, fullscreen: false , fullscreen: false
, rgb2Hex: true, , rgb2Hex: true,

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

@ -34,7 +34,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item class="is-required" prop="stem" label="题干"> <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" <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" 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> <div v-if="item.optionText" v-html="item.optionText"></div>
<p v-else class="default">请输入</p> <p v-else class="default">请输入</p>
</div> </div>
<UeditorPlus v-else class="opt-editor" :ref="'opt' + item.optionNumber" v-model="item.optionText" <UeditorPlus v-else class="opt-editor" :ref="'opt' + item.optionNumber" :config="editorConfig"
@ready="editor => optReady(editor, item)" /> v-model="item.optionText" @ready="editor => optReady(editor, item)" />
<template v-if="form.questionType !== 'judgement'"> <template v-if="form.questionType !== 'judgement'">
<i class="icon el-icon-circle-plus-outline" @click="addOpt(i)"></i> <i class="icon el-icon-circle-plus-outline" @click="addOpt(i)"></i>
<i class="icon el-icon-remove-outline" @click="delOpt(i)"></i> <i class="icon el-icon-remove-outline" @click="delOpt(i)"></i>
@ -124,7 +124,8 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="form.allowAttachment" prop="uploadInstructions" label="上传要求说明"> <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>
<el-form-item label="判分标准" class="is-required"> <el-form-item label="判分标准" class="is-required">
<el-select :value="form.questionAnswerVersions[0].gradingStandard" placeholder="请选择判分标准" disabled> <el-select :value="form.questionAnswerVersions[0].gradingStandard" placeholder="请选择判分标准" disabled>
@ -132,13 +133,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="referenceAnswer" label="参考答案"> <el-form-item prop="referenceAnswer" label="参考答案">
<UeditorPlus ref="referenceAnswer" @ready="referenceAnswerReady" <UeditorPlus ref="referenceAnswer" :config="editorConfig" @ready="referenceAnswerReady"
v-model="form.questionAnswerVersions[0].referenceAnswer" /> v-model="form.questionAnswerVersions[0].referenceAnswer" />
</el-form-item> </el-form-item>
</template> </template>
<el-form-item prop="answerAnalysis" label="解析"> <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-item>
</el-form> </el-form>
<span v-if="detailType !== 2" slot="footer" class="dialog-footer"> <span v-if="detailType !== 2" slot="footer" class="dialog-footer">
@ -221,6 +223,9 @@ export default {
questionTypes: Const.questionTypes, questionTypes: Const.questionTypes,
knowledges: [], knowledges: [],
editorConfig: {
zIndex: 2500,
},
richEditor: { richEditor: {
object: null, object: null,
parameterName: '', parameterName: '',

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

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

Loading…
Cancel
Save