|
@@ -1,6 +1,12 @@
|
|
|
<template>
|
|
|
<div class="Box">
|
|
|
- <el-form :model="FormData" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
|
|
+ <el-form
|
|
|
+ :model="FormData"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm"
|
|
|
+ label-width="100px"
|
|
|
+ class="demo-ruleForm"
|
|
|
+ >
|
|
|
<div class="topBox">
|
|
|
<div class="titleBtn">
|
|
|
<span class="titleStyle">策略信息新增 </span>
|
|
@@ -10,26 +16,51 @@
|
|
|
<div class="fristLine">
|
|
|
<div class="inputBox">
|
|
|
<el-form-item label="策略名称" prop="TacName">
|
|
|
- <el-input placeholder="请输入" v-model="FormData.TacName"></el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model="FormData.TacName"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="inputBox">
|
|
|
<el-form-item label="IP类型" prop="IpType">
|
|
|
<el-select v-model="FormData.IpType" placeholder="请选择类型">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="block inputBox1">
|
|
|
<el-form-item label="登录日期" prop="Date">
|
|
|
- <el-date-picker v-model="FormData.Date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="dataChange" value-format="yyyy-MM-dd">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="FormData.Date"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ @change="dataChange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="block inputBox1">
|
|
|
<el-form-item label="登录时间" prop="Time">
|
|
|
- <el-time-picker is-range v-model="FormData.Time" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围" @change="timeChange" value-format="HH:mm:ss">
|
|
|
+ <el-time-picker
|
|
|
+ is-range
|
|
|
+ v-model="FormData.Time"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ placeholder="选择时间范围"
|
|
|
+ @change="timeChange"
|
|
|
+ value-format="HH:mm:ss"
|
|
|
+ >
|
|
|
</el-time-picker>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -38,12 +69,18 @@
|
|
|
<div class="fristLine" style="margin-top: 24px">
|
|
|
<div class="inputBox2">
|
|
|
<el-form-item label="IP段" prop="IpList">
|
|
|
- <el-input placeholder="请输入IP,并以‘;’号隔开" v-model="FormData.IpList"></el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入IP,并以‘;’号隔开"
|
|
|
+ v-model="FormData.IpList"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<div class="inputBox3">
|
|
|
<el-form-item label="描述" prop="IpList">
|
|
|
- <el-input placeholder="请输入" v-model="FormData.TacDesc"></el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model="FormData.TacDesc"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -57,7 +94,11 @@
|
|
|
<div class="center-box">
|
|
|
<el-row class="scCont" :gutter="16">
|
|
|
<el-checkbox-group @change="UnchangeChecked" v-model="UncheckList">
|
|
|
- <el-col :span="4" v-for="(item, index) in FormData.UseList" :key="index">
|
|
|
+ <el-col
|
|
|
+ :span="4"
|
|
|
+ v-for="(item, index) in FormData.UseList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
<el-card class="box-card">
|
|
|
<div class="lineTop"></div>
|
|
|
<div class="text item">
|
|
@@ -75,7 +116,11 @@
|
|
|
</el-col>
|
|
|
</el-checkbox-group>
|
|
|
</el-row>
|
|
|
- <el-empty v-if="FormData.UseList.length == 0" description="没有选取" style="margin: 0 auto"></el-empty>
|
|
|
+ <el-empty
|
|
|
+ v-if="FormData.UseList.length == 0"
|
|
|
+ description="没有选取"
|
|
|
+ style="margin: 0 auto"
|
|
|
+ ></el-empty>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -83,14 +128,29 @@
|
|
|
<div class="titleBtn">
|
|
|
<span class="titleStyle">选择职员 </span>
|
|
|
<div class="searchBox">
|
|
|
- <el-input placeholder="请输入内容" clearable @clear="clearData" v-model="keyWords"></el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入内容"
|
|
|
+ clearable
|
|
|
+ @clear="clearData"
|
|
|
+ v-model="keyWords"
|
|
|
+ ></el-input>
|
|
|
<el-button @click="getUserData">搜索</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="center-box">
|
|
|
- <el-row v-infinite-scroll="load" :infinite-scroll-distance="20" infinite-scroll-disabled="disabled" class="scCont scrollbar" :gutter="16">
|
|
|
+ <el-row
|
|
|
+ v-infinite-scroll="load"
|
|
|
+ :infinite-scroll-distance="20"
|
|
|
+ infinite-scroll-disabled="disabled"
|
|
|
+ class="scCont scrollbar"
|
|
|
+ :gutter="16"
|
|
|
+ >
|
|
|
<el-checkbox-group @change="changeChecked" v-model="checkList">
|
|
|
- <el-col :span="6" v-for="(item, index) in FormData.Unuselist" :key="index">
|
|
|
+ <el-col
|
|
|
+ :span="6"
|
|
|
+ v-for="(item, index) in FormData.Unuselist"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
<el-card class="box-card">
|
|
|
<div class="lineTop"></div>
|
|
|
<div class="text item">
|
|
@@ -112,7 +172,11 @@
|
|
|
<p class="center" v-if="loading">加载中...</p>
|
|
|
<p class="center" v-if="noMore">没有更多数据了~</p>
|
|
|
</template>
|
|
|
- <el-empty v-if="FormData.Unuselist.length == 0" description="没有内容" style="margin: 0 auto"></el-empty>
|
|
|
+ <el-empty
|
|
|
+ v-if="FormData.Unuselist.length == 0"
|
|
|
+ description="没有内容"
|
|
|
+ style="margin: 0 auto"
|
|
|
+ ></el-empty>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -123,7 +187,7 @@
|
|
|
import { GetUserList } from "@/api/apiAuthority";
|
|
|
import { SaveTac } from "@/api/systemConfiguration";
|
|
|
export default {
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
keyWords: "",
|
|
|
checkList: [],
|
|
@@ -177,23 +241,23 @@ export default {
|
|
|
total: null,
|
|
|
arrList: [],
|
|
|
dataList: [],
|
|
|
- checkData: []
|
|
|
+ checkData: [],
|
|
|
};
|
|
|
},
|
|
|
created: function () {
|
|
|
this.getUserList({
|
|
|
QueryName: this.keyWords,
|
|
|
PageSize: this.PageSize,
|
|
|
- PageIndex: this.pageNum
|
|
|
+ PageIndex: this.pageNum,
|
|
|
});
|
|
|
},
|
|
|
computed: {
|
|
|
- noMore () {
|
|
|
- return this.pageNum >= this.total
|
|
|
+ noMore() {
|
|
|
+ return this.pageNum >= this.total;
|
|
|
+ },
|
|
|
+ disabled() {
|
|
|
+ return this.loading || this.noMore;
|
|
|
},
|
|
|
- disabled () {
|
|
|
- return this.loading || this.noMore
|
|
|
- }
|
|
|
},
|
|
|
methods: {
|
|
|
isValidIP: function (ip) {
|
|
@@ -201,11 +265,11 @@ export default {
|
|
|
/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
|
|
|
return reg.test(ip);
|
|
|
},
|
|
|
- save () {
|
|
|
+ save() {
|
|
|
let that = this;
|
|
|
let ipArr = this.FormData.IpList.split(";");
|
|
|
let isSave = true;
|
|
|
- if (ipArr.length > 0) {
|
|
|
+ if (ipArr.length >= 2) {
|
|
|
ipArr.forEach((item) => {
|
|
|
if (this.isValidIP(item) == false) {
|
|
|
this.$message.error("请输入正确IP段,并以;号隔开");
|
|
@@ -248,7 +312,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getUserList (obj) {
|
|
|
+ getUserList(obj) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.loading = true;
|
|
|
GetUserList(obj)
|
|
@@ -272,20 +336,20 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- changeChecked (arr) {
|
|
|
+ changeChecked(arr) {
|
|
|
const datas = this.dataList;
|
|
|
datas.forEach((item, index) => {
|
|
|
- arr.forEach(p => {
|
|
|
+ arr.forEach((p) => {
|
|
|
if (index == p) {
|
|
|
this.checkData.push(item);
|
|
|
this.FormData.Unuselist.splice(index, 1);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
});
|
|
|
this.FormData.UseList = this.checkData;
|
|
|
this.checkList = [];
|
|
|
},
|
|
|
- UnchangeChecked (val, index) {
|
|
|
+ UnchangeChecked(val, index) {
|
|
|
this.UncheckList = true;
|
|
|
this.FormData.Unuselist.push(val);
|
|
|
this.FormData.UseList.splice(index, 1);
|
|
@@ -298,34 +362,34 @@ export default {
|
|
|
this.FormData.TimeBegin = data[0];
|
|
|
this.FormData.TimeEnd = data[1];
|
|
|
},
|
|
|
- load () {
|
|
|
+ load() {
|
|
|
this.pageNum += 1;
|
|
|
this.getUserList({
|
|
|
QueryName: this.keyWords,
|
|
|
PageSize: this.PageSize,
|
|
|
- PageIndex: this.pageNum
|
|
|
- })
|
|
|
+ PageIndex: this.pageNum,
|
|
|
+ });
|
|
|
},
|
|
|
- getUserData () {
|
|
|
+ getUserData() {
|
|
|
this.arrList = [];
|
|
|
this.FormData.Unuselist = [];
|
|
|
this.pageNum = 1;
|
|
|
this.getUserList({
|
|
|
QueryName: this.keyWords,
|
|
|
PageSize: this.PageSize,
|
|
|
- PageIndex: this.pageNum
|
|
|
- })
|
|
|
+ PageIndex: this.pageNum,
|
|
|
+ });
|
|
|
},
|
|
|
- clearData () {
|
|
|
+ clearData() {
|
|
|
this.arrList = [];
|
|
|
this.FormData.Unuselist = [];
|
|
|
this.pageNum = 1;
|
|
|
this.getUserList({
|
|
|
- QueryName: '',
|
|
|
+ QueryName: "",
|
|
|
PageSize: this.PageSize,
|
|
|
- PageIndex: this.pageNum
|
|
|
- })
|
|
|
- }
|
|
|
+ PageIndex: this.pageNum,
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|