fix(功能用例): 评审脑图-重新评审和单人评审下评审用例只更新状态标签&取消选中时关闭详情
This commit is contained in:
parent
56686a2bad
commit
02b93ec4f3
|
@ -15,6 +15,7 @@
|
|||
:more-menu-other-operation-list="canShowFloatMenu ? moreMenuOtherOperationList : []"
|
||||
disabled
|
||||
@node-select="handleNodeSelect"
|
||||
@node-unselect="handleNodeUnselect"
|
||||
>
|
||||
<template #extractMenu>
|
||||
<!-- 评审 查看详情 -->
|
||||
|
@ -159,6 +160,7 @@
|
|||
ReviewResult as ReviewResultStatus,
|
||||
} from '@/models/caseManagement/caseReview';
|
||||
import { ModuleTreeNode } from '@/models/common';
|
||||
import { StartReviewStatus } from '@/enums/caseEnum';
|
||||
import { MinderEventName, MinderKeyEnum } from '@/enums/minderEnum';
|
||||
|
||||
import { convertToFile, getCustomField } from '@/views/case-management/caseManagementFeature/components/utils';
|
||||
|
@ -174,7 +176,7 @@
|
|||
|
||||
const emit = defineEmits<{
|
||||
(e: 'operation', type: string, node: MinderJsonNode): void;
|
||||
(e: 'handleReviewDone'): void;
|
||||
(e: 'handleReviewDone', refreshTree?: boolean): void;
|
||||
}>();
|
||||
|
||||
const route = useRoute();
|
||||
|
@ -550,9 +552,38 @@
|
|||
|
||||
const selectNode = ref();
|
||||
const reviewVisible = ref(false);
|
||||
function handleReviewDone() {
|
||||
function handleReviewDone(status: StartReviewStatus) {
|
||||
reviewVisible.value = false;
|
||||
emit('handleReviewDone');
|
||||
if (
|
||||
props.reviewPassRule !== 'MULTIPLE' &&
|
||||
status !== StartReviewStatus.UNDER_REVIEWED &&
|
||||
selectNode.value.data?.resource?.includes(caseTag)
|
||||
) {
|
||||
window.minder.execCommand('resource', [statusTagMap[status], caseTag]);
|
||||
emit('handleReviewDone');
|
||||
} else {
|
||||
emit('handleReviewDone', true);
|
||||
}
|
||||
}
|
||||
|
||||
// 递归更新子节点的用例标签
|
||||
function updateChildResources(status: string, node?: MinderJsonNode) {
|
||||
node?.children?.forEach((child: MinderJsonNode) => {
|
||||
if (child.data?.resource?.includes(caseTag)) {
|
||||
child.setData('resource', [statusTagMap[status], caseTag]).render();
|
||||
} else if (child.data?.resource?.includes(moduleTag)) {
|
||||
updateChildResources(status, child);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 更新状态标签
|
||||
function updateResource(status: string) {
|
||||
if (selectNode.value.data?.resource?.includes(moduleTag)) {
|
||||
updateChildResources(status, selectNode.value);
|
||||
} else if (selectNode.value.data?.resource?.includes(caseTag)) {
|
||||
window.minder.execCommand('resource', [statusTagMap[status], caseTag]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -634,8 +665,13 @@
|
|||
setPriorityView(true, 'P');
|
||||
}
|
||||
|
||||
function handleNodeUnselect() {
|
||||
extraVisible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
initCaseTree,
|
||||
updateResource,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { OptionItem } from '@/api/modules/message/index';
|
||||
|
||||
import { BatchApiParams, TableQueryParams } from '@/models/common';
|
||||
import { StartReviewStatus } from '@/enums/caseEnum';
|
||||
|
||||
// 评审状态, PREPARED: 待开始, UNDERWAY: 进行中, COMPLETED: 已完成, ARCHIVED: 已归档(暂时没有)
|
||||
export type ReviewStatus = 'PREPARED' | 'UNDERWAY' | 'COMPLETED';
|
||||
|
@ -221,7 +222,7 @@ export interface ReviewCaseItem {
|
|||
}
|
||||
// 评审详情-提交评审入参
|
||||
export interface ReviewFormParams {
|
||||
status: ReviewResult;
|
||||
status: StartReviewStatus;
|
||||
content: string;
|
||||
notifiers?: string[];
|
||||
reviewCommentFileIds?: string[];
|
||||
|
|
|
@ -840,7 +840,12 @@
|
|||
});
|
||||
Message.success(t('common.updateSuccess'));
|
||||
dialogVisible.value = false;
|
||||
refresh(false);
|
||||
if (showType.value === 'list') {
|
||||
resetSelector();
|
||||
loadList();
|
||||
} else {
|
||||
msCaseReviewMinderRef.value?.updateResource('RE_REVIEWED');
|
||||
}
|
||||
emit('refresh');
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
@ -976,8 +981,10 @@
|
|||
handleOperation(type);
|
||||
}
|
||||
|
||||
function handleReviewDone() {
|
||||
refresh(false);
|
||||
function handleReviewDone(refreshTree?: boolean) {
|
||||
if (refreshTree) {
|
||||
refresh(false);
|
||||
}
|
||||
emit('refresh');
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,8 @@
|
|||
import useAppStore from '@/store/modules/app';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import { CaseReviewFunctionalCaseUserItem, ReviewPassRule, ReviewResult } from '@/models/caseManagement/caseReview';
|
||||
import { CaseReviewFunctionalCaseUserItem, ReviewPassRule } from '@/models/caseManagement/caseReview';
|
||||
import { StartReviewStatus } from '@/enums/caseEnum';
|
||||
|
||||
const props = defineProps<{
|
||||
reviewId: string;
|
||||
|
@ -113,7 +114,7 @@
|
|||
const dialogFormRef = ref<FormInstance>();
|
||||
const caseReviewerList = ref<CaseReviewFunctionalCaseUserItem[]>([]);
|
||||
const caseResultForm = ref({
|
||||
result: 'PASS' as ReviewResult,
|
||||
result: StartReviewStatus.PASS,
|
||||
reason: '',
|
||||
fileList: [] as string[],
|
||||
commentIds: [] as string[],
|
||||
|
@ -121,7 +122,7 @@
|
|||
const submitReviewLoading = ref(false);
|
||||
const submitDisabled = computed(
|
||||
() =>
|
||||
caseResultForm.value.result !== 'PASS' &&
|
||||
caseResultForm.value.result !== StartReviewStatus.PASS &&
|
||||
(caseResultForm.value.reason === '' || caseResultForm.value.reason.trim() === '<p style=""></p>')
|
||||
);
|
||||
const modalVisible = ref(false);
|
||||
|
@ -169,7 +170,7 @@
|
|||
}
|
||||
|
||||
caseResultForm.value = {
|
||||
result: 'PASS' as ReviewResult,
|
||||
result: StartReviewStatus.PASS,
|
||||
reason: '',
|
||||
fileList: [] as string[],
|
||||
commentIds: [] as string[],
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'done', status: StartReviewStatus): void;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -109,7 +109,7 @@
|
|||
await batchReview(params);
|
||||
modalVisible.value = false;
|
||||
Message.success(t('caseManagement.caseReview.reviewSuccess'));
|
||||
emit('done');
|
||||
emit('done', form.value.status);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
|
Loading…
Reference in New Issue