Browse Source

平台-设备密码

gzb
wangzhonglu 8 months ago
parent
commit
07ad09a35d

+ 5
- 0
src/api/setting.js View File

76
  */
76
  */
77
 export const password_detail_userpwd = (data) =>
77
 export const password_detail_userpwd = (data) =>
78
   setRequest("password/detail_userpwd", data);
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
  * 8.4.1 开机设置-详情
85
  * 8.4.1 开机设置-详情
81
  */
86
  */

+ 4
- 0
src/assets/less/common.less View File

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

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

90
         title: "平台管控-设备管理-设备导出"
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
       path: "logDeviceExport",
107
       path: "logDeviceExport",
95
       component: () =>
108
       component: () =>

+ 124
- 16
src/views/platformSection/deviceManage/deviceManageExport/deviceManageExport.vue View File

2
   <div class="main_root">
2
   <div class="main_root">
3
     <div class="search_header">
3
     <div class="search_header">
4
       <div class="search_left">
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
           style="width: 150px"
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
       </div>
19
       </div>
13
       <Button type="primary" class="primary_btn" @click="toExport()"
20
       <Button type="primary" class="primary_btn" @click="toExport()"
14
         >导出</Button
21
         >导出</Button
16
     </div>
23
     </div>
17
     <div class="table_wrap">
24
     <div class="table_wrap">
18
       <Table :columns="columns" :data="searchForm.list">
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
         <template slot-scope="{ row }" slot="actionSlot">
31
         <template slot-scope="{ row }" slot="actionSlot">
20
           <div class="action_list">
32
           <div class="action_list">
21
-            <div @click="toExport(row)">导出</div>
33
+            <div @click="toView(row)">查看</div>
22
           </div>
34
           </div>
23
         </template>
35
         </template>
24
       </Table>
36
       </Table>
36
         show-sizer
48
         show-sizer
37
       ></Page>
49
       ></Page>
38
     </div>
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
   </div>
64
   </div>
40
 </template>
65
 </template>
41
 
66
 
42
 <script>
67
 <script>
68
+import { region_list_sel_pt } from "@/api/region";
43
 import { exportToExcel } from "@/utils/exportToExcel";
69
 import { exportToExcel } from "@/utils/exportToExcel";
44
 import { logDeviceBind_list, logDeviceBind_list_all } from "@/api/log";
70
 import { logDeviceBind_list, logDeviceBind_list_all } from "@/api/log";
45
 export default {
71
 export default {
46
   data() {
72
   data() {
47
     return {
73
     return {
48
       searchForm: {
74
       searchForm: {
49
-        name: "",
75
+        regionid: 0,
76
+        regionList: [],
50
         page: 1,
77
         page: 1,
51
         size: 10,
78
         size: 10,
52
         list: [],
79
         list: [],
53
         total: 0
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
       columns: [
126
       columns: [
56
         {
127
         {
57
           title: "序号",
128
           title: "序号",
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
           align: "center"
158
           align: "center"
73
         },
159
         },
74
         {
160
         {
75
-          title: "学校数",
76
-          key: "schoolnum",
161
+          title: "设备型号",
162
+          key: "deviceModel",
77
           align: "center"
163
           align: "center"
78
         },
164
         },
79
         {
165
         {
80
-          title: "用户数",
81
-          key: "usernum",
166
+          title: "状态",
167
+          slot: "onlineSlot",
168
+          width: 70,
82
           align: "center"
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
           align: "center"
181
           align: "center"
88
         },
182
         },
89
         {
183
         {
96
     };
190
     };
97
   },
191
   },
98
   created() {
192
   created() {
193
+    this.getRegionList();
99
     this.searchList();
194
     this.searchList();
100
   },
195
   },
101
   computed: {
196
   computed: {
104
     }
199
     }
105
   },
200
   },
106
   methods: {
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
     searchList() {
213
     searchList() {
109
       this.searchForm.page = 1;
214
       this.searchForm.page = 1;
137
         }
242
         }
138
       });
243
       });
139
     },
244
     },
245
+    toView() {
246
+      this.viewInfo.show = true;
247
+    },
140
     toExport(row) {
248
     toExport(row) {
141
       let form = {
249
       let form = {
142
         rtype: this.powerParams.rtype,
250
         rtype: this.powerParams.rtype,

+ 114
- 0
src/views/platformSection/deviceManage/deviceManagePwd/deviceManagePwd.vue View File

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 View File

71
               class="drop_down_list_item"
71
               class="drop_down_list_item"
72
               >设备导出</router-link
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
           </div>
81
           </div>
75
         </div>
82
         </div>
76
         <div :class="['module_item drop_down', logSelected ? 'selected' : '']">
83
         <div :class="['module_item drop_down', logSelected ? 'selected' : '']">
120
     deviceManageSelected() {
127
     deviceManageSelected() {
121
       return (
128
       return (
122
         this.$route.path.includes("/platform/deviceManageImport") ||
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 View File

264
   data() {
264
   data() {
265
     // 重复密码验证
265
     // 重复密码验证
266
     const pwdAgainCheck = async (rule, value, callback) => {
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
         return callback(new Error("密码格式不正确。"));
270
         return callback(new Error("密码格式不正确。"));
269
       } else if (this.adminInfo.loginpwd != this.adminInfo.loginpwd1) {
271
       } else if (this.adminInfo.loginpwd != this.adminInfo.loginpwd1) {
270
         return callback(new Error("两次输入密码不一致!"));
272
         return callback(new Error("两次输入密码不一致!"));

+ 11
- 7
src/views/platformSection/regionManage/regionManage.vue View File

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

+ 1
- 0
src/views/schoolSection/applicationStrategy/appStrategyManage.vue View File

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

Loading…
Cancel
Save