Browse Source

管理员列表操作优化

gzb
guozhongbo 7 months ago
parent
commit
0665ee70a0
1 changed files with 24 additions and 13 deletions
  1. 24
    13
      src/views/regionSection/regionManage/adminManage.vue

+ 24
- 13
src/views/regionSection/regionManage/adminManage.vue View File

48
           }}
48
           }}
49
         </template>
49
         </template>
50
         <template slot-scope="{ row }" slot="enabledSlot">
50
         <template slot-scope="{ row }" slot="enabledSlot">
51
-          <i-switch
52
-            size="large"
53
-            v-model="row.enabled"
54
-            :true-value="1"
55
-            :false-value="2"
56
-            @on-change="enabledChange(row)"
57
-          >
58
-            <span slot="open">启用</span>
59
-            <span slot="close">禁用</span>
60
-          </i-switch>
51
+          <div v-if="row.adminid === userInfo.adminid">
52
+            {{ row.enabled === 1 ? "启用" : "禁用" }}
53
+          </div>
54
+          <div v-else>
55
+            <i-switch
56
+              size="large"
57
+              v-model="row.enabled"
58
+              :true-value="1"
59
+              :false-value="2"
60
+              @on-change="enabledChange(row)"
61
+            >
62
+              <span slot="open">启用</span>
63
+              <span slot="close">禁用</span>
64
+            </i-switch>
65
+          </div>
61
         </template>
66
         </template>
62
         <template slot-scope="{ row }" slot="actionSlot">
67
         <template slot-scope="{ row }" slot="actionSlot">
63
           <div class="action_list">
68
           <div class="action_list">
64
             <div @click="toView(row)">查看</div>
69
             <div @click="toView(row)">查看</div>
65
             <div @click="toEdit(row)">编辑</div>
70
             <div @click="toEdit(row)">编辑</div>
66
-            <div class="action_del" @click="toDel(row)">删除</div>
71
+            <div
72
+              v-if="row.adminid != userInfo.adminid"
73
+              class="action_del"
74
+              @click="toDel(row)"
75
+            >
76
+              删除
77
+            </div>
67
           </div>
78
           </div>
68
         </template>
79
         </template>
69
       </Table>
80
       </Table>
571
     },
582
     },
572
     // 新建
583
     // 新建
573
     toAdd() {
584
     toAdd() {
574
-      if(this.adminInfo.timer){
585
+      if (this.adminInfo.timer) {
575
         clearInterval(this.adminInfo.timer);
586
         clearInterval(this.adminInfo.timer);
576
       }
587
       }
577
       this.adminInfo = {
588
       this.adminInfo = {
741
       }).then((res) => {
752
       }).then((res) => {
742
         this.showLoading = false;
753
         this.showLoading = false;
743
         if (res.code === 0) {
754
         if (res.code === 0) {
744
-          if(this.adminInfo.timer){
755
+          if (this.adminInfo.timer) {
745
             clearInterval(this.adminInfo.timer);
756
             clearInterval(this.adminInfo.timer);
746
           }
757
           }
747
           this.adminInfo = {
758
           this.adminInfo = {

Loading…
Cancel
Save