Browse Source

应用列表操作优化

gzb
guozhongbo 9 months ago
parent
commit
4e38b6dd1c

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

@@ -55,20 +55,26 @@
55 55
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
56 56
         </template>
57 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 76
             {{ row.enabled === 1 ? "启用" : "禁用" }}
60 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 78
         </template>
73 79
         <template slot-scope="{ row }" slot="whited">
74 80
           <div class="action_list">
@@ -91,8 +97,25 @@
91 97
         <template slot-scope="{ row }" slot="actionSlot">
92 98
           <div class="action_list">
93 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 119
           </div>
97 120
         </template>
98 121
       </Table>
@@ -966,6 +989,8 @@ export default {
966 989
     this.userInfo = JSON.parse(
967 990
       localStorage.getItem("xh_control_userInfo")
968 991
     ).content;
992
+    console.log(this.userInfo.adminid);
993
+    console.log(this.powerParams.objectid);
969 994
     this.init();
970 995
     this.searchList();
971 996
   },

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

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

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

@@ -41,20 +41,9 @@
41 41
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
42 42
         </template>
43 43
         <template slot-scope="{ row }" slot="enabled">
44
-          <div v-if="row.belong === 1">
44
+          <div>
45 45
             {{ row.enabled === 1 ? "启用" : "禁用" }}
46 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 47
         </template>
59 48
         <template slot-scope="{ row }" slot="whited">
60 49
           <div class="action_list">
@@ -78,7 +67,6 @@
78 67
         <template slot-scope="{ row }" slot="actionSlot">
79 68
           <div class="action_list">
80 69
             <div @click="toView(row)">查看</div>
81
-            <div class="action_del" @click="toDel(row)">删除</div>
82 70
           </div>
83 71
         </template>
84 72
       </Table>
@@ -339,11 +327,8 @@
339 327
 <script>
340 328
 import { search_list_app } from "@/api/region";
341 329
 import {
342
-  app_delete,
343 330
   app_detail,
344 331
   app_detail_history,
345
-  app_edit_enable,
346
-  app_edit_unenable,
347 332
   app_install_statistic
348 333
 } from "@/api/appgroup";
349 334
 import QRCode from "qrcodejs2";
@@ -540,24 +525,6 @@ export default {
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 528
     installChange() {
562 529
       //安装统计切换版本
563 530
       let obj = this.installInfo.apphistorys.filter(
@@ -714,31 +681,6 @@ export default {
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 685
     searchList() {
744 686
       this.searchForm.page = 1;

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

@@ -71,20 +71,27 @@
71 71
           <div>{{ row.appType === 1 ? "推荐应用" : "必装应用" }}</div>
72 72
         </template>
73 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 93
             {{ row.enabled === 1 ? "启用" : "禁用" }}
76 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 95
         </template>
89 96
         <template slot-scope="{ row }" slot="whited">
90 97
           <div class="action_list">
@@ -107,8 +114,23 @@
107 114
         <template slot-scope="{ row }" slot="actionSlot">
108 115
           <div class="action_list">
109 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 135
             </div>
114 136
           </div>

Loading…
Cancel
Save