deason 4 年 前
コミット
99ddd86bb5
1 ファイル変更34 行追加1 行削除
  1. 34 1
      src/modules/basic/view/sys_login_rule_list.vue

+ 34 - 1
src/modules/basic/view/sys_login_rule_list.vue

@@ -75,6 +75,24 @@
       </el-button>
     </div>
 
+    <div class="page pull-right">
+      <el-form :inline="true">
+        <span
+          v-for="(item, index) in topLoginRuleList"
+          :key="item"
+          style="padding: 0px 15px"
+        >
+          <el-form-item :label="'开放' + getTypeTitle(item.type)">
+            <el-switch
+              v-model="switchModels[index].allow"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+            ></el-switch>
+          </el-form-item>
+        </span>
+      </el-form>
+    </div>
+
     <el-table
       v-loading="loading"
       :data="tableData"
@@ -242,7 +260,9 @@ export default {
         allow: [
           { required: true, message: "请选择是否白名单!", trigger: "change" }
         ]
-      }
+      },
+      topLoginRuleList: [],
+      switchModels: []
     };
   },
   methods: {
@@ -255,6 +275,18 @@ export default {
           });
       }
     },
+    getTopLoginRuleList() {
+      this.$httpWithMsg
+        .post(CORE_API + "/sys/xlogin/rule/top/list")
+        .then(response => {
+          this.topLoginRuleList = response.data;
+
+          for (let n = 0; n < this.topLoginRuleList.length; n++) {
+            let value = this.topLoginRuleList[n].allow;
+            this.switchModels.push({ allow: value });
+          }
+        });
+    },
     doSearch(pageNo) {
       this.searchForm.pageNo = pageNo;
 
@@ -369,6 +401,7 @@ export default {
   },
   created() {
     this.getRootOrgList();
+    this.getTopLoginRuleList();
     this.doSearch(1);
   }
 };