Skip to content

Commit

Permalink
perf: 修改授权
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler committed Feb 11, 2025
1 parent ff76917 commit f54e2c8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
11 changes: 10 additions & 1 deletion src/components/Apps/AccountListTable/AccountList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export default {
extraQuery: {
type: Object,
default: () => ({})
},
showQuickFilters: {
type: Boolean,
default: true
}
},
data() {
Expand All @@ -151,7 +155,7 @@ export default {
iAsset: this.asset,
account: {},
secretUrl: '',
quickFilters: accountQuickFilters(this),
quickFilters: this.showQuickFilters ? accountQuickFilters(this) : [],
tableConfig: {
url: this.url,
permissions: {
Expand Down Expand Up @@ -205,6 +209,11 @@ export default {
platformAttr: 'asset.platform'
}
},
asset: {
formatter: function(row) {
return row.asset.name
}
},
username: {
width: '120px'
},
Expand Down
2 changes: 1 addition & 1 deletion src/layout/components/Page/TwoColPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>
<template v-else>
<!-- 默认插槽内容,全宽 -->
<el-col :md="single" :sm="24">
<el-col :md="single" :offset="(24 - single)/2" :sm="24">
<slot />
</el-col>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<AccountListTable
ref="ListTable"
:asset="object"
:columns-default="columns"
:has-clone="false"
:has-column-actions="false"
:has-delete-action="false"
:has-export="false"
:has-import="false"
:has-left-actions="false"
:show-quick-filters="false"
:url="url"
/>
</template>
<template #right>
<IBox :title="$tc('Account')" type="primary">
<AccountFormatter
:assets="assetIds"
Expand Down Expand Up @@ -54,7 +54,8 @@ export default {
relation: {
disabled: false,
username: ''
}
},
columns: ['name', 'username', 'secret', 'asset']
}
},
computed: {
Expand Down
11 changes: 9 additions & 2 deletions src/views/perms/AssetPermission/AssetPermissionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Page from '@/layout/components/Page'
import AssetTreeTable from '@/components/Apps/AssetTreeTable'
import PermBulkUpdateDialog from './components/PermBulkUpdateDialog'
import { mapGetters } from 'vuex'
import { AssetPermissionListPageSearchConfigOptions, AssetPermissionTableMeta } from '../const'
import { AssetPermissionListPageSearchConfigOptions, AssetPermissionTableMeta } from '../const.js'
export default {
components: {
Expand All @@ -41,9 +41,16 @@ export default {
is_valid: false
}
},
{
label: this.$t('Valid'),
filter: {
is_valid: true
}
},
{
label: this.$t('Expired'),
filter: {
is_expired: true
}
},
{
Expand All @@ -55,7 +62,7 @@ export default {
{
label: this.$t('NoResource'),
filter: {
no_resource: true
is_no_resource: true
}
}
]
Expand Down
8 changes: 7 additions & 1 deletion src/views/perms/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const AssetPermissionTableMeta = {
name: {
minWidth: '120px',
formatterArgs: {
route: 'AssetPermissionDetail'
route: 'AssetPermissionDetail',
drawer: true
}
},
action: {
Expand Down Expand Up @@ -65,6 +66,7 @@ export const AssetPermissionTableMeta = {
formatterArgs: {
async: true,
route: 'AssetPermissionDetail',
drawer: true,
routeQuery: {
tab: 'AssetPermissionUser'
}
Expand All @@ -75,6 +77,7 @@ export const AssetPermissionTableMeta = {
formatter: AmountFormatter,
formatterArgs: {
async: true,
drawer: true,
route: 'AssetPermissionDetail',
routeQuery: {
tab: 'AssetPermissionUser'
Expand All @@ -85,6 +88,7 @@ export const AssetPermissionTableMeta = {
formatter: AmountFormatter,
formatterArgs: {
async: true,
drawer: true,
route: 'AssetPermissionDetail',
routeQuery: {
tab: 'AssetPermissionAsset'
Expand All @@ -96,6 +100,7 @@ export const AssetPermissionTableMeta = {
formatter: AmountFormatter,
formatterArgs: {
async: true,
drawer: true,
route: 'AssetPermissionDetail',
routeQuery: {
tab: 'AssetPermissionAsset'
Expand All @@ -106,6 +111,7 @@ export const AssetPermissionTableMeta = {
formatter: AmountFormatter,
formatterArgs: {
cellValueToRemove: ['@SPEC'],
drawer: true,
getItem(item) {
if (item !== '@SPEC') {
return AccountLabelMapper[item] || item
Expand Down

0 comments on commit f54e2c8

Please sign in to comment.