|
@@ -1,14 +1,14 @@
|
|
<template>
|
|
<template>
|
|
<section style="margin-top: 0px;">
|
|
<section style="margin-top: 0px;">
|
|
<el-form
|
|
<el-form
|
|
- :model="formSearch"
|
|
|
|
|
|
+ :model="searchForm"
|
|
:inline="true"
|
|
:inline="true"
|
|
style="border-bottom: 1px solid rgb(221, 221, 221);margin-bottom: 10px;"
|
|
style="border-bottom: 1px solid rgb(221, 221, 221);margin-bottom: 10px;"
|
|
>
|
|
>
|
|
<el-form-item label="学校">
|
|
<el-form-item label="学校">
|
|
<el-select
|
|
<el-select
|
|
v-if="isSuperAdmin"
|
|
v-if="isSuperAdmin"
|
|
- v-model="formSearch.rootOrgId"
|
|
|
|
|
|
+ v-model="searchForm.rootOrgId"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
filterable
|
|
filterable
|
|
clearable
|
|
clearable
|
|
@@ -26,7 +26,7 @@
|
|
|
|
|
|
<el-form-item label="规则类型">
|
|
<el-form-item label="规则类型">
|
|
<el-select
|
|
<el-select
|
|
- v-model="formSearch.type"
|
|
|
|
|
|
+ v-model="searchForm.type"
|
|
size="small"
|
|
size="small"
|
|
class="w180"
|
|
class="w180"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
@@ -34,7 +34,7 @@
|
|
clearable
|
|
clearable
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in ruleTypes"
|
|
|
|
|
|
+ v-for="item in loginRuleTypes"
|
|
:label="item.label"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
:value="item.value"
|
|
:key="item.value"
|
|
:key="item.value"
|
|
@@ -57,6 +57,25 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
+ <div style="margin-bottom: 5px;">
|
|
|
|
+ 操作:
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ @click="loginRuleDialogOpen(null)"
|
|
|
|
+ >新增
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-refresh"
|
|
|
|
+ @click="doRefreshRule"
|
|
|
|
+ >刷新
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<el-table
|
|
<el-table
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
:data="tableData"
|
|
:data="tableData"
|
|
@@ -83,13 +102,22 @@
|
|
<el-table-column label="创建时间" prop="creationTime" sortable />
|
|
<el-table-column label="创建时间" prop="creationTime" sortable />
|
|
<el-table-column label="更新时间" prop="updateTime" sortable />
|
|
<el-table-column label="更新时间" prop="updateTime" sortable />
|
|
|
|
|
|
- <el-table-column label="操作" width="100px">
|
|
|
|
|
|
+ <el-table-column label="操作" width="180px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ @click="loginRuleDialogOpen(scope.row)"
|
|
|
|
+ plain
|
|
|
|
+ >编辑
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="danger"
|
|
type="danger"
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
- @click="doDelete(scope.row)"
|
|
|
|
|
|
+ @click="doDeleteRule(scope.row)"
|
|
plain
|
|
plain
|
|
>删除
|
|
>删除
|
|
</el-button>
|
|
</el-button>
|
|
@@ -100,14 +128,78 @@
|
|
<div class="page pull-right">
|
|
<div class="page pull-right">
|
|
<el-pagination
|
|
<el-pagination
|
|
@current-change="handlePagerNo"
|
|
@current-change="handlePagerNo"
|
|
- :current-page="formSearch.pageNo"
|
|
|
|
|
|
+ :current-page="searchForm.pageNo"
|
|
@size-change="handlePagerSize"
|
|
@size-change="handlePagerSize"
|
|
- :page-size="formSearch.pageSize"
|
|
|
|
|
|
+ :page-size="searchForm.pageSize"
|
|
:page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
:page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
:total="totalElements"
|
|
:total="totalElements"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
></el-pagination>
|
|
></el-pagination>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="规则新增"
|
|
|
|
+ width="380px"
|
|
|
|
+ :visible.sync="loginRuleDialog"
|
|
|
|
+ @close="loginRuleDialogClose"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ :model="loginRuleForm"
|
|
|
|
+ ref="loginRuleForm"
|
|
|
|
+ :rules="formRules"
|
|
|
|
+ label-position="right"
|
|
|
|
+ label-width="120px"
|
|
|
|
+ inline-message
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="学校">
|
|
|
|
+ <el-select
|
|
|
|
+ v-if="isSuperAdmin"
|
|
|
|
+ v-model="loginRuleForm.rootOrgId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ filterable
|
|
|
|
+ clearable
|
|
|
|
+ size="small"
|
|
|
|
+ class="w180"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in rootOrgList"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="规则类型">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="loginRuleForm.type"
|
|
|
|
+ size="small"
|
|
|
|
+ class="w180"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in loginRuleTypes"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="是否白名单">
|
|
|
|
+ <el-radio-group v-model="loginRuleForm.allow">
|
|
|
|
+ <el-radio label="true">是</el-radio>
|
|
|
|
+ <el-radio label="false">否</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <div style="text-align: center">
|
|
|
|
+ <el-button type="primary" @click="doAddRule">确 定</el-button>
|
|
|
|
+ <el-button @click="loginRuleDialogClose">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
</section>
|
|
</section>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -118,7 +210,7 @@ import { CORE_API } from "@/constants/constants.js";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- formSearch: {
|
|
|
|
|
|
+ searchForm: {
|
|
rootOrgId: null,
|
|
rootOrgId: null,
|
|
type: null,
|
|
type: null,
|
|
allow: null,
|
|
allow: null,
|
|
@@ -129,11 +221,25 @@ export default {
|
|
tableData: [],
|
|
tableData: [],
|
|
totalElements: 0,
|
|
totalElements: 0,
|
|
rootOrgList: [],
|
|
rootOrgList: [],
|
|
- ruleTypes: [
|
|
|
|
|
|
+ loginRuleTypes: [
|
|
{ label: "考生登录", value: "STUDENT_LOGIN" },
|
|
{ label: "考生登录", value: "STUDENT_LOGIN" },
|
|
{ label: "考生端登录", value: "STUDENT_CLIENT_LOGIN" },
|
|
{ label: "考生端登录", value: "STUDENT_CLIENT_LOGIN" },
|
|
{ label: "极验验证码登录", value: "GEETEST_LOGIN" }
|
|
{ label: "极验验证码登录", value: "GEETEST_LOGIN" }
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
|
|
+ loginRuleDialog: false,
|
|
|
|
+ loginRuleForm: {
|
|
|
|
+ rootOrgId: null,
|
|
|
|
+ type: null,
|
|
|
|
+ allow: null
|
|
|
|
+ },
|
|
|
|
+ formRules: {
|
|
|
|
+ rootOrgId: [
|
|
|
|
+ { required: true, message: "学校不能为空!", trigger: "change" }
|
|
|
|
+ ],
|
|
|
|
+ type: [
|
|
|
|
+ { required: true, message: "规则类型不能为空!", trigger: "change" }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -147,11 +253,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
doSearch(pageNo) {
|
|
doSearch(pageNo) {
|
|
- this.formSearch.pageNo = pageNo;
|
|
|
|
|
|
+ this.searchForm.pageNo = pageNo;
|
|
|
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
let url = CORE_API + "/sys/xlogin/rule/list";
|
|
let url = CORE_API + "/sys/xlogin/rule/list";
|
|
- this.$http.post(url, this.formSearch).then(
|
|
|
|
|
|
+ this.$http.post(url, this.searchForm).then(
|
|
response => {
|
|
response => {
|
|
this.tableData = response.data.content;
|
|
this.tableData = response.data.content;
|
|
this.totalElements = response.data.totalElements;
|
|
this.totalElements = response.data.totalElements;
|
|
@@ -163,8 +269,35 @@ export default {
|
|
}
|
|
}
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- doDelete(row) {
|
|
|
|
- this.$confirm("确认删除当前规则?", "提示", {
|
|
|
|
|
|
+ loginRuleDialogOpen(row) {
|
|
|
|
+ if (row) {
|
|
|
|
+ this.loginRuleForm.rootOrgId = row.rootOrgId;
|
|
|
|
+ this.loginRuleForm.type = row.type;
|
|
|
|
+ this.loginRuleForm.allow = row.allow;
|
|
|
|
+ } else {
|
|
|
|
+ this.loginRuleForm.rootOrgId = null;
|
|
|
|
+ this.loginRuleForm.type = null;
|
|
|
|
+ this.loginRuleForm.allow = null;
|
|
|
|
+ }
|
|
|
|
+ this.loginRuleDialog = true;
|
|
|
|
+ },
|
|
|
|
+ loginRuleDialogClose() {
|
|
|
|
+ this.loginRuleDialog = false;
|
|
|
|
+ },
|
|
|
|
+ doAddRule() {
|
|
|
|
+ this.$refs.loginRuleForm.validate(valid => {
|
|
|
|
+ if (!valid) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.loginRuleDialogClose();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ doEditRule() {
|
|
|
|
+ this.loginRuleDialogClose();
|
|
|
|
+ },
|
|
|
|
+ doDeleteRule(row) {
|
|
|
|
+ this.$confirm("确认删除?", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
type: "warning"
|
|
@@ -179,27 +312,42 @@ export default {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ doRefreshRule() {
|
|
|
|
+ this.$confirm("确认刷新?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(() => {
|
|
|
|
+ let url = CORE_API + "/sys/xlogin/rule/refresh";
|
|
|
|
+ this.$http.post(url).then(() => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "刷新成功"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
handlePagerNo(pageNo) {
|
|
handlePagerNo(pageNo) {
|
|
this.doSearch(pageNo);
|
|
this.doSearch(pageNo);
|
|
},
|
|
},
|
|
handlePagerSize(pageSize) {
|
|
handlePagerSize(pageSize) {
|
|
- this.formSearch.pageSize = pageSize;
|
|
|
|
|
|
+ this.searchForm.pageSize = pageSize;
|
|
this.doSearch(1);
|
|
this.doSearch(1);
|
|
},
|
|
},
|
|
clearTypeValue() {
|
|
clearTypeValue() {
|
|
- this.formSearch.type = null;
|
|
|
|
|
|
+ this.searchForm.type = null;
|
|
},
|
|
},
|
|
getTypeTitle(val) {
|
|
getTypeTitle(val) {
|
|
- for (let type of this.ruleTypes) {
|
|
|
|
|
|
+ for (let type of this.loginRuleTypes) {
|
|
if (type.value == val) {
|
|
if (type.value == val) {
|
|
return type.label;
|
|
return type.label;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
resetSearchForm() {
|
|
resetSearchForm() {
|
|
- this.formSearch.rootOrgId = null;
|
|
|
|
- this.formSearch.type = null;
|
|
|
|
- this.formSearch.allow = null;
|
|
|
|
|
|
+ this.searchForm.rootOrgId = null;
|
|
|
|
+ this.searchForm.type = null;
|
|
|
|
+ this.searchForm.allow = null;
|
|
this.doSearch(1);
|
|
this.doSearch(1);
|
|
}
|
|
}
|
|
},
|
|
},
|