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