style(脑图): 评审或执行用例不刷新整个脑图

This commit is contained in:
teukkk 2024-08-19 18:52:03 +08:00 committed by Craftsman
parent 66a9832e1d
commit 6ffc936be2
6 changed files with 53 additions and 21 deletions

View File

@ -27,6 +27,7 @@ import {
GetReviewListUrl, GetReviewListUrl,
GetReviewModulesUrl, GetReviewModulesUrl,
GetReviewUsersUrl, GetReviewUsersUrl,
MinderReviewCaseUrl,
MoveReviewModuleUrl, MoveReviewModuleUrl,
MoveReviewUrl, MoveReviewUrl,
ReviewModuleCountUrl, ReviewModuleCountUrl,
@ -49,6 +50,7 @@ import {
CopyReviewParams, CopyReviewParams,
CopyReviewResponse, CopyReviewResponse,
FollowReviewParams, FollowReviewParams,
MinderReviewCaseParams,
Review, Review,
ReviewCaseItem, ReviewCaseItem,
ReviewDetailCaseListQueryParams, ReviewDetailCaseListQueryParams,
@ -225,3 +227,8 @@ export function getCasePlanMinder(data: CasePlanMinderParams) {
export const getReviewerAndStatus = (reviewId: string, caseId: string) => { export const getReviewerAndStatus = (reviewId: string, caseId: string) => {
return MSR.get<ReviewerAndStatus>({ url: `${GetReviewerAndStatusUrl}/${reviewId}/${caseId}` }); return MSR.get<ReviewerAndStatus>({ url: `${GetReviewerAndStatusUrl}/${reviewId}/${caseId}` });
}; };
// 评审详情-脑图评审用例
export const minderReviewCase = (data: MinderReviewCaseParams) => {
return MSR.post({ url: MinderReviewCaseUrl, data });
};

View File

@ -19,6 +19,7 @@ export const ReviewModuleCountUrl = '/case/review/module/count'; // 模块下用
export const GetReviewDetailCasePageUrl = '/case/review/detail/page'; // 评审详情-获取已关联用例列表 export const GetReviewDetailCasePageUrl = '/case/review/detail/page'; // 评审详情-获取已关联用例列表
export const SortReviewDetailCaseUrl = '/case/review/detail/edit/pos'; // 评审详情-已关联用例拖拽排序 export const SortReviewDetailCaseUrl = '/case/review/detail/edit/pos'; // 评审详情-已关联用例拖拽排序
export const BatchReviewUrl = '/case/review/detail/batch/review'; // 评审详情-批量评审 export const BatchReviewUrl = '/case/review/detail/batch/review'; // 评审详情-批量评审
export const MinderReviewCaseUrl = '/case/review/detail/mind/multiple/review'; // 评审详情-脑图评审用例
export const BatchChangeReviewerUrl = '/case/review/detail/batch/edit/reviewers'; // 评审详情-批量修改评审人 export const BatchChangeReviewerUrl = '/case/review/detail/batch/edit/reviewers'; // 评审详情-批量修改评审人
export const BatchDisassociateReviewCaseUrl = '/case/review/detail/batch/disassociate'; // 评审详情-批量取消关联用例 export const BatchDisassociateReviewCaseUrl = '/case/review/detail/batch/disassociate'; // 评审详情-批量取消关联用例
export const GetAssociatedIdsUrl = '/case/review/detail/get-ids'; // 获取已关联用例id集合 export const GetAssociatedIdsUrl = '/case/review/detail/get-ids'; // 获取已关联用例id集合

View File

@ -43,7 +43,7 @@
<ReviewSubmit <ReviewSubmit
:review-pass-rule="reviewPassRule" :review-pass-rule="reviewPassRule"
:select-node="selectNode" :select-node="selectNode"
:user-id="props.viewFlag ? userStore.id || '' : ''" :user-id="props.viewStatusFlag ? userStore.id || '' : ''"
:review-id="route.query.id as string" :review-id="route.query.id as string"
@done="handleReviewDone" @done="handleReviewDone"
/> />
@ -137,6 +137,7 @@
CaseReviewFunctionalCaseUserItem, CaseReviewFunctionalCaseUserItem,
ReviewHistoryItem, ReviewHistoryItem,
ReviewPassRule, ReviewPassRule,
ReviewResult,
} from '@/models/caseManagement/caseReview'; } from '@/models/caseManagement/caseReview';
import { ModuleTreeNode } from '@/models/common'; import { ModuleTreeNode } from '@/models/common';
import { StartReviewStatus } from '@/enums/caseEnum'; import { StartReviewStatus } from '@/enums/caseEnum';
@ -477,17 +478,18 @@
const selectNode = ref(); const selectNode = ref();
const reviewVisible = ref(false); const reviewVisible = ref(false);
function handleReviewDone(status: StartReviewStatus) { function handleReviewDone(status: StartReviewStatus | ReviewResult) {
const node = window.minder.getSelectedNode();
reviewVisible.value = false; reviewVisible.value = false;
if ( if (status !== 'UN_REVIEWED' && node.data?.resource?.includes(caseTag)) {
props.reviewPassRule !== 'MULTIPLE' &&
status !== StartReviewStatus.UNDER_REVIEWED &&
selectNode.value.data?.resource?.includes(caseTag)
) {
window.minder.execCommand('resource', [statusTagMap[status], caseTag]); window.minder.execCommand('resource', [statusTagMap[status], caseTag]);
} else { } else if (status !== StartReviewStatus.UNDER_REVIEWED && node.data?.resource?.includes(moduleTag)) {
if (status === StartReviewStatus.UNDER_REVIEWED) return; //
initCaseTree(); for (let i = node.children.length - 1; i >= 0; i--) {
window.minder.removeNode(node.children[i]);
}
//
initNodeCases(node);
} }
emit('handleReviewDone'); emit('handleReviewDone');
} }

View File

@ -556,19 +556,25 @@
} }
// / // /
function handleExecuteDone(status: LastExecuteResults, content: string) { function handleExecuteDone(status: LastExecuteResults, content: string) {
const node = window.minder.getSelectedNode();
executeVisible.value = false; executeVisible.value = false;
const resource = selectNode.value.data?.resource; const resource = node.data?.resource;
if (resource?.includes(caseTag)) { if (resource?.includes(caseTag)) {
// //
window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]); window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]);
// //
updateCaseActualResultNode(selectNode.value, content); updateCaseActualResultNode(node, content);
// //
if (extraVisible.value && activeExtraKey.value === 'history') { if (extraVisible.value && activeExtraKey.value === 'history') {
initExecuteHistory(selectNode.value.data); initExecuteHistory(node.data);
} }
} else if (resource?.includes(moduleTag)) { } else if (resource?.includes(moduleTag)) {
initCaseTree(); //
for (let i = node.children.length - 1; i >= 0; i--) {
window.minder.removeNode(node.children[i]);
}
//
initNodeCases(node);
} }
emit('refreshPlan'); emit('refreshPlan');
} }

View File

@ -235,6 +235,11 @@ export interface CommitReviewResultParams extends ReviewFormParams {
reviewPassRule: ReviewPassRule; reviewPassRule: ReviewPassRule;
notifier: string; notifier: string;
} }
export interface MinderReviewCaseParams extends ReviewFormParams {
reviewId: string;
caseId: string;
userId?: string;
}
// 评审详情-获取用例评审历史 // 评审详情-获取用例评审历史
export interface ReviewHistoryItem { export interface ReviewHistoryItem {
id: string; id: string;

View File

@ -40,7 +40,7 @@
import { getMinderOperationParams } from '@/components/business/ms-minders/caseReviewMinder/utils'; import { getMinderOperationParams } from '@/components/business/ms-minders/caseReviewMinder/utils';
import ReviewForm from './reviewFormRichText.vue'; import ReviewForm from './reviewFormRichText.vue';
import { batchReview } from '@/api/modules/case-management/caseReview'; import { batchReview, minderReviewCase } from '@/api/modules/case-management/caseReview';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
@ -110,19 +110,30 @@
async function submit() { async function submit() {
try { try {
submitLoading.value = true; submitLoading.value = true;
const params: BatchReviewCaseParams = { const params = {
projectId: appStore.currentProjectId,
userId: props.userId, userId: props.userId,
reviewId: props.reviewId, reviewId: props.reviewId,
reviewPassRule: props.reviewPassRule,
...submitForm.value, ...submitForm.value,
notifier: submitForm.value.notifiers?.join(';') ?? '', notifier: submitForm.value.notifiers?.join(';') ?? '',
...getMinderOperationParams(props.selectNode),
}; };
await batchReview(params); let minderCaseStatus;
const isMinderCase = props.selectNode && props.selectNode.data?.resource?.includes(t('common.case'));
if (isMinderCase) {
minderCaseStatus = await minderReviewCase({
...params,
caseId: props.selectNode.data?.caseId as string,
});
} else {
await batchReview({
...params,
projectId: appStore.currentProjectId,
reviewPassRule: props.reviewPassRule,
...getMinderOperationParams(props.selectNode),
} as BatchReviewCaseParams);
}
modalVisible.value = false; modalVisible.value = false;
Message.success(t('caseManagement.caseReview.reviewSuccess')); Message.success(t('caseManagement.caseReview.reviewSuccess'));
emit('done', params.status); emit('done', isMinderCase ? minderCaseStatus : params.status);
} catch (error) { } catch (error) {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log(error); console.log(error);