瀏覽代碼

分班判断

lrf402788946 5 年之前
父節點
當前提交
842de15ca1
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/views/plan/classes.vue

+ 4 - 3
src/views/plan/classes.vue

@@ -183,9 +183,10 @@ export default {
     },
     isOutRange(selected) {
       let res = true;
-      if (selected.length > this.selectInfo.personReq) this.$message.error('超出班级规定人数');
-      else if (selected.length < this.selectInfo.personReq) this.$message.error('人数不足');
-      else if (selected.length == this.selectInfo.personReq) res = false;
+      if (selected.length <= 0) this.$message.warning('请选择学生');
+      else if (_.inRange(selected.length, 1, this.selectInfo.personReq * 1)) this.$message.error('选择人数不足');
+      else if (selected.length > this.selectInfo.personReq * 1) this.$message('超出班级规定人数');
+      else res = false;
       return res;
     },
   },