Browse Source

应用列表操作优化

gzb
guozhongbo 9 months ago
parent
commit
4e38b6dd1c

+ 39
- 14
src/views/regionSection/applicationManage/applicationManage.vue View File

55
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
55
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
56
         </template>
56
         </template>
57
         <template slot-scope="{ row }" slot="enabled">
57
         <template slot-scope="{ row }" slot="enabled">
58
-          <div v-if="row.belong === 1">
58
+          <div
59
+            v-if="
60
+              row.createid === userInfo.adminid ||
61
+              row.regionid === powerParams.objectid
62
+            "
63
+          >
64
+            <i-switch
65
+              size="large"
66
+              v-model="row.enabled"
67
+              :true-value="1"
68
+              :false-value="2"
69
+              @on-change="enabledChange(row)"
70
+            >
71
+              <span slot="open">启用</span>
72
+              <span slot="close">禁用</span>
73
+            </i-switch>
74
+          </div>
75
+          <div v-else>
59
             {{ row.enabled === 1 ? "启用" : "禁用" }}
76
             {{ row.enabled === 1 ? "启用" : "禁用" }}
60
           </div>
77
           </div>
61
-          <i-switch
62
-            v-if="row.belong === 2"
63
-            size="large"
64
-            v-model="row.enabled"
65
-            :true-value="1"
66
-            :false-value="2"
67
-            @on-change="enabledChange(row)"
68
-          >
69
-            <span slot="open">启用</span>
70
-            <span slot="close">禁用</span>
71
-          </i-switch>
72
         </template>
78
         </template>
73
         <template slot-scope="{ row }" slot="whited">
79
         <template slot-scope="{ row }" slot="whited">
74
           <div class="action_list">
80
           <div class="action_list">
91
         <template slot-scope="{ row }" slot="actionSlot">
97
         <template slot-scope="{ row }" slot="actionSlot">
92
           <div class="action_list">
98
           <div class="action_list">
93
             <div @click="toView(row)">查看</div>
99
             <div @click="toView(row)">查看</div>
94
-            <div @click="toEdit(row)">编辑</div>
95
-            <div class="action_del" @click="toDel(row)">删除</div>
100
+            <div
101
+              v-if="
102
+                row.createid === userInfo.adminid ||
103
+                row.regionid === powerParams.objectid
104
+              "
105
+              @click="toEdit(row)"
106
+            >
107
+              编辑
108
+            </div>
109
+            <div
110
+              v-if="
111
+                row.createid === userInfo.adminid ||
112
+                row.regionid === powerParams.objectid
113
+              "
114
+              class="action_del"
115
+              @click="toDel(row)"
116
+            >
117
+              删除
118
+            </div>
96
           </div>
119
           </div>
97
         </template>
120
         </template>
98
       </Table>
121
       </Table>
966
     this.userInfo = JSON.parse(
989
     this.userInfo = JSON.parse(
967
       localStorage.getItem("xh_control_userInfo")
990
       localStorage.getItem("xh_control_userInfo")
968
     ).content;
991
     ).content;
992
+    console.log(this.userInfo.adminid);
993
+    console.log(this.powerParams.objectid);
969
     this.init();
994
     this.init();
970
     this.searchList();
995
     this.searchList();
971
   },
996
   },

+ 7
- 2
src/views/regionSection/networkManage/whitelist.vue View File

32
             <div v-if="row.whiteType === 1" @click="toView(row)">查看</div>
32
             <div v-if="row.whiteType === 1" @click="toView(row)">查看</div>
33
             <div
33
             <div
34
               v-if="
34
               v-if="
35
-                row.whiteType === 1 && row.regionid === powerParams.objectid
35
+                row.whiteType === 1 &&
36
+                (row.createid === userInfo.adminid ||
37
+                  row.regionid === powerParams.objectid)
36
               "
38
               "
37
               @click="toEdit(row)"
39
               @click="toEdit(row)"
38
             >
40
             >
39
               编辑
41
               编辑
40
             </div>
42
             </div>
41
             <div
43
             <div
42
-              v-if="row.regionid === powerParams.objectid"
44
+              v-if="
45
+                row.createid === userInfo.adminid ||
46
+                row.regionid === powerParams.objectid
47
+              "
43
               class="action_del"
48
               class="action_del"
44
               @click="toDel(row)"
49
               @click="toDel(row)"
45
             >
50
             >

+ 1
- 59
src/views/regionSection/search/allApps.vue View File

41
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
41
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
42
         </template>
42
         </template>
43
         <template slot-scope="{ row }" slot="enabled">
43
         <template slot-scope="{ row }" slot="enabled">
44
-          <div v-if="row.belong === 1">
44
+          <div>
45
             {{ row.enabled === 1 ? "启用" : "禁用" }}
45
             {{ row.enabled === 1 ? "启用" : "禁用" }}
46
           </div>
46
           </div>
47
-          <i-switch
48
-            size="large"
49
-            v-if="row.belong === 2"
50
-            v-model="row.enabled"
51
-            :true-value="1"
52
-            :false-value="2"
53
-            @on-change="enabledChange(row)"
54
-          >
55
-            <span slot="open">启用</span>
56
-            <span slot="close">禁用</span>
57
-          </i-switch>
58
         </template>
47
         </template>
59
         <template slot-scope="{ row }" slot="whited">
48
         <template slot-scope="{ row }" slot="whited">
60
           <div class="action_list">
49
           <div class="action_list">
78
         <template slot-scope="{ row }" slot="actionSlot">
67
         <template slot-scope="{ row }" slot="actionSlot">
79
           <div class="action_list">
68
           <div class="action_list">
80
             <div @click="toView(row)">查看</div>
69
             <div @click="toView(row)">查看</div>
81
-            <div class="action_del" @click="toDel(row)">删除</div>
82
           </div>
70
           </div>
83
         </template>
71
         </template>
84
       </Table>
72
       </Table>
339
 <script>
327
 <script>
340
 import { search_list_app } from "@/api/region";
328
 import { search_list_app } from "@/api/region";
341
 import {
329
 import {
342
-  app_delete,
343
   app_detail,
330
   app_detail,
344
   app_detail_history,
331
   app_detail_history,
345
-  app_edit_enable,
346
-  app_edit_unenable,
347
   app_install_statistic
332
   app_install_statistic
348
 } from "@/api/appgroup";
333
 } from "@/api/appgroup";
349
 import QRCode from "qrcodejs2";
334
 import QRCode from "qrcodejs2";
540
         }
525
         }
541
       });
526
       });
542
     },
527
     },
543
-    enabledChange(row) {
544
-      let api = row.enabled === 1 ? app_edit_enable : app_edit_unenable;
545
-      this.showLoading = true;
546
-      api({
547
-        rtype: this.powerParams.rtype,
548
-        objectid: this.powerParams.objectid,
549
-        appid: row.appid,
550
-        rversion: row.rversion
551
-      }).then((data) => {
552
-        this.showLoading = false;
553
-        this.searchList();
554
-        if (data.code === 0) {
555
-          this.$Message.success(data.msg);
556
-        } else {
557
-          this.$Message.error(data.msg);
558
-        }
559
-      });
560
-    },
561
     installChange() {
528
     installChange() {
562
       //安装统计切换版本
529
       //安装统计切换版本
563
       let obj = this.installInfo.apphistorys.filter(
530
       let obj = this.installInfo.apphistorys.filter(
714
         }
681
         }
715
       });
682
       });
716
     },
683
     },
717
-    // 删除
718
-    toDel(row) {
719
-      this.$Modal.confirm({
720
-        title: "提示",
721
-        content: "您确定删除选中数据吗?",
722
-        onOk: () => {
723
-          this.showLoading = true;
724
-          app_delete({
725
-            rtype: this.powerParams.rtype,
726
-            objectid: this.powerParams.objectid,
727
-            appid: row.appid,
728
-            rversion: row.rversion
729
-          }).then((res) => {
730
-            this.showLoading = false;
731
-            if (res.code === 0) {
732
-              this.$Message.success(res.msg);
733
-              this.searchList();
734
-            } else {
735
-              this.$Message.error(res.msg);
736
-            }
737
-          });
738
-        },
739
-        onCancel: () => {}
740
-      });
741
-    },
742
     // 搜索
684
     // 搜索
743
     searchList() {
685
     searchList() {
744
       this.searchForm.page = 1;
686
       this.searchForm.page = 1;

+ 36
- 14
src/views/schoolSection/applicationManage/applicationList.vue View File

71
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
71
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
72
         </template>
72
         </template>
73
         <template slot-scope="{ row }" slot="enabled">
73
         <template slot-scope="{ row }" slot="enabled">
74
-          <div v-if="row.belong === 1">
74
+          <div
75
+            v-if="
76
+              row.createid === userInfo.adminid ||
77
+              row.schoolid === powerParams.objectid
78
+            "
79
+          >
80
+            <i-switch
81
+              v-if="row.belong === 2"
82
+              size="large"
83
+              v-model="row.enabled"
84
+              :true-value="1"
85
+              :false-value="2"
86
+              @on-change="enabledChange(row)"
87
+            >
88
+              <span slot="open">启用</span>
89
+              <span slot="close">禁用</span>
90
+            </i-switch>
91
+          </div>
92
+          <div v-else>
75
             {{ row.enabled === 1 ? "启用" : "禁用" }}
93
             {{ row.enabled === 1 ? "启用" : "禁用" }}
76
           </div>
94
           </div>
77
-          <i-switch
78
-            v-if="row.belong === 2"
79
-            size="large"
80
-            v-model="row.enabled"
81
-            :true-value="1"
82
-            :false-value="2"
83
-            @on-change="enabledChange(row)"
84
-          >
85
-            <span slot="open">启用</span>
86
-            <span slot="close">禁用</span>
87
-          </i-switch>
88
         </template>
95
         </template>
89
         <template slot-scope="{ row }" slot="whited">
96
         <template slot-scope="{ row }" slot="whited">
90
           <div class="action_list">
97
           <div class="action_list">
107
         <template slot-scope="{ row }" slot="actionSlot">
114
         <template slot-scope="{ row }" slot="actionSlot">
108
           <div class="action_list">
115
           <div class="action_list">
109
             <div @click="toView(row)">查看</div>
116
             <div @click="toView(row)">查看</div>
110
-            <div v-if="row.belong === 2" @click="toEdit(row)">编辑</div>
111
-            <div v-if="row.belong === 2" class="action_del" @click="toDel(row)">
117
+            <div
118
+              v-if="
119
+                row.createid === userInfo.adminid ||
120
+                row.schoolid === powerParams.objectid
121
+              "
122
+              @click="toEdit(row)"
123
+            >
124
+              编辑
125
+            </div>
126
+            <div
127
+              v-if="
128
+                row.createid === userInfo.adminid ||
129
+                row.schoolid === powerParams.objectid
130
+              "
131
+              class="action_del"
132
+              @click="toDel(row)"
133
+            >
112
               删除
134
               删除
113
             </div>
135
             </div>
114
           </div>
136
           </div>

Loading…
Cancel
Save