Browse Source

Merge remote-tracking branch 'origin/gzb' into wzl

gzb
wangzhonglu 9 months ago
parent
commit
c9ad2f4b9b

+ 10
- 0
src/router/platform.js View File

@@ -21,6 +21,16 @@ export default {
21 21
         title: "平台管控-首页"
22 22
       }
23 23
     },
24
+    {
25
+      path: "personal",
26
+      component: () => import("@/views/regionSection/personal.vue"),
27
+      name: "personal",
28
+      meta: {
29
+        keepAlive: true,
30
+        isAuth: true,
31
+        title: "平台管控-个人中心"
32
+      }
33
+    },
24 34
     {
25 35
       path: "regionManage",
26 36
       component: () =>

+ 10
- 0
src/router/region.js View File

@@ -21,6 +21,16 @@ export default {
21 21
         title: "区域管控-个人中心"
22 22
       }
23 23
     },
24
+    {
25
+      path: "logdoperatemsg",
26
+      component: () => import("@/views/regionSection/logdoperatemsg.vue"),
27
+      name: "logdoperatemsg",
28
+      meta: {
29
+        keepAlive: true,
30
+        isAuth: true,
31
+        title: "区域管控-消息"
32
+      }
33
+    },
24 34
     {
25 35
       path: "home",
26 36
       component: () => import("@/views/regionSection/home/index.vue"),

+ 20
- 0
src/router/school.js View File

@@ -21,6 +21,26 @@ export default {
21 21
         title: "学校管控-首页"
22 22
       }
23 23
     },
24
+    {
25
+      path: "personal",
26
+      component: () => import("@/views/regionSection/personal.vue"),
27
+      name: "personal",
28
+      meta: {
29
+        keepAlive: true,
30
+        isAuth: true,
31
+        title: "学校管控-个人中心"
32
+      }
33
+    },
34
+    {
35
+      path: "logdoperatemsg",
36
+      component: () => import("@/views/regionSection/logdoperatemsg.vue"),
37
+      name: "logdoperatemsg",
38
+      meta: {
39
+        keepAlive: true,
40
+        isAuth: true,
41
+        title: "学校管控-消息"
42
+      }
43
+    },
24 44
     {
25 45
       path: "applicationList",
26 46
       component: () =>

+ 28
- 6
src/views/layout.vue View File

@@ -15,10 +15,11 @@
15 15
         <div style="margin-right: 10px" v-else-if="powerParams.rtype === 3">
16 16
           所属学校【{{ belongName }}】
17 17
         </div>
18
-        <div class="dope" v-if="powerParams.rtype != 1">
19
-          <img @click="headerDope" class="img1" src="../assets/img/dope.png" />
20
-          <img class="img2" src="../assets/img/Ellipse.png" />
21
-          <span class="dopenum">99</span>
18
+        <div class="dope" @click="headerDope" v-if="powerParams.rtype != 1">
19
+          <img class="img1" src="../assets/img/dope.png" />
20
+          <div class="img2">
21
+            {{ nreadNum }}
22
+          </div>
22 23
         </div>
23 24
         <Dropdown
24 25
           :transfer="true"
@@ -159,6 +160,7 @@
159 160
 <script>
160 161
 import { admin_detail, admin_edit_phone, admin_edit_pwd } from "@/api/admin";
161 162
 import { login_msg_code } from "@/api/login";
163
+import { logdoperatemsg_get_nrn } from "@/api/log";
162 164
 
163 165
 export default {
164 166
   data() {
@@ -183,6 +185,7 @@ export default {
183 185
     return {
184 186
       showLoading: false,
185 187
       userDropdown: false,
188
+      nreadNum: 0,
186 189
       pwInfo: {
187 190
         show: false,
188 191
         adminid: "",
@@ -230,6 +233,7 @@ export default {
230 233
     this.userInfo = JSON.parse(
231 234
       localStorage.getItem("xh_control_userInfo")
232 235
     ).content;
236
+    this.init();
233 237
   },
234 238
   computed: {
235 239
     // 所属名称
@@ -242,8 +246,20 @@ export default {
242 246
     }
243 247
   },
244 248
   methods: {
245
-    headerDope(){
246
-
249
+    init() {
250
+      logdoperatemsg_get_nrn({
251
+        rtype: this.powerParams.rtype,
252
+        objectid: this.powerParams.objectid
253
+      }).then((res) => {
254
+        if (res.code === 0) {
255
+          this.nreadNum = res.obj >= 100 ? 99 : res.obj;
256
+        } else {
257
+          this.$Message.error(res.msg);
258
+        }
259
+      });
260
+    },
261
+    headerDope() {
262
+      this.$router.push("logdoperatemsg");
247 263
     },
248 264
     // 获取短信验证码
249 265
     getMsgCode() {
@@ -448,6 +464,12 @@ export default {
448 464
         position: absolute;
449 465
         right: -1px;
450 466
         top: -4px;
467
+        text-align: center;
468
+        line-height: 18px;
469
+        font-size: 12px;
470
+        color: white;
471
+        background: url("../assets/img/Ellipse.png") no-repeat;
472
+        background-size: 100% 100%;
451 473
       }
452 474
       .dopenum {
453 475
         color: white;

+ 413
- 0
src/views/platformSection/personal.vue View File

@@ -0,0 +1,413 @@
1
+<template>
2
+  <div class="main_root">
3
+    <div class="personal_list">
4
+      <div class="personal_item" v-for="item in personal_list" :key="item.id">
5
+        <div
6
+          @click="toggle(item.id)"
7
+          :class="[curmodel === item.id ? 'active' : '']"
8
+        >
9
+          {{ item.title }}
10
+        </div>
11
+      </div>
12
+    </div>
13
+    <div class="contents" v-if="curmodel === 1">
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">
73
+        </Table>
74
+      </div>
75
+      <div class="page_wrap">
76
+        <Page
77
+          :transfer="true"
78
+          :total="searchForm.total"
79
+          :current="searchForm.page"
80
+          :page-size="searchForm.size"
81
+          :page-size-opts="[10, 20, 40, 60]"
82
+          @on-change="pageChange"
83
+          @on-page-size-change="pageSizeChange"
84
+          show-total
85
+          show-sizer
86
+        ></Page>
87
+      </div>
88
+    </div>
89
+    <div class="content" style="padding-top: 16px" v-else>
90
+      <div class="table_wrap">
91
+        <Table :columns="columns1" :data="searchForm.list"></Table>
92
+      </div>
93
+      <div class="page_wrap">
94
+        <Page
95
+          :transfer="true"
96
+          :total="searchForm.total"
97
+          :current="searchForm.page"
98
+          :page-size="searchForm.size"
99
+          :page-size-opts="[10, 20, 40, 60]"
100
+          @on-change="pageChange"
101
+          @on-page-size-change="pageSizeChange"
102
+          show-total
103
+          show-sizer
104
+        ></Page>
105
+      </div>
106
+    </div>
107
+  </div>
108
+</template>
109
+
110
+<script>
111
+import { admin_detail, admin_list_lr, admin_list_re } from "@/api/admin";
112
+import { dateFormat } from "@/utils";
113
+
114
+export default {
115
+  data() {
116
+    return {
117
+      personal_list: [
118
+        {
119
+          id: 1,
120
+          title: "个人信息"
121
+        },
122
+        {
123
+          id: 2,
124
+          title: "最近事件"
125
+        },
126
+        {
127
+          id: 3,
128
+          title: "历史登录"
129
+        }
130
+      ],
131
+      curmodel: 1,
132
+      personalInfo: {},
133
+      searchForm: {
134
+        dataRange: [],
135
+        name: "",
136
+        page: 1,
137
+        size: 10,
138
+        list: [],
139
+        total: 0
140
+      },
141
+      userInfo: {},
142
+      columns: [
143
+        {
144
+          title: "序号",
145
+          align: "center",
146
+          width: 70,
147
+          render: (h, params) => {
148
+            return h(
149
+              "span",
150
+              params.index +
151
+                (this.searchForm.page - 1) * this.searchForm.size +
152
+                1
153
+            );
154
+          }
155
+        },
156
+        {
157
+          title: "登录名",
158
+          key: "loginname",
159
+          align: "center"
160
+        },
161
+        {
162
+          title: "所属模块",
163
+          key: "logmodel",
164
+          align: "center"
165
+        },
166
+        {
167
+          title: "模块操作",
168
+          key: "logaction",
169
+          align: "center"
170
+        },
171
+        {
172
+          title: "日志内容",
173
+          key: "content",
174
+          align: "center"
175
+        },
176
+        {
177
+          title: "时间",
178
+          key: "createtime",
179
+          width: 190,
180
+          align: "center"
181
+        }
182
+      ],
183
+      columns1: [
184
+        {
185
+          title: "序号",
186
+          align: "center",
187
+          width: 70,
188
+          render: (h, params) => {
189
+            return h(
190
+              "span",
191
+              params.index +
192
+                (this.searchForm.page - 1) * this.searchForm.size +
193
+                1
194
+            );
195
+          }
196
+        },
197
+        {
198
+          title: "登录IP",
199
+          key: "ip",
200
+          align: "center"
201
+        },
202
+        {
203
+          title: "地址",
204
+          key: "ipAddress",
205
+          align: "center"
206
+        },
207
+        {
208
+          title: "登录时间",
209
+          key: "createtime",
210
+          width: 190,
211
+          align: "center"
212
+        }
213
+      ]
214
+    };
215
+  },
216
+  created() {
217
+    this.userInfo = JSON.parse(
218
+      localStorage.getItem("xh_control_userInfo")
219
+    ).content;
220
+    this.getPersonal();
221
+  },
222
+  computed: {
223
+    powerParams() {
224
+      return this.$store.getters.powerParams;
225
+    }
226
+  },
227
+  methods: {
228
+    toggle(type) {
229
+      this.curmodel = type;
230
+      if (type === 1) {
231
+        this.getPersonal();
232
+      } else {
233
+        this.searchForm.size = 10;
234
+        this.searchForm.page = 1;
235
+        this.searchList();
236
+      }
237
+    },
238
+    // 搜索
239
+    searchList() {
240
+      this.searchForm.page = 1;
241
+      this.getEvent();
242
+    },
243
+    // 页码改变
244
+    pageChange(page) {
245
+      this.searchForm.page = page;
246
+      this.getEvent();
247
+    },
248
+    // 每页显示数量改变
249
+    pageSizeChange(size) {
250
+      this.searchForm.size = size;
251
+      this.searchForm.page = 1;
252
+      this.getEvent();
253
+    },
254
+    async getEvent() {
255
+      let res = {
256
+        code: null
257
+      };
258
+      if (this.curmodel === 2) {
259
+        let _begindate = this.searchForm.dataRange[0];
260
+        _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
261
+        let _enddate = this.searchForm.dataRange[1];
262
+        _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
263
+        res = await admin_list_re({
264
+          objectid: this.userInfo.adminid,
265
+          begindate: _begindate,
266
+          enddate: _enddate,
267
+          name: this.searchForm.name,
268
+          page: this.searchForm.page,
269
+          size: this.searchForm.size
270
+        });
271
+      } else {
272
+        res = await admin_list_lr({
273
+          objectid: this.userInfo.adminid,
274
+          page: this.searchForm.page,
275
+          size: this.searchForm.size
276
+        });
277
+      }
278
+
279
+      if (res.code === 0) {
280
+        this.searchForm.list = res.obj.data;
281
+        this.searchForm.total = res.obj.total;
282
+      } else {
283
+        this.$Message.error(res.msg);
284
+      }
285
+    },
286
+    getPersonal() {
287
+      admin_detail({ adminid: this.userInfo.adminid }).then((res) => {
288
+        if (res.code === 0) {
289
+          this.personalInfo = res.obj;
290
+        } else {
291
+          this.$Message.error(res.msg);
292
+        }
293
+      });
294
+    }
295
+  }
296
+};
297
+</script>
298
+
299
+<style lang="less" scoped>
300
+.main_root {
301
+  background-color: transparent;
302
+  border: navajowhite;
303
+  height: calc(100% - 20px);
304
+  display: flex;
305
+  .personal_list {
306
+    width: 200px;
307
+    height: 100%;
308
+    border-radius: 15px;
309
+    padding: 20px 10px;
310
+    border: 1px solid #e9f0f9;
311
+    background: #ffffff;
312
+    margin-right: 20px;
313
+    .personal_item {
314
+      line-height: 30px;
315
+      text-align: center;
316
+      cursor: pointer;
317
+    }
318
+    .active {
319
+      border-radius: 6px;
320
+      background: #339dff;
321
+      color: white;
322
+    }
323
+  }
324
+  .contents {
325
+    width: calc(100% - 220px);
326
+    height: 100%;
327
+    .user {
328
+      height: 200px;
329
+      border-radius: 15px;
330
+      background: white;
331
+      margin-bottom: 20px;
332
+      display: flex;
333
+      align-items: center;
334
+      .head {
335
+        width: 100px;
336
+        height: 100px;
337
+        margin: 0 40px;
338
+        border-radius: 16px;
339
+        overflow: hidden;
340
+        border: 2px solid #ffffff;
341
+        box-shadow: 0 6px 14px 0 #dce0e880;
342
+        img {
343
+          width: 100%;
344
+          height: 100%;
345
+          object-fit: cover;
346
+        }
347
+      }
348
+      .username {
349
+        p {
350
+          color: #253a70;
351
+          font-size: 20px;
352
+          font-weight: 500;
353
+          font-family: "SourceHanSansCN";
354
+          text-align: left;
355
+          line-height: 50px;
356
+        }
357
+        div {
358
+          color: #7c8db5;
359
+          font-size: 16px;
360
+          font-weight: 400;
361
+          font-family: "SourceHanSansCN";
362
+          line-height: 50px;
363
+          span {
364
+            color: #253a70;
365
+            display: inline-block;
366
+            margin: 0 20px;
367
+          }
368
+        }
369
+      }
370
+    }
371
+    .comm {
372
+      height: calc(100% - 220px);
373
+      border-radius: 15px;
374
+      background: white;
375
+      margin-bottom: 20px;
376
+      padding: 40px;
377
+      .com {
378
+        line-height: 30px;
379
+        color: #253a70;
380
+        font-size: 16px;
381
+        font-weight: 400;
382
+        margin-bottom: 10px;
383
+        font-family: "SourceHanSansCN";
384
+        span {
385
+          color: #7c8db5;
386
+          display: inline-block;
387
+          width: 100px;
388
+          margin-right: 20px;
389
+        }
390
+      }
391
+    }
392
+  }
393
+  .content {
394
+    width: calc(100% - 220px);
395
+    height: 100%;
396
+    overflow-y: auto;
397
+    border-radius: 15px;
398
+    border: 1px solid #e9f0f9;
399
+    background: #ffffff;
400
+    .search_header {
401
+      display: flex;
402
+      justify-content: space-between;
403
+      align-items: center;
404
+      margin: 16px 16px;
405
+      .search_left {
406
+        display: flex;
407
+        justify-content: flex-start;
408
+        align-items: center;
409
+      }
410
+    }
411
+  }
412
+}
413
+</style>

+ 262
- 0
src/views/regionSection/logdoperatemsg.vue View File

@@ -0,0 +1,262 @@
1
+<template>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Input
6
+          v-model="searchForm.name"
7
+          placeholder="请输入姓名、账号、设备号"
8
+          search
9
+          @on-search="searchList()"
10
+          style="width: 240px; margin-right: 20px"
11
+        />
12
+        <Checkbox @on-change="showReadChange" v-model="searchForm.showRead"
13
+          >只显示未读</Checkbox
14
+        >
15
+      </div>
16
+    </div>
17
+    <div class="table_wrap">
18
+      <div class="log_list" v-for="item in searchForm.list" :key="item.doid">
19
+        <div class="username" @click="headleView(item)">
20
+          {{ item.classname }} 【{{ item.username }}】<span
21
+            :class="[item.hasread === 1 ? 'active' : '']"
22
+            >{{ item.hasread === 1 ? "已读" : "未读" }}</span
23
+          >
24
+        </div>
25
+        <div class="comm">{{ item.comm }}</div>
26
+        <div class="school">
27
+          学校:<span>{{ item.schoolName }}</span> 设备号:<span>{{
28
+            item.sn
29
+          }}</span>
30
+          时间:<span>{{ item.createtime }}</span>
31
+        </div>
32
+      </div>
33
+      <div class="nodeta" v-if="searchForm.list.length === 0">暂无数据</div>
34
+    </div>
35
+    <div class="page_wrap" v-if="searchForm.list.length > 0">
36
+      <Page
37
+        :transfer="true"
38
+        :total="searchForm.total"
39
+        :current="searchForm.page"
40
+        :page-size="searchForm.size"
41
+        :page-size-opts="[10, 20, 40, 60]"
42
+        @on-change="pageChange"
43
+        @on-page-size-change="pageSizeChange"
44
+        show-total
45
+        show-sizer
46
+      ></Page>
47
+    </div>
48
+    <!-- 查看 -->
49
+    <Modal
50
+      class="modal1"
51
+      :mask-closable="false"
52
+      v-model="viewInfo.show"
53
+      title="查看"
54
+    >
55
+      <div>
56
+        <div class="username">
57
+          {{ viewInfo.classname }} 【{{ viewInfo.username }}】
58
+        </div>
59
+        <div class="school">
60
+          学校:<span style="margin-right: 20px">{{
61
+            viewInfo.schoolName
62
+          }}</span>
63
+          时间:{{ viewInfo.createtime }}
64
+        </div>
65
+        <div class="comm">{{ viewInfo.comm }}</div>
66
+        <div class="comm">设备号:{{ viewInfo.sn }}</div>
67
+      </div>
68
+      <div slot="footer" style="text-align: center">
69
+        <div>
70
+          <Button @click="viewInfo.show = false">关闭</Button>
71
+        </div>
72
+      </div>
73
+    </Modal>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import { logdoperatemsg_edit_read, logdoperatemsg_list } from "@/api/log";
79
+
80
+export default {
81
+  data() {
82
+    return {
83
+      searchForm: {
84
+        showRead: 0,
85
+        name: "",
86
+        page: 1,
87
+        size: 10,
88
+        list: [],
89
+        total: 0
90
+      },
91
+      viewInfo: {
92
+        show: false
93
+      },
94
+      userInfo: {}
95
+    };
96
+  },
97
+  created() {
98
+    this.userInfo = JSON.parse(
99
+      localStorage.getItem("xh_control_userInfo")
100
+    ).content;
101
+    this.searchList();
102
+  },
103
+  computed: {
104
+    powerParams() {
105
+      return this.$store.getters.powerParams;
106
+    }
107
+  },
108
+  methods: {
109
+    headleView(item) {
110
+      logdoperatemsg_edit_read({ ldomid: item.ldomid }).then((res) => {
111
+        if (res.code === 0) {
112
+          this.searchForm.list.forEach((v) => {
113
+            if (item.ldomid === v.ldomid) {
114
+              //改状态为已读
115
+              v.hasread = 1;
116
+            }
117
+          });
118
+          this.viewInfo = {
119
+            show: true,
120
+            classname: item.classname,
121
+            username: item.username,
122
+            schoolName: item.schoolName,
123
+            createtime: item.createtime,
124
+            comm: item.comm,
125
+            sn: item.sn
126
+          };
127
+        } else {
128
+          this.$Message.error(res.msg);
129
+        }
130
+      });
131
+    },
132
+    showReadChange() {
133
+      this.searchForm.showRead = this.searchForm.showRead ? 1 : 0;
134
+      this.searchList();
135
+    },
136
+    // 搜索
137
+    searchList() {
138
+      this.searchForm.page = 1;
139
+      this.getList();
140
+    },
141
+    // 页码改变
142
+    pageChange(page) {
143
+      this.searchForm.page = page;
144
+      this.getList();
145
+    },
146
+    // 每页显示数量改变
147
+    pageSizeChange(size) {
148
+      this.searchForm.size = size;
149
+      this.searchForm.page = 1;
150
+      this.getList();
151
+    },
152
+    getList() {
153
+      logdoperatemsg_list({
154
+        rtype: this.powerParams.rtype,
155
+        objectid: this.powerParams.objectid,
156
+        name: this.searchForm.name,
157
+        page: this.searchForm.page,
158
+        size: this.searchForm.size,
159
+        showRead: this.searchForm.showRead
160
+      }).then((res) => {
161
+        if (res.code === 0) {
162
+          this.searchForm.list = res.obj.data;
163
+          this.searchForm.total = res.obj.total;
164
+        } else {
165
+          this.$Message.error(res.msg);
166
+        }
167
+      });
168
+    }
169
+  }
170
+};
171
+</script>
172
+
173
+<style lang="less" scoped>
174
+.search_header {
175
+  display: flex;
176
+  justify-content: space-between;
177
+  align-items: center;
178
+  margin: 16px 16px;
179
+  .search_left {
180
+    display: flex;
181
+    justify-content: flex-start;
182
+    align-items: center;
183
+  }
184
+}
185
+.table_wrap {
186
+  border: none;
187
+  .log_list {
188
+    border-radius: 8px;
189
+    border: 1px solid #ced9f2;
190
+    padding: 16px;
191
+    margin-bottom: 10px;
192
+    font-family: "SourceHanSansCN";
193
+    .username {
194
+      color: #253a70;
195
+      font-size: 16px;
196
+      font-weight: 700;
197
+      line-height: 30px;
198
+      margin-bottom: 10px;
199
+      cursor: pointer;
200
+      span {
201
+        display: inline-block;
202
+        border-radius: 11px;
203
+        background: #95abdf1a;
204
+        color: #95abdf;
205
+        font-size: 14px;
206
+        line-height: 14px;
207
+        font-weight: 400;
208
+        padding: 4px 10px;
209
+      }
210
+      .active {
211
+        background: #ebf3ff;
212
+        color: #339dff;
213
+      }
214
+    }
215
+    .comm {
216
+      color: #253a70;
217
+      font-size: 16px;
218
+      font-weight: 400;
219
+      line-height: 30px;
220
+    }
221
+    .school {
222
+      color: #798cb5;
223
+      font-size: 16px;
224
+      font-weight: 400;
225
+      line-height: 30px;
226
+      span {
227
+        margin-right: 20px;
228
+      }
229
+    }
230
+  }
231
+}
232
+.modal1 {
233
+  font-family: "SourceHanSansCN";
234
+
235
+  .username {
236
+    color: #253a70;
237
+    font-size: 18px;
238
+    font-weight: 500;
239
+    line-height: 30px;
240
+    text-align: center;
241
+  }
242
+  .school {
243
+    color: #afbcc7;
244
+    font-size: 12px;
245
+    font-weight: 400;
246
+    text-align: center;
247
+    line-height: 26px;
248
+    margin: 10px 0;
249
+  }
250
+  .comm {
251
+    color: #253a70;
252
+    font-size: 16px;
253
+    font-weight: 400;
254
+    line-height: 30px;
255
+  }
256
+}
257
+.nodeta {
258
+  min-height: 300px;
259
+  line-height: 300px;
260
+  text-align: center;
261
+}
262
+</style>

+ 14
- 3
src/views/regionSection/personal.vue View File

@@ -61,7 +61,7 @@
61 61
           ></DatePicker>
62 62
           <Input
63 63
             v-model="searchForm.name"
64
-            placeholder="请输入事件名称"
64
+            placeholder="请输入事件名称"
65 65
             search
66 66
             @on-search="searchList()"
67 67
             style="width: 180px"
@@ -69,7 +69,8 @@
69 69
         </div>
70 70
       </div>
71 71
       <div class="table_wrap">
72
-        <Table :columns="columns" :data="searchForm.list"></Table>
72
+        <Table :columns="columns" :data="searchForm.list">
73
+        </Table>
73 74
       </div>
74 75
       <div class="page_wrap">
75 76
         <Page
@@ -158,7 +159,17 @@ export default {
158 159
           align: "center"
159 160
         },
160 161
         {
161
-          title: "事件",
162
+          title: "所属模块",
163
+          key: "logmodel",
164
+          align: "center"
165
+        },
166
+        {
167
+          title: "模块操作",
168
+          key: "logaction",
169
+          align: "center"
170
+        },
171
+        {
172
+          title: "日志内容",
162 173
           key: "content",
163 174
           align: "center"
164 175
         },

+ 262
- 0
src/views/schoolSection/logdoperatemsg.vue View File

@@ -0,0 +1,262 @@
1
+<template>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Input
6
+          v-model="searchForm.name"
7
+          placeholder="请输入姓名、账号、设备号"
8
+          search
9
+          @on-search="searchList()"
10
+          style="width: 240px; margin-right: 20px"
11
+        />
12
+        <Checkbox @on-change="showReadChange" v-model="searchForm.showRead"
13
+          >只显示未读</Checkbox
14
+        >
15
+      </div>
16
+    </div>
17
+    <div class="table_wrap">
18
+      <div class="log_list" v-for="item in searchForm.list" :key="item.doid">
19
+        <div class="username" @click="headleView(item)">
20
+          {{ item.classname }} 【{{ item.username }}】<span
21
+            :class="[item.hasread === 1 ? 'active' : '']"
22
+            >{{ item.hasread === 1 ? "已读" : "未读" }}</span
23
+          >
24
+        </div>
25
+        <div class="comm">{{ item.comm }}</div>
26
+        <div class="school">
27
+          学校:<span>{{ item.schoolName }}</span> 设备号:<span>{{
28
+            item.sn
29
+          }}</span>
30
+          时间:<span>{{ item.createtime }}</span>
31
+        </div>
32
+      </div>
33
+      <div class="nodeta" v-if="searchForm.list.length === 0">暂无数据</div>
34
+    </div>
35
+    <div class="page_wrap" v-if="searchForm.list.length > 0">
36
+      <Page
37
+        :transfer="true"
38
+        :total="searchForm.total"
39
+        :current="searchForm.page"
40
+        :page-size="searchForm.size"
41
+        :page-size-opts="[10, 20, 40, 60]"
42
+        @on-change="pageChange"
43
+        @on-page-size-change="pageSizeChange"
44
+        show-total
45
+        show-sizer
46
+      ></Page>
47
+    </div>
48
+    <!-- 查看 -->
49
+    <Modal
50
+      class="modal1"
51
+      :mask-closable="false"
52
+      v-model="viewInfo.show"
53
+      title="查看"
54
+    >
55
+      <div>
56
+        <div class="username">
57
+          {{ viewInfo.classname }} 【{{ viewInfo.username }}】
58
+        </div>
59
+        <div class="school">
60
+          学校:<span style="margin-right: 20px">{{
61
+            viewInfo.schoolName
62
+          }}</span>
63
+          时间:{{ viewInfo.createtime }}
64
+        </div>
65
+        <div class="comm">{{ viewInfo.comm }}</div>
66
+        <div class="comm">设备号:{{ viewInfo.sn }}</div>
67
+      </div>
68
+      <div slot="footer" style="text-align: center">
69
+        <div>
70
+          <Button @click="viewInfo.show = false">关闭</Button>
71
+        </div>
72
+      </div>
73
+    </Modal>
74
+  </div>
75
+</template>
76
+
77
+<script>
78
+import { logdoperatemsg_edit_read, logdoperatemsg_list } from "@/api/log";
79
+
80
+export default {
81
+  data() {
82
+    return {
83
+      searchForm: {
84
+        showRead: 0,
85
+        name: "",
86
+        page: 1,
87
+        size: 10,
88
+        list: [],
89
+        total: 0
90
+      },
91
+      viewInfo: {
92
+        show: false
93
+      },
94
+      userInfo: {}
95
+    };
96
+  },
97
+  created() {
98
+    this.userInfo = JSON.parse(
99
+      localStorage.getItem("xh_control_userInfo")
100
+    ).content;
101
+    this.searchList();
102
+  },
103
+  computed: {
104
+    powerParams() {
105
+      return this.$store.getters.powerParams;
106
+    }
107
+  },
108
+  methods: {
109
+    headleView(item) {
110
+      logdoperatemsg_edit_read({ ldomid: item.ldomid }).then((res) => {
111
+        if (res.code === 0) {
112
+          this.searchForm.list.forEach((v) => {
113
+            if (item.ldomid === v.ldomid) {
114
+              //改状态为已读
115
+              v.hasread = 1;
116
+            }
117
+          });
118
+          this.viewInfo = {
119
+            show: true,
120
+            classname: item.classname,
121
+            username: item.username,
122
+            schoolName: item.schoolName,
123
+            createtime: item.createtime,
124
+            comm: item.comm,
125
+            sn: item.sn
126
+          };
127
+        } else {
128
+          this.$Message.error(res.msg);
129
+        }
130
+      });
131
+    },
132
+    showReadChange() {
133
+      this.searchForm.showRead = this.searchForm.showRead ? 1 : 0;
134
+      this.searchList();
135
+    },
136
+    // 搜索
137
+    searchList() {
138
+      this.searchForm.page = 1;
139
+      this.getList();
140
+    },
141
+    // 页码改变
142
+    pageChange(page) {
143
+      this.searchForm.page = page;
144
+      this.getList();
145
+    },
146
+    // 每页显示数量改变
147
+    pageSizeChange(size) {
148
+      this.searchForm.size = size;
149
+      this.searchForm.page = 1;
150
+      this.getList();
151
+    },
152
+    getList() {
153
+      logdoperatemsg_list({
154
+        rtype: this.powerParams.rtype,
155
+        objectid: this.powerParams.objectid,
156
+        name: this.searchForm.name,
157
+        page: this.searchForm.page,
158
+        size: this.searchForm.size,
159
+        showRead: this.searchForm.showRead
160
+      }).then((res) => {
161
+        if (res.code === 0) {
162
+          this.searchForm.list = res.obj.data;
163
+          this.searchForm.total = res.obj.total;
164
+        } else {
165
+          this.$Message.error(res.msg);
166
+        }
167
+      });
168
+    }
169
+  }
170
+};
171
+</script>
172
+
173
+<style lang="less" scoped>
174
+.search_header {
175
+  display: flex;
176
+  justify-content: space-between;
177
+  align-items: center;
178
+  margin: 16px 16px;
179
+  .search_left {
180
+    display: flex;
181
+    justify-content: flex-start;
182
+    align-items: center;
183
+  }
184
+}
185
+.table_wrap {
186
+  border: none;
187
+  .log_list {
188
+    border-radius: 8px;
189
+    border: 1px solid #ced9f2;
190
+    padding: 16px;
191
+    margin-bottom: 10px;
192
+    font-family: "SourceHanSansCN";
193
+    .username {
194
+      color: #253a70;
195
+      font-size: 16px;
196
+      font-weight: 700;
197
+      line-height: 30px;
198
+      margin-bottom: 10px;
199
+      cursor: pointer;
200
+      span {
201
+        display: inline-block;
202
+        border-radius: 11px;
203
+        background: #95abdf1a;
204
+        color: #95abdf;
205
+        font-size: 14px;
206
+        line-height: 14px;
207
+        font-weight: 400;
208
+        padding: 4px 10px;
209
+      }
210
+      .active {
211
+        background: #ebf3ff;
212
+        color: #339dff;
213
+      }
214
+    }
215
+    .comm {
216
+      color: #253a70;
217
+      font-size: 16px;
218
+      font-weight: 400;
219
+      line-height: 30px;
220
+    }
221
+    .school {
222
+      color: #798cb5;
223
+      font-size: 16px;
224
+      font-weight: 400;
225
+      line-height: 30px;
226
+      span {
227
+        margin-right: 20px;
228
+      }
229
+    }
230
+  }
231
+}
232
+.modal1 {
233
+  font-family: "SourceHanSansCN";
234
+
235
+  .username {
236
+    color: #253a70;
237
+    font-size: 18px;
238
+    font-weight: 500;
239
+    line-height: 30px;
240
+    text-align: center;
241
+  }
242
+  .school {
243
+    color: #afbcc7;
244
+    font-size: 12px;
245
+    font-weight: 400;
246
+    text-align: center;
247
+    line-height: 26px;
248
+    margin: 10px 0;
249
+  }
250
+  .comm {
251
+    color: #253a70;
252
+    font-size: 16px;
253
+    font-weight: 400;
254
+    line-height: 30px;
255
+  }
256
+}
257
+.nodeta {
258
+  min-height: 300px;
259
+  line-height: 300px;
260
+  text-align: center;
261
+}
262
+</style>

+ 413
- 0
src/views/schoolSection/personal.vue View File

@@ -0,0 +1,413 @@
1
+<template>
2
+  <div class="main_root">
3
+    <div class="personal_list">
4
+      <div class="personal_item" v-for="item in personal_list" :key="item.id">
5
+        <div
6
+          @click="toggle(item.id)"
7
+          :class="[curmodel === item.id ? 'active' : '']"
8
+        >
9
+          {{ item.title }}
10
+        </div>
11
+      </div>
12
+    </div>
13
+    <div class="contents" v-if="curmodel === 1">
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">
73
+        </Table>
74
+      </div>
75
+      <div class="page_wrap">
76
+        <Page
77
+          :transfer="true"
78
+          :total="searchForm.total"
79
+          :current="searchForm.page"
80
+          :page-size="searchForm.size"
81
+          :page-size-opts="[10, 20, 40, 60]"
82
+          @on-change="pageChange"
83
+          @on-page-size-change="pageSizeChange"
84
+          show-total
85
+          show-sizer
86
+        ></Page>
87
+      </div>
88
+    </div>
89
+    <div class="content" style="padding-top: 16px" v-else>
90
+      <div class="table_wrap">
91
+        <Table :columns="columns1" :data="searchForm.list"></Table>
92
+      </div>
93
+      <div class="page_wrap">
94
+        <Page
95
+          :transfer="true"
96
+          :total="searchForm.total"
97
+          :current="searchForm.page"
98
+          :page-size="searchForm.size"
99
+          :page-size-opts="[10, 20, 40, 60]"
100
+          @on-change="pageChange"
101
+          @on-page-size-change="pageSizeChange"
102
+          show-total
103
+          show-sizer
104
+        ></Page>
105
+      </div>
106
+    </div>
107
+  </div>
108
+</template>
109
+
110
+<script>
111
+import { admin_detail, admin_list_lr, admin_list_re } from "@/api/admin";
112
+import { dateFormat } from "@/utils";
113
+
114
+export default {
115
+  data() {
116
+    return {
117
+      personal_list: [
118
+        {
119
+          id: 1,
120
+          title: "个人信息"
121
+        },
122
+        {
123
+          id: 2,
124
+          title: "最近事件"
125
+        },
126
+        {
127
+          id: 3,
128
+          title: "历史登录"
129
+        }
130
+      ],
131
+      curmodel: 1,
132
+      personalInfo: {},
133
+      searchForm: {
134
+        dataRange: [],
135
+        name: "",
136
+        page: 1,
137
+        size: 10,
138
+        list: [],
139
+        total: 0
140
+      },
141
+      userInfo: {},
142
+      columns: [
143
+        {
144
+          title: "序号",
145
+          align: "center",
146
+          width: 70,
147
+          render: (h, params) => {
148
+            return h(
149
+              "span",
150
+              params.index +
151
+                (this.searchForm.page - 1) * this.searchForm.size +
152
+                1
153
+            );
154
+          }
155
+        },
156
+        {
157
+          title: "登录名",
158
+          key: "loginname",
159
+          align: "center"
160
+        },
161
+        {
162
+          title: "所属模块",
163
+          key: "logmodel",
164
+          align: "center"
165
+        },
166
+        {
167
+          title: "模块操作",
168
+          key: "logaction",
169
+          align: "center"
170
+        },
171
+        {
172
+          title: "日志内容",
173
+          key: "content",
174
+          align: "center"
175
+        },
176
+        {
177
+          title: "时间",
178
+          key: "createtime",
179
+          width: 190,
180
+          align: "center"
181
+        }
182
+      ],
183
+      columns1: [
184
+        {
185
+          title: "序号",
186
+          align: "center",
187
+          width: 70,
188
+          render: (h, params) => {
189
+            return h(
190
+              "span",
191
+              params.index +
192
+                (this.searchForm.page - 1) * this.searchForm.size +
193
+                1
194
+            );
195
+          }
196
+        },
197
+        {
198
+          title: "登录IP",
199
+          key: "ip",
200
+          align: "center"
201
+        },
202
+        {
203
+          title: "地址",
204
+          key: "ipAddress",
205
+          align: "center"
206
+        },
207
+        {
208
+          title: "登录时间",
209
+          key: "createtime",
210
+          width: 190,
211
+          align: "center"
212
+        }
213
+      ]
214
+    };
215
+  },
216
+  created() {
217
+    this.userInfo = JSON.parse(
218
+      localStorage.getItem("xh_control_userInfo")
219
+    ).content;
220
+    this.getPersonal();
221
+  },
222
+  computed: {
223
+    powerParams() {
224
+      return this.$store.getters.powerParams;
225
+    }
226
+  },
227
+  methods: {
228
+    toggle(type) {
229
+      this.curmodel = type;
230
+      if (type === 1) {
231
+        this.getPersonal();
232
+      } else {
233
+        this.searchForm.size = 10;
234
+        this.searchForm.page = 1;
235
+        this.searchList();
236
+      }
237
+    },
238
+    // 搜索
239
+    searchList() {
240
+      this.searchForm.page = 1;
241
+      this.getEvent();
242
+    },
243
+    // 页码改变
244
+    pageChange(page) {
245
+      this.searchForm.page = page;
246
+      this.getEvent();
247
+    },
248
+    // 每页显示数量改变
249
+    pageSizeChange(size) {
250
+      this.searchForm.size = size;
251
+      this.searchForm.page = 1;
252
+      this.getEvent();
253
+    },
254
+    async getEvent() {
255
+      let res = {
256
+        code: null
257
+      };
258
+      if (this.curmodel === 2) {
259
+        let _begindate = this.searchForm.dataRange[0];
260
+        _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
261
+        let _enddate = this.searchForm.dataRange[1];
262
+        _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
263
+        res = await admin_list_re({
264
+          objectid: this.userInfo.adminid,
265
+          begindate: _begindate,
266
+          enddate: _enddate,
267
+          name: this.searchForm.name,
268
+          page: this.searchForm.page,
269
+          size: this.searchForm.size
270
+        });
271
+      } else {
272
+        res = await admin_list_lr({
273
+          objectid: this.userInfo.adminid,
274
+          page: this.searchForm.page,
275
+          size: this.searchForm.size
276
+        });
277
+      }
278
+
279
+      if (res.code === 0) {
280
+        this.searchForm.list = res.obj.data;
281
+        this.searchForm.total = res.obj.total;
282
+      } else {
283
+        this.$Message.error(res.msg);
284
+      }
285
+    },
286
+    getPersonal() {
287
+      admin_detail({ adminid: this.userInfo.adminid }).then((res) => {
288
+        if (res.code === 0) {
289
+          this.personalInfo = res.obj;
290
+        } else {
291
+          this.$Message.error(res.msg);
292
+        }
293
+      });
294
+    }
295
+  }
296
+};
297
+</script>
298
+
299
+<style lang="less" scoped>
300
+.main_root {
301
+  background-color: transparent;
302
+  border: navajowhite;
303
+  height: calc(100% - 20px);
304
+  display: flex;
305
+  .personal_list {
306
+    width: 200px;
307
+    height: 100%;
308
+    border-radius: 15px;
309
+    padding: 20px 10px;
310
+    border: 1px solid #e9f0f9;
311
+    background: #ffffff;
312
+    margin-right: 20px;
313
+    .personal_item {
314
+      line-height: 30px;
315
+      text-align: center;
316
+      cursor: pointer;
317
+    }
318
+    .active {
319
+      border-radius: 6px;
320
+      background: #339dff;
321
+      color: white;
322
+    }
323
+  }
324
+  .contents {
325
+    width: calc(100% - 220px);
326
+    height: 100%;
327
+    .user {
328
+      height: 200px;
329
+      border-radius: 15px;
330
+      background: white;
331
+      margin-bottom: 20px;
332
+      display: flex;
333
+      align-items: center;
334
+      .head {
335
+        width: 100px;
336
+        height: 100px;
337
+        margin: 0 40px;
338
+        border-radius: 16px;
339
+        overflow: hidden;
340
+        border: 2px solid #ffffff;
341
+        box-shadow: 0 6px 14px 0 #dce0e880;
342
+        img {
343
+          width: 100%;
344
+          height: 100%;
345
+          object-fit: cover;
346
+        }
347
+      }
348
+      .username {
349
+        p {
350
+          color: #253a70;
351
+          font-size: 20px;
352
+          font-weight: 500;
353
+          font-family: "SourceHanSansCN";
354
+          text-align: left;
355
+          line-height: 50px;
356
+        }
357
+        div {
358
+          color: #7c8db5;
359
+          font-size: 16px;
360
+          font-weight: 400;
361
+          font-family: "SourceHanSansCN";
362
+          line-height: 50px;
363
+          span {
364
+            color: #253a70;
365
+            display: inline-block;
366
+            margin: 0 20px;
367
+          }
368
+        }
369
+      }
370
+    }
371
+    .comm {
372
+      height: calc(100% - 220px);
373
+      border-radius: 15px;
374
+      background: white;
375
+      margin-bottom: 20px;
376
+      padding: 40px;
377
+      .com {
378
+        line-height: 30px;
379
+        color: #253a70;
380
+        font-size: 16px;
381
+        font-weight: 400;
382
+        margin-bottom: 10px;
383
+        font-family: "SourceHanSansCN";
384
+        span {
385
+          color: #7c8db5;
386
+          display: inline-block;
387
+          width: 100px;
388
+          margin-right: 20px;
389
+        }
390
+      }
391
+    }
392
+  }
393
+  .content {
394
+    width: calc(100% - 220px);
395
+    height: 100%;
396
+    overflow-y: auto;
397
+    border-radius: 15px;
398
+    border: 1px solid #e9f0f9;
399
+    background: #ffffff;
400
+    .search_header {
401
+      display: flex;
402
+      justify-content: space-between;
403
+      align-items: center;
404
+      margin: 16px 16px;
405
+      .search_left {
406
+        display: flex;
407
+        justify-content: flex-start;
408
+        align-items: center;
409
+      }
410
+    }
411
+  }
412
+}
413
+</style>

Loading…
Cancel
Save