qinchao vor 4 Jahren
Ursprung
Commit
01d2661a10
2 geänderte Dateien mit 12 neuen und 4 gelöschten Zeilen
  1. 1 1
      src/modules/examwork/view/examInfo.vue
  2. 11 3
      src/modules/examwork/view/examIpLimit.vue

+ 1 - 1
src/modules/examwork/view/examInfo.vue

@@ -234,7 +234,7 @@
                     </el-dropdown-item>
                     <el-dropdown-item>
                       <el-button
-                        :disabled="!rolePrivileges.update_exam"
+                        :disabled="!scope.row.ipLimitSettingsEnabled"
                         size="mini"
                         type="primary"
                         icon="el-icon-edit"

+ 11 - 3
src/modules/examwork/view/examIpLimit.vue

@@ -34,8 +34,8 @@
           <el-form-item label="限制类型">
             <el-select v-model="formSearch.limitType" class="input">
               <el-option label="未选择" value=""></el-option>
-              <el-option label="允许访问" value="false"></el-option>
-              <el-option label="限制访问" value="true"></el-option>
+              <el-option label="允许访问" value="0"></el-option>
+              <el-option label="禁止访问" value="1"></el-option>
             </el-select>
           </el-form-item>
 
@@ -599,10 +599,18 @@ export default {
       }
       this.examIpLimitForm.id = row.id;
       this.examIpLimitForm.ip = row.ip;
-      this.examIpLimitForm.limitType = row.limitType;
+      this.examIpLimitForm.limitType = this.getLimitType(row.limitType);
       this.addingIpLimitDialog = true;
       this.showIpColumn = true;
     },
+    getLimitType(type) {
+      if (type === "允许访问") {
+        return 0;
+      } else if (type === "禁止访问") {
+        return 1;
+      }
+      return null;
+    },
     batchDelete() {
       this.$confirm("确定删除所选数据吗?", "提示", {
         confirmButtonText: "确定",