Sfoglia il codice sorgente

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

gzb
wangzhonglu 9 mesi fa
parent
commit
d595461e54

+ 151
- 4
src/views/layout.vue Vedi File

@@ -48,14 +48,125 @@
48 48
     <div class="layout_main">
49 49
       <router-view></router-view>
50 50
     </div>
51
+    <!-- 修改密码 -->
52
+    <Modal
53
+        class="modal1"
54
+        :mask-closable="false"
55
+        v-model="pwInfo.show"
56
+        title="修改密码"
57
+    >
58
+      <Form
59
+          v-if="pwInfo.show"
60
+          ref="pwInfo"
61
+          :model="pwInfo"
62
+          :rules="rules"
63
+          :label-width="110"
64
+      >
65
+        <FormItem label="原密码" prop="oldpwd">
66
+          <Input
67
+              v-model="pwInfo.oldpwd"
68
+              placeholder="请输入原密码"
69
+          ></Input>
70
+        </FormItem>
71
+        <FormItem
72
+            label="新密码"
73
+            prop="loginpwd"
74
+        >
75
+          <Input
76
+              v-model="pwInfo.loginpwd"
77
+              placeholder="请输入新密码"
78
+          ></Input>
79
+        </FormItem>
80
+        <FormItem
81
+            label="确认密码"
82
+            prop="loginpwd1"
83
+        >
84
+          <Input
85
+              v-model="pwInfo.loginpwd1"
86
+              placeholder="请输入确认密码"
87
+          ></Input>
88
+        </FormItem>
89
+      </Form>
90
+      <div
91
+          slot="footer"
92
+          style="
93
+          display: flex;
94
+          justify-content: space-between;
95
+          align-items: center;
96
+        "
97
+      >
98
+        <div style="color: #b50000">
99
+          注:密码必须包含大小写字母和数字的组合,长度在8-32之间。
100
+        </div>
101
+        <div>
102
+          <Button @click="pwInfo.show = false">取消</Button>
103
+          <Button @click="savepwInfo()" type="primary">保存</Button>
104
+        </div>
105
+      </div>
106
+    </Modal>
107
+    <Spin fix v-if="showLoading" style="background-color: transparent">
108
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
109
+      <div>加载中</div>
110
+    </Spin>
51 111
   </div>
52 112
 </template>
53 113
 
54 114
 <script>
115
+import {region_add} from "@/api/region";
116
+import {admin_detail, admin_edit_pwd} from "@/api/admin";
117
+
55 118
 export default {
56 119
   data() {
120
+    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
121
+    // 密码验证
122
+    const pwdCheck = (rule, value, callback) => {
123
+      if (!reg.test(value)) {
124
+        return callback(new Error("密码格式不正确!"));
125
+      }
126
+      callback();
127
+    };
128
+    // 重复密码验证
129
+    const pwdAgainCheck = async (rule, value, callback) => {
130
+      if (!reg.test(value)) {
131
+        return callback(new Error("密码格式不正确!"));
132
+      }
133
+      if (this.pwInfo.loginpwd != value) {
134
+        return callback(new Error("两次输入密码不一致!"));
135
+      }
136
+      callback();
137
+    };
57 138
     return {
139
+      showLoading: false,
58 140
       userDropdown: false,
141
+      pwInfo: {
142
+        show: false,
143
+      },
144
+      phoneInfo: {
145
+        show: false
146
+      },
147
+      rules: {
148
+        oldpwd: [
149
+          {
150
+            required: true,
151
+            message: "请输入原密码",
152
+            trigger: "blur"
153
+          }
154
+        ],
155
+        loginpwd: [
156
+          {
157
+            required: true,
158
+            validator: pwdCheck,
159
+            trigger: "blur"
160
+          }
161
+        ],
162
+        loginpwd1: [
163
+          {
164
+            required: true,
165
+            validator: pwdAgainCheck,
166
+            trigger: "blur"
167
+          }
168
+        ]
169
+      },
59 170
       userInfo: {}
60 171
     };
61 172
   },
@@ -75,6 +186,30 @@ export default {
75 186
     }
76 187
   },
77 188
   methods: {
189
+    savepwInfo(){
190
+
191
+      this.$refs.pwInfo.validate((valid) => {
192
+        if (valid) {
193
+          console.log(this.pwInfo)
194
+          return
195
+          this.showLoading = true;
196
+          admin_edit_pwd({
197
+            adminid: this.pwInfo.adminid,
198
+            loginpwd: this.pwInfo.loginpwd,
199
+            oldpwd: this.pwInfo.oldpwd,
200
+            rversion: this.pwInfo.rversion
201
+            }).then((data) => {
202
+            this.showLoading = false;
203
+            if (data.code === 0) {
204
+              this.regionInfo.show = false;
205
+              this.$Message.success(data.msg);
206
+            } else {
207
+              this.$Message.error(data.msg);
208
+            }
209
+          });
210
+        }
211
+      });
212
+    },
78 213
     // 下拉菜单显示隐藏
79 214
     userDropdownVisibleChange(visible) {
80 215
       this.userDropdown = visible;
@@ -84,10 +219,22 @@ export default {
84 219
       if (name === "1") {
85 220
         // 个人中心
86 221
         this.$router.push("personal");
87
-      } else if (name === "2") {
88
-        // 修改密码
89
-      } else if (name === "3") {
90
-        // 更换手机号
222
+      } else if (name === "2" || name === "3") {
223
+        // 2修改密码 3更换手机号
224
+        admin_detail({ adminid: this.userInfo.adminid }).then((res) => {
225
+          if (res.code === 0) {
226
+            console.log(res.obj);
227
+            if(name === "2"){
228
+              this.pwInfo.show = true;
229
+              this.pwInfo.rversion = res.obj.rversion;
230
+            }else {
231
+              this.phoneInfo.show = true;
232
+              this.phoneInfo.rversion = res.obj.rversion;
233
+            }
234
+          } else {
235
+            this.$Message.error(res.msg);
236
+          }
237
+        });
91 238
       } else if (name === "4") {
92 239
         // 退出
93 240
         this.$Modal.confirm({

+ 3
- 2
src/views/login/login.vue Vedi File

@@ -313,8 +313,9 @@ export default {
313 313
     background: #ffffff;
314 314
     box-shadow: 0 0 18px 0 #deeaffe0;
315 315
     position: absolute;
316
-    right: 160px;
317
-    bottom: 160px;
316
+    top: 50%;
317
+    transform: translateY(-50%);
318
+    right: 16%;
318 319
     .welcome {
319 320
       height: 30px;
320 321
       color: #000000;

+ 1
- 0
src/views/regionSection/applicationManage/applicationManage.vue Vedi File

@@ -2012,6 +2012,7 @@ export default {
2012 2012
       margin-top: 10px;
2013 2013
       color: #96abdf;
2014 2014
       line-height: 30px;
2015
+      text-align: center;
2015 2016
       &:hover {
2016 2017
         cursor: pointer;
2017 2018
         color: #339cff;

+ 294
- 7
src/views/regionSection/personal.vue Vedi File

@@ -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>

+ 3
- 2
src/views/regionSection/search/allApps.vue Vedi File

@@ -618,7 +618,7 @@ export default {
618 618
         {
619 619
           title: "状态",
620 620
           slot: "enabled",
621
-          width: 120,
621
+          width: 100,
622 622
           align: "center"
623 623
         },
624 624
         {
@@ -636,7 +636,7 @@ export default {
636 636
         {
637 637
           title: "操作时间",
638 638
           key: "updatetime",
639
-          width: 190,
639
+          width: 180,
640 640
           align: "center"
641 641
         },
642 642
         {
@@ -1057,6 +1057,7 @@ export default {
1057 1057
       margin-top: 10px;
1058 1058
       color: #96abdf;
1059 1059
       line-height: 30px;
1060
+      text-align: center;
1060 1061
       &:hover {
1061 1062
         cursor: pointer;
1062 1063
         color: #339cff;

+ 2
- 2
src/views/regionSection/search/deviceModel.vue Vedi File

@@ -2,12 +2,12 @@
2 2
   <div class="main_root">
3 3
     <div class="search_header">
4 4
       <Input
5
-        v-model="searchForm.name"
5
+        v-model="searchForm.title"
6 6
         placeholder="请输入学校名称"
7 7
         style="width: 200px"
8 8
       />
9 9
       <Input
10
-        v-model="searchForm.title"
10
+        v-model="searchForm.name"
11 11
         placeholder="请输入设备型号、Rom版本"
12 12
         style="width: 200px; margin: 0 10px"
13 13
       />

+ 1
- 0
src/views/schoolSection/applicationManage/applicationList.vue Vedi File

@@ -1607,6 +1607,7 @@ export default {
1607 1607
       margin-top: 10px;
1608 1608
       color: #96abdf;
1609 1609
       line-height: 30px;
1610
+      text-align: center;
1610 1611
       &:hover {
1611 1612
         cursor: pointer;
1612 1613
         color: #339cff;

Loading…
Annulla
Salva