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

fix(permission/app): 去掉授权记录的“授权类型”列过滤器 #1126

Merged
merged 1 commit into from
Nov 25, 2024
Merged
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
68 changes: 34 additions & 34 deletions src/dashboard-front/src/views/permission/app/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
{{ row.expires || t('永久有效') }}
</template>
</bk-table-column>
<bk-table-column width="150" :label="t('授权类型')" prop="grant_type" :filter="grantTypeFilterOptions">
<bk-table-column width="150" :label="t('授权类型')" prop="grant_type">
<template #default="{ row }: { row: IPermission }">
{{ row.grant_type === 'initialize' ? t('主动授权') : t('申请审批') }}
</template>
Expand Down Expand Up @@ -468,39 +468,39 @@ const grantDimensionFilterOptions = {
};

// 授权类型表头过滤
const grantTypeFilterOptions = {
list: [
{
// value: 'initialize',
value: t('主动授权'),
text: t('主动授权'),
},
{
// value: 'renew',
value: t('申请审批'),
text: t('申请审批'),
},
],
checked: checkedGrantTypeFilterOptions.value,
filterFn: (checked: string[], row: IPermission) => {
if (!checked.length) {
return true;
}

const checkedList = checked.map((value) => {
if (value === '主动授权' || value === 'Add Permissions') {
return 'initialize';
}
if (value === '申请审批' || value === 'apply') {
return 'renew';
}

return value;
});

return checkedList.includes(row.grant_type);
},
};
// const grantTypeFilterOptions = {
// list: [
// {
// // value: 'initialize',
// value: t('主动授权'),
// text: t('主动授权'),
// },
// {
// // value: 'renew',
// value: t('申请审批'),
// text: t('申请审批'),
// },
// ],
// checked: checkedGrantTypeFilterOptions.value,
// filterFn: (checked: string[], row: IPermission) => {
// if (!checked.length) {
// return true;
// }
//
// const checkedList = checked.map((value) => {
// if (value === '主动授权' || value === 'Add Permissions') {
// return 'initialize';
// }
// if (value === '申请审批' || value === 'apply') {
// return 'renew';
// }
//
// return value;
// });
//
// return checkedList.includes(row.grant_type);
// },
// };

const filterData = ref<IFilterParams>({});

Expand Down
Loading