feat: 用户组权限问题调整&应用管理交互调整

This commit is contained in:
RubyLiu 2024-01-29 17:02:39 +08:00 committed by 刘瑞斌
parent 5551cbde21
commit 0d85df85c7
6 changed files with 79 additions and 64 deletions

View File

@ -20,7 +20,7 @@
v-if="tableData && tableData?.length > 0"
:model-value="allChecked"
:indeterminate="allIndeterminate"
:disabled="currentInternal"
:disabled="currentInternal || props.disabled"
class="mr-[7px]"
@change="handleAllAuthChangeByCheckbox"
></a-checkbox>
@ -35,7 +35,7 @@
<a-checkbox
v-for="item in record.permissions"
:key="item.id"
:disabled="item.license || currentInternal"
:disabled="item.license || currentInternal || props.disabled"
:value="item.id"
>{{ t(item.name) }}</a-checkbox
>
@ -44,7 +44,7 @@
class="mr-[7px]"
:model-value="record.enable"
:indeterminate="record.indeterminate"
:disabled="currentInternal"
:disabled="currentInternal || props.disabled"
@change="(value) => handleRowAuthChange(value, rowIndex)"
/>
</div>
@ -106,6 +106,7 @@
savePermission?: string[];
width?: string;
showBottom?: boolean;
disabled?: boolean;
scroll?: {
x?: number | string;
y?: number | string;
@ -115,6 +116,7 @@
}>(),
{
showBottom: true,
disabled: false,
scroll() {
return {
x: '800px',

View File

@ -402,7 +402,7 @@
title: 'caseManagement.caseReview.tag',
dataIndex: 'tags',
isTag: true,
width: 150,
width: 300,
},
{
title: 'caseManagement.caseReview.desc',

View File

@ -11,7 +11,9 @@
ref="tableRef"
class="mt-[16px]"
v-bind="propsRes"
row-class="cursor-pointer"
:expanded-keys="expandedKeys"
@row-click="handleRowClick"
@expand="expandChange"
v-on="propsEvent"
>
@ -231,12 +233,9 @@
</div>
</template>
<template #operation="{ record }">
<!-- 用例 同步缺陷状态 -->
<a-tooltip
v-if="record.type === 'BUG_SYNC' && !allValueMap['BUG_SYNC_SYNC_ENABLE']"
v-permission="['PROJECT_APPLICATION_BUG:READ+UPDATE']"
position="tr"
>
<!-- 缺陷 同步缺陷状态 -->
<div v-permission="['PROJECT_APPLICATION_BUG:READ+UPDATE']">
<a-tooltip v-if="record.type === 'BUG_SYNC' && !allValueMap['BUG_SYNC_SYNC_ENABLE']" position="tr">
<template #content>
<span>
{{ t('project.menu.notConfig') }}
@ -246,6 +245,7 @@
{{ t('project.menu.configure') }}
</span>
</template>
<a-switch
checked-value="true"
unchecked-value="false"
@ -256,6 +256,8 @@
@change="(v: boolean | string| number) => handleMenuStatusChange('BUG_SYNC_SYNC_ENABLE',v as boolean, MenuEnum.bugManagement)"
/>
</a-tooltip>
</div>
<a-switch
v-if="record.type === 'BUG_SYNC' && allValueMap['BUG_SYNC_SYNC_ENABLE']"
checked-value="true"
@ -266,11 +268,8 @@
@change="(v: boolean | string| number) => handleMenuStatusChange('BUG_SYNC_SYNC_ENABLE',v as boolean, MenuEnum.bugManagement)"
/>
<!-- 功能测试 同步缺陷 -->
<a-tooltip
v-if="record.type === 'CASE_RELATED' && !allValueMap['CASE_RELATED_CASE_ENABLE']"
v-permission="['PROJECT_APPLICATION_BUG:READ+UPDATE']"
position="tr"
>
<div v-permission="['PROJECT_APPLICATION_BUG:READ+UPDATE']">
<a-tooltip v-if="record.type === 'CASE_RELATED' && !allValueMap['CASE_RELATED_CASE_ENABLE']" position="tr">
<template #content>
<span>
{{ t('project.menu.notConfig') }}
@ -290,6 +289,7 @@
@change="(v: boolean | string| number) => handleMenuStatusChange('CASE_RELATED_CASE_ENABLE',v as boolean, MenuEnum.caseManagement)"
/>
</a-tooltip>
</div>
<a-switch
v-if="record.type === 'CASE_RELATED' && allValueMap['CASE_RELATED_CASE_ENABLE']"
:disabled="!hasAnyPermission(['PROJECT_APPLICATION_BUG:READ+UPDATE'])"
@ -417,14 +417,14 @@
//
const defaultValueMap = {
TEST_PLAN_CLEAN_REPORT: '30D',
TEST_PLAN_SHARE_REPORT: '30D',
API_CLEAN_REPORT: '30D',
API_SHARE_REPORT: '30D',
UI_CLEAN_REPORT: '30D',
UI_SHARE_REPORT: '30D',
PERFORMANCE_TEST_CLEAN_REPORT: '30D',
PERFORMANCE_TEST_SHARE_REPORT: '30D',
TEST_PLAN_CLEAN_REPORT: '3M',
TEST_PLAN_SHARE_REPORT: '1D',
API_CLEAN_REPORT: '3M',
API_SHARE_REPORT: '1D',
UI_CLEAN_REPORT: '3M',
UI_SHARE_REPORT: '1D',
PERFORMANCE_TEST_CLEAN_REPORT: '3M',
PERFORMANCE_TEST_SHARE_REPORT: '1D',
WORKSTATION_SYNC_RULE: true,
CASE_RELATED: true,
CASE_RE_REVIEW: true,
@ -798,6 +798,13 @@
}
};
//
const handleRowClick = (record: TableData, ev: Event) => {
if (record.module) {
expandChange(record);
}
};
onMounted(() => {
setLoadListParams({ projectId: currentProjectId.value });
fetchData();

View File

@ -28,13 +28,13 @@
</template>
<template #operation="{ record }">
<div class="flex flex-row flex-nowrap">
<span v-permission="['SYSTEM_ORGANIZATIN_PROJECT:READ+UPDATE']" class="flex flex-row">
<span v-permission="['PROJECT_GROUP:READ+UPDATE']" class="flex flex-row">
<MsButton class="!mr-0" @click="showAuthDrawer(record)">{{ t('project.userGroup.viewAuth') }}</MsButton>
<a-divider v-if="!record.internal" direction="vertical" />
</span>
<MsButton
v-if="!record.internal"
v-permission="['SYSTEM_ORGANIZATIN_PROJECT:READ+UPDATE']"
v-permission="['PROJECT_GROUP:READ+UPDATE']"
class="!mr-0"
status="danger"
@click="handleDelete(record)"
@ -57,6 +57,7 @@
:show-bottom="false"
:scroll="{ x: 800, y: 'calc(100vh - 150px)' }"
:current="currentItem"
:disabled="!hasAnyPermission(['PROJECT_GROUP:READ+UPDATE'])"
/>
<template #footer>
<div class="flex items-center justify-between">
@ -134,6 +135,7 @@
import { useI18n } from '@/hooks/useI18n';
import useModal from '@/hooks/useModal';
import { useAppStore } from '@/store';
import { hasAnyPermission } from '@/utils/permission';
import { CurrentUserGroupItem, UserGroupItem } from '@/models/setting/usergroup';
import { AuthScopeEnum } from '@/enums/commonEnum';

View File

@ -45,6 +45,7 @@
:current="currentUserGroupItem"
:width="bottomWidth"
:save-permission="['ORGANIZATION_GROUP:READ+UPDATE']"
:disabled="!hasAnyPermission(['ORGANIZATION_GROUP:READ+UPDATE'])"
/>
</div>
</div>
@ -67,6 +68,7 @@
import { useI18n } from '@/hooks/useI18n';
import { useAppStore } from '@/store';
import { addPixelValues } from '@/utils/css';
import { hasAnyPermission } from '@/utils/permission';
import { CurrentUserGroupItem } from '@/models/setting/usergroup';
import { AuthScopeEnum } from '@/enums/commonEnum';

View File

@ -44,7 +44,8 @@
v-if="currentTable === 'auth' && couldShowAuth"
:current="currentUserGroupItem"
:width="bottomWidth"
:save-permission="['PROJECT_GROUP:READ+UPDATE']"
:save-permission="['SYSTEM_USER_ROLE:READ+UPDATE']"
:disabled="!hasAnyPermission(['SYSTEM_USER_ROLE:READ+UPDATE'])"
/>
</div>
</div>
@ -67,6 +68,7 @@
import { useI18n } from '@/hooks/useI18n';
import { useAppStore } from '@/store';
import { addPixelValues } from '@/utils/css';
import { hasAnyPermission } from '@/utils/permission';
import { CurrentUserGroupItem } from '@/models/setting/usergroup';
import { AuthScopeEnum } from '@/enums/commonEnum';