田源
2024-10-23 52874e13b27f92bc21b0a3b079077739841ebdb3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<template>
  <!--文件柜管理-->
  <basic-container>
    <avue-crud
      ref="fileCrud"
      :data="tableData"
      :option="option"
      :page.sync="page"
      :table-loading="tableLoading"
      @on-load="getTableList"
      @refresh-change="handleRefresh"
      @search-change="handleSearch"
      @search-reset="handleReset"
      @size-change="sizeChange"
      @current-change="currentChange"
    >
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="allDelHandler">导出</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
 
<script>
import basicOption from "@/util/basic-option";
import {getLogListByContion} from "@/api/system/log/logBasic";
 
export default {
  name: "index",
  data: function () {
    return {
      tableLoading: false,
      tableData: [],
      option: {
        ...basicOption,
        addBtn:false,
        editBtn: false,
        delBtn: false,
        calcHeight: -60,
        align:'left',
        headerAlign:'center',
        menu:false,
        searchMenuSpan: 6,
        searchIcon:false,
        column: [
          {
            label: '用户名',
            prop: 'truename',
            search:true,
            searchSpan: 4,
            searchLabel:'操作用户',
            type:'select',
            dicUrl:'/api/loginBasicController/getOperatingUsers',
            sortable:true,
            width: 150
          }, {
            label: '姓名',
            prop: 'username',
            sortable:true,
            width: 150
          },{
            label: '用户IP',
            prop: 'userIp',
            search:true,
            searchSpan: 4,
            sortable:true,
            width: 150
          },{
            label: '模块',
            prop: 'moduleName',
            sortable:true,
            overHidden: true,
          },{
            label: '操作',
            prop: 'type',
            sortable:true,
            width: 150
          },{
            label: '时间',
            prop: 'date',
            type:'date',
            search:true,
            searchOrder: 1,
            searchSpan: 8,
            searchRange: true,
            searchLabel:'查询日期',
            valueFormat:'yyyy-MM-dd',
            width: 160
          },{
            label: '描述',
            prop: 'result',
            overHidden: true,
            width:380,
          },
        ]
      },
      page: {
        currentPage: 1,
        pageSize: 50,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      searchParams: {}
    }
  },
  methods: {
    // 表格请求
    getTableList() {
      this.tableLoading = true;
      getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType':this.$route.query.logType,...this.searchParams}).then(res => {
        this.tableData = res.data.data;
        this.page.total = res.data.total;
        this.tableLoading = false;
      })
    },
 
    // 搜索查询
    handleSearch(params, done) {
      this.searchParams = {
        userName:params.truename,
        ipText:params.userIp,
        startDate:params.date[0],
        endDate:params.date[1]
      };
 
      this.getTableList();
      done();
    },
 
    // 重置搜索条件
    handleReset() {
      this.searchParams = {};
      this.getTableList();
    },
 
    // 条数
    sizeChange(val) {
      this.page.pageSize = val;
    },
 
    // 页码
    currentChange(val) {
      this.page.currentPage = val;
    },
 
    handleRefresh(){
      this.getTableList();
    }
  }
}
</script>
 
<style scoped>
 
</style>