Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed: Fixed an issue where clicking the user/group field in the authorization rule of the user detail page would jump to an error #4109

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixed: Fixed an issue where clicking the user/group field in the auth…
…orization rule of the user detail page would jump to an error
  • Loading branch information
ZhaoJiSen committed Jun 25, 2024
commit 3f42ad7d181cf35d27f20b5fc6de68d83d286b75
1 change: 1 addition & 0 deletions src/components/Form/AutoDataForm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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>
11 changes: 8 additions & 3 deletions src/views/perms/AssetPermission/AssetPermissionDetail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/views/settings/Org/OrganizationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default {
},
'resource_statistics.asset_perms_amount': {
label: this.$t('AssetPermsAmount'),
width: '150px'
width: '200px'
},
actions: {
prop: 'id',
Expand Down