ソースを参照

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

gzb
wangzhonglu 9ヶ月前
コミット
695dab1dc6

+ 10
- 0
src/api/appgroup.js ファイルの表示

@@ -85,6 +85,16 @@ export const app_edit_enable = (data) => setRequest("app/edit_enable", data);
85 85
  */
86 86
 export const app_edit_unenable = (data) =>
87 87
   setRequest("app/edit_unenable", data);
88
+/**
89
+ * 5.2.12 应用-历史版本
90
+ */
91
+export const app_detail_history = (data) =>
92
+  setRequest("app/detail_history", data);
93
+/**
94
+ * 5.2.13 应用-安装统计
95
+ */
96
+export const app_install_statistic = (data) =>
97
+  setRequest("app/install_statistic", data);
88 98
 /**
89 99
  * 5.3 设备-列表(分组下设备)
90 100
  */

+ 4
- 0
src/api/region.js ファイルの表示

@@ -30,6 +30,10 @@ export const region_add = (data) => setRequest("region/add", data);
30 30
  * 2.3区域--更新
31 31
  */
32 32
 export const region_edit = (data) => setRequest("region/edit", data);
33
+/**
34
+ * 2.1.3.2区域--设置
35
+ */
36
+export const region_set = (data) => setRequest("region/set", data);
33 37
 /**
34 38
  * 2.4区域--删除
35 39
  */

+ 15
- 0
src/api/setting.js ファイルの表示

@@ -20,6 +20,21 @@ export const wallpaper_detail = (data) => setRequest("wallpaper/detail", data);
20 20
  * 8.1.5 壁纸-删除
21 21
  */
22 22
 export const wallpaper_delete = (data) => setRequest("wallpaper/delete", data);
23
+/**
24
+ *8.1.6 壁纸-是否有添加
25
+ */
26
+export const wallpaper_add_has = (data) =>
27
+  setRequest("wallpaper/add_has", data);
28
+/**
29
+ * 8.1.7 壁纸-选择设备
30
+ */
31
+export const wallpaper_list_device = (data) =>
32
+  setRequest("wallpaper/list_device", data);
33
+/**
34
+ * 8.1.9 壁纸-选择设备包含自己
35
+ */
36
+export const wallpaper_list_devicewp = (data) =>
37
+  setRequest("wallpaper/list_devicewp", data);
23 38
 /**
24 39
  * 8.2.1 LOGO-详情
25 40
  */

バイナリ
src/assets/img/platformLogin.png ファイルの表示


+ 237
- 33
src/views/regionSection/applicationManage/applicationManage.vue ファイルの表示

@@ -109,6 +109,44 @@
109 109
         show-sizer
110 110
       ></Page>
111 111
     </div>
112
+    <!-- 安装统计 -->
113
+    <Modal
114
+      class="modal1"
115
+      :mask-closable="false"
116
+      v-model="installInfo.show"
117
+      title="安装统计"
118
+    >
119
+      <div v-if="installInfo.show">
120
+        <div class="install_title">
121
+          {{ installInfo.appName }}
122
+          <div class="history">
123
+            <div>版本号码</div>
124
+            <Select
125
+              :transfer="true"
126
+              v-model="installInfo.versionName"
127
+              @on-change="installChange()"
128
+              style="width: 120px; margin-left: 10px"
129
+            >
130
+              <Option
131
+                v-for="item in installInfo.apphistorys"
132
+                :value="item.versionName"
133
+                :key="item.versionName"
134
+                >{{ item.versionName }}</Option
135
+              >
136
+            </Select>
137
+          </div>
138
+        </div>
139
+        <Table
140
+          style="border: 1px solid #e8eaec; border-bottom: none"
141
+          :columns="installInfo.columns"
142
+          :data="installInfo.list"
143
+        ></Table>
144
+      </div>
145
+
146
+      <div slot="footer" style="text-align: center">
147
+        <Button @click="installInfo.show = false">关闭</Button>
148
+      </div>
149
+    </Modal>
112 150
     <!-- 下载 -->
113 151
     <Modal
114 152
       class="modal_tip download"
@@ -529,7 +567,20 @@
529 567
               }}<span v-if="viewInfo.enabled === 1" class="qy">启用</span>
530 568
             </div>
531 569
             <div class="view_item">
532
-              <span>版本号码</span>{{ viewInfo.versionNum }}
570
+              <span>版本号码</span>
571
+              <Select
572
+                :transfer="true"
573
+                v-model="viewInfo.versionName"
574
+                @on-change="viewInfoChange()"
575
+                style="width: 120px"
576
+              >
577
+                <Option
578
+                  v-for="item in viewInfo.apphistorys"
579
+                  :value="item.versionName"
580
+                  :key="item.versionName"
581
+                  >{{ item.versionName }}</Option
582
+                >
583
+              </Select>
533 584
             </div>
534 585
           </div>
535 586
           <div class="view_comm">
@@ -649,9 +700,11 @@ import {
649 700
   app_add,
650 701
   app_delete,
651 702
   app_detail,
703
+  app_detail_history,
652 704
   app_edit,
653 705
   app_edit_enable,
654 706
   app_edit_unenable,
707
+  app_install_statistic,
655 708
   app_list,
656 709
   appgroup_list,
657 710
   device_list
@@ -755,6 +808,46 @@ export default {
755 808
         deviceids: [],
756 809
         schoolids: []
757 810
       },
811
+      installInfo: {
812
+        show: false,
813
+        appName: "",
814
+        versionName: null,
815
+        apphistorys: [],
816
+        list: [],
817
+        columns: [
818
+          {
819
+            title: "序号",
820
+            type: "index",
821
+            width: 70,
822
+            align: "center"
823
+          },
824
+          {
825
+            title: "区域名称",
826
+            key: "regionName",
827
+            align: "center"
828
+          },
829
+          {
830
+            title: "设备总数",
831
+            key: "total",
832
+            align: "center"
833
+          },
834
+          {
835
+            title: "已安装设备数",
836
+            key: "installNum",
837
+            align: "center"
838
+          },
839
+          {
840
+            title: "未安装设备总数",
841
+            key: "unInstallNum",
842
+            align: "center"
843
+          },
844
+          {
845
+            title: "安装比例",
846
+            key: "installRate",
847
+            align: "center"
848
+          }
849
+        ]
850
+      },
758 851
       rules: {
759 852
         appName: [
760 853
           {
@@ -891,16 +984,35 @@ export default {
891 984
     download(url) {
892 985
       window.location.href = this.$api.showImageUrl + url;
893 986
     },
987
+    viewInfoChange() {
988
+      //查看切换版本
989
+      let obj = this.viewInfo.apphistorys.filter(
990
+        (v) => v.versionName === this.viewInfo.versionName
991
+      )[0];
992
+      console.log(obj);
993
+      this.viewInfo.apkPath = obj.apkPath;
994
+      this.viewInfo.appAbbr = obj.appAbbr;
995
+      this.viewInfo.appDeveloper = obj.appDeveloper;
996
+      this.viewInfo.appIcon = obj.appIcon;
997
+      this.viewInfo.appImg = obj.appImg.split(";");
998
+      this.viewInfo.appPackage = obj.appPackage;
999
+      this.viewInfo.appRenew = obj.appRenew;
1000
+      this.viewInfo.appSize = obj.appSize;
1001
+      this.viewInfo.versionNum = obj.versionNum;
1002
+    },
894 1003
     // 查看
895 1004
     toView(row) {
1005
+      this.showLoading = true;
896 1006
       app_detail({
897 1007
         rtype: this.powerParams.rtype,
898 1008
         objectid: this.powerParams.objectid,
899 1009
         appid: row.appid
900 1010
       }).then((res) => {
1011
+        this.showLoading = false;
901 1012
         if (res.code === 0) {
902 1013
           this.viewInfo = {
903 1014
             show: true,
1015
+            apphistorys: res.obj.apphistorys,
904 1016
             appName: res.obj.appName,
905 1017
             appgroupName: row.appgroupName,
906 1018
             enabled: res.obj.enabled,
@@ -933,11 +1045,13 @@ export default {
933 1045
     },
934 1046
     //查看型号
935 1047
     see_device(row) {
1048
+      this.showLoading = true;
936 1049
       app_detail({
937 1050
         rtype: this.powerParams.rtype,
938 1051
         objectid: this.powerParams.objectid,
939 1052
         appid: row.appid
940 1053
       }).then((res) => {
1054
+        this.showLoading = false;
941 1055
         if (res.code === 0) {
942 1056
           this.deviceInfo = {
943 1057
             show: true,
@@ -952,12 +1066,14 @@ export default {
952 1066
     },
953 1067
     enabledChange(row) {
954 1068
       let api = row.enabled === 1 ? app_edit_enable : app_edit_unenable;
1069
+      this.showLoading = true;
955 1070
       api({
956 1071
         rtype: this.powerParams.rtype,
957 1072
         objectid: this.powerParams.objectid,
958 1073
         appid: row.appid,
959 1074
         rversion: row.rversion
960 1075
       }).then((data) => {
1076
+        this.showLoading = false;
961 1077
         this.searchList();
962 1078
         if (data.code === 0) {
963 1079
           this.$Message.success(data.msg);
@@ -966,41 +1082,111 @@ export default {
966 1082
         }
967 1083
       });
968 1084
     },
969
-    countSlot(row, type) {
970
-      console.log(row);
1085
+    installChange() {
1086
+      //安装统计切换版本
1087
+      console.log(this.installInfo.versionName);
1088
+      let obj = this.installInfo.apphistorys.filter(
1089
+        (v) => v.versionName === this.installInfo.versionName
1090
+      )[0];
1091
+      this.showLoading = true;
1092
+      app_install_statistic({
1093
+        appPackage: obj.appPackage,
1094
+        versionName: obj.versionName,
1095
+        rtype: this.powerParams.rtype,
1096
+        objectid: this.powerParams.objectid
1097
+      }).then((res) => {
1098
+        this.showLoading = false;
1099
+        if (res.code === 0) {
1100
+          console.log(res.obj);
1101
+          this.installInfo.list = res.obj;
1102
+        } else {
1103
+          this.$Message.error(res.msg);
1104
+        }
1105
+      });
1106
+    },
1107
+    async countSlot(row, type) {
971 1108
       if (type === 1) {
972 1109
         //下载
973
-        app_detail({
974
-          rtype: this.powerParams.rtype,
975
-          objectid: this.powerParams.objectid,
976
-          appid: row.appid
977
-        }).then((res) => {
978
-          if (res.code === 0) {
979
-            this.downloadInfo = {
980
-              show: true,
981
-              appName: res.obj.appName,
982
-              apkPath: res.obj.apkPath
983
-            };
984
-            this.$nextTick(() => {
985
-              let qrcodeEl = this.$refs.ScanShare;
986
-              if (!qrcodeEl) {
987
-                return;
988
-              }
989
-              qrcodeEl.innerHTML = "";
990
-              let qrcode = new QRCode(qrcodeEl, {
991
-                width: 140,
992
-                height: 140,
993
-                text: this.$api.showImageUrl + this.downloadInfo.apkPath
994
-              });
995
-              qrcode._el.title = "";
996
-            });
997
-            console.log(this.downloadInfo);
998
-          } else {
999
-            this.$Message.error(res.msg);
1110
+        this.downloadInfo = {
1111
+          show: true,
1112
+          appName: row.appName,
1113
+          apkPath: row.apkPath
1114
+        };
1115
+        this.$nextTick(() => {
1116
+          let qrcodeEl = this.$refs.ScanShare;
1117
+          if (!qrcodeEl) {
1118
+            return;
1000 1119
           }
1120
+          qrcodeEl.innerHTML = "";
1121
+          let qrcode = new QRCode(qrcodeEl, {
1122
+            width: 140,
1123
+            height: 140,
1124
+            text: this.$api.showImageUrl + this.downloadInfo.apkPath
1125
+          });
1126
+          qrcode._el.title = "";
1001 1127
         });
1128
+        console.log(this.downloadInfo);
1002 1129
       } else if (type === 2) {
1130
+        //获取历史版本
1131
+        this.showLoading = true;
1132
+        let res = await app_detail_history({ appid: row.appid });
1133
+        if (res.code === 0) {
1134
+        } else {
1135
+          this.$Message.error(res.msg);
1136
+        }
1003 1137
         //安装统计
1138
+        let res1 = await app_install_statistic({
1139
+          appPackage: row.appPackage,
1140
+          versionName: row.versionName,
1141
+          rtype: this.powerParams.rtype,
1142
+          objectid: this.powerParams.objectid
1143
+        });
1144
+        this.showLoading = false;
1145
+        if (res1.code === 0) {
1146
+          console.log(res1.obj);
1147
+          this.installInfo = {
1148
+            show: true,
1149
+            appName: row.appName,
1150
+            apphistorys: res.obj,
1151
+            versionName: row.versionName,
1152
+            list: res1.obj,
1153
+            columns: [
1154
+              {
1155
+                title: "序号",
1156
+                type: "index",
1157
+                width: 70,
1158
+                align: "center"
1159
+              },
1160
+              {
1161
+                title: "区域名称",
1162
+                key: "regionName",
1163
+                align: "center"
1164
+              },
1165
+              {
1166
+                title: "设备总数",
1167
+                key: "total",
1168
+                align: "center"
1169
+              },
1170
+              {
1171
+                title: "已安装设备数",
1172
+                key: "installNum",
1173
+                align: "center"
1174
+              },
1175
+              {
1176
+                title: "未安装设备总数",
1177
+                key: "unInstallNum",
1178
+                align: "center"
1179
+              },
1180
+              {
1181
+                title: "安装比例",
1182
+                key: "installRate",
1183
+                align: "center"
1184
+              }
1185
+            ]
1186
+          };
1187
+        } else {
1188
+          this.$Message.error(res1.msg);
1189
+        }
1004 1190
       }
1005 1191
     },
1006 1192
     //删除截图
@@ -1071,6 +1257,7 @@ export default {
1071 1257
         formData.append("filename", `${file.resourcename}.${file.suffix}`);
1072 1258
         formData.append("savefolder", "app");
1073 1259
         // 进行post 请求
1260
+        that.showLoading = true;
1074 1261
         axios({
1075 1262
           method: "post",
1076 1263
           timeout: 1000 * window._config.axiosFileTimeout,
@@ -1081,6 +1268,7 @@ export default {
1081 1268
           }
1082 1269
         })
1083 1270
           .then((response) => {
1271
+            that.showLoading = false;
1084 1272
             let res = response.data;
1085 1273
             if (res.code === 0) {
1086 1274
               that.wallpaperInfo.apkPath = res.obj.apkPath;
@@ -1382,7 +1570,9 @@ export default {
1382 1570
           }
1383 1571
           console.log(form);
1384 1572
           let api = this.wallpaperInfo.appid ? app_edit : app_add;
1573
+          this.showLoading = true;
1385 1574
           api(form).then((res) => {
1575
+            this.showLoading = false;
1386 1576
             if (res.code === 0) {
1387 1577
               this.wallpaperInfo.show = false;
1388 1578
               console.log(res.obj);
@@ -1417,11 +1607,13 @@ export default {
1417 1607
 
1418 1608
     // 编辑
1419 1609
     toEdit(row) {
1610
+      this.showLoading = true;
1420 1611
       app_detail({
1421 1612
         rtype: this.powerParams.rtype,
1422 1613
         objectid: this.powerParams.objectid,
1423 1614
         appid: row.appid
1424 1615
       }).then((res) => {
1616
+        this.showLoading = false;
1425 1617
         if (res.code === 0) {
1426 1618
           this.school_list = JSON.parse(JSON.stringify(this.curRegion));
1427 1619
           this.wallpaperInfo = {
@@ -1499,12 +1691,14 @@ export default {
1499 1691
         title: "提示",
1500 1692
         content: "您确定删除选中数据吗?",
1501 1693
         onOk: () => {
1694
+          this.showLoading = true;
1502 1695
           app_delete({
1503 1696
             rtype: this.powerParams.rtype,
1504 1697
             objectid: this.powerParams.objectid,
1505 1698
             appid: row.appid,
1506 1699
             rversion: row.rversion
1507 1700
           }).then((res) => {
1701
+            this.showLoading = false;
1508 1702
             if (res.code === 0) {
1509 1703
               this.$Message.success(res.msg);
1510 1704
               this.searchList();
@@ -1541,7 +1735,7 @@ export default {
1541 1735
     display: flex;
1542 1736
     margin: 16px 0;
1543 1737
     .app_logo {
1544
-      flex-wrap: none;
1738
+      flex: none;
1545 1739
       width: 56px;
1546 1740
       height: 56px;
1547 1741
       border-radius: 20px;
@@ -1582,11 +1776,22 @@ export default {
1582 1776
     cursor: not-allowed;
1583 1777
   }
1584 1778
 }
1585
-.view_title {
1779
+.install_title {
1586 1780
   margin-bottom: 16px;
1587 1781
   font-size: 18px;
1588 1782
   font-weight: bold;
1589 1783
   text-align: center;
1784
+  position: relative;
1785
+}
1786
+.history {
1787
+  position: absolute;
1788
+  top: 0;
1789
+  right: 0;
1790
+  display: flex;
1791
+  font-size: 16px;
1792
+  font-weight: 400;
1793
+  font-family: "SourceHanSansCN";
1794
+  align-items: center;
1590 1795
 }
1591 1796
 .view_content {
1592 1797
   display: flex;
@@ -1602,7 +1807,6 @@ export default {
1602 1807
 }
1603 1808
 .view_devices {
1604 1809
   .view_list {
1605
-    margin-bottom: 20px;
1606 1810
     line-height: 32px;
1607 1811
   }
1608 1812
   .dgname {

+ 5
- 1
src/views/regionSection/home/index.vue ファイルの表示

@@ -1,5 +1,9 @@
1 1
 <template>
2
-  <div class="main_root">区域首页</div>
2
+  <div class="main_root">
3
+    <div class="content">
4
+      <div></div>
5
+    </div>
6
+  </div>
3 7
 </template>
4 8
 
5 9
 <script>

+ 1
- 1
src/views/regionSection/log/appLaunch.vue ファイルの表示

@@ -95,7 +95,7 @@ export default {
95 95
         },
96 96
         {
97 97
           title: "姓名",
98
-          key: "aname",
98
+          key: "username",
99 99
           align: "center"
100 100
         },
101 101
         {

+ 1
- 1
src/views/regionSection/log/applicationDownload.vue ファイルの表示

@@ -87,7 +87,7 @@ export default {
87 87
         },
88 88
         {
89 89
           title: "姓名",
90
-          key: "aname",
90
+          key: "username",
91 91
           align: "center"
92 92
         },
93 93
         {

+ 48
- 1
src/views/regionSection/log/deviceEvents.vue ファイルの表示

@@ -73,6 +73,7 @@
73 73
 <script>
74 74
 import { dateFormat, doEventInfo } from "@/utils";
75 75
 import { logdoperate_list_event } from "@/api/log";
76
+import { exportToExcel } from "@/utils/exportToExcel";
76 77
 export default {
77 78
   data() {
78 79
     return {
@@ -203,7 +204,53 @@ export default {
203 204
         }
204 205
       });
205 206
     },
206
-    toExport() {}
207
+    toExport() {
208
+      let _begindate = this.searchForm.dataRange[0];
209
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
210
+      let _enddate = this.searchForm.dataRange[1];
211
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
212
+      logdoperate_list_event({
213
+        rtype: this.powerParams.rtype,
214
+        objectid: this.powerParams.objectid,
215
+        regionid: this.powerParams.objectid,
216
+        doEvent: this.searchForm.doEvent,
217
+        begindate: _begindate,
218
+        enddate: _enddate,
219
+        name: this.searchForm.name
220
+      }).then((data) => {
221
+        if (data.code === 0) {
222
+          exportToExcel(
223
+            [
224
+              {
225
+                list: data.obj.data.map((item) => {
226
+                  return {
227
+                    学校名称: item.schoolName,
228
+                    班级: item.classname,
229
+                    登录名: item.loginname,
230
+                    姓名: item.username,
231
+                    设备号码: item.sn,
232
+                    事件: this.doEventInfo[item.doEvent],
233
+                    描述: item.comm,
234
+                    // 0不违规1违规
235
+                    违规:
236
+                      item.violated === 1
237
+                        ? "违规"
238
+                        : item.violated === 0
239
+                        ? "不违规"
240
+                        : "",
241
+                    时间: item.createtime
242
+                  };
243
+                }),
244
+                name: "设备事件日志"
245
+              }
246
+            ],
247
+            "设备事件日志"
248
+          );
249
+        } else {
250
+          this.$Message.error(data.msg);
251
+        }
252
+      });
253
+    }
207 254
   }
208 255
 };
209 256
 </script>

+ 42
- 1
src/views/regionSection/log/deviceInstallation.vue ファイルの表示

@@ -47,6 +47,7 @@
47 47
 <script>
48 48
 import { dateFormat } from "@/utils";
49 49
 import { logAppStart_list_install } from "@/api/log";
50
+import { exportToExcel } from "@/utils/exportToExcel";
50 51
 export default {
51 52
   data() {
52 53
     return {
@@ -179,7 +180,47 @@ export default {
179 180
         }
180 181
       });
181 182
     },
182
-    toExport() {}
183
+    toExport() {
184
+      let _begindate = this.searchForm.dataRange[0];
185
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
186
+      let _enddate = this.searchForm.dataRange[1];
187
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
188
+      logAppStart_list_install({
189
+        rtype: this.powerParams.rtype,
190
+        objectid: this.powerParams.objectid,
191
+        regionid: this.powerParams.objectid,
192
+        begindate: _begindate,
193
+        enddate: _enddate,
194
+        name: this.searchForm.name
195
+      }).then((data) => {
196
+        if (data.code === 0) {
197
+          exportToExcel(
198
+            [
199
+              {
200
+                list: data.obj.data.map((item) => {
201
+                  return {
202
+                    学校名称: item.schoolName,
203
+                    班级: item.classname,
204
+                    登录名: item.loginname,
205
+                    姓名: item.username,
206
+                    设备号码: item.sn,
207
+                    应用名称: item.appName,
208
+                    应用包名: item.appPackage,
209
+                    版本名称: item.versionName,
210
+                    版本号: item.versionNum,
211
+                    上报时间: item.createtime
212
+                  };
213
+                }),
214
+                name: "设备已安装应用"
215
+              }
216
+            ],
217
+            "设备已安装应用"
218
+          );
219
+        } else {
220
+          this.$Message.error(data.msg);
221
+        }
222
+      });
223
+    }
183 224
   }
184 225
 };
185 226
 </script>

+ 45
- 4
src/views/regionSection/log/deviceLocation.vue ファイルの表示

@@ -47,6 +47,7 @@
47 47
 <script>
48 48
 import { dateFormat } from "@/utils";
49 49
 import { logDeviceLogin_list } from "@/api/log";
50
+import { exportToExcel } from "@/utils/exportToExcel";
50 51
 export default {
51 52
   data() {
52 53
     return {
@@ -81,12 +82,14 @@ export default {
81 82
         {
82 83
           title: "登录名",
83 84
           key: "loginname",
84
-          align: "center"
85
+          align: "center",
86
+          width: 160
85 87
         },
86 88
         {
87 89
           title: "姓名",
88 90
           key: "username",
89
-          align: "center"
91
+          align: "center",
92
+          width: 160
90 93
         },
91 94
         {
92 95
           title: "学校名称",
@@ -96,7 +99,8 @@ export default {
96 99
         {
97 100
           title: "班级",
98 101
           key: "classname",
99
-          align: "center"
102
+          align: "center",
103
+          width: 160
100 104
         },
101 105
         {
102 106
           title: "地址",
@@ -164,7 +168,44 @@ export default {
164 168
         }
165 169
       });
166 170
     },
167
-    toExport() {}
171
+    toExport() {
172
+      let _begindate = this.searchForm.dataRange[0];
173
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
174
+      let _enddate = this.searchForm.dataRange[1];
175
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
176
+      logDeviceLogin_list({
177
+        rtype: this.powerParams.rtype,
178
+        objectid: this.powerParams.objectid,
179
+        regionid: this.powerParams.objectid,
180
+        begindate: _begindate,
181
+        enddate: _enddate,
182
+        name: this.searchForm.name
183
+      }).then((data) => {
184
+        if (data.code === 0) {
185
+          exportToExcel(
186
+            [
187
+              {
188
+                list: data.obj.data.map((item) => {
189
+                  return {
190
+                    设备号码: item.sn,
191
+                    登录名: item.loginname,
192
+                    姓名: item.username,
193
+                    学校名称: item.schoolName,
194
+                    班级: item.classname,
195
+                    地址: item.ipAddress,
196
+                    时间: item.createtime
197
+                  };
198
+                }),
199
+                name: "设备位置日志"
200
+              }
201
+            ],
202
+            "设备位置日志"
203
+          );
204
+        } else {
205
+          this.$Message.error(data.msg);
206
+        }
207
+      });
208
+    }
168 209
   }
169 210
 };
170 211
 </script>

+ 1
- 1
src/views/regionSection/log/devicePush.vue ファイルの表示

@@ -83,7 +83,7 @@ export default {
83 83
         },
84 84
         {
85 85
           title: "姓名",
86
-          key: "aname",
86
+          key: "username",
87 87
           align: "center"
88 88
         },
89 89
         {

+ 45
- 1
src/views/regionSection/log/violatingDevice.vue ファイルの表示

@@ -101,6 +101,7 @@
101 101
 <script>
102 102
 import { dateFormat, doEventInfo } from "@/utils";
103 103
 import { logdoperate_list_violate } from "@/api/log";
104
+import { exportToExcel } from "@/utils/exportToExcel";
104 105
 export default {
105 106
   data() {
106 107
     return {
@@ -246,7 +247,50 @@ export default {
246 247
         }
247 248
       });
248 249
     },
249
-    toExport() {}
250
+    toExport() {
251
+      let _begindate = this.searchForm.dataRange[0];
252
+      _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
253
+      let _enddate = this.searchForm.dataRange[1];
254
+      _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
255
+      logdoperate_list_violate({
256
+        rtype: this.powerParams.rtype,
257
+        objectid: this.powerParams.objectid,
258
+        regionid: this.powerParams.objectid,
259
+        doEvent: this.searchForm.doEvent,
260
+        begindate: _begindate,
261
+        enddate: _enddate,
262
+        name: this.searchForm.name
263
+      }).then((data) => {
264
+        if (data.code === 0) {
265
+          exportToExcel(
266
+            [
267
+              {
268
+                list: data.obj.data.map((item) => {
269
+                  return {
270
+                    学校名称: item.schoolName,
271
+                    班级: item.classname,
272
+                    登录名: item.loginname,
273
+                    姓名: item.username,
274
+                    设备号码: item.sn,
275
+                    事件: this.doEventInfo[item.doEvent],
276
+                    通知: item.noticed === 1 ? "是" : "否",
277
+                    锁定: item.locked === 1 ? "是" : "否",
278
+                    重置: item.reseted === 1 ? "是" : "否",
279
+                    发邮件: item.emailed === 1 ? "是" : "否",
280
+                    处理结果: item.handled === 1 ? "是" : "否",
281
+                    时间: item.createtime
282
+                  };
283
+                }),
284
+                name: "违规设备日志"
285
+              }
286
+            ],
287
+            "违规设备日志"
288
+          );
289
+        } else {
290
+          this.$Message.error(data.msg);
291
+        }
292
+      });
293
+    }
250 294
   }
251 295
 };
252 296
 </script>

+ 287
- 3
src/views/regionSection/regionManage/regionManage.vue ファイルの表示

@@ -18,6 +18,7 @@
18 18
             <div @click="toView(row)">查看</div>
19 19
             <div @click="toEdit(row)">编辑</div>
20 20
             <div class="action_del" @click="toDel(row)">删除</div>
21
+            <div @click="toSet(row)">设置</div>
21 22
           </div>
22 23
         </template>
23 24
       </Table>
@@ -179,6 +180,80 @@
179 180
         <Button @click="viewInfo.show = false">关闭</Button>
180 181
       </div>
181 182
     </Modal>
183
+    <!-- 设置 -->
184
+    <Modal
185
+      class="modal1"
186
+      :mask-closable="false"
187
+      v-model="authInfo.show"
188
+      title="设置"
189
+    >
190
+      <div v-if="authInfo.show">
191
+        <Form
192
+          ref="authInfo"
193
+          :model="authInfo"
194
+          :rules="rules1"
195
+          :label-width="110"
196
+        >
197
+          <FormItem label="单点登录" prop="sso" class="require">
198
+            <RadioGroup v-model="authInfo.sso">
199
+              <Radio :label="1">平台</Radio>
200
+              <Radio :label="2">自定义</Radio>
201
+            </RadioGroup>
202
+          </FormItem>
203
+          <div class="platformLogin" v-if="authInfo.sso === 1">
204
+            <img src="../../../assets/img/platformLogin.png" />
205
+            <p>当前已选择平台登录</p>
206
+          </div>
207
+          <div v-else>
208
+            <FormItem label="认证地址" prop="authUrl">
209
+              <Input
210
+                v-model.trim="authInfo.authUrl"
211
+                placeholder="请输入认证地址"
212
+              ></Input>
213
+            </FormItem>
214
+            <FormItem label="认证密钥" prop="authKey">
215
+              <Input
216
+                v-model.trim="authInfo.authKey"
217
+                placeholder="请输入认证密钥"
218
+              ></Input>
219
+            </FormItem>
220
+            <FormItem label="认证类型" class="require">
221
+              <RadioGroup v-model="authInfo.authType">
222
+                <Radio :label="1">账号</Radio>
223
+                <Radio :label="2">学号</Radio>
224
+                <Radio :label="3">手机号码</Radio>
225
+                <Radio :label="4">身份证号码</Radio>
226
+              </RadioGroup>
227
+            </FormItem>
228
+            <FormItem label="请求说明">
229
+              <Table
230
+                style="border: 1px solid #e8eaec; border-bottom: none"
231
+                :columns="columns1"
232
+                :data="request_list"
233
+              ></Table>
234
+            </FormItem>
235
+            <FormItem label="返回说明">
236
+              <div style="line-height: 36px; margin-bottom: 10px">
237
+                以json格式返回数据
238
+              </div>
239
+              <Table
240
+                style="border: 1px solid #e8eaec; border-bottom: none"
241
+                :columns="columns1"
242
+                :data="response_list"
243
+              ></Table>
244
+            </FormItem>
245
+          </div>
246
+        </Form>
247
+      </div>
248
+      <div slot="footer" style="text-align: right">
249
+        <Button @click="authInfo.show = false">关闭</Button>
250
+        <Button @click="saveauthInfo()" type="primary">保存</Button>
251
+      </div>
252
+    </Modal>
253
+    <Spin fix v-if="showLoading" style="background-color: transparent">
254
+      <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
255
+      <div>加载中</div>
256
+    </Spin>
182 257
   </div>
183 258
 </template>
184 259
 
@@ -190,7 +265,8 @@ import {
190 265
   region_add,
191 266
   region_edit,
192 267
   region_list_qy,
193
-  region_detail
268
+  region_detail,
269
+  region_set
194 270
 } from "@/api/region";
195 271
 import { login_msg_code } from "@/api/login";
196 272
 export default {
@@ -214,6 +290,7 @@ export default {
214 290
       callback();
215 291
     };
216 292
     return {
293
+      showLoading: false,
217 294
       searchForm: {
218 295
         regionName: "",
219 296
         page: 1,
@@ -273,6 +350,31 @@ export default {
273 350
           }
274 351
         ]
275 352
       },
353
+      authInfo: {
354
+        show: false,
355
+        regionid: null,
356
+        rversion: null,
357
+        sso: null,
358
+        authUrl: null,
359
+        authKey: null,
360
+        authType: null
361
+      },
362
+      rules1: {
363
+        authUrl: [
364
+          {
365
+            required: true,
366
+            message: "请输入认证地址",
367
+            trigger: "blur"
368
+          }
369
+        ],
370
+        authKey: [
371
+          {
372
+            required: true,
373
+            message: "请输入认证密钥",
374
+            trigger: "blur"
375
+          }
376
+        ]
377
+      },
276 378
       rules: {
277 379
         regionName: [
278 380
           {
@@ -356,9 +458,122 @@ export default {
356 458
         {
357 459
           title: "操作",
358 460
           slot: "actionSlot",
359
-          width: 220,
461
+          width: 280,
360 462
           align: "center"
361 463
         }
464
+      ],
465
+      columns1: [
466
+        {
467
+          title: "参数",
468
+          key: "data",
469
+          align: "center",
470
+          width: 180
471
+        },
472
+        {
473
+          title: "类型",
474
+          key: "type",
475
+          width: 120,
476
+          align: "center"
477
+        },
478
+        {
479
+          title: "是否必填",
480
+          key: "Required",
481
+          width: 120,
482
+          align: "center"
483
+        },
484
+        {
485
+          title: "说明",
486
+          key: "comm",
487
+          align: "center"
488
+        }
489
+      ],
490
+      request_list: [
491
+        {
492
+          data: "loginname",
493
+          type: "string",
494
+          Required: "是",
495
+          comm: "认证类型对应的值"
496
+        },
497
+        {
498
+          data: "loginpwd",
499
+          type: "string",
500
+          Required: "是",
501
+          comm: "认证密码"
502
+        }
503
+      ],
504
+      response_list: [
505
+        {
506
+          data: "code",
507
+          type: "int",
508
+          Required: "是",
509
+          comm: "0正常,1错误"
510
+        },
511
+        {
512
+          data: "msg",
513
+          type: "string",
514
+          Required: "是",
515
+          comm: "成功/失败(有失败信息)"
516
+        },
517
+        {
518
+          data: "schoolid",
519
+          type: "int",
520
+          Required: "是",
521
+          comm: "学校ID"
522
+        },
523
+        {
524
+          data: "schoolname",
525
+          type: "string",
526
+          Required: "是",
527
+          comm: "学校名称"
528
+        },
529
+        {
530
+          data: "classid",
531
+          type: "int",
532
+          Required: "是",
533
+          comm: "班级ID"
534
+        },
535
+        {
536
+          data: "classname",
537
+          type: "string",
538
+          Required: "是",
539
+          comm: "班级名称"
540
+        },
541
+        {
542
+          data: "userid",
543
+          type: "int",
544
+          Required: "是",
545
+          comm: "用户ID"
546
+        },
547
+        {
548
+          data: "usename",
549
+          type: "string",
550
+          Required: "是",
551
+          comm: "用户姓名"
552
+        },
553
+        {
554
+          data: "userphone",
555
+          type: "string",
556
+          Required: "是",
557
+          comm: "手机号码"
558
+        },
559
+        {
560
+          data: "studentno",
561
+          type: "string",
562
+          Required: "是",
563
+          comm: "学号"
564
+        },
565
+        {
566
+          data: "loginname",
567
+          type: "string",
568
+          Required: "是",
569
+          comm: "账号"
570
+        },
571
+        {
572
+          data: "cardid",
573
+          type: "string",
574
+          Required: "是",
575
+          comm: "身份证号"
576
+        }
362 577
       ]
363 578
     };
364 579
   },
@@ -374,6 +589,17 @@ export default {
374 589
     }
375 590
   },
376 591
   methods: {
592
+    toSet(row) {
593
+      this.authInfo = {
594
+        show: true,
595
+        regionid: row.regionid,
596
+        rversion: row.rversion,
597
+        sso: row.sso,
598
+        authUrl: row.authUrl,
599
+        authKey: row.authKey,
600
+        authType: row.authType
601
+      };
602
+    },
377 603
     // 获取短信验证码
378 604
     getMsgCode() {
379 605
       if (this.regionInfo.second < 60) {
@@ -390,9 +616,11 @@ export default {
390 616
         return;
391 617
       }
392 618
       this.setRegionSecond();
619
+      this.showLoading = true;
393 620
       login_msg_code({
394 621
         phone: this.regionInfo.admin.phone
395 622
       }).then((data) => {
623
+        this.showLoading = false;
396 624
         if (data.code === 0) {
397 625
           this.$Message.success(data.msg);
398 626
         } else {
@@ -429,6 +657,7 @@ export default {
429 657
     },
430 658
     // 获取列表
431 659
     getList() {
660
+      this.showLoading = true;
432 661
       region_list_qy({
433 662
         rtype: this.powerParams.rtype,
434 663
         objectid: this.powerParams.objectid,
@@ -437,10 +666,11 @@ export default {
437 666
         size: this.searchForm.size,
438 667
         regionName: this.searchForm.regionName
439 668
       }).then((data) => {
669
+        this.showLoading = false;
440 670
         if (data.code === 0) {
441 671
           this.searchForm.list = data.obj.data;
442 672
           this.searchForm.total = data.obj.total;
443
-          console.log(this.searchForm.list)
673
+          console.log(this.searchForm.list);
444 674
         } else {
445 675
           this.$Message.error(data.msg);
446 676
         }
@@ -468,6 +698,35 @@ export default {
468 698
         }
469 699
       };
470 700
     },
701
+    //设置
702
+    saveauthInfo() {
703
+      this.$refs.authInfo.validate((valid) => {
704
+        if (valid) {
705
+          let form = {
706
+            sso: this.authInfo.sso,
707
+            regionid: this.authInfo.regionid,
708
+            rversion: this.authInfo.rversion
709
+          };
710
+          if (form.sso === 2) {
711
+            form.authUrl = this.authInfo.authUrl;
712
+            form.authKey = this.authInfo.authKey;
713
+            form.authType = this.authInfo.authType;
714
+          }
715
+          console.log(form);
716
+          this.showLoading = true;
717
+          region_set(form).then((data) => {
718
+            this.showLoading = false;
719
+            this.authInfo.show = false;
720
+            if (data.code === 0) {
721
+              this.searchList();
722
+              this.$Message.success(data.msg);
723
+            } else {
724
+              this.$Message.error(data.msg);
725
+            }
726
+          });
727
+        }
728
+      });
729
+    },
471 730
     // 保存新建
472 731
     saveAddInfo() {
473 732
       this.$refs.addForm.validate((valid) => {
@@ -488,6 +747,7 @@ export default {
488 747
             clearInterval(this.regionInfo.timer);
489 748
             this.regionInfo.timer = null;
490 749
           }
750
+          this.showLoading = true;
491 751
           region_add({
492 752
             regionName: this.regionInfo.regionName,
493 753
             rtype: this.powerParams.rtype,
@@ -501,6 +761,7 @@ export default {
501 761
               msgcode: this.regionInfo.admin.msgcode
502 762
             }
503 763
           }).then((data) => {
764
+            this.showLoading = false;
504 765
             if (data.code === 0) {
505 766
               this.regionInfo.show = false;
506 767
               this.searchList();
@@ -516,6 +777,7 @@ export default {
516 777
     saveModifyInfo() {
517 778
       this.$refs.modifyForm.validate((valid) => {
518 779
         if (valid) {
780
+          this.showLoading = true;
519 781
           region_edit({
520 782
             rtype: this.powerParams.rtype,
521 783
             objectid: this.powerParams.objectid,
@@ -523,6 +785,7 @@ export default {
523 785
             regionName: this.modifyRegion.regionName,
524 786
             rversion: this.modifyRegion.rversion
525 787
           }).then((data) => {
788
+            this.showLoading = false;
526 789
             this.modifyRegion.show = false;
527 790
             if (data.code === 0) {
528 791
               this.searchList();
@@ -547,11 +810,13 @@ export default {
547 810
     },
548 811
     // 查看管理员列表
549 812
     toView(row) {
813
+      this.showLoading = true;
550 814
       region_list_admin({
551 815
         rtype: this.powerParams.rtype,
552 816
         objectid: this.powerParams.objectid,
553 817
         regionid: row.regionid
554 818
       }).then((data) => {
819
+        this.showLoading = false;
555 820
         if (data.code === 0) {
556 821
           this.viewInfo.show = true;
557 822
           this.viewInfo.regionName = row.regionName;
@@ -563,11 +828,13 @@ export default {
563 828
     },
564 829
     // 编辑
565 830
     toEdit(row) {
831
+      this.showLoading = true;
566 832
       region_detail({
567 833
         rtype: this.powerParams.rtype,
568 834
         objectid: this.powerParams.objectid,
569 835
         regionid: row.regionid
570 836
       }).then((res) => {
837
+        this.showLoading = false;
571 838
         if (res.code === 0) {
572 839
           this.modifyRegion = {
573 840
             show: true,
@@ -586,12 +853,14 @@ export default {
586 853
         title: "提示",
587 854
         content: "您确定删除选中数据吗?",
588 855
         onOk: () => {
856
+          this.showLoading = true;
589 857
           region_delete({
590 858
             rtype: this.powerParams.rtype,
591 859
             objectid: this.powerParams.objectid,
592 860
             regionid: row.regionid,
593 861
             rversion: row.rversion
594 862
           }).then((data) => {
863
+            this.showLoading = false;
595 864
             if (data.code === 0) {
596 865
               this.searchList();
597 866
               this.$Message.success(data.msg);
@@ -639,4 +908,19 @@ export default {
639 908
   font-weight: bold;
640 909
   text-align: center;
641 910
 }
911
+.platformLogin {
912
+  text-align: center;
913
+  padding-bottom: 40px;
914
+  img {
915
+    width: 212px;
916
+    height: 212px;
917
+    margin: 0 auto;
918
+    object-fit: cover;
919
+  }
920
+  p {
921
+    line-height: 30px;
922
+    font-size: 14px;
923
+    color: #7c8db5;
924
+  }
925
+}
642 926
 </style>

+ 825
- 9
src/views/regionSection/search/allApps.vue ファイルの表示

@@ -25,17 +25,19 @@
25 25
             <div class="app_comm">
26 26
               <div>{{ row.appName }}</div>
27 27
               <span>版本: {{ row.versionName }}</span>
28
-              <div>授权型号: {{ row.devicenum }}个</div>
28
+              <div @click="see_device(row)" style="cursor: pointer">
29
+                授权型号: {{ row.devicenum }}个
30
+              </div>
29 31
             </div>
30 32
           </div>
31 33
         </template>
32 34
         <template slot-scope="{ row }" slot="appType">
33 35
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
34 36
         </template>
35
-        <template slot-scope="{ row }" slot="enable">
37
+        <template slot-scope="{ row }" slot="enabled">
36 38
           <i-switch
37 39
             size="large"
38
-            v-model="row.enable"
40
+            v-model="row.enabled"
39 41
             :true-value="1"
40 42
             :false-value="2"
41 43
             @on-change="enabledChange(row)"
@@ -93,6 +95,388 @@
93 95
         show-sizer
94 96
       ></Page>
95 97
     </div>
98
+    <!-- 安装统计 -->
99
+    <Modal
100
+      class="modal1"
101
+      :mask-closable="false"
102
+      v-model="installInfo.show"
103
+      title="安装统计"
104
+    >
105
+      <div v-if="installInfo.show">
106
+        <div class="install_title">
107
+          {{ installInfo.appName }}
108
+          <div class="history">
109
+            <div>版本号码</div>
110
+            <Select
111
+              :transfer="true"
112
+              v-model="installInfo.versionName"
113
+              @on-change="installChange()"
114
+              style="width: 120px; margin-left: 10px"
115
+            >
116
+              <Option
117
+                v-for="item in installInfo.apphistorys"
118
+                :value="item.versionName"
119
+                :key="item.versionName"
120
+                >{{ item.versionName }}</Option
121
+              >
122
+            </Select>
123
+          </div>
124
+        </div>
125
+        <Table
126
+          style="border: 1px solid #e8eaec; border-bottom: none"
127
+          :columns="installInfo.columns"
128
+          :data="installInfo.list"
129
+        ></Table>
130
+      </div>
131
+
132
+      <div slot="footer" style="text-align: center">
133
+        <Button @click="installInfo.show = false">关闭</Button>
134
+      </div>
135
+    </Modal>
136
+    <!-- 授权型号 -->
137
+    <Modal
138
+      class="modal1 view"
139
+      :mask-closable="false"
140
+      v-model="deviceInfo.show"
141
+      title="授权型号"
142
+    >
143
+      <div class="view_content" v-if="deviceInfo.show">
144
+        <div class="view_title">名称</div>
145
+        <div class="view_devices" style="width: 100%">
146
+          <Input style="width: 100%" disabled v-model="deviceInfo.appName" />
147
+        </div>
148
+      </div>
149
+      <div class="view_content" style="margin-top: 20px">
150
+        <div class="view_title">适配类型</div>
151
+        <div class="view_devices">
152
+          <div
153
+            class="view_list"
154
+            v-for="item in deviceInfo.devices"
155
+            :key="item.dgroupid"
156
+          >
157
+            <div class="dgname">{{ item.dgname }}</div>
158
+            <div class="devices">
159
+              <span v-for="sitem in item.devices" :key="sitem.deviceid">{{
160
+                sitem.deviceModel
161
+              }}</span>
162
+            </div>
163
+          </div>
164
+        </div>
165
+      </div>
166
+      <div slot="footer" style="text-align: center">
167
+        <Button @click="deviceInfo.show = false">关闭</Button>
168
+      </div>
169
+    </Modal>
170
+    <!-- 下载 -->
171
+    <Modal
172
+      class="modal_tip download"
173
+      :mask-closable="false"
174
+      v-model="downloadInfo.show"
175
+      title="下载"
176
+    >
177
+      <div class="content" v-if="downloadInfo.show">
178
+        <div class="title">{{ downloadInfo.appName }}</div>
179
+        <div class="qrcode">
180
+          <div id="ScanShare" ref="ScanShare"></div>
181
+          <p>扫描二维码进行下载</p>
182
+        </div>
183
+        <div class="download" @click="download(downloadInfo.apkPath)">
184
+          <Icon type="md-download" />点击下载
185
+        </div>
186
+      </div>
187
+
188
+      <div slot="footer" style="text-align: center">
189
+        <Button @click="downloadInfo.show = false">关闭</Button>
190
+      </div>
191
+    </Modal>
192
+    <!-- 查看 -->
193
+    <Modal
194
+      class="modal1"
195
+      :mask-closable="false"
196
+      v-model="viewInfo.show"
197
+      title="查看"
198
+    >
199
+      <div class="view_conten" v-if="viewInfo.show">
200
+        <div class="view_logo">
201
+          <div>
202
+            <img
203
+              v-if="viewInfo.appIcon"
204
+              :src="$api.showImageUrl + viewInfo.appIcon"
205
+            />
206
+          </div>
207
+          <div class="appIcon" @click="download(viewInfo.appIcon)">
208
+            <Icon type="md-download" />下载
209
+          </div>
210
+        </div>
211
+        <div class="view_conter">
212
+          <div class="view_comm">
213
+            <div class="view_titles">
214
+              {{ viewInfo.appName
215
+              }}<span v-if="viewInfo.enabled === 1" class="qy">启用</span>
216
+            </div>
217
+            <div class="view_item">
218
+              <span>版本号码</span>
219
+              <Select
220
+                :transfer="true"
221
+                v-model="viewInfo.versionName"
222
+                @on-change="viewInfoChange()"
223
+                style="width: 120px"
224
+              >
225
+                <Option
226
+                  v-for="item in viewInfo.apphistorys"
227
+                  :value="item.versionName"
228
+                  :key="item.versionName"
229
+                  >{{ item.versionName }}</Option
230
+                >
231
+              </Select>
232
+            </div>
233
+          </div>
234
+          <div class="view_comm">
235
+            <div class="view_item">
236
+              <span>版本名称</span>{{ viewInfo.versionName }}
237
+            </div>
238
+            <div class="view_item">
239
+              <span>分组</span>{{ viewInfo.appgroupName }}
240
+            </div>
241
+            <div class="view_item">
242
+              <span>开发者</span>{{ viewInfo.appDeveloper }}
243
+            </div>
244
+          </div>
245
+          <div class="view_comm">
246
+            <div class="view_item">
247
+              <span>强制安装</span>{{ viewInfo.forced === 0 ? "否" : "是" }}
248
+            </div>
249
+            <div class="view_item">
250
+              <span>可信任</span>{{ viewInfo.trusted === 0 ? "否" : "是" }}
251
+            </div>
252
+            <div class="view_item">
253
+              <span>隐藏图标</span>{{ viewInfo.showico === 0 ? "否" : "是" }}
254
+            </div>
255
+          </div>
256
+          <div class="view_comm">
257
+            <div class="view_item">
258
+              <span>应用属性</span
259
+              >{{ viewInfo.appType === 1 ? "推荐应用" : "必装应用" }}
260
+            </div>
261
+            <div class="view_item">
262
+              <span>应用大小</span>{{ viewInfo.appSize }}
263
+            </div>
264
+            <div class="view_item">
265
+              <span>应用包名</span>{{ viewInfo.appPackage }}
266
+            </div>
267
+          </div>
268
+          <div class="view_comm">
269
+            <div class="view_item">
270
+              <span style="width: 120px">网址白名单例外</span
271
+              >{{ viewInfo.whited === 0 ? "否" : "是" }}
272
+            </div>
273
+            <div class="view_item">
274
+              <span style="width: 120px">允许清空缓存</span
275
+              >{{ viewInfo.cached === 0 ? "否" : "是" }}
276
+            </div>
277
+            <div class="view_item">
278
+              <span style="width: 120px">添加到已有策略</span
279
+              >{{ viewInfo.strategy === 0 ? "否" : "是" }}
280
+            </div>
281
+          </div>
282
+          <div class="view_com">
283
+            <div class="view_t">应用截图</div>
284
+            <div class="view_img">
285
+              <img
286
+                v-for="img in viewInfo.appImg"
287
+                :key="img"
288
+                :src="$api.showImageUrl + img"
289
+              />
290
+            </div>
291
+          </div>
292
+          <div class="view_com">
293
+            <div class="view_t">应用简介</div>
294
+            <div>{{ viewInfo.appAbbr }}</div>
295
+          </div>
296
+          <div class="view_com">
297
+            <div class="view_t">更新</div>
298
+            <div>{{ viewInfo.appRenew }}</div>
299
+          </div>
300
+          <div class="view_com">
301
+            <div class="view_t">授权型号</div>
302
+            <div class="view_devices">
303
+              <div
304
+                class="view_list"
305
+                v-for="item in viewInfo.devices"
306
+                :key="item.dgroupid"
307
+              >
308
+                <div class="dgname" style="line-height: 40px">
309
+                  {{ item.dgname }}
310
+                </div>
311
+                <div class="devices">
312
+                  <span v-for="sitem in item.devices" :key="sitem.deviceid">{{
313
+                    sitem.deviceModel
314
+                  }}</span>
315
+                </div>
316
+              </div>
317
+            </div>
318
+          </div>
319
+          <div class="view_com">
320
+            <div class="view_t">选择学校</div>
321
+            <div class="view_devices">
322
+              <div class="devices">
323
+                <span v-for="item in viewInfo.schools" :key="item.schoolid">{{
324
+                  item.schoolName
325
+                }}</span>
326
+              </div>
327
+            </div>
328
+          </div>
329
+        </div>
330
+      </div>
331
+
332
+      <div slot="footer" style="text-align: center">
333
+        <Button @click="viewInfo.show = false">关闭</Button>
334
+      </div>
335
+    </Modal>
336
+    <!-- 查看 -->
337
+    <Modal
338
+      class="modal1"
339
+      :mask-closable="false"
340
+      v-model="viewInfo.show"
341
+      title="查看"
342
+    >
343
+      <div class="view_conten" v-if="viewInfo.show">
344
+        <div class="view_logo">
345
+          <div>
346
+            <img
347
+              v-if="viewInfo.appIcon"
348
+              :src="$api.showImageUrl + viewInfo.appIcon"
349
+            />
350
+          </div>
351
+          <div class="appIcon" @click="download(viewInfo.appIcon)">
352
+            <Icon type="md-download" />下载
353
+          </div>
354
+        </div>
355
+        <div class="view_conter">
356
+          <div class="view_comm">
357
+            <div class="view_titles">
358
+              {{ viewInfo.appName
359
+              }}<span v-if="viewInfo.enabled === 1" class="qy">启用</span>
360
+            </div>
361
+            <div class="view_item">
362
+              <span>版本号码</span>
363
+              <Select
364
+                :transfer="true"
365
+                v-model="viewInfo.versionName"
366
+                @on-change="viewInfoChange()"
367
+                style="width: 120px"
368
+              >
369
+                <Option
370
+                  v-for="item in viewInfo.apphistorys"
371
+                  :value="item.versionName"
372
+                  :key="item.versionName"
373
+                  >{{ item.versionName }}</Option
374
+                >
375
+              </Select>
376
+            </div>
377
+          </div>
378
+          <div class="view_comm">
379
+            <div class="view_item">
380
+              <span>版本名称</span>{{ viewInfo.versionName }}
381
+            </div>
382
+            <div class="view_item">
383
+              <span>分组</span>{{ viewInfo.appgroupName }}
384
+            </div>
385
+            <div class="view_item">
386
+              <span>开发者</span>{{ viewInfo.appDeveloper }}
387
+            </div>
388
+          </div>
389
+          <div class="view_comm">
390
+            <div class="view_item">
391
+              <span>强制安装</span>{{ viewInfo.forced === 0 ? "否" : "是" }}
392
+            </div>
393
+            <div class="view_item">
394
+              <span>可信任</span>{{ viewInfo.trusted === 0 ? "否" : "是" }}
395
+            </div>
396
+            <div class="view_item">
397
+              <span>隐藏图标</span>{{ viewInfo.showico === 0 ? "否" : "是" }}
398
+            </div>
399
+          </div>
400
+          <div class="view_comm">
401
+            <div class="view_item">
402
+              <span>应用属性</span
403
+              >{{ viewInfo.appType === 1 ? "推荐应用" : "必装应用" }}
404
+            </div>
405
+            <div class="view_item">
406
+              <span>应用大小</span>{{ viewInfo.appSize }}
407
+            </div>
408
+            <div class="view_item">
409
+              <span>应用包名</span>{{ viewInfo.appPackage }}
410
+            </div>
411
+          </div>
412
+          <div class="view_comm">
413
+            <div class="view_item">
414
+              <span style="width: 120px">网址白名单例外</span
415
+              >{{ viewInfo.whited === 0 ? "否" : "是" }}
416
+            </div>
417
+            <div class="view_item">
418
+              <span style="width: 120px">允许清空缓存</span
419
+              >{{ viewInfo.cached === 0 ? "否" : "是" }}
420
+            </div>
421
+            <div class="view_item">
422
+              <span style="width: 120px">添加到已有策略</span
423
+              >{{ viewInfo.strategy === 0 ? "否" : "是" }}
424
+            </div>
425
+          </div>
426
+          <div class="view_com">
427
+            <div class="view_t">应用截图</div>
428
+            <div class="view_img">
429
+              <img
430
+                v-for="img in viewInfo.appImg"
431
+                :key="img"
432
+                :src="$api.showImageUrl + img"
433
+              />
434
+            </div>
435
+          </div>
436
+          <div class="view_com">
437
+            <div class="view_t">应用简介</div>
438
+            <div>{{ viewInfo.appAbbr }}</div>
439
+          </div>
440
+          <div class="view_com">
441
+            <div class="view_t">更新</div>
442
+            <div>{{ viewInfo.appRenew }}</div>
443
+          </div>
444
+          <div class="view_com">
445
+            <div class="view_t">授权型号</div>
446
+            <div class="view_devices">
447
+              <div
448
+                class="view_list"
449
+                v-for="item in viewInfo.devices"
450
+                :key="item.dgroupid"
451
+              >
452
+                <div class="dgname" style="line-height: 40px">
453
+                  {{ item.dgname }}
454
+                </div>
455
+                <div class="devices">
456
+                  <span v-for="sitem in item.devices" :key="sitem.deviceid">{{
457
+                    sitem.deviceModel
458
+                  }}</span>
459
+                </div>
460
+              </div>
461
+            </div>
462
+          </div>
463
+          <div class="view_com">
464
+            <div class="view_t">选择学校</div>
465
+            <div class="view_devices">
466
+              <div class="devices">
467
+                <span v-for="item in viewInfo.schools" :key="item.schoolid">{{
468
+                  item.schoolName
469
+                }}</span>
470
+              </div>
471
+            </div>
472
+          </div>
473
+        </div>
474
+      </div>
475
+
476
+      <div slot="footer" style="text-align: center">
477
+        <Button @click="viewInfo.show = false">关闭</Button>
478
+      </div>
479
+    </Modal>
96 480
     <Spin fix v-if="showLoading" style="background-color: transparent">
97 481
       <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
98 482
       <div>加载中</div>
@@ -102,11 +486,96 @@
102 486
 
103 487
 <script>
104 488
 import { search_list_app } from "@/api/region";
105
-import { app_edit_enable, app_edit_unenable } from "@/api/appgroup";
489
+import {
490
+  app_delete,
491
+  app_detail,
492
+  app_detail_history,
493
+  app_edit_enable,
494
+  app_edit_unenable,
495
+  app_install_statistic
496
+} from "@/api/appgroup";
497
+import QRCode from "qrcodejs2";
106 498
 export default {
107 499
   data() {
108 500
     return {
109 501
       showLoading: false,
502
+      downloadInfo: {
503
+        show: false,
504
+        appName: "",
505
+        apkPath: ""
506
+      },
507
+      deviceInfo: {
508
+        show: false,
509
+        appName: "",
510
+        devices: []
511
+      },
512
+      // 查看
513
+      viewInfo: {
514
+        show: false,
515
+        appName: "",
516
+        appgroupName: "",
517
+        enabled: 1,
518
+        appType: 1,
519
+        forced: 1,
520
+        whited: 1,
521
+        trusted: 1,
522
+        showico: 1,
523
+        cached: 1,
524
+        strategy: 1,
525
+        apkPath: "",
526
+        appIcon: "",
527
+        appImg: [],
528
+        versionName: "",
529
+        versionNum: "",
530
+        appSize: "",
531
+        appDeveloper: "",
532
+        appPackage: "",
533
+        appAbbr: "",
534
+        appRenew: "",
535
+        targetSchool: 2,
536
+        deviceids: [],
537
+        schoolids: []
538
+      },
539
+      installInfo: {
540
+        show: false,
541
+        appName: "",
542
+        versionName: null,
543
+        apphistorys: [],
544
+        list: [],
545
+        columns: [
546
+          {
547
+            title: "序号",
548
+            type: "index",
549
+            width: 70,
550
+            align: "center"
551
+          },
552
+          {
553
+            title: "区域名称",
554
+            key: "regionName",
555
+            align: "center"
556
+          },
557
+          {
558
+            title: "设备总数",
559
+            key: "total",
560
+            align: "center"
561
+          },
562
+          {
563
+            title: "已安装设备数",
564
+            key: "installNum",
565
+            align: "center"
566
+          },
567
+          {
568
+            title: "未安装设备总数",
569
+            key: "unInstallNum",
570
+            align: "center"
571
+          },
572
+          {
573
+            title: "安装比例",
574
+            key: "installRate",
575
+            align: "center"
576
+          }
577
+        ]
578
+      },
110 579
       searchForm: {
111 580
         name: "",
112 581
         title: "",
@@ -148,7 +617,7 @@ export default {
148 617
         },
149 618
         {
150 619
           title: "状态",
151
-          slot: "enable",
620
+          slot: "enabled",
152 621
           width: 120,
153 622
           align: "center"
154 623
         },
@@ -194,8 +663,33 @@ export default {
194 663
     this.searchList();
195 664
   },
196 665
   methods: {
666
+    //下载logo
667
+    download(url) {
668
+      window.location.href = this.$api.showImageUrl + url;
669
+    },
670
+    //查看型号
671
+    see_device(row) {
672
+      this.showLoading = true;
673
+      app_detail({
674
+        rtype: this.powerParams.rtype,
675
+        objectid: this.powerParams.objectid,
676
+        appid: row.appid
677
+      }).then((res) => {
678
+        this.showLoading = false;
679
+        if (res.code === 0) {
680
+          this.deviceInfo = {
681
+            show: true,
682
+            appName: res.obj.appName,
683
+            devices: res.obj.devices
684
+          };
685
+          console.log(this.deviceInfo);
686
+        } else {
687
+          this.$Message.error(res.msg);
688
+        }
689
+      });
690
+    },
197 691
     enabledChange(row) {
198
-      let api = row.enable === 1 ? app_edit_enable : app_edit_unenable;
692
+      let api = row.enabled === 1 ? app_edit_enable : app_edit_unenable;
199 693
       this.showLoading = true;
200 694
       api({
201 695
         rtype: this.powerParams.rtype,
@@ -212,9 +706,197 @@ export default {
212 706
         }
213 707
       });
214 708
     },
215
-    countSlot() {},
216
-    toView() {},
217
-    toDel() {},
709
+    installChange() {
710
+      //安装统计切换版本
711
+      console.log(this.installInfo.versionName);
712
+      let obj = this.installInfo.apphistorys.filter(
713
+        (v) => v.versionName === this.installInfo.versionName
714
+      )[0];
715
+      this.showLoading = true;
716
+      app_install_statistic({
717
+        appPackage: obj.appPackage,
718
+        versionName: obj.versionName,
719
+        rtype: this.powerParams.rtype,
720
+        objectid: this.powerParams.objectid
721
+      }).then((res) => {
722
+        this.showLoading = false;
723
+        if (res.code === 0) {
724
+          console.log(res.obj);
725
+          this.installInfo.list = res.obj;
726
+        } else {
727
+          this.$Message.error(res.msg);
728
+        }
729
+      });
730
+    },
731
+    async countSlot(row, type) {
732
+      if (type === 1) {
733
+        //下载
734
+        this.downloadInfo = {
735
+          show: true,
736
+          appName: row.appName,
737
+          apkPath: row.apkPath
738
+        };
739
+        this.$nextTick(() => {
740
+          let qrcodeEl = this.$refs.ScanShare;
741
+          if (!qrcodeEl) {
742
+            return;
743
+          }
744
+          qrcodeEl.innerHTML = "";
745
+          let qrcode = new QRCode(qrcodeEl, {
746
+            width: 140,
747
+            height: 140,
748
+            text: this.$api.showImageUrl + this.downloadInfo.apkPath
749
+          });
750
+          qrcode._el.title = "";
751
+        });
752
+        console.log(this.downloadInfo);
753
+      } else if (type === 2) {
754
+        //获取历史版本
755
+        this.showLoading = true;
756
+        let res = await app_detail_history({ appid: row.appid });
757
+        if (res.code === 0) {
758
+        } else {
759
+          this.$Message.error(res.msg);
760
+        }
761
+        //安装统计
762
+        let res1 = await app_install_statistic({
763
+          appPackage: row.appPackage,
764
+          versionName: row.versionName,
765
+          rtype: this.powerParams.rtype,
766
+          objectid: this.powerParams.objectid
767
+        });
768
+        this.showLoading = false;
769
+        if (res1.code === 0) {
770
+          console.log(res1.obj);
771
+          this.installInfo = {
772
+            show: true,
773
+            appName: row.appName,
774
+            apphistorys: res.obj,
775
+            versionName: row.versionName,
776
+            list: res1.obj,
777
+            columns: [
778
+              {
779
+                title: "序号",
780
+                type: "index",
781
+                width: 70,
782
+                align: "center"
783
+              },
784
+              {
785
+                title: "区域名称",
786
+                key: "regionName",
787
+                align: "center"
788
+              },
789
+              {
790
+                title: "设备总数",
791
+                key: "total",
792
+                align: "center"
793
+              },
794
+              {
795
+                title: "已安装设备数",
796
+                key: "installNum",
797
+                align: "center"
798
+              },
799
+              {
800
+                title: "未安装设备总数",
801
+                key: "unInstallNum",
802
+                align: "center"
803
+              },
804
+              {
805
+                title: "安装比例",
806
+                key: "installRate",
807
+                align: "center"
808
+              }
809
+            ]
810
+          };
811
+        } else {
812
+          this.$Message.error(res1.msg);
813
+        }
814
+      }
815
+    },
816
+    viewInfoChange() {
817
+      //查看切换版本
818
+      let obj = this.viewInfo.apphistorys.filter(
819
+        (v) => v.versionName === this.viewInfo.versionName
820
+      )[0];
821
+      console.log(obj);
822
+      this.viewInfo.apkPath = obj.apkPath;
823
+      this.viewInfo.appAbbr = obj.appAbbr;
824
+      this.viewInfo.appDeveloper = obj.appDeveloper;
825
+      this.viewInfo.appIcon = obj.appIcon;
826
+      this.viewInfo.appImg = obj.appImg.split(";");
827
+      this.viewInfo.appPackage = obj.appPackage;
828
+      this.viewInfo.appRenew = obj.appRenew;
829
+      this.viewInfo.appSize = obj.appSize;
830
+      this.viewInfo.versionNum = obj.versionNum;
831
+    },
832
+    // 查看
833
+    toView(row) {
834
+      this.showLoading = true;
835
+      app_detail({
836
+        rtype: this.powerParams.rtype,
837
+        objectid: this.powerParams.objectid,
838
+        appid: row.appid
839
+      }).then((res) => {
840
+        this.showLoading = false;
841
+        if (res.code === 0) {
842
+          this.viewInfo = {
843
+            show: true,
844
+            apphistorys: res.obj.apphistorys,
845
+            appName: res.obj.appName,
846
+            appgroupName: row.appgroupName,
847
+            enabled: res.obj.enabled,
848
+            appType: res.obj.appType,
849
+            forced: res.obj.forced,
850
+            whited: res.obj.whited,
851
+            trusted: res.obj.trusted,
852
+            showico: res.obj.showico,
853
+            cached: res.obj.cached,
854
+            strategy: res.obj.strategy,
855
+            apkPath: res.obj.apkPath,
856
+            appIcon: res.obj.appIcon,
857
+            appImg: res.obj.appImg ? res.obj.appImg.split(";") : [],
858
+            versionName: res.obj.versionName,
859
+            versionNum: res.obj.versionNum,
860
+            appSize: res.obj.appSize,
861
+            appDeveloper: res.obj.appDeveloper,
862
+            appPackage: res.obj.appPackage,
863
+            appAbbr: res.obj.appAbbr,
864
+            appRenew: res.obj.appRenew,
865
+            targetSchool: res.obj.targetSchool,
866
+            devices: res.obj.devices,
867
+            schools: res.obj.schools
868
+          };
869
+          console.log(this.viewInfo);
870
+        } else {
871
+          this.$Message.error(res.msg);
872
+        }
873
+      });
874
+    },
875
+    // 删除
876
+    toDel(row) {
877
+      this.$Modal.confirm({
878
+        title: "提示",
879
+        content: "您确定删除选中数据吗?",
880
+        onOk: () => {
881
+          this.showLoading = true;
882
+          app_delete({
883
+            rtype: this.powerParams.rtype,
884
+            objectid: this.powerParams.objectid,
885
+            appid: row.appid,
886
+            rversion: row.rversion
887
+          }).then((res) => {
888
+            this.showLoading = false;
889
+            if (res.code === 0) {
890
+              this.$Message.success(res.msg);
891
+              this.searchList();
892
+            } else {
893
+              this.$Message.error(res.msg);
894
+            }
895
+          });
896
+        },
897
+        onCancel: () => {}
898
+      });
899
+    },
218 900
     // 搜索
219 901
     searchList() {
220 902
       this.searchForm.page = 1;
@@ -297,4 +979,138 @@ export default {
297 979
     }
298 980
   }
299 981
 }
982
+.view_content {
983
+  display: flex;
984
+  .view_title {
985
+    width: 90px;
986
+    text-align: right;
987
+    flex: none;
988
+    font-size: 16px;
989
+    margin: 0 10px;
990
+    line-height: 32px;
991
+    height: 32px;
992
+  }
993
+}
994
+.download {
995
+  .content {
996
+    text-align: center;
997
+    .title {
998
+      font-size: 18px;
999
+      font-weight: bold;
1000
+      margin-bottom: 30px;
1001
+    }
1002
+    .qrcode {
1003
+      width: 172px;
1004
+      padding: 16px;
1005
+      margin: 0 auto;
1006
+      border: 2px solid #ffffff;
1007
+      background: #ffffff4d;
1008
+      box-shadow: 0 10px 30px 0 #339dff26;
1009
+      #ScanShare {
1010
+        width: 140px;
1011
+        height: 140px;
1012
+        margin-bottom: 10px;
1013
+      }
1014
+    }
1015
+    .download {
1016
+      margin-top: 40px;
1017
+      &:hover {
1018
+        cursor: pointer;
1019
+        color: #339cff;
1020
+      }
1021
+    }
1022
+  }
1023
+}
1024
+.install_title {
1025
+  margin-bottom: 16px;
1026
+  font-size: 18px;
1027
+  font-weight: bold;
1028
+  text-align: center;
1029
+  position: relative;
1030
+}
1031
+.history {
1032
+  position: absolute;
1033
+  top: 0;
1034
+  right: 0;
1035
+  display: flex;
1036
+  font-size: 16px;
1037
+  font-weight: 400;
1038
+  font-family: "SourceHanSansCN";
1039
+  align-items: center;
1040
+}
1041
+.view_conten {
1042
+  display: flex;
1043
+  .view_logo {
1044
+    width: 90px;
1045
+    height: 90px;
1046
+    margin-right: 20px;
1047
+    border: 1px solid #e5e5e5;
1048
+    background-color: white;
1049
+    border-radius: 20px;
1050
+    padding: 15px;
1051
+    img {
1052
+      width: 60px;
1053
+      height: 60px;
1054
+      object-fit: cover;
1055
+    }
1056
+    .appIcon {
1057
+      margin-top: 10px;
1058
+      color: #96abdf;
1059
+      line-height: 30px;
1060
+      &:hover {
1061
+        cursor: pointer;
1062
+        color: #339cff;
1063
+      }
1064
+    }
1065
+  }
1066
+  .view_conter {
1067
+    width: calc(100% - 110px);
1068
+    font-size: 16px;
1069
+    .view_comm {
1070
+      display: flex;
1071
+      justify-content: space-between;
1072
+      line-height: 40px;
1073
+      .view_titles {
1074
+        font-size: 20px;
1075
+        font-weight: bold;
1076
+        .qy {
1077
+          background-color: #52c41a;
1078
+          border-radius: 6px;
1079
+          font-size: 10px;
1080
+          color: white;
1081
+          margin-left: 10px;
1082
+          padding: 4px 6px;
1083
+        }
1084
+      }
1085
+      .view_item {
1086
+        width: 33%;
1087
+        span {
1088
+          display: inline-block;
1089
+          width: 70px;
1090
+          margin-right: 20px;
1091
+        }
1092
+      }
1093
+    }
1094
+    .view_com {
1095
+      display: flex;
1096
+      line-height: 40px;
1097
+      .view_t {
1098
+        width: 70px;
1099
+        flex: none;
1100
+        margin-right: 20px;
1101
+        text-align: right;
1102
+      }
1103
+      .view_img {
1104
+        display: flex;
1105
+        padding-top: 10px;
1106
+        img {
1107
+          width: 90px;
1108
+          height: 80px;
1109
+          object-fit: cover;
1110
+          margin-right: 20px;
1111
+        }
1112
+      }
1113
+    }
1114
+  }
1115
+}
300 1116
 </style>

+ 1
- 1
src/views/regionSection/search/allWhitelists.vue ファイルの表示

@@ -157,7 +157,7 @@ export default {
157 157
         },
158 158
         {
159 159
           title: "所属区域",
160
-          key: "name",
160
+          key: "regionName",
161 161
           align: "center"
162 162
         },
163 163
         {

+ 2
- 9
src/views/regionSection/setting/logo.vue ファイルの表示

@@ -103,9 +103,7 @@ export default {
103 103
     init() {
104 104
       logo_detail({
105 105
         rtype: this.powerParams.rtype,
106
-        objectid: this.powerParams.objectid,
107
-        regionid: this.powerParams.objectid,
108
-        llevel: 2
106
+        objectid: this.powerParams.objectid
109 107
       }).then((res) => {
110 108
         this.showLoading = false;
111 109
         if (res.code === 0) {
@@ -143,7 +141,6 @@ export default {
143 141
         .then((res) => {
144 142
           this.showLoading = false;
145 143
           if (res.data.code === 0) {
146
-            console.log(res.data);
147 144
             this.form.logoPath = res.data.obj;
148 145
             this.$Message.success(res.data.msg);
149 146
           } else {
@@ -167,7 +164,6 @@ export default {
167 164
         this.showLoading = false;
168 165
         if (res.code === 0) {
169 166
           this.form.logoPath = "";
170
-          console.log(res.obj);
171 167
           this.$Message.success(res.msg);
172 168
         } else {
173 169
           this.$Message.error(res.msg);
@@ -179,15 +175,12 @@ export default {
179 175
         logoPath: this.form.logoPath,
180 176
         llevel: 2,
181 177
         rtype: this.powerParams.rtype,
182
-        objectid: this.powerParams.objectid,
183
-        regionid: this.powerParams.objectid
178
+        objectid: this.powerParams.objectid
184 179
       };
185
-      console.log(form);
186 180
       this.showLoading = true;
187 181
       logo_edit(form).then((res) => {
188 182
         this.showLoading = false;
189 183
         if (res.code === 0) {
190
-          console.log(res.obj);
191 184
           this.$Message.success(res.msg);
192 185
         } else {
193 186
           this.$Message.error(res.msg);

+ 5
- 6
src/views/regionSection/setting/powerUp.vue ファイルの表示

@@ -41,10 +41,7 @@
41 41
 </template>
42 42
 
43 43
 <script>
44
-import {
45
-  autoapp_detail,
46
-  autoapp_edit
47
-} from "@/api/setting";
44
+import { autoapp_detail, autoapp_edit } from "@/api/setting";
48 45
 
49 46
 export default {
50 47
   data() {
@@ -72,9 +69,11 @@ export default {
72 69
   },
73 70
   methods: {
74 71
     init() {
75
-      autoapp_detail({  rtype: this.powerParams.rtype,
72
+      autoapp_detail({
73
+        rtype: this.powerParams.rtype,
76 74
         objectid: this.powerParams.objectid,
77
-        regionid: this.powerParams.objectid }).then((res) => {
75
+        regionid: this.powerParams.objectid
76
+      }).then((res) => {
78 77
         this.showLoading = false;
79 78
         if (res.code === 0) {
80 79
           if (res.obj) {

+ 82
- 62
src/views/regionSection/setting/wallpaper.vue ファイルの表示

@@ -9,7 +9,7 @@
9 9
         style="width: 150px"
10 10
       />
11 11
       <Button
12
-        v-if="searchForm.list.length === 0"
12
+        v-if="add_has === 1"
13 13
         type="primary"
14 14
         class="primary_btn"
15 15
         @click="toAdd()"
@@ -161,10 +161,13 @@ import axios from "axios";
161 161
 import CheckboxDevice from "@/components/Checkbox/CheckboxDevice";
162 162
 import {
163 163
   wallpaper_add,
164
+  wallpaper_add_has,
164 165
   wallpaper_delete,
165 166
   wallpaper_detail,
166 167
   wallpaper_edit,
167
-  wallpaper_list
168
+  wallpaper_list,
169
+  wallpaper_list_device,
170
+  wallpaper_list_devicewp
168 171
 } from "@/api/setting";
169 172
 import { device_list } from "@/api/appgroup";
170 173
 export default {
@@ -217,6 +220,7 @@ export default {
217 220
       userInfo: {},
218 221
       device_list: [],
219 222
       deviceids: {}, //设备类型
223
+      add_has: 0,
220 224
       columns: [
221 225
         {
222 226
           title: "序号",
@@ -277,17 +281,19 @@ export default {
277 281
     CheckboxDevice(dgroupid, val) {
278 282
       this.deviceids[dgroupid] = val;
279 283
     },
280
-    init() {
281
-      //获取分组下设备
284
+    async init() {
285
+      //是否显示添加按钮
282 286
       this.showLoading = true;
283
-      device_list({}).then((res) => {
284
-        this.showLoading = false;
285
-        if (res.code === 0) {
286
-          this.device_list = res.obj;
287
-        } else {
288
-          this.$Message.error(res.msg);
289
-        }
287
+      let res = await wallpaper_add_has({
288
+        wlevel: 2,
289
+        objectid: this.powerParams.objectid
290 290
       });
291
+      this.showLoading = false;
292
+      if (res.code === 0) {
293
+        this.add_has = res.obj;
294
+      } else {
295
+        this.$Message.error(res.msg);
296
+      }
291 297
     },
292 298
     upLoad(file) {
293 299
       let str = file.name.split(".");
@@ -345,8 +351,7 @@ export default {
345 351
         size: this.searchForm.size,
346 352
         name: this.searchForm.name,
347 353
         rtype: this.powerParams.rtype,
348
-        objectid: this.powerParams.objectid,
349
-        regionid: this.powerParams.objectid
354
+        objectid: this.powerParams.objectid
350 355
       }).then((data) => {
351 356
         this.showLoading = false;
352 357
         if (data.code === 0) {
@@ -359,15 +364,27 @@ export default {
359 364
     },
360 365
     // 新建
361 366
     toAdd() {
362
-      this.wallpaperInfo = {
363
-        show: true,
364
-        id: null,
365
-        wname: "",
366
-        hpath: "",
367
-        wlevel: "",
368
-        objectid: "",
369
-        deviceids: []
370
-      };
367
+      this.showLoading = true;
368
+      wallpaper_list_device({
369
+        wlevel: 2,
370
+        objectid: this.powerParams.objectid
371
+      }).then((res) => {
372
+        this.showLoading = false;
373
+        if (res.code === 0) {
374
+          this.device_list = res.obj;
375
+          this.wallpaperInfo = {
376
+            show: true,
377
+            id: null,
378
+            wname: "",
379
+            hpath: "",
380
+            wlevel: "",
381
+            objectid: "",
382
+            deviceids: []
383
+          };
384
+        } else {
385
+          this.$Message.error(res.msg);
386
+        }
387
+      });
371 388
     },
372 389
     // 保存新建
373 390
     saveAddInfo() {
@@ -397,7 +414,6 @@ export default {
397 414
             wlevel: 2,
398 415
             rtype: this.powerParams.rtype,
399 416
             objectid: this.powerParams.objectid,
400
-            regionid: this.powerParams.objectid,
401 417
             deviceids
402 418
           };
403 419
           if (this.wallpaperInfo.wallpaperid) {
@@ -441,52 +457,56 @@ export default {
441 457
       });
442 458
     },
443 459
     // 编辑
444
-    toEdit(row) {
460
+    async toEdit(row) {
445 461
       this.showLoading = true;
446
-      wallpaper_detail({
462
+      //获取选择设备包含自己
463
+      let res1 = await wallpaper_list_devicewp({
464
+        wlevel: this.powerParams.rtype,
465
+        objectid: this.powerParams.objectid,
466
+        wallpaperid: row.wallpaperid
467
+      });
468
+      if (res1.code === 0) {
469
+        this.device_list = res1.obj;
470
+      } else {
471
+        this.$Message.error(res1.msg);
472
+      }
473
+      //获取详情
474
+      let res = await wallpaper_detail({
447 475
         rtype: this.powerParams.rtype,
448 476
         objectid: this.powerParams.objectid,
449 477
         wallpaperid: row.wallpaperid
450
-      }).then((data) => {
451
-        this.showLoading = false;
452
-        if (data.code === 0) {
453
-          this.wallpaperInfo = {
454
-            show: true,
455
-            wallpaperid: data.obj.wallpaperid,
456
-            wname: data.obj.wname,
457
-            hpath: data.obj.hpath,
458
-            wlevel: data.obj.wlevel,
459
-            objectid: data.obj.objectid,
460
-            deviceids: data.obj.devices,
461
-            rversion: data.obj.rversion
462
-          };
463
-          this.$nextTick(() => {
464
-            //回显设备
465
-            let checkedArr = this.$refs.checkbevice;
466
-            if (checkedArr) {
467
-              for (let m = 0; m < checkedArr.length; m++) {
468
-                let dgroupid = checkedArr[m].module.dgroupid;
469
-                let marr = data.obj.devices;
470
-                for (let h = 0; h < marr.length; h++) {
471
-                  let arr = marr[h].devices;
472
-                  if (dgroupid == marr[h].dgroupid) {
473
-                    checkedArr[m].getCheckedDevices(arr);
474
-                  }
478
+      });
479
+      this.showLoading = false;
480
+      if (res.code === 0) {
481
+        this.wallpaperInfo = {
482
+          show: true,
483
+          wallpaperid: res.obj.wallpaperid,
484
+          wname: res.obj.wname,
485
+          hpath: res.obj.hpath,
486
+          wlevel: res.obj.wlevel,
487
+          objectid: res.obj.objectid,
488
+          deviceids: res.obj.devices,
489
+          rversion: res.obj.rversion
490
+        };
491
+        this.$nextTick(() => {
492
+          //回显设备
493
+          let checkedArr = this.$refs.checkbevice;
494
+          if (checkedArr) {
495
+            for (let m = 0; m < checkedArr.length; m++) {
496
+              let dgroupid = checkedArr[m].module.dgroupid;
497
+              let marr = res.obj.devices;
498
+              for (let h = 0; h < marr.length; h++) {
499
+                let arr = marr[h].devices;
500
+                if (dgroupid == marr[h].dgroupid) {
501
+                  checkedArr[m].getCheckedDevices(arr);
475 502
                 }
476 503
               }
477 504
             }
478
-          });
479
-        } else {
480
-          this.$Message.error(data.msg);
481
-        }
482
-      });
483
-      this.wallpaperInfo = {
484
-        show: true,
485
-        // 验证码计时
486
-        timer: null,
487
-        name: "",
488
-        img: ""
489
-      };
505
+          }
506
+        });
507
+      } else {
508
+        this.$Message.error(res.msg);
509
+      }
490 510
     },
491 511
     // 删除
492 512
     toDel(row) {

読み込み中…
キャンセル
保存