Browse Source

设备导出

gzb
wangzhonglu 9 months ago
parent
commit
f398ab3611

+ 24
- 49
src/views/platformSection/log/deviceExport.vue View File

@@ -131,57 +131,32 @@ export default {
131 131
       });
132 132
     },
133 133
     toExport(row) {
134
+      let form = {};
134 135
       if (row) {
135
-        logDeviceBind_list_all({
136
-          regionid: row.regionid
137
-        }).then((data) => {
138
-          if (data.code === 0) {
139
-            exportToExcel(
140
-              [
141
-                {
142
-                  list: data.obj.map((item) => {
143
-                    return {
144
-                      区域名称: item.regionName,
145
-                      学校数: item.schoolnum,
146
-                      用户数: item.usernum,
147
-                      设备数: item.snnum
148
-                    };
149
-                  }),
150
-                  name: row.regionName
151
-                }
152
-              ],
153
-              `设备导出_${row.regionName}`
154
-            );
155
-          } else {
156
-            this.$Message.error(data.msg);
157
-          }
158
-        });
159
-      } else {
160
-        logDeviceBind_list({
161
-          name: this.searchForm.name
162
-        }).then((data) => {
163
-          if (data.code === 0) {
164
-            exportToExcel(
165
-              [
166
-                {
167
-                  list: data.obj.data.map((item) => {
168
-                    return {
169
-                      区域名称: item.regionName,
170
-                      学校数: item.schoolnum,
171
-                      用户数: item.usernum,
172
-                      设备数: item.snnum
173
-                    };
174
-                  }),
175
-                  name: "设备导出"
176
-                }
177
-              ],
178
-              "设备导出"
179
-            );
180
-          } else {
181
-            this.$Message.error(data.msg);
182
-          }
183
-        });
136
+        form.regionid = row.regionid;
184 137
       }
138
+      logDeviceBind_list_all(form).then((data) => {
139
+        if (data.code === 0) {
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
+          );
156
+        } else {
157
+          this.$Message.error(data.msg);
158
+        }
159
+      });
185 160
     }
186 161
   }
187 162
 };

+ 49
- 17
src/views/schoolSection/log/deviceExport.vue View File

@@ -2,20 +2,28 @@
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
15 15
       >
16 16
     </div>
17 17
     <div class="table_wrap">
18
-      <Table :columns="columns" :data="searchForm.list"></Table>
18
+      <Table :columns="columns" :data="searchForm.list">
19
+        <template slot-scope="{ row }" slot="violatedSlot">
20
+          <div class="action_list">
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>
24
+          </div>
25
+        </template>
26
+      </Table>
19 27
     </div>
20 28
     <div class="page_wrap">
21 29
       <Page
@@ -61,8 +69,13 @@ export default {
61 69
           }
62 70
         },
63 71
         {
64
-          title: "设备号码",
65
-          key: "sn",
72
+          title: "学校名称",
73
+          key: "schoolName",
74
+          align: "center"
75
+        },
76
+        {
77
+          title: "班级",
78
+          key: "classname",
66 79
           align: "center"
67 80
         },
68 81
         {
@@ -76,22 +89,33 @@ export default {
76 89
           align: "center"
77 90
         },
78 91
         {
79
-          title: "学校名称",
80
-          key: "schoolName",
92
+          title: "设备号码",
93
+          key: "deviceMac",
81 94
           align: "center"
82 95
         },
83 96
         {
84
-          title: "班级",
85
-          key: "classname",
97
+          title: "设备型号",
98
+          key: "deviceModel",
86 99
           align: "center"
87 100
         },
88 101
         {
89
-          title: "地址",
90
-          key: "deviceMac",
102
+          title: "ID(IMEI/MEID/ESN)",
103
+          key: "sn",
91 104
           align: "center"
92 105
         },
93 106
         {
94
-          title: "时间",
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: "更新时间",
95 119
           key: "createtime",
96 120
           width: 190,
97 121
           align: "center"
@@ -150,13 +174,21 @@ export default {
150 174
               {
151 175
                 list: data.obj.data.map((item) => {
152 176
                   return {
153
-                    设备号码: item.sn,
154
-                    登录名: item.loginname,
155
-                    姓名: item.username,
156 177
                     学校名称: item.schoolName,
157 178
                     班级: item.classname,
158
-                    地址: item.deviceMac,
159
-                    时间: item.createtime
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
160 192
                   };
161 193
                 }),
162 194
                 name: "设备导出"

+ 40
- 1
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() {
@@ -164,7 +165,45 @@ export default {
164 165
         }
165 166
       });
166 167
     },
167
-    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
+    }
168 207
   }
169 208
 };
170 209
 </script>

Loading…
Cancel
Save