style(脑图): 评审或执行用例不刷新整个脑图
This commit is contained in:
parent
66a9832e1d
commit
6ffc936be2
|
@ -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 });
|
||||
};
|
||||
|
|
|
@ -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集合
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue