Browse Source

路由根据权限跳转传参

gzb
wangzhonglu 9 months ago
parent
commit
bee8a54650
36 changed files with 721 additions and 98 deletions
  1. 3
    1
      src/App.vue
  2. 1
    1
      src/api/region.js
  3. 91
    1
      src/router/index.js
  4. 131
    3
      src/store/index.js
  5. 54
    1
      src/views/layout.vue
  6. 2
    7
      src/views/login/login.vue
  7. 11
    1
      src/views/platformSection/log/deviceExport.vue
  8. 11
    0
      src/views/platformSection/networkManage/whitelistLibrary.vue
  9. 15
    0
      src/views/platformSection/notice/notice.vue
  10. 13
    0
      src/views/platformSection/regionManage/adminManage.vue
  11. 17
    1
      src/views/platformSection/regionManage/regionManage.vue
  12. 41
    2
      src/views/regionSection/index.vue
  13. 11
    3
      src/views/regionSection/regionManage/regionManage.vue
  14. 11
    4
      src/views/regionSection/regionManage/schoolManage.vue
  15. 14
    6
      src/views/schoolSection/applicationManage/greenBrowser.vue
  16. 8
    2
      src/views/schoolSection/deviceManage/breakRuleDevice.vue
  17. 14
    2
      src/views/schoolSection/deviceManage/deviceManage.vue
  18. 8
    1
      src/views/schoolSection/deviceManage/inLineDevice.vue
  19. 8
    1
      src/views/schoolSection/deviceManage/outControlDevice.vue
  20. 8
    1
      src/views/schoolSection/deviceManage/removeControlDevice.vue
  21. 22
    2
      src/views/schoolSection/index.vue
  22. 11
    2
      src/views/schoolSection/log/admin.vue
  23. 11
    2
      src/views/schoolSection/log/appLaunch.vue
  24. 11
    2
      src/views/schoolSection/log/applicationDownload.vue
  25. 17
    4
      src/views/schoolSection/log/deviceEvents.vue
  26. 17
    4
      src/views/schoolSection/log/deviceExport.vue
  27. 17
    4
      src/views/schoolSection/log/deviceInstallation.vue
  28. 17
    2
      src/views/schoolSection/log/deviceLocation.vue
  29. 11
    2
      src/views/schoolSection/log/devicePush.vue
  30. 17
    4
      src/views/schoolSection/log/violatingDevice.vue
  31. 22
    8
      src/views/schoolSection/networkManage/whitelist.vue
  32. 12
    2
      src/views/schoolSection/networkManage/whitelistLibrary.vue
  33. 9
    0
      src/views/schoolSection/notice/notice.vue
  34. 21
    9
      src/views/schoolSection/setting/deviceSetting.vue
  35. 12
    5
      src/views/schoolSection/setting/logo.vue
  36. 22
    8
      src/views/schoolSection/setting/wallpaper.vue

+ 3
- 1
src/App.vue View File

@@ -9,7 +9,9 @@ export default {
9 9
   data() {
10 10
     return {};
11 11
   },
12
-  created() {},
12
+  created() {
13
+    this.$store.commit("setPowerAfterRefresh");
14
+  },
13 15
   methods: {}
14 16
 };
15 17
 </script>

+ 1
- 1
src/api/region.js View File

@@ -17,7 +17,7 @@ export const region_list_sel_pt = (data) =>
17 17
  * 2.1.1.2区域--区域选择列表
18 18
  */
19 19
 export const region_list_sel_qy = (data) =>
20
-    setRequest("region/list_sel_qy", data);
20
+  setRequest("region/list_sel_qy", data);
21 21
 /**
22 22
  * 2.1.1.2区域--区域学校选择列表
23 23
  */

+ 91
- 1
src/router/index.js View File

@@ -93,7 +93,97 @@ router.beforeEach((to, from, next) => {
93 93
             "xh_control_userInfo",
94 94
             JSON.stringify(_userInfo)
95 95
           );
96
-          next();
96
+          let _userPower = localStorage.getItem("xh_control_userPower");
97
+          if (_userPower) {
98
+            _userPower = JSON.parse(_userPower);
99
+            if (_userPower.atype === 3) {
100
+              if (
101
+                to.path.startsWith("/platform/") ||
102
+                to.path.startsWith("/region/")
103
+              ) {
104
+                console.log("文件名:router index.vue,退出原因:未获得权限1");
105
+                next({
106
+                  path: "/login",
107
+                  query: to.query
108
+                });
109
+              } else {
110
+                next();
111
+              }
112
+            } else if (_userPower.atype === 2) {
113
+              if (to.path.startsWith("/platform/")) {
114
+                console.log("文件名:router index.vue,退出原因:未获得权限2");
115
+                next({
116
+                  path: "/login",
117
+                  query: to.query
118
+                });
119
+              } else {
120
+                if (to.path.startsWith("/region/")) {
121
+                  if (_userPower.regionids.length > 0 && _userPower.schoolid) {
122
+                    next("/school");
123
+                  } else {
124
+                    next();
125
+                  }
126
+                } else if (to.path.startsWith("/school/")) {
127
+                  if (_userPower.regionids.length > 0 && !_userPower.schoolid) {
128
+                    next("/region");
129
+                  } else {
130
+                    next();
131
+                  }
132
+                } else {
133
+                  next();
134
+                }
135
+              }
136
+            } else if (_userPower.atype === 1) {
137
+              if (to.path.startsWith("/platform/")) {
138
+                if (_userPower.regionids.length > 0 && _userPower.schoolid) {
139
+                  next("/school");
140
+                } else if (
141
+                  _userPower.regionids.length > 0 &&
142
+                  !_userPower.schoolid
143
+                ) {
144
+                  next("/region");
145
+                } else {
146
+                  next();
147
+                }
148
+              } else if (to.path.startsWith("/region/")) {
149
+                if (_userPower.regionids.length === 0 && !_userPower.schoolid) {
150
+                  next("/platform");
151
+                } else if (
152
+                  _userPower.regionids.length > 0 &&
153
+                  _userPower.schoolid
154
+                ) {
155
+                  next("/school");
156
+                } else {
157
+                  next();
158
+                }
159
+              } else if (to.path.startsWith("/school/")) {
160
+                if (_userPower.regionids.length === 0 && !_userPower.schoolid) {
161
+                  next("/platform");
162
+                } else if (
163
+                  _userPower.regionids.length > 0 &&
164
+                  !_userPower.schoolid
165
+                ) {
166
+                  next("/region");
167
+                } else {
168
+                  next();
169
+                }
170
+              } else {
171
+                next();
172
+              }
173
+            } else {
174
+              console.log("文件名:router index.vue,退出原因:未获得权限3");
175
+              next({
176
+                path: "/login",
177
+                query: to.query
178
+              });
179
+            }
180
+          } else {
181
+            console.log("文件名:router index.vue,退出原因:未获得权限4");
182
+            next({
183
+              path: "/login",
184
+              query: to.query
185
+            });
186
+          }
97 187
         } else {
98 188
           console.log("文件名:router index.vue,退出原因:超过24小时未登录");
99 189
           next({

+ 131
- 3
src/store/index.js View File

@@ -4,8 +4,136 @@ Vue.use(Vuex);
4 4
 
5 5
 export default new Vuex.Store({
6 6
   state: {
7
-    userInfo: {}
7
+    userInfo: {},
8
+    // 用户权限
9
+    userPower: {
10
+      // 1平台管理员 2区域管理员 3学校管理员
11
+      atype: null,
12
+      // 进入的区域层级列表
13
+      regionids: [],
14
+      // 进入的学校
15
+      schoolid: null
16
+    }
8 17
   },
9
-  mutations: {},
10
-  actions: {}
18
+  mutations: {
19
+    // 登录后设置用户信息
20
+    loginSetUserInfo(state, info) {
21
+      state.userInfo = info;
22
+      state.userPower.atype = info.atype;
23
+      if (state.userPower.atype === 1) {
24
+        state.userPower.regionids = [];
25
+        state.userPower.schoolid = null;
26
+      } else if (state.userPower.atype === 2) {
27
+        state.userPower.regionids = [info.regionid];
28
+        state.userPower.schoolid = null;
29
+      } else if (state.userPower.atype === 3) {
30
+        state.userPower.regionids = [info.regionid];
31
+        state.userPower.schoolid = info.schoolid;
32
+      }
33
+      localStorage.setItem(
34
+        "xh_control_userInfo",
35
+        JSON.stringify({
36
+          content: info,
37
+          datetime: new Date().getTime()
38
+        })
39
+      );
40
+      // 登录后设置用户的初始权限
41
+      localStorage.setItem(
42
+        "xh_control_userPower",
43
+        JSON.stringify(state.userPower)
44
+      );
45
+    },
46
+    // 刷新后设置权限
47
+    setPowerAfterRefresh(state) {
48
+      let _userInfo = localStorage.getItem("xh_control_userInfo");
49
+      let _userPower = localStorage.getItem("xh_control_userPower");
50
+      if (_userInfo && _userPower) {
51
+        _userPower = JSON.parse(_userPower);
52
+        state.userPower.atype = _userPower.atype;
53
+        state.userPower.regionids = _userPower.regionids;
54
+        state.userPower.schoolid = _userPower.schoolid;
55
+      } else {
56
+        state.userPower.atype = null;
57
+        state.userPower.regionids = [];
58
+        state.userPower.schoolid = null;
59
+      }
60
+    },
61
+    // 进入区域设置跳转痕迹
62
+    setEnterRegionPower(state, regionid) {
63
+      if (!state.userPower.regionids.includes(regionid)) {
64
+        state.userPower.regionids.push(regionid);
65
+      }
66
+      localStorage.setItem(
67
+        "xh_control_userPower",
68
+        JSON.stringify(state.userPower)
69
+      );
70
+    },
71
+    // 退出当前区域设置跳转痕迹
72
+    setQuitRegionPower(state) {
73
+      if (state.userPower.atype === 1) {
74
+        if (state.userPower.regionids.length > 0) {
75
+          state.userPower.regionids.pop();
76
+        }
77
+      } else if (state.userPower.atype === 2) {
78
+        if (state.userPower.regionids.length > 1) {
79
+          state.userPower.regionids.pop();
80
+        }
81
+      }
82
+      localStorage.setItem(
83
+        "xh_control_userPower",
84
+        JSON.stringify(state.userPower)
85
+      );
86
+    },
87
+    // 进入学校设置跳转痕迹
88
+    setEnterSchoolPower(state, schoolid) {
89
+      state.userPower.schoolid = schoolid;
90
+      localStorage.setItem(
91
+        "xh_control_userPower",
92
+        JSON.stringify(state.userPower)
93
+      );
94
+    },
95
+    // 退出当前学校设置跳转痕迹
96
+    setQuitSchoolPower(state) {
97
+      if (state.userPower.atype === 1 || state.userPower.atype === 2) {
98
+        state.userPower.schoolid = null;
99
+      }
100
+      localStorage.setItem(
101
+        "xh_control_userPower",
102
+        JSON.stringify(state.userPower)
103
+      );
104
+    }
105
+  },
106
+  getters: {
107
+    powerParams(state) {
108
+      let _powerParams = {
109
+        // 1平台 2区域 3学校
110
+        rtype: null,
111
+        // 区域ID/学校ID
112
+        objectid: null
113
+      };
114
+      if (
115
+        state.userPower.schoolid &&
116
+        (state.userPower.atype === 1 ||
117
+          state.userPower.atype === 2 ||
118
+          state.userPower.atype === 3)
119
+      ) {
120
+        _powerParams.rtype = 3;
121
+        _powerParams.objectid = state.userPower.schoolid;
122
+      } else if (
123
+        state.userPower.regionids.length > 0 &&
124
+        (state.userPower.atype === 1 || state.userPower.atype === 2)
125
+      ) {
126
+        _powerParams.rtype = 2;
127
+        let _regionids = [...state.userPower.regionids];
128
+        _powerParams.objectid = _regionids.pop();
129
+      } else if (
130
+        state.userPower.regionids.length === 0 &&
131
+        state.userPower.atype === 1
132
+      ) {
133
+        _powerParams.rtype = 1;
134
+        _powerParams.objectid = null;
135
+      }
136
+      return _powerParams;
137
+    }
138
+  }
11 139
 });

+ 54
- 1
src/views/layout.vue View File

@@ -5,6 +5,12 @@
5 5
         <img src="@/assets/img/setting/LOGO.png" />
6 6
       </div>
7 7
       <div class="header_right">
8
+        <div style="margin-right: 10px" v-if="powerParams.rtype === 2">
9
+          所属区域【{{ belongName }}】
10
+        </div>
11
+        <div style="margin-right: 10px" v-else-if="powerParams.rtype === 3">
12
+          所属学校【{{ belongName }}】
13
+        </div>
8 14
         <Dropdown
9 15
           :transfer="true"
10 16
           @on-visible-change="userDropdownVisibleChange"
@@ -37,11 +43,15 @@
37 43
 </template>
38 44
 
39 45
 <script>
46
+import { region_detail } from "@/api/region";
47
+import { school_detail } from "@/api/school";
40 48
 export default {
41 49
   data() {
42 50
     return {
43 51
       userDropdown: false,
44
-      userInfo: {}
52
+      userInfo: {},
53
+      // 所属名称
54
+      belongName: ""
45 55
     };
46 56
   },
47 57
   created() {
@@ -49,7 +59,50 @@ export default {
49 59
       localStorage.getItem("xh_control_userInfo")
50 60
     ).content;
51 61
   },
62
+  computed: {
63
+    powerParams() {
64
+      return this.$store.getters.powerParams;
65
+    }
66
+  },
67
+  watch: {
68
+    $route: {
69
+      handler() {
70
+        this.$nextTick(() => {
71
+          this.getDetail();
72
+        });
73
+      },
74
+      deep: true,
75
+      immediate: true
76
+    }
77
+  },
52 78
   methods: {
79
+    getDetail() {
80
+      if (this.powerParams.rtype === 2) {
81
+        region_detail({
82
+          regionid: this.powerParams.objectid
83
+        }).then((data) => {
84
+          if (data.code === 0) {
85
+            this.belongName = data.obj.regionName;
86
+          } else {
87
+            this.belongName = "";
88
+            this.$Message.error(data.msg);
89
+          }
90
+        });
91
+      } else if (this.powerParams.rtype === 3) {
92
+        school_detail({
93
+          schoolid: this.powerParams.objectid
94
+        }).then((data) => {
95
+          if (data.code === 0) {
96
+            this.belongName = data.obj.schoolName;
97
+          } else {
98
+            this.belongName = "";
99
+            this.$Message.error(data.msg);
100
+          }
101
+        });
102
+      } else {
103
+        this.belongName = "";
104
+      }
105
+    },
53 106
     // 下拉菜单显示隐藏
54 107
     userDropdownVisibleChange(visible) {
55 108
       this.userDropdown = visible;

+ 2
- 7
src/views/login/login.vue View File

@@ -164,6 +164,7 @@ export default {
164 164
   created() {
165 165
     //登录前清除信息
166 166
     localStorage.setItem("xh_control_userInfo", "");
167
+    localStorage.setItem("xh_control_userPower", "");
167 168
     // 在页面加载时获取账号信息
168 169
     let userdata = localStorage.getItem("control_user");
169 170
     // 如果存在赋值给表单,并且将记住密码勾选
@@ -241,13 +242,7 @@ export default {
241 242
             that.wait_flag = false;
242 243
             if (res.code == 0) {
243 244
               that.$Message.success(res.msg);
244
-              localStorage.setItem(
245
-                "xh_control_userInfo",
246
-                JSON.stringify({
247
-                  content: res.obj,
248
-                  datetime: new Date().getTime()
249
-                })
250
-              );
245
+              this.$store.commit("loginSetUserInfo", res.obj);
251 246
               let atype = res.obj.atype;
252 247
               let path = "";
253 248
               //1平台管理员2区域管理员3学校管理员

+ 11
- 1
src/views/platformSection/log/deviceExport.vue View File

@@ -98,6 +98,11 @@ export default {
98 98
   created() {
99 99
     this.searchList();
100 100
   },
101
+  computed: {
102
+    powerParams() {
103
+      return this.$store.getters.powerParams;
104
+    }
105
+  },
101 106
   methods: {
102 107
     // 搜索
103 108
     searchList() {
@@ -118,6 +123,8 @@ export default {
118 123
     // 获取列表
119 124
     getList() {
120 125
       logDeviceBind_list({
126
+        rtype: this.powerParams.rtype,
127
+        objectid: this.powerParams.objectid,
121 128
         page: this.searchForm.page,
122 129
         size: this.searchForm.size,
123 130
         name: this.searchForm.name
@@ -131,7 +138,10 @@ export default {
131 138
       });
132 139
     },
133 140
     toExport(row) {
134
-      let form = {};
141
+      let form = {
142
+        rtype: this.powerParams.rtype,
143
+        objectid: this.powerParams.objectid
144
+      };
135 145
       if (row) {
136 146
         form.regionid = row.regionid;
137 147
       }

+ 11
- 0
src/views/platformSection/networkManage/whitelistLibrary.vue View File

@@ -277,6 +277,11 @@ export default {
277 277
   created() {
278 278
     this.searchList();
279 279
   },
280
+  computed: {
281
+    powerParams() {
282
+      return this.$store.getters.powerParams;
283
+    }
284
+  },
280 285
   methods: {
281 286
     // 搜索
282 287
     searchList() {
@@ -297,6 +302,8 @@ export default {
297 302
     // 获取列表
298 303
     getList() {
299 304
       whiteLibrary_list({
305
+        rtype: this.powerParams.rtype,
306
+        objectid: this.powerParams.objectid,
300 307
         page: this.searchForm.page,
301 308
         size: this.searchForm.size,
302 309
         name: this.searchForm.name
@@ -334,6 +341,8 @@ export default {
334 341
               ? whiteLibrary_edit
335 342
               : whiteLibrary_add;
336 343
           let form = {
344
+            rtype: this.powerParams.rtype,
345
+            objectid: this.powerParams.objectid,
337 346
             name: this.whiteLibraryInfo.name,
338 347
             wltype: this.whiteLibraryInfo.wltype,
339 348
             comm: this.whiteLibraryInfo.comm,
@@ -393,6 +402,8 @@ export default {
393 402
         content: "您确定删除选中数据吗?",
394 403
         onOk: () => {
395 404
           whiteLibrary_delete({
405
+            rtype: this.powerParams.rtype,
406
+            objectid: this.powerParams.objectid,
396 407
             wlid: row.wlid,
397 408
             rversion: row.rversion
398 409
           }).then((data) => {

+ 15
- 0
src/views/platformSection/notice/notice.vue View File

@@ -258,6 +258,11 @@ export default {
258 258
   created() {
259 259
     this.searchList();
260 260
   },
261
+  computed: {
262
+    powerParams() {
263
+      return this.$store.getters.powerParams;
264
+    }
265
+  },
261 266
   methods: {
262 267
     // 搜索
263 268
     searchList() {
@@ -282,6 +287,8 @@ export default {
282 287
       let _enddate = this.searchForm.dataRange[1];
283 288
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
284 289
       notice_list({
290
+        rtype: this.powerParams.rtype,
291
+        objectid: this.powerParams.objectid,
285 292
         page: this.searchForm.page,
286 293
         size: this.searchForm.size,
287 294
         title: this.searchForm.title,
@@ -342,6 +349,8 @@ export default {
342 349
           }
343 350
           this.noticeInfo.show = false;
344 351
           let form = {
352
+            rtype: this.powerParams.rtype,
353
+            objectid: this.powerParams.objectid,
345 354
             noticeTitle: this.noticeInfo.noticeTitle,
346 355
             noticeContent: this.noticeInfo.noticeContent,
347 356
             noticeTxt: this.noticeInfo.noticeTxt,
@@ -370,6 +379,8 @@ export default {
370 379
     // 查看
371 380
     toView(row) {
372 381
       notice_detail({
382
+        rtype: this.powerParams.rtype,
383
+        objectid: this.powerParams.objectid,
373 384
         noticeid: row.noticeid
374 385
       }).then((data) => {
375 386
         if (data.code === 0) {
@@ -390,6 +401,8 @@ export default {
390 401
     // 编辑
391 402
     toEdit(row) {
392 403
       notice_detail({
404
+        rtype: this.powerParams.rtype,
405
+        objectid: this.powerParams.objectid,
393 406
         noticeid: row.noticeid
394 407
       }).then((data) => {
395 408
         if (data.code === 0) {
@@ -423,6 +436,8 @@ export default {
423 436
         content: "您确定删除选中数据吗?",
424 437
         onOk: () => {
425 438
           notice_delete({
439
+            rtype: this.powerParams.rtype,
440
+            objectid: this.powerParams.objectid,
426 441
             noticeid: row.noticeid,
427 442
             rversion: row.rversion
428 443
           }).then((data) => {

+ 13
- 0
src/views/platformSection/regionManage/adminManage.vue View File

@@ -434,6 +434,11 @@ export default {
434 434
     this.getSearchRegionList();
435 435
     this.searchList();
436 436
   },
437
+  computed: {
438
+    powerParams() {
439
+      return this.$store.getters.powerParams;
440
+    }
441
+  },
437 442
   methods: {
438 443
     // 获取搜索区域列表
439 444
     getSearchRegionList() {
@@ -464,6 +469,8 @@ export default {
464 469
     // 获取列表
465 470
     getList() {
466 471
       admin_list_pt({
472
+        rtype: this.powerParams.rtype,
473
+        objectid: this.powerParams.objectid,
467 474
         page: this.searchForm.page,
468 475
         size: this.searchForm.size,
469 476
         enabled: this.searchForm.enabled,
@@ -570,6 +577,8 @@ export default {
570 577
           this.adminInfo.show = false;
571 578
           let api = this.adminInfo.adminid ? admin_edit : admin_add;
572 579
           let form = {
580
+            rtype: this.powerParams.rtype,
581
+            objectid: this.powerParams.objectid,
573 582
             aname: this.adminInfo.aname,
574 583
             loginname: this.adminInfo.loginname,
575 584
             loginpwd: this.adminInfo.loginpwd,
@@ -633,6 +642,8 @@ export default {
633 642
         content: "您确定删除选中数据吗?",
634 643
         onOk: () => {
635 644
           admin_delete({
645
+            rtype: this.powerParams.rtype,
646
+            objectid: this.powerParams.objectid,
636 647
             adminid: row.adminid,
637 648
             rversion: row.rversion
638 649
           }).then((data) => {
@@ -650,6 +661,8 @@ export default {
650 661
     enabledChange(row) {
651 662
       let api = row.enabled === 1 ? admin_enable : admin_disabled;
652 663
       api({
664
+        rtype: this.powerParams.rtype,
665
+        objectid: this.powerParams.objectid,
653 666
         adminid: row.adminid,
654 667
         rversion: row.rversion
655 668
       }).then((data) => {

+ 17
- 1
src/views/platformSection/regionManage/regionManage.vue View File

@@ -419,6 +419,11 @@ export default {
419 419
   created() {
420 420
     this.searchList();
421 421
   },
422
+  computed: {
423
+    powerParams() {
424
+      return this.$store.getters.powerParams;
425
+    }
426
+  },
422 427
   methods: {
423 428
     // 获取短信验证码
424 429
     getMsgCode() {
@@ -476,6 +481,8 @@ export default {
476 481
     // 获取列表
477 482
     getList() {
478 483
       region_list_pt({
484
+        rtype: this.powerParams.rtype,
485
+        objectid: this.powerParams.objectid,
479 486
         page: this.searchForm.page,
480 487
         size: this.searchForm.size,
481 488
         regionName: this.searchForm.regionName
@@ -535,6 +542,8 @@ export default {
535 542
           }
536 543
           this.regionInfo.show = false;
537 544
           region_add({
545
+            rtype: this.powerParams.rtype,
546
+            objectid: this.powerParams.objectid,
538 547
             regionName: this.regionInfo.regionName,
539 548
             regionCode: this.regionInfo.regionCode,
540 549
             admin: {
@@ -563,6 +572,8 @@ export default {
563 572
         if (valid) {
564 573
           this.regionInfo.show = false;
565 574
           region_edit({
575
+            rtype: this.powerParams.rtype,
576
+            objectid: this.powerParams.objectid,
566 577
             regionName: this.modifyRegion.regionName,
567 578
             regionCode: this.modifyRegion.regionCode,
568 579
             address: this.modifyRegion.address,
@@ -581,7 +592,8 @@ export default {
581 592
       });
582 593
     },
583 594
     // 进入
584
-    toEnter() {
595
+    toEnter(row) {
596
+      this.$store.commit("setEnterRegionPower", row.regionid);
585 597
       this.$router.push({
586 598
         path: "/region/home",
587 599
         query: {}
@@ -590,6 +602,8 @@ export default {
590 602
     // 查看
591 603
     toView(row) {
592 604
       region_list_admin({
605
+        rtype: this.powerParams.rtype,
606
+        objectid: this.powerParams.objectid,
593 607
         regionid: row.regionid
594 608
       }).then((data) => {
595 609
         if (data.code === 0) {
@@ -623,6 +637,8 @@ export default {
623 637
         content: "您确定删除选中数据吗?",
624 638
         onOk: () => {
625 639
           region_delete({
640
+            rtype: this.powerParams.rtype,
641
+            objectid: this.powerParams.objectid,
626 642
             regionid: row.regionid,
627 643
             rversion: row.rversion
628 644
           }).then((data) => {

+ 41
- 2
src/views/regionSection/index.vue View File

@@ -264,7 +264,16 @@
264 264
           <span>公告</span>
265 265
         </router-link>
266 266
       </div>
267
-      <div class="out_region" @click="exitToPreviousLevel()">退出区域</div>
267
+      <div
268
+        class="out_region"
269
+        v-if="
270
+          (userPower.atype === 1 && userPower.regionids.length > 0) ||
271
+          (userPower.atype === 2 && userPower.regionids.length > 1)
272
+        "
273
+        @click="exitToPreviousLevel()"
274
+      >
275
+        退出区域
276
+      </div>
268 277
     </div>
269 278
     <div class="section_main">
270 279
       <router-view></router-view>
@@ -336,6 +345,10 @@ export default {
336 345
         this.$route.path.includes("/region/deviceInstallationLog") ||
337 346
         this.$route.path.includes("/region/deviceExport")
338 347
       );
348
+    },
349
+    // 用户权限
350
+    userPower() {
351
+      return this.$store.state.userPower;
339 352
     }
340 353
   },
341 354
   methods: {
@@ -348,7 +361,33 @@ export default {
348 361
     },
349 362
     // 退出到上一级
350 363
     exitToPreviousLevel() {
351
-      this.$router.push("/platform/home");
364
+      let power = this.userPower;
365
+      if (power.atype === 1) {
366
+        if (power.regionids.length === 1) {
367
+          this.$store.commit("setQuitRegionPower");
368
+          if (this.$route.path === "/platform/home") {
369
+            this.$router.go(0);
370
+          } else {
371
+            this.$router.push("/platform/home");
372
+          }
373
+        } else if (power.regionids.length > 1) {
374
+          this.$store.commit("setQuitRegionPower");
375
+          if (this.$route.path === "/region/home") {
376
+            this.$router.go(0);
377
+          } else {
378
+            this.$router.push("/region/home");
379
+          }
380
+        }
381
+      } else if (power.atype === 2) {
382
+        if (power.regionids.length > 1) {
383
+          this.$store.commit("setQuitRegionPower");
384
+          if (this.$route.path === "/region/home") {
385
+            this.$router.go(0);
386
+          } else {
387
+            this.$router.push("/region/home");
388
+          }
389
+        }
390
+      }
352 391
     }
353 392
   }
354 393
 };

+ 11
- 3
src/views/regionSection/regionManage/regionManage.vue View File

@@ -366,6 +366,11 @@ export default {
366 366
     ).content;
367 367
     this.searchList();
368 368
   },
369
+  computed: {
370
+    powerParams() {
371
+      return this.$store.getters.powerParams;
372
+    }
373
+  },
369 374
   methods: {
370 375
     // 获取短信验证码
371 376
     getMsgCode() {
@@ -423,10 +428,12 @@ export default {
423 428
     // 获取列表
424 429
     getList() {
425 430
       region_list_qy({
431
+        rtype: this.powerParams.rtype,
432
+        objectid: this.powerParams.objectid,
433
+        regionid: this.powerParams.objectid,
426 434
         page: this.searchForm.page,
427 435
         size: this.searchForm.size,
428
-        regionName: this.searchForm.regionName,
429
-        regionid: this.userInfo.regionid
436
+        regionName: this.searchForm.regionName
430 437
       }).then((data) => {
431 438
         if (data.code === 0) {
432 439
           this.searchForm.list = data.obj.data;
@@ -521,7 +528,8 @@ export default {
521 528
       });
522 529
     },
523 530
     // 进入
524
-    toEnter() {
531
+    toEnter(row) {
532
+      this.$store.commit("setEnterRegionPower", row.regionid);
525 533
       this.$router.push({
526 534
         path: "/region/home",
527 535
         query: {}

+ 11
- 4
src/views/regionSection/regionManage/schoolManage.vue View File

@@ -314,7 +314,7 @@
314 314
 </template>
315 315
 
316 316
 <script>
317
-import { region_list_sel_pt, region_list_sel_qy } from "@/api/region";
317
+import { region_list_sel_qy } from "@/api/region";
318 318
 import { login_msg_code } from "@/api/login";
319 319
 import { generateRandomString } from "@/utils";
320 320
 import {
@@ -508,7 +508,11 @@ export default {
508 508
     this.getAreaList();
509 509
     this.searchList();
510 510
   },
511
-  mounted() {},
511
+  computed: {
512
+    powerParams() {
513
+      return this.$store.getters.powerParams;
514
+    }
515
+  },
512 516
   methods: {
513 517
     //选择省份
514 518
     provinceChange(id, type) {
@@ -590,11 +594,13 @@ export default {
590 594
     // 获取列表
591 595
     getList() {
592 596
       school_list({
597
+        rtype: this.powerParams.rtype,
598
+        objectid: this.powerParams.objectid,
599
+        regionid: this.powerParams.objectid,
593 600
         page: this.searchForm.page,
594 601
         size: this.searchForm.size,
595 602
         areaCode: this.searchForm.areaCodes,
596
-        schoolName: this.searchForm.schoolName,
597
-        regionid: this.userInfo.regionid
603
+        schoolName: this.searchForm.schoolName
598 604
       }).then((data) => {
599 605
         if (data.code === 0) {
600 606
           this.searchForm.list = data.obj.data;
@@ -739,6 +745,7 @@ export default {
739 745
     },
740 746
     // 进入学校
741 747
     toSchool(row) {
748
+      this.$store.commit("setEnterSchoolPower", row.schoolid);
742 749
       this.$router.push({
743 750
         path: "/school/home",
744 751
         query: {}

+ 14
- 6
src/views/schoolSection/applicationManage/greenBrowser.vue View File

@@ -169,6 +169,11 @@ export default {
169 169
   created() {
170 170
     this.searchList();
171 171
   },
172
+  computed: {
173
+    powerParams() {
174
+      return this.$store.getters.powerParams;
175
+    }
176
+  },
172 177
   methods: {
173 178
     // 搜索
174 179
     searchList() {
@@ -188,9 +193,10 @@ export default {
188 193
     },
189 194
     // 获取列表
190 195
     getList() {
191
-      console.warn("---注意替换regionid---schoolid->");
192 196
       browser_list({
193
-        schoolid: 4,
197
+        rtype: this.powerParams.rtype,
198
+        objectid: this.powerParams.objectid,
199
+        schoolid: this.powerParams.objectid,
194 200
         page: this.searchForm.page,
195 201
         size: this.searchForm.size,
196 202
         visitName: this.searchForm.visitName
@@ -204,12 +210,11 @@ export default {
204 210
       });
205 211
     },
206 212
     toAdd() {
207
-      console.warn("---注意替换regionid---schoolid->");
208 213
       this.browserInfo = {
209 214
         show: true,
210 215
         browserid: null,
211 216
         rversion: null,
212
-        schoolid: 4,
217
+        schoolid: this.powerParams.objectid,
213 218
         visitName: null,
214 219
         visitUrl: null
215 220
       };
@@ -220,6 +225,8 @@ export default {
220 225
           this.browserInfo.show = false;
221 226
           let api = this.browserInfo.browserid ? browser_edit : browser_add;
222 227
           let form = {
228
+            rtype: this.powerParams.rtype,
229
+            objectid: this.powerParams.objectid,
223 230
             schoolid: this.browserInfo.schoolid,
224 231
             visitName: this.browserInfo.visitName,
225 232
             visitUrl: this.browserInfo.visitUrl
@@ -240,12 +247,11 @@ export default {
240 247
       });
241 248
     },
242 249
     toEdit(row) {
243
-      console.warn("---注意替换regionid---schoolid->");
244 250
       this.browserInfo = {
245 251
         show: true,
246 252
         browserid: row.browserid,
247 253
         rversion: row.rversion,
248
-        schoolid: 4,
254
+        schoolid: this.powerParams.objectid,
249 255
         visitName: row.visitName,
250 256
         visitUrl: row.visitUrl
251 257
       };
@@ -256,6 +262,8 @@ export default {
256 262
         content: "您确定删除选中数据吗?",
257 263
         onOk: () => {
258 264
           browser_delete({
265
+            rtype: this.powerParams.rtype,
266
+            objectid: this.powerParams.objectid,
259 267
             browserid: row.browserid,
260 268
             rversion: row.rversion
261 269
           }).then((data) => {

+ 8
- 2
src/views/schoolSection/deviceManage/breakRuleDevice.vue View File

@@ -155,6 +155,11 @@ export default {
155 155
   created() {
156 156
     this.searchList();
157 157
   },
158
+  computed: {
159
+    powerParams() {
160
+      return this.$store.getters.powerParams;
161
+    }
162
+  },
158 163
   methods: {
159 164
     // 搜索
160 165
     searchList() {
@@ -176,14 +181,15 @@ export default {
176 181
     getList() {
177 182
       this.tableSelection = [];
178 183
       device_manager_list_vd({
184
+        rtype: this.powerParams.rtype,
185
+        objectid: this.powerParams.objectid,
179 186
         page: this.searchForm.page,
180 187
         size: this.searchForm.size,
181
-        schoolid: 4,
182 188
         handled: this.searchForm.handled,
183 189
         name: this.searchForm.name
184 190
       }).then((data) => {
185 191
         if (data.code === 0) {
186
-          // this.searchForm.list = data.obj.data;
192
+          this.searchForm.list = data.obj.data;
187 193
           this.searchForm.total = data.obj.total;
188 194
         } else {
189 195
           this.$Message.error(data.msg);

+ 14
- 2
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -204,6 +204,11 @@ export default {
204 204
   created() {
205 205
     this.getClassList();
206 206
   },
207
+  computed: {
208
+    powerParams() {
209
+      return this.$store.getters.powerParams;
210
+    }
211
+  },
207 212
   methods: {
208 213
     classChange(classid) {
209 214
       this.searchForm.classid = classid;
@@ -227,9 +232,10 @@ export default {
227 232
     },
228 233
     // 获取班级列表
229 234
     getClassList() {
230
-      console.warn("class_list----");
231 235
       class_list({
232
-        schoolid: 1
236
+        rtype: this.powerParams.rtype,
237
+        objectid: this.powerParams.objectid,
238
+        schoolid: this.powerParams.objectid
233 239
       }).then((data) => {
234 240
         if (data.code === 0) {
235 241
           this.schoolInfo = {
@@ -247,6 +253,8 @@ export default {
247 253
     getList() {
248 254
       this.tableSelection = [];
249 255
       device_manager_list_d({
256
+        rtype: this.powerParams.rtype,
257
+        objectid: this.powerParams.objectid,
250 258
         page: this.searchForm.page,
251 259
         size: this.searchForm.size,
252 260
         schoolid: this.schoolInfo.schoolid,
@@ -265,6 +273,8 @@ export default {
265 273
     // 设备导出
266 274
     toDeviceExport() {
267 275
       device_manager_export_d({
276
+        rtype: this.powerParams.rtype,
277
+        objectid: this.powerParams.objectid,
268 278
         schoolid: this.schoolInfo.schoolid,
269 279
         classid: this.searchForm.classid,
270 280
         atype: this.searchForm.atype,
@@ -304,6 +314,8 @@ export default {
304 314
     // 安装应用导出
305 315
     toInstallingAppExport() {
306 316
       device_manager_export_id({
317
+        rtype: this.powerParams.rtype,
318
+        objectid: this.powerParams.objectid,
307 319
         schoolid: this.schoolInfo.schoolid,
308 320
         classid: this.searchForm.classid
309 321
       }).then((data) => {

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

@@ -134,6 +134,11 @@ export default {
134 134
   created() {
135 135
     this.searchList();
136 136
   },
137
+  computed: {
138
+    powerParams() {
139
+      return this.$store.getters.powerParams;
140
+    }
141
+  },
137 142
   methods: {
138 143
     // 搜索
139 144
     searchList() {
@@ -154,9 +159,11 @@ export default {
154 159
     // 获取列表
155 160
     getList() {
156 161
       device_manager_list_od({
162
+        rtype: this.powerParams.rtype,
163
+        objectid: this.powerParams.objectid,
157 164
         page: this.searchForm.page,
158 165
         size: this.searchForm.size,
159
-        schoolid: 4,
166
+        schoolid: this.powerParams.objectid,
160 167
         atype: this.searchForm.atype,
161 168
         doEvent: this.searchForm.doEvent,
162 169
         name: this.searchForm.name

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

@@ -137,6 +137,11 @@ export default {
137 137
   created() {
138 138
     this.searchList();
139 139
   },
140
+  computed: {
141
+    powerParams() {
142
+      return this.$store.getters.powerParams;
143
+    }
144
+  },
140 145
   methods: {
141 146
     // 搜索
142 147
     searchList() {
@@ -157,9 +162,11 @@ export default {
157 162
     // 获取列表
158 163
     getList() {
159 164
       device_manager_list_hd({
165
+        rtype: this.powerParams.rtype,
166
+        objectid: this.powerParams.objectid,
160 167
         page: this.searchForm.page,
161 168
         size: this.searchForm.size,
162
-        schoolid: 4,
169
+        schoolid: this.powerParams.objectid,
163 170
         name: this.searchForm.name,
164 171
         atype: this.searchForm.atype,
165 172
         doEvent: this.searchForm.doEvent,

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

@@ -112,6 +112,11 @@ export default {
112 112
   created() {
113 113
     this.searchList();
114 114
   },
115
+  computed: {
116
+    powerParams() {
117
+      return this.$store.getters.powerParams;
118
+    }
119
+  },
115 120
   methods: {
116 121
     // 搜索
117 122
     searchList() {
@@ -132,9 +137,11 @@ export default {
132 137
     // 获取列表
133 138
     getList() {
134 139
       device_manager_list_od({
140
+        rtype: this.powerParams.rtype,
141
+        objectid: this.powerParams.objectid,
135 142
         page: this.searchForm.page,
136 143
         size: this.searchForm.size,
137
-        schoolid: 4,
144
+        schoolid: this.powerParams.objectid,
138 145
         atype: this.searchForm.atype,
139 146
         doEvent: this.searchForm.doEvent,
140 147
         name: this.searchForm.name

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

@@ -242,7 +242,15 @@
242 242
           <span>公告</span>
243 243
         </router-link>
244 244
       </div>
245
-      <div class="out_region" @click="exitToPreviousLevel()">退出学校</div>
245
+      <div
246
+        class="out_region"
247
+        v-if="
248
+          (userPower.atype === 1 || userPower.atype === 2) && userPower.schoolid
249
+        "
250
+        @click="exitToPreviousLevel()"
251
+      >
252
+        退出学校
253
+      </div>
246 254
     </div>
247 255
     <div class="section_main">
248 256
       <router-view></router-view>
@@ -311,6 +319,10 @@ export default {
311 319
         this.$route.path.includes("/school/deviceInstallation") ||
312 320
         this.$route.path.includes("/school/deviceExport")
313 321
       );
322
+    },
323
+    // 用户权限
324
+    userPower() {
325
+      return this.$store.state.userPower;
314 326
     }
315 327
   },
316 328
   methods: {
@@ -323,7 +335,15 @@ export default {
323 335
     },
324 336
     // 退出到上一级
325 337
     exitToPreviousLevel() {
326
-      this.$router.push("/region/home");
338
+      let power = this.userPower;
339
+      if ((power.atype === 1 || power.atype === 2) && power.schoolid) {
340
+        this.$store.commit("setQuitSchoolPower");
341
+        if (this.$route.path === "/region/home") {
342
+          this.$router.go(0);
343
+        } else {
344
+          this.$router.push("/region/home");
345
+        }
346
+      }
327 347
     }
328 348
   }
329 349
 };

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

@@ -96,6 +96,11 @@ export default {
96 96
   created() {
97 97
     this.searchList();
98 98
   },
99
+  computed: {
100
+    powerParams() {
101
+      return this.$store.getters.powerParams;
102
+    }
103
+  },
99 104
   methods: {
100 105
     // 搜索
101 106
     searchList() {
@@ -119,9 +124,13 @@ export default {
119 124
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
120 125
       let _enddate = this.searchForm.dataRange[1];
121 126
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
127
+      let _regionids = this.$store.state.userPower.regionids;
128
+      _regionids = [..._regionids];
122 129
       logOperate_list({
123
-        regionid: 1,
124
-        schoolid: 1,
130
+        rtype: this.powerParams.rtype,
131
+        objectid: this.powerParams.objectid,
132
+        regionid: _regionids.pop(),
133
+        schoolid: this.powerParams.objectid,
125 134
         page: this.searchForm.page,
126 135
         size: this.searchForm.size,
127 136
         begindate: _begindate,

+ 11
- 2
src/views/schoolSection/log/appLaunch.vue View File

@@ -125,6 +125,11 @@ export default {
125 125
   created() {
126 126
     this.searchList();
127 127
   },
128
+  computed: {
129
+    powerParams() {
130
+      return this.$store.getters.powerParams;
131
+    }
132
+  },
128 133
   methods: {
129 134
     // 搜索
130 135
     searchList() {
@@ -148,9 +153,13 @@ export default {
148 153
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
149 154
       let _enddate = this.searchForm.dataRange[1];
150 155
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
156
+      let _regionids = this.$store.state.userPower.regionids;
157
+      _regionids = [..._regionids];
151 158
       logAppStart_list_start({
152
-        regionid: 1,
153
-        schoolid: 1,
159
+        rtype: this.powerParams.rtype,
160
+        objectid: this.powerParams.objectid,
161
+        regionid: _regionids.pop(),
162
+        schoolid: this.powerParams.objectid,
154 163
         page: this.searchForm.page,
155 164
         size: this.searchForm.size,
156 165
         begindate: _begindate,

+ 11
- 2
src/views/schoolSection/log/applicationDownload.vue View File

@@ -116,6 +116,11 @@ export default {
116 116
   created() {
117 117
     this.searchList();
118 118
   },
119
+  computed: {
120
+    powerParams() {
121
+      return this.$store.getters.powerParams;
122
+    }
123
+  },
119 124
   methods: {
120 125
     // 搜索
121 126
     searchList() {
@@ -139,9 +144,13 @@ export default {
139 144
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
140 145
       let _enddate = this.searchForm.dataRange[1];
141 146
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
147
+      let _regionids = this.$store.state.userPower.regionids;
148
+      _regionids = [..._regionids];
142 149
       logAppDown_list({
143
-        regionid: 1,
144
-        schoolid: 1,
150
+        rtype: this.powerParams.rtype,
151
+        objectid: this.powerParams.objectid,
152
+        regionid: _regionids.pop(),
153
+        schoolid: this.powerParams.objectid,
145 154
         page: this.searchForm.page,
146 155
         size: this.searchForm.size,
147 156
         begindate: _begindate,

+ 17
- 4
src/views/schoolSection/log/deviceEvents.vue View File

@@ -154,6 +154,11 @@ export default {
154 154
   created() {
155 155
     this.searchList();
156 156
   },
157
+  computed: {
158
+    powerParams() {
159
+      return this.$store.getters.powerParams;
160
+    }
161
+  },
157 162
   methods: {
158 163
     // 搜索
159 164
     searchList() {
@@ -177,9 +182,13 @@ export default {
177 182
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
178 183
       let _enddate = this.searchForm.dataRange[1];
179 184
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
185
+      let _regionids = this.$store.state.userPower.regionids;
186
+      _regionids = [..._regionids];
180 187
       logdoperate_list_event({
181
-        regionid: 3,
182
-        schoolid: 1,
188
+        rtype: this.powerParams.rtype,
189
+        objectid: this.powerParams.objectid,
190
+        regionid: _regionids.pop(),
191
+        schoolid: this.powerParams.objectid,
183 192
         page: this.searchForm.page,
184 193
         size: this.searchForm.size,
185 194
         doEvent: this.searchForm.doEvent,
@@ -200,9 +209,13 @@ export default {
200 209
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
201 210
       let _enddate = this.searchForm.dataRange[1];
202 211
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
212
+      let _regionids = this.$store.state.userPower.regionids;
213
+      _regionids = [..._regionids];
203 214
       logdoperate_list_event({
204
-        regionid: 3,
205
-        schoolid: 1,
215
+        rtype: this.powerParams.rtype,
216
+        objectid: this.powerParams.objectid,
217
+        regionid: _regionids.pop(),
218
+        schoolid: this.powerParams.objectid,
206 219
         doEvent: this.searchForm.doEvent,
207 220
         begindate: _begindate,
208 221
         enddate: _enddate,

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

@@ -126,6 +126,11 @@ export default {
126 126
   created() {
127 127
     this.searchList();
128 128
   },
129
+  computed: {
130
+    powerParams() {
131
+      return this.$store.getters.powerParams;
132
+    }
133
+  },
129 134
   methods: {
130 135
     // 搜索
131 136
     searchList() {
@@ -145,9 +150,13 @@ export default {
145 150
     },
146 151
     // 获取列表
147 152
     getList() {
153
+      let _regionids = this.$store.state.userPower.regionids;
154
+      _regionids = [..._regionids];
148 155
       logDeviceBind_list_school({
149
-        regionid: 1,
150
-        schoolid: 1,
156
+        rtype: this.powerParams.rtype,
157
+        objectid: this.powerParams.objectid,
158
+        regionid: _regionids.pop(),
159
+        schoolid: this.powerParams.objectid,
151 160
         page: this.searchForm.page,
152 161
         size: this.searchForm.size,
153 162
         name: this.searchForm.name
@@ -161,9 +170,13 @@ export default {
161 170
       });
162 171
     },
163 172
     toExport() {
173
+      let _regionids = this.$store.state.userPower.regionids;
174
+      _regionids = [..._regionids];
164 175
       logDeviceBind_list_school({
165
-        regionid: 1,
166
-        schoolid: 1,
176
+        rtype: this.powerParams.rtype,
177
+        objectid: this.powerParams.objectid,
178
+        regionid: _regionids.pop(),
179
+        schoolid: this.powerParams.objectid,
167 180
         page: this.searchForm.page,
168 181
         size: this.searchForm.size,
169 182
         name: this.searchForm.name

+ 17
- 4
src/views/schoolSection/log/deviceInstallation.vue View File

@@ -125,6 +125,11 @@ export default {
125 125
   created() {
126 126
     this.searchList();
127 127
   },
128
+  computed: {
129
+    powerParams() {
130
+      return this.$store.getters.powerParams;
131
+    }
132
+  },
128 133
   methods: {
129 134
     // 搜索
130 135
     searchList() {
@@ -148,9 +153,13 @@ export default {
148 153
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
149 154
       let _enddate = this.searchForm.dataRange[1];
150 155
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
156
+      let _regionids = this.$store.state.userPower.regionids;
157
+      _regionids = [..._regionids];
151 158
       logAppStart_list_install({
152
-        regionid: 1,
153
-        schoolid: 1,
159
+        rtype: this.powerParams.rtype,
160
+        objectid: this.powerParams.objectid,
161
+        regionid: _regionids.pop(),
162
+        schoolid: this.powerParams.objectid,
154 163
         page: this.searchForm.page,
155 164
         size: this.searchForm.size,
156 165
         begindate: _begindate,
@@ -170,9 +179,13 @@ export default {
170 179
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
171 180
       let _enddate = this.searchForm.dataRange[1];
172 181
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
182
+      let _regionids = this.$store.state.userPower.regionids;
183
+      _regionids = [..._regionids];
173 184
       logAppStart_list_install({
174
-        regionid: 1,
175
-        schoolid: 1,
185
+        rtype: this.powerParams.rtype,
186
+        objectid: this.powerParams.objectid,
187
+        regionid: _regionids.pop(),
188
+        schoolid: this.powerParams.objectid,
176 189
         begindate: _begindate,
177 190
         enddate: _enddate,
178 191
         name: this.searchForm.name

+ 17
- 2
src/views/schoolSection/log/deviceLocation.vue View File

@@ -115,6 +115,11 @@ export default {
115 115
   created() {
116 116
     this.searchList();
117 117
   },
118
+  computed: {
119
+    powerParams() {
120
+      return this.$store.getters.powerParams;
121
+    }
122
+  },
118 123
   methods: {
119 124
     // 搜索
120 125
     searchList() {
@@ -138,9 +143,13 @@ export default {
138 143
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
139 144
       let _enddate = this.searchForm.dataRange[1];
140 145
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
146
+      let _regionids = this.$store.state.userPower.regionids;
147
+      _regionids = [..._regionids];
141 148
       logDeviceLogin_list({
142
-        regionid: 1,
143
-        schoolid: 1,
149
+        rtype: this.powerParams.rtype,
150
+        objectid: this.powerParams.objectid,
151
+        regionid: _regionids.pop(),
152
+        schoolid: this.powerParams.objectid,
144 153
         page: this.searchForm.page,
145 154
         size: this.searchForm.size,
146 155
         begindate: _begindate,
@@ -160,7 +169,13 @@ export default {
160 169
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
161 170
       let _enddate = this.searchForm.dataRange[1];
162 171
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
172
+      let _regionids = this.$store.state.userPower.regionids;
173
+      _regionids = [..._regionids];
163 174
       logDeviceLogin_list({
175
+        rtype: this.powerParams.rtype,
176
+        objectid: this.powerParams.objectid,
177
+        regionid: _regionids.pop(),
178
+        schoolid: this.powerParams.objectid,
164 179
         begindate: _begindate,
165 180
         enddate: _enddate,
166 181
         name: this.searchForm.name

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

@@ -107,6 +107,11 @@ export default {
107 107
   created() {
108 108
     this.searchList();
109 109
   },
110
+  computed: {
111
+    powerParams() {
112
+      return this.$store.getters.powerParams;
113
+    }
114
+  },
110 115
   methods: {
111 116
     // 搜索
112 117
     searchList() {
@@ -130,9 +135,13 @@ export default {
130 135
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
131 136
       let _enddate = this.searchForm.dataRange[1];
132 137
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
138
+      let _regionids = this.$store.state.userPower.regionids;
139
+      _regionids = [..._regionids];
133 140
       logPush_list({
134
-        regionid: 1,
135
-        schoolid: 1,
141
+        rtype: this.powerParams.rtype,
142
+        objectid: this.powerParams.objectid,
143
+        regionid: _regionids.pop(),
144
+        schoolid: this.powerParams.objectid,
136 145
         page: this.searchForm.page,
137 146
         size: this.searchForm.size,
138 147
         begindate: _begindate,

+ 17
- 4
src/views/schoolSection/log/violatingDevice.vue View File

@@ -201,6 +201,11 @@ export default {
201 201
   created() {
202 202
     this.searchList();
203 203
   },
204
+  computed: {
205
+    powerParams() {
206
+      return this.$store.getters.powerParams;
207
+    }
208
+  },
204 209
   methods: {
205 210
     // 搜索
206 211
     searchList() {
@@ -224,9 +229,13 @@ export default {
224 229
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
225 230
       let _enddate = this.searchForm.dataRange[1];
226 231
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
232
+      let _regionids = this.$store.state.userPower.regionids;
233
+      _regionids = [..._regionids];
227 234
       logdoperate_list_violate({
228
-        regionid: 1,
229
-        schoolid: 1,
235
+        rtype: this.powerParams.rtype,
236
+        objectid: this.powerParams.objectid,
237
+        regionid: _regionids.pop(),
238
+        schoolid: this.powerParams.objectid,
230 239
         page: this.searchForm.page,
231 240
         size: this.searchForm.size,
232 241
         doEvent: this.searchForm.doEvent,
@@ -247,9 +256,13 @@ export default {
247 256
       _begindate = _begindate ? dateFormat(_begindate, "yyyy-MM-dd") : null;
248 257
       let _enddate = this.searchForm.dataRange[1];
249 258
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
259
+      let _regionids = this.$store.state.userPower.regionids;
260
+      _regionids = [..._regionids];
250 261
       logdoperate_list_violate({
251
-        regionid: 1,
252
-        schoolid: 1,
262
+        rtype: this.powerParams.rtype,
263
+        objectid: this.powerParams.objectid,
264
+        regionid: _regionids.pop(),
265
+        schoolid: this.powerParams.objectid,
253 266
         page: this.searchForm.page,
254 267
         size: this.searchForm.size,
255 268
         doEvent: this.searchForm.doEvent,

+ 22
- 8
src/views/schoolSection/networkManage/whitelist.vue View File

@@ -215,6 +215,11 @@ export default {
215 215
   created() {
216 216
     this.searchList();
217 217
   },
218
+  computed: {
219
+    powerParams() {
220
+      return this.$store.getters.powerParams;
221
+    }
222
+  },
218 223
   methods: {
219 224
     // 搜索
220 225
     searchList() {
@@ -234,9 +239,12 @@ export default {
234 239
     },
235 240
     // 获取列表
236 241
     getList() {
237
-      console.warn("---注意替换regionid---->white_list");
242
+      let _regionids = this.$store.state.userPower.regionids;
243
+      _regionids = [..._regionids];
238 244
       white_list({
239
-        regionid: 11,
245
+        rtype: this.powerParams.rtype,
246
+        objectid: this.powerParams.objectid,
247
+        regionid: _regionids.pop(),
240 248
         page: this.searchForm.page,
241 249
         size: this.searchForm.size,
242 250
         whiteName: this.searchForm.whiteName
@@ -251,7 +259,8 @@ export default {
251 259
     },
252 260
     // 新建
253 261
     toAdd() {
254
-      console.warn("---注意替换regionid---schoolids->");
262
+      let _regionids = this.$store.state.userPower.regionids;
263
+      _regionids = [..._regionids];
255 264
       this.whiteListInfo = {
256 265
         show: true,
257 266
         whiteid: null,
@@ -260,9 +269,9 @@ export default {
260 269
         // 1所有学校2指定学校
261 270
         targetSchool: 2,
262 271
         website: "",
263
-        regionid: 11,
272
+        regionid: _regionids.pop(),
264 273
         comm: "",
265
-        schoolids: [4]
274
+        schoolids: [this.powerParams.objectid]
266 275
       };
267 276
     },
268 277
     // 保存新建
@@ -275,6 +284,8 @@ export default {
275 284
               ? white_edit
276 285
               : white_add;
277 286
           let form = {
287
+            rtype: this.powerParams.rtype,
288
+            objectid: this.powerParams.objectid,
278 289
             whiteName: this.whiteListInfo.whiteName,
279 290
             targetSchool: this.whiteListInfo.targetSchool,
280 291
             website: this.whiteListInfo.website,
@@ -310,7 +321,8 @@ export default {
310 321
     },
311 322
     // 编辑
312 323
     toEdit(row) {
313
-      console.warn("---注意替换regionid-schoolids--->");
324
+      let _regionids = this.$store.state.userPower.regionids;
325
+      _regionids = [..._regionids];
314 326
       this.whiteListInfo = {
315 327
         show: true,
316 328
         whiteid: row.whiteid,
@@ -319,9 +331,9 @@ export default {
319 331
         // 1所有学校2指定学校
320 332
         targetSchool: 2,
321 333
         website: row.website,
322
-        regionid: 11,
334
+        regionid: _regionids.pop(),
323 335
         comm: row.comm,
324
-        schoolids: [4]
336
+        schoolids: [this.powerParams.objectid]
325 337
       };
326 338
     },
327 339
     // 删除
@@ -333,6 +345,8 @@ export default {
333 345
         }?`,
334 346
         onOk: () => {
335 347
           white_delete({
348
+            rtype: this.powerParams.rtype,
349
+            objectid: this.powerParams.objectid,
336 350
             whiteid: row.whiteid,
337 351
             rversion: row.rversion
338 352
           }).then((data) => {

+ 12
- 2
src/views/schoolSection/networkManage/whitelistLibrary.vue View File

@@ -108,6 +108,11 @@ export default {
108 108
   created() {
109 109
     this.searchList();
110 110
   },
111
+  computed: {
112
+    powerParams() {
113
+      return this.$store.getters.powerParams;
114
+    }
115
+  },
111 116
   methods: {
112 117
     // 搜索
113 118
     searchList() {
@@ -128,6 +133,8 @@ export default {
128 133
     // 获取列表
129 134
     getList() {
130 135
       whiteLibrary_list({
136
+        rtype: this.powerParams.rtype,
137
+        objectid: this.powerParams.objectid,
131 138
         page: this.searchForm.page,
132 139
         size: this.searchForm.size,
133 140
         name: this.searchForm.name
@@ -142,14 +149,17 @@ export default {
142 149
     },
143 150
     // 添加到白名单
144 151
     addToWhitelist(row) {
145
-      console.warn("---注意替换regionid---->whiteLibrary_add_white");
146 152
       this.$Modal.confirm({
147 153
         title: "提示",
148 154
         content: `确定要将“${row.name}”加到白名单?`,
149 155
         onOk: () => {
156
+          let _regionids = this.$store.state.userPower.regionids;
157
+          _regionids = [..._regionids];
150 158
           whiteLibrary_add_white({
159
+            rtype: this.powerParams.rtype,
160
+            objectid: this.powerParams.objectid,
151 161
             wlid: row.wlid,
152
-            regionid: 11
162
+            regionid: _regionids.pop()
153 163
           }).then((data) => {
154 164
             if (data.code === 0) {
155 165
               this.$Message.success(data.msg);

+ 9
- 0
src/views/schoolSection/notice/notice.vue View File

@@ -131,6 +131,11 @@ export default {
131 131
   created() {
132 132
     this.searchList();
133 133
   },
134
+  computed: {
135
+    powerParams() {
136
+      return this.$store.getters.powerParams;
137
+    }
138
+  },
134 139
   methods: {
135 140
     // 搜索
136 141
     searchList() {
@@ -155,6 +160,8 @@ export default {
155 160
       let _enddate = this.searchForm.dataRange[1];
156 161
       _enddate = _enddate ? dateFormat(_enddate, "yyyy-MM-dd") : null;
157 162
       notice_list_region({
163
+        rtype: this.powerParams.rtype,
164
+        objectid: this.powerParams.objectid,
158 165
         page: this.searchForm.page,
159 166
         size: this.searchForm.size,
160 167
         title: this.searchForm.title,
@@ -172,6 +179,8 @@ export default {
172 179
     // 查看
173 180
     toView(row) {
174 181
       notice_detail_region({
182
+        rtype: this.powerParams.rtype,
183
+        objectid: this.powerParams.objectid,
175 184
         noticeid: row.noticeid
176 185
       }).then((data) => {
177 186
         if (data.code === 0) {

+ 21
- 9
src/views/schoolSection/setting/deviceSetting.vue View File

@@ -289,6 +289,11 @@ export default {
289 289
   created() {
290 290
     this.getPswDetail();
291 291
   },
292
+  computed: {
293
+    powerParams() {
294
+      return this.$store.getters.powerParams;
295
+    }
296
+  },
292 297
   methods: {
293 298
     toChangeMenu(type) {
294 299
       this.menuInfo.selected = type;
@@ -299,12 +304,13 @@ export default {
299 304
       }
300 305
     },
301 306
     resetDetail() {
302
-      console.warn("------schoolid-------");
303 307
       if (this.menuInfo.selected === 1) {
304 308
         if (!this.menuInfo.pswDetail.pwid) {
305 309
           return;
306 310
         }
307 311
         password_delete({
312
+          rtype: this.powerParams.rtype,
313
+          objectid: this.powerParams.objectid,
308 314
           pwid: this.menuInfo.pswDetail.pwid,
309 315
           rversion: this.menuInfo.pswDetail.rversion
310 316
         }).then((data) => {
@@ -320,6 +326,8 @@ export default {
320 326
           return;
321 327
         }
322 328
         deviceSet_delete({
329
+          rtype: this.powerParams.rtype,
330
+          objectid: this.powerParams.objectid,
323 331
           dsid: this.menuInfo.setDetail.dsid,
324 332
           rversion: this.menuInfo.setDetail.rversion
325 333
         }).then((data) => {
@@ -333,9 +341,10 @@ export default {
333 341
       }
334 342
     },
335 343
     getPswDetail() {
336
-      console.warn("------schoolid-------");
337 344
       password_detail({
338
-        schoolid: 4
345
+        rtype: this.powerParams.rtype,
346
+        objectid: this.powerParams.objectid,
347
+        schoolid: this.powerParams.objectid
339 348
       }).then((data) => {
340 349
         if (data.code === 0) {
341 350
           if (data.obj) {
@@ -354,9 +363,10 @@ export default {
354 363
       });
355 364
     },
356 365
     getSetDetail() {
357
-      console.warn("------schoolid-------");
358 366
       deviceSet_detail({
359
-        schoolid: 4
367
+        rtype: this.powerParams.rtype,
368
+        objectid: this.powerParams.objectid,
369
+        schoolid: this.powerParams.objectid
360 370
       }).then((data) => {
361 371
         if (data.code === 0) {
362 372
           if (data.obj) {
@@ -405,9 +415,10 @@ export default {
405 415
       }
406 416
     },
407 417
     savePswDetail() {
408
-      console.warn("------schoolid-------");
409 418
       password_edit({
410
-        schoolid: 4,
419
+        rtype: this.powerParams.rtype,
420
+        objectid: this.powerParams.objectid,
421
+        schoolid: this.powerParams.objectid,
411 422
         trend: this.menuInfo.pswDetail.trend,
412 423
         password: this.menuInfo.pswDetail.password,
413 424
         pwid: this.menuInfo.pswDetail.pwid,
@@ -422,9 +433,10 @@ export default {
422 433
       });
423 434
     },
424 435
     saveSetDetail() {
425
-      console.warn("------schoolid-------");
426 436
       deviceSet_edit({
427
-        schoolid: 4,
437
+        rtype: this.powerParams.rtype,
438
+        objectid: this.powerParams.objectid,
439
+        schoolid: this.powerParams.objectid,
428 440
         dsid: this.menuInfo.setDetail.dsid,
429 441
         rversion: this.menuInfo.setDetail.rversion,
430 442
         forceBind: this.menuInfo.setDetail.forceBind,

+ 12
- 5
src/views/schoolSection/setting/logo.vue View File

@@ -55,11 +55,16 @@ export default {
55 55
   created() {
56 56
     this.getLogoDetail();
57 57
   },
58
+  computed: {
59
+    powerParams() {
60
+      return this.$store.getters.powerParams;
61
+    }
62
+  },
58 63
   methods: {
59 64
     getLogoDetail() {
60
-      console.warn("----objectid----");
61 65
       logo_detail({
62
-        objectid: 4,
66
+        rtype: this.powerParams.rtype,
67
+        objectid: this.powerParams.objectid,
63 68
         llevel: 3
64 69
       }).then((data) => {
65 70
         if (data.code === 0) {
@@ -75,6 +80,8 @@ export default {
75 80
         return;
76 81
       }
77 82
       logo_delete({
83
+        rtype: this.powerParams.rtype,
84
+        objectid: this.powerParams.objectid,
78 85
         logoid: this.logoInfo.logoid,
79 86
         rversion: this.logoInfo.rversion
80 87
       }).then((data) => {
@@ -128,11 +135,11 @@ export default {
128 135
         });
129 136
     },
130 137
     toUploadLogo() {
131
-      console.warn("----objectid----");
132 138
       logo_edit({
139
+        rtype: this.powerParams.rtype,
140
+        objectid: this.powerParams.objectid,
133 141
         logoPath: this.logoInfo.logoPath,
134
-        llevel: this.logoInfo.llevel || 3,
135
-        objectid: this.logoInfo.objectid || 4,
142
+        llevel: 3,
136 143
         logoid: this.logoInfo.logoid,
137 144
         rversion: this.logoInfo.rversion
138 145
       }).then((data) => {

+ 22
- 8
src/views/schoolSection/setting/wallpaper.vue View File

@@ -387,6 +387,11 @@ export default {
387 387
     ).content;
388 388
     this.searchList();
389 389
   },
390
+  computed: {
391
+    powerParams() {
392
+      return this.$store.getters.powerParams;
393
+    }
394
+  },
390 395
   methods: {
391 396
     // 搜索
392 397
     searchList() {
@@ -406,13 +411,16 @@ export default {
406 411
     },
407 412
     // 获取列表
408 413
     getList() {
409
-      console.warn("---注意替换regionid--schoolid-->wallpaper_list");
414
+      let _regionids = this.$store.state.userPower.regionids;
415
+      _regionids = [..._regionids];
410 416
       wallpaper_list({
417
+        rtype: this.powerParams.rtype,
418
+        objectid: this.powerParams.objectid,
419
+        schoolid: this.powerParams.objectid,
420
+        regionid: _regionids.pop(),
411 421
         page: this.searchForm.page,
412 422
         size: this.searchForm.size,
413
-        name: this.searchForm.name,
414
-        regionid: 11,
415
-        schoolid: 4
423
+        name: this.searchForm.name
416 424
       }).then((data) => {
417 425
         if (data.code === 0) {
418 426
           this.searchForm.list = data.obj.data;
@@ -424,7 +432,6 @@ export default {
424 432
     },
425 433
     // 新建
426 434
     toAdd() {
427
-      console.warn("---objectid---->", 4);
428 435
       this.wallpaperInfo = {
429 436
         show: true,
430 437
         wallpaperid: null,
@@ -437,7 +444,7 @@ export default {
437 444
         // 2区域3学校
438 445
         wlevel: 3,
439 446
         // 对应的区域/学校ID
440
-        objectid: 4,
447
+        objectid: this.powerParams.objectid,
441 448
         deviceids: [],
442 449
         deviceList: []
443 450
       };
@@ -598,11 +605,12 @@ export default {
598 605
           }
599 606
           this.wallpaperInfo.show = false;
600 607
           let form = {
608
+            rtype: this.powerParams.rtype,
609
+            objectid: this.powerParams.objectid,
601 610
             wname: this.wallpaperInfo.wname,
602 611
             hpath: this.wallpaperInfo.hpath,
603 612
             vpath: this.wallpaperInfo.vpath,
604 613
             wlevel: this.wallpaperInfo.wlevel,
605
-            objectid: this.wallpaperInfo.objectid,
606 614
             deviceids: this.wallpaperInfo.deviceids
607 615
           };
608 616
           if (this.wallpaperInfo.wallpaperid && this.wallpaperInfo.rversion) {
@@ -684,7 +692,11 @@ export default {
684 692
     },
685 693
     getWallpaperDetail(wallpaperid) {
686 694
       return new Promise((resolve) => {
687
-        wallpaper_detail({ wallpaperid }).then((data) => {
695
+        wallpaper_detail({
696
+          rtype: this.powerParams.rtype,
697
+          objectid: this.powerParams.objectid,
698
+          wallpaperid
699
+        }).then((data) => {
688 700
           if (data.code === 0) {
689 701
             resolve(data.obj);
690 702
           } else {
@@ -701,6 +713,8 @@ export default {
701 713
         content: "您确定删除选中数据吗?",
702 714
         onOk: () => {
703 715
           wallpaper_delete({
716
+            rtype: this.powerParams.rtype,
717
+            objectid: this.powerParams.objectid,
704 718
             wallpaperid: row.wallpaperid,
705 719
             rversion: row.rversion
706 720
           }).then((data) => {

Loading…
Cancel
Save