@@ -34,6 +34,9 @@ export default {
extraplugins: {
type: String,
default: ""
+ },
+ readonly: {
+ type: Boolean
}
},
computed: {
@@ -57,6 +60,9 @@ export default {
"Underline,Subscript,Superscript,Image,HorizontalRule,Unlink,Link,Scayt,Cut,Copy,Paste,PasteText,PasteFromWord,Maximize,Italic,Bold,NumberedList,BulletedList,Indent,Outdent,Blockquote,Styles,Format,About,RemoveFormat,Strike"
};
window.CKEDITOR.replace(this.id, config);
+ this.instance.on("instanceReady", ev => {
+ ev.editor.setReadOnly(this.readonly);
+ });
this.instance.on("change", () => {
let html = this.instance.getData();
if (html !== this.value) {
@@ -49,6 +49,13 @@
@click="addExamInfoDialog"
>新增
</el-button>
+ <el-button
+ size="mini"
+ type="primary"
+ icon="el-icon-document"
+ @click="toCopyExam()"
+ >复制</el-button
+ >
</el-form-item>
</el-form>
@@ -198,14 +205,7 @@
>
学习中心设置
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-edit"
- @click="showCopyExam(scope.row)"
- >复制</el-button
- ></el-dropdown-item
- >
+ </el-dropdown-item>
</el-dropdown-menu></el-dropdown
</div>
@@ -350,6 +350,25 @@ export default {
methods: {
+ toCopyExam() {
+ if (this.selectedExamIds.length == 0) {
+ this.$notify({
+ type: "warning",
+ message: "请勾选一个考试"
+ return;
+ }
+ if (this.selectedExamIds.length > 1) {
+ message: "只能勾选一个考试"
+ this.showCopyExam(
+ this.tableData.filter(v => v.id === this.selectedExamIds[0])[0]
+ );
showCopyExam(row) {
this.examCopyTitle = "复制考试:" + row.name;
this.examCopyForm.srcExamId = row.id;
@@ -268,15 +268,9 @@
</el-col>
</el-row>
<el-form-item label="公告内容" prop="content">
- <div v-if="this.operateType == 'view'">
- <div
- v-html="noticeForm.content"
- class="ckeditor-readOnly"
- ></div>
- </div>
- <div v-else>
+ <div>
<ckeditor
- :readOnly="this.operateType == 'view'"
+ :readonly="this.operateType == 'view'"
width="650px"
v-model="noticeForm.content"
></ckeditor>
@@ -372,16 +372,16 @@ export default {
this.$notify({
message: "分数不能为空",
type: "error",
- duration: 1000
+ duration: 2000
});
return false;
} else {
let regex = "^\\d+(\\.[\\d])?$";
if (!score.match(regex)) {
- message: "分数必须为数字",
+ message: "分数必须为数字且最多一位小数",
@@ -389,12 +389,29 @@ export default {
message: "分数不能超过" + maxScore + "分",
+ //校验分数是否是间隔的倍数
+ var scoreInterval = resultItem.markItem.scoreInterval;
+ if (this.scoreStep != null) {
+ scoreInterval = this.scoreStep;
+ if (
+ parseFloat(score) != 0 &&
+ parseFloat(score) != parseFloat(maxScore) &&
+ (parseFloat(score) * 10) % (scoreInterval * 10) != 0
+ ) {
+ message: "分数必须是给分间隔的倍数或者零分、满分",
+ type: "error",
+ return false;
return true;
scoreClick(score, index1) {
@@ -519,9 +536,17 @@ export default {
message: itemName + "没有打分,请打分",
type: "warning"
+ if (!this.isMouseMode) {
+ let curItemInput = "item" + resultItem.markItem.id;
+ document.getElementById(curItemInput).focus();
if (!this.checkScore(resultItem)) {