fix(产品需求、项目需求): 修复权限码的语义问题。
This commit is contained in:
@@ -462,7 +462,7 @@ const columns = computed(() => [
|
||||
onClick: () => void;
|
||||
}[] = [];
|
||||
|
||||
if (hasObjectAuth('project:product:query') && canViewReviewRecord(row)) {
|
||||
if (hasObjectAuth('project:product:requirement:query') && canViewReviewRecord(row)) {
|
||||
actions.push({
|
||||
key: 'reviewRecord',
|
||||
label: '查看评审记录',
|
||||
@@ -472,7 +472,7 @@ const columns = computed(() => [
|
||||
});
|
||||
}
|
||||
|
||||
if (hasObjectAuth('project:product:split') && canSplitRequirement(row)) {
|
||||
if (hasObjectAuth('project:product:requirement:split') && canSplitRequirement(row)) {
|
||||
actions.push({
|
||||
key: 'split',
|
||||
label: '拆分',
|
||||
@@ -482,7 +482,7 @@ const columns = computed(() => [
|
||||
});
|
||||
}
|
||||
|
||||
if (hasObjectAuth('project:product:update') && canEditRequirement(row)) {
|
||||
if (hasObjectAuth('project:product:requirement:update') && canEditRequirement(row)) {
|
||||
actions.push({
|
||||
key: 'edit',
|
||||
label: '编辑',
|
||||
@@ -503,8 +503,8 @@ const columns = computed(() => [
|
||||
}
|
||||
|
||||
const lifecycleActions = getRowActions(row);
|
||||
const hasReviewAuth = hasObjectAuth('project:product:review');
|
||||
const hasStatusAuth = hasObjectAuth('project:product:status');
|
||||
const hasReviewAuth = hasObjectAuth('project:product:requirement:review');
|
||||
const hasStatusAuth = hasObjectAuth('project:product:requirement:status');
|
||||
|
||||
if (hasReviewAuth && lifecycleActions.some(action => isReviewAction(row, action))) {
|
||||
actions.push({
|
||||
@@ -540,7 +540,7 @@ const columns = computed(() => [
|
||||
}
|
||||
}
|
||||
|
||||
if (canDeleteRequirement(row) && hasObjectAuth('project:product:delete')) {
|
||||
if (canDeleteRequirement(row) && hasObjectAuth('project:product:requirement:delete')) {
|
||||
actions.push({
|
||||
key: 'delete',
|
||||
label: '删除',
|
||||
@@ -922,7 +922,7 @@ onMounted(async () => {
|
||||
<TableHeaderOperation v-model:columns="columnChecks" :loading="loading" @refresh="reloadTable">
|
||||
<template #default>
|
||||
<ElButton
|
||||
v-auth="{ code: 'project:product:create', source: 'object' }"
|
||||
v-auth="{ code: 'project:product:requirement:create', source: 'object' }"
|
||||
plain
|
||||
type="primary"
|
||||
@click="openCreate"
|
||||
|
||||
@@ -45,12 +45,12 @@ const isRootModule = computed(() => props.module.id === props.rootModuleId);
|
||||
|
||||
const hasAnyActionPermission = computed(() => {
|
||||
if (isRootModule.value) {
|
||||
return hasObjectAuth('project:product:create');
|
||||
return hasObjectAuth('project:product:requirement:create');
|
||||
}
|
||||
return (
|
||||
hasObjectAuth('project:product:create') ||
|
||||
hasObjectAuth('project:product:update') ||
|
||||
hasObjectAuth('project:product:delete')
|
||||
hasObjectAuth('project:product:requirement:create') ||
|
||||
hasObjectAuth('project:product:requirement:update') ||
|
||||
hasObjectAuth('project:product:requirement:delete')
|
||||
);
|
||||
});
|
||||
|
||||
@@ -163,18 +163,22 @@ function handleToggle() {
|
||||
</div>
|
||||
|
||||
<div v-if="!isEditing && hasAnyActionPermission" class="module-tree-item__actions" @click.stop>
|
||||
<ElTooltip v-if="hasObjectAuth('project:product:create')" content="新增子模块" placement="top">
|
||||
<ElTooltip v-if="hasObjectAuth('project:product:requirement:create')" content="新增子模块" placement="top">
|
||||
<ElButton link type="primary" class="module-tree-item__action-btn" @click="handleStartAddChild">
|
||||
<icon-mdi-plus class="text-14px" />
|
||||
</ElButton>
|
||||
</ElTooltip>
|
||||
<ElTooltip v-if="!isRootModule && hasObjectAuth('project:product:update')" content="编辑" placement="top">
|
||||
<ElTooltip
|
||||
v-if="!isRootModule && hasObjectAuth('project:product:requirement:update')"
|
||||
content="编辑"
|
||||
placement="top"
|
||||
>
|
||||
<ElButton link type="primary" class="module-tree-item__action-btn" @click="handleStartEdit">
|
||||
<icon-mdi-pencil-outline class="text-14px" />
|
||||
</ElButton>
|
||||
</ElTooltip>
|
||||
<ElPopconfirm
|
||||
v-if="!isRootModule && canDeleteModule && hasObjectAuth('project:product:delete')"
|
||||
v-if="!isRootModule && canDeleteModule && hasObjectAuth('project:product:requirement:delete')"
|
||||
title="确定删除该模块吗?"
|
||||
@confirm="handleDelete"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user