|
@@ -3,7 +3,7 @@
|
3
|
3
|
<div class="personal_list">
|
4
|
4
|
<div class="personal_item" v-for="item in personal_list" :key="item.id">
|
5
|
5
|
<div
|
6
|
|
- @click="curmodel = item.id"
|
|
6
|
+ @click="toggle(item.id)"
|
7
|
7
|
:class="[curmodel === item.id ? 'active' : '']"
|
8
|
8
|
>
|
9
|
9
|
{{ item.title }}
|
|
@@ -11,15 +11,104 @@
|
11
|
11
|
</div>
|
12
|
12
|
</div>
|
13
|
13
|
<div class="contents" v-if="curmodel === 1">
|
14
|
|
- <div class="user"></div>
|
15
|
|
- <div class="comm"></div>
|
|
14
|
+ <div class="user">
|
|
15
|
+ <div class="head">
|
|
16
|
+ <img src="../../assets/img/user.png" />
|
|
17
|
+ </div>
|
|
18
|
+ <div class="username">
|
|
19
|
+ <p>{{ personalInfo.aname }}</p>
|
|
20
|
+ <div>
|
|
21
|
+ 登录名<span>{{ personalInfo.loginname }}</span> 角色<span>{{
|
|
22
|
+ personalInfo.atype === 1
|
|
23
|
+ ? "平台管理员"
|
|
24
|
+ : personalInfo.atype === 2
|
|
25
|
+ ? "区域管理员"
|
|
26
|
+ : "学校管理员"
|
|
27
|
+ }}</span>
|
|
28
|
+ 手机号<span>{{ personalInfo.phone }}</span>
|
|
29
|
+ </div>
|
|
30
|
+ </div>
|
|
31
|
+ </div>
|
|
32
|
+ <div class="comm">
|
|
33
|
+ <div class="com">
|
|
34
|
+ <span>创建时间</span>{{ personalInfo.createtime }}
|
|
35
|
+ <span style="margin-left: 20px">更新时间</span
|
|
36
|
+ >{{ personalInfo.updatetime }}
|
|
37
|
+ </div>
|
|
38
|
+ <div class="com">
|
|
39
|
+ <span>最后登录时间</span>{{ personalInfo.lasttime }}
|
|
40
|
+ <span style="margin-left: 20px">最后登录IP</span
|
|
41
|
+ >{{ personalInfo.lastip }}
|
|
42
|
+ </div>
|
|
43
|
+ <div class="com">
|
|
44
|
+ <span style="width: 50px">描述</span>{{ personalInfo.comm }}
|
|
45
|
+ </div>
|
|
46
|
+ </div>
|
|
47
|
+ </div>
|
|
48
|
+ <div class="content" v-else-if="curmodel === 2">
|
|
49
|
+ <div class="search_header">
|
|
50
|
+ <div class="search_left">
|
|
51
|
+ <DatePicker
|
|
52
|
+ v-model="searchForm.dataRange"
|
|
53
|
+ @on-change="searchList()"
|
|
54
|
+ :editable="false"
|
|
55
|
+ :transfer="true"
|
|
56
|
+ format="yyyy-MM-dd"
|
|
57
|
+ type="daterange"
|
|
58
|
+ placement="bottom-start"
|
|
59
|
+ placeholder="请选择时间段"
|
|
60
|
+ style="margin-right: 10px; width: 220px"
|
|
61
|
+ ></DatePicker>
|
|
62
|
+ <Input
|
|
63
|
+ v-model="searchForm.name"
|
|
64
|
+ placeholder="请输入事件、名称"
|
|
65
|
+ search
|
|
66
|
+ @on-search="searchList()"
|
|
67
|
+ style="width: 180px"
|
|
68
|
+ />
|
|
69
|
+ </div>
|
|
70
|
+ </div>
|
|
71
|
+ <div class="table_wrap">
|
|
72
|
+ <Table :columns="columns" :data="searchForm.list"></Table>
|
|
73
|
+ </div>
|
|
74
|
+ <div class="page_wrap">
|
|
75
|
+ <Page
|
|
76
|
+ :transfer="true"
|
|
77
|
+ :total="searchForm.total"
|
|
78
|
+ :current="searchForm.page"
|
|
79
|
+ :page-size="searchForm.size"
|
|
80
|
+ :page-size-opts="[10, 20, 40, 60]"
|
|
81
|
+ @on-change="pageChange"
|
|
82
|
+ @on-page-size-change="pageSizeChange"
|
|
83
|
+ show-total
|
|
84
|
+ show-sizer
|
|
85
|
+ ></Page>
|
|
86
|
+ </div>
|
|
87
|
+ </div>
|
|
88
|
+ <div class="content" style="padding-top: 16px" v-else>
|
|
89
|
+ <div class="table_wrap">
|
|
90
|
+ <Table :columns="columns1" :data="searchForm.list"></Table>
|
|
91
|
+ </div>
|
|
92
|
+ <div class="page_wrap">
|
|
93
|
+ <Page
|
|
94
|
+ :transfer="true"
|
|
95
|
+ :total="searchForm.total"
|
|
96
|
+ :current="searchForm.page"
|
|
97
|
+ :page-size="searchForm.size"
|
|
98
|
+ :page-size-opts="[10, 20, 40, 60]"
|
|
99
|
+ @on-change="pageChange"
|
|
100
|
+ @on-page-size-change="pageSizeChange"
|
|
101
|
+ show-total
|
|
102
|
+ show-sizer
|
|
103
|
+ ></Page>
|
|
104
|
+ </div>
|
16
|
105
|
</div>
|
17
|
|
- <div class="content" v-else></div>
|
18
|
106
|
</div>
|
19
|
107
|
</template>
|
20
|
108
|
|
21
|
109
|
<script>
|
22
|
|
-import { admin_detail } from "@/api/admin";
|
|
110
|
+import { admin_detail, admin_list_lr, admin_list_re } from "@/api/admin";
|
|
111
|
+import { dateFormat } from "@/utils";
|
23
|
112
|
|
24
|
113
|
export default {
|
25
|
114
|
data() {
|
|
@@ -39,7 +128,78 @@ export default {
|
39
|
128
|
}
|
40
|
129
|
],
|
41
|
130
|
curmodel: 1,
|
42
|
|
- userInfo: {}
|
|
131
|
+ personalInfo: {},
|
|
132
|
+ searchForm: {
|
|
133
|
+ dataRange: [],
|
|
134
|
+ name: "",
|
|
135
|
+ page: 1,
|
|
136
|
+ size: 10,
|
|
137
|
+ list: [],
|
|
138
|
+ total: 0
|
|
139
|
+ },
|
|
140
|
+ userInfo: {},
|
|
141
|
+ columns: [
|
|
142
|
+ {
|
|
143
|
+ title: "序号",
|
|
144
|
+ align: "center",
|
|
145
|
+ width: 70,
|
|
146
|
+ render: (h, params) => {
|
|
147
|
+ return h(
|
|
148
|
+ "span",
|
|
149
|
+ params.index +
|
|
150
|
+ (this.searchForm.page - 1) * this.searchForm.size +
|
|
151
|
+ 1
|
|
152
|
+ );
|
|
153
|
+ }
|
|
154
|
+ },
|
|
155
|
+ {
|
|
156
|
+ title: "登录名",
|
|
157
|
+ key: "loginname",
|
|
158
|
+ align: "center"
|
|
159
|
+ },
|
|
160
|
+ {
|
|
161
|
+ title: "事件",
|
|
162
|
+ key: "content",
|
|
163
|
+ align: "center"
|
|
164
|
+ },
|
|
165
|
+ {
|
|
166
|
+ title: "时间",
|
|
167
|
+ key: "createtime",
|
|
168
|
+ width: 190,
|
|
169
|
+ align: "center"
|
|
170
|
+ }
|
|
171
|
+ ],
|
|
172
|
+ columns1: [
|
|
173
|
+ {
|
|
174
|
+ title: "序号",
|
|
175
|
+ align: "center",
|
|
176
|
+ width: 70,
|
|
177
|
+ render: (h, params) => {
|
|
178
|
+ return h(
|
|
179
|
+ "span",
|
|
180
|
+ params.index +
|
|
181
|
+ (this.searchForm.page - 1) * this.searchForm.size +
|
|
182
|
+ 1
|
|
183
|
+ );
|
|
184
|
+ }
|
|
185
|
+ },
|
|
186
|
+ {
|
|
187
|
+ title: "登录IP",
|
|
188
|
+ key: "ip",
|
|
189
|
+ align: "center"
|
|
190
|
+ },
|
|
191
|
+ {
|
|
192
|
+ title: "地址",
|
|
193
|
+ key: "ipAddress",
|
|
194
|
+ align: "center"
|
|
195
|
+ },
|
|
196
|
+ {
|
|
197
|
+ title: "登录时间",
|
|
198
|
+ key: "createtime",
|
|
199
|
+ width: 190,
|
|
200
|
+ align: "center"
|
|
201
|
+ }
|
|
202
|
+ ]
|
43
|
203
|
};
|
44
|
204
|
},
|
45
|
205
|
created() {
|
|
@@ -54,9 +214,71 @@ export default {
|
54
|
214
|
}
|
55
|
215
|
},
|
56
|
216
|
methods: {
|
|
217
|
+ toggle(type) {
|
|
218
|
+ this.curmodel = type;
|
|
219
|
+ if (type === 1) {
|
|
220
|
+ this.getPersonal();
|
|
221
|
+ } else {
|
|
222
|
+ this.searchForm.size = 10;
|
|
223
|
+ this.searchForm.page = 1;
|
|
224
|
+ this.searchList();
|
|
225
|
+ }
|
|
226
|
+ },
|
|
227
|
+ // 搜索
|
|
228
|
+ searchList() {
|
|
229
|
+ this.searchForm.page = 1;
|
|
230
|
+ this.getEvent();
|
|
231
|
+ },
|
|
232
|
+ // 页码改变
|
|
233
|
+ pageChange(page) {
|
|
234
|
+ this.searchForm.page = page;
|
|
235
|
+ this.getEvent();
|
|
236
|
+ },
|
|
237
|
+ // 每页显示数量改变
|
|
238
|
+ pageSizeChange(size) {
|
|
239
|
+ this.searchForm.size = size;
|
|
240
|
+ this.searchForm.page = 1;
|
|
241
|
+ this.getEvent();
|
|
242
|
+ },
|
|
243
|
+ async getEvent() {
|
|
244
|
+ console.log(this.userInfo);
|
|
245
|
+ let res = {
|
|
246
|
+ code: null
|
|
247
|
+ };
|
|
248
|
+ if (this.curmodel === 2) {
|
|
249
|
+ let _begindate = this.searchForm.dataRange[0];
|
|
250
|
+ _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
|
|
251
|
+ let _enddate = this.searchForm.dataRange[1];
|
|
252
|
+ _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
|
|
253
|
+ res = await admin_list_re({
|
|
254
|
+ objectid: this.userInfo.adminid,
|
|
255
|
+ begindate: _begindate,
|
|
256
|
+ enddate: _enddate,
|
|
257
|
+ name: this.searchForm.name,
|
|
258
|
+ page: this.searchForm.page,
|
|
259
|
+ size: this.searchForm.size
|
|
260
|
+ });
|
|
261
|
+ } else {
|
|
262
|
+ res = await admin_list_lr({
|
|
263
|
+ objectid: this.userInfo.adminid,
|
|
264
|
+ page: this.searchForm.page,
|
|
265
|
+ size: this.searchForm.size
|
|
266
|
+ });
|
|
267
|
+ }
|
|
268
|
+
|
|
269
|
+ if (res.code === 0) {
|
|
270
|
+ this.searchForm.list = res.obj.data;
|
|
271
|
+ console.log(this.searchForm.list);
|
|
272
|
+ this.searchForm.total = res.obj.total;
|
|
273
|
+ } else {
|
|
274
|
+ this.$Message.error(res.msg);
|
|
275
|
+ }
|
|
276
|
+ },
|
57
|
277
|
getPersonal() {
|
58
|
|
- admin_detail({ adminid: this.userInfo.user }).then((res) => {
|
|
278
|
+ console.log(this.userInfo);
|
|
279
|
+ admin_detail({ adminid: this.userInfo.adminid }).then((res) => {
|
59
|
280
|
if (res.code === 0) {
|
|
281
|
+ this.personalInfo = res.obj;
|
60
|
282
|
console.log(res.obj);
|
61
|
283
|
} else {
|
62
|
284
|
this.$Message.error(res.msg);
|
|
@@ -100,20 +322,85 @@ export default {
|
100
|
322
|
border-radius: 15px;
|
101
|
323
|
background: white;
|
102
|
324
|
margin-bottom: 20px;
|
|
325
|
+ display: flex;
|
|
326
|
+ align-items: center;
|
|
327
|
+ .head {
|
|
328
|
+ width: 100px;
|
|
329
|
+ height: 100px;
|
|
330
|
+ margin: 0 40px;
|
|
331
|
+ border-radius: 16px;
|
|
332
|
+ overflow: hidden;
|
|
333
|
+ border: 2px solid #ffffff;
|
|
334
|
+ box-shadow: 0 6px 14px 0 #dce0e880;
|
|
335
|
+ img {
|
|
336
|
+ width: 100%;
|
|
337
|
+ height: 100%;
|
|
338
|
+ object-fit: cover;
|
|
339
|
+ }
|
|
340
|
+ }
|
|
341
|
+ .username {
|
|
342
|
+ p {
|
|
343
|
+ color: #253a70;
|
|
344
|
+ font-size: 20px;
|
|
345
|
+ font-weight: 500;
|
|
346
|
+ font-family: "SourceHanSansCN";
|
|
347
|
+ text-align: left;
|
|
348
|
+ line-height: 50px;
|
|
349
|
+ }
|
|
350
|
+ div {
|
|
351
|
+ color: #7c8db5;
|
|
352
|
+ font-size: 16px;
|
|
353
|
+ font-weight: 400;
|
|
354
|
+ font-family: "SourceHanSansCN";
|
|
355
|
+ line-height: 50px;
|
|
356
|
+ span {
|
|
357
|
+ color: #253a70;
|
|
358
|
+ display: inline-block;
|
|
359
|
+ margin: 0 20px;
|
|
360
|
+ }
|
|
361
|
+ }
|
|
362
|
+ }
|
103
|
363
|
}
|
104
|
364
|
.comm {
|
105
|
365
|
height: calc(100% - 220px);
|
106
|
366
|
border-radius: 15px;
|
107
|
367
|
background: white;
|
108
|
368
|
margin-bottom: 20px;
|
|
369
|
+ padding: 40px;
|
|
370
|
+ .com {
|
|
371
|
+ line-height: 30px;
|
|
372
|
+ color: #253a70;
|
|
373
|
+ font-size: 16px;
|
|
374
|
+ font-weight: 400;
|
|
375
|
+ margin-bottom: 10px;
|
|
376
|
+ font-family: "SourceHanSansCN";
|
|
377
|
+ span {
|
|
378
|
+ color: #7c8db5;
|
|
379
|
+ display: inline-block;
|
|
380
|
+ width: 100px;
|
|
381
|
+ margin-right: 20px;
|
|
382
|
+ }
|
|
383
|
+ }
|
109
|
384
|
}
|
110
|
385
|
}
|
111
|
386
|
.content {
|
112
|
387
|
width: calc(100% - 220px);
|
113
|
388
|
height: 100%;
|
|
389
|
+ overflow-y: auto;
|
114
|
390
|
border-radius: 15px;
|
115
|
391
|
border: 1px solid #e9f0f9;
|
116
|
392
|
background: #ffffff;
|
|
393
|
+ .search_header {
|
|
394
|
+ display: flex;
|
|
395
|
+ justify-content: space-between;
|
|
396
|
+ align-items: center;
|
|
397
|
+ margin: 16px 16px;
|
|
398
|
+ .search_left {
|
|
399
|
+ display: flex;
|
|
400
|
+ justify-content: flex-start;
|
|
401
|
+ align-items: center;
|
|
402
|
+ }
|
|
403
|
+ }
|
117
|
404
|
}
|
118
|
405
|
}
|
119
|
406
|
</style>
|