|
@@ -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)) {
|
|
|
this.$notify({
|
|
|
- message: "分数必须为数字",
|
|
|
+ message: "分数必须为数字且最多一位小数",
|
|
|
type: "error",
|
|
|
- duration: 1000
|
|
|
+ duration: 2000
|
|
|
});
|
|
|
return false;
|
|
|
} else {
|
|
@@ -389,12 +389,29 @@ export default {
|
|
|
this.$notify({
|
|
|
message: "分数不能超过" + maxScore + "分",
|
|
|
type: "error",
|
|
|
- duration: 1000
|
|
|
+ duration: 2000
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //校验分数是否是间隔的倍数
|
|
|
+ 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
|
|
|
+ ) {
|
|
|
+ this.$notify({
|
|
|
+ message: "分数必须是给分间隔的倍数或者零分、满分",
|
|
|
+ type: "error",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ 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();
|
|
|
+ }
|
|
|
return false;
|
|
|
} else {
|
|
|
if (!this.checkScore(resultItem)) {
|
|
|
+ if (!this.isMouseMode) {
|
|
|
+ let curItemInput = "item" + resultItem.markItem.id;
|
|
|
+ document.getElementById(curItemInput).focus();
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
}
|