Browse Source

Merge commit 'eee9780ecb7ec319c88b2c6fb6b147e98a518cfc' into gzb

# Conflicts:
#	public/iconfont/demo_index.html
#	public/iconfont/iconfont.css
#	public/iconfont/iconfont.ttf
#	public/iconfont/iconfont.woff
#	public/iconfont/iconfont.woff2
gzb
guozhongbo 9 months ago
parent
commit
3583cef761

+ 6
- 0
src/api/class.js View File

@@ -0,0 +1,6 @@
1
+import { setRequest } from "@/utils/httpRequest";
2
+
3
+/**
4
+ * 3.2.2用户--学校下班级列表
5
+ */
6
+export const class_list = (data) => setRequest("class/list", data);

+ 32
- 0
src/api/device_manager.js View File

@@ -0,0 +1,32 @@
1
+import { setRequest } from "@/utils/httpRequest";
2
+
3
+/**
4
+ * 11.1.1设备管理--在线设备列表
5
+ */
6
+export const device_manager_list_od = (data) =>
7
+  setRequest("device_manager/list_od", data);
8
+/**
9
+ * 11.1.2设备管理--疑似托管设备列表
10
+ */
11
+export const device_manager_list_hd = (data) =>
12
+  setRequest("device_manager/list_hd", data);
13
+/**
14
+ * 11.1.3设备管理--违规设备列表
15
+ */
16
+export const device_manager_list_vd = (data) =>
17
+  setRequest("device_manager/list_vd", data);
18
+/**
19
+ * 11.1.4设备管理--设备管理列表
20
+ */
21
+export const device_manager_list_d = (data) =>
22
+  setRequest("device_manager/list_d", data);
23
+/**
24
+ * 11.1.4.2设备管理--设备导出列表
25
+ */
26
+export const device_manager_export_d = (data) =>
27
+  setRequest("device_manager/export_d", data);
28
+/**
29
+ * 11.1.4.3设备管理--安装应用导出列表
30
+ */
31
+export const device_manager_export_id = (data) =>
32
+  setRequest("device_manager/export_id", data);

+ 13
- 1
src/utils/exportToExcel.js View File

@@ -59,13 +59,25 @@ const openDownloadDialog = (blob, fileName) => {
59 59
 };
60 60
 /**
61 61
  * 导出Excel表格
62
- * @param sheetListInfo {list:数组数据, name: sheet名称}
62
+ * @param sheetListInfo sheet列表信息 [{list:数组数据, name: sheet名称}]
63 63
  * @param excelName Excel表格名称
64 64
  */
65 65
 export const exportToExcel = (sheetListInfo, excelName) => {
66 66
   const wb = XLSX2.utils.book_new();
67 67
   for (const sheetItem of sheetListInfo) {
68 68
     const sheet = XLSX2.utils.json_to_sheet(sheetItem.list);
69
+    // 设置每个单元格的样式
70
+    let range = XLSX.utils.decode_range(sheet["!ref"]);
71
+    for (let R = range.s.r; R <= range.e.r; ++R) {
72
+      for (let C = range.s.c; C <= range.e.c; ++C) {
73
+        let cell_ref = XLSX.utils.encode_cell({ r: R, c: C });
74
+        let cell = sheet[cell_ref];
75
+        if (cell) {
76
+          if (!cell.s) cell.s = {};
77
+          cell.s.alignment = { horizontal: "center", vertical: "middle" };
78
+        }
79
+      }
80
+    }
69 81
     XLSX2.utils.book_append_sheet(wb, sheet, sheetItem.name);
70 82
   }
71 83
   const workbookBlob = workbook2blob(wb);

+ 25
- 5
src/views/platformSection/log/deviceExport.vue View File

@@ -10,9 +10,9 @@
10 10
           style="width: 150px"
11 11
         />
12 12
       </div>
13
-      <!-- <Button type="primary" class="primary_btn" @click="toExport()"
13
+      <Button type="primary" class="primary_btn" @click="toExport()"
14 14
         >导出</Button
15
-      > -->
15
+      >
16 16
     </div>
17 17
     <div class="table_wrap">
18 18
       <Table :columns="columns" :data="searchForm.list">
@@ -40,6 +40,7 @@
40 40
 </template>
41 41
 
42 42
 <script>
43
+import { exportToExcel } from "@/utils/exportToExcel";
43 44
 import { logDeviceBind_list, logDeviceBind_list_all } from "@/api/log";
44 45
 export default {
45 46
   data() {
@@ -129,10 +130,29 @@ export default {
129 130
         }
130 131
       });
131 132
     },
132
-    toExport() {
133
-      logDeviceBind_list_all({}).then((data) => {
133
+    toExport(row) {
134
+      let form = {};
135
+      if (row) {
136
+        form.regionid = row.regionid;
137
+      }
138
+      logDeviceBind_list_all(form).then((data) => {
134 139
         if (data.code === 0) {
135
-          console.log("---logDeviceBind_list_all---->", data.obj);
140
+          exportToExcel(
141
+            [
142
+              {
143
+                list: data.obj.map((item) => {
144
+                  return {
145
+                    区域名称: item.regionName,
146
+                    学校数: item.schoolnum,
147
+                    用户数: item.usernum,
148
+                    设备数: item.snnum
149
+                  };
150
+                }),
151
+                name: "设备导出"
152
+              }
153
+            ],
154
+            `设备导出`
155
+          );
136 156
         } else {
137 157
           this.$Message.error(data.msg);
138 158
         }

+ 256
- 4
src/views/schoolSection/deviceManage/breakRuleDevice.vue View File

@@ -1,14 +1,266 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Select
6
+          v-model="searchForm.handled"
7
+          style="margin-right: 10px; width: 120px"
8
+          placeholder="关注状态"
9
+          @on-change="searchList()"
10
+        >
11
+          <Option :value="0">未处理</Option>
12
+          <Option :value="1">已处理</Option>
13
+        </Select>
14
+        <Input
15
+          v-model="searchForm.name"
16
+          placeholder="请输入姓名、账号、设备号、型号"
17
+          search
18
+          @on-search="searchList()"
19
+          style="width: 260px"
20
+        />
21
+      </div>
22
+      <div class="search_right">
23
+        <Dropdown @on-click="dropdownSelected">
24
+          <div class="drop_btn">
25
+            其他操作<Icon type="ios-arrow-down" class="arrow_down" />
26
+          </div>
27
+          <DropdownMenu slot="list">
28
+            <DropdownItem name="1">恢复出厂设置</DropdownItem>
29
+            <DropdownItem name="2">发送消息</DropdownItem>
30
+            <DropdownItem name="3">解除限制</DropdownItem>
31
+            <DropdownItem name="4">限制使用</DropdownItem>
32
+            <DropdownItem name="5">更新策略</DropdownItem>
33
+            <DropdownItem name="6">重启设备</DropdownItem>
34
+            <DropdownItem name="7">合理处理</DropdownItem>
35
+          </DropdownMenu>
36
+        </Dropdown>
37
+      </div>
38
+    </div>
39
+    <div class="table_wrap">
40
+      <Table
41
+        :columns="columns"
42
+        :data="searchForm.list"
43
+        @on-selection-change="selectionChange"
44
+      >
45
+        <template slot-scope="{ row }" slot="actionSlot">
46
+          <div class="action_list">
47
+            <div @click="toDetail(row)">违规详情</div>
48
+            <div @click="toRestore(row)">恢复出厂</div>
49
+            <div @click="toHandle(row)">合规处理</div>
50
+          </div>
51
+        </template>
52
+      </Table>
53
+    </div>
54
+    <div class="page_wrap">
55
+      <Page
56
+        :transfer="true"
57
+        :total="searchForm.total"
58
+        :current="searchForm.page"
59
+        :page-size="searchForm.size"
60
+        :page-size-opts="[10, 20, 40, 60]"
61
+        @on-change="pageChange"
62
+        @on-page-size-change="pageSizeChange"
63
+        show-total
64
+        show-sizer
65
+      ></Page>
66
+    </div>
67
+  </div>
3 68
 </template>
4 69
 
5 70
 <script>
71
+import { device_manager_list_vd } from "@/api/device_manager";
6 72
 export default {
7 73
   data() {
8
-    return {};
74
+    return {
75
+      searchForm: {
76
+        name: "",
77
+        // 是否处理:0否 1是
78
+        handled: 0,
79
+        page: 1,
80
+        size: 10,
81
+        list: [],
82
+        total: 0
83
+      },
84
+      tableSelection: [],
85
+      columns: [
86
+        {
87
+          type: "selection",
88
+          width: 60,
89
+          align: "center"
90
+        },
91
+        {
92
+          title: "序号",
93
+          align: "center",
94
+          width: 70,
95
+          render: (h, params) => {
96
+            return h(
97
+              "span",
98
+              params.index +
99
+                (this.searchForm.page - 1) * this.searchForm.size +
100
+                1
101
+            );
102
+          }
103
+        },
104
+        {
105
+          title: "登录账号",
106
+          key: "loginname",
107
+          align: "center"
108
+        },
109
+        {
110
+          title: "姓名",
111
+          key: "username",
112
+          align: "center"
113
+        },
114
+        {
115
+          title: "设备名称",
116
+          key: "device",
117
+          align: "center"
118
+        },
119
+        {
120
+          title: "设备型号",
121
+          key: "deviceModel",
122
+          align: "center"
123
+        },
124
+        {
125
+          title: "ID(IMEI/MEID/ESN)",
126
+          key: "sn",
127
+          align: "center"
128
+        },
129
+        {
130
+          title: "Rom版本",
131
+          key: "romVersion",
132
+          align: "center"
133
+        },
134
+        {
135
+          title: "更新时间",
136
+          key: "lasttime",
137
+          width: 190,
138
+          align: "center"
139
+        },
140
+        {
141
+          title: "操作中",
142
+          key: "num",
143
+          width: 100,
144
+          align: "center"
145
+        },
146
+        {
147
+          title: "操作",
148
+          slot: "actionSlot",
149
+          width: 260,
150
+          align: "center"
151
+        }
152
+      ]
153
+    };
9 154
   },
10
-  methods: {}
155
+  created() {
156
+    this.searchList();
157
+  },
158
+  methods: {
159
+    // 搜索
160
+    searchList() {
161
+      this.searchForm.page = 1;
162
+      this.getList();
163
+    },
164
+    // 页码改变
165
+    pageChange(page) {
166
+      this.searchForm.page = page;
167
+      this.getList();
168
+    },
169
+    // 每页显示数量改变
170
+    pageSizeChange(size) {
171
+      this.searchForm.size = size;
172
+      this.searchForm.page = 1;
173
+      this.getList();
174
+    },
175
+    // 获取列表
176
+    getList() {
177
+      this.tableSelection = [];
178
+      device_manager_list_vd({
179
+        page: this.searchForm.page,
180
+        size: this.searchForm.size,
181
+        schoolid: 4,
182
+        handled: this.searchForm.handled,
183
+        name: this.searchForm.name
184
+      }).then((data) => {
185
+        if (data.code === 0) {
186
+          // this.searchForm.list = data.obj.data;
187
+          this.searchForm.total = data.obj.total;
188
+        } else {
189
+          this.$Message.error(data.msg);
190
+        }
191
+      });
192
+    },
193
+    // 违规详情
194
+    toDetail() {},
195
+    // 恢复出厂
196
+    toRestore() {},
197
+    // 合规处理
198
+    toHandle() {},
199
+    selectionChange(selection) {
200
+      this.tableSelection = selection;
201
+    },
202
+    // 其他操作
203
+    dropdownSelected(name) {
204
+      if (this.tableSelection.length === 0) {
205
+        this.$Message.error("请选择列表");
206
+        return;
207
+      }
208
+      if (name === "1") {
209
+        // 恢复出厂设置
210
+      } else if (name === "2") {
211
+        // 发送消息
212
+      } else if (name === "3") {
213
+        // 解除限制
214
+      } else if (name === "4") {
215
+        // 限制使用
216
+      } else if (name === "5") {
217
+        // 更新策略
218
+      } else if (name === "6") {
219
+        // 重启设备
220
+      } else if (name === "7") {
221
+        // 合理处理
222
+      }
223
+    }
224
+  }
11 225
 };
12 226
 </script>
13 227
 
14
-<style lang="less" scoped></style>
228
+<style lang="less" scoped>
229
+.main_root {
230
+  .search_header {
231
+    display: flex;
232
+    justify-content: space-between;
233
+    align-items: center;
234
+    margin: 16px 16px;
235
+    .search_left {
236
+      display: flex;
237
+      justify-content: flex-start;
238
+      align-items: center;
239
+    }
240
+    .search_right {
241
+      display: flex;
242
+      justify-content: flex-start;
243
+      align-items: center;
244
+      /deep/.ivu-dropdown {
245
+        &:hover {
246
+          .arrow_down {
247
+            transform: rotate(180deg);
248
+          }
249
+        }
250
+      }
251
+      .drop_btn {
252
+        padding: 0 6px 0 10px;
253
+        line-height: 30px;
254
+        border-radius: 8px;
255
+        border: 1px solid #d8dce9;
256
+        cursor: pointer;
257
+        .arrow_down {
258
+          margin: 4px;
259
+          color: #96acdf;
260
+          transition: all 0.2s ease-in-out;
261
+        }
262
+      }
263
+    }
264
+  }
265
+}
266
+</style>

+ 470
- 4
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -1,14 +1,480 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">
3
+    <div class="main_left">
4
+      <div class="main_left_title">所有设备</div>
5
+      <div class="class_list">
6
+        <div
7
+          :class="['class_item', !searchForm.classid ? 'selceted' : '']"
8
+          @click="classChange(null)"
9
+        >
10
+          {{ schoolInfo.schoolname }}
11
+        </div>
12
+        <div
13
+          :class="[
14
+            'class_item',
15
+            searchForm.classid === classItem.id ? 'selceted' : ''
16
+          ]"
17
+          v-for="classItem in schoolInfo.classList"
18
+          :key="classItem.id"
19
+          @click="classChange(classItem.id)"
20
+        >
21
+          {{ classItem.name }}
22
+        </div>
23
+      </div>
24
+    </div>
25
+    <div class="main_right">
26
+      <div class="search_header">
27
+        <div class="search_left">
28
+          <Select
29
+            v-model="searchForm.atype"
30
+            style="margin-right: 10px; width: 120px"
31
+            placeholder="关注状态"
32
+            @on-change="searchList()"
33
+          >
34
+            <Option :value="0">全部</Option>
35
+            <Option :value="1">重点关注</Option>
36
+            <Option :value="2">不关注</Option>
37
+          </Select>
38
+          <Input
39
+            v-model="searchForm.name"
40
+            placeholder="请输入名姓名、登录名、设备名、型号"
41
+            search
42
+            @on-search="searchList()"
43
+            style="width: 280px"
44
+          />
45
+        </div>
46
+        <div class="search_right">
47
+          <Button
48
+            type="primary"
49
+            class="primary_btn"
50
+            style="margin-right: 10px"
51
+            @click="toDeviceExport()"
52
+            >设备导出</Button
53
+          >
54
+          <Button
55
+            type="primary"
56
+            class="primary_btn"
57
+            style="margin-right: 10px"
58
+            @click="toInstallingAppExport()"
59
+            >安装应用导出</Button
60
+          >
61
+          <Dropdown @on-click="dropdownSelected">
62
+            <div class="drop_btn">
63
+              其他操作<Icon type="ios-arrow-down" class="arrow_down" />
64
+            </div>
65
+            <DropdownMenu slot="list">
66
+              <DropdownItem name="1">恢复出厂设置</DropdownItem>
67
+              <DropdownItem name="2">发送消息</DropdownItem>
68
+              <DropdownItem name="3">整班发送消息</DropdownItem>
69
+              <DropdownItem name="4">解除限制</DropdownItem>
70
+              <DropdownItem name="5">限制使用</DropdownItem>
71
+              <DropdownItem name="6">更新策略</DropdownItem>
72
+              <DropdownItem name="7">重启设备</DropdownItem>
73
+            </DropdownMenu>
74
+          </Dropdown>
75
+        </div>
76
+      </div>
77
+      <div class="table_wrap">
78
+        <Table
79
+          :columns="columns"
80
+          :data="searchForm.list"
81
+          @on-selection-change="selectionChange"
82
+        >
83
+          <template slot-scope="{ row }" slot="onlineSlot">
84
+            <!-- 1在线2离线 -->
85
+            <div v-if="row.online === 1">在线</div>
86
+            <div v-else-if="row.online === 2">离线</div>
87
+          </template>
88
+          <template slot-scope="{ row }" slot="actionSlot">
89
+            <div class="action_list">
90
+              <div @click="toView(row)">查看</div>
91
+              <div @click="toStrategy(row)">策略</div>
92
+              <div @click="toPsw(row)">设备密码</div>
93
+            </div>
94
+          </template>
95
+        </Table>
96
+      </div>
97
+      <div class="page_wrap">
98
+        <Page
99
+          :transfer="true"
100
+          :total="searchForm.total"
101
+          :current="searchForm.page"
102
+          :page-size="searchForm.size"
103
+          :page-size-opts="[10, 20, 40, 60]"
104
+          @on-change="pageChange"
105
+          @on-page-size-change="pageSizeChange"
106
+          show-total
107
+          show-sizer
108
+        ></Page>
109
+      </div>
110
+    </div>
111
+  </div>
3 112
 </template>
4 113
 
5 114
 <script>
115
+import { exportToExcel } from "@/utils/exportToExcel";
116
+import { class_list } from "@/api/class";
117
+import {
118
+  device_manager_list_d,
119
+  device_manager_export_d,
120
+  device_manager_export_id
121
+} from "@/api/device_manager";
6 122
 export default {
7 123
   data() {
8
-    return {};
124
+    return {
125
+      searchForm: {
126
+        classid: null,
127
+        atype: 0,
128
+        name: "",
129
+        page: 1,
130
+        size: 10,
131
+        list: [],
132
+        total: 0
133
+      },
134
+      tableSelection: [],
135
+      schoolInfo: {
136
+        schoolid: null,
137
+        schoolname: null,
138
+        classList: []
139
+      },
140
+      columns: [
141
+        {
142
+          type: "selection",
143
+          width: 60,
144
+          align: "center"
145
+        },
146
+        {
147
+          title: "序号",
148
+          align: "center",
149
+          width: 70,
150
+          render: (h, params) => {
151
+            return h(
152
+              "span",
153
+              params.index +
154
+                (this.searchForm.page - 1) * this.searchForm.size +
155
+                1
156
+            );
157
+          }
158
+        },
159
+        {
160
+          title: "登录账号",
161
+          key: "loginname",
162
+          align: "center"
163
+        },
164
+        {
165
+          title: "姓名",
166
+          key: "username",
167
+          align: "center"
168
+        },
169
+        {
170
+          title: "在线状态",
171
+          slot: "onlineSlot",
172
+          align: "center"
173
+        },
174
+        {
175
+          title: "设备型号",
176
+          key: "deviceModel",
177
+          align: "center"
178
+        },
179
+        {
180
+          title: "ID(IMEI/MEID/ESN)",
181
+          key: "sn",
182
+          align: "center"
183
+        },
184
+        {
185
+          title: "Rom版本",
186
+          key: "romVersion",
187
+          align: "center"
188
+        },
189
+        {
190
+          title: "更新时间",
191
+          key: "updatetime",
192
+          width: 190,
193
+          align: "center"
194
+        },
195
+        {
196
+          title: "操作",
197
+          slot: "actionSlot",
198
+          width: 200,
199
+          align: "center"
200
+        }
201
+      ]
202
+    };
9 203
   },
10
-  methods: {}
204
+  created() {
205
+    this.getClassList();
206
+  },
207
+  methods: {
208
+    classChange(classid) {
209
+      this.searchForm.classid = classid;
210
+      this.searchList();
211
+    },
212
+    // 搜索
213
+    searchList() {
214
+      this.searchForm.page = 1;
215
+      this.getList();
216
+    },
217
+    // 页码改变
218
+    pageChange(page) {
219
+      this.searchForm.page = page;
220
+      this.getList();
221
+    },
222
+    // 每页显示数量改变
223
+    pageSizeChange(size) {
224
+      this.searchForm.size = size;
225
+      this.searchForm.page = 1;
226
+      this.getList();
227
+    },
228
+    // 获取班级列表
229
+    getClassList() {
230
+      console.warn("class_list----");
231
+      class_list({
232
+        schoolid: 1
233
+      }).then((data) => {
234
+        if (data.code === 0) {
235
+          this.schoolInfo = {
236
+            schoolid: data.obj.id,
237
+            schoolname: data.obj.name,
238
+            classList: data.obj.children
239
+          };
240
+          this.searchList();
241
+        } else {
242
+          this.$Message.error(data.msg);
243
+        }
244
+      });
245
+    },
246
+    // 获取列表
247
+    getList() {
248
+      this.tableSelection = [];
249
+      device_manager_list_d({
250
+        page: this.searchForm.page,
251
+        size: this.searchForm.size,
252
+        schoolid: this.schoolInfo.schoolid,
253
+        classid: this.searchForm.classid,
254
+        atype: this.searchForm.atype,
255
+        name: this.searchForm.name
256
+      }).then((data) => {
257
+        if (data.code === 0) {
258
+          this.searchForm.list = data.obj.data;
259
+          this.searchForm.total = data.obj.total;
260
+        } else {
261
+          this.$Message.error(data.msg);
262
+        }
263
+      });
264
+    },
265
+    // 设备导出
266
+    toDeviceExport() {
267
+      device_manager_export_d({
268
+        schoolid: this.schoolInfo.schoolid,
269
+        classid: this.searchForm.classid,
270
+        atype: this.searchForm.atype,
271
+        name: this.searchForm.name
272
+      }).then((data) => {
273
+        if (data.code === 0) {
274
+          exportToExcel(
275
+            [
276
+              {
277
+                list: data.obj.map((item) => {
278
+                  return {
279
+                    登录名: item.loginname,
280
+                    姓名: item.username,
281
+                    // 1在线2离线
282
+                    在线状态:
283
+                      item.online === 1
284
+                        ? "在线"
285
+                        : item.online === 2
286
+                        ? "离线"
287
+                        : "",
288
+                    设备型号: item.deviceModel,
289
+                    "ID(IMEI/MEID/ESN)": item.sn,
290
+                    Rom版本: item.romVersion,
291
+                    更新时间: item.updatetime
292
+                  };
293
+                }),
294
+                name: "设备导出"
295
+              }
296
+            ],
297
+            "设备导出"
298
+          );
299
+        } else {
300
+          this.$Message.error(data.msg);
301
+        }
302
+      });
303
+    },
304
+    // 安装应用导出
305
+    toInstallingAppExport() {
306
+      device_manager_export_id({
307
+        schoolid: this.schoolInfo.schoolid,
308
+        classid: this.searchForm.classid
309
+      }).then((data) => {
310
+        if (data.code === 0) {
311
+          exportToExcel(
312
+            [
313
+              {
314
+                list: data.obj.map((item) => {
315
+                  return {
316
+                    登录名: item.loginname,
317
+                    姓名: item.username,
318
+                    班级: item.classname,
319
+                    应用名称: item.appName,
320
+                    包名: item.appPackage,
321
+                    版本名称: item.appVersion,
322
+                    MAC地址: item.mac,
323
+                    时间: item.createtime
324
+                  };
325
+                }),
326
+                name: "安装应用导出"
327
+              }
328
+            ],
329
+            "安装应用导出"
330
+          );
331
+        } else {
332
+          this.$Message.error(data.msg);
333
+        }
334
+      });
335
+    },
336
+    // 查看
337
+    toView() {},
338
+    // 策略
339
+    toStrategy() {},
340
+    // 设备密码
341
+    toPsw() {},
342
+    selectionChange(selection) {
343
+      this.tableSelection = selection;
344
+    },
345
+    // 其他操作
346
+    dropdownSelected(name) {
347
+      if (name === "1") {
348
+        // 恢复出厂设置
349
+        if (this.tableSelection.length === 0) {
350
+          this.$Message.error("请选择列表");
351
+          return;
352
+        }
353
+      } else if (name === "2") {
354
+        // 发送消息
355
+        if (this.tableSelection.length === 0) {
356
+          this.$Message.error("请选择列表");
357
+          return;
358
+        }
359
+      } else if (name === "3") {
360
+        // 整班发送消息
361
+      } else if (name === "4") {
362
+        // 解除限制
363
+        if (this.tableSelection.length === 0) {
364
+          this.$Message.error("请选择列表");
365
+          return;
366
+        }
367
+      } else if (name === "5") {
368
+        // 限制使用
369
+        if (this.tableSelection.length === 0) {
370
+          this.$Message.error("请选择列表");
371
+          return;
372
+        }
373
+      } else if (name === "6") {
374
+        // 更新策略
375
+        if (this.tableSelection.length === 0) {
376
+          this.$Message.error("请选择列表");
377
+          return;
378
+        }
379
+      } else if (name === "7") {
380
+        // 重启设备
381
+        if (this.tableSelection.length === 0) {
382
+          this.$Message.error("请选择列表");
383
+          return;
384
+        }
385
+      }
386
+    }
387
+  }
11 388
 };
12 389
 </script>
13 390
 
14
-<style lang="less" scoped></style>
391
+<style lang="less" scoped>
392
+.main_root {
393
+  display: flex;
394
+  justify-content: space-between;
395
+  align-items: center;
396
+  height: calc(100% - 10px);
397
+  border-radius: 0;
398
+  border: none;
399
+  background-color: transparent;
400
+  .main_left {
401
+    margin-right: 10px;
402
+    width: 200px;
403
+    height: 100%;
404
+    border-radius: 15px;
405
+    border: 1px solid #e9f0f9;
406
+    background-color: #fff;
407
+    overflow: auto;
408
+    .main_left_title {
409
+      margin: 10px;
410
+      padding: 20px 0;
411
+      line-height: 20px;
412
+      font-size: 16px;
413
+      text-align: center;
414
+      color: #798cb5;
415
+      border-bottom: 1px solid #e9f0f9;
416
+    }
417
+    .class_list {
418
+      max-height: calc(100% - 82px);
419
+      font-size: 14px;
420
+      line-height: 32px;
421
+      text-align: center;
422
+      overflow: auto;
423
+      .class_item {
424
+        margin: 0 10px;
425
+        border-radius: 6px;
426
+        cursor: pointer;
427
+        &:hover,
428
+        &.selceted {
429
+          font-weight: bold;
430
+          color: #339dff;
431
+          background-color: #dbeeff;
432
+        }
433
+      }
434
+    }
435
+  }
436
+  .main_right {
437
+    width: calc(100% - 210px);
438
+    height: 100%;
439
+    border-radius: 15px;
440
+    border: 1px solid #e9f0f9;
441
+    background-color: #fff;
442
+    overflow: auto;
443
+    .search_header {
444
+      display: flex;
445
+      justify-content: space-between;
446
+      align-items: center;
447
+      margin: 16px 16px;
448
+      .search_left {
449
+        display: flex;
450
+        justify-content: flex-start;
451
+        align-items: center;
452
+      }
453
+      .search_right {
454
+        display: flex;
455
+        justify-content: flex-start;
456
+        align-items: center;
457
+        /deep/.ivu-dropdown {
458
+          &:hover {
459
+            .arrow_down {
460
+              transform: rotate(180deg);
461
+            }
462
+          }
463
+        }
464
+        .drop_btn {
465
+          padding: 0 6px 0 10px;
466
+          line-height: 30px;
467
+          border-radius: 8px;
468
+          border: 1px solid #d8dce9;
469
+          cursor: pointer;
470
+          .arrow_down {
471
+            margin: 4px;
472
+            color: #96acdf;
473
+            transition: all 0.2s ease-in-out;
474
+          }
475
+        }
476
+      }
477
+    }
478
+  }
479
+}
480
+</style>

+ 178
- 4
src/views/schoolSection/deviceManage/inLineDevice.vue View File

@@ -1,14 +1,188 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Select
6
+          v-model="searchForm.atype"
7
+          style="margin-right: 10px; width: 150px"
8
+          @on-change="searchList()"
9
+        >
10
+          <Option :value="1">在线设备</Option>
11
+          <Option :value="0">离线设备</Option>
12
+        </Select>
13
+        <Select
14
+          v-model="searchForm.doEvent"
15
+          style="margin-right: 10px; width: 150px"
16
+          @on-change="searchList()"
17
+        >
18
+          <Option :value="5">最近1小时</Option>
19
+          <Option :value="4">最近48小时</Option>
20
+          <Option :value="3">最近7天</Option>
21
+          <Option :value="2">最近14天</Option>
22
+          <Option :value="1">最近2个月</Option>
23
+        </Select>
24
+        <Input
25
+          v-model="searchForm.name"
26
+          placeholder="请输入姓名、账号、设备号、型号"
27
+          search
28
+          @on-search="searchList()"
29
+          style="width: 260px"
30
+        />
31
+      </div>
32
+    </div>
33
+    <div class="table_wrap">
34
+      <Table :columns="columns" :data="searchForm.list">
35
+        <template slot-scope="{ row }" slot="controlSlot">
36
+          <div>
37
+            {{
38
+              row.control === 1 ? "管控中" : row.control === 2 ? "解除管控" : ""
39
+            }}
40
+          </div>
41
+        </template>
42
+      </Table>
43
+    </div>
44
+    <div class="page_wrap">
45
+      <Page
46
+        :transfer="true"
47
+        :total="searchForm.total"
48
+        :current="searchForm.page"
49
+        :page-size="searchForm.size"
50
+        :page-size-opts="[10, 20, 40, 60]"
51
+        @on-change="pageChange"
52
+        @on-page-size-change="pageSizeChange"
53
+        show-total
54
+        show-sizer
55
+      ></Page>
56
+    </div>
57
+  </div>
3 58
 </template>
4 59
 
5 60
 <script>
61
+import { device_manager_list_od } from "@/api/device_manager";
6 62
 export default {
7 63
   data() {
8
-    return {};
64
+    return {
65
+      searchForm: {
66
+        // 1在线2离线
67
+        atype: 1,
68
+        // 1最近2个月 2最近14天 3最近7天 4最近48小时 5最近1小时
69
+        doEvent: 5,
70
+        name: "",
71
+        page: 1,
72
+        size: 10,
73
+        list: [],
74
+        total: 0
75
+      },
76
+      columns: [
77
+        {
78
+          title: "序号",
79
+          align: "center",
80
+          width: 70,
81
+          render: (h, params) => {
82
+            return h(
83
+              "span",
84
+              params.index +
85
+                (this.searchForm.page - 1) * this.searchForm.size +
86
+                1
87
+            );
88
+          }
89
+        },
90
+        {
91
+          title: "登录账号",
92
+          key: "loginname",
93
+          align: "center"
94
+        },
95
+        {
96
+          title: "姓名",
97
+          key: "username",
98
+          align: "center"
99
+        },
100
+        {
101
+          title: "设备名称",
102
+          key: "device",
103
+          align: "center"
104
+        },
105
+        {
106
+          title: "管控状态",
107
+          slot: "controlSlot",
108
+          align: "center"
109
+        },
110
+        {
111
+          title: "设备型号",
112
+          key: "deviceModel",
113
+          align: "center"
114
+        },
115
+        {
116
+          title: "ID(IMEI/MEID/ESN)",
117
+          key: "sn",
118
+          align: "center"
119
+        },
120
+        {
121
+          title: "Rom版本",
122
+          key: "romVersion",
123
+          align: "center"
124
+        },
125
+        {
126
+          title: "最后在线时间",
127
+          key: "lasttime",
128
+          width: 190,
129
+          align: "center"
130
+        }
131
+      ]
132
+    };
9 133
   },
10
-  methods: {}
134
+  created() {
135
+    this.searchList();
136
+  },
137
+  methods: {
138
+    // 搜索
139
+    searchList() {
140
+      this.searchForm.page = 1;
141
+      this.getList();
142
+    },
143
+    // 页码改变
144
+    pageChange(page) {
145
+      this.searchForm.page = page;
146
+      this.getList();
147
+    },
148
+    // 每页显示数量改变
149
+    pageSizeChange(size) {
150
+      this.searchForm.size = size;
151
+      this.searchForm.page = 1;
152
+      this.getList();
153
+    },
154
+    // 获取列表
155
+    getList() {
156
+      device_manager_list_od({
157
+        page: this.searchForm.page,
158
+        size: this.searchForm.size,
159
+        schoolid: 4,
160
+        atype: this.searchForm.atype,
161
+        doEvent: this.searchForm.doEvent,
162
+        name: this.searchForm.name
163
+      }).then((data) => {
164
+        if (data.code === 0) {
165
+          this.searchForm.list = data.obj.data;
166
+          this.searchForm.total = data.obj.total;
167
+        } else {
168
+          this.$Message.error(data.msg);
169
+        }
170
+      });
171
+    }
172
+  }
11 173
 };
12 174
 </script>
13 175
 
14
-<style lang="less" scoped></style>
176
+<style lang="less" scoped>
177
+.search_header {
178
+  display: flex;
179
+  justify-content: space-between;
180
+  align-items: center;
181
+  margin: 16px 16px;
182
+  .search_left {
183
+    display: flex;
184
+    justify-content: flex-start;
185
+    align-items: center;
186
+  }
187
+}
188
+</style>

+ 182
- 4
src/views/schoolSection/deviceManage/outControlDevice.vue View File

@@ -1,14 +1,192 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">
3
+    <div class="search_header">
4
+      <div class="search_left">
5
+        <Select
6
+          v-model="searchForm.doEvent"
7
+          style="margin-right: 10px; width: 120px"
8
+          placeholder="事件"
9
+          @on-change="searchList()"
10
+        >
11
+          <!-- 1Token变化 2一周未通信 3安装可疑应用 -->
12
+          <Option :value="1">Token变化</Option>
13
+          <Option :value="2">一周未通信</Option>
14
+          <Option :value="3">安装可疑应用</Option>
15
+        </Select>
16
+        <Select
17
+          v-model="searchForm.atype"
18
+          style="margin-right: 10px; width: 120px"
19
+          placeholder="关注状态"
20
+          @on-change="searchList()"
21
+        >
22
+          <Option :value="0">全部</Option>
23
+          <Option :value="1">重点关注</Option>
24
+          <Option :value="2">不关注</Option>
25
+        </Select>
26
+        <Select
27
+          v-if="searchForm.doEvent === 3"
28
+          v-model="searchForm.handled"
29
+          style="margin-right: 10px; width: 120px"
30
+          placeholder="关注状态"
31
+          @on-change="searchList()"
32
+        >
33
+          <Option :value="0">未处理</Option>
34
+          <Option :value="1">已处理</Option>
35
+        </Select>
36
+        <Input
37
+          v-model="searchForm.name"
38
+          placeholder="请输入姓名、账号、设备号、型号"
39
+          search
40
+          @on-search="searchList()"
41
+          style="width: 250px"
42
+        />
43
+      </div>
44
+    </div>
45
+    <div class="table_wrap">
46
+      <Table :columns="columns" :data="searchForm.list"></Table>
47
+    </div>
48
+    <div class="page_wrap">
49
+      <Page
50
+        :transfer="true"
51
+        :total="searchForm.total"
52
+        :current="searchForm.page"
53
+        :page-size="searchForm.size"
54
+        :page-size-opts="[10, 20, 40, 60]"
55
+        @on-change="pageChange"
56
+        @on-page-size-change="pageSizeChange"
57
+        show-total
58
+        show-sizer
59
+      ></Page>
60
+    </div>
61
+  </div>
3 62
 </template>
4 63
 
5 64
 <script>
65
+import { device_manager_list_hd } from "@/api/device_manager";
6 66
 export default {
7 67
   data() {
8
-    return {};
68
+    return {
69
+      searchForm: {
70
+        atype: 0,
71
+        doEvent: 1,
72
+        handled: 0,
73
+        name: "",
74
+        page: 1,
75
+        size: 10,
76
+        list: [],
77
+        total: 0
78
+      },
79
+      columns: [
80
+        {
81
+          title: "序号",
82
+          align: "center",
83
+          width: 70,
84
+          render: (h, params) => {
85
+            return h(
86
+              "span",
87
+              params.index +
88
+                (this.searchForm.page - 1) * this.searchForm.size +
89
+                1
90
+            );
91
+          }
92
+        },
93
+        {
94
+          title: "登录账号",
95
+          key: "loginname",
96
+          align: "center"
97
+        },
98
+        {
99
+          title: "姓名",
100
+          key: "username",
101
+          align: "center"
102
+        },
103
+        {
104
+          title: "班级",
105
+          key: "classname",
106
+          align: "center"
107
+        },
108
+        {
109
+          title: "设备名称",
110
+          key: "device",
111
+          align: "center"
112
+        },
113
+        {
114
+          title: "设备型号",
115
+          key: "deviceModel",
116
+          align: "center"
117
+        },
118
+        {
119
+          title: "ID(IMEI/MEID/ESN)",
120
+          key: "sn",
121
+          align: "center"
122
+        },
123
+        {
124
+          title: "Rom版本",
125
+          key: "updatename",
126
+          align: "center"
127
+        },
128
+        {
129
+          title: "Token更新时间",
130
+          key: "romVersion",
131
+          width: 190,
132
+          align: "center"
133
+        }
134
+      ]
135
+    };
9 136
   },
10
-  methods: {}
137
+  created() {
138
+    this.searchList();
139
+  },
140
+  methods: {
141
+    // 搜索
142
+    searchList() {
143
+      this.searchForm.page = 1;
144
+      this.getList();
145
+    },
146
+    // 页码改变
147
+    pageChange(page) {
148
+      this.searchForm.page = page;
149
+      this.getList();
150
+    },
151
+    // 每页显示数量改变
152
+    pageSizeChange(size) {
153
+      this.searchForm.size = size;
154
+      this.searchForm.page = 1;
155
+      this.getList();
156
+    },
157
+    // 获取列表
158
+    getList() {
159
+      device_manager_list_hd({
160
+        page: this.searchForm.page,
161
+        size: this.searchForm.size,
162
+        schoolid: 4,
163
+        name: this.searchForm.name,
164
+        atype: this.searchForm.atype,
165
+        doEvent: this.searchForm.doEvent,
166
+        handled: this.searchForm.handled
167
+      }).then((data) => {
168
+        if (data.code === 0) {
169
+          this.searchForm.list = data.obj.data;
170
+          this.searchForm.total = data.obj.total;
171
+        } else {
172
+          this.$Message.error(data.msg);
173
+        }
174
+      });
175
+    }
176
+  }
11 177
 };
12 178
 </script>
13 179
 
14
-<style lang="less" scoped></style>
180
+<style lang="less" scoped>
181
+.search_header {
182
+  display: flex;
183
+  justify-content: space-between;
184
+  align-items: center;
185
+  margin: 16px 16px;
186
+  .search_left {
187
+    display: flex;
188
+    justify-content: flex-start;
189
+    align-items: center;
190
+  }
191
+}
192
+</style>

+ 1
- 1
src/views/schoolSection/deviceManage/parentControlDevice.vue View File

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="main_root"></div>
2
+  <div class="main_root">不做</div>
3 3
 </template>
4 4
 
5 5
 <script>

+ 156
- 4
src/views/schoolSection/deviceManage/removeControlDevice.vue View File

@@ -1,14 +1,166 @@
1 1
 <template>
2
-  <div class="main_root"></div>
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: 260px"
11
+        />
12
+      </div>
13
+    </div>
14
+    <div class="table_wrap">
15
+      <Table :columns="columns" :data="searchForm.list">
16
+        <template slot-scope="{ row }" slot="controlSlot">
17
+          <div>
18
+            {{
19
+              row.control === 1 ? "管控中" : row.control === 2 ? "解除管控" : ""
20
+            }}
21
+          </div>
22
+        </template>
23
+      </Table>
24
+    </div>
25
+    <div class="page_wrap">
26
+      <Page
27
+        :transfer="true"
28
+        :total="searchForm.total"
29
+        :current="searchForm.page"
30
+        :page-size="searchForm.size"
31
+        :page-size-opts="[10, 20, 40, 60]"
32
+        @on-change="pageChange"
33
+        @on-page-size-change="pageSizeChange"
34
+        show-total
35
+        show-sizer
36
+      ></Page>
37
+    </div>
38
+  </div>
3 39
 </template>
4 40
 
5 41
 <script>
42
+import { device_manager_list_od } from "@/api/device_manager";
6 43
 export default {
7 44
   data() {
8
-    return {};
45
+    return {
46
+      searchForm: {
47
+        pushType: 2,
48
+        name: "",
49
+        page: 1,
50
+        size: 10,
51
+        list: [],
52
+        total: 0
53
+      },
54
+      columns: [
55
+        {
56
+          title: "序号",
57
+          align: "center",
58
+          width: 70,
59
+          render: (h, params) => {
60
+            return h(
61
+              "span",
62
+              params.index +
63
+                (this.searchForm.page - 1) * this.searchForm.size +
64
+                1
65
+            );
66
+          }
67
+        },
68
+        {
69
+          title: "登录账号",
70
+          key: "loginname",
71
+          align: "center"
72
+        },
73
+        {
74
+          title: "姓名",
75
+          key: "username",
76
+          align: "center"
77
+        },
78
+        {
79
+          title: "设备名称",
80
+          key: "device",
81
+          align: "center"
82
+        },
83
+        {
84
+          title: "管控状态",
85
+          slot: "controlSlot",
86
+          align: "center"
87
+        },
88
+        {
89
+          title: "设备型号",
90
+          key: "deviceModel",
91
+          align: "center"
92
+        },
93
+        {
94
+          title: "ID(IMEI/MEID/ESN)",
95
+          key: "sn",
96
+          align: "center"
97
+        },
98
+        {
99
+          title: "Rom版本",
100
+          key: "romVersion",
101
+          align: "center"
102
+        },
103
+        {
104
+          title: "更新时间",
105
+          key: "updatetime",
106
+          width: 190,
107
+          align: "center"
108
+        }
109
+      ]
110
+    };
9 111
   },
10
-  methods: {}
112
+  created() {
113
+    this.searchList();
114
+  },
115
+  methods: {
116
+    // 搜索
117
+    searchList() {
118
+      this.searchForm.page = 1;
119
+      this.getList();
120
+    },
121
+    // 页码改变
122
+    pageChange(page) {
123
+      this.searchForm.page = page;
124
+      this.getList();
125
+    },
126
+    // 每页显示数量改变
127
+    pageSizeChange(size) {
128
+      this.searchForm.size = size;
129
+      this.searchForm.page = 1;
130
+      this.getList();
131
+    },
132
+    // 获取列表
133
+    getList() {
134
+      device_manager_list_od({
135
+        page: this.searchForm.page,
136
+        size: this.searchForm.size,
137
+        schoolid: 4,
138
+        atype: this.searchForm.atype,
139
+        doEvent: this.searchForm.doEvent,
140
+        name: this.searchForm.name
141
+      }).then((data) => {
142
+        if (data.code === 0) {
143
+          this.searchForm.list = data.obj.data;
144
+          this.searchForm.total = data.obj.total;
145
+        } else {
146
+          this.$Message.error(data.msg);
147
+        }
148
+      });
149
+    }
150
+  }
11 151
 };
12 152
 </script>
13 153
 
14
-<style lang="less" scoped></style>
154
+<style lang="less" scoped>
155
+.search_header {
156
+  display: flex;
157
+  justify-content: space-between;
158
+  align-items: center;
159
+  margin: 16px 16px;
160
+  .search_left {
161
+    display: flex;
162
+    justify-content: flex-start;
163
+    align-items: center;
164
+  }
165
+}
166
+</style>

+ 2
- 2
src/views/schoolSection/index.vue View File

@@ -99,13 +99,13 @@
99 99
               class="drop_down_list_item"
100 100
               >解除管控设备</router-link
101 101
             >
102
-            <router-link
102
+            <!-- <router-link
103 103
               @click.native="routeDropdownChange()"
104 104
               tag="div"
105 105
               to="/school/parentControlDevice"
106 106
               class="drop_down_list_item"
107 107
               >家长管控设备</router-link
108
-            >
108
+            > -->
109 109
             <router-link
110 110
               @click.native="routeDropdownChange()"
111 111
               tag="div"

+ 2
- 0
src/views/schoolSection/log/admin.vue View File

@@ -120,6 +120,8 @@ export default {
120 120
       let _enddate = this.searchForm.dataRange[1];
121 121
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
122 122
       logOperate_list({
123
+        regionid: 1,
124
+        schoolid: 1,
123 125
         page: this.searchForm.page,
124 126
         size: this.searchForm.size,
125 127
         begindate: _begindate,

+ 4
- 1
src/views/schoolSection/log/appLaunch.vue View File

@@ -94,7 +94,7 @@ export default {
94 94
         },
95 95
         {
96 96
           title: "姓名",
97
-          key: "aname",
97
+          key: "username",
98 98
           align: "center"
99 99
         },
100 100
         {
@@ -110,6 +110,7 @@ export default {
110 110
         {
111 111
           title: "违规",
112 112
           slot: "violatedSlot",
113
+          width: 70,
113 114
           align: "center"
114 115
         },
115 116
         {
@@ -148,6 +149,8 @@ export default {
148 149
       let _enddate = this.searchForm.dataRange[1];
149 150
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
150 151
       logAppStart_list_start({
152
+        regionid: 1,
153
+        schoolid: 1,
151 154
         page: this.searchForm.page,
152 155
         size: this.searchForm.size,
153 156
         begindate: _begindate,

+ 3
- 1
src/views/schoolSection/log/applicationDownload.vue View File

@@ -86,7 +86,7 @@ export default {
86 86
         },
87 87
         {
88 88
           title: "姓名",
89
-          key: "aname",
89
+          key: "username",
90 90
           align: "center"
91 91
         },
92 92
         {
@@ -140,6 +140,8 @@ export default {
140 140
       let _enddate = this.searchForm.dataRange[1];
141 141
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
142 142
       logAppDown_list({
143
+        regionid: 1,
144
+        schoolid: 1,
143 145
         page: this.searchForm.page,
144 146
         size: this.searchForm.size,
145 147
         begindate: _begindate,

+ 50
- 1
src/views/schoolSection/log/deviceEvents.vue View File

@@ -72,6 +72,7 @@
72 72
 
73 73
 <script>
74 74
 import { dateFormat, doEventInfo } from "@/utils";
75
+import { exportToExcel } from "@/utils/exportToExcel";
75 76
 import { logdoperate_list_event } from "@/api/log";
76 77
 export default {
77 78
   data() {
@@ -138,6 +139,7 @@ export default {
138 139
         {
139 140
           title: "违规",
140 141
           slot: "violatedSlot",
142
+          width: 70,
141 143
           align: "center"
142 144
         },
143 145
         {
@@ -176,6 +178,8 @@ export default {
176 178
       let _enddate = this.searchForm.dataRange[1];
177 179
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
178 180
       logdoperate_list_event({
181
+        regionid: 3,
182
+        schoolid: 1,
179 183
         page: this.searchForm.page,
180 184
         size: this.searchForm.size,
181 185
         doEvent: this.searchForm.doEvent,
@@ -191,7 +195,52 @@ export default {
191 195
         }
192 196
       });
193 197
     },
194
-    toExport() {}
198
+    toExport() {
199
+      let _begindate = this.searchForm.dataRange[0];
200
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
201
+      let _enddate = this.searchForm.dataRange[1];
202
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
203
+      logdoperate_list_event({
204
+        regionid: 3,
205
+        schoolid: 1,
206
+        doEvent: this.searchForm.doEvent,
207
+        begindate: _begindate,
208
+        enddate: _enddate,
209
+        name: this.searchForm.name
210
+      }).then((data) => {
211
+        if (data.code === 0) {
212
+          exportToExcel(
213
+            [
214
+              {
215
+                list: data.obj.data.map((item) => {
216
+                  return {
217
+                    学校名称: item.schoolName,
218
+                    班级: item.classname,
219
+                    登录名: item.loginname,
220
+                    姓名: item.username,
221
+                    设备号码: item.sn,
222
+                    事件: this.doEventInfo[item.doEvent],
223
+                    描述: item.comm,
224
+                    // 0不违规1违规
225
+                    违规:
226
+                      item.violated === 1
227
+                        ? "违规"
228
+                        : item.violated === 0
229
+                        ? "不违规"
230
+                        : "",
231
+                    时间: item.createtime
232
+                  };
233
+                }),
234
+                name: "设备事件日志"
235
+              }
236
+            ],
237
+            "设备事件日志"
238
+          );
239
+        } else {
240
+          this.$Message.error(data.msg);
241
+        }
242
+      });
243
+    }
195 244
   }
196 245
 };
197 246
 </script>

+ 89
- 18
src/views/schoolSection/log/deviceExport.vue View File

@@ -2,13 +2,13 @@
2 2
   <div class="main_root">
3 3
     <div class="search_header">
4 4
       <div class="search_left">
5
-        <Input
5
+        <!-- <Input
6 6
           v-model="searchForm.name"
7 7
           placeholder="请输入名称"
8 8
           search
9 9
           @on-search="searchList()"
10 10
           style="width: 150px"
11
-        />
11
+        /> -->
12 12
       </div>
13 13
       <Button type="primary" class="primary_btn" @click="toExport()"
14 14
         >导出</Button
@@ -16,9 +16,11 @@
16 16
     </div>
17 17
     <div class="table_wrap">
18 18
       <Table :columns="columns" :data="searchForm.list">
19
-        <template slot-scope="{ row }" slot="actionSlot">
19
+        <template slot-scope="{ row }" slot="violatedSlot">
20 20
           <div class="action_list">
21
-            <div @click="toExport(row)">导出</div>
21
+            <!-- 0不违规1违规 -->
22
+            <div v-if="row.violated === 1" class="action_success">是</div>
23
+            <div v-else-if="row.violated === 0" class="action_error">否</div>
22 24
           </div>
23 25
         </template>
24 26
       </Table>
@@ -40,7 +42,8 @@
40 42
 </template>
41 43
 
42 44
 <script>
43
-import { logDeviceBind_list } from "@/api/log";
45
+import { exportToExcel } from "@/utils/exportToExcel";
46
+import { logDeviceBind_list_school } from "@/api/log";
44 47
 export default {
45 48
   data() {
46 49
     return {
@@ -66,29 +69,55 @@ export default {
66 69
           }
67 70
         },
68 71
         {
69
-          title: "区域名称",
70
-          key: "regionName",
72
+          title: "学校名称",
73
+          key: "schoolName",
71 74
           align: "center"
72 75
         },
73 76
         {
74
-          title: "学校数",
75
-          key: "schoolnum",
77
+          title: "班级",
78
+          key: "classname",
76 79
           align: "center"
77 80
         },
78 81
         {
79
-          title: "用户数",
80
-          key: "usernum",
82
+          title: "登录名",
83
+          key: "loginname",
81 84
           align: "center"
82 85
         },
83 86
         {
84
-          title: "设备数",
85
-          key: "snnum",
87
+          title: "姓名",
88
+          key: "username",
86 89
           align: "center"
87 90
         },
88 91
         {
89
-          title: "操作",
90
-          slot: "actionSlot",
91
-          width: 90,
92
+          title: "设备号码",
93
+          key: "deviceMac",
94
+          align: "center"
95
+        },
96
+        {
97
+          title: "设备型号",
98
+          key: "deviceModel",
99
+          align: "center"
100
+        },
101
+        {
102
+          title: "ID(IMEI/MEID/ESN)",
103
+          key: "sn",
104
+          align: "center"
105
+        },
106
+        {
107
+          title: "Rom版本",
108
+          key: "romVersion",
109
+          align: "center"
110
+        },
111
+        {
112
+          title: "是否违规",
113
+          slot: "violatedSlot",
114
+          width: 100,
115
+          align: "center"
116
+        },
117
+        {
118
+          title: "更新时间",
119
+          key: "createtime",
120
+          width: 190,
92 121
           align: "center"
93 122
         }
94 123
       ]
@@ -116,7 +145,9 @@ export default {
116 145
     },
117 146
     // 获取列表
118 147
     getList() {
119
-      logDeviceBind_list({
148
+      logDeviceBind_list_school({
149
+        regionid: 1,
150
+        schoolid: 1,
120 151
         page: this.searchForm.page,
121 152
         size: this.searchForm.size,
122 153
         name: this.searchForm.name
@@ -129,7 +160,47 @@ export default {
129 160
         }
130 161
       });
131 162
     },
132
-    toExport() {}
163
+    toExport() {
164
+      logDeviceBind_list_school({
165
+        regionid: 1,
166
+        schoolid: 1,
167
+        page: this.searchForm.page,
168
+        size: this.searchForm.size,
169
+        name: this.searchForm.name
170
+      }).then((data) => {
171
+        if (data.code === 0) {
172
+          exportToExcel(
173
+            [
174
+              {
175
+                list: data.obj.data.map((item) => {
176
+                  return {
177
+                    学校名称: item.schoolName,
178
+                    班级: item.classname,
179
+                    登录名: item.loginname,
180
+                    姓名: item.username,
181
+                    设备号码: item.deviceMac,
182
+                    设备型号: item.deviceModel,
183
+                    "ID(IMEI/MEID/ESN)": item.sn,
184
+                    Rom版本: item.romVersion,
185
+                    是否违规:
186
+                      item.violated === 1
187
+                        ? "是"
188
+                        : item.violated === 2
189
+                        ? "否"
190
+                        : "",
191
+                    更新时间: item.createtime
192
+                  };
193
+                }),
194
+                name: "设备导出"
195
+              }
196
+            ],
197
+            "设备导出"
198
+          );
199
+        } else {
200
+          this.$Message.error(data.msg);
201
+        }
202
+      });
203
+    }
133 204
   }
134 205
 };
135 206
 </script>

+ 43
- 7
src/views/schoolSection/log/deviceInstallation.vue View File

@@ -46,6 +46,7 @@
46 46
 
47 47
 <script>
48 48
 import { dateFormat } from "@/utils";
49
+import { exportToExcel } from "@/utils/exportToExcel";
49 50
 import { logAppStart_list_install } from "@/api/log";
50 51
 export default {
51 52
   data() {
@@ -89,7 +90,7 @@ export default {
89 90
         },
90 91
         {
91 92
           title: "姓名",
92
-          key: "aname",
93
+          key: "username",
93 94
           align: "center"
94 95
         },
95 96
         {
@@ -112,11 +113,6 @@ export default {
112 113
           key: "versionName",
113 114
           align: "center"
114 115
         },
115
-        {
116
-          title: "版本号",
117
-          key: "versionNum",
118
-          align: "center"
119
-        },
120 116
         {
121 117
           title: "上报时间",
122 118
           key: "createtime",
@@ -153,6 +149,8 @@ export default {
153 149
       let _enddate = this.searchForm.dataRange[1];
154 150
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
155 151
       logAppStart_list_install({
152
+        regionid: 1,
153
+        schoolid: 1,
156 154
         page: this.searchForm.page,
157 155
         size: this.searchForm.size,
158 156
         begindate: _begindate,
@@ -167,7 +165,45 @@ export default {
167 165
         }
168 166
       });
169 167
     },
170
-    toExport() {}
168
+    toExport() {
169
+      let _begindate = this.searchForm.dataRange[0];
170
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
171
+      let _enddate = this.searchForm.dataRange[1];
172
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
173
+      logAppStart_list_install({
174
+        regionid: 1,
175
+        schoolid: 1,
176
+        begindate: _begindate,
177
+        enddate: _enddate,
178
+        name: this.searchForm.name
179
+      }).then((data) => {
180
+        if (data.code === 0) {
181
+          exportToExcel(
182
+            [
183
+              {
184
+                list: data.obj.data.map((item) => {
185
+                  return {
186
+                    学校名称: item.schoolName,
187
+                    班级: item.classname,
188
+                    登录名: item.loginname,
189
+                    姓名: item.username,
190
+                    设备号码: item.sn,
191
+                    应用名称: item.appName,
192
+                    应用包名: item.appPackage,
193
+                    版本名称: item.versionName,
194
+                    上报时间: item.createtime
195
+                  };
196
+                }),
197
+                name: "设备已安装应用"
198
+              }
199
+            ],
200
+            "设备已安装应用"
201
+          );
202
+        } else {
203
+          this.$Message.error(data.msg);
204
+        }
205
+      });
206
+    }
171 207
   }
172 208
 };
173 209
 </script>

+ 38
- 1
src/views/schoolSection/log/deviceLocation.vue View File

@@ -46,6 +46,7 @@
46 46
 
47 47
 <script>
48 48
 import { dateFormat } from "@/utils";
49
+import { exportToExcel } from "@/utils/exportToExcel";
49 50
 import { logDeviceLogin_list } from "@/api/log";
50 51
 export default {
51 52
   data() {
@@ -138,6 +139,8 @@ export default {
138 139
       let _enddate = this.searchForm.dataRange[1];
139 140
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
140 141
       logDeviceLogin_list({
142
+        regionid: 1,
143
+        schoolid: 1,
141 144
         page: this.searchForm.page,
142 145
         size: this.searchForm.size,
143 146
         begindate: _begindate,
@@ -152,7 +155,41 @@ export default {
152 155
         }
153 156
       });
154 157
     },
155
-    toExport() {}
158
+    toExport() {
159
+      let _begindate = this.searchForm.dataRange[0];
160
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
161
+      let _enddate = this.searchForm.dataRange[1];
162
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
163
+      logDeviceLogin_list({
164
+        begindate: _begindate,
165
+        enddate: _enddate,
166
+        name: this.searchForm.name
167
+      }).then((data) => {
168
+        if (data.code === 0) {
169
+          exportToExcel(
170
+            [
171
+              {
172
+                list: data.obj.data.map((item) => {
173
+                  return {
174
+                    设备号码: item.sn,
175
+                    登录名: item.loginname,
176
+                    姓名: item.username,
177
+                    学校名称: item.schoolName,
178
+                    班级: item.classname,
179
+                    地址: item.ipAddress,
180
+                    时间: item.createtime
181
+                  };
182
+                }),
183
+                name: "设备位置日志"
184
+              }
185
+            ],
186
+            "设备位置日志"
187
+          );
188
+        } else {
189
+          this.$Message.error(data.msg);
190
+        }
191
+      });
192
+    }
156 193
   }
157 194
 };
158 195
 </script>

+ 2
- 0
src/views/schoolSection/log/devicePush.vue View File

@@ -131,6 +131,8 @@ export default {
131 131
       let _enddate = this.searchForm.dataRange[1];
132 132
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
133 133
       logPush_list({
134
+        regionid: 1,
135
+        schoolid: 1,
134 136
         page: this.searchForm.page,
135 137
         size: this.searchForm.size,
136 138
         begindate: _begindate,

+ 53
- 1
src/views/schoolSection/log/violatingDevice.vue View File

@@ -100,6 +100,7 @@
100 100
 
101 101
 <script>
102 102
 import { dateFormat, doEventInfo } from "@/utils";
103
+import { exportToExcel } from "@/utils/exportToExcel";
103 104
 import { logdoperate_list_violate } from "@/api/log";
104 105
 export default {
105 106
   data() {
@@ -161,26 +162,31 @@ export default {
161 162
         {
162 163
           title: "通知",
163 164
           slot: "noticedSlot",
165
+          width: 70,
164 166
           align: "center"
165 167
         },
166 168
         {
167 169
           title: "锁定",
168 170
           slot: "lockedSlot",
171
+          width: 70,
169 172
           align: "center"
170 173
         },
171 174
         {
172 175
           title: "重置",
173 176
           slot: "resetedSlot",
177
+          width: 70,
174 178
           align: "center"
175 179
         },
176 180
         {
177 181
           title: "发邮件",
178 182
           slot: "emailedSlot",
183
+          width: 80,
179 184
           align: "center"
180 185
         },
181 186
         {
182 187
           title: "处理结果",
183 188
           slot: "handledSlot",
189
+          width: 100,
184 190
           align: "center"
185 191
         },
186 192
         {
@@ -219,6 +225,8 @@ export default {
219 225
       let _enddate = this.searchForm.dataRange[1];
220 226
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
221 227
       logdoperate_list_violate({
228
+        regionid: 1,
229
+        schoolid: 1,
222 230
         page: this.searchForm.page,
223 231
         size: this.searchForm.size,
224 232
         doEvent: this.searchForm.doEvent,
@@ -234,7 +242,51 @@ export default {
234 242
         }
235 243
       });
236 244
     },
237
-    toExport() {}
245
+    toExport() {
246
+      let _begindate = this.searchForm.dataRange[0];
247
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
248
+      let _enddate = this.searchForm.dataRange[1];
249
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
250
+      logdoperate_list_violate({
251
+        regionid: 1,
252
+        schoolid: 1,
253
+        page: this.searchForm.page,
254
+        size: this.searchForm.size,
255
+        doEvent: this.searchForm.doEvent,
256
+        begindate: _begindate,
257
+        enddate: _enddate,
258
+        name: this.searchForm.name
259
+      }).then((data) => {
260
+        if (data.code === 0) {
261
+          exportToExcel(
262
+            [
263
+              {
264
+                list: data.obj.data.map((item) => {
265
+                  return {
266
+                    学校名称: item.schoolName,
267
+                    班级: item.classname,
268
+                    登录名: item.loginname,
269
+                    姓名: item.username,
270
+                    设备号码: item.sn,
271
+                    事件: this.doEventInfo[item.doEvent],
272
+                    通知: item.noticed === 1 ? "是" : "否",
273
+                    锁定: item.locked === 1 ? "是" : "否",
274
+                    重置: item.reseted === 1 ? "是" : "否",
275
+                    发邮件: item.emailed === 1 ? "是" : "否",
276
+                    处理结果: item.handled === 1 ? "是" : "否",
277
+                    时间: item.createtime
278
+                  };
279
+                }),
280
+                name: "违规设备日志"
281
+              }
282
+            ],
283
+            "违规设备日志"
284
+          );
285
+        } else {
286
+          this.$Message.error(data.msg);
287
+        }
288
+      });
289
+    }
238 290
   }
239 291
 };
240 292
 </script>

Loading…
Cancel
Save