浏览代码

修复考生端配置的bug

lideyin 5 年之前
父节点
当前提交
f853a92fe9
共有 1 个文件被更改,包括 23 次插入3 次删除
  1. 23 3
      src/modules/basic/view/clientConfig.vue

+ 23 - 3
src/modules/basic/view/clientConfig.vue

@@ -202,9 +202,29 @@ export default {
             this.ruleForm.properties.PREVENT_CHEATING_CONFIG = this.ruleForm.PREVENT_CHEATING_CONFIG =
               "NONE";
           } else {
-            this.ruleForm.properties.PREVENT_CHEATING_CONFIG = this.ruleForm.PREVENT_CHEATING_CONFIG = this.ruleForm.preventCheatingConfig.join(
-              ","
-            );
+            let defaultArr = [];
+            for (let lt of PREVENT_CHEATING_CONFIG) {
+              defaultArr.push(lt.code);
+            }
+            let validArr = [];
+            //保存时清理一下历史数据
+            for (
+              var i = 0;
+              i < this.ruleForm.preventCheatingConfig.length;
+              i++
+            ) {
+              var code = this.ruleForm.preventCheatingConfig[i];
+              if (defaultArr.indexOf(code) > -1) {
+                validArr.push(code);
+              }
+            }
+            let res = "";
+            if (validArr.length == 0) {
+              res = "NONE";
+            } else {
+              res = validArr.join(",");
+            }
+            this.ruleForm.properties.PREVENT_CHEATING_CONFIG = this.ruleForm.PREVENT_CHEATING_CONFIG = res;
           }
 
           this.$httpWithMsg