| | |
| | | ></My-bread> |
| | | <el-divider /> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane |
| | | :label="$t('operatManage.BWL.blackList')" |
| | | :name="$t('operatManage.BWL.blackList')" |
| | | > |
| | | <el-tab-pane :label="$t('operatManage.BWL.blackList')" name="first"> |
| | | <div class="inquire"> |
| | | <el-form ref="ruleForm" :model="form" :inline="true"> |
| | | <el-form-item |
| | |
| | | > |
| | | <el-input |
| | | v-model="form.blackListIP" |
| | | :placeholder="$t('operatManage.BWL.blackListIPInfo')" |
| | | :placeholder="$t('operatManage.BWL.listIPInfo')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="onSubmit">{{ |
| | | $t("operatManage.BWL.change") |
| | | }}</el-button> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="onSubmit" |
| | | ><i class="el-icon-search"></i> {{ |
| | | $t("operatManage.BWL.change") |
| | | $t("operatManage.BWL.search") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="onSubmit" |
| | | ><i class="el-icon-delete"></i> {{ |
| | | $t("operatManage.BWL.reset") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table_box"> |
| | | <el-table :data="tableData" stripe style="width: 100%" height="99%"> |
| | | <el-table :data="BTableData" stripe style="width: 100%" height="85%"> |
| | | <el-table-column |
| | | align="center" |
| | | type="index" |
| | |
| | | width="70px" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="username" |
| | | :label="$t('operatManage.BWL.username')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="ip" |
| | | :label="$t('operatManage.BWL.ip')" |
| | | :label="$t('operatManage.BWL.whiteListIP')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="IPState" |
| | | :label="$t('operatManage.BWL.IPState')" |
| | | prop="visit" |
| | | :label="$t('operatManage.BWL.PageView')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="largeModuleName" |
| | | :label="$t('operatManage.BWL.largeModuleName')" |
| | | prop="descr" |
| | | :label="$t('operatManage.BWL.description')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="smallModuleName" |
| | | :label="$t('operatManage.BWL.smallModuleName')" |
| | | prop="createName" |
| | | :label="$t('operatManage.BWL.creator')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="resourceName" |
| | | :label="$t('operatManage.BWL.resourceName')" |
| | | :formatter="formatData" |
| | | prop="createTime" |
| | | :label="$t('operatManage.BWL.creationTime')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="date" |
| | | :label="$t('operatManage.BWL.date')" |
| | | prop="updateName" |
| | | :label="$t('operatManage.BWL.update')" |
| | | /> |
| | | <el-table-column |
| | | align="center" |
| | | prop="operationType" |
| | | :label="$t('operatManage.BWL.operationType')" |
| | | :formatter="formatData" |
| | | prop="updateTime" |
| | | :label="$t('operatManage.BWL.UpdateTime')" |
| | | /> |
| | | </el-table> |
| | | <div style="margin-top: 40px" class="pagination_box"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | @size-change="BhandleSizeChange" |
| | | @current-change="BhandleCurrentChange" |
| | | :current-page="BListData.pageIndex" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="10" |
| | | :page-size="BListData.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="9" |
| | | :total="Bcount" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane> |
| | | <el-tab-pane :label="$t('operatManage.BWL.whiteList')" name="second" |
| | | ><div class="inquire"> |
| | | <el-form ref="ruleForm" :model="form" :inline="true"> |
| | | <el-form-item |
| | | :label="$t('operatManage.BWL.whiteListIP')" |
| | | prop="whiteListIP" |
| | | > |
| | | <el-input |
| | | v-model="form.blackListIP" |
| | | :placeholder="$t('operatManage.BWL.listIPInfo')" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.BWL.IPState')" |
| | | prop="IPState" |
| | | > |
| | | <el-select v-model="form.IPState"> |
| | | <el-option :label="$t('operatManage.BWL.all')" value="0" /> |
| | | <el-option :label="$t('operatManage.BWL.validity')" value="1" /> |
| | | <el-option |
| | | :label="$t('operatManage.BWL.invalidity')" |
| | | value="2" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="onSubmit" |
| | | ><i class="el-icon-search"></i> {{ |
| | | $t("operatManage.BWL.search") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="onSubmit" |
| | | ><i class="el-icon-delete"></i> {{ |
| | | $t("operatManage.BWL.reset") |
| | | }}</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table_box"> |
| | | <el-table :data="WTableData" stripe style="width: 100%" height="85%"> |
| | | <el-table-column |
| | | align="center" |
| | | type="index" |
| | | :label="$t('operatManage.BWL.index')" |
| | | width="70px" |
| | | /> |
| | | <el-table-column |
| | | prop="ip" |
| | | :label="$t('operatManage.BWL.whiteListIP')" |
| | | /> |
| | | <el-table-column |
| | | prop="visit" |
| | | :label="$t('operatManage.BWL.PageView')" |
| | | /> |
| | | <el-table-column |
| | | prop="descr" |
| | | :label="$t('operatManage.BWL.description')" |
| | | /> |
| | | <el-table-column |
| | | prop="createName" |
| | | :label="$t('operatManage.BWL.creator')" |
| | | /> |
| | | <el-table-column |
| | | :formatter="formatData" |
| | | prop="createTime" |
| | | :label="$t('operatManage.BWL.creationTime')" |
| | | /> |
| | | <el-table-column |
| | | prop="updateName" |
| | | :label="$t('operatManage.BWL.update')" |
| | | /> |
| | | <el-table-column |
| | | :formatter="formatData" |
| | | prop="updateTime" |
| | | :label="$t('operatManage.BWL.UpdateTime')" |
| | | /> |
| | | </el-table> |
| | | <div style="margin-top: 40px" class="pagination_box"> |
| | | <el-pagination |
| | | @size-change="WhandleSizeChange" |
| | | @current-change="WhandleCurrentChange" |
| | | :current-page="WListData.pageIndex" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | :page-size="WListData.pageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="Wcount" |
| | | > |
| | | </el-pagination> |
| | | </div></div |
| | | ></el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | |
| | | import { blacklistSelectByPageAndCount } from "../../api/api"; |
| | | export default { |
| | | //import引入的组件需要注入到对象中才能使用 |
| | | components: { |
| | |
| | | |
| | | data() { |
| | | return { |
| | | activeName: this.$t("operatManage.BWL.blackList"), |
| | | activeName: "first", |
| | | currentPage: 1, |
| | | form: { |
| | | blackListIP: "", |
| | | IPState: this.$t("operatManage.BWL.all"), |
| | | IPState: "", |
| | | interceptionCycle: "", |
| | | unit: this.$t("operatManage.BWL.seconds"), |
| | | unit: "", |
| | | interceptionNumber: "", |
| | | }, |
| | | tableData: [ |
| | | { |
| | | username: "管理员", |
| | | ip: "221.182.31.12", |
| | | date: "2022-08-05", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | { |
| | | date: "2022-08-05", |
| | | username: "管理员", |
| | | IPState: "", |
| | | largeModuleName: "运维监控", |
| | | smallModuleName: "资源操作日志", |
| | | resourceName: "", |
| | | operationType: "查询", |
| | | ip: "221.182.31.12", |
| | | }, |
| | | ], |
| | | BTableData: [], |
| | | WTableData: [], |
| | | BListData: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | type: 1, |
| | | }, |
| | | WListData: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | type: 2, |
| | | }, |
| | | Wcount: 0, |
| | | Bcount: 0, |
| | | }; |
| | | }, |
| | | methods: { |
| | | //格式化时间 |
| | | add0(m) { |
| | | return m < 10 ? "0" + m : m; |
| | | }, |
| | | //格式化时间 |
| | | format(shijianchuo) { |
| | | //shijianchuo是整数,否则要parseInt转换 |
| | | var time = new Date(shijianchuo); |
| | | var y = time.getFullYear(); |
| | | var m = time.getMonth() + 1; |
| | | var d = time.getDate(); |
| | | var h = time.getHours(); |
| | | var mm = time.getMinutes(); |
| | | var s = time.getSeconds(); |
| | | return ( |
| | | y + "-" + this.add0(m) + "-" + this.add0(d) |
| | | // " " + |
| | | // this.add0(h) + |
| | | // ":" + |
| | | // this.add0(mm) + |
| | | // ":" + |
| | | // this.add0(s) |
| | | ); |
| | | }, |
| | | //格式化列表 |
| | | formatData(row, column) { |
| | | let data = row[column.property]; |
| | | if (data == null) { |
| | | return data; |
| | | } |
| | | return this.format(data); |
| | | }, |
| | | handleClick(tab, event) { |
| | | console.log(tab, event); |
| | | }, |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`); |
| | | WhandleSizeChange(val) { |
| | | this.WListData.pageSize = val; |
| | | this.getList(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | console.log(`当前页: ${val}`); |
| | | WhandleCurrentChange(val) { |
| | | this.WListData.pageIndex = val; |
| | | this.getList(); |
| | | }, |
| | | BhandleSizeChange(val) { |
| | | this.BListData.pageSize = val; |
| | | this.getList(); |
| | | }, |
| | | BhandleCurrentChange(val) { |
| | | this.BListData.pageIndex = val; |
| | | this.getList(); |
| | | }, |
| | | onSubmit() { |
| | | console.log("submit!"); |
| | |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | }, |
| | | async WGetList() { |
| | | const data = await blacklistSelectByPageAndCount(this.WListData); |
| | | |
| | | if (data.code != 200) { |
| | | return this.$message.error("列表调用失败"); |
| | | } |
| | | this.WTableData = data.result; |
| | | this.Wcount = data.count; |
| | | }, |
| | | async BGetList() { |
| | | const data = await blacklistSelectByPageAndCount(this.BListData); |
| | | console.log(data); |
| | | if (data.code != 200) { |
| | | return this.$message.error("列表调用失败"); |
| | | } |
| | | this.BTableData = data.result; |
| | | this.Bcount = data.count; |
| | | }, |
| | | }, |
| | | created() {}, |
| | | created() { |
| | | this.BGetList(); |
| | | this.WGetList(); |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="less" scoped> |
| | |
| | | background: #fff; |
| | | border-radius: 5px; |
| | | border: 1px solid rgb(202, 201, 204); |
| | | overflow: auto; |
| | | height: 70%; |
| | | } |
| | | .text-center { |
| | | text-align: center; |
| | | } |
| | | .el-tab-pane { |
| | | height: 82vh; |
| | | } |
| | | } |
| | | </style> |
| | | |