This commit is contained in:
Swift
2024-02-02 12:35:35 +03:30
parent 980763fd6e
commit b14c480f17
7 changed files with 211 additions and 8 deletions
+4 -4
View File
@@ -85,10 +85,10 @@
:key="index + Math.random() + 2"
class="ml-2 mb-2"
style="cursor: pointer"
:type="hasPermission(item.value) ? 'success' : 'primary'"
:type="hasPermission(item?.value) ? 'success' : 'primary'"
disable-transitions
@click="addPermission(item.value)"
>{{ item.name }}
@click="addPermission(item?.value)"
>{{ item.name || item.value }}
</el-tag>
</div>
</CCardBody>
@@ -223,7 +223,7 @@ export default {
})
},
getPermissionName(value) {
return this.permissions.filter(item => item.value === value)[0].name
return this.permissions.filter(item => item.value === value)[0]?.name || value
},
addPermission(val) {
if (!this.admin.permissions.includes(val)) this.admin.permissions.push(val)