Ver código fonte

平台-设备密码

gzb
wangzhonglu 8 meses atrás
pai
commit
07ad09a35d

+ 5
- 0
src/api/setting.js Ver arquivo

@@ -76,6 +76,11 @@ export const schoolSet_delete = (data) => setRequest("schoolSet/delete", data);
76 76
  */
77 77
 export const password_detail_userpwd = (data) =>
78 78
   setRequest("password/detail_userpwd", data);
79
+/**
80
+ * 8.3.6 设备设置--根据SN获取动态码
81
+ */
82
+export const password_detail_sn = (data) =>
83
+  setRequest("password/detail_sn", data);
79 84
 /**
80 85
  * 8.4.1 开机设置-详情
81 86
  */

+ 4
- 0
src/assets/less/common.less Ver arquivo

@@ -383,6 +383,7 @@ fieldset[disabled] .ivu-input,
383 383
   background-color: #fff;
384 384
 }
385 385
 // 表格
386
+.table_wrap_modal,
386 387
 .table_wrap {
387 388
   margin: 0 16px;
388 389
   border: 1px solid #e8eaec;
@@ -398,6 +399,9 @@ fieldset[disabled] .ivu-input,
398 399
     }
399 400
   }
400 401
 }
402
+.table_wrap_modal {
403
+  margin: 0;
404
+}
401 405
 .page_wrap {
402 406
   padding: 16px;
403 407
   text-align: right;

+ 13
- 0
src/router/platform.js Ver arquivo

@@ -90,6 +90,19 @@ export default {
90 90
         title: "平台管控-设备管理-设备导出"
91 91
       }
92 92
     },
93
+    {
94
+      path: "deviceManagePwd",
95
+      component: () =>
96
+        import(
97
+          "@/views/platformSection/deviceManage/deviceManagePwd/deviceManagePwd.vue"
98
+        ),
99
+      name: "deviceManagePwd",
100
+      meta: {
101
+        keepAlive: true,
102
+        isAuth: true,
103
+        title: "平台管控-设备管理-设备密码"
104
+      }
105
+    },
93 106
     {
94 107
       path: "logDeviceExport",
95 108
       component: () =>

+ 124
- 16
src/views/platformSection/deviceManage/deviceManageExport/deviceManageExport.vue Ver arquivo

@@ -2,13 +2,20 @@
2 2
   <div class="main_root">
3 3
     <div class="search_header">
4 4
       <div class="search_left">
5
-        <Input
6
-          v-model="searchForm.name"
7
-          placeholder="请输入名称"
8
-          search
9
-          @on-search="searchList()"
5
+        <Select
6
+          v-model="searchForm.regionid"
7
+          :transfer="true"
8
+          @on-change="searchList()"
10 9
           style="width: 150px"
11
-        />
10
+        >
11
+          <Option :value="0">所有区域</Option>
12
+          <Option
13
+            v-for="regionItem in searchForm.regionList"
14
+            :value="regionItem.regionid"
15
+            :key="regionItem.regionid"
16
+            >{{ regionItem.regionName }}</Option
17
+          >
18
+        </Select>
12 19
       </div>
13 20
       <Button type="primary" class="primary_btn" @click="toExport()"
14 21
         >导出</Button
@@ -16,9 +23,14 @@
16 23
     </div>
17 24
     <div class="table_wrap">
18 25
       <Table :columns="columns" :data="searchForm.list">
26
+        <template slot-scope="{ row }" slot="onlineSlot">
27
+          <!-- 1在线2离线 -->
28
+          <div v-if="row.online === 1">在线</div>
29
+          <div v-else-if="row.online === 2">离线</div>
30
+        </template>
19 31
         <template slot-scope="{ row }" slot="actionSlot">
20 32
           <div class="action_list">
21
-            <div @click="toExport(row)">导出</div>
33
+            <div @click="toView(row)">查看</div>
22 34
           </div>
23 35
         </template>
24 36
       </Table>
@@ -36,22 +48,81 @@
36 48
         show-sizer
37 49
       ></Page>
38 50
     </div>
51
+    <Modal
52
+      class="modal2"
53
+      :mask-closable="false"
54
+      v-model="viewInfo.show"
55
+      title="查看"
56
+    >
57
+      <div class="table_wrap_modal">
58
+        <Table :columns="viewInfo.columns" :data="viewInfo.list"></Table>
59
+      </div>
60
+      <div slot="footer" style="text-align: center">
61
+        <Button @click="viewInfo.show = false">关闭</Button>
62
+      </div>
63
+    </Modal>
39 64
   </div>
40 65
 </template>
41 66
 
42 67
 <script>
68
+import { region_list_sel_pt } from "@/api/region";
43 69
 import { exportToExcel } from "@/utils/exportToExcel";
44 70
 import { logDeviceBind_list, logDeviceBind_list_all } from "@/api/log";
45 71
 export default {
46 72
   data() {
47 73
     return {
48 74
       searchForm: {
49
-        name: "",
75
+        regionid: 0,
76
+        regionList: [],
50 77
         page: 1,
51 78
         size: 10,
52 79
         list: [],
53 80
         total: 0
54 81
       },
82
+      viewInfo: {
83
+        show: false,
84
+        list: [],
85
+        columns: [
86
+          {
87
+            title: "序号",
88
+            type: "index",
89
+            align: "center",
90
+            width: 70
91
+          },
92
+          {
93
+            title: "所属区域",
94
+            key: "regionName",
95
+            align: "center"
96
+          },
97
+          {
98
+            title: "学校名称",
99
+            key: "schoolName",
100
+            align: "center"
101
+          },
102
+          {
103
+            title: "班级",
104
+            key: "classname",
105
+            align: "center"
106
+          },
107
+          {
108
+            title: "姓名",
109
+            key: "username",
110
+            align: "center"
111
+          },
112
+          {
113
+            title: "绑定时间",
114
+            key: "snnum",
115
+            width: 190,
116
+            align: "center"
117
+          },
118
+          {
119
+            title: "解绑时间",
120
+            key: "snnum",
121
+            width: 190,
122
+            align: "center"
123
+          }
124
+        ]
125
+      },
55 126
       columns: [
56 127
         {
57 128
           title: "序号",
@@ -67,23 +138,46 @@ export default {
67 138
           }
68 139
         },
69 140
         {
70
-          title: "区域名称",
71
-          key: "regionName",
141
+          title: "学校名称",
142
+          key: "schoolName",
143
+          align: "center"
144
+        },
145
+        {
146
+          title: "班级",
147
+          key: "classname",
148
+          align: "center"
149
+        },
150
+        {
151
+          title: "姓名",
152
+          key: "username",
153
+          align: "center"
154
+        },
155
+        {
156
+          title: "设备号",
157
+          key: "sn",
72 158
           align: "center"
73 159
         },
74 160
         {
75
-          title: "学校数",
76
-          key: "schoolnum",
161
+          title: "设备型号",
162
+          key: "deviceModel",
77 163
           align: "center"
78 164
         },
79 165
         {
80
-          title: "用户数",
81
-          key: "usernum",
166
+          title: "状态",
167
+          slot: "onlineSlot",
168
+          width: 70,
82 169
           align: "center"
83 170
         },
84 171
         {
85
-          title: "设备数",
86
-          key: "snnum",
172
+          title: "首次激活时间",
173
+          key: "updatetime",
174
+          width: 190,
175
+          align: "center"
176
+        },
177
+        {
178
+          title: "末次解绑时间",
179
+          key: "updatetime",
180
+          width: 190,
87 181
           align: "center"
88 182
         },
89 183
         {
@@ -96,6 +190,7 @@ export default {
96 190
     };
97 191
   },
98 192
   created() {
193
+    this.getRegionList();
99 194
     this.searchList();
100 195
   },
101 196
   computed: {
@@ -104,6 +199,16 @@ export default {
104 199
     }
105 200
   },
106 201
   methods: {
202
+    // 获取搜索区域列表
203
+    getRegionList() {
204
+      region_list_sel_pt({}).then((data) => {
205
+        if (data.code === 0) {
206
+          this.searchForm.regionList = data.obj;
207
+        } else {
208
+          this.$Message.error(data.msg);
209
+        }
210
+      });
211
+    },
107 212
     // 搜索
108 213
     searchList() {
109 214
       this.searchForm.page = 1;
@@ -137,6 +242,9 @@ export default {
137 242
         }
138 243
       });
139 244
     },
245
+    toView() {
246
+      this.viewInfo.show = true;
247
+    },
140 248
     toExport(row) {
141 249
       let form = {
142 250
         rtype: this.powerParams.rtype,

+ 114
- 0
src/views/platformSection/deviceManage/deviceManagePwd/deviceManagePwd.vue Ver arquivo

@@ -0,0 +1,114 @@
1
+<template>
2
+  <div class="main_root">
3
+    <div class="tip_bg">
4
+      <div class="require">输入设备号后,系统自动计算设备密码。</div>
5
+      <div class="require">密码为动态密码,每隔1小时变化一次。</div>
6
+    </div>
7
+    <div class="pwd_main">
8
+      <div class="pwd_main_input">
9
+        <Input
10
+          v-model="searchInfo.sn"
11
+          placeholder="请输入设备号"
12
+          @on-enter="getSnPwd()"
13
+          @on-change="searchInfo.data = ''"
14
+          style="width: 380px"
15
+          clearable
16
+        />
17
+        <Button type="primary" class="primary_btn" @click="getSnPwd()"
18
+          >查询</Button
19
+        >
20
+      </div>
21
+      <div class="pwd_main_info" v-if="searchInfo.data">
22
+        <div>查询结果</div>
23
+        <div class="pwd_main_data">{{ searchInfo.data }}</div>
24
+      </div>
25
+    </div>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+import { password_detail_sn } from "@/api/setting";
31
+export default {
32
+  data() {
33
+    return {
34
+      searchInfo: {
35
+        sn: "",
36
+        data: ""
37
+      }
38
+    };
39
+  },
40
+  computed: {
41
+    powerParams() {
42
+      return this.$store.getters.powerParams;
43
+    }
44
+  },
45
+  methods: {
46
+    getSnPwd() {
47
+      if (!this.searchInfo.sn) {
48
+        this.$Message.error("请输入设备号");
49
+        return;
50
+      }
51
+      password_detail_sn({
52
+        sn: this.searchInfo.sn
53
+      }).then((data) => {
54
+        if (data.code === 0) {
55
+          this.searchInfo.data = data.obj;
56
+        } else {
57
+          this.$Message.error(data.msg);
58
+        }
59
+      });
60
+    }
61
+  }
62
+};
63
+</script>
64
+
65
+<style lang="less" scoped>
66
+.tip_bg {
67
+  margin: 50px 100px;
68
+  border-radius: 8px;
69
+  border: 1px dashed #ced9f2;
70
+  background: #f1f6fc;
71
+  .require {
72
+    margin: 10px 20px;
73
+    font-size: 16px;
74
+    line-height: 1.6;
75
+    &::before {
76
+      content: "*" !important;
77
+      display: inline-block;
78
+      margin-right: 4px;
79
+      line-height: 1;
80
+      font-family: SimSun;
81
+      font-size: 14px;
82
+      color: #ed4014;
83
+    }
84
+  }
85
+}
86
+.pwd_main {
87
+  margin: 0 auto;
88
+  width: 480px;
89
+  .pwd_main_input {
90
+    display: flex;
91
+    justify-content: space-between;
92
+    align-items: center;
93
+    .primary_btn {
94
+      width: 84px;
95
+    }
96
+  }
97
+  .pwd_main_info {
98
+    margin-top: 40px;
99
+    font-weight: bold;
100
+    font-size: 16px;
101
+    .pwd_main_data {
102
+      margin-top: 10px;
103
+      height: 36px;
104
+      line-height: 36px;
105
+      font-size: 18px;
106
+      text-align: center;
107
+      color: #339dff;
108
+      border-radius: 8px;
109
+      border: 0 solid #979797;
110
+      background: #ebf3ff;
111
+    }
112
+  }
113
+}
114
+</style>

+ 9
- 1
src/views/platformSection/index.vue Ver arquivo

@@ -71,6 +71,13 @@
71 71
               class="drop_down_list_item"
72 72
               >设备导出</router-link
73 73
             >
74
+            <router-link
75
+              @click.native="routeDropdownChange()"
76
+              tag="div"
77
+              to="/platform/deviceManagePwd"
78
+              class="drop_down_list_item"
79
+              >设备密码</router-link
80
+            >
74 81
           </div>
75 82
         </div>
76 83
         <div :class="['module_item drop_down', logSelected ? 'selected' : '']">
@@ -120,7 +127,8 @@ export default {
120 127
     deviceManageSelected() {
121 128
       return (
122 129
         this.$route.path.includes("/platform/deviceManageImport") ||
123
-        this.$route.path.includes("/platform/deviceManageExport")
130
+        this.$route.path.includes("/platform/deviceManageExport") ||
131
+        this.$route.path.includes("/platform/deviceManagePwd")
124 132
       );
125 133
     },
126 134
     // 日志路由选中

+ 3
- 1
src/views/platformSection/regionManage/adminManage.vue Ver arquivo

@@ -264,7 +264,9 @@ export default {
264 264
   data() {
265 265
     // 重复密码验证
266 266
     const pwdAgainCheck = async (rule, value, callback) => {
267
-      if (!reg.test(this.adminInfo.loginpwd1)) {
267
+      if (!this.adminInfo.loginpwd1) {
268
+        return callback(new Error("请输入确认密码"));
269
+      } else if (!reg.test(this.adminInfo.loginpwd1)) {
268 270
         return callback(new Error("密码格式不正确。"));
269 271
       } else if (this.adminInfo.loginpwd != this.adminInfo.loginpwd1) {
270 272
         return callback(new Error("两次输入密码不一致!"));

+ 11
- 7
src/views/platformSection/regionManage/regionManage.vue Ver arquivo

@@ -59,7 +59,7 @@
59 59
         <FormItem label="区域码" prop="regionCode" style="width: 100%">
60 60
           <Input
61 61
             v-model="regionInfo.regionCode"
62
-            placeholder="请输入区域码"
62
+            placeholder="请输入6位区域码"
63 63
           ></Input>
64 64
         </FormItem>
65 65
         <FormItem
@@ -74,7 +74,7 @@
74 74
         </FormItem>
75 75
         <FormItem
76 76
           label="登录账号"
77
-          prop="loginname"
77
+          prop="admin.loginname"
78 78
           style="width: calc(50% - 10px)"
79 79
         >
80 80
           <Input
@@ -184,7 +184,7 @@
184 184
         <FormItem label="区域码" prop="regionCode" style="width: 100%">
185 185
           <Input
186 186
             v-model="modifyRegion.regionCode"
187
-            placeholder="请输入区域码"
187
+            placeholder="请输入6位区域码"
188 188
           ></Input>
189 189
         </FormItem>
190 190
         <FormItem label="地址" prop="address" style="width: 100%">
@@ -251,8 +251,10 @@ export default {
251 251
   data() {
252 252
     // 重复密码验证
253 253
     const pwdAgainCheck = async (rule, value, callback) => {
254
-      if (!reg.test(this.regionInfo.admin.loginpwd1)) {
255
-        return callback(new Error("密码格式不正确。"));
254
+      if (!this.regionInfo.admin.loginpwd1) {
255
+        return callback(new Error("请输入确认密码"));
256
+      } else if (!reg.test(this.regionInfo.admin.loginpwd1)) {
257
+        return callback(new Error("密码格式不正确"));
256 258
       } else if (
257 259
         this.regionInfo.admin.loginpwd != this.regionInfo.admin.loginpwd1
258 260
       ) {
@@ -341,6 +343,8 @@ export default {
341 343
         regionCode: [
342 344
           {
343 345
             required: true,
346
+            min: 6,
347
+            max: 6,
344 348
             message: "请输入6位区域码",
345 349
             trigger: "blur"
346 350
           }
@@ -355,7 +359,7 @@ export default {
355 359
         "admin.loginname": [
356 360
           {
357 361
             required: true,
358
-            message: "请输入请输入登录账号",
362
+            message: "请输入登录账号",
359 363
             trigger: "blur"
360 364
           }
361 365
         ],
@@ -366,7 +370,7 @@ export default {
366 370
             trigger: "blur"
367 371
           }
368 372
         ],
369
-        loginpwd1: [
373
+        "admin.loginpwd1": [
370 374
           {
371 375
             required: true,
372 376
             validator: pwdAgainCheck,

+ 1
- 0
src/views/schoolSection/applicationStrategy/appStrategyManage.vue Ver arquivo

@@ -513,6 +513,7 @@ export default {
513 513
     justify-content: center;
514 514
     align-items: center;
515 515
     flex-wrap: wrap;
516
+    min-height: 30px;
516 517
     > span {
517 518
       margin: 4px 6px;
518 519
       line-height: 1;

Carregando…
Cancelar
Salvar