Blame view

src/views/role/roleList.vue 2.63 KB
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <template>
    <div class="role-container">
      <el-row>
        <el-col :span="4" class="role-left">
          <role-div @switch-role="handleSwitchRole" />
        </el-col>
        <el-col :span="20" class="role-right">
          <div class="role-content">
            <div class="role-title">{{ currentRole.name }}</div>
            <el-divider />
            <div class="role-menu">
              <el-button :type="activeTab === 'privilege' ? 'primary' : ''" @click="changeTab('privilege')">
                {{ $t('role.privilege') }}
              </el-button>
72de60dc   wuxw   优化报修完成
15
              <!-- <el-button :type="activeTab === 'community' ? 'primary' : ''" @click="changeTab('community')">
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
16
                {{ $t('role.community') }}
72de60dc   wuxw   优化报修完成
17
              </el-button> -->
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
              <el-button :type="activeTab === 'staff' ? 'primary' : ''" @click="changeTab('staff')">
                {{ $t('role.staff') }}
              </el-button>
            </div>
  
            <div v-if="activeTab === 'privilege'">
              <privilege-tree :pg-id="currentRole.pgId" />
            </div>
  
            <div v-if="activeTab === 'community'">
              <role-community :pg-id="currentRole.pgId" />
            </div>
  
            <div v-if="activeTab === 'staff'">
              <role-staff :pg-id="currentRole.pgId" />
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
  </template>
72de60dc   wuxw   优化报修完成
39
  
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
40
41
42
  <script>
  import RoleDiv from '@/components/role/RoleDiv'
  import PrivilegeTree from '@/components/role/PrivilegeTree'
72de60dc   wuxw   优化报修完成
43
  // import RoleCommunity from '@/components/role/RoleCommunity'
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
44
45
46
47
48
49
50
  import RoleStaff from '@/components/role/RoleStaff'
  
  export default {
    name: 'RoleList',
    components: {
      RoleDiv,
      PrivilegeTree,
72de60dc   wuxw   优化报修完成
51
     // RoleCommunity,
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
      RoleStaff
    },
    data() {
      return {
        activeTab: 'privilege',
        currentRole: {
          pgId: ''
        }
      }
    },
    methods: {
      handleSwitchRole(role) {
        this.currentRole = role
        this.changeTab('privilege')
      },
      changeTab(tabName) {
        this.activeTab = tabName
      }
    }
  }
  </script>
72de60dc   wuxw   优化报修完成
73
  
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
  <style lang="scss" scoped>
  .role-container {
  
  
    .role-left {
      padding: 0px;
      margin: 0px;
    }
  
    .role-right {
      padding: 0px;
      margin-top: 10px;
  
      .el-divider--horizontal {
        display: block;
        height: 1px;
        width: 100%;
        margin: 0px 0;
      }
    }
  
    .role-content {
      margin-top: 0px;
      margin-left: 20px;
      background: #fff;
      border-radius: 4px;
  
  
      .role-title {
        font-size: 18px;
        line-height: 48px;
        text-align: left;
        margin-left: 15px;
      }
  
      .role-context {
        color: #666;
      }
  
      .role-menu {
        text-align: left;
        margin-left: 15px;
72de60dc   wuxw   优化报修完成
116
  
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
117
118
        .el-button {
          margin-top: 15px;
72de60dc   wuxw   优化报修完成
119
  
a42b3256   wuxw   HC小区管理系统前段vue版正在开发中
120
121
122
123
124
        }
      }
    }
  }
  </style>