mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
perf: Update user orgs roles (#3828)
Co-authored-by: Bai <baijiangjie@gmail.com>
This commit is contained in:
@@ -68,7 +68,16 @@ export default {
|
||||
return [this.$t('common.tree.Loading') + '...']
|
||||
}
|
||||
const getItem = this.formatterArgs.getItem || (item => item.name)
|
||||
let data = this.data.map(item => getItem(item)) || []
|
||||
let data = []
|
||||
if (Array.isArray(this.data)) {
|
||||
data = this.data.map(item => getItem(item)) || []
|
||||
} else {
|
||||
// object {key: [value]}
|
||||
data = Object.entries(this.data).map(([key, value]) => {
|
||||
const item = { key: key, value: value }
|
||||
return getItem(item)
|
||||
}) || []
|
||||
}
|
||||
data = data.filter(Boolean)
|
||||
return data
|
||||
},
|
||||
@@ -80,7 +89,14 @@ export default {
|
||||
if (this.formatterArgs.async) {
|
||||
this.amount = this.cellValue
|
||||
} else {
|
||||
this.amount = (this.cellValue?.filter(value => !this.cellValueToRemove.includes(value)) || []).length
|
||||
let cellValue = []
|
||||
if (Array.isArray(this.cellValue)) {
|
||||
cellValue = this.cellValue
|
||||
} else {
|
||||
// object {key: [value]}
|
||||
cellValue = Object.keys(this.cellValue)
|
||||
}
|
||||
this.amount = (cellValue?.filter(value => !this.cellValueToRemove.includes(value)) || []).length
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -1996,7 +1996,7 @@
|
||||
"UpdateNodeAssetHardwareInfo": "Update node asset hardware information"
|
||||
},
|
||||
"users": {
|
||||
"OrgRoleRelations": "Organizations",
|
||||
"OrgsAndRoles": "Organizations and roles",
|
||||
"LunaSettingUpdate": "Luna setting",
|
||||
"KokoSettingUpdate": "Koko setting",
|
||||
"UserSetting": "User setting",
|
||||
|
||||
@@ -1987,7 +1987,7 @@
|
||||
"UpdateNodeAssetHardwareInfo": "ノード資産ハードウェア情報の更新"
|
||||
},
|
||||
"users": {
|
||||
"OrgRoleRelations": "しょぞくそしき",
|
||||
"OrgsAndRoles": "そしきとやくわり",
|
||||
"LunaSettingUpdate": "Luna 設定更新",
|
||||
"KokoSettingUpdate": "Koko 設定更新",
|
||||
"UserSetting": "個人設定",
|
||||
|
||||
@@ -1981,7 +1981,7 @@
|
||||
"PasskeyAddDisableInfo": "你的认证来源是 {source}, 不支持添加 Passkey"
|
||||
},
|
||||
"users": {
|
||||
"OrgRoleRelations": "所属组织",
|
||||
"OrgsAndRoles": "组织与角色",
|
||||
"LunaSettingUpdate": "Luna 配置设置",
|
||||
"KokoSettingUpdate": "Koko 配置设置",
|
||||
"UserSetting": "偏好设置",
|
||||
|
||||
@@ -196,7 +196,7 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
key: this.$t('users.OrgRoleRelations'),
|
||||
key: this.$t('users.OrgsAndRoles'),
|
||||
has: this.$store.getters.currentOrgIsRoot,
|
||||
formatter: (item, val) => {
|
||||
const doms = []
|
||||
@@ -207,8 +207,8 @@ export default {
|
||||
if (key.length >= allowKeyMaxLength) {
|
||||
prettyKey = key.substring(0, allowKeyMaxLength - 3) + '...'
|
||||
}
|
||||
const domKey = <el-tag size='mini' type='success'>{prettyKey}</el-tag>
|
||||
doms.push(domKey)
|
||||
const item = prettyKey + ': ' + value.join(',')
|
||||
doms.push([item, <br/>])
|
||||
})
|
||||
return <div>{doms}</div>
|
||||
}
|
||||
|
||||
@@ -96,6 +96,19 @@ export default {
|
||||
return this.$store.getters.hasValidLicense && !this.currentOrgIsRoot
|
||||
}
|
||||
},
|
||||
orgs_roles: {
|
||||
columnKey: 'orgs_roles',
|
||||
has: () => {
|
||||
return this.$store.getters.currentOrgIsRoot
|
||||
},
|
||||
formatter: AmountFormatter,
|
||||
filters: [],
|
||||
formatterArgs: {
|
||||
getItem(item) {
|
||||
return item.key + ': ' + item.value.join(',')
|
||||
}
|
||||
}
|
||||
},
|
||||
phone: {
|
||||
formatter: (row) => {
|
||||
const phoneObj = row.phone
|
||||
|
||||
Reference in New Issue
Block a user