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