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,
GetReviewModulesUrl,
GetReviewUsersUrl,
MinderReviewCaseUrl,
MoveReviewModuleUrl,
MoveReviewUrl,
ReviewModuleCountUrl,
@ -49,6 +50,7 @@ import {
CopyReviewParams,
CopyReviewResponse,
FollowReviewParams,
MinderReviewCaseParams,
Review,
ReviewCaseItem,
ReviewDetailCaseListQueryParams,
@ -225,3 +227,8 @@ export function getCasePlanMinder(data: CasePlanMinderParams) {
export const getReviewerAndStatus = (reviewId: string, caseId: string) => {
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 SortReviewDetailCaseUrl = '/case/review/detail/edit/pos'; // 评审详情-已关联用例拖拽排序
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 BatchDisassociateReviewCaseUrl = '/case/review/detail/batch/disassociate'; // 评审详情-批量取消关联用例
export const GetAssociatedIdsUrl = '/case/review/detail/get-ids'; // 获取已关联用例id集合

View File

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

View File

@ -556,19 +556,25 @@
}
// /
function handleExecuteDone(status: LastExecuteResults, content: string) {
const node = window.minder.getSelectedNode();
executeVisible.value = false;
const resource = selectNode.value.data?.resource;
const resource = node.data?.resource;
if (resource?.includes(caseTag)) {
//
window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]);
//
updateCaseActualResultNode(selectNode.value, content);
updateCaseActualResultNode(node, content);
//
if (extraVisible.value && activeExtraKey.value === 'history') {
initExecuteHistory(selectNode.value.data);
initExecuteHistory(node.data);
}
} 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');
}

View File

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

View File

@ -40,7 +40,7 @@
import { getMinderOperationParams } from '@/components/business/ms-minders/caseReviewMinder/utils';
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 useAppStore from '@/store/modules/app';
@ -110,19 +110,30 @@
async function submit() {
try {
submitLoading.value = true;
const params: BatchReviewCaseParams = {
projectId: appStore.currentProjectId,
const params = {
userId: props.userId,
reviewId: props.reviewId,
reviewPassRule: props.reviewPassRule,
...submitForm.value,
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;
Message.success(t('caseManagement.caseReview.reviewSuccess'));
emit('done', params.status);
emit('done', isMinderCase ? minderCaseStatus : params.status);
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);