123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <template>
- <div>
- <search-layout :needBox="true">
- <template slot="searchItem1">
- <span class="label">账户名称</span>
- <el-input
- v-model="searchParams.username"
- size="small"
- clearable
- placeholder="请输入"
- maxlength="60"
- >
- </el-input>
- </template>
- <template slot="searchItem2">
- <span class="label">登录时间</span>
- <el-date-picker
- v-model="createDate"
- type="daterange"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- >
- </el-date-picker>
- </template>
- <template slot="searchBtn1">
- <el-button type="primary" @click="doSearch">查询</el-button>
- </template>
- <template slot="searchBtn2">
- <el-button type="primary" @click="doReset">重置</el-button>
- </template>
- </search-layout>
- <tableList
- ref="table"
- style="margin: 30px"
- :columns="columns"
- :getDataWay="getDataWay"
- :pagination="pagination"
- index
- >
- </tableList>
- </div>
- </template>
- <script>
- import searchLayout from "@/components/grid/searchLayout";
- import tableList from "@/components/grid/TableList";
- export default {
- name: "loginLogManagement",
- components: { searchLayout, tableList },
- data() {
- return {
- searchParams: {
-
- username: "",
- createTimeBegin: "",
- createTimeEnd: "",
- },
- createDate: "",
- columns: [
-
- {
- label: "账户名称",
- prop: "username",
- },
- {
- label: "IP",
- prop: "ip",
- },
- {
- label: "登录状态",
- prop: "state",
- formatter: (data)=>{
- return data.state == 1 ? "成功" : "失败";
- }
- },
- {
- label: "登录时间",
- prop: "createTime",
- },
- ],
- pagination: {
-
- currentPage: 1,
- pageSize: 10,
- position: "right",
- pageSizes: [10, 30, 50, 100, 200],
- layout: "sizes, total, prev, pager, next, jumper",
- },
- getDataWay: {
-
- dataType: "url",
- type: "post",
-
- data: this.$api.systemManagement.getLoginLogPageList,
- param: {},
- },
- };
- },
- methods: {
- doSearch() {
- if (this.createDate) {
- this.searchParams.createTimeBegin = `${this.createDate[0]}`;
- this.searchParams.createTimeEnd = `${this.createDate[1]}`;
- } else {
- this.searchParams.createTimeBegin = "";
- this.searchParams.createTimeEnd = "";
- }
- let pageMap = {
- username: this.searchParams.username,
- createTimeBegin: this.searchParams.createTimeBegin,
- createTimeEnd: this.searchParams.createTimeEnd,
- };
- this.refreshList(pageMap);
- },
-
- refreshList(param) {
- param
- ? this.$refs["table"].loadData(param)
- : this.$refs["table"].loadData();
- },
- doReset() {
- this.searchParams = {
- username: "",
- createTimeBegin: "",
- createTimeEnd: "",
- };
- this.createDate = "";
- this.doSearch();
- },
- },
- mounted() {},
- };
- </script>
- <style scoped lang="less">
- </style>
|