mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-23 12:07:38 +00:00
fixed: Fixed an issue where clicking the user/group field in the authorization rule of the user detail page would jump to an error
This commit is contained in:
@@ -176,6 +176,7 @@ export class FormFieldGenerator {
|
||||
const helpTextWordLength = helpText.split(' ').length
|
||||
const placeholderType = ['input', 'select', 'm2m_related_field']
|
||||
const placeholderComponent = [ObjectSelect2]
|
||||
|
||||
if (helpTextAsPlaceholder !== undefined) {
|
||||
helpTextAsPlaceholder = !!helpTextAsPlaceholder
|
||||
} else if (placeholderType.indexOf(field.type) === -1 && placeholderComponent.indexOf(field.component) === -1) {
|
||||
|
@@ -28,11 +28,9 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const id = this.object.id
|
||||
const url = id ? `/api/v1/perms/asset-permissions/${id}/users/all/` : ''
|
||||
return {
|
||||
tableConfig: {
|
||||
url: url,
|
||||
url: '',
|
||||
id: 'user',
|
||||
columnsExclude: ['user'],
|
||||
columnsExtra: ['delete_action'],
|
||||
@@ -104,7 +102,6 @@ export default {
|
||||
this.$log.debug('Select value', that.select2.value)
|
||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||
this.$store.commit('common/reload')
|
||||
// this.$refs.ListTable.reloadTable()
|
||||
}
|
||||
},
|
||||
groupRelationConfig: {
|
||||
@@ -150,6 +147,26 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
object: {
|
||||
handler(newVal) {
|
||||
this.updateTableConfigUrl(newVal.id)
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.updateTableConfigUrl(this.$route.params.id)
|
||||
},
|
||||
methods: {
|
||||
// 对于 url 中的 id 值有可能会捕获到上一个页面路由对象中的 id 值,因此会导致权限报错
|
||||
updateTableConfigUrl(id) {
|
||||
if (id) {
|
||||
this.tableConfig.url = `/api/v1/perms/asset-permissions/${id}/users/all/`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -31,9 +31,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
AssetPermission: {
|
||||
name: '', users_amount: 0, user_groups_amount: 0, assets_amount: 0,
|
||||
nodes_amount: 0, system_users_amount: 0,
|
||||
date_start: '', date_expired: ''
|
||||
name: '',
|
||||
users_amount: 0,
|
||||
user_groups_amount: 0,
|
||||
assets_amount: 0,
|
||||
nodes_amount: 0,
|
||||
system_users_amount: 0,
|
||||
date_start: '',
|
||||
date_expired: ''
|
||||
},
|
||||
config: {
|
||||
activeMenu: 'AssetPermissionDetail',
|
||||
|
@@ -67,7 +67,7 @@ export default {
|
||||
},
|
||||
'resource_statistics.asset_perms_amount': {
|
||||
label: this.$t('AssetPermsAmount'),
|
||||
width: '150px'
|
||||
width: '200px'
|
||||
},
|
||||
actions: {
|
||||
prop: 'id',
|
||||
|
Reference in New Issue
Block a user