fix(全局): 问题修复
This commit is contained in:
parent
9e744abcc0
commit
fa94637dc7
|
@ -38,6 +38,7 @@ import {
|
|||
BatchReviewCaseParams,
|
||||
CommitReviewResultParams,
|
||||
CopyReviewParams,
|
||||
CopyReviewResponse,
|
||||
FollowReviewParams,
|
||||
Review,
|
||||
ReviewCaseItem,
|
||||
|
@ -97,7 +98,7 @@ export const associateReviewCase = (data: AssociateReviewCaseParams) => {
|
|||
|
||||
// 复制评审
|
||||
export const copyReview = (data: CopyReviewParams) => {
|
||||
return MSR.post({ url: CopyReviewUrl, data });
|
||||
return MSR.post<CopyReviewResponse>({ url: CopyReviewUrl, data });
|
||||
};
|
||||
|
||||
// 编辑评审
|
||||
|
|
|
@ -91,11 +91,11 @@ import type {
|
|||
PreviewImages,
|
||||
UpdateModule,
|
||||
} from '@/models/caseManagement/featureCase';
|
||||
import type { CommonList, MoveModules, TableQueryParams } from '@/models/common';
|
||||
import type { CommonList, ModuleTreeNode, MoveModules, TableQueryParams } from '@/models/common';
|
||||
|
||||
// 获取模块树
|
||||
export function getCaseModuleTree(params: TableQueryParams) {
|
||||
return MSR.get<ModulesTreeType[]>({ url: `${GetCaseModuleTreeUrl}/${params.projectId}` });
|
||||
return MSR.get<ModuleTreeNode[]>({ url: `${GetCaseModuleTreeUrl}/${params.projectId}` });
|
||||
}
|
||||
|
||||
// 创建模块树
|
||||
|
@ -320,7 +320,7 @@ export function getPublicLinkCaseModulesCounts(data: TableQueryParams) {
|
|||
|
||||
// 获取关联用例接口模块树
|
||||
export function getPublicLinkModuleTree(data: TableQueryParams) {
|
||||
return MSR.post<ModulesTreeType[]>({ url: GetAssociationPublicModuleTreeUrl, data });
|
||||
return MSR.post<ModuleTreeNode[]>({ url: GetAssociationPublicModuleTreeUrl, data });
|
||||
}
|
||||
// 关联用例
|
||||
export function associationPublicCase(data: TableQueryParams) {
|
||||
|
|
|
@ -30,7 +30,7 @@ import {
|
|||
UploadFileUrl,
|
||||
} from '@/api/requrls/project-management/fileManagement';
|
||||
|
||||
import type { CommonList } from '@/models/common';
|
||||
import type { CommonList, ModuleTreeNode } from '@/models/common';
|
||||
import type {
|
||||
AddModuleParams,
|
||||
AddRepositoryFileParams,
|
||||
|
@ -42,7 +42,6 @@ import type {
|
|||
FileItem,
|
||||
FileListQueryParams,
|
||||
ModuleCount,
|
||||
ModuleTreeNode,
|
||||
MoveModuleParams,
|
||||
Repository,
|
||||
RepositoryInfo,
|
||||
|
|
|
@ -159,8 +159,7 @@
|
|||
import { mapTree } from '@/utils';
|
||||
|
||||
import type { CaseManagementTable } from '@/models/caseManagement/featureCase';
|
||||
import type { CommonList, TableQueryParams } from '@/models/common';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import type { CommonList, ModuleTreeNode, TableQueryParams } from '@/models/common';
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
|
||||
import type { CaseLevel } from './types';
|
||||
|
|
|
@ -105,13 +105,9 @@
|
|||
getFormApiImportPageList,
|
||||
} from '@/api/modules/project-management/commonScript';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import type { TableQueryParams } from '@/models/common';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
|
||||
const appStore = useAppStore();
|
||||
import type { ModuleTreeNode, TableQueryParams } from '@/models/common';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
|
|
|
@ -92,8 +92,8 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
|
||||
import type { AssociatedList } from '@/models/caseManagement/featureCase';
|
||||
import type { CommonList, TableQueryParams } from '@/models/common';
|
||||
import { FileListQueryParams, ModuleTreeNode, Repository } from '@/models/projectManagement/file';
|
||||
import type { CommonList, ModuleTreeNode, TableQueryParams } from '@/models/common';
|
||||
import { FileListQueryParams, Repository } from '@/models/projectManagement/file';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeMount, ref, watch } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import MsIcon from '@/components/pure/ms-icon-font/index.vue';
|
||||
import MsTree from '@/components/business/ms-tree/index.vue';
|
||||
|
@ -51,7 +51,7 @@
|
|||
import useAppStore from '@/store/modules/app';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const appStore = useAppStore();
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@
|
|||
import { findNodeByKey, formatFileSize } from '@/utils';
|
||||
|
||||
import type { AssociatedList } from '@/models/caseManagement/featureCase';
|
||||
import type { CommonList, TableQueryParams } from '@/models/common';
|
||||
import type { FileListQueryParams, ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import type { CommonList, ModuleTreeNode, TableQueryParams } from '@/models/common';
|
||||
import type { FileListQueryParams } from '@/models/projectManagement/file';
|
||||
import { Repository } from '@/models/projectManagement/file';
|
||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||
|
||||
|
|
|
@ -212,7 +212,6 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
|
||||
import { SelectValue } from '@/models/projectManagement/menuManagement';
|
||||
import { OptionsItem } from '@/models/setting/log';
|
||||
|
||||
import { OPERATOR_MAP } from './index';
|
||||
import { AccordBelowType, BackEndEnum, CombineItem, FilterFormItem, FilterResult, FilterType } from './type';
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
:placeholder="props.searchPlaceholder"
|
||||
class="w-[240px]"
|
||||
allow-clear
|
||||
@press-enter="emit('keywordSearch', innerKeyword)"
|
||||
@search="emit('keywordSearch', innerKeyword)"
|
||||
@clear="emit('keywordSearch', innerKeyword)"
|
||||
@press-enter="emit('keywordSearch', innerKeyword, filterResult)"
|
||||
@search="emit('keywordSearch', innerKeyword, filterResult)"
|
||||
@clear="emit('keywordSearch', innerKeyword, filterResult)"
|
||||
></a-input-search>
|
||||
<MsTag
|
||||
:type="visible ? 'primary' : 'default'"
|
||||
|
@ -28,7 +28,7 @@
|
|||
</span>
|
||||
</span>
|
||||
</MsTag>
|
||||
<MsTag no-margin size="large" class="cursor-pointer" theme="outline" @click="handleResetSearch">
|
||||
<MsTag no-margin size="large" class="cursor-pointer" theme="outline" @click="handleRefresh">
|
||||
<MsIcon class="text-[var(color-text-4)]" :size="16" type="icon-icon_reset_outlined" />
|
||||
</MsTag>
|
||||
<slot name="right"></slot>
|
||||
|
@ -44,7 +44,7 @@
|
|||
class="mt-[8px]"
|
||||
@on-search="handleFilter"
|
||||
@data-index-change="dataIndexChange"
|
||||
@reset="emit('reset')"
|
||||
@reset="handleResetFilter"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
@ -69,26 +69,33 @@
|
|||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:keyword', value: string): void;
|
||||
(e: 'keywordSearch', value: string | undefined): void; // innerKeyword 搜索
|
||||
(e: 'keywordSearch', value: string | undefined, combine: FilterResult): void; // innerKeyword 搜索 TODO:可以去除,父组件通过 v-model:keyword 获取关键字
|
||||
(e: 'advSearch', value: FilterResult): void; // 高级搜索
|
||||
(e: 'dataIndexChange', value: string): void; // 高级搜索选项变更
|
||||
(e: 'reset'): void;
|
||||
(e: 'refresh', value: FilterResult): void;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const innerKeyword = useVModel(props, 'keyword', emit);
|
||||
const visible = ref(false);
|
||||
const filterCount = ref(0);
|
||||
const defaultFilterResult: FilterResult = { accordBelow: 'AND', combine: {} };
|
||||
const filterResult = ref<FilterResult>({ ...defaultFilterResult });
|
||||
|
||||
const handleResetSearch = () => {
|
||||
innerKeyword.value = '';
|
||||
emit('keywordSearch', '');
|
||||
const handleResetFilter = () => {
|
||||
filterResult.value = { ...defaultFilterResult };
|
||||
emit('keywordSearch', '', { ...defaultFilterResult });
|
||||
};
|
||||
|
||||
const handleFilter = (filter: FilterResult) => {
|
||||
filterResult.value = filter;
|
||||
emit('advSearch', filter);
|
||||
};
|
||||
|
||||
const handleRefresh = () => {
|
||||
emit('refresh', filterResult.value);
|
||||
};
|
||||
|
||||
const dataIndexChange = (dataIndex: string) => {
|
||||
emit('dataIndexChange', dataIndex);
|
||||
};
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
import { hasAllPermission } from '@/utils/permission';
|
||||
|
||||
interface MenuItem {
|
||||
title: string;
|
||||
|
@ -47,7 +47,7 @@
|
|||
const currentKey = ref(props.defaultKey);
|
||||
|
||||
const innerMenuList = computed(() => {
|
||||
return props.menuList.filter((item: any) => hasAnyPermission(item.permission));
|
||||
return props.menuList.filter((item: any) => hasAllPermission(item.permission));
|
||||
});
|
||||
|
||||
watch(
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<template v-for="(element, idx) in baseAction" :key="element.label">
|
||||
<a-divider v-if="element.isDivider" class="divider mx-0 my-[6px]" />
|
||||
<a-button
|
||||
v-if="!element.isDivider && !element.children && hasAnyPermission(element.permission as string[])"
|
||||
v-if="!element.isDivider && !element.children && hasAllPermission(element.permission as string[])"
|
||||
class="ml-[12px]"
|
||||
:class="{
|
||||
'arco-btn-outline--danger': element.danger,
|
||||
|
@ -16,7 +16,7 @@
|
|||
>
|
||||
<!-- baseAction多菜单选择 -->
|
||||
<a-dropdown
|
||||
v-if="!element.isDivider && element.children && hasAnyPermission(element.permission as string[])"
|
||||
v-if="!element.isDivider && element.children && hasAllPermission(element.permission as string[])"
|
||||
position="tr"
|
||||
@select="handleSelect"
|
||||
>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<template v-for="element in moreAction" :key="element.label">
|
||||
<a-divider v-if="element.isDivider" margin="4px" />
|
||||
<a-doption
|
||||
v-else-if="hasAnyPermission(element.permission as string[])"
|
||||
v-else-if="hasAllPermission(element.permission as string[])"
|
||||
:value="element"
|
||||
:class="{ delete: element.danger }"
|
||||
>
|
||||
|
@ -67,7 +67,7 @@
|
|||
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { getNodeWidth } from '@/utils/dom';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
import { hasAllPermission } from '@/utils/permission';
|
||||
|
||||
import { BatchActionConfig, BatchActionParams } from './type';
|
||||
import ResizeObserver from 'resize-observer-polyfill';
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import { BatchApiParams, TableQueryParams } from '@/models/common';
|
||||
|
||||
// 评审状态, PREPARED: 待开始, UNDERWAY: 进行中, COMPLETED: 已完成, ARCHIVED: 已归档
|
||||
export type ReviewStatus = 'PREPARED' | 'UNDERWAY' | 'COMPLETED' | 'ARCHIVED';
|
||||
// 评审结果,UN_REVIEWED:未评审,UNDER_REVIEWED:评审中,PASS:通过,UN_PASS:未通过,RE_REVIEWED:重新提审
|
||||
export type ReviewResult = 'UN_REVIEWED' | 'UNDER_REVIEWED' | 'PASS' | 'UN_PASS' | 'RE_REVIEWED';
|
||||
// 评审模块
|
||||
export interface ReviewModule {
|
||||
projectId: string;
|
||||
|
@ -50,6 +54,27 @@ export interface Review {
|
|||
export interface CopyReviewParams extends Omit<Review, 'baseAssociateCaseRequest'> {
|
||||
copyId: string;
|
||||
}
|
||||
// 复制评审响应内容
|
||||
export interface CopyReviewResponse {
|
||||
caseCount: number;
|
||||
createTime: number;
|
||||
createUser: string;
|
||||
description: string;
|
||||
endTime: number | null;
|
||||
id: string;
|
||||
moduleId: string;
|
||||
name: string;
|
||||
num: number;
|
||||
passRate: number;
|
||||
pos: number;
|
||||
projectId: string;
|
||||
reviewPassRule: ReviewPassRule;
|
||||
startTime: number | null;
|
||||
status: ReviewStatus;
|
||||
tags: null;
|
||||
updateTime: number;
|
||||
updateUser: string;
|
||||
}
|
||||
// 更新评审入参
|
||||
export interface UpdateReviewParams extends Omit<Review, 'baseAssociateCaseRequest'> {
|
||||
id: string;
|
||||
|
@ -81,10 +106,6 @@ export interface SortReviewParams {
|
|||
moveMode: ReviewMoveMode;
|
||||
moveId: string; // 被移动的评审id
|
||||
}
|
||||
// 评审状态, PREPARED: 待开始, UNDERWAY: 进行中, COMPLETED: 已完成, ARCHIVED: 已归档
|
||||
export type ReviewStatus = 'PREPARED' | 'UNDERWAY' | 'COMPLETED' | 'ARCHIVED';
|
||||
// 评审结果,UN_REVIEWED:未评审,UNDER_REVIEWED:评审中,PASS:通过,UN_PASS:未通过,RE_REVIEWED:重新提审
|
||||
export type ReviewResult = 'UN_REVIEWED' | 'UNDER_REVIEWED' | 'PASS' | 'UN_PASS' | 'RE_REVIEWED';
|
||||
// 评审列表查询参数
|
||||
export interface ReviewListQueryParams extends TableQueryParams {
|
||||
moduleIds: string[];
|
||||
|
|
|
@ -49,3 +49,14 @@ export interface MoveModules {
|
|||
dropNodeId: string; // 放入的节点
|
||||
dropPosition: number; // 放入的位置(取值:-1,,0,,1。 -1:dropNodeId节点之前。 0:dropNodeId节点内。 1:dropNodeId节点后)
|
||||
}
|
||||
// 模块树节点
|
||||
export interface ModuleTreeNode {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
children: ModuleTreeNode[];
|
||||
attachInfo: Record<string, any>; // 附加信息
|
||||
count: 0;
|
||||
parentId: string;
|
||||
path: string;
|
||||
}
|
||||
|
|
|
@ -85,13 +85,6 @@ export interface AddModuleParams {
|
|||
name: string;
|
||||
parentId: string;
|
||||
}
|
||||
// 模块树节点
|
||||
export interface ModuleTreeNode {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
children: ModuleTreeNode[];
|
||||
}
|
||||
// 文件历史列表项
|
||||
export interface FileHistoryItem {
|
||||
id: string;
|
||||
|
|
|
@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
|||
import { getCaseModulesCounts, getRecycleModulesCounts } from '@/api/modules/case-management/featureCase';
|
||||
|
||||
import type { CaseModuleQueryParams, TabItemType } from '@/models/caseManagement/featureCase';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const useFeatureCaseStore = defineStore('featureCase', {
|
||||
persist: true,
|
||||
|
|
|
@ -194,8 +194,9 @@ export interface TreeNode<T> {
|
|||
*/
|
||||
export function mapTree<T>(
|
||||
tree: TreeNode<T> | TreeNode<T>[] | T | T[],
|
||||
customNodeFn: (node: TreeNode<T>) => TreeNode<T> | null = (node) => node,
|
||||
customChildrenKey = 'children'
|
||||
customNodeFn: (node: TreeNode<T>, path: string) => TreeNode<T> | null = (node) => node,
|
||||
customChildrenKey = 'children',
|
||||
parentPath = ''
|
||||
): T[] {
|
||||
if (!Array.isArray(tree)) {
|
||||
tree = [tree];
|
||||
|
@ -203,7 +204,8 @@ export function mapTree<T>(
|
|||
|
||||
return tree
|
||||
.map((node: TreeNode<T>) => {
|
||||
const newNode = typeof customNodeFn === 'function' ? customNodeFn(node) : node;
|
||||
const fullPath = node.path ? `${parentPath}/${node.path}`.replace(/\/+/g, '/') : '';
|
||||
const newNode = typeof customNodeFn === 'function' ? customNodeFn(node, fullPath) : node;
|
||||
|
||||
if (newNode && newNode[customChildrenKey] && newNode[customChildrenKey].length > 0) {
|
||||
newNode[customChildrenKey] = mapTree(newNode[customChildrenKey], customNodeFn, customChildrenKey);
|
||||
|
|
|
@ -30,7 +30,10 @@ export function hasPermission(permission: string, typeList: string[]) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// 判断是否有权限
|
||||
/**
|
||||
* 判断是否有任一权限
|
||||
* @param permissions 权限列表
|
||||
*/
|
||||
export function hasAnyPermission(permissions: string[], typeList = ['PROJECT', 'ORGANIZATION', 'SYSTEM']) {
|
||||
if (!permissions || permissions.length === 0) {
|
||||
return true;
|
||||
|
@ -38,6 +41,17 @@ export function hasAnyPermission(permissions: string[], typeList = ['PROJECT', '
|
|||
return permissions.some((permission) => hasPermission(permission, typeList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有所有权限
|
||||
* @param permissions 权限列表
|
||||
*/
|
||||
export function hasAllPermission(permissions: string[], typeList = ['PROJECT', 'ORGANIZATION', 'SYSTEM']) {
|
||||
if (!permissions || permissions.length === 0) {
|
||||
return true;
|
||||
}
|
||||
return permissions.every((permission) => hasPermission(permission, typeList));
|
||||
}
|
||||
|
||||
function filterProject(role: UserRole, id: string) {
|
||||
return role && role.type === 'PROJECT' && (role.scopeId === id || role.scopeId === 'global');
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { registerCatchSaveShortcut, removeCatchSaveShortcut } from '@/utils/event';
|
||||
|
||||
import type { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { RequestBodyFormat, RequestComposition, RequestMethods, ResponseComposition } from '@/enums/apiEnum';
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
import useAppStore from '@/store/modules/app';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const props = defineProps<{
|
||||
modulesCount?: Record<string, number>; // 模块数量统计对象
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { parseCurlScript } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { RequestContentTypeEnum } from '@/enums/apiEnum';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
|
|
@ -304,7 +304,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { RequestImportFormat } from '@/enums/apiEnum';
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
import useAppStore from '@/store/modules/app';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
|
|
@ -54,11 +54,7 @@
|
|||
import management from './components/management/index.vue';
|
||||
import moduleTree from './components/moduleTree.vue';
|
||||
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
|
||||
const { t } = useI18n();
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const activeModule = ref<string>('all');
|
||||
const folderTree = ref<ModuleTreeNode[]>([]);
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
async function initProjects() {
|
||||
try {
|
||||
if (appStore.getCurrentOrgId && hasAnyPermission(['PROJECT_BASE_INFO:READ'])) {
|
||||
const res = await getProjectList(appStore.getCurrentOrgId);
|
||||
const res = await getProjectList(appStore.getCurrentOrgId); // TODO:
|
||||
} else {
|
||||
projectList.value = [];
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@
|
|||
import { hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import type { CustomAttributes, DetailCase, TabItemType } from '@/models/caseManagement/featureCase';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
|
||||
import { getCaseLevels } from './utils';
|
||||
|
|
|
@ -283,8 +283,7 @@
|
|||
DetailCase,
|
||||
StepList,
|
||||
} from '@/models/caseManagement/featureCase';
|
||||
import type { TableQueryParams } from '@/models/common';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import type { ModuleTreeNode, TableQueryParams } from '@/models/common';
|
||||
|
||||
import { convertToFile } from './utils';
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
import { mapTree } from '@/utils';
|
||||
|
||||
import type { CreateOrUpdateModule, UpdateModule } from '@/models/caseManagement/featureCase';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const featureCaseStore = useFeatureCaseStore();
|
||||
|
||||
|
|
|
@ -183,8 +183,7 @@
|
|||
CaseModuleQueryParams,
|
||||
CustomAttributes,
|
||||
} from '@/models/caseManagement/featureCase';
|
||||
import type { TableQueryParams } from '@/models/common';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import type { ModuleTreeNode, TableQueryParams } from '@/models/common';
|
||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||
|
||||
import { getCaseLevels, getReviewStatusClass, getStatusText, getTableFields } from './utils';
|
||||
|
|
|
@ -148,8 +148,7 @@
|
|||
import { mapTree } from '@/utils';
|
||||
|
||||
import type { CaseManagementTable, CaseModuleQueryParams } from '@/models/caseManagement/featureCase';
|
||||
import type { TableQueryParams } from '@/models/common';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import type { ModuleTreeNode, TableQueryParams } from '@/models/common';
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
|
||||
import { getCaseLevels } from '../../utils';
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
:filter-config-list="filterConfigList"
|
||||
:row-count="filterRowCount"
|
||||
:search-placeholder="t('caseManagement.caseReview.searchPlaceholder')"
|
||||
@keyword-search="() => searchCase()"
|
||||
@keyword-search="(val, filter) => searchCase(filter)"
|
||||
@adv-search="searchCase"
|
||||
@reset="searchCase"
|
||||
@refresh="searchCase"
|
||||
>
|
||||
<template #right>
|
||||
<div class="flex items-center">
|
||||
|
@ -273,8 +273,7 @@
|
|||
import useUserStore from '@/store/modules/user';
|
||||
|
||||
import { ReviewCaseItem, ReviewItem, ReviewPassRule, ReviewResult } from '@/models/caseManagement/caseReview';
|
||||
import { BatchApiParams } from '@/models/common';
|
||||
import type { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { BatchApiParams, ModuleTreeNode } from '@/models/common';
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const props = defineProps<{
|
||||
modulesCount?: Record<string, number>; // 模块数量统计对象
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
import useAppStore from '@/store/modules/app';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const props = defineProps<{
|
||||
isModal?: boolean; // 是否是弹窗模式
|
||||
|
@ -194,7 +194,13 @@
|
|||
try {
|
||||
loading.value = true;
|
||||
const res = await getReviewModules(appStore.currentProjectId);
|
||||
folderTree.value = mapTree<ModuleTreeNode>(res, (e) => {
|
||||
const nodePathObj: Record<string, any> = {};
|
||||
folderTree.value = mapTree<ModuleTreeNode>(res, (e, fullPath) => {
|
||||
// 拼接当前节点的完整路径
|
||||
nodePathObj[e.id] = {
|
||||
path: e.path,
|
||||
fullPath,
|
||||
};
|
||||
return {
|
||||
...e,
|
||||
hideMoreAction: e.id === 'root',
|
||||
|
@ -213,7 +219,7 @@
|
|||
|
||||
emit('folderNodeSelect', selectedKeys.value, offspringIds);
|
||||
}
|
||||
emit('init', folderTree.value);
|
||||
emit('init', folderTree.value, nodePathObj);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
:filter-config-list="filterConfigList"
|
||||
:row-count="filterRowCount"
|
||||
:search-placeholder="t('caseManagement.caseReview.searchPlaceholder')"
|
||||
@keyword-search="() => searchReview()"
|
||||
@keyword-search="(val, filter) => searchReview(filter)"
|
||||
@adv-search="searchReview"
|
||||
@reset="searchReview"
|
||||
@refresh="searchReview"
|
||||
>
|
||||
<template #left>
|
||||
<div class="flex items-center">
|
||||
|
@ -99,6 +99,11 @@
|
|||
{{ `${record.passRate}%` }}
|
||||
</div>
|
||||
</template>
|
||||
<template #moduleName="{ record }">
|
||||
<a-tooltip :content="record.fullModuleName">
|
||||
<div class="one-line-text">{{ record.moduleName }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<MsButton type="text" class="!mr-0" @click="() => editReview(record)">
|
||||
{{ t('common.edit') }}
|
||||
|
@ -185,13 +190,20 @@
|
|||
ReviewListQueryParams,
|
||||
ReviewStatus,
|
||||
} from '@/models/caseManagement/caseReview';
|
||||
import type { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||
|
||||
const props = defineProps<{
|
||||
activeFolder: string;
|
||||
moduleTree: ModuleTreeNode[];
|
||||
treePathMap: Record<
|
||||
string,
|
||||
{
|
||||
path: string;
|
||||
fullPath: string;
|
||||
}
|
||||
>;
|
||||
showType: string;
|
||||
offspringIds: string[];
|
||||
}>();
|
||||
|
@ -403,8 +415,9 @@
|
|||
},
|
||||
{
|
||||
title: 'caseManagement.caseReview.module',
|
||||
dataIndex: 'module',
|
||||
width: 90,
|
||||
dataIndex: 'moduleName',
|
||||
slotName: 'moduleName',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: 'caseManagement.caseReview.tag',
|
||||
|
@ -446,6 +459,8 @@
|
|||
...item,
|
||||
tags: (item.tags || []).map((e: string) => ({ id: e, name: e })),
|
||||
reviewers: item.reviewers.map((e: ReviewDetailReviewersItem) => e.userName),
|
||||
moduleName: props.treePathMap[item.moduleId].path,
|
||||
fullModuleName: props.treePathMap[item.moduleId].fullPath,
|
||||
cycle:
|
||||
item.startTime && item.endTime
|
||||
? `${dayjs(item.startTime).format('YYYY-MM-DD HH:mm:ss')} - ${dayjs(item.endTime).format(
|
||||
|
|
|
@ -291,7 +291,7 @@
|
|||
try {
|
||||
saveLoading.value = true;
|
||||
const { name, folderId, type, cycle, tags, desc, reviewers } = reviewForm.value;
|
||||
let res = '';
|
||||
let res: Record<string, any> = {};
|
||||
if (isCopy.value) {
|
||||
// 复制评审场景
|
||||
res = await copyReview({
|
||||
|
@ -326,7 +326,7 @@
|
|||
router.replace({
|
||||
name: CaseManagementRouteEnum.CASE_MANAGEMENT_REVIEW_DETAIL,
|
||||
query: {
|
||||
id: res,
|
||||
id: res.id,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
ReviewItem,
|
||||
ReviewStatus,
|
||||
} from '@/models/caseManagement/caseReview';
|
||||
import type { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
|
||||
const router = useRouter();
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<ReviewTable
|
||||
:active-folder="activeFolderId"
|
||||
:module-tree="moduleTree"
|
||||
:tree-path-map="moduleTreePathMap"
|
||||
:show-type="showType"
|
||||
:offspring-ids="offspringIds"
|
||||
@go-create="goCreateReview"
|
||||
|
@ -51,7 +52,7 @@
|
|||
import { useI18n } from '@/hooks/useI18n';
|
||||
|
||||
import { ReviewListQueryParams } from '@/models/caseManagement/caseReview';
|
||||
import type { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
|
||||
|
||||
const router = useRouter();
|
||||
|
@ -65,10 +66,12 @@
|
|||
const activeFolderId = ref<string>('all');
|
||||
const offspringIds = ref<string[]>([]);
|
||||
const moduleTree = ref<ModuleTreeNode[]>([]);
|
||||
const moduleTreePathMap = ref<Record<string, any>>({});
|
||||
const modulesCount = ref<Record<string, number>>({});
|
||||
|
||||
function initModuleTree(tree: ModuleTreeNode[]) {
|
||||
function initModuleTree(tree: ModuleTreeNode[], pathMap: Record<string, any>) {
|
||||
moduleTree.value = unref(tree);
|
||||
moduleTreePathMap.value = pathMap;
|
||||
}
|
||||
|
||||
function handleFolderNodeSelect(ids: string[], _offspringIds: string[]) {
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
import useAppStore from '@/store/modules/app';
|
||||
import { mapTree } from '@/utils';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const props = defineProps<{
|
||||
isExpandAll: boolean;
|
||||
|
|
|
@ -596,7 +596,11 @@
|
|||
{
|
||||
tableKey: TableKeyEnum.FILE_MANAGEMENT_FILE,
|
||||
showSetting: true,
|
||||
selectable: !!hasAnyPermission(['PROJECT_FILE_MANAGEMENT:READ+DOWNLOAD+UPDATE+DELETE']),
|
||||
selectable: !!hasAnyPermission([
|
||||
'PROJECT_FILE_MANAGEMENT:READ+DOWNLOAD',
|
||||
'PROJECT_FILE_MANAGEMENT:READ+UPDATE',
|
||||
'PROJECT_FILE_MANAGEMENT:READ+DELETE',
|
||||
]),
|
||||
showSelectAll: true,
|
||||
},
|
||||
(item) => {
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
{{ t('system.user.editUser') }}
|
||||
</MsButton>
|
||||
<MsTableMoreAction
|
||||
v-permission="['SYSTEM_USER:READ+UPDATE+DELETE']"
|
||||
v-permission="['SYSTEM_USER:READ+UPDATE', 'SYSTEM_USER:READ+DELETE']"
|
||||
:list="tableActions"
|
||||
@select="handleSelect($event, record)"
|
||||
></MsTableMoreAction>
|
||||
|
@ -378,7 +378,7 @@
|
|||
{
|
||||
tableKey: TableKeyEnum.SYSTEM_USER,
|
||||
columns,
|
||||
selectable: !!hasAnyPermission(['SYSTEM_USER:READ+ADD+UPDATE+DELETE']),
|
||||
selectable: !!hasAnyPermission(['SYSTEM_USER:READ+ADD', 'SYSTEM_USER:READ+UPDATE', 'SYSTEM_USER:READ+DELETE']),
|
||||
showSetting: true,
|
||||
showJumpMethod: true,
|
||||
heightUsed: 288,
|
||||
|
@ -582,17 +582,17 @@
|
|||
{
|
||||
label: 'system.user.batchActionAddProject',
|
||||
eventTag: 'batchAddProject',
|
||||
permission: ['SYSTEM_USER:READ+ADD', 'SYSTEM_ORGANIZATION_PROJECT:READ'],
|
||||
permission: ['SYSTEM_USER:READ+UPDATE', 'SYSTEM_ORGANIZATION_PROJECT:READ'],
|
||||
},
|
||||
{
|
||||
label: 'system.user.batchActionAddUserGroup',
|
||||
eventTag: 'batchAddUserGroup',
|
||||
permission: ['SYSTEM_USER:READ+ADD', 'SYSTEM_USER_ROLE:READ'],
|
||||
permission: ['SYSTEM_USER:READ+UPDATE', 'SYSTEM_USER_ROLE:READ'],
|
||||
},
|
||||
{
|
||||
label: 'system.user.batchActionAddOrganization',
|
||||
eventTag: 'batchAddOrganization',
|
||||
permission: ['SYSTEM_USER:READ+ADD', 'SYSTEM_ORGANIZATION_PROJECT:READ'],
|
||||
permission: ['SYSTEM_USER:READ+UPDATE', 'SYSTEM_ORGANIZATION_PROJECT:READ'],
|
||||
},
|
||||
],
|
||||
moreAction: [
|
||||
|
|
|
@ -93,9 +93,8 @@
|
|||
|
||||
import { reviewStatusMap } from '@/config/caseManagement';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import { useAppStore, useTableStore } from '@/store';
|
||||
import { useTableStore } from '@/store';
|
||||
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ColumnEditTypeEnum, TableKeyEnum } from '@/enums/tableEnum';
|
||||
|
||||
const tableStore = useTableStore();
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
import { mapTree } from '@/utils';
|
||||
|
||||
import type { CreateOrUpdateModule, UpdateModule } from '@/models/caseManagement/featureCase';
|
||||
import { ModuleTreeNode } from '@/models/projectManagement/file';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
|
||||
const { t } = useI18n();
|
||||
const { openModal } = useModal();
|
||||
|
|
Loading…
Reference in New Issue