55 <div class =" flex h-full" >
66 <div class =" role-left border-r p-16" >
77 <div class =" p-8 pb-0" >
8- <el-input v-model =" filterText" :placeholder =" $t('common.search')" prefix-icon =" Search" clearable />
8+ <el-input v-model =" filterText" :placeholder =" $t('common.search')" prefix-icon =" Search"
9+ clearable />
910 </div >
1011 <div class =" list-height-left mt-8" >
1112 <el-scrollbar v-loading =" loading" >
1213 <div class =" role-left_title color-secondary lighter" >
1314 <span >{{ $t('views.role.internalRole') }}</span >
1415 </div >
15- <common-list :data =" filterInternalRole" @click =" clickRole" :default-active =" currentRole?.id" >
16+ <common-list :data =" filterInternalRole" @click =" clickRole"
17+ :default-active =" currentRole?.id" >
1618 <template #default =" { row } " >
1719 <div class =" flex-between" >
1820 <span class =" mr-8" >{{ row.role_name }}</span >
1921 <el-dropdown :teleported =" false" >
2022 <el-button text >
2123 <el-icon class =" color-secondary" >
22- <MoreFilled />
24+ <MoreFilled />
2325 </el-icon >
2426 </el-button >
2527 <template #dropdown >
4244 </template >
4345 </common-list >
4446 <div class =" role-left_divider" >
45- <el-divider />
47+ <el-divider />
4648 </div >
4749 <div class =" role-left_title" >
4850 <span class =" color-secondary lighter" >{{ $t('views.role.customRole') }}</span >
49- <el-tooltip effect =" dark" :content =" `${$t('common.create')}${$t('views.role.customRole')}`"
50- placement =" top" >
51+ <el-tooltip effect =" dark"
52+ :content =" `${$t('common.create')}${$t('views.role.customRole')}`"
53+ placement =" top" >
5154 <el-button type =" primary" text @click =" createOrUpdateRole()" >
5255 <AppIcon iconName =" app-copy" ></AppIcon >
5356 </el-button >
5457 </el-tooltip >
5558 </div >
56- <common-list :data =" filterCustomRole" @click =" clickRole" :default-active =" currentRole?.id" >
59+ <common-list :data =" filterCustomRole" @click =" clickRole"
60+ :default-active =" currentRole?.id" >
5761 <template #default =" { row } " >
5862 <div class =" flex-between" >
5963 <span >
6064 {{ row.role_name }}
61- <span class =" color-input-placeholder ml-4" >({{ roleTypeMap[row.type as RoleTypeEnum] }})</span >
65+ <span class =" color-input-placeholder ml-4" >({{
66+ roleTypeMap[row.type as RoleTypeEnum]
67+ }})</span >
6268 </span >
6369 <el-dropdown :teleported =" false" >
6470 <el-button text >
6571 <el-icon class =" color-secondary" >
66- <MoreFilled />
72+ <MoreFilled />
6773 </el-icon >
6874 </el-button >
6975 <template #dropdown >
95101 <div class =" flex align-center" >
96102 <span >
97103 {{ currentRole?.role_name }}
98- <span v-if =" currentRole?.type && !currentRole.internal" class =" color-input-placeholder ml-4" >({{
99- roleTypeMap[currentRole?.type as
100- RoleTypeEnum] }})
104+ <span v-if =" currentRole?.type && !currentRole.internal"
105+ class =" color-input-placeholder ml-4" >({{
106+ roleTypeMap[currentRole?.type as
107+ RoleTypeEnum]
108+ }})
101109 </span >
102110 </span >
103- <el-divider direction =" vertical" class =" mr-8 ml-8" />
104- <AppIcon iconName =" app-wordspace" style =" font-size : 16px " class =" color-input-placeholder" ></AppIcon >
111+ <el-divider direction =" vertical" class =" mr-8 ml-8" />
112+ <AppIcon iconName =" app-wordspace" style =" font-size : 16px "
113+ class =" color-input-placeholder" ></AppIcon >
105114 <span class =" color-input-placeholder ml-4" >
106- 数字
115+ {{ currentRole?.user_count }}
107116 </span >
108117 </div >
109118 <el-radio-group v-model =" currentTab" >
110- <el-radio-button v-for =" item in tabList" :key =" item.value" :label =" item.label" :value =" item.value" />
119+ <el-radio-button v-for =" item in tabList" :key =" item.value" :label =" item.label"
120+ :value =" item.value" />
111121 </el-radio-group >
112122 </div >
113- <PermissionConfiguration v-if =" currentTab === 'permission'" :currentRole =" currentRole" />
114- <Member v-else :currentRole =" currentRole" />
123+ <PermissionConfiguration v-if =" currentTab === 'permission'" :currentRole =" currentRole" />
124+ <Member v-else :currentRole =" currentRole" />
115125 </div >
116126 </div >
117127 </el-card >
118128
119- <CreateOrUpdateRoleDialog ref =" createOrUpdateRoleDialogRef" @refresh =" refresh" />
129+ <CreateOrUpdateRoleDialog ref =" createOrUpdateRoleDialogRef" @refresh =" refresh" />
120130 </div >
121131</template >
122132
123133<script lang="ts" setup>
124- import { onMounted , ref , watch } from ' vue'
134+ import {onMounted , ref , watch } from ' vue'
125135import RoleApi from ' @/api/system/role'
126- import { t } from ' @/locales'
136+ import {t } from ' @/locales'
127137import PermissionConfiguration from ' ./component/PermissionConfiguration.vue'
128138import Member from ' ./component/Member.vue'
129139import CreateOrUpdateRoleDialog from ' ./component/CreateOrUpdateRoleDialog.vue'
130- import type { RoleItem } from ' @/api/type/role'
131- import { RoleTypeEnum } from ' @/enums/system'
132- import { roleTypeMap } from ' ./index'
133- import { MsgSuccess , MsgConfirm } from ' @/utils/message'
140+ import type {RoleItem } from ' @/api/type/role'
141+ import {RoleTypeEnum } from ' @/enums/system'
142+ import {roleTypeMap } from ' ./index'
143+ import {MsgSuccess , MsgConfirm } from ' @/utils/message'
134144
135145const filterText = ref (' ' )
136146const loading = ref (false )
@@ -182,6 +192,7 @@ function clickRole(item: RoleItem) {
182192}
183193
184194const createOrUpdateRoleDialogRef = ref <InstanceType <typeof CreateOrUpdateRoleDialog >>()
195+
185196function createOrUpdateRole(item ? : RoleItem ) {
186197 createOrUpdateRoleDialogRef .value ?.open (item );
187198}
@@ -202,7 +213,8 @@ function deleteRole(item: RoleItem) {
202213 currentRole .value = item .id === currentRole .value ?.id ? internalRoleList .value [0 ] : currentRole .value
203214 })
204215 })
205- .catch (() => { })
216+ .catch (() => {
217+ })
206218}
207219
208220
0 commit comments