|
@@ -0,0 +1,162 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main_root">
|
|
3
|
+ <div class="search_header">
|
|
4
|
+ <div class="search_left">
|
|
5
|
+ <DatePicker
|
|
6
|
+ v-model="searchForm.dataRange"
|
|
7
|
+ @on-change="searchList()"
|
|
8
|
+ :editable="false"
|
|
9
|
+ :transfer="true"
|
|
10
|
+ format="yyyy-MM-dd"
|
|
11
|
+ type="daterange"
|
|
12
|
+ placement="bottom-start"
|
|
13
|
+ placeholder="请选择日期段"
|
|
14
|
+ style="margin-right: 10px; width: 220px"
|
|
15
|
+ ></DatePicker>
|
|
16
|
+ <Input
|
|
17
|
+ v-model="searchForm.name"
|
|
18
|
+ placeholder="请输入登录名、事件"
|
|
19
|
+ search
|
|
20
|
+ @on-search="searchList()"
|
|
21
|
+ style="width: 180px"
|
|
22
|
+ />
|
|
23
|
+ </div>
|
|
24
|
+ </div>
|
|
25
|
+ <div class="table_wrap">
|
|
26
|
+ <Table :columns="columns" :data="searchForm.list"></Table>
|
|
27
|
+ </div>
|
|
28
|
+ <div class="page_wrap">
|
|
29
|
+ <Page
|
|
30
|
+ :transfer="true"
|
|
31
|
+ :total="searchForm.total"
|
|
32
|
+ :current="searchForm.page"
|
|
33
|
+ :page-size="searchForm.size"
|
|
34
|
+ :page-size-opts="[10, 20, 40, 60]"
|
|
35
|
+ @on-change="pageChange"
|
|
36
|
+ @on-page-size-change="pageSizeChange"
|
|
37
|
+ show-total
|
|
38
|
+ show-sizer
|
|
39
|
+ ></Page>
|
|
40
|
+ </div>
|
|
41
|
+ </div>
|
|
42
|
+</template>
|
|
43
|
+
|
|
44
|
+<script>
|
|
45
|
+import { dateFormat } from "@/utils";
|
|
46
|
+import { logOperate_list } from "@/api/log";
|
|
47
|
+export default {
|
|
48
|
+ data() {
|
|
49
|
+ return {
|
|
50
|
+ searchForm: {
|
|
51
|
+ dataRange: [],
|
|
52
|
+ name: "",
|
|
53
|
+ page: 1,
|
|
54
|
+ size: 10,
|
|
55
|
+ list: [],
|
|
56
|
+ total: 0
|
|
57
|
+ },
|
|
58
|
+ columns: [
|
|
59
|
+ {
|
|
60
|
+ title: "序号",
|
|
61
|
+ align: "center",
|
|
62
|
+ width: 70,
|
|
63
|
+ render: (h, params) => {
|
|
64
|
+ return h(
|
|
65
|
+ "span",
|
|
66
|
+ params.index +
|
|
67
|
+ (this.searchForm.page - 1) * this.searchForm.size +
|
|
68
|
+ 1
|
|
69
|
+ );
|
|
70
|
+ }
|
|
71
|
+ },
|
|
72
|
+ {
|
|
73
|
+ title: "登录名",
|
|
74
|
+ minWidth: 100,
|
|
75
|
+ key: "loginname",
|
|
76
|
+ align: "center"
|
|
77
|
+ },
|
|
78
|
+ {
|
|
79
|
+ title: "姓名",
|
|
80
|
+ minWidth: 80,
|
|
81
|
+ key: "aname",
|
|
82
|
+ align: "center"
|
|
83
|
+ },
|
|
84
|
+ {
|
|
85
|
+ title: "事件",
|
|
86
|
+ minWidth: 150,
|
|
87
|
+ key: "content",
|
|
88
|
+ align: "center"
|
|
89
|
+ },
|
|
90
|
+ {
|
|
91
|
+ title: "时间",
|
|
92
|
+ key: "createtime",
|
|
93
|
+ width: 190,
|
|
94
|
+ align: "center"
|
|
95
|
+ }
|
|
96
|
+ ]
|
|
97
|
+ };
|
|
98
|
+ },
|
|
99
|
+ created() {
|
|
100
|
+ this.searchList();
|
|
101
|
+ },
|
|
102
|
+ computed: {
|
|
103
|
+ powerParams() {
|
|
104
|
+ return this.$store.getters.powerParams;
|
|
105
|
+ }
|
|
106
|
+ },
|
|
107
|
+ methods: {
|
|
108
|
+ // 搜索
|
|
109
|
+ searchList() {
|
|
110
|
+ this.searchForm.page = 1;
|
|
111
|
+ this.getList();
|
|
112
|
+ },
|
|
113
|
+ // 页码改变
|
|
114
|
+ pageChange(page) {
|
|
115
|
+ this.searchForm.page = page;
|
|
116
|
+ this.getList();
|
|
117
|
+ },
|
|
118
|
+ // 每页显示数量改变
|
|
119
|
+ pageSizeChange(size) {
|
|
120
|
+ this.searchForm.size = size;
|
|
121
|
+ this.searchForm.page = 1;
|
|
122
|
+ this.getList();
|
|
123
|
+ },
|
|
124
|
+ // 获取列表
|
|
125
|
+ getList() {
|
|
126
|
+ let _begindate = this.searchForm.dataRange[0];
|
|
127
|
+ _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
|
|
128
|
+ let _enddate = this.searchForm.dataRange[1];
|
|
129
|
+ _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
|
|
130
|
+ logOperate_list({
|
|
131
|
+ // rtype: this.powerParams.rtype,
|
|
132
|
+ page: this.searchForm.page,
|
|
133
|
+ size: this.searchForm.size,
|
|
134
|
+ begindate: _begindate,
|
|
135
|
+ enddate: _enddate,
|
|
136
|
+ name: this.searchForm.name
|
|
137
|
+ }).then((data) => {
|
|
138
|
+ if (data.code === 0) {
|
|
139
|
+ this.searchForm.list = data.obj.data;
|
|
140
|
+ this.searchForm.total = data.obj.total;
|
|
141
|
+ } else {
|
|
142
|
+ this.$Message.error(data.msg);
|
|
143
|
+ }
|
|
144
|
+ });
|
|
145
|
+ }
|
|
146
|
+ }
|
|
147
|
+};
|
|
148
|
+</script>
|
|
149
|
+
|
|
150
|
+<style lang="less" scoped>
|
|
151
|
+.search_header {
|
|
152
|
+ display: flex;
|
|
153
|
+ justify-content: space-between;
|
|
154
|
+ align-items: center;
|
|
155
|
+ margin: 16px 16px;
|
|
156
|
+ .search_left {
|
|
157
|
+ display: flex;
|
|
158
|
+ justify-content: flex-start;
|
|
159
|
+ align-items: center;
|
|
160
|
+ }
|
|
161
|
+}
|
|
162
|
+</style>
|