diff --git a/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue b/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue
index 30c5452e82..1a3409eedc 100644
--- a/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue
+++ b/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue
@@ -11,57 +11,56 @@
:can-show-more-menu="canShowFloatMenu"
:can-show-enter-node="canShowEnterNode"
:can-show-more-menu-node-operation="false"
- :more-menu-other-operation-list="canShowEnterNode ? [] : moreMenuOtherOperationList"
+ :more-menu-other-operation-list="canShowFloatMenu ? moreMenuOtherOperationList : []"
disabled
@node-select="handleNodeSelect"
@before-exec-command="handleBeforeExecCommand"
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
();
const emit = defineEmits<{
- (e: 'operation', type: string, data: MinderJsonNodeData): void;
+ (e: 'operation', type: string, node: MinderJsonNode): void;
(e: 'handleReviewDone'): void;
}>();
@@ -519,16 +518,16 @@
const isReviewer = ref(false); // 是否是此用例的评审人
const caseReviewerList = ref([]);
const canShowEnterNode = ref(false);
- const showCaseMenu = ref(false);
+ const canShowDetail = ref(false);
const moreMenuOtherOperationList = ref();
- function setMoreMenuOtherOperationList(data: MinderJsonNodeData) {
+ function setMoreMenuOtherOperationList(node: MinderJsonNode) {
moreMenuOtherOperationList.value = [
{
value: 'changeReviewer',
label: t('caseManagement.caseReview.changeReviewer'),
permission: ['CASE_REVIEW:READ+UPDATE'],
onClick: () => {
- emit('operation', 'changeReviewer', data);
+ emit('operation', 'changeReviewer', node);
},
},
{
@@ -536,7 +535,7 @@
label: t('caseManagement.caseReview.reReview'),
permission: ['CASE_REVIEW:READ+UPDATE'],
onClick: () => {
- emit('operation', 'reReview', data);
+ emit('operation', 'reReview', node);
},
},
{
@@ -544,31 +543,16 @@
label: t('caseManagement.caseReview.disassociate'),
permission: ['CASE_REVIEW:READ+RELEVANCE'],
onClick: () => {
- emit('operation', 'disassociate', data);
+ emit('operation', 'disassociate', node);
},
},
];
}
- const selectCaseId = ref('');
+ const selectNode = ref();
const reviewVisible = ref(false);
- function handleReviewDone(status: ReviewResultStatus) {
+ function handleReviewDone() {
reviewVisible.value = false;
- let origin = window.minder.queryCommandValue('resource');
- if (origin[0] !== caseTag) {
- origin[0] = statusTagMap[status];
- } else {
- origin = [statusTagMap[status], ...origin];
- }
- window.minder.execCommand('resource', origin);
- minderStore.dispatchEvent(
- MinderEventName.SET_TAG,
- undefined,
- undefined,
- undefined,
- window.minder.getSelectedNodes()
- );
- setPriorityView(true, 'P');
emit('handleReviewDone');
}
@@ -594,27 +578,34 @@
setPriorityView(true, 'P');
return;
}
- // 展示浮动菜单: 模块节点有子节点且非根节点、用例节点
+ selectNode.value = node;
+
+ // 展示浮动菜单: 模块节点有子节点、用例节点
if (
node.data?.resource?.includes(caseTag) ||
- (node.data?.resource?.includes(moduleTag) && node.type !== 'root' && (node.children || []).length > 0)
+ (node.data?.resource?.includes(moduleTag) && (node.children || []).length > 0)
) {
canShowFloatMenu.value = true;
+ setMoreMenuOtherOperationList(node);
} else {
canShowFloatMenu.value = false;
}
// 展示进入节点菜单: 模块节点
- if (data?.resource?.includes(moduleTag)) {
+ if (data?.resource?.includes(moduleTag) && (node.children || []).length > 0 && node.type !== 'root') {
canShowEnterNode.value = true;
} else {
canShowEnterNode.value = false;
}
+ if (data?.resource?.includes(moduleTag) && (node.children || []).length > 0) {
+ isReviewer.value = true;
+ } else {
+ isReviewer.value = false;
+ }
+
if (data?.resource?.includes(caseTag)) {
- showCaseMenu.value = true;
- selectCaseId.value = node.data?.caseId ?? '';
- setMoreMenuOtherOperationList(node.data as MinderJsonNodeData);
+ canShowDetail.value = true;
setIsReviewer(node.data);
if (extraVisible.value) {
toggleDetail(true);
@@ -622,11 +613,11 @@
} else if (data?.resource?.includes(moduleTag) && data.count > 0 && data.isLoaded !== true) {
// 模块节点且有用例且未加载过用例数据
await initNodeCases(node);
- showCaseMenu.value = false;
extraVisible.value = false;
+ canShowDetail.value = false;
} else {
- showCaseMenu.value = false;
extraVisible.value = false;
+ canShowDetail.value = false;
resetExtractInfo();
removeFakeNode(node, 'fakeNode');
}
diff --git a/frontend/src/components/business/ms-minders/caseReviewMinder/utils.ts b/frontend/src/components/business/ms-minders/caseReviewMinder/utils.ts
new file mode 100644
index 0000000000..00ade35bc1
--- /dev/null
+++ b/frontend/src/components/business/ms-minders/caseReviewMinder/utils.ts
@@ -0,0 +1,37 @@
+import type { MinderJsonNode } from '@/components/pure/ms-minder-editor/props';
+
+import { useI18n } from '@/hooks/useI18n';
+import { mapTree } from '@/utils';
+
+const { t } = useI18n();
+
+export function getMinderOffspringIds(node: MinderJsonNode) {
+ const offspringIds: string[] = [];
+ mapTree(node.children || [], (e) => {
+ if (e.data.resource?.includes(t('common.module')) && e.data.id !== 'fakeNode') {
+ offspringIds.push(e.data.id);
+ }
+ return e;
+ });
+ return offspringIds;
+}
+
+/**
+ * 获取脑图操作的参数
+ * @param node 选中节点
+ */
+export function getMinderOperationParams(node: MinderJsonNode) {
+ if (node.data?.resource?.includes(t('common.module'))) {
+ return {
+ selectIds: [],
+ selectAll: true,
+ condition: {},
+ moduleIds: node.data?.id === 'NONE' ? [] : [node.data?.id, ...getMinderOffspringIds(node)],
+ };
+ }
+ return {
+ selectIds: [node.data?.caseId],
+ selectAll: false,
+ condition: {},
+ };
+}
diff --git a/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue b/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue
index 435f031c31..edc197a32b 100644
--- a/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue
+++ b/frontend/src/views/case-management/caseReview/components/detail/caseTable.vue
@@ -143,7 +143,7 @@
:review-progress="props.reviewProgress"
:review-pass-rule="props.reviewPassRule"
@operation="handleMinderOperation"
- @handle-review-done="emitRefresh"
+ @handle-review-done="handleReviewDone"
/>
(); // 当前脑图选中的数据
+ const minderParams = ref();
const keyword = ref('');
const filterRowCount = ref(0);
const filterConfigList = ref([]);
@@ -725,11 +727,7 @@
...batchParams.value,
...tableParams.value,
}
- : {
- selectIds: [minderSelectData.value.id],
- selectAll: false,
- condition: {},
- }),
+ : minderParams.value),
});
Message.success(t('common.updateSuccess'));
dialogLoading.value = false;
@@ -786,11 +784,7 @@
...batchParams.value,
...tableParams.value,
}
- : {
- selectIds: [minderSelectData.value.id],
- selectAll: false,
- condition: {},
- }),
+ : minderParams.value),
});
Message.success(t('common.updateSuccess'));
dialogVisible.value = false;
@@ -822,11 +816,7 @@
...tableParams.value,
selectIds: batchParams.value.selectIds.length > 0 ? batchParams.value.selectIds : [record.id],
}
- : {
- selectIds: [minderSelectData.value.id],
- selectAll: false,
- condition: {},
- }),
+ : minderParams.value),
});
Message.success(t('common.updateSuccess'));
dialogVisible.value = false;
@@ -927,11 +917,17 @@
}
// 脑图操作
- function handleMinderOperation(type: string, data: MinderJsonNodeData) {
- minderSelectData.value = data;
+ function handleMinderOperation(type: string, node: MinderJsonNode) {
+ minderSelectData.value = node.data;
+ minderParams.value = getMinderOperationParams(node);
handleOperation(type);
}
+ function handleReviewDone() {
+ refresh(false);
+ emitRefresh();
+ }
+
/**
* 处理表格选中后批量操作
* @param event 批量操作事件对象
diff --git a/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue b/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue
index c26dda8c93..8c7943d989 100644
--- a/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue
+++ b/frontend/src/views/case-management/caseReview/components/reviewSubmit.vue
@@ -34,23 +34,31 @@
import { useEventListener } from '@vueuse/core';
import { Message } from '@arco-design/web-vue';
+ import type { MinderJsonNode } from '@/components/pure/ms-minder-editor/props';
+ import { getMinderOperationParams } from '@/components/business/ms-minders/caseReviewMinder/utils';
import ReviewForm from './reviewFormRichText.vue';
- import { saveCaseReviewResult } from '@/api/modules/case-management/caseReview';
+ import { batchReview } from '@/api/modules/case-management/caseReview';
import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app';
- import { ReviewFormParams, ReviewPassRule, ReviewResult } from '@/models/caseManagement/caseReview';
+ import {
+ BatchReviewCaseParams,
+ ReviewFormParams,
+ ReviewPassRule,
+ ReviewResult,
+ } from '@/models/caseManagement/caseReview';
import { StartReviewStatus } from '@/enums/caseEnum';
const props = defineProps<{
- caseId: string;
+ selectNode: MinderJsonNode;
reviewPassRule: ReviewPassRule;
reviewId: string;
+ userId: string;
}>();
const emit = defineEmits<{
- (e: 'done', status: ReviewResult): void;
+ (e: 'done'): void;
}>();
const { t } = useI18n();
@@ -84,7 +92,7 @@
});
watch(
- () => props.caseId,
+ () => props.selectNode.data?.caseId,
() => {
form.value = { ...defaultForm };
}
@@ -94,18 +102,19 @@
async function submit() {
try {
submitLoading.value = true;
- const params = {
+ const params: BatchReviewCaseParams = {
projectId: appStore.currentProjectId,
- caseId: props.caseId,
+ userId: props.userId,
reviewId: props.reviewId,
reviewPassRule: props.reviewPassRule,
...form.value,
notifier: form.value.notifiers?.join(';') ?? '',
+ ...getMinderOperationParams(props.selectNode),
};
- await saveCaseReviewResult(params);
+ await batchReview(params);
modalVisible.value = false;
Message.success(t('caseManagement.caseReview.reviewSuccess'));
- emit('done', form.value.status);
+ emit('done');
} catch (error) {
// eslint-disable-next-line no-console
console.log(error);