fix: 用户组权限勾选逻辑修改
This commit is contained in:
parent
a7bc73fc4a
commit
c01ba09c11
|
@ -73,6 +73,11 @@
|
|||
const checkIsLogin = async () => {
|
||||
const isLogin = await userStore.isLogin();
|
||||
const isLoginPage = route.name === 'login';
|
||||
if (isLoginPage && isLogin) {
|
||||
// 当前页面为登录页面,且已经登录,跳转到首页
|
||||
const currentRouteName = getFirstRouteNameByPermission(router.getRoutes());
|
||||
router.push({ name: currentRouteName });
|
||||
}
|
||||
if (isLogin && appStore.currentProjectId && appStore.currentProjectId !== 'no_such_project') {
|
||||
// 当前为登陆状态,且已经选择了项目,初始化当前项目配置
|
||||
try {
|
||||
|
@ -89,11 +94,6 @@
|
|||
console.log(err);
|
||||
}
|
||||
}
|
||||
if (isLoginPage && isLogin) {
|
||||
// 当前页面为登录页面,且已经登录,跳转到首页
|
||||
const currentRouteName = getFirstRouteNameByPermission(router.getRoutes());
|
||||
router.push({ name: currentRouteName });
|
||||
}
|
||||
};
|
||||
// 获取公钥
|
||||
const getPublicKey = async () => {
|
||||
|
|
|
@ -361,7 +361,14 @@
|
|||
}
|
||||
} else {
|
||||
// 删除权限值
|
||||
record.perChecked.splice(record.perChecked.indexOf(currentValue), 1);
|
||||
const preStr = currentValue.split(':')[0];
|
||||
const postStr = currentValue.split(':')[1];
|
||||
if (postStr === 'READ') {
|
||||
// 当前是查询 那 移除所有相关的
|
||||
record.perChecked = record.perChecked.filter((item) => !item.includes(preStr));
|
||||
} else {
|
||||
record.perChecked.splice(record.perChecked.indexOf(currentValue), 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -483,5 +490,11 @@
|
|||
:deep(.arco-table-th-title) {
|
||||
width: 100%;
|
||||
}
|
||||
:deep(.arco-checkbox-indeterminate) {
|
||||
.arco-checkbox-icon {
|
||||
border-color: rgb(var(--primary-5));
|
||||
background: rgb(var(--primary-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -314,7 +314,7 @@ const Setting: AppRouteRecordRaw = {
|
|||
component: () => import('@/views/setting/organization/log/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.settings.organization.log',
|
||||
roles: ['*'],
|
||||
roles: ['ORGANIZATION_LOG:READ'],
|
||||
isTopMenu: true,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</template>
|
||||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
<a-form-item field="resourcePool" :label="t('system.project.resourcePool')">
|
||||
<a-form-item v-if="showPool" field="resourcePool" :label="t('system.project.resourcePool')">
|
||||
<MsSystemPool v-model:modelValue="form.resourcePoolIds" :organization-id="currentOrgId" />
|
||||
</a-form-item>
|
||||
<a-form-item field="description" :label="t('system.organization.description')">
|
||||
|
@ -137,6 +137,10 @@
|
|||
(e: 'cancel', shouldSearch: boolean): void;
|
||||
}>();
|
||||
|
||||
const allModuleIds = ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'];
|
||||
|
||||
const showPoolModuleIds = ['uiTest', 'apiTest', 'loadTest'];
|
||||
|
||||
const form = reactive<CreateOrUpdateSystemProjectParams>({
|
||||
name: '',
|
||||
userIds: [],
|
||||
|
@ -144,10 +148,11 @@
|
|||
description: '',
|
||||
resourcePoolIds: [],
|
||||
enable: true,
|
||||
moduleIds: ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'],
|
||||
moduleIds: allModuleIds,
|
||||
});
|
||||
|
||||
const currentVisible = ref(props.visible);
|
||||
const showPool = computed(() => showPoolModuleIds.some((item) => form.moduleIds?.includes(item)));
|
||||
|
||||
const isXpack = computed(() => {
|
||||
return licenseStore.hasLicense();
|
||||
|
@ -163,7 +168,7 @@
|
|||
form.organizationId = currentOrgId.value;
|
||||
form.description = '';
|
||||
form.enable = true;
|
||||
form.moduleIds = ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'];
|
||||
form.moduleIds = allModuleIds;
|
||||
form.resourcePoolIds = [];
|
||||
};
|
||||
const handleCancel = (shouldSearch: boolean) => {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<a-input-search
|
||||
v-model:model-value="keyword"
|
||||
allow-clear
|
||||
:placeholder="t('system.user.searchUser')"
|
||||
:placeholder="t('system.organization.searchUserPlaceholder')"
|
||||
class="w-[230px]"
|
||||
@search="searchUser"
|
||||
@press-enter="searchUser"
|
||||
|
|
|
@ -20,8 +20,12 @@
|
|||
<template #revokeDelete="{ record }">
|
||||
<a-tooltip background-color="#FFFFFF">
|
||||
<template #content>
|
||||
<span class="text-[var(--color-text-1)]">{{ t('system.project.revokeDeleteToolTip') }}</span>
|
||||
<MsButton class="ml-[8px]" @click="handleRevokeDelete(record)">{{ t('common.revokeDelete') }}</MsButton>
|
||||
<div class="flex flex-row">
|
||||
<span class="text-[var(--color-text-1)]">{{
|
||||
t('system.project.revokeDeleteToolTip', { count: record.remainDayCount })
|
||||
}}</span>
|
||||
<MsButton class="ml-[8px]" @click="handleRevokeDelete(record)">{{ t('common.revokeDelete') }}</MsButton>
|
||||
</div>
|
||||
</template>
|
||||
<MsIcon v-if="record.deleted" type="icon-icon_alarm_clock" class="ml-[4px] text-[rgb(var(--danger-6))]" />
|
||||
</a-tooltip>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
</template>
|
||||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
<a-form-item field="resourcePool" :label="t('system.project.resourcePool')">
|
||||
<a-form-item v-if="showPool" field="resourcePool" :label="t('system.project.resourcePool')">
|
||||
<MsSystemPool v-model:modelValue="form.resourcePoolIds" :organization-id="form.organizationId" />
|
||||
</a-form-item>
|
||||
<a-form-item field="description" :label="t('system.organization.description')">
|
||||
|
@ -137,17 +137,22 @@
|
|||
(e: 'cancel', shouldSearch: boolean): void;
|
||||
}>();
|
||||
|
||||
const allModuleIds = ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'];
|
||||
|
||||
const showPoolModuleIds = ['uiTest', 'apiTest', 'loadTest'];
|
||||
|
||||
const form = reactive<CreateOrUpdateSystemProjectParams>({
|
||||
name: '',
|
||||
userIds: [],
|
||||
organizationId: '',
|
||||
description: '',
|
||||
enable: true,
|
||||
moduleIds: ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'],
|
||||
moduleIds: allModuleIds,
|
||||
resourcePoolIds: [],
|
||||
});
|
||||
|
||||
const currentVisible = ref(props.visible);
|
||||
const showPool = computed(() => showPoolModuleIds.some((item) => form.moduleIds?.includes(item)));
|
||||
|
||||
const isXpack = computed(() => {
|
||||
return licenseStore.hasLicense();
|
||||
|
@ -159,7 +164,7 @@
|
|||
form.organizationId = '';
|
||||
form.description = '';
|
||||
form.enable = true;
|
||||
form.moduleIds = ['workstation', 'testPlan', 'bugManagement', 'caseManagement', 'apiTest', 'uiTest', 'loadTest'];
|
||||
form.moduleIds = allModuleIds;
|
||||
};
|
||||
const handleCancel = (shouldSearch: boolean) => {
|
||||
emit('cancel', shouldSearch);
|
||||
|
|
|
@ -181,6 +181,10 @@
|
|||
title: 'system.organization.createTime',
|
||||
dataIndex: 'createTime',
|
||||
width: 180,
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
sorter: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: hasOperationPermission.value ? 'system.organization.operation' : '',
|
||||
|
|
|
@ -70,7 +70,7 @@ export default {
|
|||
'system.project.affiliatedOrgPlaceholder': 'Please select affiliated organization',
|
||||
'system.project.projectAdmin': 'Project administrator',
|
||||
'system.project.projectAdminPlaceholder': 'The project administrator defaults to the person who created the project',
|
||||
'system.project.moduleSetting': 'Module setting',
|
||||
'system.project.moduleSetting': 'Enable module',
|
||||
'system.project.projectNameRequired': 'Project name cannot be empty',
|
||||
'system.project.createTip': 'After the project is enabled, it will be displayed in the project switching list',
|
||||
'system.project.affiliatedOrgRequired': 'Affiliated organization cannot be empty',
|
||||
|
|
|
@ -65,7 +65,7 @@ export default {
|
|||
'system.project.affiliatedOrgPlaceholder': '请选择所属组织',
|
||||
'system.project.projectAdmin': '项目管理员',
|
||||
'system.project.projectAdminPlaceholder': '默认选择创建项目人为项目管理员',
|
||||
'system.project.moduleSetting': '模块设置',
|
||||
'system.project.moduleSetting': '开启模块',
|
||||
'system.project.projectNameRequired': '项目名称不能为空',
|
||||
'system.project.createTip': '项目启用后,将展示在项目切换列表',
|
||||
'system.project.affiliatedOrgRequired': '所属组织不能为空',
|
||||
|
|
Loading…
Reference in New Issue